feat(npm): support pnpm as a package manager for npm backend#7214
feat(npm): support pnpm as a package manager for npm backend#7214
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for pnpm as a package manager in the npm backend, alongside the existing npm and bun options. It introduces a new npm.package_manager string setting to replace the legacy boolean npm.bun setting while maintaining backward compatibility.
Key changes:
- Introduces
npm.package_managersetting that accepts "npm", "bun", or "pnpm" values - Deprecates the legacy
npm.bunboolean setting with backward compatibility preserved - Implements pnpm-specific installation logic with proper global directory and bin path configuration
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/config/settings.rs | Adds backward compatibility logic to map npm.bun=true to npm.package_manager="bun" |
| src/backend/npm.rs | Replaces if/else logic with match statement supporting npm, bun, and pnpm; adds pnpm to dependencies list and implements pnpm-specific installation commands |
| settings.toml | Marks npm.bun as deprecated and hidden; adds new npm.package_manager setting with documentation |
| schema/mise.json | Updates JSON schema to mark bun property as deprecated and adds package_manager property |
| e2e/backend/test_npm_package_manager | New comprehensive test file covering all three package managers and backward compatibility scenarios |
| e2e/backend/test_npm_bun | Removed obsolete test file (replaced by test_npm_package_manager) |
| docs/dev-tools/backends/npm.md | Updates documentation to reflect support for npm, bun, and pnpm as package managers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
bugbot run |
|
bugbot run |
| if Settings::get().npm.package_manager == "npm" { | ||
| Ok(vec![tv.install_path()]) | ||
| } else { | ||
| Ok(vec![tv.install_path().join("bin")]) |
There was a problem hiding this comment.
Bug: Windows bin path mismatch for non-standard package manager values
The install_version_ function uses a match expression that treats any value other than "bun" or "pnpm" as npm (via the wildcard _ case). However, the Windows-specific list_bin_paths function uses an equality check == "npm" which only matches the exact string "npm". If a user sets npm.package_manager to any non-standard value (like a typo or uppercase "NPM"), the installation will use npm but list_bin_paths will incorrectly return install_path().join("bin") instead of install_path(), causing installed binaries to not be found on Windows.
Additional Locations (1)
### 🚀 Features - **(npm)** support pnpm as a package manager for npm backend by @risu729 in [#7214](#7214) - **(tool-stubs)** add --bootstrap flag to mise generate tool-stub by @jdx in [#7203](#7203) ### 🐛 Bug Fixes - **(alpine)** increase alpine release timeout to 60 minutes by @jdx in [#7188](#7188) - **(bun)** use x64-baseline for aarch64 on Windows by @roele in [#7190](#7190) - **(tools)** allow using env vars in tools by @antonsergeyev in [#7205](#7205) - add cfg(feature = "self_update") to statics only used by that feature by @jdx in [#7185](#7185) ### 📚 Documentation - Update registry.md by @jdx in [ad11ad1](ad11ad1) ### 📦️ Dependency Updates - update ghcr.io/jdx/mise:alpine docker digest to 2909cce by @renovate[bot] in [#7196](#7196) - update fedora:43 docker digest to 6cd815d by @renovate[bot] in [#7195](#7195) - update ghcr.io/jdx/mise:deb docker digest to 1893530 by @renovate[bot] in [#7198](#7198) - update ghcr.io/jdx/mise:copr docker digest to 0447a85 by @renovate[bot] in [#7197](#7197) ### 📦 Registry - add Supabase CLI to registry.toml by @bodadotsh in [#7206](#7206) - add cmake aqua backend by @mangkoran in [#7186](#7186) ### New Contributors - @antonsergeyev made their first contribution in [#7205](#7205) - @bodadotsh made their first contribution in [#7206](#7206) ## 📦 Aqua Registry Updates #### New Packages (3) - [`skanehira/ghost`](https://github.com/skanehira/ghost) - [`square/certigo`](https://github.com/square/certigo) - [`steveyegge/beads`](https://github.com/steveyegge/beads) #### Updated Packages (8) - [`apache/maven`](https://github.com/apache/maven) - [`apple/container`](https://github.com/apple/container) - [`aquasecurity/trivy`](https://github.com/aquasecurity/trivy) - [`charmbracelet/crush`](https://github.com/charmbracelet/crush) - [`goreleaser/goreleaser`](https://github.com/goreleaser/goreleaser) - [`goreleaser/nfpm`](https://github.com/goreleaser/nfpm) - [`ninja-build/ninja`](https://github.com/ninja-build/ninja) - [`twpayne/chezmoi`](https://github.com/twpayne/chezmoi)
ref: #4879
The reason I reconsidered this is the
minimumReleaseAgeoption, which restricts downloading recently released npm package versions to avoid installing compromised ones. If you don't think it's worth adding a new option, feel free to close this.pnpm viewexists, but it just passes through tonpm, so I think we can stick with usingnpminlist_remote_versions.https://github.com/pnpm/pnpm/blob/19fb36dc6adce16efac97481510485b1960d5243/pnpm/src/pnpm.ts#L44-L47
Note
Adds
npm.package_manager(supports npm/bun/pnpm) with pnpm install flow, deprecatesnpm.bun, and updates docs/schema/tests.settings.npm.package_managerwith support fornpm(default),bun, andpnpm; keep usingnpmfor version queries.pnpminstall path (global dir/bin flags, PATH workaround) and includepnpminget_dependencies.settings.npm.bun; auto-map legacynpm.bun=truetonpm.package_manager=bun.MISE_NPM_PACKAGE_MANAGER; markMISE_NPM_BUNhidden/deprecated.schema/mise.jsonfornpm.package_manager; marknpm.bundeprecated.test_npm_bunwithtest_npm_package_managercovering default, bun, pnpm, and legacy override behaviors.Written by Cursor Bugbot for commit 5b10c3d. This will update automatically on new commits. Configure here.