feat(tool-modules): propagate pnpm_filter to all affected run() functions
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 81.1k
- Forks
- 5.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 35
Description
Part of #512 — pnpm workspace filter support. Depends on #515 (utils).
Phase 4: Tool module signature updates
Each module gets pnpm_filter: Option<&str> added to its run() signature. The change is mechanical: replace command construction with filtered variant.
src/prettier_cmd.rs
pub fn run(args: &[String], verbose: u8, pnpm_filter: Option<&str>) -> Result<()> {
let mut cmd = package_manager_filtered_exec("prettier", pnpm_filter);
// ...
}
src/format_cmd.rs
pub fn run(args: &[String], verbose: u8, pnpm_filter: Option<&str>) -> Result<()> {
let mut cmd = match formatter.as_str() {
"prettier" => package_manager_filtered_exec("prettier", pnpm_filter),
"biome" => package_manager_filtered_exec("biome", pnpm_filter),
// ...
};
}
src/vitest_cmd.rs
pub fn run(cmd: VitestCommand, args: &[String], verbose: u8, pnpm_filter: Option<&str>) -> Result<()> {
match cmd {
VitestCommand::Run => run_vitest(args, verbose, pnpm_filter),
}
}
fn run_vitest(args: &[String], verbose: u8, pnpm_filter: Option<&str>) -> Result<()> {
let mut cmd = package_manager_filtered_exec("vitest", pnpm_filter);
// ...
}
src/lint_cmd.rs
pub fn run(args: &[String], verbose: u8, pnpm_filter: Option<&str>) -> Result<()> {
let mut cmd = if is_python_linter(linter) {
Command::new(linter)
} else {
package_manager_filtered_exec(linter, pnpm_filter)
};
// ...
}
src/tsc_cmd.rs
Custom logic (doesn't use package_manager_exec):
pub fn run(args: &[String], verbose: u8, pnpm_filter: Option<&str>) -> Result<()> {
let mut cmd = if let Some(workspace) = pnpm_filter {
let mut c = Command::new("pnpm");
c.arg("--filter").arg(workspace).arg("exec").arg("--").arg("tsc");
c
} else {
// existing which tsc / npx tsc fallback logic
};
// ...
}
src/playwright_cmd.rs
Custom logic (doesn't use package_manager_exec):
pub fn run(args: &[String], verbose: u8, pnpm_filter: Option<&str>) -> Result<()> {
let mut cmd = if let Some(workspace) = pnpm_filter {
let mut c = std::process::Command::new("pnpm");
c.arg("--filter").arg(workspace).arg("exec").arg("--").arg("playwright");
c
} else {
// existing detect_package_manager() logic
};
// ...
}
src/pnpm_cmd.rs
4 Command::new("pnpm") sites — inject --filter workspace before subcommand args:
pub fn run(cmd: PnpmCommand, args: &[String], verbose: u8, pnpm_filter: Option<&str>) -> Result<()>
pub fn run_passthrough(args: &[OsString], verbose: u8, pnpm_filter: Option<&str>) -> Result<()>
For run_list, run_outdated, run_install:
let mut cmd = Command::new("pnpm");
if let Some(workspace) = pnpm_filter {
cmd.arg("--filter").arg(workspace);
}
cmd.arg("list"); // or "outdated" / "install"
For run_passthrough:
let mut cmd = Command::new("pnpm");
if let Some(workspace) = pnpm_filter {
cmd.arg("--filter").arg(workspace);
}
cmd.args(args);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing run signatures and command construction in src/prettier_cmd.rs, src/format_cmd.rs, src/vitest_cmd.rs, src/lint_cmd.rs, src/tsc_cmd.rs, src/playwright_cmd.rs, and src/pnpm_cmd.rs. Trace their callers before updating signatures. Done means each listed command propagates the optional workspace filter while retaining the existing unfiltered behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100