Skip to content

Add pnpm nx command patterns for Nx monorepos #444

@mkbctrl

Description

@mkbctrl

Problem

pnpm nx * commands are not covered by RTK's rewrite/compression patterns, causing them to pass through uncompressed. In our monorepo (Nx-managed, 20+ projects), we observed 313 pnpm nx * passthrough invocations in a single audit window — making this the largest single category of uncompressed output.

Related Issues

These all point to the same gap: pnpm as a command prefix is not systematically handled.

High-Impact Patterns

Command Frequency Notes
pnpm nx run <project>:<target> ~180 Build, typecheck, lint, test
pnpm nx show project <name> ~60 Project details (large JSON output)
pnpm nx graph ~30 Dependency graph
pnpm nx affected ~25 CI/change detection
pnpm nx run-many ~18 Batch operations

Suggested Approach

Add pnpm nx as a recognized command prefix in the rewrite rules, delegating to existing patterns where the underlying command is already supported (e.g., pnpm nx run -> build output compression).

Environment

  • RTK v0.27.2
  • pnpm v9.x
  • Nx 20.x monorepo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions