From 1e9db801d3613119738e7761c7590ce0532b83df Mon Sep 17 00:00:00 2001 From: Tuan Duong Date: Wed, 20 Apr 2022 00:46:46 +0700 Subject: [PATCH 1/5] update angular to v9 --- angular.json | 10 +++++ package.json | 37 +++++++++---------- .../containerBox/containerBox.component.ts | 4 +- projects/example/tsconfig.app.json | 9 +++-- projects/lib/src/lib/img/img.component.ts | 4 +- projects/lib/tsconfig.lib.json | 1 - projects/lib/tsconfig.lib.prod.json | 6 +++ tsconfig.json | 2 +- 8 files changed, 45 insertions(+), 28 deletions(-) create mode 100644 projects/lib/tsconfig.lib.prod.json diff --git a/angular.json b/angular.json index 84dff20..00ebc82 100644 --- a/angular.json +++ b/angular.json @@ -14,6 +14,11 @@ "options": { "tsConfig": "projects/lib/tsconfig.lib.json", "project": "projects/lib/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "projects/lib/tsconfig.lib.prod.json" + } } }, "test": { @@ -48,6 +53,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { + "aot": true, "outputPath": "dist/example", "index": "projects/example/src/index.html", "main": "projects/example/src/main.ts", @@ -85,6 +91,10 @@ "type": "initial", "maximumWarning": "2mb", "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" } ] } diff --git a/package.json b/package.json index c5b79f1..86403f2 100644 --- a/package.json +++ b/package.json @@ -19,31 +19,32 @@ }, "private": true, "dependencies": { - "@angular-devkit/build-angular": "^0.801.1", - "@angular/animations": "~8.1.1", - "@angular/common": "~8.1.1", - "@angular/compiler": "~8.1.1", - "@angular/core": "~8.1.1", - "@angular/forms": "~8.1.1", - "@angular/platform-browser": "~8.1.1", - "@angular/platform-browser-dynamic": "~8.1.1", - "@angular/router": "~8.1.1", + "@angular-devkit/build-angular": "~0.901.15", + "@angular/animations": "~9.1.13", + "@angular/common": "~9.1.13", + "@angular/compiler": "~9.1.13", + "@angular/core": "~9.1.13", + "@angular/forms": "~9.1.13", + "@angular/platform-browser": "~9.1.13", + "@angular/platform-browser-dynamic": "~9.1.13", + "@angular/router": "~9.1.13", "core-js": "^3.6.5", "fibers": "^4.0.2", "highlight.js": "^9.18.1", "ng-lazyload-image": "^7.0.1", "ngx-highlightjs": "^3.0.3", "rxjs": "^6.5.5", - "zone.js": "^0.9.1" + "tslib": "^1.10.0", + "zone.js": "~0.10.2" }, "devDependencies": { - "@angular-devkit/build-ng-packagr": "~0.801.1", - "@angular/cli": "^8.3.26", - "@angular/compiler-cli": "~8.1.1", - "@angular/language-service": "~8.1.1", + "@angular-devkit/build-ng-packagr": "~0.901.15", + "@angular/cli": "^9.1.15", + "@angular/compiler-cli": "~9.1.13", + "@angular/language-service": "~9.1.13", "@types/jasmine": "^3.5.10", "@types/jasminewd2": "^2.0.8", - "@types/node": "~12.6.6", + "@types/node": "^12.11.1", "codelyzer": "^5.1.2", "gh-pages": "^2.2.0", "jasmine-core": "~3.4.0", @@ -53,12 +54,10 @@ "karma-coverage-istanbul-reporter": "^2.1.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.5.3", - "ng-packagr": "^5.7.1", + "ng-packagr": "^9.0.0", "protractor": "^5.4.4", "ts-node": "~8.3.0", - "tsickle": "^0.36.0", - "tslib": "^1.11.1", "tslint": "~5.18.0", - "typescript": "~3.4.5" + "typescript": "~3.8.3" } } diff --git a/projects/example/src/app/containerBox/containerBox.component.ts b/projects/example/src/app/containerBox/containerBox.component.ts index 24e5ed4..73d8861 100644 --- a/projects/example/src/app/containerBox/containerBox.component.ts +++ b/projects/example/src/app/containerBox/containerBox.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, ViewChild, ElementRef, OnDestroy} from '@angular/core'; +import { Component, OnInit, ViewChild, ElementRef, OnDestroy, AfterViewInit } from '@angular/core'; import {fromEvent, Observable, Subscription} from 'rxjs'; import {debounceTime} from 'rxjs/operators'; @@ -8,7 +8,7 @@ import {debounceTime} from 'rxjs/operators'; }) export default class ContainerBoxComponent implements OnInit, OnDestroy { - @ViewChild('containerElem', null) containerElem: ElementRef; + @ViewChild('containerElem', { static: true }) containerElem: ElementRef; resizeObservable$: Observable; resizeSubscription$: Subscription; diff --git a/projects/example/tsconfig.app.json b/projects/example/tsconfig.app.json index bb16c46..a5b387a 100644 --- a/projects/example/tsconfig.app.json +++ b/projects/example/tsconfig.app.json @@ -4,8 +4,11 @@ "outDir": "../../out-tsc/app", "types": [] }, - "exclude": [ - "test.ts", - "**/*.spec.ts" + "files": [ + "src/main.ts", + "src/polyfills.ts" + ], + "include": [ + "projects/example/src/**/*.d.ts" ] } diff --git a/projects/lib/src/lib/img/img.component.ts b/projects/lib/src/lib/img/img.component.ts index cb290ad..31dd233 100644 --- a/projects/lib/src/lib/img/img.component.ts +++ b/projects/lib/src/lib/img/img.component.ts @@ -14,8 +14,8 @@ import { isPlatformServer } from '@angular/common'; templateUrl: './img.component.html', }) export class ImgComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy { - @ViewChild('imgElem', {static: false}) imgElem: ElementRef; - @ViewChild('pictureElem', {static: false}) pictureElem: ElementRef; + @ViewChild('imgElem') imgElem: ElementRef; + @ViewChild('pictureElem') pictureElem: ElementRef; @Input() src: string; @Input() class = ''; @Input() alt: string; diff --git a/projects/lib/tsconfig.lib.json b/projects/lib/tsconfig.lib.json index 3fe337f..a78ed73 100644 --- a/projects/lib/tsconfig.lib.json +++ b/projects/lib/tsconfig.lib.json @@ -18,7 +18,6 @@ ] }, "angularCompilerOptions": { - "annotateForClosureCompiler": true, "skipTemplateCodegen": true, "strictMetadataEmit": true, "fullTemplateTypeCheck": true, diff --git a/projects/lib/tsconfig.lib.prod.json b/projects/lib/tsconfig.lib.prod.json new file mode 100644 index 0000000..b1d501a --- /dev/null +++ b/projects/lib/tsconfig.lib.prod.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.lib.json", + "angularCompilerOptions": { + "enableIvy": false + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 9922421..f64bcd8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, - "module": "es2015", + "module": "esnext", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, From 3f3f52e71931ab7002d107dd8e810895a44bdd99 Mon Sep 17 00:00:00 2001 From: Tuan Duong Date: Wed, 20 Apr 2022 01:48:32 +0700 Subject: [PATCH 2/5] Update Angular to v10 --- package.json | 50 +++++++++---------- .../example/{browserslist => .browserslistrc} | 0 tsconfig.json | 2 +- tslint.json | 1 - 4 files changed, 26 insertions(+), 27 deletions(-) rename projects/example/{browserslist => .browserslistrc} (100%) diff --git a/package.json b/package.json index 86403f2..0dee585 100644 --- a/package.json +++ b/package.json @@ -19,45 +19,45 @@ }, "private": true, "dependencies": { - "@angular-devkit/build-angular": "~0.901.15", - "@angular/animations": "~9.1.13", - "@angular/common": "~9.1.13", - "@angular/compiler": "~9.1.13", - "@angular/core": "~9.1.13", - "@angular/forms": "~9.1.13", - "@angular/platform-browser": "~9.1.13", - "@angular/platform-browser-dynamic": "~9.1.13", - "@angular/router": "~9.1.13", + "@angular-devkit/build-angular": "~0.1002.4", + "@angular/animations": "~10.2.5", + "@angular/common": "~10.2.5", + "@angular/compiler": "~10.2.5", + "@angular/core": "~10.2.5", + "@angular/forms": "~10.2.5", + "@angular/platform-browser": "~10.2.5", + "@angular/platform-browser-dynamic": "~10.2.5", + "@angular/router": "~10.2.5", "core-js": "^3.6.5", "fibers": "^4.0.2", "highlight.js": "^9.18.1", "ng-lazyload-image": "^7.0.1", "ngx-highlightjs": "^3.0.3", "rxjs": "^6.5.5", - "tslib": "^1.10.0", + "tslib": "^2.3.1", "zone.js": "~0.10.2" }, "devDependencies": { - "@angular-devkit/build-ng-packagr": "~0.901.15", - "@angular/cli": "^9.1.15", - "@angular/compiler-cli": "~9.1.13", - "@angular/language-service": "~9.1.13", + "@angular-devkit/build-ng-packagr": "~0.1002.4", + "@angular/cli": "^10.2.4", + "@angular/compiler-cli": "~10.2.5", + "@angular/language-service": "~10.2.5", "@types/jasmine": "^3.5.10", "@types/jasminewd2": "^2.0.8", "@types/node": "^12.11.1", "codelyzer": "^5.1.2", "gh-pages": "^2.2.0", - "jasmine-core": "~3.4.0", - "jasmine-spec-reporter": "~4.2.1", - "karma": "~4.2.0", - "karma-chrome-launcher": "~3.0.0", - "karma-coverage-istanbul-reporter": "^2.1.1", - "karma-jasmine": "~2.0.1", - "karma-jasmine-html-reporter": "^1.5.3", - "ng-packagr": "^9.0.0", - "protractor": "^5.4.4", + "jasmine-core": "~3.5.0", + "jasmine-spec-reporter": "~5.0.0", + "karma": "~5.0.0", + "karma-chrome-launcher": "~3.1.0", + "karma-coverage-istanbul-reporter": "~3.0.2", + "karma-jasmine": "~4.0.0", + "karma-jasmine-html-reporter": "^1.5.0", + "ng-packagr": "^10.1.0", + "protractor": "~7.0.0", "ts-node": "~8.3.0", - "tslint": "~5.18.0", - "typescript": "~3.8.3" + "tslint": "~6.1.0", + "typescript": "~4.0.8" } } diff --git a/projects/example/browserslist b/projects/example/.browserslistrc similarity index 100% rename from projects/example/browserslist rename to projects/example/.browserslistrc diff --git a/tsconfig.json b/tsconfig.json index f64bcd8..8a33cff 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, - "module": "esnext", + "module": "es2020", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, diff --git a/tslint.json b/tslint.json index c740a7b..4370015 100644 --- a/tslint.json +++ b/tslint.json @@ -73,7 +73,6 @@ "no-trailing-whitespace": true, "no-unnecessary-initializer": true, "no-unused-expression": true, - "no-use-before-declare": true, "no-var-keyword": true, "object-literal-sort-keys": false, "one-line": [ From 450da596ffe87e2375e96ef3890d3e6cba6968b1 Mon Sep 17 00:00:00 2001 From: Tuan Duong Date: Wed, 20 Apr 2022 01:57:41 +0700 Subject: [PATCH 3/5] Update Angular to v11 --- angular.json | 3 +-- package.json | 39 +++++++++++++++-------------- projects/lib/tsconfig.lib.json | 1 + projects/lib/tsconfig.lib.prod.json | 3 +++ 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/angular.json b/angular.json index 00ebc82..ec54c3c 100644 --- a/angular.json +++ b/angular.json @@ -10,7 +10,7 @@ "prefix": "ci", "architect": { "build": { - "builder": "@angular-devkit/build-ng-packagr:build", + "builder": "@angular-devkit/build-angular:ng-packagr", "options": { "tsConfig": "projects/lib/tsconfig.lib.json", "project": "projects/lib/ng-package.json" @@ -80,7 +80,6 @@ "optimization": true, "outputHashing": "all", "sourceMap": false, - "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, diff --git a/package.json b/package.json index 0dee585..9566780 100644 --- a/package.json +++ b/package.json @@ -19,42 +19,43 @@ }, "private": true, "dependencies": { - "@angular-devkit/build-angular": "~0.1002.4", - "@angular/animations": "~10.2.5", - "@angular/common": "~10.2.5", - "@angular/compiler": "~10.2.5", - "@angular/core": "~10.2.5", - "@angular/forms": "~10.2.5", - "@angular/platform-browser": "~10.2.5", - "@angular/platform-browser-dynamic": "~10.2.5", - "@angular/router": "~10.2.5", + "@angular-devkit/build-angular": "~0.1102.19", + "@angular/animations": "~11.2.14", + "@angular/common": "~11.2.14", + "@angular/compiler": "~11.2.14", + "@angular/core": "~11.2.14", + "@angular/forms": "~11.2.14", + "@angular/platform-browser": "~11.2.14", + "@angular/platform-browser-dynamic": "~11.2.14", + "@angular/router": "~11.2.14", "core-js": "^3.6.5", "fibers": "^4.0.2", "highlight.js": "^9.18.1", "ng-lazyload-image": "^7.0.1", "ngx-highlightjs": "^3.0.3", "rxjs": "^6.5.5", - "tslib": "^2.3.1", + "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { - "@angular-devkit/build-ng-packagr": "~0.1002.4", - "@angular/cli": "^10.2.4", - "@angular/compiler-cli": "~10.2.5", - "@angular/language-service": "~10.2.5", - "@types/jasmine": "^3.5.10", + "@angular-devkit/build-angular": "~0.1102.18", + "@angular-devkit/core": "^13.3.3", + "@angular/cli": "^11.2.19", + "@angular/compiler-cli": "~11.2.14", + "@angular/language-service": "~11.2.14", + "@types/jasmine": "~3.6.0", "@types/jasminewd2": "^2.0.8", "@types/node": "^12.11.1", - "codelyzer": "^5.1.2", + "codelyzer": "^6.0.0", "gh-pages": "^2.2.0", - "jasmine-core": "~3.5.0", + "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", - "karma": "~5.0.0", + "karma": "~6.3.18", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", - "ng-packagr": "^10.1.0", + "ng-packagr": "^11.2.4", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", diff --git a/projects/lib/tsconfig.lib.json b/projects/lib/tsconfig.lib.json index a78ed73..009b845 100644 --- a/projects/lib/tsconfig.lib.json +++ b/projects/lib/tsconfig.lib.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "../../out-tsc/lib", + "declarationMap": true, "target": "es2015", "module": "es2015", "moduleResolution": "node", diff --git a/projects/lib/tsconfig.lib.prod.json b/projects/lib/tsconfig.lib.prod.json index b1d501a..2617a83 100644 --- a/projects/lib/tsconfig.lib.prod.json +++ b/projects/lib/tsconfig.lib.prod.json @@ -1,5 +1,8 @@ { "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, "angularCompilerOptions": { "enableIvy": false } From ffc3f5198cbfde3479c28b3fc9454853f59bb12b Mon Sep 17 00:00:00 2001 From: Tuan Duong Date: Wed, 20 Apr 2022 02:11:55 +0700 Subject: [PATCH 4/5] Update Angular to v12 --- angular.json | 13 +++++--- package.json | 31 +++++++++---------- .../example/src/environments/environment.ts | 2 +- projects/example/src/polyfills.ts | 2 +- projects/example/src/test.ts | 2 +- projects/lib/src/test.ts | 4 +-- projects/lib/tsconfig.lib.json | 1 - tsconfig.json | 1 - 8 files changed, 29 insertions(+), 27 deletions(-) diff --git a/angular.json b/angular.json index ec54c3c..b43d498 100644 --- a/angular.json +++ b/angular.json @@ -53,7 +53,6 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "aot": true, "outputPath": "dist/example", "index": "projects/example/src/index.html", "main": "projects/example/src/main.ts", @@ -67,7 +66,13 @@ "projects/example/src/styles.css", "./node_modules/highlight.js/styles/github.css" ], - "scripts": [] + "scripts": [], + "vendorChunk": true, + "extractLicenses": false, + "buildOptimizer": false, + "sourceMap": true, + "optimization": false, + "namedChunks": true }, "configurations": { "production": { @@ -81,7 +86,6 @@ "outputHashing": "all", "sourceMap": false, "namedChunks": false, - "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, @@ -97,7 +101,8 @@ } ] } - } + }, + "defaultConfiguration": "" }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", diff --git a/package.json b/package.json index 9566780..7702155 100644 --- a/package.json +++ b/package.json @@ -19,15 +19,15 @@ }, "private": true, "dependencies": { - "@angular-devkit/build-angular": "~0.1102.19", - "@angular/animations": "~11.2.14", - "@angular/common": "~11.2.14", - "@angular/compiler": "~11.2.14", - "@angular/core": "~11.2.14", - "@angular/forms": "~11.2.14", - "@angular/platform-browser": "~11.2.14", - "@angular/platform-browser-dynamic": "~11.2.14", - "@angular/router": "~11.2.14", + "@angular-devkit/build-angular": "~12.2.17", + "@angular/animations": "~12.2.16", + "@angular/common": "~12.2.16", + "@angular/compiler": "~12.2.16", + "@angular/core": "~12.2.16", + "@angular/forms": "~12.2.16", + "@angular/platform-browser": "~12.2.16", + "@angular/platform-browser-dynamic": "~12.2.16", + "@angular/router": "~12.2.16", "core-js": "^3.6.5", "fibers": "^4.0.2", "highlight.js": "^9.18.1", @@ -35,14 +35,13 @@ "ngx-highlightjs": "^3.0.3", "rxjs": "^6.5.5", "tslib": "^2.0.0", - "zone.js": "~0.10.2" + "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "~0.1102.18", "@angular-devkit/core": "^13.3.3", - "@angular/cli": "^11.2.19", - "@angular/compiler-cli": "~11.2.14", - "@angular/language-service": "~11.2.14", + "@angular/cli": "^12.2.17", + "@angular/compiler-cli": "~12.2.16", + "@angular/language-service": "~12.2.16", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "^2.0.8", "@types/node": "^12.11.1", @@ -55,10 +54,10 @@ "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", - "ng-packagr": "^11.2.4", + "ng-packagr": "^12.2.7", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", - "typescript": "~4.0.8" + "typescript": "~4.3.5" } } diff --git a/projects/example/src/environments/environment.ts b/projects/example/src/environments/environment.ts index 7b4f817..30d7bcc 100644 --- a/projects/example/src/environments/environment.ts +++ b/projects/example/src/environments/environment.ts @@ -13,4 +13,4 @@ export const environment = { * This import should be commented out in production mode because it will have a negative impact * on performance if an error is thrown. */ -// import 'zone.js/dist/zone-error'; // Included with Angular CLI. +// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. diff --git a/projects/example/src/polyfills.ts b/projects/example/src/polyfills.ts index a6d34ea..218a01c 100644 --- a/projects/example/src/polyfills.ts +++ b/projects/example/src/polyfills.ts @@ -77,7 +77,7 @@ /*************************************************************************************************** * 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/projects/example/src/test.ts b/projects/example/src/test.ts index 1631789..a6f15af 100644 --- a/projects/example/src/test.ts +++ b/projects/example/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, diff --git a/projects/lib/src/test.ts b/projects/lib/src/test.ts index e11ff1c..b1cc186 100644 --- a/projects/lib/src/test.ts +++ b/projects/lib/src/test.ts @@ -1,8 +1,8 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files import 'core-js/es7/reflect'; -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/projects/lib/tsconfig.lib.json b/projects/lib/tsconfig.lib.json index 009b845..f689945 100644 --- a/projects/lib/tsconfig.lib.json +++ b/projects/lib/tsconfig.lib.json @@ -9,7 +9,6 @@ "declaration": true, "sourceMap": true, "inlineSources": true, - "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, "types": [], diff --git a/tsconfig.json b/tsconfig.json index 8a33cff..ebe2fa2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,6 @@ "declaration": false, "module": "es2020", "moduleResolution": "node", - "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, "target": "es5", From 9ee124646f9bddf42c8f874cd0eb4bd16a392d1e Mon Sep 17 00:00:00 2001 From: Tuan Duong Date: Wed, 20 Apr 2022 02:18:56 +0700 Subject: [PATCH 5/5] Update Angular to v13 --- .gitignore | 1 + angular.json | 33 ----------------------------- package.json | 29 ++++++++++++------------- projects/example/src/polyfills.ts | 10 --------- projects/example/src/test.ts | 4 +++- projects/lib/ng-package.json | 2 +- projects/lib/src/test.ts | 4 +++- projects/lib/tsconfig.lib.prod.json | 2 +- 8 files changed, 23 insertions(+), 62 deletions(-) diff --git a/.gitignore b/.gitignore index e50b457..7b821e4 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ speed-measure-plugin.json !.vscode/extensions.json # misc +/.angular/cache /.sass-cache /connect.lock /coverage diff --git a/angular.json b/angular.json index b43d498..aeb17a5 100644 --- a/angular.json +++ b/angular.json @@ -28,18 +28,6 @@ "tsConfig": "projects/lib/tsconfig.spec.json", "karmaConfig": "projects/lib/karma.conf.js" } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "projects/lib/tsconfig.lib.json", - "projects/lib/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } } } }, @@ -137,18 +125,6 @@ "projects/example/src/assets" ] } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "projects/example/tsconfig.app.json", - "projects/example/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } } } }, @@ -168,15 +144,6 @@ "devServerTarget": "example:serve:production" } } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": "projects/example-e2e/tsconfig.e2e.json", - "exclude": [ - "**/node_modules/**" - ] - } } } } diff --git a/package.json b/package.json index 7702155..c76a814 100644 --- a/package.json +++ b/package.json @@ -19,15 +19,15 @@ }, "private": true, "dependencies": { - "@angular-devkit/build-angular": "~12.2.17", - "@angular/animations": "~12.2.16", - "@angular/common": "~12.2.16", - "@angular/compiler": "~12.2.16", - "@angular/core": "~12.2.16", - "@angular/forms": "~12.2.16", - "@angular/platform-browser": "~12.2.16", - "@angular/platform-browser-dynamic": "~12.2.16", - "@angular/router": "~12.2.16", + "@angular-devkit/build-angular": "~13.3.3", + "@angular/animations": "~13.3.3", + "@angular/common": "~13.3.3", + "@angular/compiler": "~13.3.3", + "@angular/core": "~13.3.3", + "@angular/forms": "~13.3.3", + "@angular/platform-browser": "~13.3.3", + "@angular/platform-browser-dynamic": "~13.3.3", + "@angular/router": "~13.3.3", "core-js": "^3.6.5", "fibers": "^4.0.2", "highlight.js": "^9.18.1", @@ -38,10 +38,9 @@ "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/core": "^13.3.3", - "@angular/cli": "^12.2.17", - "@angular/compiler-cli": "~12.2.16", - "@angular/language-service": "~12.2.16", + "@angular/cli": "^13.3.3", + "@angular/compiler-cli": "~13.3.3", + "@angular/language-service": "~13.3.3", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "^2.0.8", "@types/node": "^12.11.1", @@ -54,10 +53,10 @@ "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", - "ng-packagr": "^12.2.7", + "ng-packagr": "^13.3.1", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", - "typescript": "~4.3.5" + "typescript": "~4.6.3" } } diff --git a/projects/example/src/polyfills.ts b/projects/example/src/polyfills.ts index 218a01c..0d7df7f 100644 --- a/projects/example/src/polyfills.ts +++ b/projects/example/src/polyfills.ts @@ -37,19 +37,9 @@ // import 'core-js/es6/weak-map'; // import 'core-js/es6/set'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. - /** IE10 and IE11 requires the following for the Reflect API. */ // import 'core-js/es6/reflect'; -/** - * Web Animations `@angular/platform-browser/animations` - * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. - * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). - */ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - /** * By default, zone.js will patch all possible macroTask and DomEvents * user can disable parts of macroTask/DomEvents patch by setting following flags diff --git a/projects/example/src/test.ts b/projects/example/src/test.ts index a6f15af..6b03dbe 100644 --- a/projects/example/src/test.ts +++ b/projects/example/src/test.ts @@ -12,7 +12,9 @@ declare const require: any; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, - platformBrowserDynamicTesting() + platformBrowserDynamicTesting(), { + teardown: { destroyAfterEach: false } +} ); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); diff --git a/projects/lib/ng-package.json b/projects/lib/ng-package.json index 5ffccff..2fdd5b8 100644 --- a/projects/lib/ng-package.json +++ b/projects/lib/ng-package.json @@ -4,5 +4,5 @@ "lib": { "entryFile": "src/public_api.ts" }, - "whitelistedNonPeerDependencies": ["ng-lazyload-image"] + "allowedNonPeerDependencies": ["ng-lazyload-image"] } diff --git a/projects/lib/src/test.ts b/projects/lib/src/test.ts index b1cc186..8bc9acb 100644 --- a/projects/lib/src/test.ts +++ b/projects/lib/src/test.ts @@ -14,7 +14,9 @@ declare const require: any; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, - platformBrowserDynamicTesting() + platformBrowserDynamicTesting(), { + teardown: { destroyAfterEach: false } +} ); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); diff --git a/projects/lib/tsconfig.lib.prod.json b/projects/lib/tsconfig.lib.prod.json index 2617a83..6330633 100644 --- a/projects/lib/tsconfig.lib.prod.json +++ b/projects/lib/tsconfig.lib.prod.json @@ -4,6 +4,6 @@ "declarationMap": false }, "angularCompilerOptions": { - "enableIvy": false + "compilationMode": "partial" } } \ No newline at end of file