Skip to content

Commit bc68b7e

Browse files
authored
feat: add support to nx v21 (#701)
1 parent 68e22cd commit bc68b7e

File tree

8 files changed

+780
-1156
lines changed

8 files changed

+780
-1156
lines changed

.github/workflows/backwards-compatibility-test.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Backwards Compatibility Test
2+
description: 'Test backwards compatibility with different Nx versions and Node versions. For more information about Nx and Node versions, see https://nx.dev/reference/core-api/workspace/documents/nx-nodejs-typescript-version-matrix'
23

34
on: workflow_call
45

@@ -8,18 +9,25 @@ jobs:
89
matrix:
910
include:
1011
# '' means current workspace version
11-
- nx-version: ''
12+
- nx-version: '' # 21.x
1213
node-version: 22
1314
- nx-version: ''
1415
node-version: 20
1516

16-
- nx-version: 'previous'
17+
- nx-version: 'previous' # 20.x
1718
node-version: 22
1819
- nx-version: 'previous'
1920
node-version: 20
2021
- nx-version: 'previous'
2122
node-version: 18
2223

24+
- nx-version: '19.8.14'
25+
node-version: 22
26+
- nx-version: '19.8.14'
27+
node-version: 20
28+
- nx-version: '19.8.14'
29+
node-version: 18
30+
2331
- nx-version: '18.3.5'
2432
node-version: 20
2533
- nx-version: '18.3.5'
@@ -34,8 +42,6 @@ jobs:
3442
node-version: 20
3543
- nx-version: '16.10.0'
3644
node-version: 18
37-
- nx-version: '16.10.0'
38-
node-version: 16 # This node's version is deprecated
3945

4046
name: Backwards Compatibility Test
4147
uses: ./.github/workflows/smoke-test-nx-workspace.yml

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ reports/*
6161
# End of https://www.toptal.com/developers/gitignore/api/sonarqube
6262

6363
.env
64+
.cursor/rules/nx-rules.mdc
65+
.github/instructions/nx.instructions.md

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,15 @@ For testing: Run through without making any changes. Execute with `--dry-run`, a
239239

240240
## Compatibility overview with Nx
241241

242-
| Version | Nx Workspace Version |
243-
| ------- | ------------------------------------------------------------- |
244-
| v8.3.0 | `^20.0.0 \|\| ^19.0.0 \|\| ^18.0.0 \|\| ^17.0.0 \|\| ^16.0.0` |
245-
| v8.2.0 | `^19.0.0 \|\| ^18.0.0 \|\| ^17.0.0 \|\| ^16.0.0` |
246-
| v8.1.0 | `^18.0.0 \|\| ^17.0.0 \|\| ^16.0.0` |
247-
| v8.0.0 | `^17.0.0 \|\| ^16.0.0` |
248-
| v7.1.0 | `^17.0.0 \|\| ^16.0.0` |
249-
| v7.0.1 | `^16.0.0` |
242+
| Version | Nx Workspace Version |
243+
| ------- | -------------------- |
244+
| v8.5.0 | `>=16.x <21.x` |
245+
| v8.4.0 | `>=16.x <20.x` |
246+
| v8.2.0 | `>=16.x <19.x` |
247+
| v8.1.0 | `>=16.x <18.x` |
248+
| v8.0.0 | `>=16.x <17.x` |
249+
| v7.1.0 | `>=16.x <17.x` |
250+
| v7.0.1 | `16.x` |
250251

251252
## 📁 Configuration File <a name="configuration-file"></a>
252253

migrations.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"migrations": [
3+
{
4+
"version": "21.0.0-beta.8",
5+
"description": "Removes the legacy cache configuration from nx.json",
6+
"implementation": "./src/migrations/update-21-0-0/remove-legacy-cache",
7+
"package": "nx",
8+
"name": "remove-legacy-cache"
9+
},
10+
{
11+
"version": "21.0.0-beta.8",
12+
"description": "Removes the legacy cache configuration from nx.json",
13+
"implementation": "./src/migrations/update-21-0-0/remove-custom-tasks-runner",
14+
"package": "nx",
15+
"name": "remove-custom-tasks-runner"
16+
},
17+
{
18+
"version": "21.0.0-beta.11",
19+
"description": "Updates release version config based on the breaking changes in Nx v21",
20+
"implementation": "./src/migrations/update-21-0-0/release-version-config-changes",
21+
"package": "nx",
22+
"name": "release-version-config-changes"
23+
},
24+
{
25+
"version": "21.0.0-beta.11",
26+
"description": "Updates release changelog config based on the breaking changes in Nx v21",
27+
"implementation": "./src/migrations/update-21-0-0/release-changelog-config-changes",
28+
"package": "nx",
29+
"name": "release-changelog-config-changes"
30+
},
31+
{
32+
"version": "21.1.0-beta.2",
33+
"description": "Adds **/nx-rules.mdc and **/nx.instructions.md to .gitignore if not present",
34+
"implementation": "./src/migrations/update-21-1-0/add-gitignore-entry",
35+
"package": "nx",
36+
"name": "21-1-0-add-ignore-entries-for-nx-rule-files"
37+
},
38+
{
39+
"cli": "nx",
40+
"version": "21.0.0-beta.9",
41+
"description": "Replace usage of `getJestProjects` with `getJestProjectsAsync`.",
42+
"implementation": "./src/migrations/update-21-0-0/replace-getJestProjects-with-getJestProjectsAsync",
43+
"package": "@nx/jest",
44+
"name": "replace-getJestProjects-with-getJestProjectsAsync-v21"
45+
},
46+
{
47+
"version": "21.0.0-beta.10",
48+
"description": "Remove the previously deprecated and unused `tsConfig` option from the `@nx/jest:jest` executor.",
49+
"implementation": "./src/migrations/update-21-0-0/remove-tsconfig-option-from-jest-executor",
50+
"package": "@nx/jest",
51+
"name": "remove-tsconfig-option-from-jest-executor"
52+
}
53+
]
54+
}

nx.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,5 @@
4343
}
4444
}
4545
},
46-
"defaultBase": "main",
47-
"useLegacyCache": true
46+
"defaultBase": "main"
4847
}

0 commit comments

Comments
 (0)