Repository navigation
fix(package-manager): run readPackage over the project manifests - #13773
Conversation
|
💖 Thanks for opening this pull request! 💖 |
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? |
📝 WalkthroughWalkthroughThe install pipeline now applies ChangesProject manifest hook processing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ProjectManifest
participant readPackageHook
participant InstallPipeline
participant LockfileImporter
ProjectManifest->>readPackageHook: submit manifest
readPackageHook-->>InstallPipeline: return transformed manifest
InstallPipeline->>LockfileImporter: resolve rewritten dependency specifier
LockfileImporter-->>InstallPipeline: record rewritten specifier and version
Assessment against linked issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "test: trim the workspace-member comment ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 @.changeset/pnpmfile-hooks-project-specifiers.md:
- Line 5: Update the release-note sentence to state that Pacquet resolves and
records the rewritten dependency specifier for the importer, matching pnpm,
rather than implying it records the raw specifier. Preserve the existing
is-positive and .pnpmfile.cjs example while describing the resulting lockfile or
install behavior.
In `@pnpm/crates/package-manager/src/install/tests.rs`:
- Around line 9851-9855: Remove the unconditional dbg!(recorded) call from the
test around root_deps and the recorded PkgName entry, leaving both assertions
unchanged; add failure-only diagnostic context only if needed for those
assertions.
- Around line 9824-9855: Extend the Rust test
read_package_hook_rewrites_the_project_own_specifier in
pnpm/crates/package-manager/src/install/tests.rs:9824-9855 with a workspace
child manifest whose dependency is rewritten, then assert its importer specifier
and resolved version after normal, repeat, and frozen installs. Add the matching
workspace-child fixture in
pnpm11/installing/deps-installer/test/install/hooks.ts:90-118 to maintain
TypeScript parity; both sites must cover rewritten importer metadata and
frozen-lockfile behavior.
🪄 Autofix
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: a38fed53-a9e5-4b93-a2d8-b5aad5f91de9
📒 Files selected for processing (6)
.changeset/pnpmfile-hooks-project-specifiers.mdpnpm/crates/package-manager/src/install.rspnpm/crates/package-manager/src/install/run.rspnpm/crates/package-manager/src/install/tests.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm11/installing/deps-installer/test/install/hooks.ts
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13773 +/- ##
=======================================
Coverage 88.13% 88.14%
=======================================
Files 623 623
Lines 101380 101413 +33
=======================================
+ Hits 89353 89391 +38
+ Misses 12027 12022 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Both regression tests only rewrote the root importer's specifier, so they passed even when the hook reached no other project: restricting the hook to the first project manifest left them green. Each stack now also rewrites a workspace member's own specifier and asserts the member's importer entry, plus a repeat install to pin that the freshness gates compare hooked manifests rather than reading the raw range back off package.json. The changeset now states what the install does rather than narrating the defect, and the leftover dbg! goes.
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Pushed review fixes to this branch (f1ab9ec) — thanks for tackling the issue. The load-bearing one was CodeRabbit's coverage finding, and it was right: both regression tests only rewrote the root importer, so they passed even when the hook reached no other project. I confirmed the gap by restricting the hook to the first project manifest ( Also: dropped the leftover Declined one finding: the changeset stays The implementation itself I did not change — applying the hook where Written by an agent (Claude Code, claude-opus-5). |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pnpm/crates/package-manager/src/install/tests.rs (1)
9904-9940: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the shared
Installsetup.This block duplicates the
Installsetup ininstall_with_pnpmfile_reporter. Extract one helper that accepts the fixture-specificConfigand manifest. This prevents the root and workspace fixtures from drifting whenInstallchanges.As per coding guidelines, check shared helpers before adding duplicate code.
🤖 Prompt for 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. In `@pnpm/crates/package-manager/src/install/tests.rs` around lines 9904 - 9940, Extract the duplicated Install construction into a shared test helper near install_with_pnpmfile_reporter, accepting the fixture-specific Config and manifest references as parameters. Move the common field initialization into that helper, then update both root and workspace fixtures to invoke it while preserving their distinct configuration and manifest values.Sources: Coding guidelines, Path instructions
pnpm11/installing/deps-installer/test/install/hooks.ts (1)
136-141: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDeclare local functions after their call sites.
Move
readPackageHookandreadMemberEntrybelow the calls that use them. This follows the repository TypeScript convention.As per coding guidelines, TypeScript code must “declare functions after use.”
Also applies to: 166-169
🤖 Prompt for 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. In `@pnpm11/installing/deps-installer/test/install/hooks.ts` around lines 136 - 141, Move the local functions readPackageHook and readMemberEntry below the call sites that invoke them, without changing their implementations or behavior. Preserve the existing hook registration and execution flow while following the repository convention of declaring functions after use.Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@pnpm/crates/package-manager/src/install/tests.rs`:
- Around line 9904-9940: Extract the duplicated Install construction into a
shared test helper near install_with_pnpmfile_reporter, accepting the
fixture-specific Config and manifest references as parameters. Move the common
field initialization into that helper, then update both root and workspace
fixtures to invoke it while preserving their distinct configuration and manifest
values.
In `@pnpm11/installing/deps-installer/test/install/hooks.ts`:
- Around line 136-141: Move the local functions readPackageHook and
readMemberEntry below the call sites that invoke them, without changing their
implementations or behavior. Preserve the existing hook registration and
execution flow while following the repository convention of declaring functions
after use.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c171b376-76cb-470b-8ad8-cf403a4d98d4
📒 Files selected for processing (3)
.changeset/pnpmfile-hooks-project-specifiers.mdpnpm/crates/package-manager/src/install/tests.rspnpm11/installing/deps-installer/test/install/hooks.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- .changeset/pnpmfile-hooks-project-specifiers.md
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. 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.5819513350400003,
"stddev": 0.11890867560090564,
"median": 2.61725536594,
"user": 1.5736044200000001,
"system": 1.34910598,
"min": 2.37179422194,
"max": 2.7521413039400002,
"times": [
2.6904090639400002,
2.51385638694,
2.6422663339400003,
2.5922443979400005,
2.37179422194,
2.6451255059400003,
2.44120739894,
2.5139687199400003,
2.7521413039400002,
2.6565000169400004
]
},
{
"command": "pacquet@main",
"mean": 2.4901785999400006,
"stddev": 0.10301735897238837,
"median": 2.4585410164400003,
"user": 1.57808522,
"system": 1.3515279799999997,
"min": 2.3625573459400004,
"max": 2.64025163294,
"times": [
2.4577205719400004,
2.38678847594,
2.6234018549400004,
2.5655935819400004,
2.64025163294,
2.38307013594,
2.44751921894,
2.5755217199400002,
2.3625573459400004,
2.4593614609400003
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5496039535399997,
"stddev": 0.12226803233670412,
"median": 1.54123472494,
"user": 1.0826392200000001,
"system": 1.1734799800000002,
"min": 1.3816385899399999,
"max": 1.7240322129399999,
"times": [
1.53719442494,
1.46946432594,
1.7043021739400002,
1.45732098794,
1.54527502494,
1.3816385899399999,
1.7240322129399999,
1.40353682994,
1.6504144299399999,
1.62286053494
]
},
{
"command": "pnpr@main",
"mean": 1.56502438194,
"stddev": 0.13524407286054463,
"median": 1.57546029394,
"user": 1.0635132200000001,
"system": 1.19611868,
"min": 1.39687794594,
"max": 1.76499234194,
"times": [
1.45367034694,
1.67338708194,
1.40352187194,
1.6662228269400001,
1.45138552594,
1.63597654394,
1.76499234194,
1.39687794594,
1.68926528994,
1.5149440439400002
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.257128648,
"stddev": 0.012442214120249763,
"median": 0.2612233077,
"user": 0.22099884000000003,
"system": 0.52991334,
"min": 0.2257383482,
"max": 0.2712359492,
"times": [
0.2612086252,
0.2597379562,
0.2528722432,
0.2612578372,
0.2257383482,
0.2712359492,
0.2504799802,
0.2629585182,
0.2645590322,
0.2612379902
]
},
{
"command": "pacquet@main",
"mean": 0.26075347509999997,
"stddev": 0.006053878867220998,
"median": 0.2613149197,
"user": 0.23088074,
"system": 0.53121064,
"min": 0.24818128320000002,
"max": 0.2680390112,
"times": [
0.2646660032,
0.2670558712,
0.2633990382,
0.2562974802,
0.2592308012,
0.24818128320000002,
0.2648100242,
0.2569083102,
0.2589469282,
0.2680390112
]
},
{
"command": "pnpr@HEAD",
"mean": 0.2710334458,
"stddev": 0.00834157527475172,
"median": 0.2696472442,
"user": 0.22207513999999998,
"system": 0.52189714,
"min": 0.2586841332,
"max": 0.2833633272,
"times": [
0.2794689172,
0.2646745602,
0.2655599962,
0.2743210282,
0.2635514852,
0.2687212762,
0.2833633272,
0.2814165222,
0.2705732122,
0.2586841332
]
},
{
"command": "pnpr@main",
"mean": 0.27733477689999997,
"stddev": 0.00626760526080275,
"median": 0.27497548920000003,
"user": 0.22491553999999997,
"system": 0.5374338399999999,
"min": 0.2708263092,
"max": 0.2899309192,
"times": [
0.2708263092,
0.2774638732,
0.2746492152,
0.2714255672,
0.2834892752,
0.2741167322,
0.2834069092,
0.2727372052,
0.2899309192,
0.2753017632
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6298981882800003,
"stddev": 0.02824481238196867,
"median": 2.6261404608800003,
"user": 1.6254967999999999,
"system": 1.3810281400000002,
"min": 2.5931959193800003,
"max": 2.6953965223800003,
"times": [
2.62163946838,
2.62110960138,
2.6094015933800003,
2.60750252838,
2.63619017838,
2.5931959193800003,
2.6953965223800003,
2.6306414533800004,
2.6334385083800003,
2.6504661093800004
]
},
{
"command": "pacquet@main",
"mean": 2.68783058658,
"stddev": 0.044261963810585475,
"median": 2.67679100038,
"user": 1.8218364,
"system": 1.4705570399999999,
"min": 2.6254695163800004,
"max": 2.7826290723800002,
"times": [
2.7208749513800004,
2.67664749038,
2.7826290723800002,
2.71219455138,
2.65789213138,
2.7061170483800003,
2.66308911038,
2.65645748338,
2.67693451038,
2.6254695163800004
]
},
{
"command": "pnpr@HEAD",
"mean": 1.66001582898,
"stddev": 0.16678705467803565,
"median": 1.65262165538,
"user": 1.2348215999999999,
"system": 1.3421061400000003,
"min": 1.44022234338,
"max": 1.88854661438,
"times": [
1.44022234338,
1.75633361938,
1.50604510138,
1.5871744993799999,
1.47468494338,
1.71806881138,
1.8401601273800001,
1.83409139038,
1.88854661438,
1.5548308393799999
]
},
{
"command": "pnpr@main",
"mean": 1.64486286948,
"stddev": 0.17192700308636602,
"median": 1.62132498738,
"user": 1.2071591,
"system": 1.3115898400000001,
"min": 1.46491580838,
"max": 1.9392045183800002,
"times": [
1.9392045183800002,
1.68751887838,
1.55513109638,
1.49933395438,
1.48446802338,
1.46491580838,
1.79175858238,
1.80499951238,
1.46804419938,
1.7532541213800001
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4863215049800001,
"stddev": 0.046714635195344675,
"median": 0.48943112388000004,
"user": 0.6453255400000001,
"system": 0.75509156,
"min": 0.43190332538000004,
"max": 0.5496886533800001,
"times": [
0.45562067238000004,
0.43190332538000004,
0.43368614138,
0.43423714938,
0.47710726938000003,
0.50175497838,
0.5496886533800001,
0.52805670138,
0.54892944338,
0.5022307153800001
]
},
{
"command": "pacquet@main",
"mean": 0.49083823348000005,
"stddev": 0.050590514006194506,
"median": 0.48240180388000004,
"user": 0.65772024,
"system": 0.7901057600000001,
"min": 0.43065678838000004,
"max": 0.60452954238,
"times": [
0.44816182838,
0.52728923638,
0.60452954238,
0.5113354183800001,
0.47108315638000003,
0.49372045138000004,
0.5064761373800001,
0.43065678838000004,
0.45210366938,
0.46302610638
]
},
{
"command": "pnpr@HEAD",
"mean": 0.36017490058,
"stddev": 0.011405085036134174,
"median": 0.36080344088000005,
"user": 0.26240404,
"system": 0.6299988599999999,
"min": 0.33860448238,
"max": 0.37436015638000003,
"times": [
0.35174026538000003,
0.37436015638000003,
0.36308855338,
0.37076971738000003,
0.35851832838000003,
0.37162814238,
0.36792066238000004,
0.35365150538,
0.33860448238,
0.35146719238
]
},
{
"command": "pnpr@main",
"mean": 0.34096035008000003,
"stddev": 0.024699967359456433,
"median": 0.33626163288,
"user": 0.25783694,
"system": 0.54933266,
"min": 0.31286368538000003,
"max": 0.39860752238,
"times": [
0.32596179638,
0.31286368538000003,
0.34621036338,
0.36264954738000005,
0.39860752238,
0.33550690038000003,
0.34298181438,
0.32044361838,
0.32736188738,
0.33701636538
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.75306217308,
"stddev": 0.015799926952390395,
"median": 1.74921127528,
"user": 0.8068891999999999,
"system": 0.79633914,
"min": 1.73398040728,
"max": 1.77823031528,
"times": [
1.74246612428,
1.7634183562799999,
1.7571567962799999,
1.73529078428,
1.73398040728,
1.77823031528,
1.7768374522800001,
1.7450759682800001,
1.74481894428,
1.75334658228
]
},
{
"command": "pacquet@main",
"mean": 1.75626894518,
"stddev": 0.013367210197019646,
"median": 1.7530511102800002,
"user": 0.8353921,
"system": 0.8059766399999999,
"min": 1.7345823302799999,
"max": 1.77841899028,
"times": [
1.77841899028,
1.76656082228,
1.7681547742800001,
1.76661375228,
1.7345823302799999,
1.74898163228,
1.7569604762800002,
1.74787950828,
1.74539542128,
1.7491417442800001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31923396567999995,
"stddev": 0.010181050463092955,
"median": 0.31948279327999995,
"user": 0.23661159999999998,
"system": 0.5411130399999999,
"min": 0.29958372928,
"max": 0.33312098828,
"times": [
0.31668705428,
0.33083873028,
0.33312098828,
0.31926807428,
0.29958372928,
0.32078217527999997,
0.31969751228,
0.32901203128,
0.31133083828,
0.31201852328
]
},
{
"command": "pnpr@main",
"mean": 0.32514752208,
"stddev": 0.010362609083039775,
"median": 0.32646893678,
"user": 0.23621139999999996,
"system": 0.54329694,
"min": 0.31082671028,
"max": 0.33869537428,
"times": [
0.32349901928,
0.33045055928,
0.33869537428,
0.32080719128,
0.33732291928,
0.32943885427999997,
0.31337651028,
0.31309608128,
0.31082671028,
0.33396200128
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21141617652285719,
"stddev": 0.01140110805382304,
"median": 0.20864997588000003,
"user": 0.17045075714285715,
"system": 0.058994579999999984,
"min": 0.19486694738000002,
"max": 0.23245925138000004,
"times": [
0.20904099738000004,
0.23245925138000004,
0.20224997038000003,
0.21844463238000003,
0.20088022038000003,
0.22021431438000003,
0.20230797838000003,
0.21858475638000002,
0.22546364838000002,
0.19486694738000002,
0.20825895438000003,
0.19946566638000002,
0.22245110638,
0.20513802738000003
]
},
{
"command": "pacquet@main",
"mean": 0.21625770653384618,
"stddev": 0.015537432439989321,
"median": 0.22046605938000002,
"user": 0.17920416923076926,
"system": 0.05787854153846154,
"min": 0.18506723638000003,
"max": 0.23562380038000003,
"times": [
0.22654256038000004,
0.21575557038,
0.22040812938,
0.19519860238000003,
0.18506723638000003,
0.19159878338000003,
0.22852372138000002,
0.22046605938000002,
0.21938958238000003,
0.22365527338000002,
0.23562380038000003,
0.22591642138000004,
0.22320444438000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08907082625096774,
"stddev": 0.002851711999311545,
"median": 0.08899589338,
"user": 0.023227593548387094,
"system": 0.008907305806451615,
"min": 0.08518226338,
"max": 0.09721054038,
"times": [
0.09089294538,
0.09338806438,
0.09179198838000001,
0.09051865038000001,
0.09125664038,
0.09721054038,
0.08787309038,
0.08672972638,
0.08703913838,
0.09317745638000001,
0.09198405038,
0.09085486338,
0.08518226338,
0.08677407038,
0.08991931238,
0.09129654538,
0.08601247638000001,
0.08664835338,
0.08722343538,
0.08939837238000001,
0.08533071238,
0.09003248538,
0.08982765938000001,
0.08696406838000001,
0.08716916438,
0.08537597738000001,
0.08867655138,
0.08590097638000001,
0.08899589338,
0.09106690238000001,
0.08668323938
]
},
{
"command": "pnpr@main",
"mean": 0.08881658731333332,
"stddev": 0.0025153820732668843,
"median": 0.08827235088,
"user": 0.0229451,
"system": 0.008928544000000002,
"min": 0.08549907938000001,
"max": 0.09504334038000001,
"times": [
0.09458752138,
0.08969524138,
0.09038242438,
0.08821259838,
0.08580185938,
0.08716487638,
0.08626753638000001,
0.08833210338,
0.08664444538,
0.08817214338,
0.08678118438,
0.09504334038000001,
0.08895193038,
0.08985671438000001,
0.08937427538,
0.08662196438,
0.08901880738000001,
0.09177829238,
0.08989744038,
0.08549907938000001,
0.09039849438,
0.08943385738000001,
0.09422271638,
0.08994873838,
0.08661935938,
0.08710295838,
0.08750453538,
0.08640746038000001,
0.08729035138,
0.08748536938
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.8313027443644444,
"stddev": 0.1505055948438005,
"median": 0.7723050879200001,
"user": 0.7993379422222222,
"system": 0.1382078711111111,
"min": 0.63266859392,
"max": 1.11213320892,
"times": [
0.9084159299200001,
1.11213320892,
0.74312185692,
0.89856110292,
0.63266859392,
0.76978216692,
0.95879243392,
0.7723050879200001,
0.68594431792
]
},
{
"command": "pacquet@main",
"mean": 1.1088262683644445,
"stddev": 0.34437232755129343,
"median": 1.02041207792,
"user": 1.0837276088888887,
"system": 0.20697853777777778,
"min": 0.68696658192,
"max": 1.72390375292,
"times": [
0.78499557192,
1.72390375292,
1.02041207792,
0.86336927092,
1.5066862329200001,
0.68696658192,
0.99022499892,
1.32392759792,
1.07895032992
]
},
{
"command": "pnpm@HEAD",
"mean": 3.2559074003644444,
"stddev": 0.14200324458768612,
"median": 3.26213628192,
"user": 5.024686053333333,
"system": 0.28327442666666663,
"min": 3.0884227169200003,
"max": 3.53391864192,
"times": [
3.53391864192,
3.26213628192,
3.2627772789200002,
3.26638195592,
3.15409034292,
3.0884227169200003,
3.11935773292,
3.20475970792,
3.41132194392
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.73823455712,
"stddev": 0.087970642027112,
"median": 4.72180620852,
"user": 2.71282038,
"system": 1.9801827799999998,
"min": 4.61646570352,
"max": 4.87695467252,
"times": [
4.684921327520001,
4.75869108952,
4.61646570352,
4.68430313152,
4.76611367752,
4.6644421865200005,
4.87695467252,
4.770529751520001,
4.68336669652,
4.87655733452
]
},
{
"command": "pacquet@main",
"mean": 4.73725153392,
"stddev": 0.14911980794437718,
"median": 4.741821406520001,
"user": 2.6350194799999995,
"system": 1.95948298,
"min": 4.5549163985200005,
"max": 4.96532516152,
"times": [
4.60472656752,
4.58214163652,
4.720394740520001,
4.96532516152,
4.763248072520001,
4.896790177520001,
4.78918741952,
4.59972295752,
4.89606220752,
4.5549163985200005
]
},
{
"command": "pnpr@HEAD",
"mean": 3.7276591814199995,
"stddev": 0.14038149002387132,
"median": 3.7356834455200003,
"user": 1.76379958,
"system": 1.6756497799999999,
"min": 3.53996958952,
"max": 3.93000845252,
"times": [
3.8356108515200003,
3.7536443895200002,
3.6161235135200003,
3.6040787555200002,
3.8484334325200003,
3.93000845252,
3.86743451252,
3.53996958952,
3.5635658155200005,
3.7177225015200004
]
},
{
"command": "pnpr@main",
"mean": 3.65378777332,
"stddev": 0.14951891186375973,
"median": 3.5946430085200003,
"user": 1.4734976799999997,
"system": 1.42661198,
"min": 3.49966398952,
"max": 3.9086785175200003,
"times": [
3.6902594975200005,
3.5395390675200002,
3.9086785175200003,
3.85461813652,
3.5224774625200004,
3.49966398952,
3.62243656052,
3.7924711355200005,
3.5668494565200004,
3.54088390952
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13773 |
| 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,440.22 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 299.58 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 338.60 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.18 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,381.64 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,539.97 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 258.68 ms |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
Summary
Fixes #13769.
pacquet never ran the pnpmfile's
readPackageover the workspace projects' own manifests, only over the manifests the resolver got back for their dependencies. A hook that rewrites one of the project's own specifiers was therefore ignored on the way in: the importer's wanted dependencies, and thespecifier:the lockfile records for it, both came straight offpackage.json.The divergence is wider than the recorded specifier. With
"is-positive": "^1.0.0"inpackage.jsonand a.pnpmfile.cjsrewriting it to3.1.0, pnpm installs 3.1.0 and recordsspecifier: 3.1.0; pacquet installed 1.0.0 and recorded^1.0.0.The fix applies the hook where pnpm's
getContextdoes — once over every project manifest, before anything reads them — so resolution, the freshness gates, and the lockfile importer entries all see the same hooked view and stay consistent with each other. Recording the hooked specifier without that would have broken--frozen-lockfile, since the gate compares the lockfile against the manifest. The optimistic repeat-install check stays on the on-disk manifests deliberately: it runs before the pnpmfile is loaded and must not spawn the Node worker.The TypeScript CLI already behaves this way; its side of this PR is a test pinning it.
Verified against pnpm 11.20.0 on the issue's repro: the two lockfiles are now byte-identical, and repeat installs,
--frozen-lockfile, andpnpm addall agree between the stacks (pnpm addstill writes the raw range back topackage.jsonin both).Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
.pnpmfile.cjsreadPackagehooks that rewrite a project’s own dependency specifications.readPackagehook fails.