Repository navigation
feat(pacquet): implement the npm-style pnpm version bump - #13200
Conversation
Replace the ERR_PNPM_NOT_IMPLEMENTED stub with the npm-style form: `pnpm version <major|minor|patch|premajor|preminor|prepatch|prerelease>` and `pnpm version <exact-version>` (a leading `v` is accepted and stripped, like semver.valid), also recursively with `-r`/`--filter`. The bare `pnpm version -r` change-intents release flow is untouched. The bump follows node-semver's inc() with its default identifier base of 0 — bumping major/minor/patch from a matching prerelease finalizes it, the pre* types start a `.0` prerelease honoring `--preid`, and `prerelease` increments the right-most numeric identifier. Options mirror the TypeScript CLI: `--allow-same-version`, `--message` with `%s` substitution, `--no-git-tag-version`, `--no-commit-hooks`, `--sign-git-tag`, `--tag-version-prefix` (default "v"), and `--json`. The single-package form records the bump as a commit plus an annotated (or GPG-signed) tag through the same RunCommand capability the publish git checks use; recursive runs skip the commit and tag since there is no single version to tag with. The preversion/version/postversion scripts run through pacquet-executor's run_lifecycle_hook — the same port of `@pnpm/exec.lifecycle` the upstream handler calls — re-reading the manifest between stages so each hook sees the right version. Error codes match pnpm: ERR_PNPM_INVALID_VERSION_BUMP, ERR_PNPM_INVALID_VERSION, ERR_PNPM_VERSION_NOT_CHANGED, ERR_PNPM_NO_PACKAGES_TO_VERSION, ERR_PNPM_UNCLEAN_WORKING_TREE. The TypeScript CLI already ships this form, so only the pacquet side changes; no TypeScript change is needed. Covers the remaining `version` gap under the Stage 3 command surface in pnpm#11633. Tests: a unit table driving inc() through the node-semver cases, plus integration tests against the built binary porting the upstream scenarios from releasing/commands/test/version/index.test.ts and pnpm/test/version.ts — bumps, preid, JSON output, explicit versions, same-version handling, lifecycle-hook ordering, the git commit/tag matrix, and recursive selection with and without --filter. Co-Authored-By: Claude Fable 5 <[email protected]>
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? |
|
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)
📝 WalkthroughWalkthroughChangesnpm-style versioning
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant VersionArgs
participant WorkspacePackages
participant PackageManifest
participant LifecycleHooks
participant Git
CLI->>VersionArgs: dispatch version with directory and reporter
VersionArgs->>WorkspacePackages: select packages for recursive mode
VersionArgs->>PackageManifest: compute and write versions
VersionArgs->>LifecycleHooks: run version lifecycle scripts
VersionArgs->>Git: commit and tag single-package changes
Possibly related issues
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/5The latest fixes appear safe to merge.
Reviews (2): Last reviewed commit: "test(pacquet): cover the version git-fai..." | Re-trigger Greptile |
| recursive: bool, | ||
| ) -> miette::Result<()> { | ||
| match self.params.first().map(String::as_str) { | ||
| None if recursive => self.release_from_intents(config).await, | ||
| None => Err(VersionError::MissingBump.into()), | ||
| Some(bump) => Err(VersionError::NpmStyleNotPorted { bump: bump.to_string() }.into()), | ||
| Some(_) => self.npm_style_bump::<Reporter>(config, dir, recursive), |
There was a problem hiding this comment.
Extra Version Arguments Are Ignored
The command accepts params as a vector but dispatches solely from its first entry, so pnpm version patch unexpected silently performs a patch bump and ignores the remaining required input. Reject more than one positional version argument before changing the manifest so malformed invocations cannot report success.
Context Used: pnpm/AGENTS.md (source)
An empty --preid produced an empty prerelease identifier and wrote an invalid version like 1.0.1-.0 into the manifest. The TypeScript CLI never does: the empty string is falsy to semver's inc(), which then starts the prerelease at a bare -0. Filter the empty preid out to match. Co-Authored-By: Claude Fable 5 <[email protected]>
The perfectionist dylint lint rejects U+2026 in comments; use ASCII dots. Co-Authored-By: Claude Fable 5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13200 +/- ##
==========================================
+ Coverage 86.74% 86.76% +0.01%
==========================================
Files 524 524
Lines 88363 88672 +309
==========================================
+ Hits 76653 76935 +282
- Misses 11710 11737 +27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A failing git commit (a rejecting pre-commit hook without --no-commit-hooks) surfaces git's stderr and leaves no tag behind, and an empty --tag-version-prefix tags without the default v. Co-Authored-By: Claude Fable 5 <[email protected]>
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.59690078854,
"stddev": 0.1673117390257194,
"median": 2.55593442434,
"user": 1.9916744199999996,
"system": 1.5504278399999998,
"min": 2.4300388278400002,
"max": 2.8104234958400003,
"times": [
2.76226892184,
2.48750835884,
2.43553140084,
2.43616037984,
2.7925251978400003,
2.8104234958400003,
2.75047197584,
2.62436048984,
2.4300388278400002,
2.43971883684
]
},
{
"command": "pacquet@main",
"mean": 2.57366213414,
"stddev": 0.16346514978557206,
"median": 2.5193716528400003,
"user": 2.05367502,
"system": 1.5128834399999997,
"min": 2.39894291084,
"max": 2.92289168984,
"times": [
2.56866723784,
2.55895012084,
2.92289168984,
2.4380152118400003,
2.80449233284,
2.5022225808400003,
2.52890468484,
2.50369595084,
2.50983862084,
2.39894291084
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6084230164400002,
"stddev": 0.12560619705656617,
"median": 1.64469630884,
"user": 1.22873292,
"system": 1.2830075399999998,
"min": 1.4247606528399999,
"max": 1.79502730384,
"times": [
1.58648829784,
1.6974532868399999,
1.4522363058399999,
1.67426093984,
1.4247606528399999,
1.45628244684,
1.79502730384,
1.62821206684,
1.70832831284,
1.66118055084
]
},
{
"command": "pnpr@main",
"mean": 1.53458562984,
"stddev": 0.15381062718436952,
"median": 1.53284537034,
"user": 1.09198482,
"system": 1.18065924,
"min": 1.34843898884,
"max": 1.79601018684,
"times": [
1.79601018684,
1.59979271684,
1.40968039684,
1.57454548984,
1.49114525084,
1.66036623684,
1.69584298184,
1.34843898884,
1.38165234684,
1.38838170284
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.27236696332,
"stddev": 0.04598850663856332,
"median": 0.26073831742000003,
"user": 0.22159959999999995,
"system": 0.5457891,
"min": 0.24203594392000002,
"max": 0.40127546292000005,
"times": [
0.40127546292000005,
0.25492001892,
0.26292146992000004,
0.26609952792,
0.25855516492,
0.26319764792,
0.24866241792000002,
0.25790058792000004,
0.26810139092,
0.24203594392000002
]
},
{
"command": "pacquet@main",
"mean": 0.25746635912000004,
"stddev": 0.015000360476441748,
"median": 0.25268478392000004,
"user": 0.20669149999999997,
"system": 0.522873,
"min": 0.23760942592,
"max": 0.28600595792,
"times": [
0.27331357292,
0.25012830592,
0.27008381792,
0.24478413692,
0.25395227492,
0.25141729292000004,
0.24614370592,
0.23760942592,
0.28600595792,
0.26122509992000004
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27369767091999997,
"stddev": 0.01610239667503817,
"median": 0.27275203991999997,
"user": 0.23238940000000002,
"system": 0.5177558,
"min": 0.24775571792,
"max": 0.30599354092000003,
"times": [
0.26832954892,
0.27071675392,
0.27529055892000004,
0.27478732592,
0.30599354092000003,
0.28965333592000003,
0.26694776892,
0.27940629492,
0.24775571792,
0.25809586292000003
]
},
{
"command": "pnpr@main",
"mean": 0.28605403932000006,
"stddev": 0.012535621849825753,
"median": 0.28232420542000003,
"user": 0.25452850000000005,
"system": 0.5443714999999999,
"min": 0.27071368892000003,
"max": 0.30463137592,
"times": [
0.30109254292000004,
0.30463137592,
0.27278788692,
0.29717515792,
0.27071368892000003,
0.27253266892,
0.28229214492,
0.28193758092,
0.28235626592,
0.29502107992000004
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.98824755762,
"stddev": 0.12589931833290824,
"median": 2.95572727472,
"user": 2.26091688,
"system": 1.639078,
"min": 2.85890562122,
"max": 3.2038063002199997,
"times": [
2.91169865522,
3.2038063002199997,
3.19399641422,
2.96344413322,
3.0008817362199998,
2.94801041622,
3.04922423522,
2.85890562122,
2.88222882022,
2.87027924422
]
},
{
"command": "pacquet@main",
"mean": 2.82660368702,
"stddev": 0.03239969676525254,
"median": 2.8305967587199996,
"user": 1.8686677800000002,
"system": 1.3732384999999998,
"min": 2.78026917222,
"max": 2.86917123722,
"times": [
2.84684548822,
2.8175253362199997,
2.85210279622,
2.80146757822,
2.84366818122,
2.86261711922,
2.86917123722,
2.78026917222,
2.7844409522199998,
2.80792900922
]
},
{
"command": "pnpr@HEAD",
"mean": 1.57988801372,
"stddev": 0.12749984120926275,
"median": 1.53389023972,
"user": 1.0775256799999997,
"system": 1.2094464000000003,
"min": 1.43768310522,
"max": 1.80258732522,
"times": [
1.6111975282200002,
1.4774321832200001,
1.7661592642200001,
1.43768310522,
1.6640942372200003,
1.5506947072200001,
1.80258732522,
1.5058109622200002,
1.46613505222,
1.51708577222
]
},
{
"command": "pnpr@main",
"mean": 1.5931720968199998,
"stddev": 0.11656861033619983,
"median": 1.5736128282200001,
"user": 1.06457428,
"system": 1.2011286999999997,
"min": 1.4364162902200002,
"max": 1.7782721952200002,
"times": [
1.54295790122,
1.5814557932200002,
1.4364162902200002,
1.7704963762200001,
1.58908808322,
1.7782721952200002,
1.6659725092200002,
1.44511456922,
1.5657698632200001,
1.5561773872200002
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.62708542972,
"stddev": 0.06961970156764104,
"median": 0.60982059472,
"user": 0.76056264,
"system": 0.6984849999999999,
"min": 0.56518776422,
"max": 0.7930454642200001,
"times": [
0.7930454642200001,
0.63683050722,
0.5828106822200001,
0.5802301522200001,
0.56518776422,
0.64744141322,
0.6395402182200001,
0.5763507532200001,
0.5755017532200001,
0.67391558922
]
},
{
"command": "pacquet@main",
"mean": 0.6268181461200001,
"stddev": 0.05662710805528345,
"median": 0.60767187372,
"user": 0.77051564,
"system": 0.7012081999999998,
"min": 0.56101444022,
"max": 0.71170104322,
"times": [
0.56242663822,
0.5840439082200001,
0.59386016222,
0.6718271642200001,
0.6935496722200001,
0.71170104322,
0.67684451022,
0.59143033722,
0.62148358522,
0.56101444022
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29979944072000003,
"stddev": 0.00655777050392439,
"median": 0.30084120822000004,
"user": 0.19654884,
"system": 0.5288401,
"min": 0.28807335922000005,
"max": 0.30863664322000006,
"times": [
0.29630363022000006,
0.30517592522000003,
0.30468958322000006,
0.29623387922000005,
0.30249090122000005,
0.28807335922000005,
0.30504908722,
0.29214988322,
0.29919151522000004,
0.30863664322000006
]
},
{
"command": "pnpr@main",
"mean": 0.30741927812000003,
"stddev": 0.014429299181577813,
"median": 0.3046362932200001,
"user": 0.20112934,
"system": 0.5519487999999999,
"min": 0.29144915822000006,
"max": 0.34430768422,
"times": [
0.34430768422,
0.31184501922,
0.30740991322000005,
0.29753483922,
0.30856854622,
0.31045346022000003,
0.30001429722000006,
0.29144915822000006,
0.30186267322000004,
0.30074719022
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.9427972096200001,
"stddev": 0.04112465982961737,
"median": 1.93098460142,
"user": 1.0147754,
"system": 0.7707944,
"min": 1.9089607124199999,
"max": 2.04593228342,
"times": [
1.92159684442,
1.94227827142,
1.93321254342,
1.9089607124199999,
1.92875665942,
1.93742653342,
1.9234735544200001,
1.90926943142,
2.04593228342,
1.97706526242
]
},
{
"command": "pacquet@main",
"mean": 1.9520336541200003,
"stddev": 0.054865395960565645,
"median": 1.9326089419199999,
"user": 1.0483444,
"system": 0.7560028000000001,
"min": 1.90014635342,
"max": 2.08419163142,
"times": [
1.9373220094199999,
1.9770262244199999,
1.9556730774200002,
1.90479130242,
1.90014635342,
1.92142545242,
1.9220365674200002,
1.9278958744199999,
1.9898280484200002,
2.08419163142
]
},
{
"command": "pnpr@HEAD",
"mean": 0.32330382032000005,
"stddev": 0.024432261187119792,
"median": 0.32153187742000006,
"user": 0.21660870000000002,
"system": 0.5625988000000001,
"min": 0.29158604742000005,
"max": 0.38112487542000006,
"times": [
0.38112487542000006,
0.33151519642000005,
0.33064368142000006,
0.32165965642000005,
0.32140409842000006,
0.32922861742000004,
0.31955625242,
0.29158604742000005,
0.29898789642000007,
0.30733188142000006
]
},
{
"command": "pnpr@main",
"mean": 0.32010660932000007,
"stddev": 0.022261449509792284,
"median": 0.31392239392000004,
"user": 0.20928859999999996,
"system": 0.5613965999999999,
"min": 0.29939618242000005,
"max": 0.37688497542000005,
"times": [
0.30343467442000005,
0.31661976642000006,
0.32496269942000006,
0.30605874342000006,
0.33150684942,
0.31074999042000007,
0.31122502142,
0.32022719042000003,
0.29939618242000005,
0.37688497542000005
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.39221902366,
"stddev": 0.019565140763238707,
"median": 0.39174088816,
"user": 0.38328272,
"system": 0.06288996,
"min": 0.36359541066,
"max": 0.43928825566,
"times": [
0.38269285866,
0.39997607366000004,
0.43928825566,
0.39278450066000004,
0.38053351866,
0.36359541066,
0.39069727566,
0.38212750766000003,
0.39510321766,
0.39539161766
]
},
{
"command": "pacquet@main",
"mean": 0.39480483186000004,
"stddev": 0.016893409439524137,
"median": 0.39536454416,
"user": 0.38376512,
"system": 0.06414055999999999,
"min": 0.36851999366,
"max": 0.42444222866000003,
"times": [
0.40019705866,
0.36851999366,
0.38104029766,
0.40460149966000003,
0.40495295766,
0.37741191066,
0.39053202966,
0.42444222866000003,
0.38726116766,
0.40908917466
]
},
{
"command": "pnpr@HEAD",
"mean": 0.09896105827290323,
"stddev": 0.011283327900186067,
"median": 0.09362072566000001,
"user": 0.02772810387096773,
"system": 0.012782187096774195,
"min": 0.08635397166000001,
"max": 0.12583537766,
"times": [
0.09065028866000001,
0.08844339866,
0.08815082166000002,
0.09126998866000001,
0.09328118066,
0.09079518866000001,
0.08690497566000001,
0.09152858366000001,
0.08635397166000001,
0.08662805566000001,
0.08996904066000001,
0.11559021866000001,
0.10597134366000001,
0.09676011266000001,
0.11633701766000001,
0.09306420366000001,
0.10946029566000001,
0.10762845066000001,
0.09181530266000001,
0.09834642766000001,
0.09124080366000001,
0.11811888866000002,
0.12186095566,
0.09907225766000001,
0.09800834366000001,
0.12583537766,
0.10255102066,
0.09362072566000001,
0.10771871966000002,
0.10044494166000001,
0.09037190466000002
]
},
{
"command": "pnpr@main",
"mean": 0.09499468114387098,
"stddev": 0.006098810168679418,
"median": 0.09275855966000002,
"user": 0.02507984580645161,
"system": 0.011994750322580641,
"min": 0.08546363266000001,
"max": 0.10702933666000002,
"times": [
0.09171525366000001,
0.09173262666000001,
0.09642974366000001,
0.08876693566,
0.08851286966000001,
0.08953503666000001,
0.08695328466,
0.09420201666000001,
0.10702933666000002,
0.10634183766000001,
0.09253942866,
0.10276414066000002,
0.09736805266000001,
0.10388460066,
0.09502971866000001,
0.09555178766000001,
0.09814158366000002,
0.10474769866000001,
0.09186584666000001,
0.09708647566,
0.09275855966000002,
0.09062673266000001,
0.08931098666000001,
0.09083827066000001,
0.09125935966000001,
0.09104879466000002,
0.08546363266000001,
0.09941326666000001,
0.09706296066000002,
0.09033472566000002,
0.10651955066000002
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.82191877648,
"stddev": 0.20098739061934598,
"median": 4.83520420528,
"user": 2.64808604,
"system": 1.92946396,
"min": 4.56259309378,
"max": 5.17888422678,
"times": [
4.99556991278,
4.56259309378,
4.68994990078,
4.96270457078,
4.62125215578,
4.6142793617799995,
5.17888422678,
4.77422981178,
4.92354613178,
4.89617859878
]
},
{
"command": "pacquet@main",
"mean": 5.16954666158,
"stddev": 0.28297000725016763,
"median": 5.163688220779999,
"user": 3.40970924,
"system": 2.48351566,
"min": 4.82361858278,
"max": 5.60050589678,
"times": [
4.90452382578,
5.07120659778,
5.33784785578,
5.56027542578,
5.2561698437799995,
5.60050589678,
5.0347531087799995,
5.27872288578,
4.82784259278,
4.82361858278
]
},
{
"command": "pnpr@HEAD",
"mean": 4.02760494618,
"stddev": 0.12082909340984833,
"median": 3.9887807502799997,
"user": 2.30854034,
"system": 2.31665016,
"min": 3.86767230078,
"max": 4.18068124678,
"times": [
3.95901020078,
4.18068124678,
3.91860122678,
3.9166360717799997,
4.1749419547799995,
3.9701674587799998,
4.00739404178,
3.86767230078,
4.10447815778,
4.17646680178
]
},
{
"command": "pnpr@main",
"mean": 3.6637335227799994,
"stddev": 0.11675507756673031,
"median": 3.68368489678,
"user": 1.5747682399999996,
"system": 1.5929198599999999,
"min": 3.5121457857799996,
"max": 3.91267168478,
"times": [
3.91267168478,
3.7035280727799997,
3.6110833637799997,
3.72706121578,
3.57634774978,
3.68556608378,
3.7027186147799998,
3.5121457857799996,
3.6818037097799996,
3.52440894678
]
}
]
} |
|
| Branch | pr/13200 |
| 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,437.68 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 291.59 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 288.07 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 86.35 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,424.76 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,867.67 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 247.76 ms |
Replace the ERR_PNPM_NOT_IMPLEMENTED stub with the npm-style form:
pnpm version <major|minor|patch|premajor|preminor|prepatch|prerelease>andpnpm version <exact-version>(a leadingvis accepted and stripped, like semver.valid), also recursively with-r/--filter. The barepnpm version -rchange-intents release flow is untouched.The bump follows node-semver's inc() with its default identifier base of 0 — bumping major/minor/patch from a matching prerelease finalizes it, the pre* types start a
.0prerelease honoring--preid, andprereleaseincrements the right-most numeric identifier. Options mirror the TypeScript CLI:--allow-same-version,--messagewith%ssubstitution,--no-git-tag-version,--no-commit-hooks,--sign-git-tag,--tag-version-prefix(default "v"), and--json.The single-package form records the bump as a commit plus an annotated (or GPG-signed) tag through the same RunCommand capability the publish git checks use; recursive runs skip the commit and tag since there is no single version to tag with. The preversion/version/postversion scripts run through pacquet-executor's run_lifecycle_hook — the same port of
@pnpm/exec.lifecyclethe upstream handler calls — re-reading the manifest between stages so each hook sees the right version. Error codes match pnpm: ERR_PNPM_INVALID_VERSION_BUMP, ERR_PNPM_INVALID_VERSION, ERR_PNPM_VERSION_NOT_CHANGED, ERR_PNPM_NO_PACKAGES_TO_VERSION, ERR_PNPM_UNCLEAN_WORKING_TREE.The TypeScript CLI already ships this form, so only the pacquet side changes; no TypeScript change is needed. Covers the remaining
versiongap under the Stage 3 command surface in #11633.Tests: a unit table driving inc() through the node-semver cases, plus integration tests against the built binary porting the upstream scenarios from releasing/commands/test/version/index.test.ts and pnpm/test/version.ts — bumps, preid, JSON output, explicit versions, same-version handling, lifecycle-hook ordering, the git commit/tag matrix, and recursive selection with and without --filter.
Summary
Implements the npm-style form of
pnpm versionin pacquet, replacing theERR_PNPM_NOT_IMPLEMENTEDstub:pnpm version <major|minor|patch|premajor|preminor|prepatch|prerelease>andpnpm version <exact-version>, also recursively with-r/--filter. The barepnpm version -rchange-intents release flow from #12953 is untouched, and the two forms interact exactly as the TypeScript handler dictates (a version argument selects the npm-style bump; intents are neither consumed nor garbage-collected by it — there is a test proving that).The TypeScript CLI already ships this form (
pnpm11/releasing/commands/src/version/index.ts), so only the pacquet side changes. Covers the remainingversiongap under the Stage 3 command surface in #11633.Behavior parity highlights:
inc()reproducing node-semver's semantics with its default identifier base of0(finalizing prereleases onmajor|minor|patch,--preidhandling, right-most-numeric prerelease increments), verified by a 20-case unit table.--preid,--allow-same-version,--message(%ssubstitution),--no-git-tag-version,--no-commit-hooks,--sign-git-tag,--tag-version-prefix(defaultv),--json.preversion/version/postversionrun throughpacquet-executor'srun_lifecycle_hook— the port of the same upstreamexec.lifecyclepackage the TypeScript handler calls — re-reading the manifest between stages so each hook sees the right version.ERR_PNPM_INVALID_VERSION_BUMP,ERR_PNPM_INVALID_VERSION,ERR_PNPM_VERSION_NOT_CHANGED,ERR_PNPM_NO_PACKAGES_TO_VERSION,ERR_PNPM_UNCLEAN_WORKING_TREE.Tests: all 27 scenarios of
releasing/commands/test/version/index.test.tsand both e2e cases ofpnpm/test/version.tsare mapped onto 21 integration tests driving the built binary, plus the unitinc()table; three extra tests cover the unclean-tree gate,--filterend to end, and the change-intent survival guard.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.(The TypeScript CLI already ships this form; this PR adds the pacquet side.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Updated the documentation if needed.(No docs change: the command formis already documented for the TypeScript CLI.)
Made with the help of Claude Code (claude-fable-5).
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
pnpm versionbumps for major/minor/patch, prereleases (with--preid), and exact versions (v-prefix supported).pnpm versionfor workspaces with recursive execution and advanced workspace selection.--message,--no-git-tag-version,--no-commit-hooks,--sign-git-tag,--tag-version-prefix), and--json.--allow-same-version.Bug Fixes
pnpm versionbehavior across reporters and execution contexts (directory/recursive handling).Tests