Skip to content

Commit 9888003

Browse files
committed
fix: Upgrade to Angular v10
BREAKING CHANGE: requires Angular v10
1 parent ecb57e5 commit 9888003

File tree

12 files changed

+4058
-3309
lines changed

12 files changed

+4058
-3309
lines changed

angular.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": {
1212
"builder": "@angular-devkit/build-angular:browser",
1313
"options": {
14+
"aot": true,
1415
"outputPath": "dist/angular-inviewport",
1516
"index": "src/index.html",
1617
"main": "src/main.ts",
@@ -23,6 +24,12 @@
2324
},
2425
"configurations": {
2526
"production": {
27+
"budgets": [
28+
{
29+
"type": "anyComponentStyle",
30+
"maximumWarning": "6kb"
31+
}
32+
],
2633
"optimization": true,
2734
"outputHashing": "all",
2835
"sourceMap": false,
@@ -40,6 +47,12 @@
4047
]
4148
},
4249
"no-progress": {
50+
"budgets": [
51+
{
52+
"type": "anyComponentStyle",
53+
"maximumWarning": "6kb"
54+
}
55+
],
4356
"progress": false
4457
}
4558
}
@@ -129,7 +142,7 @@
129142
"schematics": {
130143
"@schematics/angular:component": {
131144
"prefix": "sn",
132-
"styleext": "scss"
145+
"style": "scss"
133146
},
134147
"@schematics/angular:directive": {
135148
"prefix": "sn"

e2e/tsconfig.e2e.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.json",
2+
"extends": "../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/e2e",
55
"baseUrl": "./",

package.json

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,44 +48,42 @@
4848
"postrelease": "npm run packagr"
4949
},
5050
"private": false,
51-
"peerDependencies": {
52-
"@angular/core": ">=5.0.0 <9.0.0"
53-
},
51+
"peerDependencies": {},
5452
"devDependencies": {
55-
"@angular-devkit/build-angular": "~0.803.0",
56-
"@angular/animations": "8.2.14",
57-
"@angular/cli": "8.3.24",
58-
"@angular/common": "8.2.14",
59-
"@angular/compiler": "8.2.14",
60-
"@angular/compiler-cli": "8.2.14",
61-
"@angular/core": "8.2.14",
62-
"@angular/platform-browser": "8.2.14",
63-
"@angular/platform-browser-dynamic": "8.2.14",
64-
"@angular/platform-server": "8.2.14",
53+
"@angular-devkit/build-angular": "~0.1000.4",
54+
"@angular/animations": "10.0.5",
55+
"@angular/cli": "10.0.4",
56+
"@angular/common": "10.0.5",
57+
"@angular/compiler": "10.0.5",
58+
"@angular/compiler-cli": "10.0.5",
59+
"@angular/core": "10.0.5",
60+
"@angular/platform-browser": "10.0.5",
61+
"@angular/platform-browser-dynamic": "10.0.5",
62+
"@angular/platform-server": "10.0.5",
6563
"@nguniversal/express-engine": "^8.2.6",
6664
"@nguniversal/module-map-ngfactory-loader": "^8.2.6",
6765
"@thisissoon/schematics": "^1.0.0-alpha.17",
6866
"@types/jasmine": "~3.3.0",
6967
"@types/jasminewd2": "~2.0.2",
70-
"@types/node": "~10.12.10",
71-
"codelyzer": "^5.2.1",
68+
"@types/node": "^12.11.1",
69+
"codelyzer": "^6.0.0",
7270
"core-js": "^2.4.1",
7371
"coveralls": "^3.0.0",
7472
"cz-conventional-changelog": "^2.1.0",
7573
"express": "^4.16.3",
7674
"husky": "^1.1.0",
7775
"intersection-observer": "^0.5.0",
78-
"jasmine-core": "~3.3.0",
79-
"jasmine-spec-reporter": "~4.2.1",
80-
"karma": "^5.1.0",
81-
"karma-chrome-launcher": "~2.2.0",
76+
"jasmine-core": "~3.5.0",
77+
"jasmine-spec-reporter": "~5.0.0",
78+
"karma": "~5.1.0",
79+
"karma-chrome-launcher": "~3.1.0",
8280
"karma-cli": "~1.0.1",
83-
"karma-coverage-istanbul-reporter": "^2.0.4",
84-
"karma-jasmine": "~2.0.1",
85-
"karma-jasmine-html-reporter": "^1.3.1",
81+
"karma-coverage-istanbul-reporter": "~3.0.2",
82+
"karma-jasmine": "~3.3.0",
83+
"karma-jasmine-html-reporter": "^1.5.0",
8684
"karma-mocha-reporter": "^2.2.5",
8785
"lint-staged": "^8.1.0",
88-
"ng-packagr": "^4.4.0",
86+
"ng-packagr": "^10.0.0",
8987
"prettier": "^1.15.2",
9088
"protractor": "^7.0.0",
9189
"rxjs": "^6.2.0",
@@ -98,12 +96,10 @@
9896
"stylelint-scss": "^3.4.0",
9997
"ts-loader": "^5.2.1",
10098
"ts-node": "~7.0.1",
101-
"tsickle": "^0.34.0",
102-
"tslib": "^1.9.3",
103-
"tslint": "~5.11.0",
99+
"tslint": "~6.1.0",
104100
"tslint-config-prettier": "^1.16.0",
105-
"typescript": "~3.4.0",
106-
"zone.js": "^0.9.1"
101+
"typescript": "~3.9.7",
102+
"zone.js": "~0.10.3"
107103
},
108104
"config": {
109105
"commitizen": {
@@ -134,5 +130,8 @@
134130
"prettier --config .prettierrc --write",
135131
"git add"
136132
]
133+
},
134+
"dependencies": {
135+
"tslib": "^2.0.0"
137136
}
138137
}

src/app/in-viewport/in-viewport.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { WINDOW_MOCK } from '../window/window-mock';
1414
exports: [InViewportDirective]
1515
})
1616
export class InViewportModule {
17-
static forServer(): ModuleWithProviders {
17+
static forServer(): ModuleWithProviders<InViewportModule> {
1818
return {
1919
ngModule: InViewportModule,
2020
providers: [{ provide: WINDOW, useValue: WINDOW_MOCK }]

src/main.server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ if (environment.production) {
77
}
88

99
export { AppServerModule } from './app/app.server.module';
10+
11+
export { renderModule, renderModuleFactory } from '@angular/platform-server';

src/tsconfig.app.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"extends": "../tsconfig.json",
2+
"extends": "../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/app",
55
"baseUrl": "./",
6-
"module": "es2015",
76
"types": []
87
},
9-
"exclude": ["test.ts", "**/*.spec.ts"]
8+
"files": ["main.ts", "polyfills.ts"],
9+
"include": ["src/**/*.d.ts"]
1010
}

src/tsconfig.server.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"extends": "./tsconfig.app.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/app-server",
5-
"baseUrl": "."
5+
"baseUrl": ".",
6+
"target": "es2016"
67
},
78
"angularCompilerOptions": {
89
"entryModule": "app/app.server.module#AppServerModule"
9-
}
10+
},
11+
"files": ["main.server.ts"],
12+
"include": ["src/**/*.d.ts"]
1013
}

src/tsconfig.spec.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
2-
"extends": "../tsconfig.json",
2+
"extends": "../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/spec",
55
"baseUrl": "./",
6-
"module": "commonjs",
76
"target": "es5",
87
"types": ["jasmine", "node"]
98
},

tsconfig.base.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"module": "es2020",
5+
"outDir": "./dist/out-tsc",
6+
"sourceMap": true,
7+
"declaration": false,
8+
"moduleResolution": "node",
9+
"emitDecoratorMetadata": true,
10+
"experimentalDecorators": true,
11+
"target": "es5",
12+
"typeRoots": ["node_modules/@types"],
13+
"lib": ["es2017", "dom"]
14+
}
15+
}

tsconfig.json

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
/*
2+
This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience.
3+
It is not intended to be used to perform a compilation.
4+
5+
To learn more about this file see: https://angular.io/config/solution-tsconfig.
6+
*/
17
{
2-
"compileOnSave": false,
3-
"compilerOptions": {
4-
"outDir": "./dist/out-tsc",
5-
"sourceMap": true,
6-
"declaration": false,
7-
"moduleResolution": "node",
8-
"emitDecoratorMetadata": true,
9-
"experimentalDecorators": true,
10-
"target": "es5",
11-
"typeRoots": ["node_modules/@types"],
12-
"lib": ["es2017", "dom"]
13-
}
14-
}
8+
"files": [],
9+
"references": [
10+
{
11+
"path": "./src/tsconfig.app.json"
12+
},
13+
{
14+
"path": "./src/tsconfig.spec.json"
15+
},
16+
{
17+
"path": "./src/tsconfig.server.json"
18+
}
19+
]
20+
}

0 commit comments

Comments
 (0)