Commit 1e0dd05
authored
Pnpm lockfile migration (#283)
This PR adds a way to migrate a repository from pnpm to Yarn. I have an
older repository I need to migrate so this will be handy.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Modifies lockfile generation by shelling out to `pnpm` and
interpreting its tree, including optional-dependency and path handling;
incorrect parsing could produce wrong resolutions during migrations.
CI/e2e coverage is added, but behavior depends on pnpm version
differences.
>
> **Overview**
> Adds a pnpm-to-Yarn migration path that builds a Yarn `Lockfile` from
`node_modules` by invoking `pnpm list -r --json`, selecting
`--depth=Infinity` on newer pnpm versions (fallback `--depth=3`),
normalizing relative paths, and skipping missing optional dependencies.
>
> Updates the e2e sandbox image to install `pnpm`, and introduces a new
`tests/e2e/pnpm-migration.sh` that asserts the migration largely
preserves pnpm-resolved package versions after switching to `yarn
install`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1d9b669. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent defef18 commit 1e0dd05
File tree
5 files changed
+113
-7
lines changed- .github/actions/run-e2e-sandbox
- packages
- zpm-primitives/src
- zpm/src
- tests/e2e
5 files changed
+113
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
| 412 | + | |
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
| |||
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
441 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
442 | 451 | | |
443 | | - | |
| 452 | + | |
444 | 453 | | |
445 | 454 | | |
446 | 455 | | |
| |||
466 | 475 | | |
467 | 476 | | |
468 | 477 | | |
469 | | - | |
| 478 | + | |
470 | 479 | | |
471 | 480 | | |
472 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
473 | 488 | | |
474 | 489 | | |
475 | 490 | | |
476 | 491 | | |
| 492 | + | |
| 493 | + | |
477 | 494 | | |
478 | 495 | | |
479 | 496 | | |
| |||
487 | 504 | | |
488 | 505 | | |
489 | 506 | | |
490 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
491 | 512 | | |
492 | 513 | | |
493 | 514 | | |
| |||
501 | 522 | | |
502 | 523 | | |
503 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
504 | 544 | | |
505 | 545 | | |
506 | 546 | | |
| |||
| 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 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
0 commit comments