Commit 401406a
feat: add support for pnpm 11 (#2802)
pnpm 11 introduced several breaking changes to the lockfile format that
this commit addresses:
1. patchedDependencies path moved to pnpm-workspace.yaml: pnpm 11 no
longer includes the patch file path in pnpm-lock.yaml (only the hash).
Add _normalize_patched_dependencies() to look up the path from
pnpm-workspace.yaml and restore the dict form expected by the rest of
the code.
2. Multi-document lockfile format: in some situations, such as when
configDependencies are present, pnpm 11 prepends an "env lockfile" YAML
document to pnpm-lock.yaml. Update the yq invocation to always return
the last document regardless of whether the file has one or two YAML
documents.
3. Changed peer dependency path encoding in snapshot keys: pnpm 11
encodes workspace-relative peer dep paths with a leading '+' (e.g.
`@scoped/b@+projects+b` instead of `@scoped/b@projects+b`), which
changes the generated virtual store target names.
Also adds v110 test fixtures (lockfile, workspace config, snapshots) and
reorganizes the e2e/pnpm_lockfiles setup so each version (v90, v101,
v110) is self-contained. v90 needs its own package.json and
pnpm-workspace.yaml, because pnpm 9 requires some things to be in
package.json that are expected in pnpm-workspace.yaml in later versions.
Fixes #2798.
---
### Changes are visible to end-users: yes
- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config): no
- Suggested release notes appear below: no
### Test plan
- New test cases added
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent a55809f commit 401406a
38 files changed
Lines changed: 4091 additions & 270 deletions
File tree
- docs
- e2e/pnpm_lockfiles
- base
- cases/multi-document-v11
- v101
- snapshots
- v110
- snapshots
- v90
- snapshots
- npm/private
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
| 274 | + | |
278 | 275 | | |
279 | 276 | | |
280 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments