Skip to content

Commit ffcdb24

Browse files
committed
feat: Upgrade Next.js 15 -> 16
1 parent c98feba commit ffcdb24

File tree

15 files changed

+3252
-6468
lines changed

15 files changed

+3252
-6468
lines changed

.eslintrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/admin/users/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ async function getData(): Promise<{ users: UserData[], date: Date }> {
120120

121121
export const revalidate = 500;
122122
export const dynamic = "force-dynamic";
123-
export const maxDuration = 60;
123+
export const maxDuration = 60;

app/api/revalidate/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import {revalidateTag} from 'next/cache';
33

44
export async function GET(request: NextRequest) {
55
const tag = request.nextUrl.searchParams.get('tag');
6-
if (tag) revalidateTag(tag);
6+
if (tag) revalidateTag(tag, "max");
77
return NextResponse.json({revalidated: !!tag, now: Date.now()});
88
}

app/api/user/[userId]/role/route.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import {PrismaClient, Role} from "@prisma/client";
33
import {getToken} from "next-auth/jwt";
44
import {CloudSettingsToken} from "@/src/types/AuthTypes";
55

6-
export const dynamic = "force-dynamic";
7-
8-
export async function POST(request: NextRequest, {params}: { params: Promise<{ userId: string }> }) {
6+
export async function POST(request: NextRequest, {params}: RouteContext<"/api/user/[userId]/role">) {
97
const nextAuthToken = await getToken({req: request}) as CloudSettingsToken;
108
if (!nextAuthToken) {
119
return new Response("No valid session token found.", {

app/api/user/[userId]/route.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ import {PrismaClient} from "@prisma/client";
33
import {getToken} from "next-auth/jwt";
44
import {CloudSettingsToken} from "@/src/types/AuthTypes";
55

6-
export const dynamic = "force-dynamic";
7-
type PathVariables = {
8-
params: Promise<{ userId: string }>
9-
}
10-
11-
export async function DELETE(request: NextRequest, {params}: PathVariables) {
6+
export async function DELETE(request: NextRequest, {params}: RouteContext<"/api/user/[userId]">) {
127
const nextAuthToken = await getToken({req: request}) as CloudSettingsToken;
138
if (!nextAuthToken) {
149
return new Response("No valid session token found.", {
@@ -69,7 +64,7 @@ export async function DELETE(request: NextRequest, {params}: PathVariables) {
6964
return NextResponse.json({});
7065
};
7166

72-
export async function GET(request: NextRequest, {params}: PathVariables) {
67+
export async function GET(request: NextRequest, {params}: RouteContext<"/api/user/[userId]">) {
7368
const nextAuthToken = await getToken({req: request}) as CloudSettingsToken;
7469
if (!nextAuthToken) {
7570
return new Response("No valid session token found.", {

app/layout.tsx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1+
import '@ant-design/v5-patch-for-react-19';
12
import './globals.css'
23
import {Inter} from 'next/font/google'
34
import {AppShell} from "@/app/AppShell";
45
import {AppProvider} from "@/app/AppProvider";
56
import {Analytics} from "@vercel/analytics/react";
6-
import {AntdStyledComponentRegistry} from "@/components/antd/AntdStyledComponentRegistry";
7-
import {Viewport} from "next";
7+
import {Metadata, Viewport} from "next";
88
import {SpeedInsights} from "@vercel/speed-insights/next"
9-
import {Suspense} from "react";
9+
import {AntdRegistry} from "@ant-design/nextjs-registry";
1010

1111
const inter = Inter({subsets: ['latin']});
1212

13-
export const metadata = {
13+
export const metadata: Metadata = {
1414
title: 'CloudSettings',
1515
description: 'Web App for the CloudSettings Minecraft Mod',
1616
metadataBase: new URL('https://cloudsettings.blutmondgilde.de'),
1717
appLinks: {
1818
web: {
1919
url: 'https://cloudsettings.blutmondgilde.de/',
20-
should_fallback: true
21-
}
20+
should_fallback: true,
21+
},
2222
},
2323
openGraph: {
2424
title: 'CloudSettings',
2525
description: 'Web App for the CloudSettings Minecraft Mod',
2626
type: 'website',
27-
url: 'https://cloudsettings.blutmondgilde.de/'
28-
}
27+
url: 'https://cloudsettings.blutmondgilde.de/',
28+
},
2929
}
3030

3131
export const viewport: Viewport = {
@@ -34,21 +34,17 @@ export const viewport: Viewport = {
3434
maximumScale: 1,
3535
}
3636

37-
type Props = {
38-
children: React.ReactNode
39-
}
40-
41-
export default function RootLayout({children,}: Props) {
37+
export default function RootLayout({children}: LayoutProps<"/">) {
4238
return (
4339
<html lang="en" className={"h-full"}>
4440
<body className={`${inter.className} min-h-screen m-0`}>
45-
<AntdStyledComponentRegistry>
41+
<AntdRegistry>
4642
<AppProvider>
4743
<AppShell>
4844
{children}
4945
</AppShell>
5046
</AppProvider>
51-
</AntdStyledComponentRegistry>
47+
</AntdRegistry>
5248
<Analytics/>
5349
<SpeedInsights/>
5450
</body>

bun.lock

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

eslint.config.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig } from "eslint/config";
2+
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = path.dirname(__filename);
8+
9+
export default defineConfig([{
10+
extends: [...nextCoreWebVitals],
11+
12+
rules: {
13+
"@next/next/no-img-element": "off",
14+
},
15+
}]);
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
/** @type {import('next').NextConfig} */
2-
const nextConfig = {
1+
import {NextConfig} from "next";
2+
3+
const nextConfig: NextConfig = {
34
headers: async () => {
45
const headers = [
56
{
67
key: "X-DNS-Prefetch-Control",
7-
value: "off"
8+
value: "off",
89
},
910
{
1011
key: "X-Frame-Options",
11-
value: "DENY"
12+
value: "DENY",
1213
},
1314
{
1415
key: 'X-Content-Type-Options',
15-
value: 'nosniff'
16-
}
16+
value: 'nosniff',
17+
},
1718
];
1819

1920
if (process.env.NODE_ENV !== "development") {
2021
headers.push({
2122
key: "Strict-Transport-Security",
22-
value: "max-age=63072000; includeSubDomains; preload"
23+
value: "max-age=63072000; includeSubDomains; preload",
2324
});
2425
}
2526

2627
return [
2728
{
2829
source: '/',
29-
headers: headers
30-
}
30+
headers: headers,
31+
},
3132
];
3233
},
3334
images: {
@@ -36,22 +37,23 @@ const nextConfig = {
3637
protocol: 'https',
3738
hostname: 'mc-heads.net',
3839
port: '',
39-
pathname: '/avatar/**'
40+
pathname: '/avatar/**',
4041
},
4142
{
4243
protocol: 'https',
4344
hostname: 'mc-heads.net',
4445
port: '',
45-
pathname: '/body/**'
46+
pathname: '/body/**',
4647
},
4748
{
4849
protocol: 'https',
4950
hostname: "media.forgecdn.net",
5051
port: '',
51-
pathname: '/attachments/**'
52-
}
53-
]
54-
}
52+
pathname: '/attachments/**',
53+
},
54+
],
55+
},
56+
typedRoutes: true,
5557
}
5658

5759
module.exports = nextConfig

package.json

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,53 @@
77
"dev": "next dev",
88
"build": "next build",
99
"start": "next start",
10-
"lint": "next lint",
11-
"prisma:pull": "pnpm exec prisma db pull",
12-
"prisma:generate": "pnpm exec prisma generate",
13-
"prisma:migrate": "pnpm exec prisma migrate dev --name init",
14-
"prisma:migrate_zap": "pnpm exec prisma migrate dev --name init",
10+
"lint": "eslint .",
11+
"prisma:pull": "prisma db pull",
12+
"prisma:generate": "prisma generate",
13+
"prisma:migrate": "prisma migrate dev --name init",
14+
"prisma:migrate_zap": "prisma migrate dev --name init",
1515
"vercel-build": "prisma migrate deploy && next build",
1616
"postinstall": "prisma generate"
1717
},
1818
"dependencies": {
19-
"@ant-design/cssinjs": "^1.21.1",
2019
"@ant-design/icons": "5.5.1",
21-
"@ant-design/pro-components": "^2.8.1",
22-
"@antv/g2": "^5.2.7",
23-
"@headlessui/react": "^2.2.0",
24-
"@heroicons/react": "^2.1.5",
20+
"@ant-design/nextjs-registry": "^1.1.0",
21+
"@ant-design/pro-components": "^2.8.10",
22+
"@ant-design/v5-patch-for-react-19": "^1.0.3",
23+
"@antv/g2": "^5.4.2",
24+
"@headlessui/react": "^2.2.9",
25+
"@heroicons/react": "^2.2.0",
2526
"@prisma/client": "^5.22.0",
2627
"@types/lodash-es": "^4.17.12",
27-
"@types/node": "^22.9.0",
28-
"@types/react": "^18.3.12",
29-
"@types/react-dom": "^18.3.1",
30-
"@vercel/analytics": "^1.3.2",
31-
"@vercel/speed-insights": "^1.1.0",
32-
"antd": "^5.21.6",
33-
"autoprefixer": "^10.4.20",
34-
"dayjs": "^1.11.13",
35-
"eslint": "^9.14.0",
36-
"eslint-config-next": "^15.0.3",
28+
"@types/node": "^22.18.13",
29+
"@types/react": "19.2.2",
30+
"@types/react-dom": "19.2.2",
31+
"@vercel/analytics": "^1.5.0",
32+
"@vercel/speed-insights": "^1.2.0",
33+
"antd": "^5.27.6",
34+
"autoprefixer": "^10.4.21",
35+
"dayjs": "^1.11.18",
36+
"eslint": "^9.38.0",
37+
"eslint-config-next": "16.0.1",
3738
"lodash-es": "^4.17.21",
38-
"next": "^15.0.3",
39-
"next-auth": "^4.24.10",
40-
"postcss": "^8.4.47",
39+
"next": "16.0.1",
40+
"next-auth": "^4.24.12",
41+
"postcss": "^8.5.6",
4142
"prisma": "^5.22.0",
42-
"react": "^18.3.1",
43-
"react-dom": "^18.3.1",
43+
"react": "19.2.0",
44+
"react-dom": "19.2.0",
4445
"react-toastify": "^10.0.6",
45-
"recharts": "^2.13.3",
46-
"tailwindcss": "^3.4.14",
47-
"typescript": "^5.6.3"
46+
"recharts": "^2.15.4",
47+
"tailwindcss": "^3.4.18",
48+
"typescript": "^5.9.3"
4849
},
49-
"packageManager": "pnpm@9.12.2"
50+
"packageManager": "bun@1.3.1",
51+
"overrides": {
52+
"@types/react": "19.2.2",
53+
"@types/react-dom": "19.2.2"
54+
},
55+
"devDependencies": {},
56+
"trustedDependencies": [
57+
"@vercel/speed-insights"
58+
]
5059
}

0 commit comments

Comments
 (0)