fix: allow pnpm run -r to work with empty pnpm-workspace.yaml#10520
Merged
fix: allow pnpm run -r to work with empty pnpm-workspace.yaml#10520
run -r to work with empty pnpm-workspace.yaml#10520Conversation
Contributor
There was a problem hiding this comment.
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 -rwith an emptypnpm-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
approved these changes
Feb 6, 2026
zkochan
pushed a commit
that referenced
this pull request
Feb 6, 2026
zkochan
added a commit
that referenced
this pull request
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #10497
Fix
pnpm run -rfailing with "No projects matched the filters" when an emptypnpm-workspace.yamlexists.