From 5b6d417fa36bab30e1a3462aba4d4b8328b39516 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 21 Apr 2020 17:13:52 +0300 Subject: [PATCH] feat(module-template): upgrade angular version to v9 --- templates/module/angular/angular.json | 52 +++++++++++++++---- templates/module/angular/package.json | 39 +++++++------- .../my-project-name-config/tsconfig.lib.json | 1 - .../tsconfig.lib.prod.json | 6 +++ .../my-project-name/tsconfig.lib.json | 1 - .../my-project-name/tsconfig.lib.prod.json | 6 +++ templates/module/angular/tsconfig.app.json | 7 ++- 7 files changed, 78 insertions(+), 34 deletions(-) create mode 100644 templates/module/angular/projects/my-project-name-config/tsconfig.lib.prod.json create mode 100644 templates/module/angular/projects/my-project-name/tsconfig.lib.prod.json diff --git a/templates/module/angular/angular.json b/templates/module/angular/angular.json index cd9a9ed936..7120592c4d 100644 --- a/templates/module/angular/angular.json +++ b/templates/module/angular/angular.json @@ -22,9 +22,12 @@ "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", - "aot": false, + "aot": true, "extractCss": true, - "assets": ["src/favicon.ico", "src/assets"], + "assets": [ + "src/favicon.ico", + "src/assets" + ], "styles": [ { "input": "node_modules/bootstrap/dist/css/bootstrap.min.css", @@ -58,7 +61,6 @@ "sourceMap": false, "extractCss": true, "namedChunks": false, - "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, @@ -67,6 +69,10 @@ "type": "initial", "maximumWarning": "2mb", "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" } ] } @@ -96,7 +102,10 @@ "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", - "assets": ["src/favicon.ico", "src/assets"], + "assets": [ + "src/favicon.ico", + "src/assets" + ], "styles": [ { "input": "node_modules/bootstrap/dist/css/bootstrap.min.css", @@ -121,8 +130,14 @@ "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { - "tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"], - "exclude": ["**/node_modules/**"] + "tsConfig": [ + "tsconfig.app.json", + "tsconfig.spec.json", + "e2e/tsconfig.json" + ], + "exclude": [ + "**/node_modules/**" + ] } }, "e2e": { @@ -150,6 +165,11 @@ "options": { "tsConfig": "projects/my-project-name/tsconfig.lib.json", "project": "projects/my-project-name/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "projects/my-project-name/tsconfig.lib.prod.json" + } } }, "test": { @@ -167,7 +187,9 @@ "projects/my-project-name/tsconfig.lib.json", "projects/my-project-name/tsconfig.spec.json" ], - "exclude": ["**/node_modules/**"] + "exclude": [ + "**/node_modules/**" + ] } } } @@ -183,6 +205,11 @@ "options": { "tsConfig": "projects/my-project-name-config/tsconfig.lib.json", "project": "projects/my-project-name-config/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "projects/my-project-name-config/tsconfig.lib.prod.json" + } } }, "test": { @@ -200,11 +227,16 @@ "projects/my-project-name-config/tsconfig.lib.json", "projects/my-project-name-config/tsconfig.spec.json" ], - "exclude": ["**/node_modules/**"] + "exclude": [ + "**/node_modules/**" + ] } } } } }, - "defaultProject": "myProjectName" -} + "defaultProject": "myProjectName", + "cli": { + "analytics": false + } +} \ No newline at end of file diff --git a/templates/module/angular/package.json b/templates/module/angular/package.json index 435df6136e..ef0dec09c1 100644 --- a/templates/module/angular/package.json +++ b/templates/module/angular/package.json @@ -17,29 +17,29 @@ "@abp/ng.setting-management": "~2.6.0", "@abp/ng.tenant-management": "~2.6.0", "@abp/ng.theme.basic": "~2.6.0", - "@angular/animations": "~8.2.14", - "@angular/common": "~8.2.14", - "@angular/compiler": "~8.2.14", - "@angular/core": "~8.2.14", - "@angular/forms": "~8.2.14", - "@angular/platform-browser": "~8.2.14", - "@angular/platform-browser-dynamic": "~8.2.14", - "@angular/router": "~8.2.14", - "rxjs": "~6.4.0", + "@angular/animations": "~9.1.2", + "@angular/common": "~9.1.2", + "@angular/compiler": "~9.1.2", + "@angular/core": "~9.1.2", + "@angular/forms": "~9.1.2", + "@angular/platform-browser": "~9.1.2", + "@angular/platform-browser-dynamic": "~9.1.2", + "@angular/router": "~9.1.2", + "rxjs": "~6.5.5", "tslib": "^1.10.0", - "zone.js": "~0.9.1" + "zone.js": "~0.10.2" }, "devDependencies": { - "@angular-devkit/build-angular": "~0.803.20", - "@angular-devkit/build-ng-packagr": "~0.803.20", - "@angular/cli": "~8.3.20", - "@angular/compiler-cli": "~8.2.14", - "@angular/language-service": "~8.2.14", + "@angular-devkit/build-angular": "~0.901.1", + "@angular-devkit/build-ng-packagr": "~0.901.1", + "@angular/cli": "~9.1.1", + "@angular/compiler-cli": "~9.1.2", + "@angular/language-service": "~9.1.2", "@ngxs/logger-plugin": "^3.5.1", "@types/jasmine": "~3.3.8", "@types/jasminewd2": "~2.0.3", - "@types/node": "~8.9.4", - "codelyzer": "^5.0.0", + "@types/node": "^12.11.1", + "codelyzer": "^5.1.2", "jasmine-core": "~3.4.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.1.0", @@ -47,12 +47,11 @@ "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", - "ng-packagr": "^5.7.1", + "ng-packagr": "^9.0.0", "ngxs-schematic": "^1.1.9", "protractor": "~5.4.0", "ts-node": "~7.0.0", - "tsickle": "^0.37.0", "tslint": "~5.15.0", "typescript": "~3.8.3" } -} +} \ No newline at end of file diff --git a/templates/module/angular/projects/my-project-name-config/tsconfig.lib.json b/templates/module/angular/projects/my-project-name-config/tsconfig.lib.json index bd23948e59..0e0b9c45d1 100644 --- a/templates/module/angular/projects/my-project-name-config/tsconfig.lib.json +++ b/templates/module/angular/projects/my-project-name-config/tsconfig.lib.json @@ -12,7 +12,6 @@ ] }, "angularCompilerOptions": { - "annotateForClosureCompiler": true, "skipTemplateCodegen": true, "strictMetadataEmit": true, "fullTemplateTypeCheck": true, diff --git a/templates/module/angular/projects/my-project-name-config/tsconfig.lib.prod.json b/templates/module/angular/projects/my-project-name-config/tsconfig.lib.prod.json new file mode 100644 index 0000000000..b1d501abbc --- /dev/null +++ b/templates/module/angular/projects/my-project-name-config/tsconfig.lib.prod.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.lib.json", + "angularCompilerOptions": { + "enableIvy": false + } +} \ No newline at end of file diff --git a/templates/module/angular/projects/my-project-name/tsconfig.lib.json b/templates/module/angular/projects/my-project-name/tsconfig.lib.json index bd23948e59..0e0b9c45d1 100644 --- a/templates/module/angular/projects/my-project-name/tsconfig.lib.json +++ b/templates/module/angular/projects/my-project-name/tsconfig.lib.json @@ -12,7 +12,6 @@ ] }, "angularCompilerOptions": { - "annotateForClosureCompiler": true, "skipTemplateCodegen": true, "strictMetadataEmit": true, "fullTemplateTypeCheck": true, diff --git a/templates/module/angular/projects/my-project-name/tsconfig.lib.prod.json b/templates/module/angular/projects/my-project-name/tsconfig.lib.prod.json new file mode 100644 index 0000000000..b1d501abbc --- /dev/null +++ b/templates/module/angular/projects/my-project-name/tsconfig.lib.prod.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.lib.json", + "angularCompilerOptions": { + "enableIvy": false + } +} \ No newline at end of file diff --git a/templates/module/angular/tsconfig.app.json b/templates/module/angular/tsconfig.app.json index b750221da5..9fa880f878 100644 --- a/templates/module/angular/tsconfig.app.json +++ b/templates/module/angular/tsconfig.app.json @@ -4,6 +4,9 @@ "outDir": "./out-tsc/app", "types": ["node"] }, - "include": ["src/**/*.ts"], - "exclude": ["src/test.ts", "src/**/*.spec.ts"] + "files": [ + "src/main.ts", + "src/polyfills.ts" + ], + "include": ["src/**/*.d.ts"] }