Skip to content

feat(bun,deno): add Bun and Deno runtime support#988

Open
geofflittle wants to merge 4 commits intortk-ai:developfrom
geofflittle:feat/bun-deno-support
Open

feat(bun,deno): add Bun and Deno runtime support#988
geofflittle wants to merge 4 commits intortk-ai:developfrom
geofflittle:feat/bun-deno-support

Conversation

@geofflittle
Copy link
Copy Markdown

Summary

  • Add token-optimized filtering for Bun and Deno CLI commands
  • Bun: install, add, remove (strip progress bars, ~80%), test (failures only, ~90%), build (errors only), run (passthrough), pm ls (JSON compact tree), bunx (smart routing to tsc/eslint filters)
  • Deno: test (failures only, ~90%), lint/check (strip download lines + tee recovery), run/task/install/compile (passthrough)

Based on #548 by @bz00qa — rebased onto develop, fixed routing bugs, and aligned with project conventions.

Changes from original PR

Critical bug fixes:

  • bun remove was silently running bun install (hardcoded subcommand)
  • deno run was running deno task (wrong subcommand)
  • deno install was dropping the install subcommand entirely
  • bun pm <non-ls> was dropping the pm prefix

Convention alignment:

  • resolved_command() for PATH resolution (was Command::new())
  • Result<i32> return type (was Result<()> + process::exit())
  • run_passthrough() for streaming passthrough commands
  • ANSI stripping before filtering
  • stderr/stdout separation
  • Package name validation (parity with pnpm_cmd)
  • Module doc comments (//!)
  • Deduplicated deno lint/check into shared run_filtered_subcmd()
  • Tee recovery on all filtered deno subcommands

Test plan

  • cargo fmt --all clean
  • cargo clippy --all-targets — 0 new warnings
  • cargo test --all — 1353 tests pass (6 new)
  • Token savings ≥60% verified for both filter_bun_install and filter_deno_output
  • ANSI stripping tests
  • Package name validation tests
  • Manual test with bun/deno installed

🤖 Generated with Claude Code

bz00qa and others added 4 commits April 3, 2026 01:05
Add token-optimized filtering for Bun and Deno CLI commands:

**Bun commands:**
- `rtk bun install/add/remove` — strip progress bars, version headers (80% reduction)
- `rtk bun test` — failures only via runner (90% reduction)
- `rtk bun build` — errors only via runner
- `rtk bun run` — passthrough (script output unpredictable)
- `rtk bun pm ls` — JSON parsing with sorted compact tree
- `rtk bunx <tool>` — smart routing: tsc→tsc filter, eslint→lint filter, else→error filter

**Deno commands:**
- `rtk deno test` — failures only via runner (90% reduction)
- `rtk deno lint` — strip download lines, tee recovery on failure
- `rtk deno check` — strip download lines, tee recovery on failure
- `rtk deno run/task` — passthrough with download line stripping
- `rtk deno compile` — errors only via runner
- `rtk deno install` — passthrough

**Hook rewriting:**
- Added bun/bunx/deno patterns to discover registry
- Commands auto-rewritten by `rtk rewrite` hook

**Testing:**
- 11 unit tests covering filter logic, JSON parsing, edge cases
- All existing tests pass (898 total)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: bz00qa <[email protected]>
Remove src/bun_cmd.rs and src/deno_cmd.rs (stale copies from pre-restructure
layout — code lives in src/cmds/js/). Fix Bun/Bunx/Deno match arms to return
i32 exit codes consistent with develop's routing pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Critical routing fixes:
- bun remove now correctly runs `bun remove` (was running `bun install`)
- deno run now correctly passes through (was running `deno task`)
- deno install now includes `install` subcommand (was dropped)
- bun pm <non-ls> now preserves `pm` prefix (was dropped)

Convention alignment:
- Use resolved_command() instead of Command::new() for PATH resolution
- Return Result<i32> instead of Result<()> + process::exit() (modules
  never call process::exit directly per CONTRIBUTING.md)
- Use run_passthrough() from core::runner for streaming passthrough
  commands (bun run, deno run/task/install)
- Strip ANSI codes before filtering (bun emits colored progress bars)
- Separate stderr from stdout (filter stdout, eprint stderr)
- Add package name validation in run_pkg (parity with pnpm_cmd)
- Add //! module doc comments
- Deduplicate deno lint/check into shared run_filtered_subcmd()
- Add tee_and_hint to all filtered deno subcommands

Testing:
- Add token savings tests (>=60% verified for both filters)
- Add ANSI stripping tests
- Add bun remove output test
- Add package name validation tests

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@aeppling aeppling added the enhancement New feature or request label Apr 3, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 4, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ bz00qa
❌ geofflittle
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants