fix: prevent implicit root exclusion when user filters are provided#10465
fix: prevent implicit root exclusion when user filters are provided#10465
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where pnpm would implicitly exclude the root package when pnpm-workspace.yaml is present, even when users explicitly provided filters that should match the root (like --filter . or --filter root-pkg).
Changes:
- Modified the implicit root exclusion logic to only apply when no user filters are provided
- Added comprehensive test coverage for both
--filter <root>and--filter .scenarios - Added a changeset documenting this as a major change
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pnpm/src/main.ts | Updated the condition for implicit root exclusion to check if filters array is empty |
| pnpm/test/recursive/filter.ts | Added two test cases verifying that explicit filters on root package work correctly |
| .changeset/stupid-wasps-turn.md | Added changeset documenting the breaking change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pnpm/test/recursive/filter.ts
Outdated
| }, | ||
| }) | ||
|
|
||
| execPnpmSync(['init']) |
There was a problem hiding this comment.
The execPnpmSync(['init']) call appears redundant since the prepare() function already creates a package.json with the specified configuration. This extra init step may be unnecessary and could be removed to simplify the test.
There was a problem hiding this comment.
Yeah, i see you already pushed a commit for this Thanks
pnpm/test/recursive/filter.ts
Outdated
| version: '1.0.0', | ||
| }) | ||
|
|
||
| execPnpmSync(['init']) |
There was a problem hiding this comment.
The execPnpmSync(['init']) call appears redundant since the prepare() function already creates a package.json with the specified configuration. This extra init step may be unnecessary and could be removed to simplify the test.
|
@zkochan Seems like one test deployment failed. It might not be related to this change and can be a flaky test but if not, please let me know, happy to dig deeper |
…10465) * fix: prevent implicit root exclusion when user filters are provided * docs: add changeset * test: remove redundant init --------- Co-authored-by: tensorworker <tensorworker@proton.me> Co-authored-by: Zoltan Kochan <z@kochan.io>
Previously,
pnpmwould implicitly exclude the root package ifpnpm-workspace.yamlwas present, even if the user explicitly provided filters that should have matched the root (e.g.--filter .or--filter root-pkg).This change ensures that the implicit exclusion is only applied when NO user filters are provided.
fixes issue: #10462
Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=178221229