You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: npm rule in rewrite registry misses install — filter already exists in npm_cmd.rs #1148
The npm rewrite rule in src/discover/rules.rs only matches run|exec:
pattern:r"^npm\s+(run|exec)",
This means npm install (and npm ci, npm list, npm outdated, etc.) are never rewritten by the hook, so they bypass RTK entirely.
The filter already handles it
src/cmds/js/npm_cmd.rs has full install support — filter_npm_output() strips progress bars and keeps the summary. The NPM_SUBCOMMANDS const lists 30+ subcommands including install, ci, list, outdated, audit, etc.
The rule just doesn't route them there.
Reproduction
$ rtk rewrite "npm install";echo"exit: $?"# exit: 1 (no match — falls through uncompressed)
Suggested fix
// rules.rs line 56
pattern:r"^npm\s+(run|exec|install|ci|list|ls|outdated|audit|test)",
Environment
rtk 0.35.0
macOS Apple Silicon
rtk discover shows 43 npm install calls with 0% savings
Adding usage data: rtk discover reports 14 npm install commands in the last 30 days that bypass rewrite. Since the npm filter already exists in npm_cmd.rs, this seems like a straightforward rewrite registry fix.
Closing as a duplicate of #3671, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.
Activity
pszymkowiak commentedon Apr 10, 2026
🔍 Automated Triage
buglowSummary
npm rewrite rule misses install/ci/test subcommands; well-scoped fix with 3 PRs already open — close in favor of existing PRs.
📁 Relevant files
src/discover/rules.rssrc/cmds/js/npm_cmd.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
fix(rules): expand npm rewrite pattern to include install, ci, list, …
fix(discover): expand npm rewrite rule to match install and other sub…
fix: expand npm rewrite rule to route install, ci, test, and other su…
etaseoul-jason commentedon Apr 13, 2026
Adding usage data:
rtk discoverreports 14npm installcommands in the last 30 days that bypass rewrite. Since the npm filter already exists innpm_cmd.rs, this seems like a straightforward rewrite registry fix.fix: expand npm rewrite rule to route install, ci, test, and other su…
fix: expand npm rewrite rule to route install, ci, test, and other su…
fix: expand npm rewrite rule to route install, ci, test, and other su…
KuSh commentedon Sep 5, 2026
Closing as a duplicate of #3671, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.
fix: expand npm rewrite rule to route install, ci, test, and other su…
fix: expand npm rewrite rule to route install, ci, test, and other su…