Skip to content

feat: add Bun and Deno runtime support#548

Open
bz00qa wants to merge 2 commits intortk-ai:developfrom
bz00qa:feat/bun-deno-support
Open

feat: add Bun and Deno runtime support#548
bz00qa wants to merge 2 commits intortk-ai:developfrom
bz00qa:feat/bun-deno-support

Conversation

@bz00qa
Copy link
Copy Markdown

@bz00qa bz00qa commented Mar 12, 2026

Summary

Add token-optimized filtering for Bun and Deno CLI commands, extending RTK's JavaScript/TypeScript runtime coverage.

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 dependency tree
  • rtk bunx <tool> — smart routing: tsc → tsc filter, eslint → lint filter, others → error filter

Deno commands

  • rtk deno test — failures only via runner (~90% reduction)
  • rtk deno lint/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 integration

  • Added bun, bunx, deno patterns to discover registry (PATTERNS + RULES)
  • Commands auto-rewritten by rtk rewrite hook
  • Added to is_operational_command security whitelist

Files changed

  • New: src/bun_cmd.rs (261 lines), src/deno_cmd.rs (254 lines)
  • Modified: src/main.rs (mod declarations, Commands enum, subcommand enums, dispatch logic)
  • Modified: src/discover/rules.rs (3 patterns + 3 rules)

Test plan

  • 7 bun_cmd unit tests (install filtering, JSON parsing, text truncation, error preservation)
  • 4 deno_cmd unit tests (download stripping, empty output, error preservation)
  • All 898 existing tests pass (1 pre-existing binlog CRLF failure on Windows unrelated)
  • cargo clippy — no new warnings
  • cargo fmt — clean

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Signed-off-by: bz00qa <bz00qa.hub@gmail.com>
@bz00qa bz00qa force-pushed the feat/bun-deno-support branch from 31443bf to 3100a8f Compare March 13, 2026 16:30
@bz00qa bz00qa changed the base branch from master to develop March 13, 2026 16:30
bz00qa added a commit to bz00qa/rtk_fork that referenced this pull request Mar 13, 2026
…docs and tests

Remove scope creep from PR rtk-ai#550:
- Restore rules.rs/registry.rs to develop baseline, keep only in-scope changes
- Remove strip_verbose_flags(), proxy -f routing, expanded subcommands
- Remove bun/deno/bunx from COMMAND_REGISTRY (unmerged PR rtk-ai#548)
- Remove context/watch/dedup from COMMAND_REGISTRY (non-existent PR rtk-ai#553)
- Remove detect_patterns() and normalize_cmd_base() (deferred)
- Remove PatternOpportunity from report

Add missing tests: consumer_base(), effective_idx
Add docs: CHANGELOG.md, README.md gain section, ARCHITECTURE.md discover module
Fix clippy warnings in new test code (vec![] → array, single_match)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: bZ00qa <167500396+bz00qa@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@engels74
Copy link
Copy Markdown

Besides the Deno support, isn't the bun integration a duplicate of #453?

@Ffinnis
Copy link
Copy Markdown

Ffinnis commented Mar 19, 2026

Besides the Deno support, isn't the bun integration a duplicate of #453?

I think we can stay with this variant

@Ffinnis Ffinnis mentioned this pull request Mar 19, 2026
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@aeppling
Copy link
Copy Markdown
Contributor

Hey

We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes src/ from a flat layout into subfolders.

No logic changes — only file moves and import path updates.

What you need to do

Rebase your branch on develop when receiving this comment:

git fetch origin && git rebase origin/develop

Git detects renames automatically. If you get import conflicts, update the paths:

use crate::git;        // now: use crate::cmds::git::git;
use crate::tracking;   // now: use crate::core::tracking;
use crate::config;     // now: use crate::core::config;
use crate::init;       // now: use crate::hooks::init;
use crate::gain;       // now: use crate::analytics::gain;

Need help rebasing? Tag @aeppling

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.

6 participants