Repository navigation
feat(install): add bun as a package manager - #1005
Conversation
How to use the Graphite Merge QueueAdd the label auto-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
45e4691 to
bc38b7a
Compare
810d51c to
efc5c42
Compare
efc5c42 to
d143fc6
Compare
d143fc6 to
9db93c2
Compare
183be48 to
f551a2a
Compare
9db93c2 to
cc73dcc
Compare
000f043 to
00ae674
Compare
a38d005 to
c16f4d5
Compare
00ae674 to
5fb8073
Compare
ffb13dd to
3659cb9
Compare
cfccc29 to
d64cba8
Compare
f5c94ee to
2430298
Compare
df57cf4 to
5534094
Compare
Some installation methods (e.g. mise) don't add `bunx` exe to PATH on Windows. Using `bun x` (subcommand) instead of `bunx` (separate binary) is more reliable across platforms and calls fewer binaries. Closes #1005
d16ee75 to
46a68bb
Compare
|
Need to add an e2e test for bun + vp lint type-aware https://github.com/voidzero-dev/vite-plus/actions/runs/23598882817/job/68723764147 |
Manual Testing PlanPrerequisitesmkdir /tmp/test-bun-vp && cd /tmp/test-bun-vp
echo '{"name":"test-bun","version":"1.0.0","packageManager":"bun@1.3.11"}' > package.json1. Detection & Install
2. Add & Remove
3. Update & Outdated
4. DLX (Execute package)
5. Why & Audit
6. PM Subcommands
7. Commands Delegating to npm
8. Monorepo with Catalog (
|
4572e20 to
3a85b2b
Compare
Merge activity
|
## Summary Add bun as the 4th supported package manager alongside pnpm, npm, and yarn. Bun is added only as a package manager and runtime support is not planned. Closes #557 ## Changes ### Rust Core - Add `Bun` variant to `PackageManagerType` enum - Detect bun via `packageManager` field, `bun.lock`, `bun.lockb`, `bunfig.toml` - Download platform-specific native binary from `@oven/bun-{os}-{arch}` npm packages (including musl variants) - Add native binary shim support (non-Node.js wrappers for sh/cmd/ps1) - Add `PackageManagerType::Bun` arms to all 30 command files with correct flag mappings - Add bun to interactive package manager selection menu ### Command Mappings - `bun install` with `--frozen-lockfile`, `--production`, `--ignore-scripts`, `--lockfile-only`, `--omit optional`, `--filter` - `bun add` with `--dev`, `--peer`, `--optional`, `--exact`, `--global` - `bun remove`, `bun update` (with `--latest`, `--interactive`, `--recursive`, `--production`) - `bun outdated` (with `--filter`, `--recursive`, `--production`, `--omit optional`) - `bun why` (with `--depth`), `bun x` (with `--package`), `bun audit` (with `--audit-level`) - `bun pm pack` (with `--filename`, `--gzip-level`), `bun pm ls`, `bun pm cache`, `bun pm whoami` - `bun info` for package view, `bun publish` for publishing - Unsupported commands (deprecate, fund, owner, ping, search, token) fall back to npm silently ### Global CLI & NAPI - Add `"bun"` to `PACKAGE_MANAGER_TOOLS` in shim dispatch - Add `"bun" => PackageManagerType::Bun` in NAPI binding ### TypeScript - Add `bun` to `PackageManager` type and selection prompt - Add `--package-manager` flag to `vp create` for easier testing - Handle bun in monorepo templates (uses `package.json` workspaces, not pnpm-workspace.yaml) - Bun catalog support: write catalog entries to root `package.json` with `catalog:` references in both dependencies and overrides - Migration: bun uses `overrides` with `catalog:` references (not raw versions) - Use `bun x` instead of `bunx` for DLX commands (better cross-platform compatibility) ### Snap Tests & Output Sanitizer - 10 bun command snap tests (add, remove, update, outdated, why, dlx, list, publish, view, cache) - 1 bun monorepo creation snap test (`new-vite-monorepo-bun`) verifying catalog support - Filter unstable bun output: `Resolving dependencies`, `Resolved, downloaded and extracted`, `Resolving...`, `Saved lockfile`, `(vX.Y.Z available)` ### RFCs - Update all 11 package-manager RFCs with bun command mapping tables ### Ecosystem CI - Add `bun-vite-template` (React + Mantine) test case ## Test plan - [x] `cargo test -p vite_install` — 455 tests pass (18 new bun tests) - [x] `cargo test -p vite_global_cli` — 311 tests pass - [x] `pnpm -F vite-plus snap-test-global bun` — all 10 bun snap tests pass - [x] `pnpm -F vite-plus snap-test-global new-vite-monorepo-bun` — catalog test passes - [x] `pnpm -F vite-plus snap-test-global new-vite-monorepo` — existing pnpm test unaffected - [x] Ecosystem CI clone verified locally for `bun-vite-template` - [x] Windows native cmd shim tested (no command echo) - [x] musl Linux binary detection tested 🤖 Generated with [Claude Code](https://claude.com/claude-code)
3a85b2b to
d0ba2fd
Compare
## Summary Add bun as the 4th supported package manager alongside pnpm, npm, and yarn. Bun is added only as a package manager and runtime support is not planned. Closes #557 ## Changes ### Rust Core - Add `Bun` variant to `PackageManagerType` enum - Detect bun via `packageManager` field, `bun.lock`, `bun.lockb`, `bunfig.toml` - Download platform-specific native binary from `@oven/bun-{os}-{arch}` npm packages (including musl variants) - Add native binary shim support (non-Node.js wrappers for sh/cmd/ps1) - Add `PackageManagerType::Bun` arms to all 30 command files with correct flag mappings - Add bun to interactive package manager selection menu ### Command Mappings - `bun install` with `--frozen-lockfile`, `--production`, `--ignore-scripts`, `--lockfile-only`, `--omit optional`, `--filter` - `bun add` with `--dev`, `--peer`, `--optional`, `--exact`, `--global` - `bun remove`, `bun update` (with `--latest`, `--interactive`, `--recursive`, `--production`) - `bun outdated` (with `--filter`, `--recursive`, `--production`, `--omit optional`) - `bun why` (with `--depth`), `bun x` (with `--package`), `bun audit` (with `--audit-level`) - `bun pm pack` (with `--filename`, `--gzip-level`), `bun pm ls`, `bun pm cache`, `bun pm whoami` - `bun info` for package view, `bun publish` for publishing - Unsupported commands (deprecate, fund, owner, ping, search, token) fall back to npm silently ### Global CLI & NAPI - Add `"bun"` to `PACKAGE_MANAGER_TOOLS` in shim dispatch - Add `"bun" => PackageManagerType::Bun` in NAPI binding ### TypeScript - Add `bun` to `PackageManager` type and selection prompt - Add `--package-manager` flag to `vp create` for easier testing - Handle bun in monorepo templates (uses `package.json` workspaces, not pnpm-workspace.yaml) - Bun catalog support: write catalog entries to root `package.json` with `catalog:` references in both dependencies and overrides - Migration: bun uses `overrides` with `catalog:` references (not raw versions) - Use `bun x` instead of `bunx` for DLX commands (better cross-platform compatibility) ### Snap Tests & Output Sanitizer - 10 bun command snap tests (add, remove, update, outdated, why, dlx, list, publish, view, cache) - 1 bun monorepo creation snap test (`new-vite-monorepo-bun`) verifying catalog support - Filter unstable bun output: `Resolving dependencies`, `Resolved, downloaded and extracted`, `Resolving...`, `Saved lockfile`, `(vX.Y.Z available)` ### RFCs - Update all 11 package-manager RFCs with bun command mapping tables ### Ecosystem CI - Add `bun-vite-template` (React + Mantine) test case ## Test plan - [x] `cargo test -p vite_install` — 455 tests pass (18 new bun tests) - [x] `cargo test -p vite_global_cli` — 311 tests pass - [x] `pnpm -F vite-plus snap-test-global bun` — all 10 bun snap tests pass - [x] `pnpm -F vite-plus snap-test-global new-vite-monorepo-bun` — catalog test passes - [x] `pnpm -F vite-plus snap-test-global new-vite-monorepo` — existing pnpm test unaffected - [x] Ecosystem CI clone verified locally for `bun-vite-template` - [x] Windows native cmd shim tested (no command echo) - [x] musl Linux binary detection tested 🤖 Generated with [Claude Code](https://claude.com/claude-code)
d0ba2fd to
f552eaf
Compare
## Summary Add bun as the 4th supported package manager alongside pnpm, npm, and yarn. Bun is added only as a package manager and runtime support is not planned. Closes #557 ## Changes ### Rust Core - Add `Bun` variant to `PackageManagerType` enum - Detect bun via `packageManager` field, `bun.lock`, `bun.lockb`, `bunfig.toml` - Download platform-specific native binary from `@oven/bun-{os}-{arch}` npm packages (including musl variants) - Add native binary shim support (non-Node.js wrappers for sh/cmd/ps1) - Add `PackageManagerType::Bun` arms to all 30 command files with correct flag mappings - Add bun to interactive package manager selection menu ### Command Mappings - `bun install` with `--frozen-lockfile`, `--production`, `--ignore-scripts`, `--lockfile-only`, `--omit optional`, `--filter` - `bun add` with `--dev`, `--peer`, `--optional`, `--exact`, `--global` - `bun remove`, `bun update` (with `--latest`, `--interactive`, `--recursive`, `--production`) - `bun outdated` (with `--filter`, `--recursive`, `--production`, `--omit optional`) - `bun why` (with `--depth`), `bun x` (with `--package`), `bun audit` (with `--audit-level`) - `bun pm pack` (with `--filename`, `--gzip-level`), `bun pm ls`, `bun pm cache`, `bun pm whoami` - `bun info` for package view, `bun publish` for publishing - Unsupported commands (deprecate, fund, owner, ping, search, token) fall back to npm silently ### Global CLI & NAPI - Add `"bun"` to `PACKAGE_MANAGER_TOOLS` in shim dispatch - Add `"bun" => PackageManagerType::Bun` in NAPI binding ### TypeScript - Add `bun` to `PackageManager` type and selection prompt - Add `--package-manager` flag to `vp create` for easier testing - Handle bun in monorepo templates (uses `package.json` workspaces, not pnpm-workspace.yaml) - Bun catalog support: write catalog entries to root `package.json` with `catalog:` references in both dependencies and overrides - Migration: bun uses `overrides` with `catalog:` references (not raw versions) - Use `bun x` instead of `bunx` for DLX commands (better cross-platform compatibility) ### Snap Tests & Output Sanitizer - 10 bun command snap tests (add, remove, update, outdated, why, dlx, list, publish, view, cache) - 1 bun monorepo creation snap test (`new-vite-monorepo-bun`) verifying catalog support - Filter unstable bun output: `Resolving dependencies`, `Resolved, downloaded and extracted`, `Resolving...`, `Saved lockfile`, `(vX.Y.Z available)` ### RFCs - Update all 11 package-manager RFCs with bun command mapping tables ### Ecosystem CI - Add `bun-vite-template` (React + Mantine) test case ## Test plan - [x] `cargo test -p vite_install` — 455 tests pass (18 new bun tests) - [x] `cargo test -p vite_global_cli` — 311 tests pass - [x] `pnpm -F vite-plus snap-test-global bun` — all 10 bun snap tests pass - [x] `pnpm -F vite-plus snap-test-global new-vite-monorepo-bun` — catalog test passes - [x] `pnpm -F vite-plus snap-test-global new-vite-monorepo` — existing pnpm test unaffected - [x] Ecosystem CI clone verified locally for `bun-vite-template` - [x] Windows native cmd shim tested (no command echo) - [x] musl Linux binary detection tested 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
@fengmk2 Seems like there is some issue with ts module augmentation when using overrides in bun monorepos. While the |
|
@nwidynski yes, please. |

Summary
Add bun as the 4th supported package manager alongside pnpm, npm, and yarn. Bun is added only as a package manager and runtime support is not planned.
Closes #557
Changes
Rust Core
Bunvariant toPackageManagerTypeenumpackageManagerfield,bun.lock,bun.lockb,bunfig.toml@oven/bun-{os}-{arch}npm packages (including musl variants)PackageManagerType::Bunarms to all 30 command files with correct flag mappingsCommand Mappings
bun installwith--frozen-lockfile,--production,--ignore-scripts,--lockfile-only,--omit optional,--filterbun addwith--dev,--peer,--optional,--exact,--globalbun remove,bun update(with--latest,--interactive,--recursive,--production)bun outdated(with--filter,--recursive,--production,--omit optional)bun why(with--depth),bun x(with--package),bun audit(with--audit-level)bun pm pack(with--filename,--gzip-level),bun pm ls,bun pm cache,bun pm whoamibun infofor package view,bun publishfor publishingGlobal CLI & NAPI
"bun"toPACKAGE_MANAGER_TOOLSin shim dispatch"bun" => PackageManagerType::Bunin NAPI bindingTypeScript
buntoPackageManagertype and selection prompt--package-managerflag tovp createfor easier testingpackage.jsonworkspaces, not pnpm-workspace.yaml)package.jsonwithcatalog:references in both dependencies and overridesoverrideswithcatalog:references (not raw versions)bun xinstead ofbunxfor DLX commands (better cross-platform compatibility)Snap Tests & Output Sanitizer
new-vite-monorepo-bun) verifying catalog supportResolving dependencies,Resolved, downloaded and extracted,Resolving...,Saved lockfile,(vX.Y.Z available)RFCs
Ecosystem CI
bun-vite-template(React + Mantine) test caseTest plan
cargo test -p vite_install— 455 tests pass (18 new bun tests)cargo test -p vite_global_cli— 311 tests passpnpm -F vite-plus snap-test-global bun— all 10 bun snap tests passpnpm -F vite-plus snap-test-global new-vite-monorepo-bun— catalog test passespnpm -F vite-plus snap-test-global new-vite-monorepo— existing pnpm test unaffectedbun-vite-template🤖 Generated with Claude Code