Implement pnpm workspace filter#250
Conversation
APP-3496 [pnpm] Support pnpm shell plugin completions
pnpm project-specific completions from shell plugins (e.g. See GitHub #3435 |
- Add workspace_packages_generator() that runs 'pnpm list -r --depth -1 --json' to dynamically suggest workspace package names for the --filter/-F flag - Add -F as a short alias for --filter across all pnpm subcommands - Wire up the workspace_packages_generator to all --filter/-F args in pnpm.json - Add unit tests for the workspace packages generator (normal, empty, invalid JSON) Co-Authored-By: Oz <oz-agent@warp.dev>
316f4f7 to
c2364d3
Compare
- Switch workspace_packages_generator from 'pnpm list' to filesystem-based approach that reads pnpm-workspace.yaml and package.json files directly. This avoids issues with corepack shims prompting for download confirmation in non-interactive generator subprocesses. - Remove 'template: filepaths' from --filter args since it prevents the generator from running in the completion engine. - Add --filter/-F as a top-level option on the pnpm command so it works when typed before a subcommand (pnpm --filter pkg run build). - Update tests to match the new text-based output format. Co-Authored-By: Oz <oz-agent@warp.dev>
|
temp |
Generator Screenshot VerificationAll generators were verified end-to-end in a local Warp build against a test pnpm workspace with scoped packages ( Fixes applied
Test results
All 54 unit tests pass, including 3 updated tests for the workspace packages generator that verify |
Summary
Addresses APP-3496 — adds workspace package name completions for pnpm's
--filter/-Foption, inspired by the pnpm-shell-completion plugin.Changes
Rust generator (
command-signatures/src/generators/npm.rs):PnpmWorkspacePackagestruct for deserializingpnpm list -r --depth -1 --jsonoutputworkspace_packages_generator()that dynamically suggests workspace package names with version infopnpm_generators()Completion spec (
command-signatures/json/pnpm.json):-Fas a short alias for--filteracross all 21 subcommand occurrencesworkspace_packages_generatorinto all--filter/-Fargs alongside the existingfilepathstemplateGenerator Screenshots
pnpm run <Tab>— scripts completions (shows scripts from package.json with descriptions):pnpm remove <Tab>— dependency completions (shows installed dependencies):pnpm --filter <Tab>— filter completions (shows filepaths + workspace packages when pnpm is available):Testing
Conversation: https://staging.warp.dev/conversation/4dc6c6b7-a480-4ec5-bfc3-a475248de4a6
Run: https://oz.staging.warp.dev/runs/019d689a-b684-7658-9363-ff95ac53972d
This PR was generated with Oz.