From 7ffa5a7ae526d8479cc19e0afee44d9ca3ff8b86 Mon Sep 17 00:00:00 2001 From: canisminor1990 Date: Mon, 17 Jul 2023 21:57:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20Update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/pages/chat/[id]/edit/index.page.tsx | 4 ++-- src/pages/chat/[id]/index.page.tsx | 5 +++-- src/utils/makeI18nProps.ts | 11 ++++++++++- turbo.json | 9 +++++++++ vercel.json | 4 ++++ 6 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 turbo.json create mode 100644 vercel.json diff --git a/package.json b/package.json index 39921d58dae6..d33721d9d485 100644 --- a/package.json +++ b/package.json @@ -122,6 +122,7 @@ "semantic-release": "^21", "semantic-release-config-gitmoji": "^1", "stylelint": "^15", + "turbo": "^1", "typescript": "^5", "vitest": "latest" }, diff --git a/src/pages/chat/[id]/edit/index.page.tsx b/src/pages/chat/[id]/edit/index.page.tsx index 9050d2dd150a..449d01fc59f9 100644 --- a/src/pages/chat/[id]/edit/index.page.tsx +++ b/src/pages/chat/[id]/edit/index.page.tsx @@ -61,6 +61,6 @@ const EditPage = memo(() => { ); }); +export { getStaticPaths } from '@/utils/makeI18nProps'; +export const getStaticProps = makeI18nProps(['common']); export default EditPage; - -export const getServerSideProps = makeI18nProps(['common']); diff --git a/src/pages/chat/[id]/index.page.tsx b/src/pages/chat/[id]/index.page.tsx index 02c28e507e45..9e81d105dc0d 100644 --- a/src/pages/chat/[id]/index.page.tsx +++ b/src/pages/chat/[id]/index.page.tsx @@ -44,6 +44,7 @@ const Chat = memo(() => { ); }); -export default Chat; -export const getServerSideProps = makeI18nProps(['common']); +export { getStaticPaths } from '@/utils/makeI18nProps'; +export const getStaticProps = makeI18nProps(['common']); +export default Chat; diff --git a/src/utils/makeI18nProps.ts b/src/utils/makeI18nProps.ts index 5b5ccc40159d..8dc50b617b61 100644 --- a/src/utils/makeI18nProps.ts +++ b/src/utils/makeI18nProps.ts @@ -1,4 +1,4 @@ -import type { GetServerSideProps, GetStaticProps } from 'next'; +import type { GetServerSideProps, GetStaticPaths, GetStaticProps } from 'next'; import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; import i18nextConfig from '@/../next-i18next.config'; @@ -16,4 +16,13 @@ export const makeI18nProps = (ns: NS[] = []): GetStaticProps | GetServerSideProps => async (ctx: any) => ({ props: await getI18nProps(ctx, ns), + revalidate: false, }); + +export const getStaticPaths: GetStaticPaths = async () => { + // We don't want to specify all possible countries as we get those from the headers + return { + fallback: 'blocking', + paths: [], + }; +}; diff --git a/turbo.json b/turbo.json new file mode 100644 index 000000000000..3b9dda339550 --- /dev/null +++ b/turbo.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://turbo.build/schema.json", + "pipeline": { + "build": { + "outputs": [".next/**", "!.next/cache/**"] + }, + "lint": {} + } +} diff --git a/vercel.json b/vercel.json new file mode 100644 index 000000000000..09e0182a968f --- /dev/null +++ b/vercel.json @@ -0,0 +1,4 @@ +{ + "buildCommand": "pnpm turbo build", + "ignoreCommand": "pnpm dlx turbo-ignore" +}