Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): improve resolution of packages in package manager workspaces when constructing the project graph #29795

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

leosvelperez
Copy link
Member

@leosvelperez leosvelperez commented Jan 29, 2025

Main fixes:

  • Identify dependencies from packages that only expose named exports (no . export)
  • Identify dependencies from exports containing wildcards (e.g. "./utils/*": "./src/utils/*.js)
  • Disallow identifying dependencies from restricted exports (e.g. "./foo": null)
  • Handle conditional exports (e.g. "exports": { "import": "./dist/index.js", "default": "./dist/index.js" }
  • Handle invalid "exports": {} (by not falling back to main)
  • Handle projects included or not in package manager workspaces

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #29486

@leosvelperez leosvelperez self-assigned this Jan 29, 2025
Copy link

vercel bot commented Jan 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Feb 3, 2025 8:56am

Copy link

nx-cloud bot commented Jan 29, 2025

View your CI Pipeline Execution ↗ for commit 873fc7c.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 41m 48s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 15s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check --base= --he... ✅ Succeeded 7s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 5s View ↗
nx documentation ✅ Succeeded 2m 17s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-03 09:43:02 UTC

@leosvelperez leosvelperez force-pushed the core/fix-workspaces-projects-handling branch from b66407d to 873fc7c Compare February 3, 2025 08:53
@jaysoo jaysoo merged commit 4235cf3 into master Feb 3, 2025
12 checks passed
@jaysoo jaysoo deleted the core/fix-workspaces-projects-handling branch February 3, 2025 13:03
FrozenPandaz pushed a commit that referenced this pull request Feb 6, 2025
…es when constructing the project graph (#29795)

Main fixes:

- Identify dependencies from packages that only expose named exports (no
`.` export)
- Identify dependencies from exports containing wildcards (e.g.
`"./utils/*": "./src/utils/*.js`)
- Disallow identifying dependencies from restricted exports (e.g.
`"./foo": null`)
- Handle conditional exports (e.g. `"exports": { "import":
"./dist/index.js", "default": "./dist/index.js" }`
- Handle invalid `"exports": {}` (by not falling back to `main`)
- Handle projects included or not in package manager workspaces

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #29486

(cherry picked from commit 4235cf3)
Copy link

github-actions bot commented Feb 9, 2025

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NX Packages without default export are excluded from dependencies
2 participants