feat: add Bun runtime support (bun test, bun run, bunx) #832
Copy link
Copy link
Closed
Labels
area:clieffort-largePlusieurs jours, nouveau modulePlusieurs jours, nouveau moduleeffort-medium1-2 jours, quelques fichiers1-2 jours, quelques fichiersenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededpriority:medium
Description
Context
Bun is a fast JavaScript runtime used as the default in many modern projects. RTK has no support for it — no Rust module, no TOML filter, no rewrite rule.
RTK already supports Node.js ecosystem tools (npm, pnpm, vitest, tsc, eslint, prettier, next, playwright, prisma) but the Bun equivalents are missing.
Scope
| Command | Description | Expected savings |
|---|---|---|
rtk bun test |
Bun's built-in test runner (similar to vitest) | 85-90% |
rtk bun run <script> |
Script runner (similar to npm run) | 70-80% |
rtk bun install |
Package install (similar to pnpm install) | 80-90% |
rtk bunx <pkg> |
Package executor (similar to npx) | 70-80% |
rtk bun build |
Bundler output | 75-85% |
Rewrite rules
The hook should rewrite:
bun test→rtk bun testbun run <script>→rtk bun run <script>bun install→rtk bun installbunx <pkg>→rtk bunx <pkg>bun build→rtk bun build
Implementation
Options:
- Rust module (
src/bun_cmd.rs) with sub-enum — best forbun test(structured output parsing) - TOML filters for simpler commands (
bun install,bun build) - Hybrid — Rust for test, TOML for the rest
References
- Vitest module (similar test runner):
src/vitest_cmd.rs - pnpm module (similar package manager):
src/pnpm_cmd.rs - npm module:
src/npm_cmd.rs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:clieffort-largePlusieurs jours, nouveau modulePlusieurs jours, nouveau moduleeffort-medium1-2 jours, quelques fichiers1-2 jours, quelques fichiersenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededpriority:medium
Activity
harmeshgv commentedon Mar 25, 2026
Hi @pszymkowiak, I’d like to work on this feature. I have experience working with Node.js tooling and some familiarity with Bun as well. I can implement the Bun command support, including rewrite rules and required modules. Let me know if I can take this up.
pszymkowiak commentedon Mar 26, 2026
🔍 Automated Triage
featuremediumSummary
Feature request to add Bun runtime support (bun test/run/install/build, bunx); partially addressed by PR #1128 — monitor PR progress before merging or closing.
📁 Relevant files
src/bun_cmd.rssrc/vitest_cmd.rssrc/pnpm_cmd.rssrc/npm_cmd.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
XtheWiz commentedon Apr 19, 2026
Production validation from a Bun + Elysia.js monorepo
Adding real numbers to validate demand. From
rtk discover(30-day scan, 13,730 Bash calls):bun testbun test 2>&1Our
bun testoutput is identical in structure to vitest — TAP-style pass/fail lines with a summary footer. Thertk vitestfiltering logic should port directly.What we'd want
rtk bun testrtk jest/rtk vitest): suppress passing test lines, keep errors + stack tracesN tests passed, M failed, K skippedRewrite rule needed
Hook should rewrite
bun test→rtk bun test(currently falls through as unhandled).Stack context
Bun 1.2.19 + Elysia.js + Prisma monorepo. We run
bun testfor API integration tests every session. Currently 100% of that output lands unfiltered in context.HenriqueSchroeder commentedon Apr 22, 2026
#1374
KuSh commentedon Sep 5, 2026
Bun support landed in #988 and is on develop.
rtk bun test,rtk bun run,rtk bun install,rtk bun buildandrtk bunxall exist, and the hook rewrites the corresponding raw commands. Verified against a realbun testrun: only failures plus the summary are kept, passing lines are dropped. Please reopen or comment if you still see unfiltered Bun output on the latest version.