Skip to content

Commit d5c664b

Browse files
committed
Attempt to upgrade to pnpm 12
1 parent 08bc9f5 commit d5c664b

49 files changed

Lines changed: 1023 additions & 227 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/sandbox-bench/scripts/sandbox-e2e.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ echo "tree ${a.name} ready"`
469469
await sbExec(
470470
vm,
471471
'55m',
472-
`set -e\nnpm i -g pnpm@10.33.0 >/dev/null 2>&1\n` +
472+
`set -e\nnpm i -g pnpm@12.9.1 >/dev/null 2>&1\n` +
473473
`(while true; do echo "hb mem=$(free -m | awk '/^Mem/{print $3}')MB"; sleep 30; done) & HB=$!\n` +
474474
`${extractCached}\n${installs}\n${builds}\n${waits}\n${verifies}\nkill $HB\n` +
475475
`echo "PHASE done $(date +%s)"\n` +

‎.github/actions/next-integration-stat/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
"engines": {
2323
"node": ">=20.9.0"
2424
},
25-
"packageManager": "pnpm@10.33.0"
25+
"packageManager": "pnpm@12.9.1"
2626
}

‎.github/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "next-github-workflows",
33
"private": true,
4-
"packageManager": "pnpm@10.33.0"
4+
"packageManager": "pnpm@12.9.1"
55
}

‎.github/pnpm-lock.yaml‎

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

‎.github/workflows/build_reusable.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,9 @@ jobs:
374374
name: next-swc-binary-${{ runner.os }}-${{ runner.arch }}
375375
path: packages/next-swc/native/next-swc.*.node
376376

377-
# undo normalize version changes for install/build
377+
# Restore manifests and lockfile (undoing normalization) before installing dependencies.
378378
- run: git checkout .
379-
if: ${{ inputs.skipInstallBuild != 'yes' }}
379+
if: ${{ inputs.skipInstallBuild != 'yes' || inputs.needsRustJsInstall == 'yes' }}
380380

381381
- name: Get pnpm store directory
382382
id: get-store-path

‎.npmrc‎

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

‎contributing/core/developing.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ _You'll need a working node.js environment with pnpm._
2525
`npm install -g corepack@latest`.
2626

2727
`pnpm` [respects the `packageManager` field in `package.json` by
28-
default](https://pnpm.io/settings#managepackagemanagerversions), even when
29-
installed without Corepack. This ensures that pnpm behaves the same locally as
30-
it does in CI.
28+
default](https://pnpm.io/settings/cli#pmonfail), even when installed without
29+
Corepack. This ensures that pnpm behaves the same locally as it does in CI.
3130

3231
- _(Optional)_ Install [fnm](https://github.com/Schniz/fnm) or
3332
[nvm](https://github.com/nvm-sh/nvm). This will ensure you use the same

‎package.json‎

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -302,47 +302,5 @@
302302
"engines": {
303303
"node": ">=20.9.0"
304304
},
305-
"packageManager": "pnpm@10.33.0",
306-
"pnpm": {
307-
"overrides": {
308-
"postcss": "8.5.23",
309-
"webpack": "5.98.0",
310-
"browserslist": "4.28.1",
311-
"caniuse-lite": "1.0.30001746",
312-
"@types/node": "20.17.7",
313-
"@babel/core": "7.26.10",
314-
"@babel/parser": "7.27.0",
315-
"@babel/types": "7.27.0",
316-
"@babel/traverse": "7.27.0",
317-
"@types/react": "19.2.18",
318-
"@types/react-dom": "19.2.4",
319-
"@types/retry": "0.12.0",
320-
"jest-snapshot": "30.0.0-alpha.6",
321-
"react": "npm:react@19.3.0-canary-b618bbb4-20261007",
322-
"react-dom": "npm:react-dom@19.3.0-canary-b618bbb4-20261007",
323-
"react-is": "npm:react-is@19.3.0-canary-b618bbb4-20261007",
324-
"scheduler": "npm:scheduler@0.28.0-canary-b618bbb4-20261007"
325-
},
326-
"packageExtensions": {
327-
"eslint-plugin-react-hooks@0.0.0-experimental-6de32a5a-20250822": {
328-
"dependencies": {
329-
"@babel/plugin-proposal-private-methods": "^7.18.6"
330-
}
331-
}
332-
},
333-
"patchedDependencies": {
334-
"webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch",
335-
"stacktrace-parser@0.1.10": "patches/stacktrace-parser@0.1.10.patch",
336-
"taskr@1.1.0": "patches/taskr@1.1.0.patch",
337-
"minizlib@3.1.0": "patches/minizlib@3.1.0.patch",
338-
"@rspack/core@1.6.7": "patches/@rspack__core@1.6.7.patch",
339-
"@modelcontextprotocol/sdk": "patches/@modelcontextprotocol__sdk.patch",
340-
"@vercel/blob": "patches/@vercel__blob.patch",
341-
"postcss-scss": "patches/postcss-scss.patch",
342-
"playwright-core@1.61.0": "patches/playwright-core@1.61.0.patch",
343-
"@types/node@20.17.7": "patches/@types__node@20.17.7.patch",
344-
"@vercel/agent-eval@2.2.1": "patches/@vercel__agent-eval@2.2.1.patch",
345-
"@vercel/og@1.0.1": "patches/@vercel__og@1.0.1.patch"
346-
}
347-
}
305+
"packageManager": "pnpm@12.9.1"
348306
}

‎packages/next-codemod/lib/__tests__/agents-md-e2e.test.js‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ jest.autoMockOff()
44
const fs = require('fs')
55
const path = require('path')
66
const os = require('os')
7+
const { execFileSync } = require('child_process')
78
const { runAgentsMd } = require('../../bin/agents-md')
89
const { getNextjsVersion } = require('../../lib/agents-md')
910

@@ -428,9 +429,27 @@ This is my project documentation.
428429
})
429430

430431
it('returns error when Next.js is not installed', () => {
431-
// Use a directory where next is not installed
432-
const nonNextDir = '/tmp'
433-
const result = getNextjsVersion(nonNextDir)
432+
// pnpm's Jest launcher adds hoisted dependencies to NODE_PATH, which causes `require.resolve`
433+
// to succeed despite us passing in a bad cwd. We need to fork a child node process with
434+
// `NODE_PATH` unset.
435+
//
436+
// This isn't an issue when the CLI is normally run: `pnpx` won't have a hoisted `next`
437+
// package in the path.
438+
const env = { ...process.env }
439+
delete env.NODE_PATH
440+
const result = JSON.parse(
441+
execFileSync(
442+
process.execPath,
443+
[
444+
'-e',
445+
`const { getNextjsVersion } = require(process.argv[1])
446+
console.log(JSON.stringify(getNextjsVersion(process.argv[2])))`,
447+
path.join(__dirname, '../agents-md.js'),
448+
testProjectDir,
449+
],
450+
{ env, encoding: 'utf8' }
451+
)
452+
)
434453

435454
expect(result.version).toBeNull()
436455
expect(result.error).toBe('Next.js is not installed in this project.')

‎packages/next/next-devtools.webpack-config.js‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,28 @@ module.exports = ({ dev, ...rest }) => {
5858
resolve: {
5959
alias: {
6060
// TODO: Get dedicated React version for NDT to uncouple development.
61-
react: `next/dist/compiled/react${bundledReactChannel}`,
62-
'react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}`,
63-
'react-dom/client$': `next/dist/compiled/react-dom${bundledReactChannel}/client`,
64-
'react-is$': `next/dist/compiled/react-is${bundledReactChannel}`,
65-
scheduler$: `next/dist/compiled/scheduler${bundledReactChannel}`,
61+
// Absolute paths keep dependencies from resolving a hoisted npm copy
62+
// of Next and bundling a second React instance.
63+
react: path.join(
64+
__dirname,
65+
`dist/compiled/react${bundledReactChannel}`
66+
),
67+
'react-dom$': path.join(
68+
__dirname,
69+
`dist/compiled/react-dom${bundledReactChannel}`
70+
),
71+
'react-dom/client$': path.join(
72+
__dirname,
73+
`dist/compiled/react-dom${bundledReactChannel}/client`
74+
),
75+
'react-is$': path.join(
76+
__dirname,
77+
`dist/compiled/react-is${bundledReactChannel}`
78+
),
79+
scheduler$: path.join(
80+
__dirname,
81+
`dist/compiled/scheduler${bundledReactChannel}`
82+
),
6683
},
6784
extensions: ['.ts', '.tsx', '.js', '.json'],
6885
},

0 commit comments

Comments
 (0)