rtk-ai / rtk-ai/rtk

feat(utils): add package_manager_filtered_exec() for pnpm workspace support

Open Beginner friendly
#515 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:cli effort-small enhancement good first issue help wanted priority:low
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.

Phase 3: src/utils.rs

Add package_manager_filtered_exec()
/// Build a Command using pnpm --filter <workspace> exec, or fallback to package_manager_exec.
/// When filter is present, always uses pnpm (workspace scoping only works through pnpm).
pub fn package_manager_filtered_exec(tool: &str, pnpm_filter: Option<&str>) -> Command {
    match pnpm_filter {
        Some(workspace) => {
            let mut c = Command::new("pnpm");
            c.arg("--filter").arg(workspace).arg("exec").arg("--").arg(tool);
            c
        }
        None => package_manager_exec(tool),
    }
}

Note on exec vs run: pnpm --filter web exec -- prettier runs the binary from node_modules/.bin. Correct for binaries (prettier, tsc, vitest, playwright, eslint, biome). For script-based commands, lint_cmd already resolves the binary name internally via detect_linter() before calling this function.

When pnpm_filter is None, falls back to existing package_manager_exec() — zero behavior change for non-workspace users.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/utils.rs by reading package_manager_exec and the surrounding command-building helpers. Add the requested workspace-aware utility while preserving the existing fallback behavior, then verify that filtered and non-filtered inputs construct the expected commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, tooling
Issue type
Feature
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.