Skip to content

build: 📦 update nx to v24 - #1105

Merged
edbzn merged 26 commits into
mainfrom
build/nx-24
Oct 24, 2026
Merged

edbzn merged 26 commits into
mainfrom
build/nx-24

Conversation

@edbzn

@edbzn edbzn commented Oct 24, 2026

Copy link
Copy Markdown
Member

Updates Nx from 22.6.1 to 24.0.1 in two steps (23.3.1, then 24.0.1). Migrations ran with --create-commits, and each manual fix is its own commit. Easiest to review commit by commit.

Migrations

  • Nx 23: 46 of 47 migrations ran. @nx/js:23-1-0-add-ignore-deprecations-for-ts6 was dropped: it writes "ignoreDeprecations": "6.0", which TypeScript 5.9 rejects (TS5103).
  • Nx 24: all 16 ran.
  • The AI-prompt migration steps were done by hand.

Manual fixes

  • TypeScript stays at 5.9.3. Angular 21 requires >=5.9 <6.0.
  • typescript-eslint 7.18 → 8, forced by @nx/eslint-plugin 23+.
    • The FlatCompat shims are replaced with plain flat config. eslint --print-config gives identical rules before and after.
    • @typescript-eslint/no-unused-expressions is off, because it fires on chai's expect(x).to.be.true.
    • Two dead .eslintrc.json files are deleted.
    • swc-angular's rollup.config.cjs is excluded from @nx/dependency-checks.
  • Vite 8:
  • Inferred targets:
    • Vitest runs in run mode, not watch.
    • The obsolete config option and the @nx/jest:jest target defaults are removed.
    • cypress-harness-e2e sets baseUrl itself, which the old executor used to pass in.
    • game-of-life's test stays an explicit jest run-command, because its config imports from dist/. Its jest.config.ts also mixed ESM and CJS, which already broke it on main.
  • CI: the Nx migrate workflow sets YARN_ENABLE_IMMUTABLE_INSTALLS: false on the migrations step. Every scheduled run since at least August failed with YN0028, because nx migrate --run-migrations runs yarn with the lockfile read-only.

Other bumps pulled in by the Nx package updates

  • cypress 15.14.2 → 16.2.0
  • vite 7.3.3 → 8.3.5
  • @analogjs/vite-plugin-angular 2.5.2 → 2.7.5
  • added @nx/vitest, angular-eslint, typescript-eslint, rollup

Validation (local)

  • run-many -t build lint test on 13 projects after the rebase onto main: all pass.
    • swc-angular-plugin: 33/33
    • swc-angular: 14/14
    • swc-angular-wide: Jest 25/25, Vitest 25/25
  • e2e (cypress-harness-e2e) and the Cypress component tests (cypress-harness-wide, microwave) pass, under Node 20 and Node 24.
  • Not run locally: the Playwright component tests (no browsers on Ubuntu 26.04). Playwright CT bundles its own Vite 5.4, so it shouldn't be affected; CI will tell.
  • Published packages: every dist/packages/*/package.json and file list is identical to the Nx 22 build. The operators and playwright-ct-angular JS is byte-identical to what's on npm.
  • nx release --dry-run works on Nx 24. adjustSemverBumpsForZeroMajorVersion (build: bump 0.x versions by minor for breaking changes #1104) is already the Nx 23+ default.

Follow-ups

  • Cypress 16 officially needs Node ≥ 22. CI's setup action defaults to Node 20 (it passed locally on 20.20.2). Worth moving the default to 24.
  • Cypress 16 mounts Angular components without zone.js by default, which can change behaviour in downstream users' tests.
  • swc-angular users on Vite 8 need unplugin-swc ≥ 1.5.10. The README's Vitest section should say so.

🤖 Generated with Claude Code

edbzn and others added 22 commits October 24, 2026 21:02
Package updates from `nx migrate 23.3.1`, except TypeScript, which stays
on 5.9.3: Angular 21 requires typescript >=5.9 <6.0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(nx: 22-7-0-add-polygraph-to-git-ignore).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(nx: 22-7-0-add-self-healing-to-gitignore).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/eslint: update-executor-lint-inputs).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/vite: ensure-vitest-package-migration-23).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(nx: 23-0-0-consolidate-release-tag-config).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(nx: 23-0-0-add-migrate-runs-to-git-ignore).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/vite: migrate-to-vitest-4).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/eslint: update-23-1-0-convert-to-flat-config).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/eslint: update-23-1-0-remove-removed-typescript-eslint-extension-rules).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/cypress: disable-webpack-ct-just-in-time-compile).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/cypress: upgrade-to-cypress-16).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- bump @typescript-eslint/* to 8.72.0: @nx/eslint-plugin 23 requires
  @typescript-eslint/parser ^8
- pin cypress to 16.2.0, as the repo pins its other dependencies
- replace the FlatCompat shims with flat-native configs: the Angular
  inline-template processor already comes from nx flat/angular, Cypress
  from eslint-plugin-cypress/flat; drop the now unused @eslint/eslintrc
  and @eslint/js
- turn off @typescript-eslint/no-unused-expressions, newly enabled by the
  typescript-eslint v8 recommended set (chai `expect(x).to.be.true`)
- remove the playwright-ct-angular tests' .eslintrc.json: they have no
  lint target and extended the deleted root .eslintrc.json

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- bump unplugin-swc to 1.5.11: Vite 8 transforms TypeScript with Oxc
  unless `oxc: false` is set, and unplugin-swc only sets it since 1.5.10.
  With 1.5.9, Oxc stripped the decorators before swc-angular-plugin saw
  them and 22 of the 25 swc-angular-wide vitest tests failed.
- typecheck swc-angular's spec files with `moduleResolution: bundler`:
  vite 8 only exposes its types through package exports, so the
  vite.config.ts typecheck failed under `node`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Package updates from `nx migrate latest`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(nx: 24-0-0-enable-legacy-affected).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/eslint: remove-deprecated-executors).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/vitest: remove-deprecated-executors).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/vite: update-24-0-0-migrate-config-helpers).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/jest: remove-deprecated-executors).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/cypress: remove-deprecated-executors).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/rollup: remove-deprecated-executors).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
edbzn and others added 4 commits October 24, 2026 21:02
Generated by `nx migrate --run-migrations --create-commits`
(@nx/angular: update-24-0-0-add-ready-when-signal).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated by `nx migrate --run-migrations --create-commits`
(@nx/angular: update-24-0-0-remove-scam-generator-defaults).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- game-of-life: load jest.config.ts as ESM (`export default`). It mixed
  an ESM import with `module.exports` and has failed to load since before
  this upgrade. Move its test target off the removed @nx/jest:jest
  executor to an explicit `jest` run-command, not to @nx/jest/plugin:
  its config imports @jscutlery/swc-angular from dist/, so inferring it
  breaks the project graph until swc-angular is built (e.g. on a fresh CI
  checkout).
- drop the @nx/jest:jest target defaults; the filtered `test` defaults
  carry them and the plugin adds jest.preset.js to the inputs
- run inferred vitest targets with `vitest run`, as the removed
  @nx/vitest:test executor did, instead of watch mode
- drop swc-angular's test `config` option: the inferred target runs in
  the project root, where the workspace-relative path does not resolve
- swc-angular: exclude the generated rollup.config.cjs from
  @nx/dependency-checks, which otherwise wants @nx/rollup as a peer
  dependency of the published package
- cypress-harness-e2e: set `baseUrl` to the sandbox dev server. The
  removed @nx/cypress:cypress executor passed it from `devServerTarget`;
  without it, `cy.visit('/')` hit Cypress's file server and 404ed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`nx migrate --run-migrations` runs `yarn` after migrations that edit
package.json (e.g. @nx/vite's switch to @nx/vitest). Yarn makes installs
immutable when CI is set, so the daily workflow has failed with YN0028
on every run since at least August.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@edbzn
edbzn enabled auto-merge (squash) October 24, 2026 19:06
@edbzn
edbzn merged commit 3c8911c into main Oct 24, 2026
11 of 13 checks passed
@edbzn
edbzn deleted the build/nx-24 branch October 24, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant