Skip to content

Commit a15f6e5

Browse files
committed
chore: update Next 16
1 parent aa86ac4 commit a15f6e5

8 files changed

Lines changed: 999 additions & 998 deletions

File tree

.prettierignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
.next
21
node_modules
3-
out
2+
3+
/next-env.d.ts
4+
/.next
5+
/out

eslint.config.mts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ export default defineConfig([
185185
},
186186
},
187187
{
188-
files: ['next-env.d.ts'],
189-
rules: {
190-
'@typescript-eslint/triple-slash-reference': 'off',
191-
'unicorn/prevent-abbreviations': 'off',
192-
},
193-
},
194-
{
195-
ignores: ['.next', '.swc', 'coverage', 'node_modules', 'out'],
188+
ignores: [
189+
'next-env.d.ts',
190+
'.next',
191+
'.swc',
192+
'coverage',
193+
'node_modules',
194+
'out',
195+
],
196196
},
197197
]);

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

next.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ const nextConfigFn: NextConfigFn = (phase) => {
1515
images: {
1616
unoptimized: true,
1717
},
18-
eslint: {
19-
dirs: ['.'],
20-
ignoreDuringBuilds: true,
21-
},
2218
typescript: {
2319
ignoreBuildErrors: true,
2420
},

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,68 +13,68 @@
1313
"test": "jest"
1414
},
1515
"dependencies": {
16-
"next": "^15.5.5",
16+
"next": "^16.0.1",
1717
"react": "^19.2.0",
1818
"react-dom": "^19.2.0",
1919
"workbox-routing": "^7.3.0",
2020
"workbox-strategies": "^7.3.0",
2121
"workbox-window": "^7.3.0"
2222
},
2323
"devDependencies": {
24-
"@eslint/config-helpers": "^0.4.0",
25-
"@eslint/core": "^0.16.0",
26-
"@eslint/js": "^9.37.0",
24+
"@eslint/config-helpers": "^0.4.2",
25+
"@eslint/core": "^0.17.0",
26+
"@eslint/js": "^9.39.1",
2727
"@mdx-js/loader": "^3.1.1",
2828
"@mdx-js/react": "^3.1.1",
29-
"@next/eslint-plugin-next": "^15.5.5",
30-
"@next/mdx": "^15.5.5",
29+
"@next/eslint-plugin-next": "^16.0.1",
30+
"@next/mdx": "^16.0.1",
3131
"@rollup/plugin-node-resolve": "^16.0.3",
32-
"@rollup/plugin-replace": "^6.0.2",
33-
"@tailwindcss/postcss": "^4.1.14",
32+
"@rollup/plugin-replace": "^6.0.3",
33+
"@tailwindcss/postcss": "^4.1.17",
3434
"@testing-library/dom": "^10.4.1",
3535
"@testing-library/jest-dom": "^6.9.1",
3636
"@testing-library/react": "^16.3.0",
3737
"@types/eslint": "^9.6.1",
3838
"@types/jest": "^30.0.0",
3939
"@types/mdx": "^2.0.13",
40-
"@types/node": "^24.7.2",
40+
"@types/node": "^24.10.0",
4141
"@types/react": "^19.2.2",
4242
"@types/react-dom": "^19.2.2",
4343
"autoprefixer": "^10.4.21",
4444
"esbuild": ">=0.25.0",
45-
"eslint": "^9.37.0",
45+
"eslint": "^9.39.1",
4646
"eslint-config-prettier": "^10.1.8",
4747
"eslint-import-resolver-typescript": "^4.4.4",
4848
"eslint-plugin-import": "^2.32.0",
4949
"eslint-plugin-prettier": "^5.5.4",
5050
"eslint-plugin-react": "^7.37.5",
51-
"eslint-plugin-react-hooks": "^7.0.0",
51+
"eslint-plugin-react-hooks": "^7.0.1",
5252
"eslint-plugin-unicorn": "^62.0.0",
53-
"globals": "^16.4.0",
53+
"globals": "^16.5.0",
5454
"husky": "^9.1.7",
5555
"jest": "^30.2.0",
5656
"jest-environment-jsdom": "^30.2.0",
5757
"jiti": "^2.6.1",
58-
"lint-staged": "^16.2.4",
58+
"lint-staged": "^16.2.6",
5959
"postcss": "^8.5.6",
6060
"postcss-calc": "^10.1.1",
6161
"postcss-load-config": "^6.0.1",
6262
"prettier": "^3.6.2",
63-
"rollup": "^4.52.4",
63+
"rollup": "^4.53.1",
6464
"rollup-plugin-esbuild": "^6.2.1",
6565
"schema-dts": "^1.1.5",
66-
"tailwindcss": "^4.1.14",
67-
"terser": "^5.44.0",
66+
"tailwindcss": "^4.1.17",
67+
"terser": "^5.44.1",
6868
"ts-jest": "^29.4.5",
6969
"ts-node": "^10.9.2",
7070
"tsx": "^4.20.6",
7171
"typescript": "^5.9.3",
72-
"typescript-eslint": "^8.46.1",
72+
"typescript-eslint": "^8.46.3",
7373
"whatwg-fetch": "^3.6.20"
7474
},
7575
"resolutions": {
7676
"postcss": "^8.5.6",
77-
"@eslint/plugin-kit": "^0.4.0"
77+
"@eslint/plugin-kit": "^0.4.1"
7878
},
7979
"engineStrict": true,
8080
"engines": {

scripts/prepare/action.ts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,36 @@ import { join } from 'node:path';
44
const fileContent = `// THIS FILE IS AUTO-GENERATED, DO NOT MODIFY
55
// TODO: This file is a workaround until Next.js finally support postcss.config.mts natively.
66
7+
import { existsSync } from 'node:fs';
8+
import { fileURLToPath } from 'node:url';
9+
import { basename, dirname, join } from 'node:path';
710
import { createJiti } from 'jiti';
811
9-
const jiti = createJiti(import.meta.url);
10-
export default jiti('./postcss.config.mts').default;
12+
// During 'next build' only import.meta.url has value
13+
const configFile = import.meta.url;
14+
const getProjectDir = () => {
15+
let dir = dirname(fileURLToPath(configFile));
16+
while (true) {
17+
console.log(dir);
18+
// should skip .next directory
19+
if (basename(dir) === '.next') {
20+
dir = dirname(dir);
21+
continue;
22+
}
23+
const pkgJsonPath = join(dir, 'package.json');
24+
if (existsSync(pkgJsonPath)) {
25+
return dir;
26+
}
27+
const newDir = dirname(dir);
28+
if (newDir === dir) {
29+
throw new Error('Cannot find Project Root');
30+
}
31+
dir = newDir;
32+
}
33+
};
34+
35+
const jiti = createJiti(configFile);
36+
export default jiti(join(getProjectDir(), 'postcss.config.mts')).default;
1137
`;
1238

1339
const isNodeError = (error: unknown): error is NodeJS.ErrnoException => {

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"moduleResolution": "bundler",
1414
"resolveJsonModule": true,
1515
"isolatedModules": true,
16-
"jsx": "preserve",
16+
"jsx": "react-jsx",
1717
"incremental": true,
1818
"plugins": [
1919
{
@@ -27,7 +27,8 @@
2727
"**/*.tsx",
2828
"**/*.cts",
2929
"**/*.mts",
30-
".next/types/**/*.ts"
30+
".next/types/**/*.ts",
31+
".next/dev/types/**/*.ts"
3132
],
3233
"exclude": [
3334
"node_modules",

0 commit comments

Comments
 (0)