Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
36589b5d
Unverified
Commit
36589b5d
authored
May 07, 2026
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
May 07, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[backport][test] Pin package manager to patch versions (#93596)
parent
ad6fd4e5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
1 deletion
+37
-1
nx-handling.test.ts
test/e2e/app-dir/nx-handling/nx-handling.test.ts
+1
-0
index.test.ts
test/e2e/handle-non-hoisted-swc-helpers/index.test.ts
+11
-1
utils.ts
test/e2e/yarn-pnp/test/utils.ts
+5
-0
pnpm.test.ts
.../integration/create-next-app/package-manager/pnpm.test.ts
+8
-0
create-next-install.js
test/lib/create-next-install.js
+5
-0
base.ts
test/lib/next-modes/base.ts
+7
-0
No files found.
test/e2e/app-dir/nx-handling/nx-handling.test.ts
View file @
36589b5d
...
...
@@ -11,6 +11,7 @@ describe('nx-handling', () => {
name
:
'@nx-next/source'
,
version
:
'0.0.0'
,
private
:
true
,
packageManager
:
'npm@10.9.2'
,
scripts
:
{
build
:
'rm -rf dist; nx run next-nx-test:build'
,
dev
:
'nx run next-nx-test:dev'
,
...
...
test/e2e/handle-non-hoisted-swc-helpers/index.test.ts
View file @
36589b5d
import
{
createNext
}
from
'e2e-utils'
import
{
createNext
,
isNextDev
}
from
'e2e-utils'
import
{
NextInstance
}
from
'e2e-utils'
import
{
renderViaHTTP
}
from
'next-test-utils'
...
...
@@ -24,8 +24,18 @@ describe('handle-non-hoisted-swc-helpers', () => {
}
`
,
},
packageJson
:
{
packageManager
:
'npm@10.9.2'
,
scripts
:
{
build
:
'next build'
,
dev
:
'next dev'
,
start
:
'next start'
,
},
},
installCommand
:
'npm install; mkdir -p node_modules/next/node_modules/@swc; mv node_modules/@swc/helpers node_modules/next/node_modules/@swc/'
,
buildCommand
:
'npm run build'
,
startCommand
:
isNextDev
?
'npm run dev'
:
'npm run start'
,
dependencies
:
{},
})
})
...
...
test/e2e/yarn-pnp/test/utils.ts
View file @
36589b5d
...
...
@@ -49,6 +49,11 @@ export function runTests(
},
{}
as
{
[
key
:
string
]:
FileRef
}
),
packageJson
:
{
// Bootstrap with classic yarn; the install command below runs
// `yarn set version berry` which rewrites this to the berry version.
packageManager
:
'yarn@1.22.22'
,
},
dependencies
:
{
...
packageJson
.
dependencies
,
...
packageJson
.
devDependencies
,
...
...
test/integration/create-next-app/package-manager/pnpm.test.ts
View file @
36589b5d
import
{
command
,
DEFAULT_FILES
,
FULL_EXAMPLE_PATH
,
projectFilesShouldExist
,
...
...
@@ -9,6 +10,11 @@ import {
const
lockFile
=
'pnpm-lock.yaml'
const
files
=
[...
DEFAULT_FILES
,
lockFile
]
// Match the monorepo's pinned pnpm so CNA's `pnpm install` doesn't drift to
// whichever version corepack happens to fetch as "latest" at test time.
const
rootPackageManager
:
string
=
require
(
'../../../../package.json'
).
packageManager
describe
(
'create-next-app with package manager pnpm'
,
()
=>
{
let
nextTgzFilename
:
string
...
...
@@ -17,6 +23,8 @@ describe('create-next-app with package manager pnpm', () => {
throw
new
Error
(
'This test needs to be run with `node run-tests.js`.'
)
}
await
command
(
'corepack'
,
[
'prepare'
,
'--activate'
,
rootPackageManager
])
const
pkgPaths
=
new
Map
<
string
,
string
>
(
JSON
.
parse
(
process
.
env
.
NEXT_TEST_PKG_PATHS
)
)
...
...
test/lib/create-next-install.js
View file @
36589b5d
...
...
@@ -9,6 +9,7 @@ const { linkPackages } =
const
PREFER_OFFLINE
=
process
.
env
.
NEXT_TEST_PREFER_OFFLINE
===
'1'
const
useRspack
=
process
.
env
.
NEXT_TEST_USE_RSPACK
===
'1'
const
ROOT_PACKAGE_MANAGER
=
require
(
'../../package.json'
).
packageManager
async
function
installDependencies
(
cwd
,
tmpDir
)
{
const
args
=
[
...
...
@@ -176,6 +177,10 @@ async function createNextInstall({
path
.
join
(
installDir
,
'package.json'
),
JSON
.
stringify
(
{
// Pin packageManager so corepack doesn't auto-inject a reference
// to the latest version (and rewrite this file mid-test).
// Callers can override via packageJson.packageManager.
packageManager
:
ROOT_PACKAGE_MANAGER
,
...
packageJson
,
scripts
,
dependencies
:
combinedDependencies
,
...
...
test/lib/next-modes/base.ts
View file @
36589b5d
...
...
@@ -64,6 +64,9 @@ const nextjsReactPeerVersion = "19.1.0";
const
latestSupportedTypeScriptVersion
=
'5.8.2'
const
latestSupportedNodeTypesVersion
=
'20.17.6'
const
ROOT_PACKAGE_MANAGER
:
string
=
require
(
'../../../package.json'
).
packageManager
export
class
NextInstance
{
protected
files
:
ResolvedFileConfig
protected
overrideFiles
:
ResolvedFileConfig
...
...
@@ -228,6 +231,10 @@ export class NextInstance {
path
.
join
(
this
.
testDir
,
'package.json'
),
JSON
.
stringify
(
{
// Pin packageManager so corepack doesn't auto-inject a reference
// to the latest version (and rewrite this file mid-test).
// Callers can override via packageJson.packageManager.
packageManager
:
ROOT_PACKAGE_MANAGER
,
...
this
.
packageJson
,
dependencies
:
{
...
finalDependencies
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment