Skip to content

Conversation

@risu729
Copy link
Contributor

@risu729 risu729 commented Dec 8, 2025

ref: #4879

The reason I reconsidered this is the minimumReleaseAge option, 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 view exists, but it just passes through to npm, so I think we can stick with using npm in list_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, deprecates npm.bun, and updates docs/schema/tests.

  • Backend (npm):
    • Add settings.npm.package_manager with support for npm (default), bun, and pnpm; keep using npm for version queries.
    • Implement pnpm install path (global dir/bin flags, PATH workaround) and include pnpm in get_dependencies.
    • Update Windows bin path resolution to depend on selected package manager.
  • Settings:
    • Deprecate settings.npm.bun; auto-map legacy npm.bun=true to npm.package_manager=bun.
    • Expose MISE_NPM_PACKAGE_MANAGER; mark MISE_NPM_BUN hidden/deprecated.
  • Schema/Docs:
    • Extend schema/mise.json for npm.package_manager; mark npm.bun deprecated.
    • Docs note bun/pnpm requirements and include settings component.
  • Tests:
    • Replace test_npm_bun with test_npm_package_manager covering default, bun, pnpm, and legacy override behaviors.

Written by Cursor Bugbot for commit 5b10c3d. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings December 8, 2025 12:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_manager setting that accepts "npm", "bun", or "pnpm" values
  • Deprecates the legacy npm.bun boolean 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.

@jdx
Copy link
Owner

jdx commented Dec 8, 2025

bugbot run

@jdx
Copy link
Owner

jdx commented Dec 8, 2025

bugbot run

if Settings::get().npm.package_manager == "npm" {
Ok(vec![tv.install_path()])
} else {
Ok(vec![tv.install_path().join("bin")])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

@jdx jdx merged commit 86e42b9 into jdx:main Dec 8, 2025
28 checks passed
jdx pushed a commit that referenced this pull request Dec 8, 2025
### 🚀 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)
@risu729 risu729 deleted the npm-package-manager branch December 8, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants