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 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