Repository navigation
Conversation
pnpm 11 rewrites `--prefix` to `--dir` and `--store` to `--store-dir` before parsing argv (`RENAMED_OPTIONS` in `parseCliArgs.ts`), so npm habits and existing CI scripts keep working. pacquet had no equivalent and clap rejected the unknown long flag outright, breaking invocations like `pnpm --prefix ../ run test:ci`. Both spellings are added as clap aliases on the global options rather than as an argv-rewriting pass: the pre-clap passes derive their arity tables from the clap `Command` and already fold in every alias, so `--prefix` relocates and steps over its value like `--dir` does. The aliases are hidden so the help output stays identical to pnpm 11's, which does not document either spelling. The pre-clap argv scan behind `pnpm --version` reads `--dir` directly to find the project whose pin decides the delegated version; it now honors `--prefix` there too, the way it already honors `--userconfig`. Closes #13583
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis change adds ChangesCLI option aliases
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 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 QodoCLI: accept npm-style --prefix/--store as aliases for --dir/--store-dir
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Confidence Score: 5/5The PR appears safe to merge. The previously reported precedence mismatch and comment-maintenance issue are fixed, and no blocking failure remains. Reviews (4): Last reviewed commit: "fix(cli): step over the value of a short..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pnpm/crates/cli/tests/run.rs (1)
588-596: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winTest the script-argument boundary.
The invocation stops at
test. It proves that--prefixworks beforerun, but it does not prove that an option after the script name remains script input. The test documentation states this boundary.Pass a sentinel option after
test, make the fixture record its received arguments, and assert that the sentinel is preserved.As per path instructions, regression tests must cover the documented pre-subcommand/script-name scope.
🤖 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/cli/tests/run.rs` around lines 588 - 596, Update the test invocation around pacquet to append a sentinel option after the script name test, and modify the fixture’s marker recording to capture the received arguments. Assert that the marker contains the sentinel, proving arguments after the script name remain script input while retaining the existing --prefix coverage.Source: Path instructions
🤖 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/src/cli_args/cli_command.rs`:
- Around line 123-127: Update SwitchInput::from_version_argv to recognize both
store-dir and its store alias, consuming their values in separated and equals
forms so the value is not treated as the command; add regression cases covering
--store /tmp/store and --store=/tmp/store.
---
Nitpick comments:
In `@pnpm/crates/cli/tests/run.rs`:
- Around line 588-596: Update the test invocation around pacquet to append a
sentinel option after the script name test, and modify the fixture’s marker
recording to capture the received arguments. Assert that the marker contains the
sentinel, proving arguments after the script name remain script input while
retaining the existing --prefix coverage.
🪄 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: 79d5f2d0-d93e-4ed3-b389-eb5d12dc4aab
📒 Files selected for processing (6)
.changeset/prefix-alias-of-dir.mdpnpm/crates/cli/src/cli_args/cli_command.rspnpm/crates/cli/src/cli_args/pre_command.rspnpm/crates/cli/src/cli_args/pre_command/tests.rspnpm/crates/cli/src/cli_args/tests.rspnpm/crates/cli/tests/run.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13592 +/- ##
=======================================
Coverage 87.98% 87.99%
=======================================
Files 565 567 +2
Lines 97856 97928 +72
=======================================
+ Hits 86101 86172 +71
- Misses 11755 11756 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pnpm drops the alias when a command line spells the same option both ways, so `--prefix foo --dir bar` and `--dir bar --prefix foo` both resolve to `bar`. Clap keeps the last occurrence instead, which would have made pacquet pick a different directory (or a different store) for the same command line. `renamed_options` removes the shadowed alias tokens ahead of the parse, alongside the other pre-clap passes and using the same clap-derived arity tables, so an alias value that spells a subcommand is never mistaken for one and a script's own `--prefix` is left alone. The `--version` pre-scan now reads option arity from the clap grammar instead of a hand-maintained list of value-taking options. The list did not know about `--store-dir`, so `pnpm --store-dir /s --version` took `/s` for the command name and stopped scanning; deriving the arity keeps every current and future global (and alias) in step. Reviewed-by: greptile-apps[bot] Reviewed-by: qodo-code-review[bot] Reviewed-by: coderabbitai[bot]
|
Both Qodo findings are addressed in 98c170b: Historical Version scan misreads Greptile separately caught that clap's alias keeps the last occurrence where pnpm's rename loop always keeps the canonical spelling; the new Written by an agent (Claude Code, claude-opus-5[1m]). |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pnpm/crates/cli/src/renamed_options/tests.rs (1)
18-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the redundant helper comment.
This comment only restates
parse. Keep comments for test rationale or parsing invariants.As per coding guidelines, Rust comments must explain non-obvious invariants, workarounds, deliberate exceptions, or contracts.
🤖 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/cli/src/renamed_options/tests.rs` at line 18, Remove the redundant “Run the full pre-parse pipeline and parse” comment in the test code, leaving the surrounding parse logic unchanged. Retain only comments that document non-obvious test rationale, parsing invariants, workarounds, deliberate exceptions, or contracts.Sources: Coding guidelines, Path instructions, Learnings
🤖 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/src/renamed_options.rs`:
- Around line 72-80: Update the short-option remainder handling in the loop over
RENAMED_OPTIONS so it scans each short flag from left to right instead of using
rest.contains(canonical), marking canonical matches only for actual short
options. Stop scanning once the current short option consumes the attached
remainder, while preserving token_width advancement and canonical_seen updates.
---
Nitpick comments:
In `@pnpm/crates/cli/src/renamed_options/tests.rs`:
- Line 18: Remove the redundant “Run the full pre-parse pipeline and parse”
comment in the test code, leaving the surrounding parse logic unchanged. Retain
only comments that document non-obvious test rationale, parsing invariants,
workarounds, deliberate exceptions, or contracts.
🪄 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: cf0035e0-d84c-4e2a-b5fc-e669475576e4
📒 Files selected for processing (7)
pnpm/crates/cli/src/cli_args/cli_command.rspnpm/crates/cli/src/cli_args/pre_command.rspnpm/crates/cli/src/cli_args/pre_command/tests.rspnpm/crates/cli/src/lib.rspnpm/crates/cli/src/renamed_options.rspnpm/crates/cli/src/renamed_options/tests.rspnpm/crates/cli/tests/run.rs
💤 Files with no reviewable changes (1)
- pnpm/crates/cli/src/cli_args/cli_command.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- pnpm/crates/cli/tests/run.rs
- pnpm/crates/cli/src/cli_args/pre_command/tests.rs
|
Code review by qodo was updated up to the latest commit 98c170b |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The shadowed-alias scan looked for the canonical short anywhere in a short-option cluster, so `-FpkgC --prefix here` read the `C` ending a `--filter` pattern as a `--dir` and dropped the `--prefix`. The cluster is now read left to right and stops at the first option that takes a value, since everything past it is that value. The clap grammar is also built once per process instead of per caller. Constructing it walks every subcommand, and the passes that run before the parse each need the same view of it — the boundary scan built one on every call, and the `--version` pre-scan added another. Reviewed-by: coderabbitai[bot] Reviewed-by: qodo-code-review[bot]
|
Both new Qodo findings are addressed in e6b825d. Redundant clap build on Written by an agent (Claude Code, claude-opus-5[1m]). |
|
Code review by qodo was updated up to the latest commit e6b825d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
A cluster ending in a value-taking short takes the next argv token as its value, but the shadowed-alias scan advanced by the first short's arity alone. `pnpm -rC --prefix install` therefore re-read `--prefix` — the directory `-C` was given — as an option of pnpm's own, and dropped it along with the token behind it because the same cluster had already marked `-C` as present. Reading the cluster and its width in one pass keeps the two in step: scanning stops at the first short that takes a value, which is also what decides whether that value is attached or the next token. Reviewed-by: qodo-code-review[bot]
|
Fixed in 231e1da — this one was a real corruption path in the new pass, thanks.
Regression test: Written by an agent (Claude Code, claude-opus-5[1m]). |
|
Code review by qodo was updated up to the latest commit 231e1da |
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.57073440888,
"stddev": 0.17596416511457208,
"median": 2.64374003908,
"user": 1.67108712,
"system": 1.2690629000000002,
"min": 2.35131844058,
"max": 2.8009170505800003,
"times": [
2.35131844058,
2.64201080858,
2.8009170505800003,
2.36632070358,
2.40422599758,
2.69505577558,
2.71080081458,
2.72029922358,
2.3709260045800002,
2.64546926958
]
},
{
"command": "pacquet@main",
"mean": 2.44927477158,
"stddev": 0.1317801999195643,
"median": 2.39804993958,
"user": 1.67673052,
"system": 1.2641342999999998,
"min": 2.33312142658,
"max": 2.6895192265800003,
"times": [
2.59148422358,
2.37982392158,
2.35125108258,
2.41627595758,
2.61417760358,
2.6895192265800003,
2.33312142658,
2.35642010158,
2.42517532458,
2.3354988475800003
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5273449483800001,
"stddev": 0.13055394530170172,
"median": 1.5312156940800001,
"user": 1.14299902,
"system": 1.1697605999999998,
"min": 1.3762075495800001,
"max": 1.7663351875800002,
"times": [
1.39629854958,
1.7663351875800002,
1.64141499758,
1.5451187535800002,
1.56460439058,
1.64245942858,
1.51731263458,
1.43941905358,
1.3762075495800001,
1.38427893858
]
},
{
"command": "pnpr@main",
"mean": 1.4840088338800002,
"stddev": 0.10338257406543314,
"median": 1.4769604695800003,
"user": 1.1960625200000001,
"system": 1.1569753999999999,
"min": 1.3574523785800001,
"max": 1.6971954885800002,
"times": [
1.5720741775800002,
1.3650128185800001,
1.3574523785800001,
1.46583647458,
1.39228376358,
1.6971954885800002,
1.54659968558,
1.47398245058,
1.4799384885800002,
1.48971261258
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25896955158,
"stddev": 0.0089719234091528,
"median": 0.25754717988,
"user": 0.20872570000000001,
"system": 0.5056565799999999,
"min": 0.24459737188000003,
"max": 0.27315940488,
"times": [
0.25909861988,
0.24459737188000003,
0.25694053988,
0.25526155088,
0.27315940488,
0.27212270888,
0.25124488188,
0.25815381988,
0.25387369688,
0.26524292088
]
},
{
"command": "pacquet@main",
"mean": 0.25364297078,
"stddev": 0.004258743051832836,
"median": 0.25471061988,
"user": 0.20259690000000002,
"system": 0.51549768,
"min": 0.24565460588000002,
"max": 0.25996676288,
"times": [
0.25996676288,
0.25168763288,
0.25565623388,
0.25470340788,
0.24565460588000002,
0.25176916588,
0.24860473888000004,
0.25471783188,
0.25687035788,
0.25679896988
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27116302098,
"stddev": 0.0032611163466777695,
"median": 0.27105740938,
"user": 0.2092845,
"system": 0.5019930799999999,
"min": 0.26723074988,
"max": 0.27885965688,
"times": [
0.27119905488,
0.27290099888,
0.27231999188,
0.26927352288,
0.26723074988,
0.27885965688,
0.26905264188,
0.27091576388,
0.26826999288,
0.27160783588
]
},
{
"command": "pnpr@main",
"mean": 0.27154572498,
"stddev": 0.0043016152773255045,
"median": 0.27194315138,
"user": 0.21571379999999998,
"system": 0.5172941799999999,
"min": 0.26400669388,
"max": 0.27853785888,
"times": [
0.26988506188,
0.27495341088,
0.27178941088,
0.26978744788,
0.26400669388,
0.26638874088,
0.27209689188,
0.27546945988,
0.27254227288,
0.27853785888
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5930165093000004,
"stddev": 0.011248436929368425,
"median": 2.5938156937,
"user": 1.6247072799999998,
"system": 1.3425767199999998,
"min": 2.5734454112000003,
"max": 2.6081933282,
"times": [
2.5882265402,
2.5971425592,
2.5904888282000003,
2.5984959292,
2.6046752112,
2.5881246552,
2.5734454112000003,
2.6024822002,
2.6081933282,
2.5788904302
]
},
{
"command": "pacquet@main",
"mean": 2.5801774504000003,
"stddev": 0.014113535471841151,
"median": 2.5795406277,
"user": 1.6108070799999996,
"system": 1.3117958199999997,
"min": 2.5603728042,
"max": 2.6152936321999998,
"times": [
2.5806133762,
2.5716356262,
2.5767688912,
2.5727399272,
2.5799600772,
2.5853089142,
2.5603728042,
2.6152936321999998,
2.5793423362,
2.5797389192
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6792100876000002,
"stddev": 0.170014223171539,
"median": 1.7087337047,
"user": 1.16899368,
"system": 1.15672432,
"min": 1.4225428012,
"max": 1.8702297282,
"times": [
1.6287965222,
1.8607911652000002,
1.7786693122,
1.5135660172,
1.8392977122,
1.4606596872,
1.6387980972,
1.7787498332,
1.4225428012,
1.8702297282
]
},
{
"command": "pnpr@main",
"mean": 1.5771359622,
"stddev": 0.15535779156511972,
"median": 1.4958623437,
"user": 1.1798832799999999,
"system": 1.1587777199999998,
"min": 1.4364947262,
"max": 1.8686396882,
"times": [
1.6323854822000001,
1.4609389762,
1.5094031622,
1.4364947262,
1.8000035822,
1.6562596052,
1.4823215252000002,
1.8686396882,
1.4697000052,
1.4552128692
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.38887103252,
"stddev": 0.0051557830873997365,
"median": 0.38878631602,
"user": 0.48348815999999994,
"system": 0.72206144,
"min": 0.38125299702000004,
"max": 0.39692442102000003,
"times": [
0.38323078902,
0.39191163402,
0.38458609102,
0.38613426902000003,
0.39692442102000003,
0.39269305002000005,
0.39023517202,
0.39440444202,
0.38733746002,
0.38125299702000004
]
},
{
"command": "pacquet@main",
"mean": 0.38345144721999996,
"stddev": 0.009255246004942564,
"median": 0.38222555502,
"user": 0.50606706,
"system": 0.6792683399999999,
"min": 0.37027950302,
"max": 0.40109319302,
"times": [
0.38288450302000004,
0.37610320202,
0.38098306602000004,
0.38156660702,
0.39148951002000004,
0.38315464602000004,
0.39235539702,
0.40109319302,
0.37027950302,
0.37460484502
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30239576432000004,
"stddev": 0.005862983207580573,
"median": 0.30151080252,
"user": 0.18685535999999997,
"system": 0.51923444,
"min": 0.29505042702,
"max": 0.31509113602,
"times": [
0.29736976302,
0.30952869902,
0.30230622102000004,
0.30246503302,
0.29941989702,
0.29505042702,
0.30104745202,
0.31509113602,
0.30197415302,
0.29970486202
]
},
{
"command": "pnpr@main",
"mean": 0.30376320612,
"stddev": 0.005902363028888327,
"median": 0.30294960352,
"user": 0.17633376,
"system": 0.52946884,
"min": 0.29520364502,
"max": 0.31440547502,
"times": [
0.31228786502,
0.30513102302,
0.30336328102000004,
0.29520364502,
0.30479847102,
0.31440547502,
0.30036457302,
0.30253592602,
0.30154722602,
0.29799457602
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.72894398168,
"stddev": 0.009054450387202744,
"median": 1.72838794958,
"user": 0.72377604,
"system": 0.7665513400000001,
"min": 1.71514090958,
"max": 1.7473552585800003,
"times": [
1.7377111115800001,
1.7302981155800001,
1.72633465958,
1.72659695258,
1.7473552585800003,
1.73225713858,
1.7301789465800002,
1.72285183858,
1.71514090958,
1.72071488558
]
},
{
"command": "pacquet@main",
"mean": 1.7243995858800005,
"stddev": 0.0113341722774165,
"median": 1.7205018090800002,
"user": 0.71786344,
"system": 0.7605454399999999,
"min": 1.7133979325800002,
"max": 1.7508286055800002,
"times": [
1.7133979325800002,
1.7221287485800003,
1.7508286055800002,
1.7153037095800001,
1.71697569458,
1.71887486958,
1.7267371325800003,
1.7259826455800003,
1.71843323358,
1.7353332865800002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30403604738,
"stddev": 0.006891507853313263,
"median": 0.30207330108,
"user": 0.19347354,
"system": 0.49967054,
"min": 0.29358772458,
"max": 0.31721152558,
"times": [
0.31721152558,
0.30010983258,
0.29358772458,
0.30599795058,
0.30263111258000003,
0.30117000858000004,
0.30719988558,
0.30151548958,
0.29858529558,
0.31235164858000003
]
},
{
"command": "pnpr@main",
"mean": 0.29996113658,
"stddev": 0.006133917538774111,
"median": 0.29942760608,
"user": 0.17797754,
"system": 0.51964424,
"min": 0.29042111758,
"max": 0.31471857758,
"times": [
0.29671334758,
0.30074016658,
0.29735922858,
0.30037022958000004,
0.30236828458000004,
0.29806458358,
0.31471857758,
0.29848498258,
0.30037084758,
0.29042111758
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.179274878295,
"stddev": 0.003840516136995144,
"median": 0.17872934992,
"user": 0.16175691,
"system": 0.0850158,
"min": 0.17256159992000003,
"max": 0.18715514992,
"times": [
0.18022620592000002,
0.17513504992000004,
0.17881607992,
0.17800425992000002,
0.18715514992,
0.17730010192000004,
0.17951916692000003,
0.17604420192000003,
0.17556858892000002,
0.17256159992000003,
0.17864261992000002,
0.18197476792000003,
0.18276248492000002,
0.18061845192000003,
0.17821466892,
0.18585465392000003
]
},
{
"command": "pacquet@main",
"mean": 0.18073361498250004,
"stddev": 0.0034363800614267814,
"median": 0.18029686542,
"user": 0.15735416000000002,
"system": 0.08912411249999998,
"min": 0.17650206792000003,
"max": 0.18740297892000002,
"times": [
0.18127790692,
0.18740297892000002,
0.17743497892,
0.17814912492,
0.18014885492000002,
0.17736340192000002,
0.17659556192000003,
0.18044487592000003,
0.18361748692000002,
0.18423580992000002,
0.18078983392000003,
0.18705418192000003,
0.17875384992,
0.17967940992000003,
0.18228751492000003,
0.17650206792000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08932652092000001,
"stddev": 0.003990170048296196,
"median": 0.08851366742,
"user": 0.020800597499999997,
"system": 0.011855759375,
"min": 0.08475342392,
"max": 0.10454050092,
"times": [
0.08855886192000001,
0.08846847292,
0.08882993192000001,
0.09223412892,
0.08639298392,
0.08592395092,
0.08604914392,
0.09396009092,
0.08958489292,
0.08518123892,
0.08688816792000001,
0.09047090392,
0.08642638492,
0.08643065892,
0.08521835092,
0.08938797992,
0.10454050092,
0.09714377692000001,
0.08813417692,
0.08680950392,
0.09151146092000001,
0.09161806092000001,
0.09291885792,
0.09036169292,
0.09073554692000001,
0.08711521192,
0.08669921192,
0.08475342392,
0.08834378992,
0.09033638892,
0.08634482992,
0.09107609092
]
},
{
"command": "pnpr@main",
"mean": 0.09106593402,
"stddev": 0.003999457975236812,
"median": 0.09091302542,
"user": 0.02137969333333334,
"system": 0.0125506,
"min": 0.08569942492,
"max": 0.10220826092,
"times": [
0.09486342492000001,
0.08795525892,
0.08643898892,
0.09159870792000001,
0.09739741592000001,
0.08962862392,
0.09303573892,
0.09431460092,
0.09080970392,
0.09138524792000001,
0.09489801892000001,
0.08718525492,
0.08612158192000001,
0.08699737592000001,
0.08662582192,
0.09091059692,
0.09091545392,
0.10220826092,
0.09072840192,
0.08584757392,
0.09229114192,
0.09891186492000001,
0.08850951992,
0.08569942492,
0.09151997092,
0.09159492292,
0.09022230292,
0.09169295792,
0.09393614592,
0.08773371492
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.8446508549266667,
"stddev": 0.1665477328335081,
"median": 0.8119520402600001,
"user": 0.7961549066666667,
"system": 0.20119455555555557,
"min": 0.54091184426,
"max": 1.08815084226,
"times": [
1.03646351926,
0.9621780972600001,
1.08815084226,
0.8119520402600001,
0.75787588526,
0.54091184426,
0.8518292002600001,
0.8057633482600001,
0.7467329172600001
]
},
{
"command": "pacquet@main",
"mean": 0.9411606917044444,
"stddev": 0.10177115453790261,
"median": 0.94791513126,
"user": 0.8948727955555557,
"system": 0.22230911111111112,
"min": 0.7850255502600001,
"max": 1.0687495412599999,
"times": [
0.8659716432600001,
0.9849031172600001,
0.94791513126,
0.7850255502600001,
1.0687495412599999,
0.8952634512600001,
1.02898487026,
1.0579600892599998,
0.8356728312600001
]
},
{
"command": "pnpm@HEAD",
"mean": 2.903866282593333,
"stddev": 0.044383277045899144,
"median": 2.89334057526,
"user": 4.1370116844444444,
"system": 0.2994805555555556,
"min": 2.8508316532599998,
"max": 2.99128405326,
"times": [
2.90528970026,
2.8715501092599998,
2.89334057526,
2.87420521126,
2.88085355226,
2.8508316532599998,
2.95557670626,
2.91186498226,
2.99128405326
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.5211441101,
"stddev": 0.12936285139787024,
"median": 4.455623559999999,
"user": 1.7493863600000001,
"system": 1.4559019999999998,
"min": 4.4144707245,
"max": 4.7537213235,
"times": [
4.4433547865,
4.4678923335,
4.4214428425,
4.7238230565,
4.5649074275,
4.7537213235,
4.5792557355,
4.4144707245,
4.4211712265,
4.4214016445
]
},
{
"command": "pacquet@main",
"mean": 4.541229689500001,
"stddev": 0.14242216823027185,
"median": 4.4643051685,
"user": 1.77194526,
"system": 1.3973359999999997,
"min": 4.4301349225,
"max": 4.8134626815,
"times": [
4.7431452535,
4.8134626815,
4.4420120665,
4.4332619145,
4.4865982705,
4.4399694045,
4.4301349225,
4.4304046685,
4.5637247995,
4.6295829135
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5390479184999997,
"stddev": 0.12318494133101252,
"median": 3.4640167775,
"user": 1.3051593599999998,
"system": 1.2063921,
"min": 3.4489019385,
"max": 3.8050037315000003,
"times": [
3.4593321405,
3.4489019385,
3.5775944385000003,
3.5853564225,
3.4529458185,
3.4514049105,
3.4572832465,
3.6839551235,
3.4687014145,
3.8050037315000003
]
},
{
"command": "pnpr@main",
"mean": 3.540216634,
"stddev": 0.09827778465194306,
"median": 3.5035956995,
"user": 1.3042954599999999,
"system": 1.2088891999999998,
"min": 3.4442213285,
"max": 3.7575041385,
"times": [
3.7575041385,
3.4962445475,
3.4442213285,
3.4610978085,
3.5311034665,
3.5109468515,
3.6154134395,
3.4713481594999998,
3.6292341974999998,
3.4850524025
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13592 |
| 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,422.54 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 293.59 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 295.05 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 84.75 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,376.21 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,448.90 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 267.23 ms |
Summary
pnpm --prefix ../ run testfailed on pnpm 12 witherror: unexpected argument '--prefix' found. pnpm 11 rewrites--prefixto--dirand--storeto--store-dirbefore parsing (RENAMED_OPTIONSinpnpm11/pnpm/src/parseCliArgs.ts), so npm habits and existing CI scripts keep working; pacquet had no equivalent and clap rejected the unknown long flag outright.Two pieces:
shorthands.rs,flag_relocation.rs,parse_boundary.rs) derive their arity tables from the clapCommandand already fold in every alias, so--prefixrelocates and steps over its value exactly like--dir. Hidden rather thanvisible_alias, so--helpstays identical to pnpm 11's, which documents neither spelling.--prefix foo --dir barand--dir bar --prefix fooboth resolve tobar), while clap alone would keep the last occurrence. The newrenamed_optionspass removes the shadowed alias tokens ahead of the parse, reusing the same clap-derived arity tables, so an alias value that spells a subcommand is never mistaken for one and a script's own--prefixstays the script's.Two smaller fixes ride along. The
--versionpre-scan (SwitchInput::from_version_argv) now reads option arity from the clap grammar instead of a hand-maintained list of value-taking options. The list did not know about--store-dir, sopnpm --store-dir /s --versiontook/sfor the command name and stopped scanning — a pre-existing bug that the--storealias would have extended. And the clap grammar is now built once per process (cli_args::grammar()) instead of per caller: constructing it walks every subcommand, and the pre-parse passes each need the same view of it, so this is a net reduction in startup work versusmain.TypeScript-side parity: none needed — the TS CLI already supports both spellings, this is pacquet catching up.
Closes #13583
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.
Written by an agent (Claude Code, claude-opus-5[1m]).
Summary by CodeRabbit
New Features
--prefixas an alias for--dir, supporting separate values and--prefix=<path>.--storeas an alias for--store-dir, including--store=<path>.pnpm --prefix <directory> run <script>now work as expected.Tests