From 22a4916ac379ae397fb39a5cf16987c469938516 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 21 Apr 2020 16:25:29 +0300 Subject: [PATCH 1/7] chore: upgrade typescript version --- templates/module/angular/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/module/angular/package.json b/templates/module/angular/package.json index a8d63e389d..56812cb9ca 100644 --- a/templates/module/angular/package.json +++ b/templates/module/angular/package.json @@ -13,10 +13,10 @@ "private": true, "dependencies": { "@abp/ng.account": "~2.6.0", - "@abp/ng.theme.basic": "~2.6.0", "@abp/ng.identity": "~2.6.0", - "@abp/ng.tenant-management": "~2.6.0", "@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", @@ -55,6 +55,6 @@ "ts-node": "~7.0.0", "tsickle": "^0.37.0", "tslint": "~5.15.0", - "typescript": "~3.5.3" + "typescript": "~3.8.3" } } From 76361fb6fb89a13c04afaa04b37feebb1cc9c3d7 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 21 Apr 2020 16:31:11 +0300 Subject: [PATCH 2/7] fix(module-template): fix some bugs in module template --- templates/app/angular/angular.json | 24 ++++++-- templates/module/angular/angular.json | 60 ++++++++++--------- templates/module/angular/package.json | 4 +- .../module/angular/src/app/app.component.ts | 19 +++++- .../angular/src/app/shared/shared.module.ts | 3 - .../src/environments/environment.hmr.ts | 25 -------- .../src/environments/environment.prod.ts | 1 - .../angular/src/environments/environment.ts | 1 - templates/module/angular/src/main.ts | 13 +--- .../appsettings.json | 4 +- .../appsettings.json | 4 +- 11 files changed, 77 insertions(+), 81 deletions(-) delete mode 100644 templates/module/angular/src/environments/environment.hmr.ts diff --git a/templates/app/angular/angular.json b/templates/app/angular/angular.json index e66c47ad63..567b8f95c7 100644 --- a/templates/app/angular/angular.json +++ b/templates/app/angular/angular.json @@ -26,8 +26,12 @@ "extractCss": true, "assets": ["src/favicon.ico", "src/assets"], "styles": [ + { + "input": "node_modules/bootstrap/dist/css/bootstrap.min.css", + "inject": true, + "bundleName": "bootstrap.min" + }, "src/styles.scss", - "node_modules/bootstrap/dist/css/bootstrap.min.css", { "input": "node_modules/@fortawesome/fontawesome-free/css/all.min.css", "inject": false, @@ -98,10 +102,22 @@ "karmaConfig": "karma.conf.js", "assets": ["src/favicon.ico", "src/assets"], "styles": [ + { + "input": "node_modules/bootstrap/dist/css/bootstrap.min.css", + "inject": true, + "bundleName": "bootstrap.min" + }, "src/styles.scss", - "node_modules/bootstrap/dist/css/bootstrap.min.css", - "node_modules/@fortawesome/fontawesome-free/css/all.min.css", - "node_modules/@fortawesome/fontawesome-free/css/v4-shims.min.css" + { + "input": "node_modules/@fortawesome/fontawesome-free/css/all.min.css", + "inject": false, + "bundleName": "fontawesome-all.min" + }, + { + "input": "node_modules/@fortawesome/fontawesome-free/css/v4-shims.min.css", + "inject": false, + "bundleName": "fontawesome-v4-shims.min" + } ], "scripts": [] } diff --git a/templates/module/angular/angular.json b/templates/module/angular/angular.json index 1f298b967c..cd9a9ed936 100644 --- a/templates/module/angular/angular.json +++ b/templates/module/angular/angular.json @@ -26,12 +26,22 @@ "extractCss": true, "assets": ["src/favicon.ico", "src/assets"], "styles": [ + { + "input": "node_modules/bootstrap/dist/css/bootstrap.min.css", + "inject": true, + "bundleName": "bootstrap.min" + }, "src/styles.scss", - "node_modules/bootstrap/dist/css/bootstrap.min.css", - "node_modules/font-awesome/css/font-awesome.min.css", - "node_modules/primeng/resources/themes/nova-light/theme.css", - "node_modules/primeicons/primeicons.css", - "node_modules/primeng/resources/primeng.min.css" + { + "input": "node_modules/@fortawesome/fontawesome-free/css/all.min.css", + "inject": false, + "bundleName": "fontawesome-all.min" + }, + { + "input": "node_modules/@fortawesome/fontawesome-free/css/v4-shims.min.css", + "inject": false, + "bundleName": "fontawesome-v4-shims.min" + } ], "scripts": [] }, @@ -59,14 +69,6 @@ "maximumError": "5mb" } ] - }, - "hmr": { - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.hmr.ts" - } - ] } } }, @@ -78,10 +80,6 @@ "configurations": { "production": { "browserTarget": "myProjectName:build:production" - }, - "hmr": { - "hmr": true, - "browserTarget": "myProjectName:build:hmr" } } }, @@ -100,12 +98,22 @@ "karmaConfig": "karma.conf.js", "assets": ["src/favicon.ico", "src/assets"], "styles": [ + { + "input": "node_modules/bootstrap/dist/css/bootstrap.min.css", + "inject": true, + "bundleName": "bootstrap.min" + }, "src/styles.scss", - "node_modules/bootstrap/dist/css/bootstrap.min.css", - "node_modules/font-awesome/css/font-awesome.min.css", - "node_modules/primeng/resources/themes/nova-light/theme.css", - "node_modules/primeicons/primeicons.css", - "node_modules/primeng/resources/primeng.min.css" + { + "input": "node_modules/@fortawesome/fontawesome-free/css/all.min.css", + "inject": false, + "bundleName": "fontawesome-all.min" + }, + { + "input": "node_modules/@fortawesome/fontawesome-free/css/v4-shims.min.css", + "inject": false, + "bundleName": "fontawesome-v4-shims.min" + } ], "scripts": [] } @@ -159,9 +167,7 @@ "projects/my-project-name/tsconfig.lib.json", "projects/my-project-name/tsconfig.spec.json" ], - "exclude": [ - "**/node_modules/**" - ] + "exclude": ["**/node_modules/**"] } } } @@ -194,9 +200,7 @@ "projects/my-project-name-config/tsconfig.lib.json", "projects/my-project-name-config/tsconfig.spec.json" ], - "exclude": [ - "**/node_modules/**" - ] + "exclude": ["**/node_modules/**"] } } } diff --git a/templates/module/angular/package.json b/templates/module/angular/package.json index 56812cb9ca..435df6136e 100644 --- a/templates/module/angular/package.json +++ b/templates/module/angular/package.json @@ -4,7 +4,7 @@ "scripts": { "ng": "ng", "start": "ng serve", - "start:hmr": "ng serve --configuration hmr", + "start:hmr": "ng serve --open", "build": "ng build my-project-name", "test": "ng test my-project-name", "lint": "ng lint my-project-name", @@ -35,8 +35,6 @@ "@angular/cli": "~8.3.20", "@angular/compiler-cli": "~8.2.14", "@angular/language-service": "~8.2.14", - "@angularclass/hmr": "^2.1.3", - "@ngxs/hmr-plugin": "^3.5.0", "@ngxs/logger-plugin": "^3.5.1", "@types/jasmine": "~3.3.8", "@types/jasminewd2": "~2.0.3", diff --git a/templates/module/angular/src/app/app.component.ts b/templates/module/angular/src/app/app.component.ts index bf2a27962a..8187365734 100644 --- a/templates/module/angular/src/app/app.component.ts +++ b/templates/module/angular/src/app/app.component.ts @@ -1,4 +1,6 @@ -import { Component } from '@angular/core'; +import { LazyLoadService, LOADING_STRATEGY } from '@abp/ng.core'; +import { Component, OnInit } from '@angular/core'; +import { forkJoin } from 'rxjs'; @Component({ selector: 'app-root', @@ -7,4 +9,17 @@ import { Component } from '@angular/core'; `, }) -export class AppComponent {} +export class AppComponent implements OnInit { + constructor(private lazyLoadService: LazyLoadService) {} + + ngOnInit() { + forkJoin( + this.lazyLoadService.load( + LOADING_STRATEGY.PrependAnonymousStyleToHead('fontawesome-v4-shims.min.css'), + ), + this.lazyLoadService.load( + LOADING_STRATEGY.PrependAnonymousStyleToHead('fontawesome-all.min.css'), + ), + ).subscribe(); + } +} diff --git a/templates/module/angular/src/app/shared/shared.module.ts b/templates/module/angular/src/app/shared/shared.module.ts index 6c4c9b016c..1f268b4572 100644 --- a/templates/module/angular/src/app/shared/shared.module.ts +++ b/templates/module/angular/src/app/shared/shared.module.ts @@ -3,7 +3,6 @@ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { NgModule } from '@angular/core'; import { ThemeBasicModule } from '@abp/ng.theme.basic'; import { ThemeSharedModule } from '@abp/ng.theme.shared'; -import { TableModule } from 'primeng/table'; import { NgxValidateCoreModule } from '@ngx-validate/core'; @NgModule({ @@ -12,7 +11,6 @@ import { NgxValidateCoreModule } from '@ngx-validate/core'; CoreModule, ThemeSharedModule, ThemeBasicModule, - TableModule, NgbDropdownModule, NgxValidateCoreModule, ], @@ -20,7 +18,6 @@ import { NgxValidateCoreModule } from '@ngx-validate/core'; CoreModule, ThemeSharedModule, ThemeBasicModule, - TableModule, NgbDropdownModule, NgxValidateCoreModule, ], diff --git a/templates/module/angular/src/environments/environment.hmr.ts b/templates/module/angular/src/environments/environment.hmr.ts deleted file mode 100644 index 4c6c9fd343..0000000000 --- a/templates/module/angular/src/environments/environment.hmr.ts +++ /dev/null @@ -1,25 +0,0 @@ -export const environment = { - production: false, - hmr: true, - application: { - name: 'MyProjectName', - logoUrl: '', - }, - oAuthConfig: { - issuer: 'https://localhost:44301', - clientId: 'MyProjectName_ConsoleTestApp', - dummyClientSecret: '1q2w3e*', - scope: 'MyProjectName', - showDebugInformation: true, - oidc: false, - requireHttps: true, - }, - apis: { - default: { - url: 'https://localhost:44300', - }, - }, - localization: { - defaultResourceName: 'MyProjectName', - }, -}; diff --git a/templates/module/angular/src/environments/environment.prod.ts b/templates/module/angular/src/environments/environment.prod.ts index 093c7f6f98..ce43f45c24 100644 --- a/templates/module/angular/src/environments/environment.prod.ts +++ b/templates/module/angular/src/environments/environment.prod.ts @@ -1,6 +1,5 @@ export const environment = { production: true, - hmr: false, application: { name: 'MyProjectName', logoUrl: '', diff --git a/templates/module/angular/src/environments/environment.ts b/templates/module/angular/src/environments/environment.ts index 2fe4e73868..f1c21c40ac 100644 --- a/templates/module/angular/src/environments/environment.ts +++ b/templates/module/angular/src/environments/environment.ts @@ -1,6 +1,5 @@ export const environment = { production: false, - hmr: false, application: { name: 'MyProjectName', logoUrl: '', diff --git a/templates/module/angular/src/main.ts b/templates/module/angular/src/main.ts index bbdf75c32d..d9a2e7e4a5 100644 --- a/templates/module/angular/src/main.ts +++ b/templates/module/angular/src/main.ts @@ -1,20 +1,13 @@ import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { BootstrapModuleFn as Bootstrap, hmr, WebpackModule } from '@ngxs/hmr-plugin'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; -declare const module: WebpackModule; - if (environment.production) { enableProdMode(); } -const bootstrap: Bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule); - -if (environment.hmr) { - hmr(module, bootstrap).catch(err => console.error(err)); -} else { - bootstrap().catch(err => console.log(err)); -} +platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch((err) => console.error(err)); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json index 6dceb9c4b9..6152adf169 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json @@ -3,7 +3,7 @@ "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200" }, "ConnectionStrings": { - "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName_Main;Trusted_Connection=True;MultipleActiveResultSets=true", + "Default": "Server=localhost;Database=MyProjectName_Main;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true", "MyProjectName": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName_Module;Trusted_Connection=True;MultipleActiveResultSets=true" }, "Redis": { @@ -12,4 +12,4 @@ "AuthServer": { "Authority": "https://localhost:44301/" } -} \ No newline at end of file +} diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/appsettings.json b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/appsettings.json index 0386db1e6a..f880341925 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/appsettings.json +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/appsettings.json @@ -5,7 +5,7 @@ }, "AppSelfUrl": "https://localhost:44301/", "ConnectionStrings": { - "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName_Main;Trusted_Connection=True;MultipleActiveResultSets=true" + "Default": "Server=localhost;Database=MyProjectName_Main;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true" }, "Redis": { "Configuration": "127.0.0.1" @@ -25,4 +25,4 @@ } } } -} \ No newline at end of file +} From 86d7a5eeb79dae2c9f7235e61be7f42a82ace025 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 21 Apr 2020 16:32:37 +0300 Subject: [PATCH 3/7] fix: undo appsettings files changes --- .../MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json | 2 +- .../MyCompanyName.MyProjectName.IdentityServer/appsettings.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json index 6152adf169..ed2fa02f22 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json @@ -3,7 +3,7 @@ "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200" }, "ConnectionStrings": { - "Default": "Server=localhost;Database=MyProjectName_Main;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true", + "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName_Main;Trusted_Connection=True;MultipleActiveResultSets=true", "MyProjectName": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName_Module;Trusted_Connection=True;MultipleActiveResultSets=true" }, "Redis": { diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/appsettings.json b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/appsettings.json index f880341925..d3a8325f90 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/appsettings.json +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/appsettings.json @@ -5,7 +5,7 @@ }, "AppSelfUrl": "https://localhost:44301/", "ConnectionStrings": { - "Default": "Server=localhost;Database=MyProjectName_Main;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true" + "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName_Main;Trusted_Connection=True;MultipleActiveResultSets=true" }, "Redis": { "Configuration": "127.0.0.1" From 60e1fb7a71376f1943827a3100e55121fdc4e437 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 21 Apr 2020 16:33:22 +0300 Subject: [PATCH 4/7] chore: update pofyfills.ts --- templates/module/angular/src/polyfills.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/module/angular/src/polyfills.ts b/templates/module/angular/src/polyfills.ts index aa665d6b87..6e00c561ed 100644 --- a/templates/module/angular/src/polyfills.ts +++ b/templates/module/angular/src/polyfills.ts @@ -1,3 +1,7 @@ +/*************************************************************************************************** + * Load `$localize` onto the global scope - used if i18n tags appear in Angular templates. + */ +import '@angular/localize/init'; /** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. @@ -35,7 +39,7 @@ * will put import in the top of bundle, so user need to create a separate file * in this directory (for example: zone-flags.ts), and put the following flags * into that file, and then add the following code before importing zone.js. - * import './zone-flags.ts'; + * import './zone-flags'; * * The flags allowed in zone-flags.ts are listed here. * @@ -55,8 +59,7 @@ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - +import 'zone.js/dist/zone'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS From 5b6d417fa36bab30e1a3462aba4d4b8328b39516 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 21 Apr 2020 17:13:52 +0300 Subject: [PATCH 5/7] 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"] } From de1ae0ac6bc9909f506156e7aeee125f6ec5309a Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 21 Apr 2020 17:20:13 +0300 Subject: [PATCH 6/7] chore(module-template): update npm scripts --- templates/module/angular/package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/module/angular/package.json b/templates/module/angular/package.json index ef0dec09c1..06812af67d 100644 --- a/templates/module/angular/package.json +++ b/templates/module/angular/package.json @@ -1,14 +1,14 @@ { - "name": "my-project-name", + "name": "MyProjectName", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "start:hmr": "ng serve --open", - "build": "ng build my-project-name", - "test": "ng test my-project-name", - "lint": "ng lint my-project-name", - "e2e": "ng e2e my-project-name" + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" }, "private": true, "dependencies": { @@ -54,4 +54,4 @@ "tslint": "~5.15.0", "typescript": "~3.8.3" } -} \ No newline at end of file +} From 5a7d399901f9d392ca0f8297d72302ff51def43f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levent=20Arman=20=C3=96zak?= Date: Wed, 22 Apr 2020 10:16:35 +0300 Subject: [PATCH 7/7] add parentheses to forkJoin --- templates/module/angular/src/app/app.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/module/angular/src/app/app.component.ts b/templates/module/angular/src/app/app.component.ts index 8187365734..1cf17b8116 100644 --- a/templates/module/angular/src/app/app.component.ts +++ b/templates/module/angular/src/app/app.component.ts @@ -13,13 +13,13 @@ export class AppComponent implements OnInit { constructor(private lazyLoadService: LazyLoadService) {} ngOnInit() { - forkJoin( + forkJoin([ this.lazyLoadService.load( LOADING_STRATEGY.PrependAnonymousStyleToHead('fontawesome-v4-shims.min.css'), ), this.lazyLoadService.load( LOADING_STRATEGY.PrependAnonymousStyleToHead('fontawesome-all.min.css'), ), - ).subscribe(); + ]).subscribe(); } }