feat(js): add Bun runtime support (bun test, run, bunx)#1374
Open
HenriqueSchroeder wants to merge 3 commits intortk-ai:developfrom
Open
feat(js): add Bun runtime support (bun test, run, bunx)#1374HenriqueSchroeder wants to merge 3 commits intortk-ai:developfrom
HenriqueSchroeder wants to merge 3 commits intortk-ai:developfrom
Conversation
Collaborator
📊 Automated PR Analysis
SummaryAdds comprehensive Bun runtime support to RTK, including filters for bun test, bun install, bun build, bun run, and bunx commands. Implements intelligent routing for bunx to specialized filters (tsc, eslint, prisma) and includes snapshot tests, token savings assertions, and clap routing tests. Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bun prints (pass)/(fail) when stdout is piped (RTK's case) but the initial filter only matched TTY ✓/✗ markers. Rewrote filter_bun_test to: - handle both TTY and piped formats - buffer lines preceding a fail marker (Bun emits error context before the marker) and flush them on match - skip the trailing "N tests failed:" summary (duplicates already captured failures) Replaced synthetic fixtures with real bun test output and added bun_test_real.txt to guard the >=60% token savings target under real-world conditions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
607535b to
18e6b1e
Compare
- README.md: added rtk bun test (Test Runners), rtk bun build + rtk bunx (Build & Lint), rtk bun install + rtk bun run (Package Managers) - docs/guide/what-rtk-covers.md: added bun test/install/build/run/bunx rows to the JavaScript / TypeScript table Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Adds Bun runtime support to RTK with filters for
bun test,bun run,bun install,bun build, andbunx.What's new
bun testfilter: strips passing tests, keeps failures with error context, compact summary. Handles both TTY (✓/✗) and piped ((pass)/(fail)) formats. Buffers lines preceding a fail marker since Bun prints error context before the marker, then flushes them on match.bun installfilter: strips progress bars, keeps summary.bun buildfilter: compact build output.bun run <script>filter: passes through script output with error-focused filtering.bunxpassthrough with intelligent routing (tsc, eslint, prisma → specialized filters).bunx tsc,bunx eslint, etc. get rewritten to specialized RTK filters.Token savings
All filters verified
>= 60%savings against realbun testoutput (seetests/fixtures/bun_test_real.txt, 140 lines of real bun output with 79 pass / 2 fail).Tests
bun_test_real.txt)bun test/run/install/buildsubcommands andbunxTest plan
cargo test— 1372 tests pass locallycargo clippy --all-targets— no new warnings inbun_cmd.rscargo fmt --all --check— cleanrtk bun testin a Bun project verifies end-to-end filteringNotes
Branch is based on an older point in history (pre-0.37.0). Merge conflicts with current
develop(notablysrc/discover/rules.rswhere Bun entries need to be combined with the expandednpx/pnpm execpatterns, andsrc/main.rsPrismaCommands derive) are expected and will need resolution before merge.🤖 Generated with Claude Code