build: update Nx to 24 by NathanWalker · Pull Request #11684 · NativeScript/NativeScript
Repository navigation
build: update Nx to 24 - #11684
Merged
NathanWalker merged 8 commits into main from chore/nx-24 Nov 28, 2026
Merged
build: update Nx to 24 #11684 NathanWalker merged 8 commits into main from chore/nx-24
Conversation
NathanWalker commented Nov 25, 2026 · edited Loading
Copy link Copy Markdown
Contributor
PR Checklist
- The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages .
- There is an issue for the bug/feature this PR is for.
- You have signed the CLA .
- All existing tests are passing (same results as the base branch, see Verification).
- Tests for the changes are included (tooling-only change).
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 ignoreDeprecations anywhere.
Moving to Nx 24 brings two required changes:
- ESLint 9.
@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. - Inferred tasks. Nx 24 removes the
@nx/eslint,@nx/jestand@nx/vitestexecutors, solintandtestbecome tasks inferred by Nx plugins.
Versions
| Package | Before | After | Why |
|---|---|---|---|
nx, @nx/* |
22.7.12 | 24.0.7 | Goal of this PR. @nx/eslint is now a direct devDependency, because nx migrate only collects migrations for packages listed in package.json. |
@nativescript/nx |
^22.0.0 | ^24.0.0 | 22.x requires nx ^22. 24.0.0 is the plugin release for Nx 24 (NativeScript/nx#90 ). |
eslint |
~8.57.0 | ~9.39.5 | Required by @nx/eslint 23.1+. ESLint 9 is the version the Nx migration targets; ESLint 10 is not used yet. |
typescript-eslint |
(none) | ^8.74.0 | Required by the flat configs in @nx/eslint-plugin. |
@typescript-eslint/eslint-plugin, @typescript-eslint/parser |
^8.72.0 | ^8.74.0 | Kept in line with typescript-eslint. |
jest |
30.0.5 | 30.3.0 | Package update from the Nx 24 migration (same major). |
Notable resolved versions in the lockfile:
- eslint and @eslint/js: 8.57.1 → 9.39.5
- @eslint/eslintrc: 2.1.4 → 3.3.7
- eslint-config-prettier: 10.1.5 → 10.1.8
- @typescript-eslint/*: 8.72.0 → 8.74.0
- jest, babel-jest, jest-environment-node and the other @jest/*: 30.0.5 → 30.3.0
- @babel/core: 7.28.3 → 7.29.13
- The nested TypeScript 5.9.3 under
@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/eslint 22 peer edges ("ERESOLVE ... Conflicting peer dependency: @nx/eslint@24.0.7"). The same package.json resolves cleanly from scratch, so the 24 nx, @nx/* and @nativescript/nx lockfile entries were removed and re-resolved. Nothing else was regenerated, and there are no overrides or --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:- Each
.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).- The JSON override moved to
tools/workspace-plugin, the only project that lints JSON.
- Each
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).- Each plugin has an
includelist naming exactly the projects that had that target before. - The eslint plugin matches only each project's root files. Otherwise nested
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.- The
ciconfiguration andpassWithNoTestsfrom the old@nx/jest:jesttarget defaults moved onto workspace-plugin'sproject.json. - Result: project names, target names and configuration names are identical to the base branch.
- Each plugin has an
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.json restored 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:
- Import rewrites: devkit deep imports,
@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.- The two pnpm cache-input migrations.
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:
| Prompt | Outcome |
|---|---|
@nx/vite ai-instructions-for-vite-8 |
Not applicable: #11588 's base is already on Vite 8, and there are no rollupOptions or other Vite 8 breaking patterns. |
@nx/vite migrate-to-vitest-3 |
Not applicable: already on Vitest 4. |
@nx/vite migrate-to-vitest-4 |
Applied: vitest.workspace.ts → vitest.config.ts (commit 7). No pool, deps, reporter or browser options to migrate, and no VITEST_MAX_* env vars in the workflows. |
@nx/eslint convert-to-flat-config |
Applied by hand (commit 2). No rules were disabled to make lint pass; see the lint notes below. |
@nx/jest verify-typecheck |
Not applicable: its generator only acts on TypeScript < 6. |
@nx/eslint migrate-ban-types-rule |
Applied: ban-types removed; no-empty-object-type, no-unsafe-function-type and no-wrapper-object-types were already configured. |
@nx/eslint finish-inferred-conversion |
Applied (commit 4). |
@nx/jest finish-inferred-conversion |
Applied (commits 4 and 6). |
@nx/vite finish-inferred-conversion |
Applied (commit 4). |
@nx/vite migrate-config-helpers |
Applied (commit 5). No other config used the helpers. |
@nx/vite finish-ready-signal-plugin |
Not applicable: apps/toolbox and apps/automated have @nativescript/vite configs, but @nx/vite/plugin is not registered, so they have no inferred dev/preview targets for nxReadySignal() to affect. |
CI and the npm start menu
nx 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.- The
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.
- Every nps menu target name still resolves.
nx g @nstudio/focus:modeworks.
Verification
Baseline is the untouched chore/typescript-6 branch after npm ci. All commands ran with --skip-nx-cache.
| Check | Baseline (Nx 22.7.12) | This PR (Nx 24.0.7) |
|---|---|---|
nx run-many -t build -p core,webpack5,vite |
pass | pass |
core:test |
565 passed, 1 skipped | 565 passed, 1 skipped |
webpack5:test |
16 failed / 65 passed | 16 failed / 65 passed (the same 16, path-dependent snapshots) |
vite:test |
5 failed / 1924 passed | 0 failed / 1929 passed (see note) |
run-many --target=test --configuration=ci --projects=core |
565 passed | 565 passed |
core:lint |
0 errors, 22 warnings | 0 errors, 23 warnings |
vite:lint |
3 errors | the same 3 errors (2 no-fallthrough, 1 no-irregular-whitespace), plus 22 warnings |
workspace-plugin:lint |
could not run (@nx/linter:eslint not installed) |
runs: 2 errors (@nx/dependency-checks), 1 warning |
webpack5:lint |
failed: "Nothing to lint" (empty lintFilePatterns) |
runs: 23 errors (prefer-const) |
apps-toolbox / apps-automated / apps-ui :lint |
failed: "All files ... are ignored" | run: 17 / 3230 / 335 errors |
run-many -t lint |
aborted immediately (@nx/linter:eslint) |
runs every project |
workspace-plugin:test |
pass (no tests) | pass (no tests), also with -c ci |
nx show projects / nx graph |
15 projects | the same 15 projects, target names and configurations |
apps-toolbox:clean, nx prepare apps-toolbox android |
n/a | pass (@nativescript/nx@24.0.0) |
nx prepare apps-toolbox android |
n/a | pass (webpack build, AARs built, "Project successfully prepared") |
Notes:
- vite tests: the 5 baseline failures are all in
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. - Lint warnings: the new warnings in core (+1) and vite (+22) are all "Unused eslint-disable directive". ESLint 9 turns
reportUnusedDisableDirectiveson by default. No rule was disabled. - Newly running lint targets: webpack5, the three apps and workspace-plugin are linted for the first time. Under ESLint 8 the root
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 . - No iOS or Android device or emulator was available, so
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).- Merging
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.
nx-cloud
Bot
commented
Nov 25, 2026
·
edited
Loading
Copy link Copy Markdown
|
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 |
pkg-pr-new
Bot
commented
Nov 25, 2026
·
edited
Loading
Copy link Copy Markdown
commit: |
fcf5e4d to
3deeab1
Compare
November 28, 2026 00:17 Base automatically changed from chore/typescript-6 to main November 28, 2026 00:30 NathanWalker added 8 commits November 27, 2026 16:30
build: update Nx to 24.0.7
0c1662a
- 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.
build: migrate ESLint to v9 flat config
2690b00
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.
build: keep project-level nx affected selection
c4105d7
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.
build: move lint and test to Nx inferred tasks
dd8cea6
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.
build(core): drop the Nx vite config helpers removed in Nx 24
7dfd5a1
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.
build: load the workspace-plugin jest config as CommonJS
71d8362
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.
build: rename vitest.workspace.ts to vitest.config.ts
19f17e9
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).
build: use the stable @nativescript/nx 24 release
219185a
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
3deeab1 to
219185a
Compare
November 28, 2026 00:30 NathanWalker merged commit
e3b20a9
into
main
Nov 28, 2026
13 checks passed
NathanWalker
deleted the
chore/nx-24
branch
November 28, 2026 00:33
NathanWalker
mentioned this pull request
Nov 28, 2026
feat(core): let style converters preserve CSS math
#11668
Open
3 tasks done
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment