Skip to content

feat(pm): support bun 1.4 package manager commands - #2513

Merged
fengmk2 merged 10 commits into
voidzero-dev:mainfrom
jong-kyung:feat/bun-1-4-pm-commands
Aug 21, 2026
Merged

feat(pm): support bun 1.4 package manager commands#2513
fengmk2 merged 10 commits into
voidzero-dev:mainfrom
jong-kyung:feat/bun-1-4-pm-commands

Conversation

@jong-kyung

@jong-kyung jong-kyung commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Bun 1.4 added native package manager commands that vp previously worked around: dedupe, prune, and audit fix, plus --filter for add/remove/update and --catalog for add.

Release notes: https://bun.com/blog/bun-v1.4

When the detected bun version is >= 1.4, vp now routes these directly:

  • vp dedupe runs bun dedupe, including --check, instead of falling back to bun install.
  • vp pm prune runs bun prune, mapping --prod to --production, instead of a noop. bun prune has no optional flag, so --no-optional is declared unsupported for bun.
  • vp pm audit --fix runs bun audit fix instead of a noop.
  • vp add/vp remove/vp update forward --filter, and vp add forwards --save-catalog as --catalog. vp update previously dropped --filter silently; bun before 1.4 now warns before dropping it.

Older bun versions keep the previous fallback or noop behavior, with diagnostics that now name the required version. The version gating uses the existing not_supported(bun < "1.4") macro rules for flags and a supports_v1_4_commands predicate for the hand-written resolvers.

Every command is covered by resolution unit tests and a bun 1.4 PTY snapshot case that runs the real binary: dedupe and check mode, prune removing a dev dependency with --production, audit fix, and workspace fixtures verifying --filter scoping and the catalog: entry written by --catalog.

Closes #2460

@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit a280630
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a87af9cdb300a0008b74ba6

@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex

Bun 1.4 added a native dedupe command with a --check mode. Run it when
the detected bun is >= 1.4 and keep the bun install fallback with a
version-hinted diagnostic for older versions. Covered by resolution
unit tests and a bun 1.4 PTY snapshot case in the pm_dedupe fixture.

Refs voidzero-dev#2460
Bun 1.4 added a native prune command with a --production flag. Run it
when the detected bun is >= 1.4, mapping --prod to --production, and
keep the noop diagnostic for older versions. bun prune has no optional
flag, so --no-optional is now declared unsupported for bun. Covered by
resolution unit tests and a bun 1.4 PTY snapshot case.

Refs voidzero-dev#2460
Bun 1.4 added an audit fix subcommand. Run it when the detected bun is
>= 1.4 and keep the noop diagnostic with a version hint for older
versions. Covered by resolution unit tests and a bun 1.4 PTY snapshot
case in a new pm_audit fixture.

Refs voidzero-dev#2460
Bun 1.4 supports workspace-filtered installs and default-catalog saves.
Relax the not_supported rules to bun < 1.4 so newer versions receive
the flags while older versions keep the warn-and-drop behavior.
Covered by resolution unit tests and a bun 1.4 workspace PTY snapshot
case.

Refs voidzero-dev#2460
Covered by resolution unit tests and a bun 1.4 workspace PTY snapshot
case.

Refs voidzero-dev#2460
bun update previously dropped --filter silently; bun before 1.4 now
warns before dropping it, and 1.4 or newer receives the flag. Covered
by resolution unit tests and a bun 1.4 workspace PTY snapshot case.

Refs voidzero-dev#2460
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: d63e35e0ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jong-kyung
jong-kyung force-pushed the feat/bun-1-4-pm-commands branch from d63e35e to 997c6a0 Compare August 20, 2026 15:09
@jong-kyung jong-kyung self-assigned this Aug 20, 2026
@jong-kyung
jong-kyung marked this pull request as ready for review August 20, 2026 15:09
@jong-kyung
jong-kyung requested a review from fengmk2 August 20, 2026 15:09
The fixture resolves the latest bun, and the bun 1.4.0 release changed
the build hash that bun pm trust prints alongside its redacted version,
so the recorded snapshot went stale on every CI run.
@jong-kyung

jong-kyung commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

@fengmk2 I temporarily fixed the CI failure caused by the changed bun build hash.
I think we should also mask bun's build hash in redact.rs so snapshots don't break whenever a new bun version is released. WDYT?

fengmk2 pushed a commit that referenced this pull request Aug 21, 2026
bun banners append the build's short commit hash after the version ("bun
pm trust v1.4.0 (34cbb9a40)"), and the hash changes with every bun
release. The version was already masked, but the hash was recorded
verbatim, so snapshots of fixtures that follow the latest bun broke
whenever bun shipped a release, as create_approve_builds_bun did when
bun 1.4.0 came out.

Ref: #2513 [CI
Failure](https://github.com/voidzero-dev/vite-plus/actions/runs/32384435197/job/96475848783)
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

I'll handle conflicts

@fengmk2 fengmk2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jong-kyung Nice!

@fengmk2
fengmk2 merged commit 044ac4c into voidzero-dev:main Aug 21, 2026
67 checks passed
@jong-kyung
jong-kyung deleted the feat/bun-1-4-pm-commands branch August 21, 2026 02:45
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.

Support Bun 1.4 pacakge manager commands

2 participants