Commit 4dbd137
authored
Implements a pnpm lockfile migration & more (#197)
This PR adds some basic logic to import pnpm lockfile into Yarn. It's
not perfect because the pnpm lockfile is unfortunately a little bare -
for example it doesn't contain the original ranges. The import process
works like this:
- We run `pnpm list -r --depth 3` to try and get the list of packages in
the dependency tree, and their path + tarball
- `--depth 3` is arbitrary; more than that crashes the process, and less
than that means we'd miss more ranges
- Then we read the `package.json` for each path
- We iterate the `dependencies` field from the `package.json` to obtain
the original range, and we attach it to whatever version we have in the
`pnpm list` output
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces pnpm installation/migration support and improves registry
fetching/auth.
>
> - Adds lockfile import from existing `pnpm` installs by parsing `pnpm
list --json` and package manifests; falls back to this when no lockfile
exists
> - Switches pnpm virtual store from `node_modules/.store` to
`node_modules/.pnpm`; updates config schema (`pnpmStoreFolder`), docs,
tests, and linker paths/hoisting pattern type (`IdentGlob`)
> - Extends `npm:` references with optional tarball URL; preserve
shorthand only when URL absent; adjust descriptor resolution/alias
handling accordingly
> - Implements registry auth resolution (scopes, per-registry,
`npmAlwaysAuth`), sends Authorization headers for npm and URL fetches;
adds stricter auth requirement helper and scope normalization
> - Tweaks install graph for inner dependencies (alias vs patch) to
resolve/refresh vs fetch appropriately
> - Minor utils: `UrlEncoded` deref, string serialization error type,
case-insensitive %2f decoding; new error for pnpm node_modules read
> - New acceptance tests for pnpm migration and custom pnpm store
location
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1aaebb5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 8dca647 commit 4dbd137
44 files changed
Lines changed: 782 additions & 280 deletions
File tree
- .claude
- documentation/src
- content/docs/concepts/core
- utils/configuration
- packages
- zpm-config
- src
- zpm-primitives/src
- zpm-utils/src
- zpm/src
- commands
- npm
- fetchers
- linker
- resolvers
- tests/acceptance-tests
- pkg-tests-core/sources/utils
- pkg-tests-fixtures/packages
- @scoped__no-deps-1.0.0
- @scoped__no-deps-1.0.1
- @scoped__no-deps-2.0.0
- one-scoped-range-dep-1.0.0
- one-scoped-range-dep-2.0.0
- unconventional-tarball-2.0.0
- pkg-tests-specs/sources
- commands
- features
- protocols
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
| 485 | + | |
486 | 486 | | |
487 | 487 | | |
488 | | - | |
| 488 | + | |
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | 934 | | |
938 | 935 | | |
939 | 936 | | |
| |||
954 | 951 | | |
955 | 952 | | |
956 | 953 | | |
| 954 | + | |
957 | 955 | | |
958 | 956 | | |
959 | 957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
50 | | - | |
51 | | - | |
52 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| 63 | + | |
56 | 64 | | |
57 | 65 | | |
58 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
0 commit comments