feat(bun,deno): add Bun and Deno runtime support#988
Open
geofflittle wants to merge 4 commits intortk-ai:developfrom
Open
feat(bun,deno): add Bun and Deno runtime support#988geofflittle wants to merge 4 commits intortk-ai:developfrom
geofflittle wants to merge 4 commits intortk-ai:developfrom
Conversation
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]>
Signed-off-by: bZ00qa <[email protected]> Co-Authored-By: Claude Opus 4.6 <[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]>
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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)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 removewas silently runningbun install(hardcoded subcommand)deno runwas runningdeno task(wrong subcommand)deno installwas dropping theinstallsubcommand entirelybun pm <non-ls>was dropping thepmprefixConvention alignment:
resolved_command()for PATH resolution (wasCommand::new())Result<i32>return type (wasResult<()>+process::exit())run_passthrough()for streaming passthrough commands//!)run_filtered_subcmd()Test plan
cargo fmt --allcleancargo clippy --all-targets— 0 new warningscargo test --all— 1353 tests pass (6 new)filter_bun_installandfilter_deno_output🤖 Generated with Claude Code