Skip to content

Commit 7aab96e

Browse files
chore: update Nx to v21 (#1082)
Precondition: - push-based/nx-verdaccio#90 This PR includes: - nx migrate latest - run migrations - small fixes for new Nx version in helpers - due to version updates typescript and eslint tests changes. same for lighthouse e2e tests <details> <summary>migrations.json</summary> ```json { "migrations": [ { "version": "20.0.0-beta.7", "description": "Migration for v20.0.0-beta.7", "implementation": "./src/migrations/update-20-0-0/move-use-daemon-process", "package": "nx", "name": "move-use-daemon-process" }, { "version": "20.0.1", "description": "Set `useLegacyCache` to true for migrating workspaces", "implementation": "./src/migrations/update-20-0-1/use-legacy-cache", "x-repair-skip": true, "package": "nx", "name": "use-legacy-cache" }, { "version": "21.0.0-beta.8", "description": "Removes the legacy cache configuration from nx.json", "implementation": "./src/migrations/update-21-0-0/remove-legacy-cache", "package": "nx", "name": "remove-legacy-cache" }, { "version": "21.0.0-beta.8", "description": "Removes the legacy cache configuration from nx.json", "implementation": "./src/migrations/update-21-0-0/remove-custom-tasks-runner", "package": "nx", "name": "remove-custom-tasks-runner" }, { "version": "21.0.0-beta.11", "description": "Updates release version config based on the breaking changes in Nx v21", "implementation": "./src/migrations/update-21-0-0/release-version-config-changes", "package": "nx", "name": "release-version-config-changes" }, { "version": "21.0.0-beta.11", "description": "Updates release changelog config based on the breaking changes in Nx v21", "implementation": "./src/migrations/update-21-0-0/release-changelog-config-changes", "package": "nx", "name": "release-changelog-config-changes" }, { "version": "21.1.0-beta.2", "description": "Adds **/nx-rules.mdc and **/nx.instructions.md to .gitignore if not present", "implementation": "./src/migrations/update-21-1-0/add-gitignore-entry", "package": "nx", "name": "21-1-0-add-ignore-entries-for-nx-rule-files" }, { "version": "20.0.4-beta.0", "description": "Add gitignore entry for temporary vite config files.", "implementation": "./src/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore", "package": "@nx/vite", "name": "update-20-0-4" }, { "version": "20.0.6-beta.0", "description": "Add gitignore entry for temporary vite config files and remove previous incorrect glob.", "implementation": "./src/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore", "package": "@nx/vite", "name": "update-20-0-6" }, { "version": "20.3.0-beta.2", "description": "Add gitignore entry for temporary vitest config files.", "implementation": "./src/migrations/update-20-3-0/add-vitest-temp-files-to-git-ignore", "package": "@nx/vite", "name": "update-20-3-0" }, { "version": "20.5.0-beta.2", "description": "Install jiti as a devDependency to allow vite to parse TS postcss files.", "implementation": "./src/migrations/update-20-5-0/install-jiti", "package": "@nx/vite", "name": "update-20-5-0-install-jiti" }, { "version": "20.5.0-beta.3", "description": "Update resolve.conditions to include defaults that are no longer provided by Vite.", "implementation": "./src/migrations/update-20-5-0/update-resolve-conditions", "package": "@nx/vite", "name": "update-20-5-0-update-resolve-conditions" }, { "version": "20.5.0-beta.3", "description": "Add vite config temporary files to the ESLint configuration ignore patterns if ESLint is used.", "implementation": "./src/migrations/update-20-5-0/eslint-ignore-vite-temp-files", "package": "@nx/vite", "name": "eslint-ignore-vite-temp-files" }, { "cli": "nx", "version": "20.2.0-beta.2", "description": "Update the ModuleFederationConfig import use @nx/module-federation.", "factory": "./src/migrations/update-20-2-0/migrate-mf-imports-to-new-package", "package": "@nx/react", "name": "update-20-2-0-update-module-federation-config-import" }, { "cli": "nx", "version": "20.2.0-beta.2", "description": "Update the withModuleFederation import use @nx/module-federation/webpack.", "factory": "./src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package", "package": "@nx/react", "name": "update-20-2-0-update-with-module-federation-import" }, { "cli": "nx", "version": "20.3.0-beta.2", "description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.", "factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package", "package": "@nx/react", "name": "ensure-nx-module-federation-package" }, { "cli": "nx", "version": "20.4.0-beta.0", "description": "Add NX_MF_DEV_REMOTES to inputs for task hashing when '@nx/webpack:webpack' or '@nx/rspack:rspack' is used for Module Federation.", "factory": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults", "package": "@nx/react", "name": "add-mf-env-var-to-target-defaults" }, { "cli": "nx", "version": "21.0.0-beta.11", "description": "Replaces `classProperties.loose` option with `loose`.", "factory": "./src/migrations/update-21-0-0/update-babel-loose", "package": "@nx/react", "name": "update-21-0-0-update-babel-loose" } ] } ``` </details> --------- Co-authored-by: Matěj Chalk <34691111+matejchalk@users.noreply.github.com>
1 parent aba2ff3 commit 7aab96e

File tree

19 files changed

+16778
-13831
lines changed

19 files changed

+16778
-13831
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,8 @@ Thumbs.db
5151

5252
# Nx workspace cache
5353
.nx
54+
55+
vite.config.*.timestamp*
56+
vitest.config.*.timestamp*
57+
.cursor/rules/nx-rules.mdc
58+
.github/instructions/nx.instructions.md

e2e/nx-plugin-e2e/tests/executor-cli.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
teardownTestFolder,
1919
} from '@code-pushup/test-utils';
2020
import { executeProcess, readJsonFile } from '@code-pushup/utils';
21-
import { INLINE_PLUGIN } from './inline-plugin.js';
21+
import { INLINE_PLUGIN } from '../mocks/inline-plugin.js';
2222

2323
async function addTargetToWorkspace(
2424
tree: Tree,

e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
teardownTestFolder,
1818
} from '@code-pushup/test-utils';
1919
import { executeProcess, readTextFile } from '@code-pushup/utils';
20-
import { INLINE_PLUGIN } from './inline-plugin.js';
20+
import { INLINE_PLUGIN } from '../mocks/inline-plugin.js';
2121

2222
describe('nx-plugin', () => {
2323
let tree: Tree;

e2e/plugin-typescript-e2e/tests/__snapshots__/collect.e2e.test.ts.snap

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,26 @@ exports[`PLUGIN collect report with typescript-plugin NPM package > should run p
5858
"description": "Errors that occur during type checking and type inference",
5959
"details": {
6060
"issues": [
61+
{
62+
"message": "TS2694: Namespace ''./index'' has no exported member 'IOptions'.",
63+
"severity": "error",
64+
"source": {
65+
"file": "node_modules/@types/glob/index.d.ts",
66+
"position": {
67+
"startLine": 29,
68+
},
69+
},
70+
},
71+
{
72+
"message": "TS2724: ''./index'' has no exported member named 'IMinimatch'. Did you mean 'Minimatch'?",
73+
"severity": "error",
74+
"source": {
75+
"file": "node_modules/@types/glob/index.d.ts",
76+
"position": {
77+
"startLine": 74,
78+
},
79+
},
80+
},
6181
{
6282
"message": "TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.",
6383
"severity": "error",
@@ -80,11 +100,11 @@ exports[`PLUGIN collect report with typescript-plugin NPM package > should run p
80100
},
81101
],
82102
},
83-
"displayValue": "2 errors",
103+
"displayValue": "4 errors",
84104
"score": 0,
85105
"slug": "semantic-errors",
86106
"title": "Semantic errors",
87-
"value": 2,
107+
"value": 4,
88108
},
89109
{
90110
"description": "Errors that occur during TypeScript language service operations",

nx.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"e2e": { "dependsOn": ["^build"] },
4444
"lint": {
4545
"inputs": ["default", "{workspaceRoot}/eslint.config.?(c)js"],
46-
"executor": "@nx/linter:eslint",
46+
"executor": "@nx/eslint:lint",
47+
"outputs": ["{options.outputFile}"],
4748
"cache": true,
4849
"options": {
4950
"errorOnUnmatchedPattern": false,
@@ -141,7 +142,8 @@
141142
},
142143
"version": {
143144
"conventionalCommits": true,
144-
"generatorOptions": {
145+
"preserveLocalDependencyProtocols": false,
146+
"versionActionsOptions": {
145147
"skipLockFileUpdate": true
146148
}
147149
},

0 commit comments

Comments
 (0)