Repository navigation
fix(pkg-manifest): devDependencies/dependencies should win over peerDependencies when computing current specifiers - #13124
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughManifest dependency merging now lets dev, regular, and optional dependencies override overlapping peer dependency entries. Utility and CLI tests cover precedence and peer inclusion behavior, and a changeset documents the patch release. ChangesPeer dependency precedence
Estimated code review effort: 2 (Simple) | ~10 minutes Assessment against linked issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Confidence Score: 5/5Safe to merge — the change is a one-line reorder in a tiny utility, matches the established pattern in the sibling getWantedDependencies function, and is covered by targeted tests that fail against the old code. The reorder is mechanically correct and the old duplicate copy is cleanly removed. All callers that pass autoInstallPeers: true now get the right precedence; callers that omit the option were already unaffected by peers. No files require special attention. Reviews (5): Last reviewed commit: "test(cli): simplify regression test comm..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/pkg-manifest/utils/test/getAllDependenciesFromManifest.test.ts`:
- Around line 4-28: Extend the getAllDependenciesFromManifest() tests with an
optionalDependencies case where an optional dependency uses an exact ~-prefixed
specifier and overrides a same-named peerDependencies entry when
autoInstallPeers is enabled. Assert the returned dependency map contains the
optional dependency’s exact specifier, covering the value consumed by the
writer.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a4af7794-0ee1-4793-b0fe-214b4d066ba2
📒 Files selected for processing (3)
.changeset/peer-prefix-precedence-fix.mdpnpm11/pkg-manifest/utils/src/index.tspnpm11/pkg-manifest/utils/test/getAllDependenciesFromManifest.test.ts
…ependencies when computing current specifiers
21c55d6 to
4d3f401
Compare
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…e module index.ts and getAllDependenciesFromManifest.ts each defined their own copy of the function, and the dormant standalone copy kept the old peers-last spread order. Keep the standalone module as the single implementation (with the fixed peers-first order) and re-export it from the package index, so the precedence cannot silently diverge again. Also reword the changeset to drop implementation detail from the release note and link the issue in the repo's changeset style.
A package declared in both devDependencies (exact) and peerDependencies (caret) must take its previous specifier from the real group when re-added, so the peer range's caret cannot leak into the written version. Mirrors the TypeScript tests for pnpm#13108; pacquet's findSpec-order scan already behaves correctly, so this test only guards the parity. Verified the test fails when the scan order is flipped to peers-first.
|
Code review by qodo was updated up to the latest commit bbeea26 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/tests/add.rs`:
- Around line 425-430: Remove the rustdoc prose above the test and replace it
with a concise standard comment referencing issue pnpm/pnpm#13108. Leave the
test implementation and behavior unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ca70ba30-0943-49d5-b5c8-84ee9af382e3
📒 Files selected for processing (4)
.changeset/peer-prefix-precedence-fix.mdpnpm/crates/cli/tests/add.rspnpm11/pkg-manifest/utils/src/getAllDependenciesFromManifest.tspnpm11/pkg-manifest/utils/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- .changeset/peer-prefix-precedence-fix.md
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13124 +/- ##
==========================================
+ Coverage 85.85% 85.86% +0.01%
==========================================
Files 505 505
Lines 83967 84047 +80
==========================================
+ Hits 72086 72167 +81
+ Misses 11881 11880 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4434757209600004,
"stddev": 0.1293974786826861,
"median": 2.39332909786,
"user": 1.5034899400000001,
"system": 1.2668362799999997,
"min": 2.3433387588600003,
"max": 2.75578850286,
"times": [
2.35583680586,
2.75578850286,
2.45180625286,
2.4116042118600003,
2.35744492386,
2.37505398386,
2.43807781786,
2.3716186828600003,
2.5741872688600003,
2.3433387588600003
]
},
{
"command": "pacquet@main",
"mean": 2.5115674334599998,
"stddev": 0.18359867261426618,
"median": 2.39095093486,
"user": 1.4616576399999999,
"system": 1.26055918,
"min": 2.36140961786,
"max": 2.77417509186,
"times": [
2.36140961786,
2.39212083486,
2.3797294848600004,
2.77275277686,
2.3616112468600003,
2.3897810348600004,
2.36474966786,
2.72769892186,
2.77417509186,
2.5916456568600004
]
},
{
"command": "pnpr@HEAD",
"mean": 1.51721658336,
"stddev": 0.12547715892342506,
"median": 1.46931303336,
"user": 1.0044258400000001,
"system": 1.15124158,
"min": 1.36309129186,
"max": 1.76189473386,
"times": [
1.4231908498599999,
1.6047074798599998,
1.49716335086,
1.5919515048600001,
1.76189473386,
1.44146271586,
1.43438683086,
1.42039099486,
1.63392608086,
1.36309129186
]
},
{
"command": "pnpr@main",
"mean": 1.5102001921600001,
"stddev": 0.1553651388805548,
"median": 1.4834570188599998,
"user": 1.03868494,
"system": 1.1152842799999998,
"min": 1.34893848086,
"max": 1.73874737886,
"times": [
1.34893848086,
1.73874737886,
1.58491699786,
1.40808100786,
1.6502376408600001,
1.38800247286,
1.36211594786,
1.70895117286,
1.35317779186,
1.55883302986
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24999121366,
"stddev": 0.004933542407535313,
"median": 0.25010419695999997,
"user": 0.20007105999999997,
"system": 0.5238037,
"min": 0.24353356746000002,
"max": 0.25693470546,
"times": [
0.24835176646,
0.24525538446,
0.24361868746,
0.25180061146,
0.24353356746000002,
0.24840778246,
0.25693470546,
0.25307117146,
0.25647519146000003,
0.25246326846
]
},
{
"command": "pacquet@main",
"mean": 0.24743554496000003,
"stddev": 0.00790815443805872,
"median": 0.24898828946,
"user": 0.19587455999999998,
"system": 0.5167565999999999,
"min": 0.23658409946,
"max": 0.25957275546,
"times": [
0.25022331646,
0.23956224946000002,
0.25155151246,
0.25957275546,
0.23847852246,
0.23658409946,
0.24775326246,
0.25518947346,
0.25365596046,
0.24178429746000002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27240388156000006,
"stddev": 0.0050331287184695855,
"median": 0.27232299596,
"user": 0.21457056,
"system": 0.5280721999999999,
"min": 0.26182722446,
"max": 0.27977794846000004,
"times": [
0.26835274546,
0.27612513946,
0.27135811646,
0.27159462946,
0.27227188446,
0.27977794846000004,
0.27250217746,
0.26182722446,
0.27237410746,
0.27785484246000003
]
},
{
"command": "pnpr@main",
"mean": 0.26356302596000003,
"stddev": 0.005067025413740405,
"median": 0.26315414546000004,
"user": 0.20507356,
"system": 0.5155269,
"min": 0.25415385546,
"max": 0.27117316846,
"times": [
0.26124751446,
0.26032528146,
0.27117316846,
0.26028639846,
0.25415385546,
0.26499026246,
0.26954711146,
0.26181616446,
0.26759837646,
0.26449212646000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7013258690199997,
"stddev": 0.016207693672995103,
"median": 2.69970415582,
"user": 1.6102104599999998,
"system": 1.25495812,
"min": 2.68136211082,
"max": 2.7320254248199998,
"times": [
2.7320254248199998,
2.68796312382,
2.70134715982,
2.70527686982,
2.68852984882,
2.72432874382,
2.69043135482,
2.68136211082,
2.6980611518199997,
2.70393290182
]
},
{
"command": "pacquet@main",
"mean": 2.69078814302,
"stddev": 0.02417159560426923,
"median": 2.69180316732,
"user": 1.57360606,
"system": 1.2561258199999998,
"min": 2.6403600098199997,
"max": 2.73262373082,
"times": [
2.70464544182,
2.73262373082,
2.7021909058199998,
2.6403600098199997,
2.68013834482,
2.67829023982,
2.68697583082,
2.68046432682,
2.70556209582,
2.69663050382
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6073607809200001,
"stddev": 0.1512387842882762,
"median": 1.59104090282,
"user": 0.9451634599999998,
"system": 1.1120099200000002,
"min": 1.39380127782,
"max": 1.8007982148200001,
"times": [
1.39380127782,
1.58539309382,
1.59668871182,
1.4020319328200002,
1.5383608428200002,
1.5049029338200002,
1.70883314982,
1.75263430382,
1.79016334782,
1.8007982148200001
]
},
{
"command": "pnpr@main",
"mean": 1.4573862336199999,
"stddev": 0.0957831869338362,
"median": 1.42203032882,
"user": 0.9774840600000001,
"system": 1.08326382,
"min": 1.3726404888200001,
"max": 1.66245107882,
"times": [
1.43380086482,
1.39132321682,
1.66245107882,
1.41087926682,
1.43318139082,
1.5470151228200002,
1.3726404888200001,
1.39607128482,
1.5463321498200002,
1.38016747182
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5400273395200001,
"stddev": 0.011986316742459997,
"median": 0.54188704052,
"user": 0.6508079600000001,
"system": 0.64423532,
"min": 0.5173252875200001,
"max": 0.5582520495200001,
"times": [
0.5582520495200001,
0.55361192552,
0.5424720705200001,
0.53185580052,
0.54130201052,
0.5441779065200001,
0.54639909352,
0.5298306815200001,
0.5350465695200001,
0.5173252875200001
]
},
{
"command": "pacquet@main",
"mean": 0.5280189818200001,
"stddev": 0.008774373872752546,
"median": 0.5301784865200001,
"user": 0.6405668600000001,
"system": 0.6407145200000001,
"min": 0.5170135935200001,
"max": 0.5429194825200001,
"times": [
0.5171203045200001,
0.53424264852,
0.52137742752,
0.5199132945200001,
0.5306790575200001,
0.5429194825200001,
0.5314098505200001,
0.53583624352,
0.5170135935200001,
0.5296779155200001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.28952213511999997,
"stddev": 0.006556843843580921,
"median": 0.29020305702,
"user": 0.17951956,
"system": 0.50290722,
"min": 0.27582624452,
"max": 0.29862374052,
"times": [
0.29148930552,
0.29135836952,
0.29795079452,
0.28685475152,
0.27582624452,
0.28766345252000003,
0.28904774452,
0.28474248152,
0.29862374052,
0.29166446652
]
},
{
"command": "pnpr@main",
"mean": 0.29254377832,
"stddev": 0.006967389631107587,
"median": 0.29197080102,
"user": 0.18500226000000003,
"system": 0.50091412,
"min": 0.28321685252,
"max": 0.30214508052,
"times": [
0.28972651052,
0.28440552652,
0.28647777252,
0.28994510252,
0.30149168252,
0.29399649952,
0.30000157052,
0.28321685252,
0.30214508052,
0.29403118552
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8324687343600004,
"stddev": 0.010529259318366235,
"median": 1.83059123056,
"user": 0.8526300599999999,
"system": 0.73318666,
"min": 1.81803673906,
"max": 1.8504782570600002,
"times": [
1.8431181490600002,
1.8342825760600001,
1.8504782570600002,
1.82585774606,
1.8313607520600002,
1.8298217090600002,
1.8439600520600001,
1.8268126900600001,
1.81803673906,
1.8209586730600003
]
},
{
"command": "pacquet@main",
"mean": 1.8291811232600002,
"stddev": 0.010827430428389842,
"median": 1.82978914206,
"user": 0.8841694599999999,
"system": 0.6788418599999999,
"min": 1.8035317160600002,
"max": 1.8399664930600002,
"times": [
1.8263722420600002,
1.8399664930600002,
1.83276288906,
1.8379366350600002,
1.8233506400600001,
1.8035317160600002,
1.8268153950600001,
1.8365757770600002,
1.8381826980600002,
1.8263167470600001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.28858640335999997,
"stddev": 0.011138417268206302,
"median": 0.28896207606,
"user": 0.18243376000000003,
"system": 0.49663445999999994,
"min": 0.27437008406,
"max": 0.30743645606000003,
"times": [
0.29067661506000003,
0.30743645606000003,
0.28577799506,
0.28724753706,
0.29224154706,
0.29413649906,
0.30205412706,
0.27533432706,
0.27658884606,
0.27437008406
]
},
{
"command": "pnpr@main",
"mean": 0.29109835036,
"stddev": 0.005704349873019998,
"median": 0.29072757506,
"user": 0.17639256,
"system": 0.51392226,
"min": 0.28450143306000003,
"max": 0.30220597206,
"times": [
0.29671673206,
0.29534688506,
0.28515097506,
0.28533285606000003,
0.28851345806,
0.30220597206,
0.29176004206,
0.29031832006,
0.28450143306000003,
0.29113683006
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.31451601174000005,
"stddev": 0.009335898323047669,
"median": 0.31091174894,
"user": 0.30597921999999994,
"system": 0.05149028,
"min": 0.30366326044,
"max": 0.33426133144000003,
"times": [
0.30366326044,
0.31035478144,
0.31067906144,
0.30892538544000003,
0.32527528544,
0.32090568944000003,
0.31114443644,
0.31143951044,
0.33426133144000003,
0.30851137544
]
},
{
"command": "pacquet@main",
"mean": 0.31989061614000003,
"stddev": 0.01097558839830296,
"median": 0.32086437194,
"user": 0.30683612,
"system": 0.05679578,
"min": 0.30566295944000005,
"max": 0.33399970044000005,
"times": [
0.33079906144000004,
0.30593530144000003,
0.33399970044000005,
0.32662576444,
0.31197712144,
0.33239843944,
0.30566295944000005,
0.32129061244,
0.32043813144,
0.30977906944
]
},
{
"command": "pnpr@HEAD",
"mean": 0.0844864110157576,
"stddev": 0.002403422079614919,
"median": 0.08399127644000001,
"user": 0.019192641212121213,
"system": 0.008754924848484847,
"min": 0.08107129544000001,
"max": 0.08929664144,
"times": [
0.08655208144000001,
0.08218286644,
0.08159098344000001,
0.08263302344000001,
0.08243709444000001,
0.08356173044000001,
0.08135026044,
0.08332652644,
0.08220795344000001,
0.08325007244,
0.08675824944,
0.08734716644000001,
0.08700177744000001,
0.08107129544000001,
0.08429327444000001,
0.08641728844,
0.08191564444,
0.08455816344000001,
0.08682268044000001,
0.08652636344,
0.08399127644000001,
0.08823778044000001,
0.08929664144,
0.08202737444000001,
0.08493148444000001,
0.08801442144,
0.08490396244000001,
0.08338088944000001,
0.08876230844,
0.08530139944000001,
0.08262567944,
0.08194293544,
0.08283091444000001
]
},
{
"command": "pnpr@main",
"mean": 0.083994814565,
"stddev": 0.002288663481632044,
"median": 0.08330025194000001,
"user": 0.020186426250000004,
"system": 0.007686200000000001,
"min": 0.08116267844000001,
"max": 0.08824810044,
"times": [
0.08824810044,
0.08506347244000001,
0.08374615544000001,
0.08172537544000001,
0.08328950644000001,
0.08695734344000002,
0.08710203644,
0.08805773244000001,
0.08760302744000001,
0.08721776344000001,
0.08410910844000001,
0.08244045044000001,
0.08324566544,
0.08173750844000001,
0.08252229444,
0.08116267844000001,
0.08396503744000001,
0.08153558944000001,
0.08245672244,
0.08244183344000001,
0.08214978444000001,
0.08233511244000001,
0.08183124544,
0.08344519944,
0.08161652144,
0.08556471544000001,
0.08537721244,
0.08188739044000001,
0.08175915944,
0.08331099744,
0.08776090544000001,
0.08616842044
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.45512822638,
"stddev": 0.06616515706391381,
"median": 4.42844598508,
"user": 1.67581056,
"system": 1.3417682,
"min": 4.4089181250800005,
"max": 4.58779346108,
"times": [
4.42349843908,
4.41056392908,
4.44378334908,
4.4089181250800005,
4.41977877508,
4.58779346108,
4.437953027080001,
4.56926752808,
4.43339353108,
4.416332099080001
]
},
{
"command": "pacquet@main",
"mean": 4.526811487380001,
"stddev": 0.10858757753917844,
"median": 4.508344447580001,
"user": 1.6586601600000002,
"system": 1.3617542,
"min": 4.420347337080001,
"max": 4.75372937908,
"times": [
4.429816475080001,
4.53204750508,
4.600302039080001,
4.540649758080001,
4.424193021080001,
4.62935470908,
4.75372937908,
4.453033260080001,
4.420347337080001,
4.48464139008
]
},
{
"command": "pnpr@HEAD",
"mean": 3.51205267988,
"stddev": 0.07508046825864728,
"median": 3.47920136958,
"user": 1.16043386,
"system": 1.1941907,
"min": 3.44225157308,
"max": 3.62190647908,
"times": [
3.45258252108,
3.62190647908,
3.44930428908,
3.45023672908,
3.53972722408,
3.44225157308,
3.6154611120799998,
3.59516197208,
3.44807468108,
3.5058202180799998
]
},
{
"command": "pnpr@main",
"mean": 3.55150832968,
"stddev": 0.12285195345817221,
"median": 3.48411331908,
"user": 1.1343177599999998,
"system": 1.2366375,
"min": 3.43323011508,
"max": 3.76098983208,
"times": [
3.45929309808,
3.4490394860799998,
3.44883095508,
3.43323011508,
3.66455079908,
3.65931376308,
3.76098983208,
3.50002191108,
3.6716086100800003,
3.46820472708
]
}
]
} |
|
| Branch | pr/13124 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,393.80 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 274.37 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 275.83 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 81.07 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,363.09 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,442.25 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 261.83 ms |
@coderabbitai resume |
|
✅ Action performedReviews resumed. |
✅ Action performedReview finished.
|
|
Congrats on merging your first pull request! 🎉🎉🎉 |
…verage Re-add the explicit autoInstallPeers: false test that the test rewrite dropped, and remove the changeset: the user-visible fix for pnpm#13108 already shipped and was released via pnpm#13124, so this PR no longer changes behavior and must not emit a duplicate release note. Co-Authored-By: Claude Fable 5 <[email protected]>
Multiple contributors keep submitting parallel PRs for the same issue (e.g. #13114 was superseded by #13124 for issue #13108). GitHub already cross-links every PR that references an issue on the issue's timeline, so add a checklist item prompting authors to check those links before submitting. Co-Authored-By: Claude Fable 5 <[email protected]>
…#13498) Multiple contributors keep submitting parallel PRs for the same issue (e.g. #13114 was superseded by #13124 for issue #13108). GitHub already cross-links every PR that references an issue on the issue's timeline, so add a checklist item prompting authors to check those links before submitting.
Dependencies
when computing current specifiers
Summary
peerDependencieswas spread last ingetAllDependenciesFromManifest, so a peer entry like"react": "^19.0.0"silently overwrote a realdevDependencies/dependencies/optionalDependenciesentry for the same package when computing "current specifiers" duringpnpm add/pnpm update. That^-prefixed value then leaked into the resolver's pinned-version detection, overriding--save-exact/--save-prefixand writing^19.2.7instead of the requested19.2.7.The sibling function
getWantedDependenciesalready spreadspeerDependenciesfirst for exactly this reason — this function just had the order backwards.Review follow-ups: the two same-named definitions of
getAllDependenciesFromManifest(the dormant standalone copy kept the old peers-last order) are consolidated into a single module re-exported from the package index (0ef3520), and pacquet gained a regression test pinning the equivalent precedence in itsaddprev-specifier scan (bbeea26).Closes #13108
Squash Commit Body
Checklist
The change is implemented in both the TypeScript CLI and the Rust
pnpm/port, or the description notes what still needs porting.No Rust-side behavior change needed — pacquet already gives real dependency groups precedence over
peerDependencieseverywhere the TypeScript bug could occur: theaddprev-specifier scan reads peers last (first match wins),updatenever reads peers and matches previous specifiers by name and group, and the resolver's wanted-deps merge spreads peers first. The pacquet regression testadd_existing_dependency_ignores_pin_from_peer_range(bbeea26) now pins theaddscan's precedence; it was verified to fail when the scan order is flipped to peers-first.Added a changeset (
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Added or updated tests.
Updated the documentation if needed.
Description edited by an agent (Claude Code, claude-fable-5): corrected the Rust parity note and recorded the review follow-up commits.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
Summary by CodeRabbit
Bug Fixes
dependencies/devDependencies/optionalDependenciescorrectly overridepeerDependencieswhen computing specifiers and when writing versions/prefixes (including--save-exact,--save-prefix, andupdate).Tests
addbehavior with pinned non-peer entries vs peer ranges, and added Jest coverage for peer auto-install precedence and inclusion/exclusion behavior.