Skip to content

fix: allow pnpm run -r to work with empty pnpm-workspace.yaml#10520

Merged
zkochan merged 3 commits intomainfrom
issue-10497/empty-workspace-run-fix
Feb 6, 2026
Merged

fix: allow pnpm run -r to work with empty pnpm-workspace.yaml#10520
zkochan merged 3 commits intomainfrom
issue-10497/empty-workspace-run-fix

Conversation

@ryo-manba
Copy link
Copy Markdown
Member

close #10497

Fix pnpm run -r failing with "No projects matched the filters" when an empty pnpm-workspace.yaml exists.

@ryo-manba ryo-manba marked this pull request as ready for review January 26, 2026 15:35
@ryo-manba ryo-manba requested a review from zkochan as a code owner January 26, 2026 15:35
Copilot AI review requested due to automatic review settings January 26, 2026 15:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes pnpm run -r incorrectly failing with “No projects matched the filters” when a pnpm-workspace.yaml exists but is empty (or otherwise provides no workspace package patterns), ensuring recursive script execution works for non-monorepo projects.

Changes:

  • Add a regression test covering pnpm run -r with an empty pnpm-workspace.yaml.
  • Adjust recursive filter initialization to only auto-exclude the workspace root when workspace package patterns are actually configured.
  • Add a changeset documenting the patch fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pnpm/test/monorepo/index.ts Adds regression test verifying pnpm run -r succeeds when pnpm-workspace.yaml is empty.
pnpm/src/main.ts Prevents default root-exclusion behavior for recursive commands when no workspace package patterns are set, avoiding empty selection in non-monorepos.
.changeset/fifty-mangos-arrive.md Records the user-facing patch note for the fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zkochan zkochan merged commit 4f7cbaa into main Feb 6, 2026
6 checks passed
@zkochan zkochan deleted the issue-10497/empty-workspace-run-fix branch February 6, 2026 16:13
zkochan added a commit that referenced this pull request Feb 9, 2026
zkochan added a commit that referenced this pull request Feb 9, 2026
#10578)

* revert: "fix: allow pnpm `run -r` to work with empty pnpm-workspace.yaml (#10520)"

This reverts commit f1cb40c.

* revert: "test: fix"

This reverts commit 1dbbffb.

* docs: add changeset

close #10571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Having empty pnpm-workspace.yaml breaks pnpm run -r

3 participants