Skip to content

Commit 9a40ab0

Browse files
fix(deps): update nextjs monorepo to v16 (major) (#4239)
* fix(deps): update nextjs monorepo to v16 * Update build script to include webpack * Try again * Fix lint * Go * Run in band' * Fixes * .. * Fix * Lets go --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Arda TANRIKULU <[email protected]>
1 parent 6f6d157 commit 9a40ab0

File tree

20 files changed

+367
-200
lines changed

20 files changed

+367
-200
lines changed

examples/file-upload-nextjs-pothos/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"@pothos/core": "4.10.0",
1414
"graphql": "16.12.0",
1515
"graphql-yoga": "workspace:*",
16-
"next": "15.5.6",
16+
"next": "16.0.1",
1717
"react": "19.2.0",
1818
"react-dom": "19.2.0"
1919
},
2020
"devDependencies": {
2121
"@types/react": "^19.0.0",
2222
"@whatwg-node/fetch": "^0.10.1",
2323
"eslint": "9.39.0",
24-
"eslint-config-next": "15.5.6",
24+
"eslint-config-next": "16.0.1",
2525
"typescript": "5.9.3"
2626
}
2727
}

examples/nextjs-app/__integration-tests__/nextjs-app.spec.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
1+
import path from 'node:path';
12
import { version } from 'graphql';
3+
import { rimrafSync } from 'rimraf';
24
import { fetch } from '@whatwg-node/fetch';
35
import { getAvailablePort, Proc, spawn, waitForAvailable } from './utils';
46

57
jest.setTimeout(33_000);
68

9+
const nodeMajorVersion = parseInt(process.version.split('.')[0].replace('v', ''), 10);
10+
711
describe('nextjs 13 App Router', () => {
8-
if (version.startsWith('15.')) {
9-
it.skip('skips for v15', () => {});
12+
if (version.startsWith('15.') || nodeMajorVersion < 20) {
13+
it.skip('skips', () => {});
1014
return;
1115
}
1216
let port: number;
1317
let serverProcess: Proc;
1418
beforeAll(async () => {
19+
rimrafSync(path.join(__dirname, '..', '.next'));
1520
const signal = AbortSignal.timeout(30_000);
1621
port = await getAvailablePort();
1722
serverProcess = await spawn('pnpm', ['dev'], {
1823
signal,
1924
env: { PORT: String(port) },
25+
cwd: path.join(__dirname, '..'),
2026
});
2127
await waitForAvailable(port, { signal });
2228
});
23-
afterAll(() => serverProcess?.kill());
29+
afterAll(() => {
30+
rimrafSync(path.join(__dirname, '..', '.next'));
31+
return serverProcess?.kill();
32+
});
2433

2534
it('should show GraphiQL', async () => {
2635
const response = await fetch(`http://127.0.0.1:${port}/api/graphql`, {

examples/nextjs-app/__integration-tests__/utils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ export interface Proc {
1313
export function spawn(
1414
cmd: string,
1515
args: string[],
16-
{ signal, env }: { signal: AbortSignal; env?: Record<string, string> },
16+
{
17+
signal,
18+
env,
19+
cwd = path.join(module.path, '..'),
20+
}: { signal: AbortSignal; env?: Record<string, string>; cwd: string },
1721
): Promise<Proc> {
1822
const proc = cp.spawn(cmd, args, {
1923
// ignore stdin because we're not feeding the process anything, pipe stdout and stderr
2024
stdio: ['ignore', 'pipe', 'pipe'],
21-
cwd: path.join(module.path, '..'),
25+
cwd,
2226
signal,
2327
env: {
2428
// @ts-ignore this runs inside jest so process is always available

examples/nextjs-app/next-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
import './.next/dev/types/routes.d.ts';
34

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

examples/nextjs-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"@types/react-dom": "19.2.2",
1616
"autoprefixer": "10.4.21",
1717
"eslint": "9.39.0",
18-
"eslint-config-next": "15.5.6",
18+
"eslint-config-next": "16.0.1",
1919
"graphql": "16.12.0",
2020
"graphql-yoga": "workspace:*",
21-
"next": "15.5.6",
21+
"next": "16.0.1",
2222
"postcss": "8.5.6",
2323
"react": "19.2.0",
2424
"react-dom": "19.2.0",

examples/nextjs-app/tsconfig.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"moduleResolution": "node",
1313
"resolveJsonModule": true,
1414
"isolatedModules": true,
15-
"jsx": "preserve",
15+
"jsx": "react-jsx",
1616
"incremental": true,
1717
"plugins": [
1818
{
@@ -23,6 +23,13 @@
2323
"@/*": ["./*"]
2424
}
2525
},
26-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26+
"include": [
27+
"next-env.d.ts",
28+
"**/*.ts",
29+
"**/*.tsx",
30+
".next/types/**/*.ts",
31+
".next/dev/types/**/*.ts",
32+
".next/dev/dev/types/**/*.ts"
33+
],
2734
"exclude": ["node_modules"]
2835
}

examples/nextjs-auth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"graphql": "16.12.0",
1414
"graphql-yoga": "workspace:*",
15-
"next": "15.5.6",
15+
"next": "16.0.1",
1616
"next-auth": "4.24.13",
1717
"react": "19.2.0",
1818
"react-dom": "19.2.0",
@@ -21,7 +21,7 @@
2121
"devDependencies": {
2222
"@types/react": "19.2.2",
2323
"eslint": "9.39.0",
24-
"eslint-config-next": "15.5.6",
24+
"eslint-config-next": "16.0.1",
2525
"typescript": "5.9.3"
2626
}
2727
}

examples/nextjs-legacy-pages/__integration-tests__/nextjs-legacy.spec.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import path from 'node:path';
2+
import { rimrafSync } from 'rimraf';
13
import { fetch } from '@whatwg-node/fetch';
24
import {
35
getAvailablePort,
@@ -7,20 +9,30 @@ import {
79
} from '../../nextjs-app/__integration-tests__/utils';
810

911
jest.setTimeout(33_000);
12+
const nodeMajorVersion = parseInt(process.version.split('.')[0].replace('v', ''), 10);
1013

1114
describe('NextJS Legacy Pages', () => {
15+
if (nodeMajorVersion < 20) {
16+
it.skip('skips', () => {});
17+
return;
18+
}
1219
let port: number;
1320
let serverProcess: Proc;
1421
beforeAll(async () => {
22+
rimrafSync(path.join(__dirname, '..', '.next'));
1523
const signal = AbortSignal.timeout(30_000);
1624
port = await getAvailablePort();
1725
serverProcess = await spawn('pnpm', ['dev'], {
1826
signal,
1927
env: { PORT: String(port) },
28+
cwd: path.join(__dirname, '..'),
2029
});
2130
await waitForAvailable(port, { signal });
2231
});
23-
afterAll(() => serverProcess.kill());
32+
afterAll(() => {
33+
rimrafSync(path.join(__dirname, '..', '.next'));
34+
return serverProcess?.kill();
35+
});
2436

2537
it('should show GraphiQL', async () => {
2638
const response = await fetch(`http://127.0.0.1:${port}/api/graphql`, {
@@ -29,8 +41,8 @@ describe('NextJS Legacy Pages', () => {
2941
},
3042
});
3143

32-
expect(response.ok).toBe(true);
3344
expect(await response.text()).toContain('<title>Yoga GraphiQL</title>');
45+
expect(response.ok).toBe(true);
3446
});
3547

3648
it('should run basic query', async () => {
@@ -46,8 +58,6 @@ describe('NextJS Legacy Pages', () => {
4658
}),
4759
});
4860

49-
expect(response.ok).toBe(true);
50-
5161
expect({
5262
...Object.fromEntries(response.headers.entries()),
5363
date: null,
@@ -60,5 +70,7 @@ describe('NextJS Legacy Pages', () => {
6070

6171
expect(json.errors).toBeFalsy();
6272
expect(json.data?.greetings).toBe('This is the `greetings` field of the root `Query` type');
73+
74+
expect(response.ok).toBe(true);
6375
});
6476
});
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
import './.next/dev/types/routes.d.ts';
34

45
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
6+
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

examples/nextjs-legacy-pages/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@types/react": "19.2.2",
1515
"graphql": "16.12.0",
1616
"graphql-yoga": "workspace:*",
17-
"next": "15.5.6",
17+
"next": "16.0.1",
1818
"react": "19.2.0",
1919
"react-dom": "19.2.0",
2020
"tslib": "2.8.1"
@@ -24,7 +24,7 @@
2424
"@types/react": "19.2.2",
2525
"esbuild": "0.25.12",
2626
"eslint": "9.39.0",
27-
"eslint-config-next": "15.5.6",
27+
"eslint-config-next": "16.0.1",
2828
"typescript": "5.9.3"
2929
}
3030
}

0 commit comments

Comments
 (0)