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): resolve subpath patterns in package exports correctly when constructing graph #30511

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leosvelperez
Copy link
Member

Current Behavior

When a package has a subpath pattern like the following:

{
  "exports": {
    "./*": {
      "types": "./dist/lib/*/index.d.ts",
      "import": "./dist/lib/*/index.js",
      "default": "./dist/lib/*/index.js"
    }
  }
}

When constructing the graph the project is not picked as a dependency of others projects that import from the package using a path that matches that subpath pattern. This is currently happening because the current resolution is wrongly using minimatch to match those patterns instead of the Node.js spec for resolving subpath patterns.

Expected Behavior

Subpath patterns should be processed after the Node.js spec and the graph should pick up dependencies when used.

Related Issue(s)

Fixes #30342

@leosvelperez leosvelperez self-assigned this Mar 26, 2025
@leosvelperez leosvelperez requested review from a team as code owners March 26, 2025 18:19
Copy link

vercel bot commented Mar 26, 2025

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

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Mar 26, 2025 6:22pm

Copy link

nx-cloud bot commented Mar 26, 2025

View your CI Pipeline Execution ↗ for commit 4c7872c.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 5m 46s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 20s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check --base=1a235... ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 1s View ↗
nx documentation ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-03-27 08:46:43 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants