Repository navigation
Conversation
|
Warning Review limit reached
Next review available in: 3 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ 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 |
PR Summary by QodoFix pacquet lockfile parity with pnpm 11 for Astro edge cases
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Confidence Score: 5/5The PR appears safe to merge. The previously reported optional duplicate is excluded because both dependency traversals share the same bundled-name set, and the added regression test directly pins that behavior; no blocking failure remains. Reviews (3): Last reviewed commit: "fix(deps-resolver): close two Astro lock..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Resolving the Astro workspace with pacquet produced a `pnpm-lock.yaml`
that differed from pnpm 11's by 306 lines. Two independent bugs account
for 143 of them.
`dedupe_injected_deps` splits a resolved package id into its name and
its `file:` payload on the first `@`. A scoped id
(`@test/pkg@file:packages/…`) starts with `@`, so the split returned the
scope tail and the `file:` strip failed — the injected workspace dep was
never recognized and stayed a `file:` snapshot where pnpm records
`link:`. Split on the whole `@file:` separator instead.
`extract_children` walked every entry of `dependencies` and
`optionalDependencies`, including the ones the manifest declares as
bundled. npm ships those inside the package's own tarball, and pnpm's
`getNonDevWantedDependencies` filters them out before resolution; the
missing filter pulled extra packages into the lockfile (`napi-wasm`
under `@parcel/watcher-wasm`, the whole `@napi-rs`/`@emnapi` set under
`@tailwindcss/oxide-wasm32-wasi`). Both spellings are honored, and
`true` means every entry of `dependencies`, matching npm. The bundled
set is computed once and shared by both `collect_deps` calls, so an
alias declared in both groups is dropped from both — upstream filters
the merged `{...optionalDependencies, ...dependencies}` map and reaches
the same result. The alias validation still runs over bundled entries
so an unusable alias is rejected either way, as it is upstream.
A third divergence from the same reproduction — a project's own
`peerDependencies` reaching its lockfile importer entry without
`autoInstallPeers` — landed separately as #13372 while this was
in review, so it is no longer part of this change.
The remaining divergences — the `parentPkgAliases` arm of upstream's
peer-shadowed-dependency omission, and local `file:*.tgz` tarballs
resolving without a manifest — are described in the issue; both need
design work beyond this change.
Related to #13334.
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Rebased onto The commit hash in my earlier reply above ( Written by an agent (Claude Code, claude-opus-5). |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. Changeset missing pnpm entry
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13374 +/- ##
==========================================
- Coverage 87.22% 87.22% -0.01%
==========================================
Files 536 536
Lines 92059 92075 +16
==========================================
+ Hits 80297 80310 +13
- Misses 11762 11765 +3 ☔ 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.5944862990199997,
"stddev": 0.14964301157176216,
"median": 2.63200859642,
"user": 1.54391918,
"system": 1.2197647,
"min": 2.36515168992,
"max": 2.7914015189200003,
"times": [
2.68733124592,
2.37705623892,
2.7914015189200003,
2.36515168992,
2.68633583392,
2.47083062792,
2.57768135892,
2.71574285292,
2.55920467992,
2.71412694292
]
},
{
"command": "pacquet@main",
"mean": 2.4787595799199997,
"stddev": 0.13127652420305608,
"median": 2.42216287842,
"user": 1.4926504799999998,
"system": 1.2682534999999997,
"min": 2.33685848292,
"max": 2.68016261292,
"times": [
2.68016261292,
2.37663615492,
2.37658210692,
2.57955647992,
2.38830677992,
2.33685848292,
2.57960985992,
2.65341795892,
2.45601897692,
2.36044638592
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5096904955200001,
"stddev": 0.12691867104830634,
"median": 1.5209123144199999,
"user": 1.0401517799999997,
"system": 1.1516616999999998,
"min": 1.33945969392,
"max": 1.70115031792,
"times": [
1.63248852492,
1.38264347792,
1.61315303492,
1.50070821992,
1.70115031792,
1.59268503292,
1.44117722992,
1.35232301392,
1.33945969392,
1.54111640892
]
},
{
"command": "pnpr@main",
"mean": 1.4901939729199998,
"stddev": 0.14204367931334205,
"median": 1.45493280692,
"user": 1.06899568,
"system": 1.1057242999999999,
"min": 1.35288945892,
"max": 1.75025783692,
"times": [
1.54804664192,
1.46516187892,
1.35288945892,
1.7198324069200002,
1.36765361192,
1.47589481592,
1.37258318092,
1.4049161619200001,
1.75025783692,
1.44470373492
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25980370738,
"stddev": 0.004391606393130098,
"median": 0.26053963238,
"user": 0.21725076,
"system": 0.5329374,
"min": 0.25278966938,
"max": 0.26576930138000004,
"times": [
0.25376331238000005,
0.25278966938,
0.25923387938000003,
0.26576930138000004,
0.25611312638,
0.25924492038,
0.26220183638000005,
0.26386183138,
0.26322485238000004,
0.26183434438000003
]
},
{
"command": "pacquet@main",
"mean": 0.25524531918000004,
"stddev": 0.006543541334922731,
"median": 0.25400140038,
"user": 0.20137686000000002,
"system": 0.5336700999999999,
"min": 0.24483356438000003,
"max": 0.26418348738,
"times": [
0.24483356438000003,
0.26202960238,
0.24808513338000002,
0.26418348738,
0.25254998938,
0.26336914338,
0.25132404038,
0.25412223838000003,
0.25807543038,
0.25388056238
]
},
{
"command": "pnpr@HEAD",
"mean": 0.26841438468000006,
"stddev": 0.013341288337162523,
"median": 0.26754808488000004,
"user": 0.21673146000000001,
"system": 0.5151856,
"min": 0.25355301638000005,
"max": 0.29435602138000005,
"times": [
0.27737453738,
0.29435602138000005,
0.26490582638000004,
0.27068760938,
0.27019034338000003,
0.28255903538000005,
0.25504254038,
0.25812100538000005,
0.25735391138,
0.25355301638000005
]
},
{
"command": "pnpr@main",
"mean": 0.26406341578000003,
"stddev": 0.01055887323353747,
"median": 0.26012343988000003,
"user": 0.19375865999999997,
"system": 0.5284834,
"min": 0.25054002538000003,
"max": 0.28291119838,
"times": [
0.28291119838,
0.27405126138,
0.27112692638,
0.25551441838000005,
0.25459548938000004,
0.25838950038,
0.25054002538000003,
0.25852327338000003,
0.26172360638000003,
0.27325845838
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.77468813964,
"stddev": 0.01645209818665853,
"median": 2.77601209424,
"user": 1.68880482,
"system": 1.33929688,
"min": 2.74827756524,
"max": 2.80050698624,
"times": [
2.74827756524,
2.77100947324,
2.77458781324,
2.75039180324,
2.77678799424,
2.77731887324,
2.7959766992399997,
2.77591388924,
2.77611029924,
2.80050698624
]
},
{
"command": "pacquet@main",
"mean": 2.76345490964,
"stddev": 0.022911400272955688,
"median": 2.76602429524,
"user": 1.65156022,
"system": 1.32960458,
"min": 2.72933301724,
"max": 2.79978405624,
"times": [
2.79978405624,
2.78300326224,
2.7344728422399998,
2.77994070824,
2.72933301724,
2.76245461624,
2.7425316992399997,
2.77786739624,
2.75556752424,
2.7695939742399998
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6574729997400002,
"stddev": 0.14083191226223515,
"median": 1.66077001624,
"user": 1.02107802,
"system": 1.1725410799999998,
"min": 1.43279540824,
"max": 1.85937175024,
"times": [
1.55523686924,
1.6119252342400001,
1.70961479824,
1.8276271722400002,
1.7270506252400002,
1.76476525824,
1.52615498324,
1.5601878982400001,
1.43279540824,
1.85937175024
]
},
{
"command": "pnpr@main",
"mean": 1.6566435183400003,
"stddev": 0.1842999885538109,
"median": 1.59944015574,
"user": 1.02326332,
"system": 1.15948198,
"min": 1.4341945022400002,
"max": 1.8895708482400002,
"times": [
1.8895708482400002,
1.4341945022400002,
1.8727614912400001,
1.59517916524,
1.60370114624,
1.49584447524,
1.4366460352400001,
1.56298586324,
1.8414580832400003,
1.83409357324
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.58825881976,
"stddev": 0.012584049793713161,
"median": 0.5889749715600001,
"user": 0.7053858,
"system": 0.6848935399999998,
"min": 0.5651863330600001,
"max": 0.6044993180600001,
"times": [
0.5945590370600001,
0.5769004310600001,
0.5752222830600001,
0.58974230106,
0.5882076420600001,
0.5651863330600001,
0.6044993180600001,
0.6014249680600001,
0.5989721410600001,
0.5878737430600001
]
},
{
"command": "pacquet@main",
"mean": 0.5817132032600001,
"stddev": 0.007958772842930464,
"median": 0.5842068425600001,
"user": 0.7243756,
"system": 0.6634284399999999,
"min": 0.5716588770600001,
"max": 0.5950567830600001,
"times": [
0.5784761170600001,
0.57189057206,
0.58831549506,
0.5950567830600001,
0.5854338920600001,
0.5838967090600001,
0.5859635580600001,
0.5716588770600001,
0.5719230530600001,
0.5845169760600001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30512893526,
"stddev": 0.004385032748802316,
"median": 0.30432693206,
"user": 0.20780559999999998,
"system": 0.53079714,
"min": 0.29919498306000003,
"max": 0.31207048606,
"times": [
0.30470160706,
0.30149618406,
0.31207048606,
0.30844416006,
0.30133384906,
0.30395225706,
0.29919498306000003,
0.30150327706,
0.31019722006,
0.30839532906
]
},
{
"command": "pnpr@main",
"mean": 0.30520481136000005,
"stddev": 0.007847240138844351,
"median": 0.30589579506,
"user": 0.18590439999999997,
"system": 0.54539834,
"min": 0.29399702106000003,
"max": 0.32357292406,
"times": [
0.32357292406,
0.30574268706,
0.30633304706000003,
0.30700848906,
0.29808490506,
0.30148155706,
0.29399702106000003,
0.30812407806000003,
0.30165450206,
0.30604890306
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.9035476063000005,
"stddev": 0.00792106484039395,
"median": 1.9050627057000002,
"user": 0.9261310999999999,
"system": 0.7639899399999999,
"min": 1.8872435787,
"max": 1.9146985917000001,
"times": [
1.9042568687,
1.9052250517000002,
1.9088205477000002,
1.8943651027,
1.9146985917000001,
1.9091200017,
1.9049003597,
1.9070404287,
1.8872435787,
1.8998055317
]
},
{
"command": "pacquet@main",
"mean": 1.8971776766000001,
"stddev": 0.007964065258940877,
"median": 1.9005601892000001,
"user": 0.9423331000000003,
"system": 0.7314158399999999,
"min": 1.8840921677000002,
"max": 1.9064762397000001,
"times": [
1.9010233267,
1.9064762397000001,
1.9039069427000002,
1.8975155637,
1.8895042247000002,
1.8840921677000002,
1.9000970517000002,
1.9027080967,
1.9010924657000001,
1.8853606867000001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.3009353255,
"stddev": 0.006270500240425738,
"median": 0.2990858087,
"user": 0.21205670000000004,
"system": 0.5231700399999999,
"min": 0.29498311670000005,
"max": 0.31430698770000004,
"times": [
0.29571193670000007,
0.29591205470000004,
0.29498311670000005,
0.31430698770000004,
0.29719881670000003,
0.30411092670000006,
0.29674755770000005,
0.30097280070000004,
0.30763086170000004,
0.30177819570000003
]
},
{
"command": "pnpr@main",
"mean": 0.30479155240000005,
"stddev": 0.007052208880477475,
"median": 0.3038227242,
"user": 0.21647420000000003,
"system": 0.5162786399999999,
"min": 0.2951655597,
"max": 0.31579174070000005,
"times": [
0.3007536377,
0.29697489470000005,
0.29958449670000004,
0.2951655597,
0.3020922167,
0.31184811970000004,
0.3072551647,
0.3128964617,
0.30555323170000004,
0.31579174070000005
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.3477340977200001,
"stddev": 0.010038401231679539,
"median": 0.34467218472000005,
"user": 0.34203308,
"system": 0.05390651999999999,
"min": 0.33569827072,
"max": 0.36326971472,
"times": [
0.33569827072,
0.35983201472000004,
0.34052080672000007,
0.34508612072000006,
0.33765266672000005,
0.34123170472000003,
0.36022162372000005,
0.36326971472,
0.34956980572000007,
0.34425824872000005
]
},
{
"command": "pacquet@main",
"mean": 0.3513940537200001,
"stddev": 0.009286224282300646,
"median": 0.35229386122000006,
"user": 0.34790368,
"system": 0.05194041999999999,
"min": 0.33572632372000005,
"max": 0.36630505072,
"times": [
0.36172118572000006,
0.36630505072,
0.35380062072000007,
0.35078710172000005,
0.34857202172000007,
0.34400726972000006,
0.35520225072000006,
0.33572632372000005,
0.34162573772000004,
0.35619297472000006
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08687192323612905,
"stddev": 0.0020966661061373104,
"median": 0.08710810072,
"user": 0.020607325161290317,
"system": 0.009287567741935487,
"min": 0.08174125872,
"max": 0.09091924372,
"times": [
0.09026246772,
0.08441747572,
0.08714602172000001,
0.08918365672,
0.08566835072000001,
0.08767240172,
0.08923711772000001,
0.08589924572,
0.08472628672,
0.08708200172,
0.08298489972,
0.08803822072,
0.08881149572000001,
0.08610280872000001,
0.08624388372,
0.08174125872,
0.08503755372,
0.08839125472,
0.08459389872,
0.08710810072,
0.08891002172,
0.08755486172,
0.08663672372,
0.08615882372,
0.08831897872,
0.08771588472,
0.08677641672,
0.09091924372,
0.08369696972,
0.08832341772,
0.08766987672
]
},
{
"command": "pnpr@main",
"mean": 0.08714206726545455,
"stddev": 0.0017689766761070172,
"median": 0.08713497072,
"user": 0.02105319515151515,
"system": 0.008866472727272723,
"min": 0.08228467172000001,
"max": 0.09056804272,
"times": [
0.08590344172,
0.08968863772,
0.08472671672,
0.08919386672,
0.08516037372,
0.08717954472,
0.09052662472,
0.08581133972,
0.08773701472,
0.08959117372,
0.09056804272,
0.08608171872,
0.08760027672000001,
0.08766438772,
0.08648183172,
0.08763309872,
0.08698363572000001,
0.08703141572,
0.08700396372000001,
0.08777700972000001,
0.08624481572,
0.08691530772,
0.08735647772,
0.08399275672,
0.08586920772000001,
0.08731305672,
0.08847443272,
0.08590387472,
0.08228467172000001,
0.08861721072,
0.08659806972,
0.08863925172,
0.08713497072
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.51516789554,
"stddev": 0.1625700217028838,
"median": 4.44752999594,
"user": 1.66653162,
"system": 1.3221722200000001,
"min": 4.41269712644,
"max": 4.83768730144,
"times": [
4.48188286444,
4.41789718344,
4.8033136164400005,
4.4409653994400005,
4.83768730144,
4.42018318744,
4.41269712644,
4.42378090544,
4.45917677844,
4.45409459244
]
},
{
"command": "pacquet@main",
"mean": 4.5194249838400005,
"stddev": 0.10898729529879053,
"median": 4.458903915940001,
"user": 1.7201307199999998,
"system": 1.32593082,
"min": 4.41962106244,
"max": 4.6956774684400004,
"times": [
4.4305894744400005,
4.62150525644,
4.6956774684400004,
4.4477216874400005,
4.42949495344,
4.41962106244,
4.45414753944,
4.46366029244,
4.68051292844,
4.55131917544
]
},
{
"command": "pnpr@HEAD",
"mean": 3.55438765324,
"stddev": 0.12629688423576868,
"median": 3.53354829544,
"user": 1.17345312,
"system": 1.20049472,
"min": 3.42216660244,
"max": 3.78972648644,
"times": [
3.45239477044,
3.42961372644,
3.42216660244,
3.66591247944,
3.68924932844,
3.78972648644,
3.57449484144,
3.45322170644,
3.56951640144,
3.4975801894400003
]
},
{
"command": "pnpr@main",
"mean": 3.53547962764,
"stddev": 0.08670734983760245,
"median": 3.51642882744,
"user": 1.1820252199999999,
"system": 1.17816692,
"min": 3.43667306144,
"max": 3.65705001844,
"times": [
3.43667306144,
3.60034865844,
3.4438535964400003,
3.65705001844,
3.50937637944,
3.47396728844,
3.4510910414400002,
3.60585197144,
3.52348127544,
3.6531029854400003
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13374 |
| 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,432.80 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 294.98 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 299.19 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 81.74 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,339.46 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,422.17 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 253.55 ms |
Investigating #13326 showed its reproduction already matches pnpm 11 byte for byte, fixed by eab73b3 (#13374) filtering bundled names out of `extract_children`. Porting the upstream `bundledDependencies` install suite — which had no pacquet counterpart, and is why the original defect shipped — surfaced two gaps that fix did not cover. A manifest may declare `bundleDependencies: true` instead of a name list, which npm and pnpm both read as "every entry of `dependencies` ships inside this tarball". The lockfile writer only understood the list form, and `PackageMetadata::bundled_dependencies` was typed `Option<Vec<String>>`, so the boolean could neither be written nor read back — a `pnpm-lock.yaml` written by pnpm 11 for such a package failed to parse. Model the field as the `string[] | boolean` union pnpm records, behind one shared `BundledDependencies::from_manifest` that both the install and env-installer writers call. The field's presence is also what tells the installer a package carries a populated `node_modules` of its own whose bins belong in that package's `node_modules/.bin`. Bundled packages are not lockfile children, so neither linker reached them: the isolated path's per-slot walk iterates `snapshot.dependencies`, and the hoisted path iterates graph nodes — `has_bundled_dependencies` was computed and stored on every hoisted node but had no reader. Both paths now run the second bin pass upstream's `linkAllBins` and `building/during-install` run. No platform gate is added to the resolver. The issue asks for one, but pnpm 11 resolves the subtree of a platform-incompatible optional package too (`[email protected]` on Linux, `@img/sharp-darwin-arm64`'s libvips edge), and `skip_optional_dependency_that_does_not_support_the_current_os` already asserts pacquet matches that. Related to #13326
Resolving the Astro workspace with pacquet produced a `pnpm-lock.yaml`
that differed from pnpm 11's by 306 lines. Two independent bugs account
for 143 of them.
`dedupe_injected_deps` splits a resolved package id into its name and
its `file:` payload on the first `@`. A scoped id
(`@test/pkg@file:packages/…`) starts with `@`, so the split returned the
scope tail and the `file:` strip failed — the injected workspace dep was
never recognized and stayed a `file:` snapshot where pnpm records
`link:`. Split on the whole `@file:` separator instead.
`extract_children` walked every entry of `dependencies` and
`optionalDependencies`, including the ones the manifest declares as
bundled. npm ships those inside the package's own tarball, and pnpm's
`getNonDevWantedDependencies` filters them out before resolution; the
missing filter pulled extra packages into the lockfile (`napi-wasm`
under `@parcel/watcher-wasm`, the whole `@napi-rs`/`@emnapi` set under
`@tailwindcss/oxide-wasm32-wasi`). Both spellings are honored, and
`true` means every entry of `dependencies`, matching npm. The bundled
set is computed once and shared by both `collect_deps` calls, so an
alias declared in both groups is dropped from both — upstream filters
the merged `{...optionalDependencies, ...dependencies}` map and reaches
the same result. The alias validation still runs over bundled entries
so an unusable alias is rejected either way, as it is upstream.
A third divergence from the same reproduction — a project's own
`peerDependencies` reaching its lockfile importer entry without
`autoInstallPeers` — landed separately as pnpm#13372 while this was
in review, so it is no longer part of this change.
The remaining divergences — the `parentPkgAliases` arm of upstream's
peer-shadowed-dependency omission, and local `file:*.tgz` tarballs
resolving without a manifest — are described in the issue; both need
design work beyond this change.
Related to pnpm#13334.
Investigating pnpm#13326 showed its reproduction already matches pnpm 11 byte for byte, fixed by eab73b3 (pnpm#13374) filtering bundled names out of `extract_children`. Porting the upstream `bundledDependencies` install suite — which had no pacquet counterpart, and is why the original defect shipped — surfaced two gaps that fix did not cover. A manifest may declare `bundleDependencies: true` instead of a name list, which npm and pnpm both read as "every entry of `dependencies` ships inside this tarball". The lockfile writer only understood the list form, and `PackageMetadata::bundled_dependencies` was typed `Option<Vec<String>>`, so the boolean could neither be written nor read back — a `pnpm-lock.yaml` written by pnpm 11 for such a package failed to parse. Model the field as the `string[] | boolean` union pnpm records, behind one shared `BundledDependencies::from_manifest` that both the install and env-installer writers call. The field's presence is also what tells the installer a package carries a populated `node_modules` of its own whose bins belong in that package's `node_modules/.bin`. Bundled packages are not lockfile children, so neither linker reached them: the isolated path's per-slot walk iterates `snapshot.dependencies`, and the hoisted path iterates graph nodes — `has_bundled_dependencies` was computed and stored on every hoisted node but had no reader. Both paths now run the second bin pass upstream's `linkAllBins` and `building/during-install` run. No platform gate is added to the resolver. The issue asks for one, but pnpm 11 resolves the subtree of a platform-incompatible optional package too (`[email protected]` on Linux, `@img/sharp-darwin-arm64`'s libvips edge), and `skip_optional_dependency_that_does_not_support_the_current_os` already asserts pacquet matches that. Related to pnpm#13326
Summary
Related to #13334.
I reproduced the report against
main(0754566903) with pnpm 11.17.0 as the reference: same Astro checkout, sametrustPolicyremoval,pnpm install --lockfile-onlywith each CLI. The diff is now 306 lines, not the 957 the issue recorded on12.0.0-alpha.21— most of the peer-context examples in the report (the[email protected]contexts,sharp×@types/node,@testing-library/svelte×vitest) already resolve identically onmain.Of what is left, three independent bugs accounted for 149 lines. One of them — a project's own
peerDependenciesreaching its lockfile importer entry withoutautoInstallPeers— landed separately as #13372 while this was in review, so this PR now carries the other two (143 lines). With #13372 onmain, the diff drops to 157 lines.1. A scoped workspace package referenced as
file:is never deduped back tolink:.injected_workspace_targetrecovers thefile:payload from a resolved package id by splitting on the first@. pacquet prefixes the manifest name onto afile:workspace pick, so a scoped id reads@test/pkg@file:packages/…— the leading@was taken for the separator and thefile:strip failed. Every one of Astro's nested fixture packages is scoped, so all of them were recorded as root-relativefile:snapshots (plus five spuriouspackages:/snapshots:rows) where pnpm 11 recordslink:pkg. Splitting on the whole@file:separator fixes it. This is pacquet-only: upstream'sdedupeInjectedDepsreads a barefile:<path>id, so it has no name to strip.2.
bundledDependenciesare resolved as if they were regular dependencies.npm ships bundled deps inside the package's own tarball, and pnpm's
getNonDevWantedDependenciesfilters them out of the wanted set before resolution. pacquet'sextract_childrenhad no such filter, sonapi-wasmwas installed under@parcel/watcher-wasm(and the whole@napi-rs/@emnapi/@tybysset under@tailwindcss/oxide-wasm32-wasi), adding packages the lockfile should not contain. Both spellings are honored andtruemeans "every entry ofdependencies", as upstream. Alias validation still runs over bundled entries, so an unusable alias is rejected either way — also as upstream.3.
A project's ownLanded independently as #13372 (closing #13325) while this PR was in review — same root cause, same gate onpeerDependenciesleak into its lockfile importer entry.autoInstallPeers. Dropped from this branch in favour of the version onmain.Both are pacquet-only — the TypeScript CLI is the reference and already behaves correctly here, so there is nothing to mirror.
What is still divergent (157 lines), and why it is not in this PR
Both remaining causes need design work rather than a targeted fix, so I left them for the issue rather than guessing:
The
parentPkgAliasesarm of upstream's peer-shadowed-dependency omission. When a package declares the same name in bothdependenciesandpeerDependencies, upstream drops it fromdependencies— underautoInstallPeersalways, and otherwise only when the name is already visible in the resolving parent's alias scope. pacquet models the first arm (omit_peer_shadowed_dependencies) and documents the second as unmodeled. That is what drops thewranglerpeer from@cloudflare/vite-pluginand the@atcute/lexiconspeer from@atcute/identity, which then cascades into duplicate@cloudflare/vite-pluginvariants and an extra@cloudflare/workers-typesentry in@flue/cli'stransitivePeerDependencies. Modeling it means threading a parent-alias set into a decision that pacquet currently memoizes per package id under a deterministic-owner rule, so "first occurrence wins" (upstream's effective behavior) would have to be re-derived without reintroducing order dependence.Local
file:*.tgztarballs. The local resolver's file branch returns no manifest, so the resolved id stays the barefile:<path>.tgzwith no name prefix. That fails to parse as aPackageKey, andbuild_packages_and_snapshotssilently skips it —fake-data-pkgis referenced from an importer but has nopackages:/snapshots:row. This is not Astro-specific: a barepnpm add ./pkg-1.0.0.tgzreproduces it, and the install leaves a dangling symlink into an empty virtual-store directory, so local tarball deps do not install at all today. Fixing it needs both a manifest at resolve time (extracting the tarball, as the remote-tarball resolver does) and a local-file arm in the fetch path.@standard-community/standard-json/standard-openapipeer contexts. These packages declare no dependencies at all, so this is not the shadowing bug. pacquet produces two extra variants that upstream'sdedupePeerDependentswould collapse; pacquet'scollapsed_target_matches_parentguard — added in fix(pacquet): match pnpm lockfile resolution #12372 to compensate for a peer-resolution divergence — blocks the child-edge rewrite that would orphan them. Removing the guard would regress pacquet: nondeterministic optional-peer suffix for webpack-dev-server on the babylon fixture #12330, so this belongs with the peer-resolution design work above.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.(pacquet-only bugs; the TypeScript CLI is the reference and already correct.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5).