Skip to content

fix(core): restore top-level schemas/ in published nx package#35427

Merged
FrozenPandaz merged 1 commit into
masterfrom
gh-35411
Apr 24, 2026
Merged

fix(core): restore top-level schemas/ in published nx package#35427
FrozenPandaz merged 1 commit into
masterfrom
gh-35411

Conversation

@leosvelperez
Copy link
Copy Markdown
Member

Current Behavior

In 22.7.0-rc.1, $schema references in nx.json and project.json no longer resolve in VS Code / JetBrains / any editor that reads $schema as a filesystem path.

Root cause — two commits combined:

  1. chore(core): build nx to local dist and use nodenext #34111 moved schemas from packages/nx/schemas/ to packages/nx/dist/schemas/.
  2. fix(core): reduce published nx package size with files allowlist #35109 introduced a files allowlist that shipped only dist/, dropping the legacy top-level schemas/ from the published npm tarball.

Node subpath exports ("./schemas/*": "./dist/schemas/*.json") do not redirect filesystem paths — editors bypass Node resolution entirely. So the regression affected both existing workspaces upgrading from 22.6.x (with $schema already in their configs) and fresh installs (since nx init, create-nx-workspace, and the project-configuration generator all write ./node_modules/nx/schemas/...).

Expected Behavior

schemas/*.json ship at the root of the published nx package again, so ./node_modules/nx/schemas/nx-schema.json (and the project/workspace variants) resolve on disk — no migration required, no changes to the paths generators write.

Schemas are static JSON assets, not build artifacts — they're now published from source, not copied through dist/:

  • packages/nx/package.json files: "dist/schemas""schemas".
  • packages/nx/package.json exports: ./schemas/* and ./schemas/*.json both map to ./schemas/*.json.
  • packages/nx/assets.json: dropped the schemas/*.jsondist/ copy step.

Verified via npm pack --dry-run — tarball now contains schemas/nx-schema.json, schemas/project-schema.json, schemas/workspace-schema.json at root, with no dist/schemas/ entries.

Related Issue(s)

Fixes #35411

Editors resolve $schema as a filesystem path, bypassing Node
subpath exports. The 22.7 files allowlist dropped the top-level
schemas/ directory, breaking $schema references in every nx.json
and project.json.
@leosvelperez leosvelperez self-assigned this Apr 24, 2026
@leosvelperez leosvelperez requested a review from a team as a code owner April 24, 2026 12:13
@leosvelperez leosvelperez requested a review from JamesHenry April 24, 2026 12:13
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 0eb79ac
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69eb5e6d48bb9500089a820c
😎 Deploy Preview https://deploy-preview-35427--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 0eb79ac
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69eb5e6d98d4750008ef8367
😎 Deploy Preview https://deploy-preview-35427--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Apr 24, 2026

View your CI Pipeline Execution ↗ for commit 0eb79ac

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 14m 17s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 17s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 23s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 5s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-24 13:53:09 UTC

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

We determined this failure is unrelated to the PR's changes, which are limited to npm packaging configuration for schema paths in the nx package. The e2e-gradle tests failed due to a missing Java 21 installation on the CI runner and a transient Foojay toolchain API outage — both external infrastructure issues. No fix is needed on our end; re-running once the environment recovers should resolve it.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.


🎓 Learn more about Self-Healing CI on nx.dev

@FrozenPandaz FrozenPandaz merged commit 9062074 into master Apr 24, 2026
24 of 25 checks passed
@FrozenPandaz FrozenPandaz deleted the gh-35411 branch April 24, 2026 14:30
@github-actions
Copy link
Copy Markdown
Contributor

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 Apr 30, 2026
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.

Possible regression: $schema paths in nx.json/project.json no longer resolve in 22.7.0-rc.1

2 participants