Repository navigation
build: update Nx to 24 - #11684
Merged
Merged
build: update Nx to 24#11684
Conversation
|
View your CI Pipeline Execution ↗ for commit 219185a
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
3 of 5 tasks
NathanWalker
force-pushed
the
chore/nx-24
branch
from
November 28, 2026 00:17
fcf5e4d to
3deeab1
Compare
- nx and @nx/* 22.7.12 -> 24.0.7; add @nx/eslint as a direct dependency so `nx migrate` collects its migrations. - @nativescript/nx 23.0.0-rc.0 (peers nx >= 23). - ESLint ~8.57 -> ~9.39.5: @nx/eslint >= 23.1 requires ESLint 9+. Add the typescript-eslint meta package used by Nx's flat configs and bump @typescript-eslint/* to ^8.74.0. - jest 30.0.5 -> 30.3.0 (Nx 24 migration package update). - Ignore .nx/migrate-runs (Nx 23 migration). The nx, @nx/* and @nativescript/nx lockfile entries were dropped and re-resolved; npm could not reconcile the old @nx/eslint 22 peer edges.
Nx 24 requires ESLint 9, which drops .eslintrc. Each .eslintrc.json is replaced by an equivalent eslint.config.mjs built on @nx/eslint-plugin's flat configs (which bundle eslint:recommended, typescript-eslint recommended and eslint-config-prettier) plus the existing overrides. - @typescript-eslint/ban-types is dropped: typescript-eslint 8 removed it and its three successors are already turned off. - packages/core gets no eslint.config.mjs of its own: the core build copies every *.mjs in the package to dist, and the vite HMR core bundle imports them. Its ignores live in the root config, which also limits core to TypeScript and JS specs (the old lintFilePatterns). - The JSON override moves from the root to tools/workspace-plugin, the only project that lints JSON. - eslint.config.mjs is excluded from the production named input.
Nx 24 selects individual affected tasks by default. Set affected.legacy (the Nx 24 migration default) so `nx affected` and `nx show projects --affected`, used by the release workflow, keep selecting whole projects.
Nx 24 removes the @nx/eslint, @nx/jest and @nx/vitest executors. Register their inference plugins instead, each limited with `include` to the projects that already had the target, so target names stay the same and no project gains a new one: - @nx/eslint/plugin: lint for core, vite, webpack5, workspace-plugin and the three apps (`eslint .` in the project root). Patterns match only each project's root files so nested package.json folders (core's css/, easysax/, the automated app's fixtures) don't become projects. - @nx/vitest: test for core and vite, `testMode: run` to keep run-once `vitest run` (`--watch` still switches to watch mode). - @nx/jest/plugin: test for workspace-plugin; the `ci` configuration and passWithNoTests from the old @nx/jest:jest target defaults move onto its project.json. The executor-keyed target defaults are removed; the `test` and `lint` target-name defaults still apply to the inferred targets. The workspace-plugin lint target pointed at @nx/linter:eslint, which was never installed, and now runs.
nxViteTsPaths and nxCopyAssetsPlugin are inert stubs in Nx 24. Path aliases now come from Vite's native resolve.tsconfigPaths. The copy plugin only copied *.md on a vite build, and core builds with @nx/js:tsc, so it is removed rather than replaced.
The inferred @nx/jest target runs the jest CLI, which loads jest.config.ts through Node type stripping (CommonJS package) or ts-node. `export default` fails the first and TypeScript 6 rejects ts-node's node10 module resolution, so use module.exports as Nx's own convert-jest-config-to-cjs migration does.
Vitest 4 no longer reads vitest.workspace.* files. The file already uses the `test.projects` form, so renaming it to the root vitest.config.ts is enough for a root-level `vitest` run to pick up the core and vite projects again (Nx's migrate-to-vitest-4 prompt).
Replaces the 23.0.0-rc.0 pin with ^24.0.0, the plugin release that targets Nx 24.
NathanWalker
force-pushed
the
chore/nx-24
branch
from
November 28, 2026 00:30
3deeab1 to
219185a
Compare
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
#11588 (
chore/typescript-6) moves the workspace to TypeScript 6.0.3 on Nx 22.7.12. This PR targets that branch to help finish it. It contains only the Nx 24 changes on top of it.What is the new behavior?
Nx 22.7.12 → 24.0.7. TypeScript stays at 6.0.3; TypeScript 7 is out of scope. Everything from #11588 is kept, and its approach is kept too: no
ignoreDeprecationsanywhere.Moving to Nx 24 brings two required changes:
@nx/eslint23.1 and later require ESLint 9 or 10, so ESLint goes from 8.57 to 9.39 and the configs move to flat config.@nx/eslint,@nx/jestand@nx/vitestexecutors, solintandtestbecome tasks inferred by Nx plugins.Versions
nx,@nx/*@nx/eslintis now a direct devDependency, becausenx migrateonly collects migrations for packages listed inpackage.json.@nativescript/nxnx ^22. 24.0.0 is the plugin release for Nx 24 (NativeScript/nx#90).eslint@nx/eslint23.1+. ESLint 9 is the version the Nx migration targets; ESLint 10 is not used yet.typescript-eslint@nx/eslint-plugin.@typescript-eslint/eslint-plugin,@typescript-eslint/parsertypescript-eslint.jestNotable resolved versions in the lockfile:
@nx/eslintis gone. The only remaining nested copy is thenativescriptCLI's 5.7.3.These did not change: vite 8.0.2, vitest 4.0.9, rolldown, esbuild, ts-jest 29.4.15, typescript 6.0.3.
About the lockfile: npm could not reconcile the old
@nx/eslint22 peer edges ("ERESOLVE … Conflicting peer dependency: @nx/eslint@24.0.7"). The samepackage.jsonresolves cleanly from scratch, so the 24nx,@nx/*and@nativescript/nxlockfile entries were removed and re-resolved. Nothing else was regenerated, and there are nooverridesor--legacy-peer-deps. Net lockfile change: 205 packages added, 47 removed, 123 changed.Commits
build: update Nx to 24.0.7: dependencies and lockfile, plus.nx/migrate-runsadded to.gitignore(an Nx 23 migration).build: migrate ESLint to v9 flat config:.eslintrc.jsonbecomes aneslint.config.mjswritten directly on the@nx/eslint-pluginflat configs, with the existing overrides. TheFlatCompat/@eslint/eslintrcshim the generator produced is not used.@typescript-eslint/ban-typesis removed: typescript-eslint 8 dropped it, and its successors are already off.packages/coreintentionally has noeslint.config.mjs. The core build copies every*.mjsin the package todist, and the vite HMR core bundle imports every top-level*.mjs. An eslint config there brokehmr/server/core-bundle.spec.tsand would have been published inside@nativescript/core. Core's ignores live in the root config instead. They also keep core's lint scope at TypeScript files and JS specs (the oldlintFilePatterns).tools/workspace-plugin, the only project that lints JSON.build: keep project-level nx affected selection: setsaffected.legacy: true, the Nx 24 migration's default.secure_nx_release.ymlrelies onnx show projects --affected.build: move lint and test to Nx inferred tasks: adds an nx.jsonpluginsblock (@nx/eslint/plugin,@nx/vitest,@nx/jest/plugin).includelist naming exactly the projects that had that target before.package.jsonfolders (core'scss/,easysax/andglobal-polyfills/, and severalapps/automated/srctest folders) would become new projects.@nx/vitestusestestMode: run, which keeps run-oncevitest run.--watchstill switches to watch mode.ciconfiguration andpassWithNoTestsfrom the old@nx/jest:jesttarget defaults moved onto workspace-plugin'sproject.json.build(core): drop the Nx vite config helpers removed in Nx 24:nxViteTsPaths→resolve.tsconfigPaths.nxCopyAssetsPlugin(['*.md'])is removed rather than replaced: it only ran on a vite build, and core builds with@nx/js:tsc.build: load the workspace-plugin jest config as CommonJS: the inferred jest task runs the plain jest CLI. That CLI can't load anexport defaultjest.config.tsin a CommonJS package, and its ts-node fallback fails on TypeScript 6's node10 deprecation. Switching tomodule.exportsmatches Nx's ownconvert-jest-config-to-cjsmigration. It needs Node with type stripping (22.18+ or 23.6+).build: rename vitest.workspace.ts to vitest.config.ts: Vitest 4 no longer readsvitest.workspace.*files. A rootnpx vitest runnow runs the core and vite projects again (209 files).Migrations (run with
nx migrate --run-migrations --agentic=false;migrations.jsonrestored to the base version)Code migrations that made changes:
@nx/eslint:update-23-1-0-convert-to-flat-config: rewritten by hand (see commit 2).@nx/eslint:update-23-1-0-remove-removed-typescript-eslint-extension-rules: dropped@typescript-eslint/no-extra-semifrom vite's config. Kept.@nx/js:23-1-0-add-ignore-deprecations-for-ts6: addedignoreDeprecations: "6.0",esModuleInterop: false,noUncheckedSideEffectImports: falseandtypes: ["*"]to 13 tsconfigs. Reverted entirely: build: update to TypeScript 6 #11588 fixes these deprecations rather than silencing them, and every build and test passes without them.nx:24-0-0-enable-legacy-affected: kept (commit 3).@nx/eslint,@nx/jestand@nx/viteremove-deprecated-executors: rewritten by hand (commit 4). The generators turnedlintFilePatternsintoargsthateslint .ignored, reordered keys in everyproject.json, and left a redundantcoverage.reportsDirectoryoverride (vitest already sets it in its config).@nx/vite:update-24-0-0-migrate-config-helpers: kept, then finished (commit 5).No changes:
@nx/*internal subpaths,createNodesV2renames, the@nx/workspacetypescript import.nx:23-0-0-add-migrate-runs-to-git-ignore: already applied in commit 1.@nx/js:23-1-0-set-tsconfig-root-dir-for-ts6.@nx/vitest:update-23-2-0-use-import-meta-dirname.nx:23-2-0-set-cache-on-executor-target-defaults.nx:24-0-0-move-custom-hashers-to-inputs.nx:24-0-0-rename-ultracache-ignore-options.@nx/jest: snapshot link update,setupFileandskipSetupFilemigrations,jestProjectGeneratorrewrite,set-ts-jest-isolated-modules(applies only to TypeScript < 6).@nx/vite: rolldownOptions rename, vitest-package safety net, migrate-to-vitest-3 and migrate-to-vitest-4 generators,register-typescript-plugin-for-typecheck,add-ready-signal-plugin.@nx/vitest:remove-deprecated-executors.@nx/eslint:update-24-0-0-replace-set-parser-options-project.@nx/web:update-24-0-0-add-ready-when-signal.The 11 AI-prompt migrations:
@nx/viteai-instructions-for-vite-8rollupOptionsor other Vite 8 breaking patterns.@nx/vitemigrate-to-vitest-3@nx/vitemigrate-to-vitest-4vitest.workspace.ts→vitest.config.ts(commit 7). No pool, deps, reporter or browser options to migrate, and noVITEST_MAX_*env vars in the workflows.@nx/eslintconvert-to-flat-config@nx/jestverify-typecheck@nx/eslintmigrate-ban-types-ruleban-typesremoved;no-empty-object-type,no-unsafe-function-typeandno-wrapper-object-typeswere already configured.@nx/eslintfinish-inferred-conversion@nx/jestfinish-inferred-conversion@nx/vitefinish-inferred-conversion@nx/vitemigrate-config-helpers@nx/vitefinish-ready-signal-pluginapps/toolboxandapps/automatedhave@nativescript/viteconfigs, but@nx/vite/pluginis not registered, so they have no inferred dev/preview targets fornxReadySignal()to affect.CI and the
npm startmenunx run-many --target=test --configuration=ci --projects=corebehaves the same as on the base branch. Core's test target had nociconfiguration before and still doesn't, so it runscore:test.nx test apps-automated -c=android|iosis unchanged: it's annx:run-commandstarget with the same configurations.secure_nx_release.ymlcommands still run, checked with dry runs:nx show projects --projects "packages/*" --type lib --exclude …gives the same list.nx release version prerelease --preid next --projects core --dry-runworks.nx release prerelease --preid next --projects vite --skip-publish --dry-runworks.nx g @nstudio/focus:modeworks.Verification
Baseline is the untouched
chore/typescript-6branch afternpm ci. All commands ran with--skip-nx-cache.nx run-many -t build -p core,webpack5,vitecore:testwebpack5:testvite:testrun-many --target=test --configuration=ci --projects=corecore:lintvite:lintno-fallthrough, 1no-irregular-whitespace), plus 22 warningsworkspace-plugin:lint@nx/linter:eslintnot installed)@nx/dependency-checks), 1 warningwebpack5:lintlintFilePatterns)prefer-const)apps-toolbox/apps-automated/apps-ui:lintrun-many -t lint@nx/linter:eslint)workspace-plugin:test-c cinx show projects/nx graphapps-toolbox:clean,nx prepare apps-toolbox android@nativescript/nx@24.0.0)nx prepare apps-toolbox androidNotes:
typescript-optional.spec.ts. They depend on the working directory, failing withThe "paths[1]" argument must be of type string: the old executor ran vitest from the workspace root, while the inferred task runs it inpackages/vite. Runningnpx vitest runfrom the root still shows the same 5 failures.reportUnusedDisableDirectiveson by default. No rule was disabled.ignorePatterns: ["**/*"](or a missing executor) meant they never actually linted anything. Their errors are existing violations:no-varandprefer-constfrom typescript-eslint's recommended set, andenforce-module-boundaries"lazy-loaded library" errors in apps/automated. They are not new failures introduced by ESLint 9. This PR doesn't touch source to satisfy them. They stay; the violations are fixed in the stacked follow-up style: fix lint violations surfaced by the Nx 24 lint targets #11685.nx test apps-automated -c=android|iosanddebugwere not run.Notes
@nativescript/nxuses the stable^24.0.0release (feat: migrate to Nx 24 nx#90), which installs and runs under Nx 24 (clean,prepare).mainintochore/typescript-6:mainis 74 commits ahead of build: update to TypeScript 6 #11588's base and did not touch the rootpackage.jsonorpackage-lock.json. Merging it gives one content conflict, inpackages/webpack5/src/loaders/native-class-downlevel-loader/index.ts. This PR does not mergemain, to keep its diff to the Nx changes.nx migratein Nx 24 starts a "migrate run" that commits each step when it detects an AI agent. Pass--agentic=falseto get the classic behavior.