feat(yarn): add yarn command support with smart delegation#867
feat(yarn): add yarn command support with smart delegation#867jzambrano12 wants to merge 3 commits intortk-ai:developfrom
Conversation
|
Hey We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes No logic changes — only file moves and import path updates. What you need to doRebase your branch on git fetch origin && git rebase origin/developGit 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 |
…ized filters Add yarn_cmd.rs module following npm_cmd flat-args pattern with run injection logic and YARN_SUBCOMMANDS list. Smart routing delegates vitest, tsc, eslint, biome, next, prettier, and playwright to existing specialized filters for maximum token savings. Generic filter strips Classic v1 and Berry boilerplate. Includes install-specific filter and discover rules with yarn prefixes on 7 existing tool patterns.
25 new tests: unit tests for edge cases (errors, ANSI, unicode, Berry format, malformed input), registry rewrite/classify tests for yarn commands and tool delegation, token savings assertions, and smoke tests in test-all.sh. Total yarn coverage: 35 tests.
afa8ede to
e84e5e9
Compare
Done! |
Summary
yarn_cmd.rsmodule following thenpm_cmd.rsflat-args pattern withruninjection logic andYARN_SUBCOMMANDSlist (35 known subcommands)vitest,tsc,eslint,biome,next,prettier,playwright) and delegate to existing specialized RTK filters for maximum savings (up to 99%)yarn run vX.Y.Z,$ cmd,Done in Xs) and Berry v2+ info lines (YN0000:)[1/4]...), info/warning lines (75% reduction)Yarnvariant inCommandsenum, routing, and operational command list inmain.rsyarn\s+prefix to 7 existing tool patterns (tsc, lint, prettier, next, vitest, playwright, prisma) soyarn tsc,yarn vitest, etc. are recognized by discoverMotivation
rtk discoveron a real project (615 sessions, 30 days) shows 126+ unhandled yarn commands:Token Savings
yarn vitestvitest_cmdyarn buildnext_cmdor generic filteryarn lintlint_cmdyarn tsctsc_cmdyarn installyarn checkTest Plan
cargo test yarn→ 35 passed)cargo fmt --all --check && cargo clippy --all-targets && cargo testpassesFiles Changed
src/yarn_cmd.rssrc/main.rssrc/discover/rules.rssrc/discover/registry.rsscripts/test-all.shCHANGELOG.mdREADME.md