Skip to content

Commit 762206f

Browse files
authored
feat!: update to the latest nx (#215)
## PR Checklist Please check if your PR fulfills the following requirements: - [x] The commit message follows our guidelines: CONTRIBUTING.md#commit - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Docs have been added / updated (for bug fixes / features) ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x". --> ``` [ ] Bugfix [x] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Build related changes [ ] CI related changes [ ] Documentation content changes [ ] Other... Please describe: ``` ## What is the current behavior? We support the previous version of Angular (18) Closes: #213 ## What is the new behavior? Migrate to the latest Angular and Nx. ## Does this PR introduce a breaking change? ``` [x] Yes [ ] No ``` BREAKING CHANGES: Only support Angular version 19
1 parent bd515ee commit 762206f

File tree

12 files changed

+7736
-3544
lines changed

12 files changed

+7736
-3544
lines changed

.github/actions/setup/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runs:
3232

3333
- uses: pnpm/action-setup@v2
3434
with:
35-
version: 9
35+
version: 9.5
3636

3737
- name: Use Node.js
3838
uses: actions/setup-node@v4

.github/workflows/ci.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,16 @@ jobs:
3535
with:
3636
fetch-depth: 0
3737

38-
# Connect your workspace on nx.app and uncomment this to enable task distribution.
39-
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
40-
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
41-
4238
- uses: pnpm/action-setup@v2
4339
with:
44-
version: 9
40+
version: 9.5
4541
# Cache node_modules
4642
- uses: actions/setup-node@v4
4743
with:
4844
node-version: 20
45+
# Connect your workspace on nx.app and uncomment this to enable task distribution.
46+
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
47+
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="4 linux-medium-js"
4948

5049
- uses: nrwl/nx-set-shas@v4
5150

@@ -96,8 +95,7 @@ jobs:
9695
- name: Run NX Commands
9796
run: |
9897
pnpm exec nx-cloud record -- nx format:check
99-
pnpm exec nx affected -t lint test build
100-
pnpm exec nx affected -t e2e-ci --parallel=1
98+
pnpm exec nx affected -t lint test build e2e-ci
10199
102100
sonarcloud:
103101
name: SonarCloud

jest.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getJestProjects } from '@nx/jest';
1+
import { getJestProjectsAsync } from '@nx/jest';
22

3-
export default {
4-
projects: getJestProjects(),
5-
};
3+
export default async () => ({
4+
projects: await getJestProjectsAsync(),
5+
});

nx.json

+15-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
"cache": true,
3838
"dependsOn": ["^build"],
3939
"inputs": ["production", "^production"]
40+
},
41+
"e2e-ci--**/*": {
42+
"dependsOn": ["^^build", "^build:production"]
4043
}
4144
},
4245
"workspaceLayout": { "appsDir": "e2e", "libsDir": "packages" },
@@ -63,7 +66,18 @@
6366
"ciTargetName": "e2e-ci"
6467
}
6568
},
66-
{ "plugin": "@nx/eslint/plugin", "options": { "targetName": "lint" } }
69+
{
70+
"plugin": "@nx/eslint/plugin",
71+
"options": {
72+
"targetName": "lint"
73+
}
74+
},
75+
{
76+
"plugin": "@nx/jest/plugin",
77+
"options": {
78+
"targetName": "test"
79+
}
80+
}
6781
],
6882
"nxCloudAccessToken": "OTNjMDE5MjItZjQ3Mi00NTM0LTgxNjYtODBjY2EyMTgzYzhlfHJlYWQtd3JpdGU=",
6983
"defaultBase": "main"

package.json

+43-42
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"clean": "rimraf dist coverage reports",
1010
"configure-sonar-report-paths": "node tools/scripts/configure-sonar-report-paths.mjs",
1111
"delete-path-alias": "node tools/scripts/delete-path-alias.mjs",
12-
"e2e": "nx run-many --target=e2e-ci --parallel=1",
12+
"e2e": "nx run-many --target=e2e --parallel=1",
1313
"format": "pnpm run nx format:write",
1414
"lint": "nx run-many --target=lint --max-warnings=0",
1515
"nx": "nx",
@@ -26,15 +26,16 @@
2626
"node": "20",
2727
"pnpm": "9.5.0"
2828
},
29+
"packageManager": "[email protected]",
2930
"dependencies": {
30-
"@angular/animations": "18.0.0",
31-
"@angular/common": "18.0.0",
32-
"@angular/compiler": "18.0.0",
33-
"@angular/core": "18.0.0",
34-
"@angular/forms": "18.0.0",
35-
"@angular/platform-browser": "18.0.0",
36-
"@angular/platform-browser-dynamic": "18.0.0",
37-
"@angular/router": "18.0.0",
31+
"@angular/animations": "19.0.0",
32+
"@angular/common": "19.0.0",
33+
"@angular/compiler": "19.0.0",
34+
"@angular/core": "19.0.0",
35+
"@angular/forms": "19.0.0",
36+
"@angular/platform-browser": "19.0.0",
37+
"@angular/platform-browser-dynamic": "19.0.0",
38+
"@angular/router": "19.0.0",
3839
"@docusaurus/core": "3.3.2",
3940
"@docusaurus/preset-classic": "3.3.2",
4041
"@mdx-js/react": "^3.0.1",
@@ -48,40 +49,40 @@
4849
"zone.js": "0.14.6"
4950
},
5051
"devDependencies": {
51-
"@angular-devkit/build-angular": "18.0.1",
52-
"@angular-devkit/core": "18.0.1",
53-
"@angular-devkit/schematics": "18.0.1",
54-
"@angular-eslint/eslint-plugin": "18.1.0",
55-
"@angular-eslint/eslint-plugin-template": "18.1.0",
56-
"@angular-eslint/template-parser": "18.1.0",
57-
"@angular/cli": "~18.0.0",
58-
"@angular/compiler-cli": "18.0.0",
59-
"@angular/language-service": "18.0.0",
60-
"@commitlint/cli": "17.3.0",
61-
"@commitlint/config-conventional": "17.3.0",
52+
"@angular-devkit/build-angular": "19.0.2",
53+
"@angular-devkit/core": "19.0.2",
54+
"@angular-devkit/schematics": "19.0.2",
55+
"@angular-eslint/eslint-plugin": "18.4.2",
56+
"@angular-eslint/eslint-plugin-template": "18.4.2",
57+
"@angular-eslint/template-parser": "18.4.2",
58+
"@angular/cli": "19.0.2",
59+
"@angular/compiler-cli": "19.0.0",
60+
"@angular/language-service": "19.0.0",
61+
"@commitlint/cli": "19.0.1",
62+
"@commitlint/config-conventional": "19.0.0",
6263
"@docusaurus/module-type-aliases": "3.3.2",
6364
"@docusaurus/types": "3.0.0",
64-
"@jscutlery/semver": "^5.2.0",
65-
"@nx/angular": "19.4.3",
66-
"@nx/cypress": "19.4.3",
67-
"@nx/devkit": "19.4.3",
68-
"@nx/eslint": "19.4.3",
69-
"@nx/eslint-plugin": "19.4.3",
70-
"@nx/jest": "19.4.3",
71-
"@nx/js": "19.4.3",
72-
"@nx/web": "19.4.3",
73-
"@nx/workspace": "19.4.3",
74-
"@schematics/angular": "18.0.1",
65+
"@jscutlery/semver": "^5.3.1",
66+
"@nx/angular": "20.1.3",
67+
"@nx/cypress": "20.1.3",
68+
"@nx/devkit": "20.1.3",
69+
"@nx/eslint": "20.1.3",
70+
"@nx/eslint-plugin": "20.1.3",
71+
"@nx/jest": "20.1.3",
72+
"@nx/js": "20.1.3",
73+
"@nx/web": "20.1.3",
74+
"@nx/workspace": "20.1.3",
75+
"@schematics/angular": "19.0.2",
7576
"@swc-node/register": "1.9.2",
7677
"@swc/core": "1.5.7",
7778
"@swc/helpers": "0.5.12",
7879
"@tsconfig/docusaurus": "^1.0.7",
7980
"@types/copy": "0.3.2",
80-
"@types/jest": "29.4.4",
81+
"@types/jest": "29.5.14",
8182
"@types/node": "18.16.9",
82-
"@typescript-eslint/eslint-plugin": "7.9.0",
83-
"@typescript-eslint/parser": "7.9.0",
84-
"@typescript-eslint/utils": "^8.0.0-alpha.28",
83+
"@typescript-eslint/eslint-plugin": "7.18.0",
84+
"@typescript-eslint/parser": "7.18.0",
85+
"@typescript-eslint/utils": "7.18.0",
8586
"autoprefixer": "^10.4.0",
8687
"copy": "0.3.2",
8788
"cypress": "13.13.0",
@@ -94,12 +95,12 @@
9495
"eslint-plugin-sonarjs": "0.17.0",
9596
"glob": "8.0.3",
9697
"husky": "8.0.2",
97-
"jest": "29.4.3",
98-
"jest-environment-jsdom": "29.4.3",
99-
"jest-preset-angular": "14.1.0",
100-
"ng-packagr": "18.0.0",
101-
"ngx-deploy-npm": "^7.1.0",
102-
"nx": "19.4.3",
98+
"jest": "29.7.0",
99+
"jest-environment-jsdom": "29.7.0",
100+
"jest-preset-angular": "14.3.3",
101+
"ng-packagr": "18.2.1",
102+
"ngx-deploy-npm": "^8.0.0",
103+
"nx": "20.1.3",
103104
"postcss": "8.4.18",
104105
"postcss-import": "14.1.0",
105106
"postcss-preset-env": "7.5.0",
@@ -109,6 +110,6 @@
109110
"rimraf": "3.0.2",
110111
"ts-jest": "29.1.0",
111112
"ts-node": "10.9.1",
112-
"typescript": "5.4.5"
113+
"typescript": "5.5.4"
113114
}
114115
}

packages/examples/lumberjack-app/project.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{
3737
"type": "anyComponentStyle",
3838
"maximumWarning": "2kb",
39-
"maximumError": "4kb"
39+
"maximumError": "15kb"
4040
}
4141
],
4242
"outputHashing": "all"
@@ -73,21 +73,20 @@
7373
"buildTarget": "examples-lumberjack-app:build"
7474
}
7575
},
76-
"lint": {
77-
"executor": "@nx/eslint:lint"
78-
},
7976
"test": {
80-
"executor": "@nx/jest:jest",
81-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
8277
"options": {
83-
"jestConfig": "packages/examples/lumberjack-app/jest.config.ts",
78+
"passWithNoTests": true,
8479
"reporters": ["default", "github-actions"]
8580
},
8681
"configurations": {
82+
"ci": {
83+
"ci": true,
84+
"coverage": true
85+
},
8786
"coverage": {
88-
"codeCoverage": true,
8987
"ci": true,
90-
"coverageReporters": ["lcovonly", "text-summary"]
88+
"coverageReporters": ["lcovonly", "text-summary"],
89+
"coverage": true
9190
}
9291
}
9392
},

packages/examples/lumberjack-app/src/app/app.component.ts

-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import { ForestService } from './forest.service';
66
import { NxWelcomeComponent } from './nx-welcome.component';
77

88
@Component({
9-
standalone: true,
109
imports: [NxWelcomeComponent],
11-
1210
selector: 'app-root',
1311
templateUrl: './app.component.html',
1412
styleUrls: ['./app.component.scss'],

packages/internal/console-driver/test-util/project.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@
77
"tags": ["scope:internal", "type:test-util"],
88
"targets": {
99
"test": {
10-
"executor": "@nx/jest:jest",
11-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
1210
"options": {
13-
"jestConfig": "packages/internal/console-driver/test-util/jest.config.ts",
11+
"passWithNoTests": true,
1412
"reporters": ["default", "github-actions"]
1513
},
1614
"configurations": {
15+
"ci": {
16+
"ci": true,
17+
"coverage": true
18+
},
1719
"coverage": {
18-
"codeCoverage": true,
1920
"ci": true,
20-
"coverageReporters": ["lcovonly", "text-summary"]
21+
"coverageReporters": ["lcovonly", "text-summary"],
22+
"coverage": true
2123
}
2224
}
2325
},
2426
"lint": {
25-
"executor": "@nx/eslint:lint",
2627
"configurations": {
2728
"report": {
2829
"format": "json",
29-
"force": true,
30-
"outputFile": "reports/packages/internal/console-driver/test-util/lint/report.json"
30+
"output-file": "reports/packages/internal/console-driver/test-util/lint/report.json"
3131
}
3232
}
3333
}

packages/internal/test-util/project.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@
77
"tags": ["scope:internal", "type:test-util"],
88
"targets": {
99
"test": {
10-
"executor": "@nx/jest:jest",
11-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
1210
"options": {
13-
"jestConfig": "packages/internal/test-util/jest.config.ts",
11+
"passWithNoTests": true,
1412
"reporters": ["default", "github-actions"]
1513
},
1614
"configurations": {
15+
"ci": {
16+
"ci": true,
17+
"coverage": true
18+
},
1719
"coverage": {
18-
"codeCoverage": true,
1920
"ci": true,
20-
"coverageReporters": ["lcovonly", "text-summary"]
21+
"coverageReporters": ["lcovonly", "text-summary"],
22+
"coverage": true
2123
}
2224
}
2325
},
2426
"lint": {
25-
"executor": "@nx/eslint:lint",
2627
"configurations": {
2728
"report": {
2829
"format": "json",
29-
"force": true,
30-
"outputFile": "reports/packages/internal/test-util/lint/report.json"
30+
"output-file": "reports/packages/internal/test-util/lint/report.json"
3131
}
3232
}
3333
}

packages/ngworker/lumberjack/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngworker/lumberjack",
3-
"version": "18.0.0",
3+
"version": "19.0.0",
44
"description": "Lumberjack is a versatile Angular logging library, specifically designed to be extended and customized",
55
"homepage": "https://ngworker.github.io/lumberjack/",
66
"license": "MIT",
@@ -37,8 +37,8 @@
3737
"url": "https://github.com/ngworker/lumberjack/issues?q=is:issue+is:open+"
3838
},
3939
"peerDependencies": {
40-
"@angular/core": "^18.0.0",
41-
"@angular/common": "^18.0.0",
40+
"@angular/core": "^19.0.0",
41+
"@angular/common": "^19.0.0",
4242
"rxjs": ">= 7.8.1 < 8.0.0"
4343
},
4444
"peerDependenciesMeta": {

0 commit comments

Comments
 (0)