Skip to content

chore: upgrade to Angular 11 #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
Expand Down Expand Up @@ -90,7 +89,7 @@
"prefix": "lib",
"architect": {
"build-package": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/testing-library/tsconfig.lib.json",
"project": "projects/testing-library/ng-package.json"
Expand Down Expand Up @@ -146,7 +145,7 @@
"prefix": "lib",
"architect": {
"build-package": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/jest-utils/tsconfig.lib.json",
"project": "projects/jest-utils/ng-package.json"
Expand Down
2 changes: 1 addition & 1 deletion apps/example-app/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const routes: Routes = [
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
exports: [RouterModule],
})
export class AppRoutingModule {}
2 changes: 1 addition & 1 deletion apps/example-app/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module.exports = {
name: 'Example',
color: 'blue',
},
preset: '../../jest.config.js',
preset: '../../jest.preset.js',
};
2 changes: 1 addition & 1 deletion apps/example-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": [],
Expand Down
2 changes: 1 addition & 1 deletion apps/example-app/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"types": ["node", "jest"]
Expand Down
26 changes: 1 addition & 25 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
module.exports = {
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
},
resolver: '@nrwl/jest/plugins/resolver',
moduleFileExtensions: ['ts', 'js', 'html'],
coverageReporters: ['html'],
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
snapshotSerializers: [
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js',
],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
astTransformers: {
before: [
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer',
]
},
},
},
projects: ['<rootDir>/', '<rootDir>/projects/testing-library', '<rootDir>/projects/jest-utils'],
};
29 changes: 29 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const nxPreset = require('@nrwl/jest/preset');
module.exports = {
...nxPreset,
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
},
resolver: '@nrwl/jest/plugins/resolver',
moduleFileExtensions: ['ts', 'js', 'html'],
coverageReporters: ['html'],
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
snapshotSerializers: [
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js',
],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
astTransformers: {
before: [
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer',
],
},
},
},
};
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"semantic-release": "semantic-release"
},
"dependencies": {
"@angular/animations": "^10.0.0",
"@angular/cdk": "^10.0.0",
"@angular/common": "^10.0.0",
"@angular/compiler": "^10.0.0",
"@angular/core": "^10.0.0",
"@angular/forms": "^10.0.0",
"@angular/material": "^10.0.0",
"@angular/platform-browser": "^10.0.0",
"@angular/platform-browser-dynamic": "^10.0.0",
"@angular/router": "^10.0.0",
"@ngrx/store": "^9.2.0",
"@nrwl/angular": "^10.0.0",
"@angular/animations": "^11.0.0",
"@angular/cdk": "^11.0.0",
"@angular/common": "^11.0.0",
"@angular/compiler": "^11.0.0",
"@angular/core": "^11.0.0",
"@angular/forms": "^11.0.0",
"@angular/material": "^11.0.0",
"@angular/platform-browser": "^11.0.0",
"@angular/platform-browser-dynamic": "^11.0.0",
"@angular/router": "^11.0.0",
"@ngrx/store": "^10.0.1",
"@nrwl/angular": "^10.3.3",
"@nrwl/nx-cloud": "^10.0.0",
"@phenomnomnominal/tsquery": "^4.1.1",
"@testing-library/dom": "^7.24.1",
Expand All @@ -43,30 +43,30 @@
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.0",
"@angular-devkit/build-ng-packagr": "~0.1000.0",
"@angular/cli": "~10.0.0",
"@angular/compiler-cli": "^10.0.0",
"@angular/language-service": "^10.0.0",
"@nrwl/jest": "^10.0.0",
"@nrwl/node": "^10.0.0",
"@nrwl/nx-plugin": "^10.0.0",
"@nrwl/workspace": "^10.0.0",
"@angular-devkit/build-angular": "~0.1100.0",
"@angular/cli": "~11.0.0",
"@angular/compiler-cli": "^11.0.0",
"@angular/language-service": "^11.0.0",
"@nrwl/cli": "10.3.3",
"@nrwl/jest": "^10.3.3",
"@nrwl/node": "^10.3.3",
"@nrwl/nx-plugin": "^10.3.3",
"@nrwl/workspace": "^10.3.3",
"@testing-library/jest-dom": "^5.11.0",
"@types/jest": "~26.0.3",
"@types/node": "^14.0.14",
"codelyzer": "^5.2.2",
"cpy-cli": "^3.1.1",
"husky": "^4.2.5",
"jest": "^26.1.0",
"jest-preset-angular": "^8.2.1",
"jest-preset-angular": "8.3.1",
"lint-staged": "^10.2.11",
"ng-packagr": "^10.0.0",
"ng-packagr": "^11.0.1",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"semantic-release": "^17.1.1",
"ts-jest": "^26.1.1",
"ts-jest": "26.4.0",
"ts-node": "~8.10.2",
"typescript": "~3.9.5"
"typescript": "~4.0.5"
}
}
2 changes: 1 addition & 1 deletion projects/jest-utils/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module.exports = {
name: 'JEST UTILS',
color: 'magenta',
},
preset: '../../jest.config.js',
preset: '../../jest.preset.js',
};
3 changes: 2 additions & 1 deletion projects/jest-utils/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"declarationMap": false,
"module": "es2015",
"moduleResolution": "node",
"declaration": true,
Expand Down
2 changes: 1 addition & 1 deletion projects/jest-utils/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"types": ["node", "jest"]
Expand Down
2 changes: 1 addition & 1 deletion projects/testing-library/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module.exports = {
name: 'ATL',
color: 'magenta',
},
preset: '../../jest.config.js',
preset: '../../jest.preset.js',
};
10 changes: 5 additions & 5 deletions projects/testing-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
},
"homepage": "https://github.com/testing-library/angular-testing-library#readme",
"peerDependencies": {
"@angular/common": "^10.0.0",
"@angular/platform-browser": "^10.0.0",
"@angular/animations": "^10.0.0",
"@angular/router": "^10.0.0",
"@angular/core": "^10.0.0"
"@angular/common": ">= 10.0.0 < 12",
"@angular/platform-browser": ">= 10.0.0 < 12",
"@angular/animations": ">= 10.0.0 < 12",
"@angular/router": ">= 10.0.0 < 12",
"@angular/core": ">= 10.0.0 < 12"
},
"dependencies": {
"@testing-library/dom": "^7.18.1",
Expand Down
3 changes: 2 additions & 1 deletion projects/testing-library/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"declarationMap": false,
"target": "es2015",
"module": "ES2015",
"moduleResolution": "node",
Expand Down
2 changes: 1 addition & 1 deletion projects/testing-library/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"types": ["node", "jest"]
Expand Down
21 changes: 0 additions & 21 deletions tsconfig.base.json

This file was deleted.

46 changes: 19 additions & 27 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
/*
This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience.
It is not intended to be used to perform a compilation.

To learn more about this file see: https://angular.io/config/solution-tsconfig.
*/
{
"files": [],
"references": [
{
"path": "./apps/example-app/tsconfig.json"
},
{
"path": "./apps/example-app/tsconfig.spec.json"
},
{
"path": "./projects/testing-library/tsconfig.lib.json"
},
{
"path": "./projects/testing-library/tsconfig.spec.json"
},
{
"path": "./projects/jest-utils/tsconfig.lib.json"
},
{
"path": "./projects/jest-utils/tsconfig.spec.json"
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"importHelpers": true,
"module": "esnext",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2015",
"typeRoots": ["node_modules/@types"],
"lib": ["es2017", "dom"],
"paths": {
"@testing-library/angular": ["projects/testing-library"],
"@testing-library/angular/jest-utils": ["projects/jest-utils"]
}
]
}
}
}
Loading