Skip to content

fix: restore default workspace package patterns when packages field is missing#10927

Merged
zkochan merged 3 commits intov10from
fix/10909
Mar 11, 2026
Merged

fix: restore default workspace package patterns when packages field is missing#10927
zkochan merged 3 commits intov10from
fix/10909

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented Mar 10, 2026

Summary

Test plan

  • Existing @pnpm/config unit test for workspacePackagePatterns passes
  • Updated recursive command with filter from config test to include explicit packages field
  • Verify with cdxgen repo: pnpm install should work without discovering test data directories as workspace projects

close #10909

🤖 Generated with Claude Code

zkochan and others added 2 commits March 11, 2026 00:45
… field is missing

Commit 6eedf82 removed the ['.'] fallback for workspacePackagePatterns
when pnpm-workspace.yaml has no packages field. This caused findPackages
to default to ['.', '**'], discovering ALL directories with package.json
as workspace projects. This is the same regression that was previously
reverted in 595cd41 (close #10571), reintroduced by #10127.

Projects like cdxgen that use pnpm-workspace.yaml only for settings
(e.g. minimumReleaseAge) without a packages field were broken because
test data directories were picked up as workspace projects.

close #10909

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zkochan zkochan requested a review from weyert as a code owner March 10, 2026 23:47
Copilot AI review requested due to automatic review settings March 10, 2026 23:47
@zkochan zkochan requested a review from gluxon as a code owner March 10, 2026 23:47
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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@zkochan zkochan changed the base branch from main to v10 March 10, 2026 23:47
…ut packages field

Adds a regression test to ensure pnpm-workspace.yaml without a packages
field defaults workspacePackagePatterns to ['.'] (root only), preventing
all directories from being discovered as workspace projects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zkochan zkochan merged commit 5163697 into v10 Mar 11, 2026
8 of 13 checks passed
@zkochan zkochan deleted the fix/10909 branch March 11, 2026 00:44
@dasa
Copy link
Copy Markdown
Contributor

dasa commented Mar 11, 2026

Is this change needed here on main too?

pnpmConfig.workspacePackagePatterns = cliOptions['workspace-packages'] as string[] ?? workspaceManifest?.packages

dasa pushed a commit to dasa/pnpm that referenced this pull request Mar 17, 2026
…s missing (pnpm#10927)

* fix: restore ['.'] default for workspacePackagePatterns when packages field is missing

Commit 6eedf82 removed the ['.'] fallback for workspacePackagePatterns
when pnpm-workspace.yaml has no packages field. This caused findPackages
to default to ['.', '**'], discovering ALL directories with package.json
as workspace projects. This is the same regression that was previously
reverted in 595cd41 (close pnpm#10571), reintroduced by pnpm#10127.

Projects like cdxgen that use pnpm-workspace.yaml only for settings
(e.g. minimumReleaseAge) without a packages field were broken because
test data directories were picked up as workspace projects.

close pnpm#10909

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove unknown word from changeset

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(config): verify workspacePackagePatterns defaults to ['.'] without packages field

Adds a regression test to ensure pnpm-workspace.yaml without a packages
field defaults workspacePackagePatterns to ['.'] (root only), preventing
all directories from being discovered as workspace projects.

(cherry picked from commit 5163697)
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.

pnpm install fails for cdxgen Lockfile changed between 10.28.2 and 10.29.1 for some packages

3 participants