Skip to content

Commit 2b67072

Browse files
B4nanCopilot
andauthored
chore: migrate v4 to pnpm 11 (#3645)
## What changes - Bump `packageManager` pnpm@10.24.0 → pnpm@11.0.9 (and the matching `volta` hint). - Drop `preinstall: npx only-allow pnpm` (ships in publish tarballs and breaks downstream npm consumers — see apify/apify-client-js#893; `only-allow`'s own `node_modules` guard catches the case but the `npx` bootstrap fails first in `npm install -g` context). - Add `devEngines.packageManager: { name: pnpm, version: 11.0.9, onFail: error }`. pnpm v11 reimplemented `pnpm config / version / pkg` as native subcommands (v10 still shells to npm), so `error` is safe here. - Migrate `pnpm-workspace.yaml` from `onlyBuiltDependencies` (pnpm 10 list) to `allowBuilds` (pnpm 11 explicit map). Add `strictDepBuilds: false` so install still proceeds if a new build-requesting dep shows up without an explicit entry; existing entries all flipped to `true` to preserve current build behavior. - `pnpm-lock.yaml`: minor inline of `patchedDependencies` (one-line hash) — pnpm 11 lockfile reader normalizes the old `hash:` / `path:` map. Lockfile version stays at 9.0. ## Why on v4 specifically All v4 packages require Node 22+ (the exception is `stagehand-crawler` at `>=16`, untouched here). pnpm v11 also requires Node 22+, so v4 is the natural place to land the upgrade — `master` (still supporting Node 18/20) stays on pnpm 10. ## Verified locally - `corepack pnpm --version` after the change → `11.0.9` (Corepack picks it up from `packageManager`). - `pnpm install --frozen-lockfile` succeeds. - `pnpm rebuild` runs all builds in the `allowBuilds` map without errors (better-sqlite3, nx postinstall, puppeteer, etc.). ## CI notes - All workflows use `apify/workflows/pnpm-install@main`, which corepacks pnpm from `packageManager` — picks up v11 automatically. - Releases use `lerna version`, not `pnpm version`, so the v10 npm-shellout trap from apify/apify-client-js#895 doesn't apply. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: B4nan <615580+B4nan@users.noreply.github.com>
1 parent d633c8b commit 2b67072

4 files changed

Lines changed: 32 additions & 21 deletions

File tree

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
},
3232
"homepage": "https://crawlee.dev",
3333
"scripts": {
34-
"preinstall": "npx only-allow pnpm",
3534
"prepublishOnly": "turbo run copy --filter=./packages/*",
3635
"clean": "turbo run clean --filter=./packages/* && rimraf .turbo packages/*/.turbo packages/*/*.tsbuildinfo",
3736
"build": "turbo run build --filter=./packages/* && node ./scripts/typescript_fixes.mjs",
@@ -119,9 +118,16 @@
119118
"oxfmt --write --no-error-on-unmatched-pattern"
120119
]
121120
},
122-
"packageManager": "pnpm@10.24.0",
121+
"packageManager": "pnpm@11.0.9",
122+
"devEngines": {
123+
"packageManager": {
124+
"name": "pnpm",
125+
"version": "11.0.9",
126+
"onFail": "error"
127+
}
128+
},
123129
"volta": {
124130
"node": "24.13.0",
125-
"pnpm": "10.24.0"
131+
"pnpm": "11.0.9"
126132
}
127133
}

packages/stagehand-crawler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "3.16.0",
44
"description": "AI-powered web crawling with Stagehand integration for Crawlee - enables natural language browser automation with act(), extract(), and observe() methods.",
55
"engines": {
6-
"node": ">=16.0.0"
6+
"node": ">=22.0.0"
77
},
88
"main": "./dist/index.js",
99
"module": "./dist/index.mjs",

pnpm-lock.yaml

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,27 @@ overrides:
2222
minimatch: "^9.0.0"
2323
"lerna>minimatch": "^3.1.4"
2424

25-
onlyBuiltDependencies:
26-
- "@apify/ui-icons"
27-
- "@playwright/browser-chromium"
28-
- "@playwright/browser-firefox"
29-
- "@playwright/browser-webkit"
30-
- "@swc/core"
31-
- better-sqlite3
32-
- bufferutil
33-
- core-js
34-
- esbuild
35-
- nx
36-
- protobufjs
37-
- puppeteer
38-
- unrs-resolver
25+
# pnpm 11 replaces `onlyBuiltDependencies` with an explicit `allowBuilds` map.
26+
# Each entry must be true (build allowed) or false (build skipped) — pnpm 11
27+
# refuses to install if any dep needs a build decision that isn't in the map
28+
# (combined with `strictDepBuilds: false` below so the install can still
29+
# proceed when new build-requesting deps appear without a manual entry).
30+
allowBuilds:
31+
"@apify/ui-icons": true
32+
"@playwright/browser-chromium": true
33+
"@playwright/browser-firefox": true
34+
"@playwright/browser-webkit": true
35+
"@swc/core": true
36+
better-sqlite3: true
37+
bufferutil: true
38+
core-js: true
39+
esbuild: true
40+
nx: true
41+
protobufjs: true
42+
puppeteer: true
43+
unrs-resolver: true
44+
45+
strictDepBuilds: false
3946

4047
nodeLinker: hoisted
4148
linkWorkspacePackages: true

0 commit comments

Comments
 (0)