Skip to content

Commit faf5893

Browse files
committed
chore: update to Angular 12
1 parent 63f77aa commit faf5893

File tree

10 files changed

+72
-69
lines changed

10 files changed

+72
-69
lines changed

angular.json

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"cli": {
4+
"analytics": false
5+
},
36
"version": 1,
47
"newProjectRoot": "projects",
58
"projects": {
@@ -42,27 +45,30 @@
4245
"with": "src/environments/environment.prod.ts"
4346
}
4447
],
45-
"optimization": true,
46-
"outputHashing": "all",
47-
"sourceMap": false,
48-
"namedChunks": false,
49-
"aot": true,
50-
"extractLicenses": true,
51-
"vendorChunk": false,
52-
"buildOptimizer": true
48+
"outputHashing": "all"
49+
},
50+
"development": {
51+
"buildOptimizer": false,
52+
"optimization": false,
53+
"vendorChunk": true,
54+
"extractLicenses": false,
55+
"sourceMap": true,
56+
"namedChunks": true
5357
}
54-
}
58+
},
59+
"defaultConfiguration": "production"
5560
},
5661
"serve": {
5762
"builder": "@angular-devkit/build-angular:dev-server",
58-
"options": {
59-
"browserTarget": "coreui:build"
60-
},
6163
"configurations": {
6264
"production": {
6365
"browserTarget": "coreui:build:production"
66+
},
67+
"development": {
68+
"browserTarget": "coreui:build:development"
6469
}
65-
}
70+
},
71+
"defaultConfiguration": "development"
6672
},
6773
"extract-i18n": {
6874
"builder": "@angular-devkit/build-angular:extract-i18n",
@@ -77,6 +83,7 @@
7783
"polyfills": "src/polyfills.ts",
7884
"tsConfig": "src/tsconfig.spec.json",
7985
"karmaConfig": "src/karma.conf.js",
86+
"inlineStyleLanguage": "scss",
8087
"styles": [
8188
"src/scss/style.scss"
8289
],
@@ -140,7 +147,8 @@
140147
"project": "projects/coreui/angular/ng-package.prod.json",
141148
"tsConfig": "projects/coreui/angular/tsconfig.lib.prod.json"
142149
}
143-
}
150+
},
151+
"defaultConfiguration": "production"
144152
},
145153
"test": {
146154
"builder": "@angular-devkit/build-angular:karma",
@@ -165,9 +173,6 @@
165173
}
166174
}
167175
},
168-
"cli": {
169-
"analytics": false
170-
},
171176
"defaultProject": "coreui",
172177
"schematics": {
173178
"@schematics/angular:component": {

package.json

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,63 +16,61 @@
1616
],
1717
"scripts": {
1818
"ng": "ng",
19-
"postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",
2019
"build-lib:dev": "ng build @coreui/angular --watch",
21-
"build-lib:prod": "ng build @coreui/angular --prod",
20+
"build-lib:prod": "ng build @coreui/angular --configuration production",
2221
"test-lib:dev": "ng test @coreui/angular",
2322
"test-lib:prod": "ng test @coreui/angular --karmaConfig=projects/coreui/angular/karma.conf.github.js",
24-
"prestart": "npm run postinstall",
2523
"start": "ng serve",
2624
"test": "ng test",
2725
"lint": "ng lint",
28-
"pree2e": "npm run postinstall",
2926
"e2e": "ng e2e",
3027
"publish": "cd dist/@coreui/angular/ && npm publish --tag v2-lts --dry-run",
3128
"link": "cd dist/@coreui/angular/ && npm link",
3229
"release-version": "node build/change-version.js"
3330
},
3431
"private": true,
3532
"dependencies": {
36-
"@angular/animations": "^11.2.14",
37-
"@angular/common": "^11.2.14",
38-
"@angular/compiler": "^11.2.14",
39-
"@angular/core": "^11.2.14",
40-
"@angular/forms": "^11.2.14",
41-
"@angular/localize": "^11.2.14",
42-
"@angular/platform-browser": "^11.2.14",
43-
"@angular/platform-browser-dynamic": "^11.2.14",
44-
"@angular/router": "^11.2.14",
33+
"@angular/animations": "^12.2.16",
34+
"@angular/common": "^12.2.16",
35+
"@angular/compiler": "^12.2.16",
36+
"@angular/core": "^12.2.16",
37+
"@angular/forms": "^12.2.16",
38+
"@angular/localize": "^12.2.16",
39+
"@angular/platform-browser": "^12.2.16",
40+
"@angular/platform-browser-dynamic": "^12.2.16",
41+
"@angular/router": "^12.2.16",
4542
"rxjs": "^6.6.7",
4643
"tslib": "^2.3.1",
47-
"zone.js": "^0.11.5"
44+
"zone.js": "~0.11.4"
4845
},
4946
"devDependencies": {
50-
"@angular-devkit/build-angular": "^0.1102.18",
51-
"@angular/cli": "^11.2.18",
52-
"@angular/compiler-cli": "^11.2.14",
53-
"@angular/language-service": "^11.2.14",
47+
"@angular-devkit/build-angular": "^12.2.16",
48+
"@angular/cli": "^12.2.16",
49+
"@angular/compiler-cli": "^12.2.16",
50+
"@angular/language-service": "^12.2.16",
5451
"@coreui/coreui": "^2.1.16",
5552
"@types/jasmine": "^3.6.11",
53+
"@types/jasminewd2": "^2.0.10",
5654
"@types/node": "^14.18.12",
5755
"codelyzer": "^6.0.2",
5856
"jasmine-core": "~3.10.1",
59-
"jasmine-spec-reporter": "~5.0.2",
60-
"karma": "^5.2.3",
57+
"jasmine-spec-reporter": "~7.0.0",
58+
"karma": "^6.3.17",
6159
"karma-chrome-launcher": "~3.1.1",
6260
"karma-coverage": "~2.0.3",
6361
"karma-jasmine": "~4.0.1",
6462
"karma-jasmine-html-reporter": "^1.7.0",
65-
"ng-packagr": "^11.2.4",
63+
"ng-packagr": "^12.2.7",
6664
"ngx-perfect-scrollbar": "^10.1.1",
6765
"protractor": "~7.0.0",
6866
"shelljs": "^0.8.5",
6967
"simple-line-icons": "^2.5.5",
7068
"ts-node": "^9.1.1",
7169
"tslint": "~6.1.3",
72-
"typescript": "~4.0.8"
70+
"typescript": "~4.3.5"
7371
},
7472
"engines": {
75-
"node": ">= 10.19",
73+
"node": "^12.20.0 || >=14.0.0",
7674
"npm": ">= 6"
7775
}
7876
}

projects/coreui/angular/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
}
1818
],
1919
"dependencies": {
20-
"tslib": "^2.0.0"
20+
"tslib": "^2.3.0"
2121
},
2222
"peerDependencies": {
23-
"@angular/common": "^11.0.0",
24-
"@angular/core": "^11.0.0",
25-
"@angular/router": "^11.0.0"
23+
"@angular/common": "^12.0.0",
24+
"@angular/core": "^12.0.0",
25+
"@angular/router": "^12.0.0"
2626
},
2727
"repository": {
2828
"type": "git",

projects/coreui/angular/src/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
22

3-
import 'zone.js/dist/zone';
4-
import 'zone.js/dist/zone-testing';
3+
import 'zone.js';
4+
import 'zone.js/testing';
55
import { getTestBed } from '@angular/core/testing';
66
import {
77
BrowserDynamicTestingModule,

projects/coreui/angular/tsconfig.lib.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"extends": "../../../tsconfig.json",
44
"compilerOptions": {
55
"outDir": "../../../out-tsc/lib",
6-
"declarationMap": true,
76
"target": "es2015",
87
"declaration": true,
8+
"declarationMap": true,
99
"inlineSources": true,
1010
"types": [],
1111
"lib": [
@@ -14,7 +14,6 @@
1414
]
1515
},
1616
"angularCompilerOptions": {
17-
"enableIvy": false,
1817
"flatModuleId": "@coreui/angular",
1918
"skipTemplateCodegen": true,
2019
"strictMetadataEmit": true,

projects/coreui/angular/tsconfig.lib.prod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"declarationMap": false
66
},
77
"angularCompilerOptions": {
8-
"enableIvy": false
8+
"compilationMode": "partial"
99
}
1010
}

src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export const environment = {
1212
* import the following file, but please comment it out in production mode
1313
* because it will have performance impact when throw error
1414
*/
15-
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
15+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

src/polyfills.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,14 @@ import '@angular/localize/init';
2020
*/
2121

2222
/***************************************************************************************************
23-
* BROWSER POLYFILLS
24-
*/
23+
* BROWSER POLYFILLS
24+
*/
2525

26-
/** IE11 requires the following for NgClass support on SVG elements */
26+
/**
27+
* IE11 requires the following for NgClass support on SVG elements
28+
*/
2729
// import 'classlist.js'; // Run `npm install --save classlist.js`.
2830

29-
/** IE11 requires all of the following polyfills. */
30-
import 'core-js';
31-
32-
/** IE11 requires the following for the Reflect API. */
33-
import 'core-js/es/reflect';
34-
3531
/**
3632
* Web Animations `@angular/platform-browser/animations`
3733
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
@@ -66,11 +62,10 @@ import 'core-js/es/reflect';
6662
/***************************************************************************************************
6763
* Zone JS is required by default for Angular itself.
6864
*/
69-
import 'zone.js/dist/zone'; // Included with Angular CLI.
65+
import 'zone.js'; // Included with Angular CLI.
7066

7167

7268
/***************************************************************************************************
7369
* APPLICATION IMPORTS
7470
*/
7571
(window as any).global = window;
76-

src/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
22

3-
import 'zone.js/dist/zone-testing';
3+
import 'zone.js/testing';
44
import { getTestBed } from '@angular/core/testing';
55
import {
66
BrowserDynamicTestingModule,

tsconfig.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
12
{
23
"compileOnSave": false,
34
"compilerOptions": {
45
"baseUrl": "./",
5-
"outDir": "./dist",
6+
"outDir": "./dist/out-tsc",
7+
"forceConsistentCasingInFileNames": true,
8+
"strict": true,
9+
"noImplicitReturns": true,
10+
"noFallthroughCasesInSwitch": true,
611
"sourceMap": true,
7-
"declaration": true,
12+
"declaration": false,
813
"downlevelIteration": true,
914
"experimentalDecorators": true,
10-
"module": "esnext",
1115
"moduleResolution": "node",
1216
"importHelpers": true,
13-
"target": "es2015",
17+
"target": "es2017",
18+
"module": "es2020",
1419
"typeRoots": [
1520
"node_modules/@types"
1621
],
@@ -25,8 +30,9 @@
2530
}
2631
},
2732
"angularCompilerOptions": {
28-
"enableIvy": false,
29-
"fullTemplateTypeCheck": true,
30-
"strictInjectionParameters": true
33+
"enableI18nLegacyMessageIdFormat": false,
34+
"strictInjectionParameters": true,
35+
"strictInputAccessModifiers": true,
36+
"strictTemplates": true
3137
}
3238
}

0 commit comments

Comments
 (0)