fix config loading
All checks were successful
Publish Docker Image / docker (push) Successful in 2m2s

This commit is contained in:
Lee 2023-07-13 10:39:37 +01:00
parent 5336a89dcc
commit 6ad1b6b85d
6 changed files with 25 additions and 21 deletions

26
package-lock.json generated
View File

@ -2828,6 +2828,19 @@
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/js-yaml-loader/node_modules/loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dependencies": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
@ -2901,19 +2914,6 @@
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="
},
"node_modules/loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dependencies": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/locate-path": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",

View File

@ -1,10 +1,11 @@
"use client";
import { Config } from "@/src/types/config";
import Image from "next/image";
import { Fragment } from "react";
import { useLanyardWS } from "use-lanyard";
import Config from "../../../config.yml";
const Config: Config = require("../../../config.yml") as any;
function LanyardWrapper(props: { children: any }) {
return <Fragment>{props.children}</Fragment>;

View File

@ -1,9 +1,10 @@
import { Config } from "@/src/types/config";
import { config } from "@fortawesome/fontawesome-svg-core";
import "@fortawesome/fontawesome-svg-core/styles.css";
import { Inter } from "next/font/google";
import "./globals.css";
import Config from "../../config.yml";
const Config: Config = require("../../config.yml") as any;
config.autoAddCss = false;
const inter = Inter({ subsets: ["latin"] });

View File

@ -1,12 +1,14 @@
import { Config } from "@/src/types/config";
import { library } from "@fortawesome/fontawesome-svg-core";
import { fab } from "@fortawesome/free-brands-svg-icons";
import { far } from "@fortawesome/free-regular-svg-icons";
import { fas } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import Image from "next/image";
import Config from "../../config.yml";
import Avatar from "./components/Avatar";
const Config: Config = require("../../config.yml") as any;
library.add(fab, far, fas); // Loading in the icons from FontAwesome
export default function Home() {

View File

@ -1,5 +1,3 @@
import { YAMLMap } from "js-yaml";
export interface Config {
configVersion: string;
name: string;
@ -52,6 +50,6 @@ export interface Config {
// Parse the YAML content and convert it to the defined type
declare module "*.yml" {
const content: YAMLMap & Config;
const content: any;
export default content;
}

View File

@ -21,11 +21,13 @@
],
"paths": {
"@/*": ["./*"]
}
},
"typeRoots": ["./src/types", "./node_modules/@types"],
"types": ["node"]
},
"include": [
"next-env.d.ts",
"src/types/*.d.ts",
"src/types/**/*.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"