From d4b7e323078e20e36734f1389ceef5ab4d2e26a0 Mon Sep 17 00:00:00 2001 From: rpdeshaies Date: Mon, 11 Sep 2023 15:29:24 -0400 Subject: [PATCH] fix: build + lint + progress for liveblocks --- .github/workflows/ci.yml | 4 +- .vscode/extensions.json | 1 - app/bugs/page.tsx | 20 ++++ app/data/page.tsx | 4 +- app/i18n.tsx | 4 + app/layout.tsx | 8 +- app/oracle/page.tsx | 13 +++ app/play-offline/page.tsx | 13 +++ app/play/(components)/play.tsx | 56 +++++++++++ app/play/[id]/page.tsx | 13 +++ app/play/join/[id]/page.tsx | 13 +++ app/play/page.tsx | 5 + bun.lockb | Bin 896507 -> 896507 bytes lib/App.tsx | 44 +++++---- lib/components/MyBinder/MyBinder.tsx | 2 +- lib/components/NoSSR/NoSSR.tsx | 10 ++ lib/components/Page/Page.tsx | 9 +- lib/constants/env.ts | 8 +- .../AppI18nContext/AppI18nContext.tsx | 79 +++++++++++++++ lib/domains/character/CharacterType.tsx | 8 +- lib/hooks/useQuery/useQuery.ts | 11 +-- lib/hooks/useTranslate/useTranslate.ts | 12 ++- lib/index.tsx | 14 --- lib/routes/Bugs/BugsRoute.tsx | 5 - lib/routes/Oracle/OracleRoute.tsx | 6 +- lib/routes/Play/JoinAGameRoute.tsx | 14 +-- lib/routes/Play/PlayOfflineRoute.tsx | 16 +--- lib/routes/Play/PlayRoute.tsx | 90 +++++++++--------- .../Play/components/Session/Session.tsx | 2 + lib/services/injections.ts | 3 - .../InternationalizationService.ts | 63 ------------ .../locales/devTranslations.ts | 12 --- next.config.mjs | 1 - package.json | 2 +- stories/StoryProvider.tsx | 14 +-- 35 files changed, 349 insertions(+), 230 deletions(-) create mode 100644 app/bugs/page.tsx create mode 100644 app/oracle/page.tsx create mode 100644 app/play-offline/page.tsx create mode 100644 app/play/(components)/play.tsx create mode 100644 app/play/[id]/page.tsx create mode 100644 app/play/join/[id]/page.tsx create mode 100644 app/play/page.tsx create mode 100644 lib/components/NoSSR/NoSSR.tsx create mode 100644 lib/contexts/AppI18nContext/AppI18nContext.tsx delete mode 100644 lib/index.tsx delete mode 100644 lib/services/internationalization/InternationalizationService.ts delete mode 100644 lib/services/internationalization/locales/devTranslations.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2494d8c87..1da13cf8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,8 +28,8 @@ jobs: run: | CONTEXT=production bun run build env: - VITE_GITHUB_RUN_NUMBER: ${{github.run_number}} - VITE_GITHUB_SHA: ${{github.sha}} + NEXT_PUBLIC__GITHUB_RUN_NUMBER: ${{github.run_number}} + NEXT_PUBLIC__GITHUB_SHA: ${{github.sha}} # Validate - name: Validate run: bun run validate diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 29a36db4b..4b8c7d0e2 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,7 +4,6 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ - "bierner.comment-tagged-templates", "dbaeumer.vscode-eslint", "eamodio.gitlens", "yzhang.markdown-all-in-one", diff --git a/app/bugs/page.tsx b/app/bugs/page.tsx new file mode 100644 index 000000000..b33d1d8a6 --- /dev/null +++ b/app/bugs/page.tsx @@ -0,0 +1,20 @@ +{ + /* */ +} + +import { BugsRoute } from "../../lib/routes/Bugs/BugsRoute"; +import { t } from "../i18n"; + +export async function generateMetadata() { + return { + title: t("bugs-route.title"), + description: t("bugs-route.description"), + }; +} + +export default function BugsPage() { + return ; +} diff --git a/app/data/page.tsx b/app/data/page.tsx index 5c43fe939..f02451129 100644 --- a/app/data/page.tsx +++ b/app/data/page.tsx @@ -3,8 +3,8 @@ import { t } from "../i18n"; export async function generateMetadata() { return { - title: t("data-route-route.title"), - description: t("data-route-route.description"), + title: t("data-route.title"), + description: t("data-route.description"), }; } diff --git a/app/i18n.tsx b/app/i18n.tsx index f8a0e77eb..29ac5679e 100644 --- a/app/i18n.tsx +++ b/app/i18n.tsx @@ -3,3 +3,7 @@ import englishTranslations from "../public/locales/en/translation.json"; export function t(key: string) { return (englishTranslations as any)[key]; } + +export function serverSideTranslations(key: string) { + return t(key); +} diff --git a/app/layout.tsx b/app/layout.tsx index bf610bf63..08d1f4d41 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,7 +1,11 @@ +/// +/// + import Script from "next/script"; import { Metadata } from "next/types"; import React from "react"; import { AppProviders } from "../lib/App"; +import NoSSR from "../lib/components/NoSSR/NoSSR"; export const metadata: Metadata = { title: "Fari App VTT | The Free and Open-Source Virtual Tabletop", description: "", @@ -65,7 +69,9 @@ export default function RootLayout(props: { children: React.ReactNode }) {
- {props.children} + + {props.children} +