From 3a2599607222e32fa879cdad61ce28e9d6d3145a Mon Sep 17 00:00:00 2001 From: Arthur Ming Date: Wed, 1 Sep 2021 23:14:55 +0800 Subject: [PATCH] build: upgrade angular@12 --- .gitignore | 1 + README.md | 4 +-- angular.json | 12 +++++++-- package.json | 38 ++++++++++++++--------------- projects/coreui/angular/src/test.ts | 4 +-- src/environments/environment.ts | 2 +- src/polyfills.ts | 2 +- src/test.ts | 2 +- 8 files changed, 37 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index b9052a77..79893d85 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ # dependencies /node_modules package-lock.json +yarn.lock # profiling files chrome-profiler-events*.json diff --git a/README.md b/README.md index f9631017..d9f5a491 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ CoreUI is an Open Source UI Kit built on top of Bootstrap 4. CoreUI is the faste Before you begin, make sure your development environment includes `Node.jsĀ®` and an `npm` package manager. ###### Node.js -Angular 11 requires `Node.js` version 10.13 or later. +Angular 12 requires `Node.js` version 12.20.0 or later. - To check your version, run `node -v` in a terminal/console window. - To get `Node.js`, go to [nodejs.org](https://nodejs.org/). @@ -67,7 +67,7 @@ Install the Angular CLI globally using a terminal/console window. npm install -g @angular/cli ``` -##### Update to Angular 11 +##### Update to Angular 12 see: [https://update.angular.io](https://update.angular.io) ## CoreUI Installation diff --git a/angular.json b/angular.json index a13abe29..97943f97 100644 --- a/angular.json +++ b/angular.json @@ -26,7 +26,14 @@ "node_modules/simple-line-icons/css/simple-line-icons.css", "src/scss/style.scss" ], - "scripts": [] + "scripts": [], + "aot": false, + "vendorChunk": true, + "extractLicenses": false, + "buildOptimizer": false, + "sourceMap": true, + "optimization": false, + "namedChunks": true }, "configurations": { "production": { @@ -51,7 +58,8 @@ "vendorChunk": false, "buildOptimizer": true } - } + }, + "defaultConfiguration": "" }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", diff --git a/package.json b/package.json index b1570e43..8407dac2 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "ng": "ng", "postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points", "build-lib:dev": "ng build @coreui/angular --watch", - "build-lib:prod": "ng build @coreui/angular --prod", + "build-lib:prod": "ng build @coreui/angular --configuration production", "test-lib:dev": "ng test @coreui/angular", "test-lib:prod": "ng test @coreui/angular --karmaConfig=projects/coreui/angular/karma.conf.github.js", "prestart": "npm run postinstall", @@ -33,46 +33,46 @@ }, "private": true, "dependencies": { - "@angular/animations": "^11.2.2", - "@angular/common": "^11.2.2", - "@angular/compiler": "^11.2.2", - "@angular/core": "^11.2.2", - "@angular/forms": "^11.2.2", - "@angular/localize": "^11.2.2", - "@angular/platform-browser": "^11.2.2", - "@angular/platform-browser-dynamic": "^11.2.2", - "@angular/router": "^11.2.2", + "@angular/animations": "^12.2.3", + "@angular/common": "^12.2.3", + "@angular/compiler": "^12.2.3", + "@angular/core": "^12.2.3", + "@angular/forms": "^12.2.3", + "@angular/localize": "^12.2.3", + "@angular/platform-browser": "^12.2.3", + "@angular/platform-browser-dynamic": "^12.2.3", + "@angular/router": "^12.2.3", "rxjs": "^6.6.3", "tslib": "^2.1.0", - "zone.js": "^0.11.4" + "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "^0.1102.1", - "@angular/cli": "^11.2.1", - "@angular/compiler-cli": "^11.2.2", - "@angular/language-service": "^11.2.2", + "@angular-devkit/build-angular": "^12.2.3", + "@angular/cli": "^12.2.3", + "@angular/compiler-cli": "^12.2.3", + "@angular/language-service": "^12.2.3", "@coreui/coreui": "^2.1.16", "@types/jasmine": "^3.6.4", "@types/node": "^14.14.31", "codelyzer": "^6.0.1", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.2", - "karma": "^5.2.3", + "karma": "^6.3.4", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.0.3", "karma-jasmine": "~4.0.1", "karma-jasmine-html-reporter": "^1.5.4", - "ng-packagr": "^11.2.4", + "ng-packagr": "^12.2.1", "ngx-perfect-scrollbar": "^10.1.0", "protractor": "~7.0.0", "shelljs": "^0.8.4", "simple-line-icons": "^2.5.5", "ts-node": "^9.1.1", "tslint": "~6.1.3", - "typescript": "~4.0.5" + "typescript": "~4.3.5" }, "engines": { "node": ">= 10.13", "npm": ">= 6" } -} +} \ No newline at end of file diff --git a/projects/coreui/angular/src/test.ts b/projects/coreui/angular/src/test.ts index 2a6d9952..e641ce5b 100644 --- a/projects/coreui/angular/src/test.ts +++ b/projects/coreui/angular/src/test.ts @@ -1,7 +1,7 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/dist/zone'; -import 'zone.js/dist/zone-testing'; +import 'zone.js'; +import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 012182ef..72cd6397 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -12,4 +12,4 @@ export const environment = { * import the following file, but please comment it out in production mode * because it will have performance impact when throw error */ -// import 'zone.js/dist/zone-error'; // Included with Angular CLI. +// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. diff --git a/src/polyfills.ts b/src/polyfills.ts index 83679398..284bc419 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -66,7 +66,7 @@ import 'core-js/es/reflect'; /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js/dist/zone'; // Included with Angular CLI. +import 'zone.js'; // Included with Angular CLI. /*************************************************************************************************** diff --git a/src/test.ts b/src/test.ts index 16317897..a6f15af3 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,6 +1,6 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/dist/zone-testing'; +import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule,