fix: handle pnpm --filter/-F flag (#259)#520
Open
ousamabenyounes wants to merge 1 commit intortk-ai:developfrom
Open
fix: handle pnpm --filter/-F flag (#259)#520ousamabenyounes wants to merge 1 commit intortk-ai:developfrom
ousamabenyounes wants to merge 1 commit intortk-ai:developfrom
Conversation
pnpm's --filter is a global flag that precedes the subcommand (e.g. `pnpm --filter mymod test`). Clap's subcommand enum cannot handle flags before the subcommand name, causing "unexpected argument '--filter' found". Fix: intercept --filter/--filter=/-F in raw args before Cli::try_parse() and route directly to pnpm passthrough. Also bumps version strings to 0.28.2 for CI validate-docs. Fixes rtk-ai#259 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Hi! Thanks for the contribution! Since March 6, all PRs should target the Could you update the base branch? Click Edit at the top right of this PR and change it from Thanks! |
Author
|
Done sorry! :) |
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
Fixes #259 —
rtk pnpm --filter mymodule testfails with "unexpected argument '--filter' found".Root cause: pnpm's
--filteris a global flag that precedes the subcommand (pnpm --filter <pkg> <cmd>). Clap'sPnpmCommandssubcommand enum expects a subcommand name first, so--filteris rejected as an unknown flag.Fix: Intercept
--filter/--filter=/-Fin raw args beforeCli::try_parse()and route directly topnpm_cmd::run_passthrough().Before/After
Impact
In pnpm monorepos (very common in modern JS/TS), almost every command uses
--filter. Without this fix, every pnpm command in a monorepo bypasses RTK filtering = 0% savings instead of 70-90%.Test plan
test_pnpm_filter_detected— verifies detection logic for all 3 variants--filter,--filter=,-Fall pass through to pnpmcargo fmt && cargo clippy && cargo testall greenvalidate-docs.shpassesGenerated with Claude Code