Skip to content

Commit 54c2233

Browse files
authored
chore!: migrate to Angular 14 (#276)
# Bug fixes - Fixes #272 by building the package using Angular 14. Standalone components and applications are now fully supported, including in component tests. BREAKING CHANGE: - Require Angular 14.0 - Require `@ngrx/component-store` 14.0 - Require RxJS 7.4 - Require TypeScript 4.6
1 parent 5e86578 commit 54c2233

21 files changed

+4019
-4231
lines changed

.eslintrc.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
{
22
"root": true,
33
"ignorePatterns": ["**/*"],
4-
"parser": "@typescript-eslint/parser",
5-
"parserOptions": {
6-
"ecmaVersion": 2019,
7-
"project": "./tsconfig.base.json",
8-
"sourceType": "module"
9-
},
10-
"plugins": ["@nrwl/nx", "ngrx"],
4+
"plugins": ["@nrwl/nx", "@ngrx"],
115
"overrides": [
126
{
137
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
@@ -34,7 +28,7 @@
3428
},
3529
{
3630
"files": ["*.ts"],
37-
"extends": ["plugin:ngrx/component-store-strict"]
31+
"extends": ["plugin:@ngrx/component-store-strict"]
3832
},
3933
{
4034
"files": ["*.js", "*.jsx"],

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
!.vscode/extensions.json
2626

2727
# misc
28-
/.angular/cache
28+
.angular/
2929
/.sass-cache
3030
/connect.lock
3131
/coverage

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.20.1
1+
16.18.0

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ An Angular Router-connecting NgRx component store.
88

99
Required peer dependencies:
1010

11-
- Angular >=12.2
12-
- NgRx Component Store >=12.0
13-
- RxJS >=7.2
14-
- TypeScript >=4.3
11+
- Angular >=14.0
12+
- NgRx Component Store >=14.0
13+
- RxJS >=7.4
14+
- TypeScript >=4.6
1515

1616
Published with partial Ivy compilation.
1717

decorate-angular-cli.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,13 @@ function symlinkNgCLItoNxCLI() {
6868

6969
try {
7070
symlinkNgCLItoNxCLI();
71-
require('@nrwl/cli/lib/decorate-cli').decorateCli();
71+
require('nx/src/adapter/decorate-cli').decorateCli();
7272
output.log({
7373
title: 'Angular CLI has been decorated to enable computation caching.',
7474
});
7575
} catch (e) {
7676
output.error({
77-
title:
78-
'Decoration of the Angular CLI did not complete successfully:' +
79-
e.message,
77+
title: 'Decoration of the Angular CLI did not complete successfully',
78+
bodyLines: [e.message],
8079
});
8180
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { getJestProjects } = require('@nrwl/jest');
22

3-
module.exports = {
3+
export default {
44
projects: getJestProjects(),
55
};

jest.preset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const nxPreset = require('@nrwl/jest/preset');
1+
const nxPreset = require('@nrwl/jest/preset').default;
22

33
module.exports = { ...nxPreset };

nx.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"extends": "@nrwl/workspace/presets/npm.json",
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3+
"extends": "nx/presets/npm.json",
34
"npmScope": "ngworker",
45
"affected": {
56
"defaultBase": "main"
67
},
78
"cli": {
8-
"defaultCollection": "@nrwl/angular",
99
"packageManager": "yarn"
1010
},
1111
"implicitDependencies": {
@@ -17,19 +17,16 @@
1717
},
1818
"tasksRunnerOptions": {
1919
"default": {
20-
"runner": "@nrwl/workspace/tasks-runners/default",
20+
"runner": "nx/tasks-runners/default",
2121
"options": {
2222
"cacheableOperations": ["build", "lint", "test", "e2e"]
2323
}
2424
}
2525
},
26-
"targetDependencies": {
27-
"build": [
28-
{
29-
"target": "build",
30-
"projects": "dependencies"
31-
}
32-
]
26+
"targetDefaults": {
27+
"build": {
28+
"dependsOn": ["^build"]
29+
}
3330
},
3431
"generators": {
3532
"@nrwl/angular:application": {
@@ -39,7 +36,6 @@
3936
"e2eTestRunner": "cypress"
4037
},
4138
"@nrwl/angular:library": {
42-
"style": "css",
4339
"linter": "eslint",
4440
"unitTestRunner": "jest"
4541
},

package.json

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,70 @@
22
"name": "workspace",
33
"private": true,
44
"scripts": {
5-
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main",
5+
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2020 browser module main",
66
"build": "nx run-many --target=build --all",
77
"ci": "yarn lint && yarn test && yarn build",
88
"lint": "nx workspace-lint && nx run-many --target=lint --all --max-warnings=0",
99
"nx": "nx",
1010
"test": "nx run-many --target=test --all"
1111
},
1212
"engines": {
13-
"node": "14.20.1",
13+
"node": "16.18.0",
1414
"yarn": "1.22.19"
1515
},
1616
"volta": {
17-
"node": "14.20.1",
17+
"node": "16.18.0",
1818
"yarn": "1.22.19"
1919
},
2020
"dependencies": {
21-
"@angular/common": "12.2.0",
22-
"@angular/compiler": "12.2.0",
23-
"@angular/core": "12.2.0",
24-
"@angular/platform-browser": "12.2.0",
25-
"@angular/platform-browser-dynamic": "12.2.0",
26-
"@angular/router": "12.2.0",
27-
"@ngrx/component-store": "12.0.0",
28-
"@ngrx/router-store": "12.0.0",
29-
"@ngrx/store": "12.0.0",
30-
"@nrwl/angular": "13.1.4",
31-
"rxjs": "7.2.0",
21+
"@angular/common": "14.0.7",
22+
"@angular/compiler": "14.0.7",
23+
"@angular/core": "14.0.7",
24+
"@angular/platform-browser": "14.0.7",
25+
"@angular/platform-browser-dynamic": "14.0.7",
26+
"@angular/router": "14.0.7",
27+
"@ngrx/component-store": "14.0.2",
28+
"@ngrx/router-store": "14.0.2",
29+
"@ngrx/store": "14.0.2",
30+
"@nrwl/angular": "14.4.3",
31+
"rxjs": "7.4.0",
3232
"tslib": "2.3.1",
33-
"zone.js": "0.11.4"
33+
"zone.js": "0.11.8"
3434
},
3535
"devDependencies": {
36-
"@angular-devkit/build-angular": "12.2.0",
37-
"@angular-eslint/eslint-plugin": "12.3.0",
38-
"@angular-eslint/eslint-plugin-template": "12.3.0",
39-
"@angular-eslint/template-parser": "12.3.0",
40-
"@angular/cli": "12.2.0",
41-
"@angular/compiler-cli": "12.2.0",
42-
"@angular/language-service": "12.2.0",
43-
"@nrwl/cli": "13.1.4",
44-
"@nrwl/cypress": "13.1.4",
45-
"@nrwl/eslint-plugin-nx": "13.1.4",
46-
"@nrwl/jest": "13.1.4",
47-
"@nrwl/linter": "13.1.4",
48-
"@nrwl/tao": "13.1.4",
49-
"@nrwl/workspace": "13.1.4",
50-
"@types/jest": "27.0.2",
51-
"@types/node": "14.14.33",
52-
"@typescript-eslint/eslint-plugin": "4.33.0",
53-
"@typescript-eslint/parser": "4.33.0",
54-
"cypress": "8.7.0",
55-
"eslint": "7.32.0",
36+
"@angular-devkit/build-angular": "14.0.7",
37+
"@angular-eslint/eslint-plugin": "14.0.4",
38+
"@angular-eslint/eslint-plugin-template": "14.0.4",
39+
"@angular-eslint/template-parser": "14.0.4",
40+
"@angular/cli": "14.0.7",
41+
"@angular/compiler-cli": "14.0.7",
42+
"@angular/language-service": "14.0.7",
43+
"@ngrx/eslint-plugin": "14.0.2",
44+
"@nrwl/cli": "14.4.3",
45+
"@nrwl/cypress": "14.4.3",
46+
"@nrwl/eslint-plugin-nx": "14.4.3",
47+
"@nrwl/jest": "14.4.3",
48+
"@nrwl/linter": "14.4.3",
49+
"@nrwl/workspace": "14.4.3",
50+
"@types/jest": "27.4.1",
51+
"@types/node": "16.11.7",
52+
"@typescript-eslint/eslint-plugin": "5.40.1",
53+
"@typescript-eslint/parser": "5.40.1",
54+
"cypress": "9.7.0",
55+
"eslint": "8.15.0",
5656
"eslint-config-prettier": "8.1.0",
57-
"eslint-plugin-ngrx": "^1.46.3",
58-
"jest": "27.2.3",
59-
"jest-preset-angular": "10.0.1",
60-
"ng-packagr": "12.2.7",
57+
"eslint-plugin-cypress": "2.12.1",
58+
"jest": "27.5.1",
59+
"jest-preset-angular": "11.1.2",
60+
"ng-packagr": "14.0.4",
61+
"nx": "14.4.3",
6162
"postcss": "8.4.18",
6263
"postcss-import": "14.1.0",
63-
"postcss-preset-env": "6.7.0",
64+
"postcss-preset-env": "7.5.0",
6465
"postcss-url": "10.1.3",
6566
"prettier": "2.7.1",
66-
"ts-jest": "27.0.5",
67-
"typescript": "4.3.5"
67+
"ts-jest": "27.1.4",
68+
"ts-node": "10.8.2",
69+
"typescript": "4.7.4"
6870
}
6971
}

packages/router-component-store/jest.config.js renamed to packages/router-component-store/jest.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
module.exports = {
1+
/* eslint-disable */
2+
export default {
23
displayName: 'router-component-store',
34
preset: '../../jest.preset.js',
45
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],

0 commit comments

Comments
 (0)