From 895b2f63c828079c27cb32206366a03dc8f75467 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 18 Apr 2024 07:32:21 +0100 Subject: [PATCH] cleanup config path --- src/app/(pages)/player/[[...id]]/page.tsx | 2 +- .../server/[platform]/[[...hostname]]/page.tsx | 2 +- src/app/layout.tsx | 16 ++++++++-------- tsconfig.json | 3 ++- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/app/(pages)/player/[[...id]]/page.tsx b/src/app/(pages)/player/[[...id]]/page.tsx index e1a9f9b..eb1c25b 100644 --- a/src/app/(pages)/player/[[...id]]/page.tsx +++ b/src/app/(pages)/player/[[...id]]/page.tsx @@ -7,10 +7,10 @@ import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } import { Colors } from "@/common/colors"; import { generateEmbed } from "@/common/embed"; import { isValidPlayer } from "@/common/player"; +import config from "@root/config.json"; import { CachedPlayer, McUtilsAPIError, getPlayer } from "mcutils-library"; import { Metadata, Viewport } from "next"; import { ReactElement } from "react"; -import config from "../../../../../config.json"; type Params = { params: { diff --git a/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx b/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx index 1cbf39e..3abba91 100644 --- a/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx +++ b/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx @@ -7,6 +7,7 @@ import { Colors } from "@/common/colors"; import { generateEmbed } from "@/common/embed"; import { isValidServer } from "@/common/server"; import { capitalizeFirstLetter } from "@/common/string-utils"; +import config from "@root/config.json"; import { CachedBedrockMinecraftServer, CachedJavaMinecraftServer, @@ -16,7 +17,6 @@ import { } from "mcutils-library"; import { Metadata, Viewport } from "next"; import { ReactElement } from "react"; -import config from "../../../../../../config.json"; type Params = { params: { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3a30fe8..29d0f6f 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -3,9 +3,9 @@ import { Metadata, Viewport } from "next"; import "./globals.css"; +import config from "@root/config.json"; import Script from "next/script"; import { ReactElement } from "react"; -import Config from "../../config.json"; import Container from "./components/container"; import ThemeProvider from "./components/theme-provider"; import { Toaster } from "./components/ui/toaster"; @@ -16,17 +16,17 @@ export const viewport: Viewport = { }; export const metadata: Metadata = { - metadataBase: new URL(Config.siteUrl), + metadataBase: new URL(config.siteUrl), title: { - template: Config.siteName + " - %s", - default: Config.siteName, + template: config.siteName + " - %s", + default: config.siteName, }, - description: Config.siteDescription, + description: config.siteDescription, keywords: "Minecraft, APIs, wrapper, utility, development", openGraph: { - title: Config.siteName, - description: Config.siteDescription, - url: Config.siteUrl, + title: config.siteName, + description: config.siteDescription, + url: config.siteUrl, locale: "en_US", type: "website", images: [ diff --git a/tsconfig.json b/tsconfig.json index 7b28589..d9c9af8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,8 @@ } ], "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "@root/*": ["./*"] } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],