feat!: install pnpm v12 as a standalone native executable#11
Conversation
Since v12, pnpm is a Rust rewrite shipped as a native executable that needs neither Node.js nor npm. The action now resolves the requested version (exact, semver range, or dist-tag) against the npm registry, downloads the @pnpm/exe.<os>-<arch> tarball for the runner's platform, verifies its sha512 integrity, and places the pnpm binary (plus the pnpx, pn, and pnx aliases) directly into dest. This removes the whole npm-based bootstrap: the committed exe-lock.json, the update-bootstrap script, the npm ci step, the node-on-PATH hack, the Windows .bin shim workarounds, and the pnpm self-update step. Versions below 12 are rejected with a pointer to pnpm/action-setup. Adjustments for the Rust CLI: - 'pnpm store path' no longer accepts --silent - $PNPM_HOME/bin is created upfront: 'pnpm runtime set -g' fails with ERR_PNPM_PNPM_DIR_NOT_WRITABLE when it is missing - the --no-runtime version probe is gone (always supported in v12)
|
Warning Review limit reached
Next review available in: 52 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe action now installs pnpm v12+ as a verified standalone executable, resolves exact versions, ranges, and dist-tags, updates runtime integration, and expands workflow and documentation coverage for the new installation model. Changespnpm v12 installer migration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Action
participant npmRegistry
participant Installer
participant pnpm
Action->>Installer: resolve requested pnpm version
Installer->>npmRegistry: fetch package metadata and tarball
npmRegistry-->>Installer: version, executable, integrity
Installer->>Installer: verify and extract executable
Installer->>pnpm: run --version
pnpm-->>Action: installed version
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 QodoInstall pnpm v12+ by downloading the native executable from npm
AI Description
Diagram
High-Level Assessment
Files changed (13)
|
Code Review by Qodo
1.
|
The new release includes the pacquet parity fixes from pnpm/pnpm#13194: runtime set -g now creates a missing global bin dir, and the --silent shorthand is accepted again. The upfront dest/bin creation stays for users pinning alpha.17 or older.
- add a least-privilege permissions block to the test workflow (CodeQL: workflow does not limit GITHUB_TOKEN permissions) - use replaceAll when encoding the scoped package name for the registry URL (CodeQL: replace only rewrites the first occurrence) - extract only the pnpm binary entry from the downloaded tarball instead of the whole archive, and fail with an actionable message when no tar executable is on PATH (self-hosted minimal runners)
Includes the fresh-install --no-runtime fix (pnpm/pnpm#13225), which unblocks the devEngines test jobs that install without a lockfile.
* ci: update pnpm/setup to the v12 standalone-executable revision Since pnpm/setup#11 the action downloads the standalone pnpm v12 executable directly from the registry — no npm bootstrap, no system Node.js dependency. Every workflow moves to the new revision except update-latest.yml: its RELEASE_TOOL_PNPM_VERSION deliberately pins a proven pnpm 11, which only the pre-v12 action revision can install, so it keeps the old pin until that version moves to v12. * ci: operate the Tag workflow with pnpm v12 RELEASE_TOOL_PNPM_VERSION moves to 12.0.0-alpha.19 and the pnpm/setup pins to the v12 revision. The commands the workflow runs are rewritten to forms both CLIs accept, since the Rust CLI does not (yet) expose --registry, --allow-build on add, or a post-subcommand --dir: - --registry becomes --config.registry (read by both stacks) - the add build-script approval moves from `--allow-build=@pnpm/exe` to an allowBuilds entry in the scratch dir pnpm-workspace.yaml - --dir moves ahead of the subcommand Each rewritten command was verified against the 12.0.0-alpha.19 binary, including the verify-upgrade sequence end to end (add of `@pnpm/exe@11.16.0` with the build approval, bin shim run) and the config set/get/delete round trip for the auth token. * revert: operate the Tag workflow with pnpm v11 again Moving the operator to v12 required rewriting commands around three CLI surfaces pacquet is missing (--registry, --allow-build on add, post-subcommand --dir). The Rust CLI must gain those for parity instead of the workflow papering over them — tracked in #13242. The workflow keeps the pre-v12 pnpm/setup pin and pnpm 11.13.1 until that lands.
Summary
Since v12, pnpm is a Rust rewrite distributed as a standalone native executable — no Node.js or npm required. This PR reworks the action to take advantage of that, deleting the entire npm-based bootstrap.
Before: write a synthetic package.json + committed lockfile →
npm cito install@pnpm/exe(with a node-on-PATH hack so npm's shebang resolves) → fix up.binshims on Windows →pnpm self-update <target>.After: resolve the requested version against the npm registry → download the
@pnpm/exe.<os>-<arch>tarball → verify its sha512 integrity → drop thepnpmbinary (pluspnpx/pn/pnxaliases, which work via argv[0] dispatch) intodest.Details
src/install-pnpm/download.ts): exact versions are used directly; semver ranges resolve viamaxSatisfyingover the published platform-package versions (stable preferred, prerelease fallback so^12.0.0works during the alpha); anything else is treated as a dist-tag (e.g.next-12) and resolved against the mainpnpmpackage's tags — the per-platform packages carry stale tags (latest→ 11.0.0-rc.3).pnpm/action-setup. The version-source precedence is unchanged (versioninput →devEngines.packageManager→packageManager).exe-lock.json,scripts/update-bootstrap.mjs(no more periodic bootstrap bumps), thenpm cistep, the node-on-PATH hack, Windows.binshim workarounds, theself-updatestep and its no-op edge case, and the--no-runtimeversion probe. Dropped the unusedzoddependency; addedsemverand@actions/http-client(proxy-aware downloads).pnpm store pathno longer accepts--silent$PNPM_HOME/binis created upfront —pnpm runtime set -gfails withERR_PNPM_PNPM_DIR_NOT_WRITABLEwhen it's missing (arguably a pnpm alpha bug worth fixing separately)destdoubles asPNPM_HOME; the binary lives indest, while runtimes and any laterpnpm self-updateland indest/bin, which gets higher PATH precedence.12.0.0-alpha.17, new jobs for dist-tag and semver-range resolution, and anubuntu-24.04-armsmoke entry to cover the arm64 binary.INPUT_CACHE-DEPENDENCY-PATH, so the underscore-named exports never matched; inputs are now passed viaenv.Testing
HOME, no node/npm on PATH beyond the action runtime): exact version,next-12tag,^12.0.0-0range, and the sub-12 error path all behave;runtime set node@24lands node in$PNPM_HOME/bin;pnpm/pnpx/nodeall resolve on the simulated PATH; outputs are correct.pnpm installon the repo itself still pass.tscclean;dist/index.jsrebuilt.Open question
With
versionomitted and nopackageManager/devEngines.packageManagerin the manifest, the action still errors asking for a version — kept rather than defaulting tonext-12while v12 is prerelease.Summary by CodeRabbit
New Features
Documentation
Bug Fixes