Skip to content

feat(yarn): add yarn command with intelligent script routing#586

Open
skategui wants to merge 2 commits intortk-ai:developfrom
skategui:feat(yarn)/add-yarn-command-with-script-routing
Open

feat(yarn): add yarn command with intelligent script routing#586
skategui wants to merge 2 commits intortk-ai:developfrom
skategui:feat(yarn)/add-yarn-command-with-script-routing

Conversation

@skategui
Copy link

Summary

  • Add rtk yarn command with intelligent script routing to specialized filters (test, build, lint, typecheck)
  • Yarn boilerplate stripping (lifecycle scripts, warnings, "Done in" lines) for 60-90% token savings
  • Known scripts delegate to optimized filters; unknown scripts use generic boilerplate stripping

Changes

  • src/yarn_cmd.rs: New command module with script routing and filters
  • src/tsc_cmd.rs: Made filter_tsc_output public for reuse by yarn typecheck route
  • src/main.rs: Register Yarn variant in Commands enum
  • README.md: Added yarn examples and rewrite table entry
  • CHANGELOG.md: Added yarn feature entry

Tracking attribution

yarn typecheck now routes through run_via_yarn_with_filter (like test/build/lint) instead of delegating to tsc_cmd::run(), so rtk gain --history correctly shows "yarn typecheck" instead of "tsc".

Test plan

  • Unit tests for boilerplate stripping, test/build/lint filters
  • Token savings tests (>=60% verified for test and build outputs)
  • cargo fmt --all --check && cargo clippy --all-targets && cargo test passes
  • Edge cases: empty output, yarn run prefix stripping, jest vs vitest detection

Add `rtk yarn` command that routes known scripts (test, build, lint, typecheck)
to specialized filters and strips yarn boilerplate for generic scripts.
- Route yarn typecheck through run_via_yarn_with_filter instead of
  delegating to tsc_cmd::run(), so rtk gain --history shows
  "yarn typecheck" instead of "tsc"
- Add yarn command to README.md (examples + rewrite table)
- Add yarn entry to CHANGELOG.md

Signed-off-by: guillaume agis <guillaume.agis@gmail.com>
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.

1 participant