rtk-ai/rtk

feat: add Bun runtime support (bun test, bun run, bunx)

Open

#832 创建于 2026年3月25日

在 GitHub 查看
 (4 评论) (12 反应) (0 负责人)Rust (2,914 fork)batch import
area:clieffort-largeeffort-mediumenhancementhelp wantedpriority:medium

仓库指标

Star
 (48,085 star)
PR 合并指标
 (平均合并 11天 1小时) (30 天内合并 45 个 PR)

描述

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 testrtk bun test
  • bun run <script>rtk bun run <script>
  • bun installrtk bun install
  • bunx <pkg>rtk bunx <pkg>
  • bun buildrtk bun build

Implementation

Options:

  1. Rust module (src/bun_cmd.rs) with sub-enum — best for bun test (structured output parsing)
  2. TOML filters for simpler commands (bun install, bun build)
  3. 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

贡献者指南