Skip to content

Commit ca4cfde

Browse files
committed
chore: update to Angular 12
1 parent c02d8d7 commit ca4cfde

17 files changed

+175
-309
lines changed

.browserslistrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ last 2 Edge major versions
1414
last 2 Safari major versions
1515
last 2 iOS major versions
1616
Firefox ESR
17-
IE 11 # Angular supports IE 11 only as an opt-in. To opt-out, add the 'not' prefix on this line.
17+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

.editorconfig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# Editor configuration, see http://editorconfig.org
1+
# Editor configuration, see https://editorconfig.org
22
root = true
33

44
[*]
55
charset = utf-8
66
end_of_line = lf
7-
indent_size = 2
87
indent_style = space
8+
indent_size = 2
99
insert_final_newline = true
1010
trim_trailing_whitespace = true
1111

12+
[*.ts]
13+
quote_type = single
14+
1215
[*.md]
1316
max_line_length = off
1417
trim_trailing_whitespace = false

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
# compiled output
44
/dist
5-
/dist-server
65
/tmp
76
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
89

910
# dependencies
1011
/node_modules
1112
package-lock.json
1213

14+
# profiling files
15+
chrome-profiler-events*.json
16+
1317
# IDEs and editors
1418
/.idea
1519
.project
@@ -25,6 +29,7 @@ package-lock.json
2529
!.vscode/tasks.json
2630
!.vscode/launch.json
2731
!.vscode/extensions.json
32+
.history/*
2833

2934
# misc
3035
/.sass-cache

angular.json

Lines changed: 46 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,31 @@
44
"newProjectRoot": "projects",
55
"projects": {
66
"ng": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
},
12+
"@schematics/angular:application": {
13+
"strict": false
14+
}
15+
},
716
"root": "",
817
"sourceRoot": "src",
9-
"projectType": "application",
18+
"prefix": "app",
1019
"architect": {
1120
"build": {
1221
"builder": "@angular-devkit/build-angular:browser",
1322
"options": {
1423
"outputPath": "dist",
1524
"index": "src/index.html",
1625
"main": "src/main.ts",
17-
"tsConfig": "src/tsconfig.app.json",
1826
"polyfills": "src/polyfills.ts",
27+
"tsConfig": "tsconfig.app.json",
28+
"inlineStyleLanguage": "scss",
29+
"preserveSymlinks": true,
1930
"assets": [
31+
"src/favicon.ico",
2032
"src/assets"
2133
],
2234
"styles": [
@@ -40,38 +52,47 @@
4052
"configurations": {
4153
"production": {
4254
"budgets": [
55+
{
56+
"type": "initial",
57+
"maximumWarning": "1500kb",
58+
"maximumError": "2mb"
59+
},
4360
{
4461
"type": "anyComponentStyle",
45-
"maximumWarning": "6kb"
62+
"maximumWarning": "6kb",
63+
"maximumError": "12kb"
4664
}
4765
],
48-
"optimization": true,
49-
"outputHashing": "all",
50-
"sourceMap": false,
51-
"namedChunks": false,
52-
"aot": true,
53-
"extractLicenses": true,
54-
"vendorChunk": false,
55-
"buildOptimizer": true,
5666
"fileReplacements": [
5767
{
5868
"replace": "src/environments/environment.ts",
5969
"with": "src/environments/environment.prod.ts"
6070
}
61-
]
71+
],
72+
"outputHashing": "all"
73+
},
74+
"development": {
75+
"buildOptimizer": false,
76+
"optimization": false,
77+
"vendorChunk": true,
78+
"extractLicenses": false,
79+
"sourceMap": true,
80+
"namedChunks": true
6281
}
63-
}
82+
},
83+
"defaultConfiguration": "production"
6484
},
6585
"serve": {
6686
"builder": "@angular-devkit/build-angular:dev-server",
67-
"options": {
68-
"browserTarget": "ng:build"
69-
},
7087
"configurations": {
7188
"production": {
7289
"browserTarget": "ng:build:production"
90+
},
91+
"development": {
92+
"browserTarget": "ng:build:development"
7393
}
74-
}
94+
},
95+
"defaultConfiguration": "development"
7596
},
7697
"extract-i18n": {
7798
"builder": "@angular-devkit/build-angular:extract-i18n",
@@ -83,10 +104,14 @@
83104
"builder": "@angular-devkit/build-angular:karma",
84105
"options": {
85106
"main": "src/test.ts",
86-
"karmaConfig": "./karma.conf.js",
87107
"polyfills": "src/polyfills.ts",
88-
"tsConfig": "src/tsconfig.spec.json",
89-
"scripts": [],
108+
"tsConfig": "tsconfig.spec.json",
109+
"karmaConfig": "karma.conf.js",
110+
"inlineStyleLanguage": "scss",
111+
"assets": [
112+
"src/favicon.ico",
113+
"src/assets"
114+
],
90115
"styles": [
91116
"node_modules/@coreui/icons/css/free.css",
92117
"node_modules/flag-icon-css/css/flag-icon.css",
@@ -98,23 +123,7 @@
98123
"includePaths": [
99124
"./node_modules"
100125
]
101-
},
102-
"assets": [
103-
"src/assets",
104-
"src/favicon.ico"
105-
]
106-
}
107-
},
108-
"lint": {
109-
"builder": "@angular-devkit/build-angular:tslint",
110-
"options": {
111-
"tsConfig": [
112-
"src/tsconfig.app.json",
113-
"src/tsconfig.spec.json"
114-
],
115-
"exclude": [
116-
"**/node_modules/**"
117-
]
126+
}
118127
}
119128
}
120129
}
@@ -130,31 +139,11 @@
130139
"protractorConfig": "./protractor.conf.js",
131140
"devServerTarget": "ng:serve"
132141
}
133-
},
134-
"lint": {
135-
"builder": "@angular-devkit/build-angular:tslint",
136-
"options": {
137-
"tsConfig": [
138-
"e2e/tsconfig.e2e.json"
139-
],
140-
"exclude": [
141-
"**/node_modules/**"
142-
]
143-
}
144142
}
145143
}
146144
}
147145
},
148146
"defaultProject": "ng",
149-
"schematics": {
150-
"@schematics/angular:component": {
151-
"prefix": "app",
152-
"style": "scss"
153-
},
154-
"@schematics/angular:directive": {
155-
"prefix": "app"
156-
}
157-
},
158147
"cli": {
159148
"analytics": false
160149
}

karma.conf.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ module.exports = function (config) {
2525
suppressAll: true // removes the duplicated traces
2626
},
2727
coverageReporter: {
28-
dir: require('path').join(__dirname, '../../coverage'),
28+
dir: require('path').join(__dirname, './coverage/coreui-free-angular-admin-template'),
2929
subdir: '.',
3030
reporters: [
3131
{ type: 'html' },
3232
{ type: 'text-summary' }
3333
]
3434
},
35-
angularCli: {
36-
environment: 'dev'
37-
},
3835
reporters: ['progress', 'kjhtml'],
3936
port: 9876,
4037
colors: true,

package.json

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,25 @@
1919
"license": "MIT",
2020
"scripts": {
2121
"ng": "ng",
22-
"postinstall": "ngcc --properties es2015 browser module main --first-only",
2322
"start": "ng serve",
24-
"build": "ng build --prod --aot --build-optimizer --common-chunk --vendor-chunk --optimization --progress",
23+
"build": "ng build",
24+
"watch": "ng build --watch --configuration development",
2525
"test": "ng test",
26-
"lint": "ng lint",
2726
"e2e": "ng e2e"
2827
},
2928
"private": true,
3029
"dependencies": {
31-
"@angular/animations": "^11.2.14",
32-
"@angular/cdk": "^11.2.13",
33-
"@angular/common": "^11.2.14",
34-
"@angular/compiler": "^11.2.14",
35-
"@angular/core": "^11.2.14",
36-
"@angular/forms": "^11.2.14",
37-
"@angular/localize": "^11.2.14",
38-
"@angular/platform-browser": "^11.2.14",
39-
"@angular/platform-browser-dynamic": "^11.2.14",
40-
"@angular/router": "^11.2.14",
41-
"@coreui/angular": "~2.11.3",
30+
"@angular/animations": "^12.2.16",
31+
"@angular/cdk": "^12.2.13",
32+
"@angular/common": "^12.2.16",
33+
"@angular/compiler": "^12.2.16",
34+
"@angular/core": "^12.2.16",
35+
"@angular/forms": "^12.2.16",
36+
"@angular/localize": "^12.2.16",
37+
"@angular/platform-browser": "^12.2.16",
38+
"@angular/platform-browser-dynamic": "^12.2.16",
39+
"@angular/router": "^12.2.16",
40+
"@coreui/angular": "~2.12.0",
4241
"@coreui/coreui": "^2.1.16",
4342
"@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.3.1",
4443
"@coreui/icons": "^2.1.0",
@@ -57,31 +56,29 @@
5756
"ts-helpers": "^1.1.2",
5857
"tslib": "^2.3.1",
5958
"web-animations-js": "^2.3.2",
60-
"zone.js": "~0.11.5"
59+
"zone.js": "~0.11.4"
6160
},
6261
"devDependencies": {
63-
"@angular-devkit/build-angular": "^0.1102.18",
64-
"@angular/cli": "^11.2.18",
65-
"@angular/compiler-cli": "^11.2.14",
66-
"@angular/language-service": "^11.2.14",
67-
"@types/jasmine": "^3.10.4",
62+
"@angular-devkit/build-angular": "^12.2.16",
63+
"@angular/cli": "^12.2.16",
64+
"@angular/compiler-cli": "^12.2.16",
65+
"@angular/language-service": "^12.2.16",
66+
"@types/jasmine": "~3.8.0",
6867
"@types/jasminewd2": "^2.0.10",
6968
"@types/node": "^14.18.12",
70-
"codelyzer": "^6.0.2",
71-
"jasmine-core": "~3.10.1",
72-
"jasmine-spec-reporter": "~5.0.2",
73-
"karma": "~5.2.3",
69+
"jasmine-core": "~3.8.0",
70+
"jasmine-spec-reporter": "^7.0.0",
71+
"karma": "~6.3.17",
7472
"karma-chrome-launcher": "~3.1.1",
7573
"karma-coverage": "~2.0.3",
7674
"karma-jasmine": "~4.0.1",
7775
"karma-jasmine-html-reporter": "^1.7.0",
7876
"protractor": "~7.0.0",
7977
"ts-node": "^9.1.1",
80-
"tslint": "~6.1.3",
81-
"typescript": "~4.1.6"
78+
"typescript": "~4.3.5"
8279
},
8380
"engines": {
84-
"node": ">= 10.19",
81+
"node": ">= 12.20",
8582
"npm": ">= 6"
8683
}
8784
}

protractor.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports.config = {
1212
'browserName': 'chrome'
1313
},
1414
directConnect: true,
15-
baseUrl: 'http://localhost:4200/',
15+
baseUrl: 'http://localhost:4202/',
1616
framework: 'jasmine',
1717
jasmineNodeOpts: {
1818
showColors: true,

src/declarations.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
declare module '@coreui/coreui/dist/js/coreui-utilities';
2+
declare module '@coreui/coreui-plugin-chartjs-custom-tooltips';
3+
4+
declare module '*.json' {
5+
const value: any;
6+
export default value;
7+
}
8+

src/environments/environment.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
// The file contents for the current environment will overwrite these during build.
2-
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
3-
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
4-
// The list of which env maps to which file can be found in `.angular-cli.json`.
1+
// This file can be replaced during build by using the `fileReplacements` array.
2+
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
3+
// The list of file replacements can be found in `angular.json`.
54

65
export const environment = {
76
production: false
87
};
8+
9+
/*
10+
* For easier debugging in development mode, you can import the following file
11+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12+
*
13+
* This import should be commented out in production mode because it will have a negative impact
14+
* on performance if an error is thrown.
15+
*/
16+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

src/polyfills.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@ import '@angular/localize/init';
2323
* BROWSER POLYFILLS
2424
*/
2525

26-
/** IE11 requires all of the following polyfills. **/
27-
import 'core-js';
28-
29-
/** IE11 requires the following for NgClass support on SVG elements */
30-
import 'classlist.js'; // Run `npm install --save classlist.js`.
26+
/**
27+
* IE11 requires the following for NgClass support on SVG elements
28+
*/
29+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
3130

3231
/**
3332
* Web Animations `@angular/platform-browser/animations`
3433
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
3534
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
3635
*/
37-
import 'web-animations-js'; // Run `npm install --save web-animations-js`.
36+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
3837

3938
/**
4039
* By default, zone.js will patch all possible macroTask and DomEvents

0 commit comments

Comments
 (0)