Skip to content

Commit 35dd013

Browse files
Refactor: Upgrade Next.js to version 16.0.10 for Hyperjump landing page (#145)
* Refactor: Upgrade Next.js to version 16.0.10 for Hyperjump landing page * Fix test * ci: fix * chore: fix format --------- Co-authored-by: Hari Nugraha <[email protected]>
1 parent afe175e commit 35dd013

File tree

9 files changed

+123
-98
lines changed

9 files changed

+123
-98
lines changed

app/[lang]/(hyperjump)/case-studies/[slug]/page.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,14 @@ export async function generateMetadata({
4646
return dynamicOpengraph(meta);
4747
}
4848

49-
export const generateStaticParams = async ({ params }: CaseStudyProps) => {
50-
return getCaseStudies((await params).lang).reduce<Params[]>(
51-
(acc, { slug }) => [
49+
export async function generateStaticParams(): Promise<Params[]> {
50+
return supportedLanguages.reduce<Params[]>((acc, lang) => {
51+
return [
5252
...acc,
53-
...supportedLanguages.map((lang) => ({ slug, lang }))
54-
],
55-
[]
56-
);
57-
};
53+
...getCaseStudies(lang).map(({ slug }) => ({ slug, lang }))
54+
];
55+
}, []);
56+
}
5857

5958
export default async function CaseStudy({ params }: CaseStudyProps) {
6059
const { lang, slug } = await params;

app/[lang]/(hyperjump)/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Nav from "./components/nav";
66

77
type MainLangLayoutProps = {
88
children: React.ReactNode;
9-
params: Promise<{ lang: SupportedLanguage }>;
9+
params: Promise<{ lang: string }>;
1010
};
1111

1212
export default async function MainLangLayout({
@@ -19,10 +19,10 @@ export default async function MainLangLayout({
1919
<>
2020
<ScrollObserver />
2121
<div className="relative min-h-screen bg-white">
22-
<Nav lang={lang} />
22+
<Nav lang={lang as SupportedLanguage} />
2323
{children}
2424
<LandingAIAgent />
25-
<Footer lang={lang} />
25+
<Footer lang={lang as SupportedLanguage} />
2626
</div>
2727
</>
2828
);

app/[lang]/(inferenceai)/inferenceai/[slug]/page.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,20 @@ import { Faqs, Hero, HowItWorks, KeyFeatures, WhatIsIncluded } from "./home";
1111
type Params = { lang: SupportedLanguage; slug: string };
1212

1313
type CaseStudyProps = {
14-
params: Promise<Params>;
14+
params: Params;
1515
};
1616

17-
export const generateStaticParams = async ({ params }: CaseStudyProps) => {
18-
return getCaseStudies((await params).lang).reduce<Params[]>(
19-
(acc, { slug }) => [
17+
export async function generateStaticParams(): Promise<Params[]> {
18+
return supportedLanguages.reduce<Params[]>((acc, lang) => {
19+
return [
2020
...acc,
21-
...supportedLanguages.map((lang) => ({ slug, lang }))
22-
],
23-
[]
24-
);
25-
};
21+
...getCaseStudies(lang).map(({ slug }) => ({ slug, lang }))
22+
];
23+
}, []);
24+
}
2625

2726
export default async function CaseStudy({ params }: CaseStudyProps) {
28-
const { lang, slug } = await params;
27+
const { lang, slug } = params;
2928
const caseStudy = caseStudyBy(slug, lang);
3029

3130
if (!caseStudy) {

app/[lang]/(inferenceai)/inferenceai/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Footer } from "./components/footer";
55

66
type MainLangLayoutProps = {
77
children: React.ReactNode;
8-
params: Promise<{ lang: SupportedLanguage }>;
8+
params: Promise<{ lang: string }>;
99
};
1010

1111
export default async function MainLangLayout({
@@ -18,9 +18,9 @@ export default async function MainLangLayout({
1818
<>
1919
<ScrollObserver />
2020
<div className="relative min-h-screen bg-transparent">
21-
<ClientWrapper lang={lang} />
21+
<ClientWrapper lang={lang as SupportedLanguage} />
2222
{children}
23-
<Footer lang={lang} />
23+
<Footer lang={lang as SupportedLanguage} />
2424
</div>
2525
</>
2626
);

bun.lock

Lines changed: 64 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

next.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import createMDX from "@next/mdx";
33
const basePath = ""; // process.env.NODE_ENV === "production" ? "/hyperjump.tech" : "";
44
/** @type {import('next').NextConfig} */
55
const nextConfig = {
6-
output: "export",
7-
basePath,
86
assetPrefix: basePath,
7+
basePath,
98
images: {
109
unoptimized: true
1110
},
11+
output: "export",
1212
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"]
1313
};
1414
const withMDX = createMDX();

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.1.0",
44
"private": true,
55
"scripts": {
6-
"generate-locales": "simple-i18n-next -i ./locales -l en",
6+
"generate-locales": "simple-i18n-next -i ./locales -l en && bun scripts/fix-locales-types.js",
77
"generate-redirect": "bun .github/scripts/generate-redirect.js",
88
"generate-sitemap": "bun .github/scripts/generate-sitemap.js",
99
"dev": "bun run generate-locales && next dev",
@@ -22,8 +22,8 @@
2222
"@mdx-js/loader": "3.1.1",
2323
"@mdx-js/react": "3.1.1",
2424
"@n8n/chat": "0.61.0",
25-
"@next/mdx": "15.5.6",
26-
"@next/third-parties": "15.5.6",
25+
"@next/mdx": "16.1.0",
26+
"@next/third-parties": "16.1.0",
2727
"@radix-ui/react-accordion": "1.2.12",
2828
"@radix-ui/react-aspect-ratio": "1.1.7",
2929
"@radix-ui/react-avatar": "1.1.10",
@@ -39,15 +39,16 @@
3939
"framer-motion": "12.23.24",
4040
"lucide-react": "0.546.0",
4141
"marked": "16.4.1",
42-
"next": "15.4.1",
42+
"next": "16.0.10",
4343
"next-themes": "0.4.6",
44-
"react": "19.2.0",
45-
"react-dom": "19.2.0",
44+
"react": "19.2.3",
45+
"react-dom": "19.2.3",
4646
"rehype-stringify": "10.0.1",
4747
"remark-gfm": "4.0.1",
4848
"remark-parse": "11.0.0",
4949
"remark-rehype": "11.1.2",
5050
"schema-dts": "1.1.5",
51+
"simple-i18n-next": "0.0.38",
5152
"sonner": "2.0.7",
5253
"tailwindcss-animate": "1.0.7",
5354
"unified": "11.0.5",
@@ -67,7 +68,6 @@
6768
"postcss": "^8",
6869
"prettier": "^3.6.2",
6970
"prettier-plugin-tailwindcss": "^0.6.14",
70-
"simple-i18n-next": "0.0.25",
7171
"tailwind-merge": "^3.3.1",
7272
"tailwindcss": "^4.1.13",
7373
"typescript": "^5"

scripts/fix-locales-types.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import fs from "fs";
2+
import path from "path";
3+
4+
const filePath = path.join(process.cwd(), "locales", ".generated", "types.ts");
5+
6+
if (!fs.existsSync(filePath)) {
7+
console.warn(
8+
`[fix-locales-types] File not found at ${filePath}, skipping patch.`
9+
);
10+
process.exit(0);
11+
}
12+
13+
const content = fs.readFileSync(filePath, "utf8");
14+
15+
if (content.includes("ArgsProps")) {
16+
// Already patched
17+
process.exit(0);
18+
}
19+
20+
const patched = `${content.trimEnd()}\n\nexport type ArgsProps = Record<string, string>;\n`;
21+
22+
fs.writeFileSync(filePath, patched, "utf8");
23+
console.log(
24+
"[fix-locales-types] Added ArgsProps type to locales .generated types."
25+
);

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"moduleResolution": "bundler",
1111
"resolveJsonModule": true,
1212
"isolatedModules": true,
13-
"jsx": "preserve",
13+
"jsx": "react-jsx",
1414
"incremental": true,
1515
"plugins": [
1616
{
@@ -28,7 +28,8 @@
2828
"**/*.ts",
2929
"**/*.tsx",
3030
".next/types/**/*.ts",
31-
"locales/.generated/**/*"
31+
"locales/.generated/**/*",
32+
".next/dev/types/**/*.ts"
3233
],
3334
"exclude": ["node_modules"]
3435
}

0 commit comments

Comments
 (0)