chore(core): build nx to local dist and use nodenext#34111
chore(core): build nx to local dist and use nodenext#34111
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
❌ Deploy Preview for nx-docs failed. Why did it fail? →
|
|
View your CI Pipeline Execution ↗ for commit a1b8225
☁️ Nx Cloud last updated this comment at |
1845ef4 to
e88f09d
Compare
e88f09d to
355cb3c
Compare
0e73eba to
3038774
Compare
3038774 to
bce8591
Compare
bce8591 to
4b4f86a
Compare
0defccd to
8db4c8c
Compare
4304d08 to
ecfcaec
Compare
Fixes missed path updates in e2e tests for the nx package dist restructuring.
The exports field was missing entries for migrations.json, generators.json, and executors.json. This caused ERR_PACKAGE_PATH_NOT_EXPORTED when resolving bare specifiers like 'nx/migrations.json' (used by nx repair/lerna repair).
…V test The "should be resilient against NODE_ENV values" test was using ...process.env which leaked unfiltered NX_* variables into the child process, causing Nx Cloud initialization failures. Use getStrippedEnvironmentVariables() instead, which is already imported and properly filters out problematic variables while preserving PATH.
The exports field in nx package.json enables Node.js self-referencing, causing require.resolve with paths option to always resolve to the current package. This made isLocalInstall always true, breaking global-to-local nx delegation. Use Module.createRequire from an external context to resolve nx, which avoids triggering self-referencing while still following the exports map.
The previous commit switched to `require()` for reading nx/package.json which causes Node's require cache to return stale data when the file is modified on disk. Use `readJsonFile` instead to always read fresh from disk while keeping the `createRequire`+`resolve` approach for path resolution. Fixes e2e-nx misc.test.ts failures for version mismatch warnings.
…cutor The `import * as process from 'node:process'` was compiled by tslib's __importStar into a wrapper object that only copies own properties. Since `process.on` is inherited from EventEmitter.prototype, it was undefined on the wrapper, causing `TypeError: process.on is not a function` in the module-federation-static-server executor. The global `process` is always available in Node.js — no import needed.
…lass directly
The tests were mutating require('eslint').loadESLint, but resolveESLintClass
uses await import('eslint') which returns a different module namespace in Jest.
Spy on resolveESLintClass instead to correctly control the returned ESLint class.
Add module-level jest.mock for fs to ensure existsSync and readFileSync are properly intercepted by SWC-compiled imports. Without this, the destructured imports bind directly and bypass jest.spyOn calls in beforeEach.
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
…post-build deps nx:copy-local-native only provides native binaries at packages/nx/dist/src/native/ but legacy-post-build also needs the compiled JS at packages/nx/dist/. Using nx:build-base provides both since it transitively depends on copy-local-native. Also restores ^build-base for dotnet and maven overrides which was previously dropped.
Replace jest.spyOn(enquirer, 'prompt') with module-level jest.mock pattern to fix CJS module mocking issues in CI.
…ig for pnpm compatibility The react-native jest preset's transformIgnorePatterns doesn't account for pnpm's .pnpm/ node_modules structure, causing Flow type parsing errors in @react-native/js-polyfills. The generated jest config now includes a pnpm-compatible pattern that works with all package managers.
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
There was a problem hiding this comment.
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 investigated the maven-batch-runner:_package failure and found it is caused by a corrupted or incompletely initialized Nx workspace database (.nx/workspace-data), not by any code introduced in this PR. Running nx reset on the CI environment should resolve the issue and allow the task to pass on a rerun.
No code changes were suggested for this issue.
Trigger a rerun:
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
…esbuild import The react-native vite config template imported esbuild directly, which fails during project graph processing in pnpm strict mode because esbuild is only a transitive dependency of vite and not hoisted to root node_modules. Fixes e2e-detox:e2e-macos-local failure.
Nx package builds to local dist folder
Nx uses nodenext for module + moduleResolution
Nx uses @swc/jest for unit testing to handle nodenext
Closes NXC-3570