Skip to content

Commit a55b46d

Browse files
feat: upgrade to Nx 13.8.x/Angular 13.x (#89)
BREAKING CHANGE: Minimum version of Angular requirement updated BEFORE: The minimum version of Angular is 9.x AFTER: The minimum version of Angular is 13.x
1 parent 8ebcf1b commit a55b46d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6151
-7486
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
!.vscode/extensions.json
2626

2727
# misc
28+
/.angular/cache
2829
/.sass-cache
2930
/connect.lock
3031
/coverage

angular.json

+66-148
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,6 @@
11
{
22
"version": 1,
33
"projects": {
4-
"router": {
5-
"projectType": "library",
6-
"root": "libs/router",
7-
"sourceRoot": "libs/router/src",
8-
"prefix": "reactiveangular",
9-
"architect": {
10-
"build-package": {
11-
"builder": "@nrwl/angular:package",
12-
"options": {
13-
"tsConfig": "libs/router/tsconfig.lib.json",
14-
"project": "libs/router/ng-package.json",
15-
"buildableProjectDepsInPackageJsonType": "dependencies"
16-
},
17-
"configurations": {
18-
"production": {
19-
"tsConfig": "libs/router/tsconfig.lib.prod.json"
20-
}
21-
}
22-
},
23-
"build": {
24-
"builder": "@nrwl/workspace:run-commands",
25-
"options": {
26-
"parallel": false,
27-
"commands": [
28-
{
29-
"command": "ng run router:build-package"
30-
},
31-
{
32-
"command": "yarn tsc -p libs/router/tsconfig.schematics.json"
33-
}
34-
]
35-
},
36-
"configurations": {
37-
"production": {}
38-
}
39-
},
40-
"lint": {
41-
"builder": "@angular-devkit/build-angular:tslint",
42-
"options": {
43-
"tsConfig": [
44-
"libs/router/tsconfig.lib.json",
45-
"libs/router/tsconfig.spec.json"
46-
],
47-
"exclude": ["**/node_modules/**", "!libs/router/**/*"]
48-
}
49-
},
50-
"test": {
51-
"builder": "@nrwl/jest:jest",
52-
"options": {
53-
"jestConfig": "libs/router/jest.config.js",
54-
"setupFile": "libs/router/src/test-setup.ts",
55-
"passWithNoTests": true
56-
},
57-
"outputs": ["coverage/libs/router"]
58-
}
59-
},
60-
"schematics": {}
61-
},
624
"example-app": {
635
"projectType": "application",
646
"schematics": {},
@@ -130,16 +72,6 @@
13072
"browserTarget": "example-app:build"
13173
}
13274
},
133-
"lint": {
134-
"builder": "@angular-devkit/build-angular:tslint",
135-
"options": {
136-
"tsConfig": [
137-
"apps/example-app/tsconfig.app.json",
138-
"apps/example-app/tsconfig.spec.json"
139-
],
140-
"exclude": ["**/node_modules/**", "!apps/example-app/**/*"]
141-
}
142-
},
14375
"test": {
14476
"builder": "@nrwl/jest:jest",
14577
"options": {
@@ -148,7 +80,8 @@
14880
},
14981
"outputs": ["coverage/apps/example-app"]
15082
}
151-
}
83+
},
84+
"tags": []
15285
},
15386
"example-app-e2e": {
15487
"root": "apps/example-app-e2e",
@@ -167,15 +100,10 @@
167100
"devServerTarget": "example-app:serve:production"
168101
}
169102
}
170-
},
171-
"lint": {
172-
"builder": "@angular-devkit/build-angular:tslint",
173-
"options": {
174-
"tsConfig": ["apps/example-app-e2e/tsconfig.e2e.json"],
175-
"exclude": ["**/node_modules/**", "!apps/example-app-e2e/**/*"]
176-
}
177103
}
178-
}
104+
},
105+
"tags": [],
106+
"implicitDependencies": ["example-app"]
179107
},
180108
"recursive-routes": {
181109
"projectType": "application",
@@ -248,16 +176,6 @@
248176
"browserTarget": "recursive-routes:build"
249177
}
250178
},
251-
"lint": {
252-
"builder": "@angular-devkit/build-angular:tslint",
253-
"options": {
254-
"tsConfig": [
255-
"apps/recursive-routes/tsconfig.app.json",
256-
"apps/recursive-routes/tsconfig.spec.json"
257-
],
258-
"exclude": ["**/node_modules/**", "!apps/recursive-routes/**/*"]
259-
}
260-
},
261179
"test": {
262180
"builder": "@nrwl/jest:jest",
263181
"options": {
@@ -266,7 +184,8 @@
266184
},
267185
"outputs": ["coverage/apps/recursive-routes"]
268186
}
269-
}
187+
},
188+
"tags": []
270189
},
271190
"recursive-routes-e2e": {
272191
"root": "apps/recursive-routes-e2e",
@@ -285,15 +204,10 @@
285204
"devServerTarget": "recursive-routes:serve:production"
286205
}
287206
}
288-
},
289-
"lint": {
290-
"builder": "@angular-devkit/build-angular:tslint",
291-
"options": {
292-
"tsConfig": ["apps/recursive-routes-e2e/tsconfig.e2e.json"],
293-
"exclude": ["**/node_modules/**", "!apps/recursive-routes-e2e/**/*"]
294-
}
295207
}
296-
}
208+
},
209+
"tags": [],
210+
"implicitDependencies": ["recursive-routes"]
297211
},
298212
"responsive-app": {
299213
"projectType": "application",
@@ -366,16 +280,6 @@
366280
"browserTarget": "responsive-app:build"
367281
}
368282
},
369-
"lint": {
370-
"builder": "@angular-devkit/build-angular:tslint",
371-
"options": {
372-
"tsConfig": [
373-
"apps/responsive-app/tsconfig.app.json",
374-
"apps/responsive-app/tsconfig.spec.json"
375-
],
376-
"exclude": ["**/node_modules/**", "!apps/responsive-app/**/*"]
377-
}
378-
},
379283
"test": {
380284
"builder": "@nrwl/jest:jest",
381285
"options": {
@@ -384,7 +288,8 @@
384288
},
385289
"outputs": ["coverage/apps/responsive-app"]
386290
}
387-
}
291+
},
292+
"tags": []
388293
},
389294
"responsive-app-e2e": {
390295
"root": "apps/responsive-app-e2e",
@@ -403,15 +308,10 @@
403308
"devServerTarget": "responsive-app:serve:production"
404309
}
405310
}
406-
},
407-
"lint": {
408-
"builder": "@angular-devkit/build-angular:tslint",
409-
"options": {
410-
"tsConfig": ["apps/responsive-app-e2e/tsconfig.e2e.json"],
411-
"exclude": ["**/node_modules/**", "!apps/responsive-app-e2e/**/*"]
412-
}
413311
}
414-
}
312+
},
313+
"tags": [],
314+
"implicitDependencies": ["responsive-app"]
415315
},
416316
"route-restrictions": {
417317
"projectType": "application",
@@ -484,16 +384,6 @@
484384
"browserTarget": "route-restrictions:build"
485385
}
486386
},
487-
"lint": {
488-
"builder": "@angular-devkit/build-angular:tslint",
489-
"options": {
490-
"tsConfig": [
491-
"apps/route-restrictions/tsconfig.app.json",
492-
"apps/route-restrictions/tsconfig.spec.json"
493-
],
494-
"exclude": ["**/node_modules/**", "!apps/route-restrictions/**/*"]
495-
}
496-
},
497387
"test": {
498388
"builder": "@nrwl/jest:jest",
499389
"options": {
@@ -502,7 +392,8 @@
502392
},
503393
"outputs": ["coverage/apps/route-restrictions"]
504394
}
505-
}
395+
},
396+
"tags": []
506397
},
507398
"route-restrictions-e2e": {
508399
"root": "apps/route-restrictions-e2e",
@@ -521,32 +412,59 @@
521412
"devServerTarget": "route-restrictions:serve:production"
522413
}
523414
}
415+
}
416+
},
417+
"tags": [],
418+
"implicitDependencies": ["route-restrictions"]
419+
},
420+
"router": {
421+
"projectType": "library",
422+
"root": "libs/router",
423+
"sourceRoot": "libs/router/src",
424+
"prefix": "reactiveangular",
425+
"architect": {
426+
"build-package": {
427+
"builder": "@nrwl/angular:package",
428+
"options": {
429+
"tsConfig": "libs/router/tsconfig.lib.json",
430+
"project": "libs/router/ng-package.json",
431+
"buildableProjectDepsInPackageJsonType": "dependencies"
432+
},
433+
"configurations": {
434+
"production": {
435+
"tsConfig": "libs/router/tsconfig.lib.prod.json"
436+
}
437+
}
524438
},
525-
"lint": {
526-
"builder": "@angular-devkit/build-angular:tslint",
439+
"build": {
440+
"builder": "@nrwl/workspace:run-commands",
527441
"options": {
528-
"tsConfig": ["apps/route-restrictions-e2e/tsconfig.e2e.json"],
529-
"exclude": [
530-
"**/node_modules/**",
531-
"!apps/route-restrictions-e2e/**/*"
442+
"parallel": false,
443+
"commands": [
444+
{
445+
"command": "ng run router:build-package"
446+
},
447+
{
448+
"command": "yarn tsc -p libs/router/tsconfig.schematics.json"
449+
}
532450
]
451+
},
452+
"configurations": {
453+
"production": {}
533454
}
455+
},
456+
"test": {
457+
"builder": "@nrwl/jest:jest",
458+
"options": {
459+
"jestConfig": "libs/router/jest.config.js",
460+
"setupFile": "libs/router/src/test-setup.ts",
461+
"passWithNoTests": true
462+
},
463+
"outputs": ["coverage/libs/router"]
534464
}
535-
}
536-
}
537-
},
538-
"cli": {
539-
"defaultCollection": "@nrwl/angular",
540-
"analytics": false
541-
},
542-
"schematics": {
543-
"@nrwl/angular:application": {
544-
"unitTestRunner": "jest",
545-
"e2eTestRunner": "cypress"
546-
},
547-
"@nrwl/angular:library": {
548-
"unitTestRunner": "jest"
465+
},
466+
"schematics": {},
467+
"tags": []
549468
}
550-
},
551-
"defaultProject": "router"
469+
}
552470
}

apps/example-app-e2e/src/integration/round-trip.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ context('Full round trip', () => {
1616

1717
afterEach(() => {
1818
(cy as any).saveLocalStorage();
19+
// cy.clearLocalStorage('books_app');
1920
});
2021

2122
after(() => {
@@ -79,7 +80,7 @@ context('Full round trip', () => {
7980

8081
// TODO: uncomment once Applitools work properly
8182
// (cy as any).eyesCheckWindow('is possible to show the collection');
82-
cy.get('bc-book-preview').its('length').should('be', 1);
83+
cy.get('bc-book-preview').its('length').should('be.eq', 1);
8384
});
8485

8586
it('is possible to sign out', () => {

apps/example-app-e2e/src/support/commands.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ Cypress.Commands.add('login', (email, password) => {
3535

3636
let LOCAL_STORAGE_MEMORY: any = {};
3737

38-
Cypress.Commands.add('saveLocalStorage', () => {
38+
Cypress.Commands.add('saveLocalStorage' as any, () => {
3939
Object.keys(localStorage).forEach((key) => {
4040
LOCAL_STORAGE_MEMORY[key] = localStorage[key];
4141
});
4242
});
4343

44-
Cypress.Commands.add('restoreLocalStorage', () => {
44+
Cypress.Commands.add('restoreLocalStorage' as any, () => {
4545
Object.keys(LOCAL_STORAGE_MEMORY).forEach((key) => {
4646
localStorage.setItem(key, LOCAL_STORAGE_MEMORY[key]);
4747
});

apps/example-app/browserslist renamed to apps/example-app/.browserslistrc

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
# For additional information regarding the format and rule options, please see:
33
# https://github.com/browserslist/browserslist#queries
44

5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
58
# You can see what browsers were selected by your queries by running:
69
# npx browserslist
710

8-
> 0.5%
9-
last 2 versions
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
1016
Firefox ESR
11-
not dead
12-
not IE 9-11 # For IE 9-11 support, remove 'not'.

apps/example-app/jest.config.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
module.exports = {
22
preset: '../../jest.preset.js',
33
coverageDirectory: '../../coverage/apps/example-app',
4-
snapshotSerializers: [
5-
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
6-
'jest-preset-angular/build/AngularSnapshotSerializer.js',
7-
'jest-preset-angular/build/HTMLCommentSerializer.js',
8-
],
4+
95
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
10-
globals: { 'ts-jest': { tsConfig: '<rootDir>/tsconfig.spec.json' } },
6+
globals: { 'ts-jest': { tsconfig: '<rootDir>/tsconfig.spec.json' } },
117
displayName: 'example-app',
8+
snapshotSerializers: [
9+
'jest-preset-angular/build/serializers/no-ng-attributes',
10+
'jest-preset-angular/build/serializers/ng-snapshot',
11+
'jest-preset-angular/build/serializers/html-comment',
12+
],
1213
};

0 commit comments

Comments
 (0)