Skip to content

Commit

Permalink
🔧 chore: Update
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jul 17, 2023
1 parent 6c4b203 commit 7ffa5a7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"semantic-release": "^21",
"semantic-release-config-gitmoji": "^1",
"stylelint": "^15",
"turbo": "^1",
"typescript": "^5",
"vitest": "latest"
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/chat/[id]/edit/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
5 changes: 3 additions & 2 deletions src/pages/chat/[id]/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const Chat = memo(() => {
</Layout>
);
});
export default Chat;

export const getServerSideProps = makeI18nProps(['common']);
export { getStaticPaths } from '@/utils/makeI18nProps';
export const getStaticProps = makeI18nProps(['common']);
export default Chat;
11 changes: 10 additions & 1 deletion src/utils/makeI18nProps.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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: [],
};
};
9 changes: 9 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"outputs": [".next/**", "!.next/cache/**"]
},
"lint": {}
}
}
4 changes: 4 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"buildCommand": "pnpm turbo build",
"ignoreCommand": "pnpm dlx turbo-ignore"
}

0 comments on commit 7ffa5a7

Please sign in to comment.