Skip to content

fix(core): normalize ./ prefix in workspace globs for package detection#4308

Merged
JamesHenry merged 2 commits intolerna:mainfrom
AI-JamesHenry-Org:4190
Mar 12, 2026
Merged

fix(core): normalize ./ prefix in workspace globs for package detection#4308
JamesHenry merged 2 commits intolerna:mainfrom
AI-JamesHenry-Org:4190

Conversation

@AI-JamesHenry
Copy link
Copy Markdown
Collaborator

Note

🤖 This PR was created by @AI-JamesHenry, an AI assistant account guided and overseen by @JamesHenry.

Summary

  • Strips leading ./ from packageConfigs globs before matching against Nx project roots, which are always normalized without the prefix
  • Fixes workspace detection when package.json uses "./packages/*" style globs (valid in both npm and yarn)

Closes #4190

Test plan

  • Added unit test that reproduces the bug (glob with ./ prefix finds 0 projects)
  • Verified fix passes all 501 existing + new tests in the core package
  • Manually verified with a temp lerna workspace using "workspaces": ["./packages/*"]

Reproduces lerna#4190 where workspace detection breaks when package.json
uses "./packages/*" instead of "packages/*" in the workspaces field.
Strip leading ./ from packageConfigs globs before matching against Nx
project roots, which are always normalized without the prefix. This
fixes workspace detection when package.json uses "./packages/*" style
globs, which are valid in both npm and yarn.

Closes lerna#4190
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Mar 12, 2026

View your CI Pipeline Execution ↗ for commit 6af2557

Command Status Duration Result
nx run-many --t e2e --parallel=1 ✅ Succeeded 11m 33s View ↗
nx run-many -t test --parallel=3 --ci --maxWork... ✅ Succeeded 1m 9s View ↗
nx run-many -t build --parallel=3 ✅ Succeeded 46s View ↗
nx run-many -t lint --parallel=3 ✅ Succeeded 45s View ↗
nx run integration:integration --ci --maxWorkers=2 ✅ Succeeded 12s View ↗
nx-cloud record -- npx nx format:check ✅ Succeeded 2s View ↗
nx run-many -t build ✅ Succeeded <1s View ↗
nx run-many -t test --parallel=3 --ci --maxWork... ✅ Succeeded 3m 22s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-12 12:31:55 UTC

@JamesHenry JamesHenry marked this pull request as ready for review March 12, 2026 12:36
@JamesHenry JamesHenry merged commit bd39779 into lerna:main Mar 12, 2026
15 checks passed
@JamesHenry JamesHenry deleted the 4190 branch March 12, 2026 12:37
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.

Workspace detection breaks with ./ prefix in v7/v8

2 participants