Skip to content

feat(pnpm): add rtk pnpm [run] <script> with smart filter routing#232

Open
denneulin wants to merge 1 commit intortk-ai:masterfrom
denneulin:feat/pnpm
Open

feat(pnpm): add rtk pnpm [run] <script> with smart filter routing#232
denneulin wants to merge 1 commit intortk-ai:masterfrom
denneulin:feat/pnpm

Conversation

@denneulin
Copy link

Summary

  • Add rtk pnpm run <script> and rtk pnpm <script> shorthand with smart routing to specialized filters
  • Strip pnpm boilerplate (lifecycle headers, script echo, "Done in Xs", ELIFECYCLE errors, progress bars)
  • Two-tier script routing: static name matching (test, lint, typecheck, vitest, prettier, format) +
    package.json auto-detection for custom scripts (e.g., test:e2e → detects playwright test
    PlaywrightParser)
  • Promote filter_tsc_output, filter_generic_lint, extract_test_summary to pub(crate) for cross-module
    reuse

Token Savings

Script Route Expected Savings
pnpm [run] test (vitest) VitestParser 90%+
pnpm [run] typecheck (tsc) filter_tsc_output 80%+
pnpm [run] lint (eslint) filter_generic_lint 80%+
pnpm [run] prettier --check filter_prettier_output 70%+
pnpm [run] test:e2e (playwright) PlaywrightParser 80%+
pnpm [run] build (unrouted) Boilerplate strip only 30-50%

How It Works

  • rtk pnpm run testPnpmCommands::Runrun_script("test") → boilerplate strip → TestRunner filter
  • rtk pnpm testPnpmCommands::Otheris_pnpm_script("test")run_script("test")
  • rtk pnpm test:e2e → reads package.json → detects playwright test → PlaywrightParser
  • rtk pnpm store pruneis_pnpm_script("store") = false → passthrough

Test plan

  • 25 new unit tests (boilerplate filtering, static routing, prefix matching, prefix exclusions,
    apply_filter labels, integration, is_pnpm_script)
  • 4 Clap parsing tests (basic, with args, colon script, shorthand falls to Other)
  • cargo fmt --all && cargo clippy --all-targets && cargo test --all — 437 tests pass
  • Manual test with real pnpm project: rtk pnpm run test, rtk pnpm test, rtk pnpm run lint

Route pnpm scripts to specialized filters (vitest, tsc, eslint, prettier,
playwright) via static name matching and package.json auto-detection.
Supports both `rtk pnpm run test` and `rtk pnpm test` shorthand.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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

Comments