Skip to content

chore: upgrade nx to v24 - #291

Merged
ChristopherPHolder merged 23 commits into
mainfrom
chore/upgrade-nx
Oct 23, 2026
Merged

ChristopherPHolder merged 23 commits into
mainfrom
chore/upgrade-nx

Conversation

@ChristopherPHolder

@ChristopherPHolder ChristopherPHolder commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

First of a series of dependency-update PRs, starting with the tooling. This one moves the workspace from Nx 21.6.4 to Nx 24.0.0 using nx migrate latest and its migration run (one commit per migration that made changes).

What nx migrate bumped

Package From To
nx, @nx/* 21.6.4 24.0.0 (+ new @nx/vitest)
typescript ^5.7.3 6.0.3
vite 7.1.9 8.3.5
vitest, @vitest/coverage-v8 ^3.2.4 4.1.9
jest / ts-jest ^30.2.0 / 29.4.5 30.3.0 / 29.4.9
typescript-eslint ^8.40.0 8.72.0
@swc/core, @swc-node/register, verdaccio latest patch/minor
webpack, webpack-cli, webpack-dev-server (transitive) now explicit devDeps for the inferred webpack targets

Notable changes

Executors → inferred targets (Nx 24 removed the executors)

  • lint is now inferred by @nx/eslint/plugin (eslint . per project) for all 5 projects.
  • nx-plugin:test is inferred by @nx/jest/plugin.
  • cli:test / cli-e2e:test are inferred by @nx/vitest with testMode: "run" (keeps the old run-once behaviour instead of watch mode locally). Both run from the workspace root with --root <project>, like the removed executor did, because the tests use workspace-relative paths. e2e/cli-e2e/vite.config.e2e.mts was renamed to vite.config.mts so the plugin picks it up.
  • nx-plugin-integration build/serve are inferred by @nx/webpack/plugin; options moved into webpack.config.js via NxAppWebpackPlugin, and the removed composePlugins/withNx/withWeb helpers are gone.
  • The executor-keyed targetDefaults were removed; the name-based lint/test defaults are unchanged.

TypeScript 6

  • tsconfig.base.json pins the TS 5 defaults this repo relies on: strict: false (nx-plugin fails type checks otherwise), esModuleInterop: false (otherwise the published nx-plugin emit changes to require tslib), noUncheckedSideEffectImports: false (the integration app's CSS import), plus ignoreDeprecations: "6.0" for baseUrl/moduleResolution: node. Projects that opted into strict keep it.

Vitest 4 / Vite 8

  • poolOptions.threads.singleThread → maxWorkers: 1 (kept default isolation; isolate: false leaked vi.mock('node:fs') across files and broke cli tests).
  • Removed basic reporter → ['default', { summary: false }].
  • beforeAll/afterAll in the e2e setup now take the suite as the second argument (Vitest 4 requires a destructured first argument).
  • nxViteTsPaths (removed in Nx 24) → native resolve.tsconfigPaths: true.

Small fixes the upgrade required

  • nx-plugin build dependsOn: [{ target, projects: 'dependencies' }] → ["^build"] (old form no longer supported).
  • nx-plugin-integration:test waited for Nx's old dev-server log line, which webpack-cli serve no longer prints; awaitServeStdout is now webpack compiled.
  • nx-plugin target generator spec wrote a target as a bare string; Nx 24 rejects that when reading project config, so the fixture now uses a { executor } object (same assertion).
  • nx.json: releaseTagPattern → releaseTag.pattern.

Verification

Compared against a clean checkout of main:

  • lint: all 5 projects pass, 0 errors (warning counts unchanged).
  • build: cli, nx-plugin, nx-plugin-integration pass. dist/packages/cli is byte-identical to main; nx-plugin only gains a leading "use strict" (TS 6 alwaysStrict); the webpack app emits the same files (minus the empty assets/.gitkeep).
  • test: cli 74/74, nx-plugin 12/12, nx-plugin-integration:test (serve + dry-run collect) passes. cli-e2e:test is covered by CI.

Known

  • Running the local nx-plugin executor under Node 26 prints a harmless "Failed to load the ES module" warning before falling back.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The inferred @nx/vitest targets ran from the project folder, breaking the
workspace-relative paths the cli and cli-e2e tests rely on. Run them from the
workspace root with --root <project>, matching the removed executor.

Vitest 4 passes the suite as the second argument to beforeAll/afterAll and
requires the first to be destructured.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Remove per-project ignoreDeprecations (inherited from tsconfig.base.json),
the unused types pin, default-valued plugin options, affected.legacy, the
nx-plugin test override the jest plugin already infers, ignore-file
additions, and a test artifact that was committed by mistake. Restore the
original lint/test targetDefaults.
@github-actions

Copy link
Copy Markdown

❗❗❗ report generated by this PR ❗❗❗

☕ Order Coffee ☕

Date/Time: 2026-10-23 20:23

Step Name Gather Mode Performance Accessibility Best Practices Seo
🧭 Navigate to coffee cart navigation 98 93 100 83
☕ Select coffee timespan 17/17 - 8/8 -
✔ Coffee selected snapshot Ø 1/1 16/18 4/4 3/5
🛒 Checkout order timespan 19/19 - 8/8 -
🧾 Order checked out snapshot Ø 1/1 18/19 4/4 3/5
💌 Submit order timespan 18/18 - 8/8 -
📧 Order submitted snapshot Ø 1/1 20/22 4/4 3/5
🧭 Navigate to github navigation 96 92 100 83

@github-actions

Copy link
Copy Markdown

☕ Order Coffee ☕

Date/Time: 2026-10-23 20:23

Step Name Gather Mode Performance Accessibility Best Practices Seo Agentic Browsing
🧭 Navigate to coffee cart navigation 97 93 100 83 50
☕ Select coffee timespan 17/17 - 8/8 - -
✔ Coffee selected snapshot Ø 1/1 16/18 4/4 3/5 1/3
🛒 Checkout order timespan 19/19 - 8/8 - -
🧾 Order checked out snapshot Ø 1/1 19/20 4/4 3/5 1/3
💌 Submit order timespan 18/18 - 8/8 - -
📧 Order submitted snapshot Ø 1/1 20/22 4/4 3/5 1/3
🧭 Navigate to github navigation 92 92 100 83 50

@ChristopherPHolder
ChristopherPHolder merged commit a609b87 into main Oct 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant