chore(repo): migrate to nx 23.1.0-rc.1#3175
Conversation
|
View your CI Pipeline Execution ↗ for commit 0805ec2
☁️ Nx Cloud last updated this comment at |
…ory (#36272) ## Current Behavior The `23-1-0-set-tsconfig-root-dir-for-ts6` migration skips any tsconfig whose inferred common source directory already equals the tsconfig's own directory, on the assumption that TypeScript 6 infers the same value so no pin is needed. That assumption only holds for the program the config declares. Inference is per-program: a tool that compiles a subset of the config's files re-infers the common directory from that subset alone. Concretely, ts-jest with its `isolatedModules` option builds a program per test file, the common directory collapses to that file's folder, and TypeScript 6 hard-fails with: ``` error TS5011: The common source directory of 'tsconfig.spec.json' is './src/document-links'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout. ``` This is not hypothetical — it broke nx-console's CI on its nx 23.1.0-rc.0 migration (nrwl/nx-console#3175): the `nxls-e2e` and `nx-mcp-e2e` projects' spec tsconfigs include the root-level `jest.config.ts` alongside `src/**`, so their inferred dir equals the config dir and the migration skipped them; every atomized `e2e-ci` jest task then failed with TS5011. Ironically, sibling projects whose include starts at `src/**` were pinned fine — including the root-level `jest.config.ts` is exactly what exempted the broken ones. ## Expected Behavior Every non-composite candidate (no `rootDir`, has an emit-gate option, has input files) gets an explicit `rootDir` pin — the file-derived directory when it differs from the config dir (as before), and `.` when it doesn't (new). The pinned value is exactly what TypeScript 5 inferred for the declared program, so compilation and emit layout are unchanged; single-file programs can no longer re-infer a different root. Composite configs keep the previous behavior (never pinned from files, only shielded from an `extends` base pin) — their `rootDir` defaults to the tsconfig directory in both TS5 and TS6 for any file subset, so they are genuinely safe. Implementation notes: - The `own-dir` analysis kind is gone: the `commonDir == config dir` case now falls through to the normal `write` path (producing `.`), and composite gets its own `composite` kind. The phase-3 shield loop now only processes composite configs, since every non-composite candidate is pinned directly in phase 2. - The migration entry is re-stamped `23.1.0-beta.8` → `23.1.0-rc.1` so workspaces that already migrated to rc.0 run it again on their next `nx migrate`. The writes are idempotent (`rootDir` present → untouched), so re-running over already-pinned workspaces is a no-op. - Added a regression spec modeled on the nx-console shape: a spec tsconfig whose include spans its own directory root (`jest.config.ts` + `src/**`) must come out with `"rootDir": "."`. All 10 specs pass. ## Related Issue(s) Discovered via the coordinated nx 23.1.0-rc.0 migration (nx-console CI failure on nrwl/nx-console#3175; fixed there manually with the same `"rootDir": "."` pins this migration now writes). <!-- polygraph-session-start --> --- [View session information ↗](https://app.trypolygraph.com/orgs/6a061dcb561c062131116eca/sessions/Migrate-nrwl-repos-to-nx-23.1.0-rc.0-b8c94700) <!-- polygraph-session-end -->
ba58b1e to
dba2926
Compare
dba2926 to
5d01557
Compare
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 this failure and determined it is unrelated to the PR's changes. The test hardcodes defaultVersion = '21.3.0', causing a peer dependency conflict when npm install -D @nx/plugin resolves to @nx/[email protected] (which requires nx >= 22) in an [email protected] workspace — a pre-existing infrastructure mismatch. The same test is also failing on master for a separate reason, confirming the breakage predates this PR.
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
5d01557 to
df8f053
Compare
Includes update-23-1-0-remove-removed-typescript-eslint-extension-rules (drops @typescript-eslint/no-extra-semi, removed in typescript-eslint v8).
Includes 23-1-0-set-tsconfig-root-dir-for-ts6 (pins rootDir on project tsconfigs so ts-jest per-file compiles keep working under TypeScript 6).
Applies change-plugin-version-0-1-23 and change-plugin-version-0-1-24 (dev.nx.gradle.project-graph 0.1.22 -> 0.1.24).
- Replace the FlatCompat shim in generate-ui-v2-e2e with the flat-native eslint-plugin-cypress/flat preset - Restore the pre-migration lint scope: the old root .eslintrc.json ignored all files, so projects without their own eslint config were never linted - Disable rules newly enabled by ESLint v9 / typescript-eslint v8 preset defaults that were not enforced before
nx 23.1 widened TargetDefaults values to a union that includes an ordered array of filtered entries. Take the executor from the last array entry that sets one, matching the last-match-wins semantics.
df8f053 to
0805ec2
Compare
…eywords (#36326) ## Current Behavior `nx release changelog` extracts issue references from the commit body with a bare `/(#\d+)/gm` regex, so **every** `#number` in a squashed PR description becomes an issue link in the changelog — including other repos' issue numbers. For example, the [23.1.0 release notes](https://github.com/nrwl/nx/releases/tag/23.1.0) contain: > **rspack:** support @rspack/core@2 and @rsbuild/core@2 (multi-version compliance) (#35682, #35764, #13420, #781) where `#13420` is actually `web-infra-dev/rspack#13420` and `#781` is `privatenumber/tsx#781` — upstream issues discussed in the PR description, rendered as (bogus) `nrwl/nx` issue links. The same release also picked up `nrwl/nx-console#3175`, `react/react#418`, and `web-infra-dev/rspack#2292`, plus noisy same-repo PR mentions that were merely referenced in prose. ## Expected Behavior Issue references are only extracted from the commit body when linked via a GitHub closing keyword (`Fixes #123`, `Closes #123`, `Resolves: #123`, ...) — the same rule GitHub itself uses to auto-link and close issues. Cross-repo forms (`owner/repo#123`), markdown links to other repos, and casual same-repo mentions no longer produce changelog references. Subject-line extraction (the PR number in `(#123)` and inline issue refs) is unchanged. Both regular commits and version plans go through the same `extractReferencesFromCommit` function, so this fixes both paths. ## Related Issue(s) N/A <!-- polygraph-session-start --> --- [View session information ↗](https://app.trypolygraph.com/orgs/6a061dcb561c062131116eca/sessions/Fix-nx-release-changelog-scraping-other-repos-issue-numbers-7967dd62) <!-- polygraph-session-end -->
…eywords (#36326) ## Current Behavior `nx release changelog` extracts issue references from the commit body with a bare `/(#\d+)/gm` regex, so **every** `#number` in a squashed PR description becomes an issue link in the changelog — including other repos' issue numbers. For example, the [23.1.0 release notes](https://github.com/nrwl/nx/releases/tag/23.1.0) contain: > **rspack:** support @rspack/core@2 and @rsbuild/core@2 (multi-version compliance) (#35682, #35764, #13420, #781) where `#13420` is actually `web-infra-dev/rspack#13420` and `#781` is `privatenumber/tsx#781` — upstream issues discussed in the PR description, rendered as (bogus) `nrwl/nx` issue links. The same release also picked up `nrwl/nx-console#3175`, `react/react#418`, and `web-infra-dev/rspack#2292`, plus noisy same-repo PR mentions that were merely referenced in prose. ## Expected Behavior Issue references are only extracted from the commit body when linked via a GitHub closing keyword (`Fixes #123`, `Closes #123`, `Resolves: #123`, ...) — the same rule GitHub itself uses to auto-link and close issues. Cross-repo forms (`owner/repo#123`), markdown links to other repos, and casual same-repo mentions no longer produce changelog references. Subject-line extraction (the PR number in `(#123)` and inline issue refs) is unchanged. Both regular commits and version plans go through the same `extractReferencesFromCommit` function, so this fixes both paths. ## Related Issue(s) N/A <!-- polygraph-session-start --> --- [View session information ↗](https://app.trypolygraph.com/orgs/6a061dcb561c062131116eca/sessions/Fix-nx-release-changelog-scraping-other-repos-issue-numbers-7967dd62) <!-- polygraph-session-end -->
…eywords (#36326) ## Current Behavior `nx release changelog` extracts issue references from the commit body with a bare `/(#\d+)/gm` regex, so **every** `#number` in a squashed PR description becomes an issue link in the changelog — including other repos' issue numbers. For example, the [23.1.0 release notes](https://github.com/nrwl/nx/releases/tag/23.1.0) contain: > **rspack:** support @rspack/core@2 and @rsbuild/core@2 (multi-version compliance) (#35682, #35764, #13420, #781) where `#13420` is actually `web-infra-dev/rspack#13420` and `#781` is `privatenumber/tsx#781` — upstream issues discussed in the PR description, rendered as (bogus) `nrwl/nx` issue links. The same release also picked up `nrwl/nx-console#3175`, `react/react#418`, and `web-infra-dev/rspack#2292`, plus noisy same-repo PR mentions that were merely referenced in prose. ## Expected Behavior Issue references are only extracted from the commit body when linked via a GitHub closing keyword (`Fixes #123`, `Closes #123`, `Resolves: #123`, ...) — the same rule GitHub itself uses to auto-link and close issues. Cross-repo forms (`owner/repo#123`), markdown links to other repos, and casual same-repo mentions no longer produce changelog references. Subject-line extraction (the PR number in `(#123)` and inline issue refs) is unchanged. Both regular commits and version plans go through the same `extractReferencesFromCommit` function, so this fixes both paths. ## Related Issue(s) N/A <!-- polygraph-session-start --> --- [View session information ↗](https://app.trypolygraph.com/orgs/6a061dcb561c062131116eca/sessions/Fix-nx-release-changelog-scraping-other-repos-issue-numbers-7967dd62) <!-- polygraph-session-end --> (cherry picked from commit d7312d2)
Current Behavior
nx-console is on nx 23.1.0-beta.7 (ESLint legacy config, pre-TS6 tsconfig defaults, Gradle project-graph plugin 0.1.22).
Expected Behavior
nx-console is on nx 23.1.0-rc.0. All
nx/@nx/*packages are bumped to exactly 23.1.0-rc.0 (Yarn Berry lockfile updated).Migrations applied (one
nx migrate --run-migrationspass, one commit each):update-23-1-0-convert-to-flat-config— ESLint 8→9 flat config; removed the typescript-eslint-v8-removed@typescript-eslint/no-extra-semirule23-1-0-add-ignore-deprecations-for-ts6—"ignoreDeprecations": "6.0"for TypeScript 6change-plugin-version-0-1-23/change-plugin-version-0-1-24— dev.nx.gradle.project-graph 0.1.22 → 0.1.24set-ts-jest-isolated-modules— no changes neededAI migration prompts applied:
convert-to-flat-config— converted the eslint-plugin-cypress FlatCompat shim to a flat-native import, kept the pre-migration lint scope (projects without their own eslint config stay ignored), and disabled the rules newly enabled by ESLint v9 / typescript-eslint v8 presets (@typescript-eslint/no-unused-expressions,no-constant-binary-expression,no-unused-private-class-members,prefer-const) with commentsmigrate-ban-types-rule— verified no-op: no flat config references@typescript-eslint/ban-typesverify-typecheck— fixedlibs/shared/json-schemafor the newTargetDefaultValueunion in nx 23.1 (atargetDefaultsentry can now be an ordered array of filtered entries; the schema builder takes the executor from the last entry that sets one, matching nx's last-match-wins semantics)Verification (all
--skip-nx-cache): typecheck 64/64, lint 59/59; project graph resolves.Related Issue(s)
Part of the coordinated nx 23.1.0-rc.1 migration across nrwl repos (see linked Polygraph session).
View session information ↗