From 3779e0a3acacf57ced23540c2b79d9e5f51a1d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=89=B2?= Date: Thu, 1 Jun 2023 15:33:22 +0800 Subject: [PATCH] chore: bump angular from 15 to 16 (#1599) --- .eslintrc.js | 3 +- .vscode/settings.json | 3 +- package.json | 114 +++++++++--------- packages/abc/date-picker/range.directive.ts | 2 +- packages/abc/down-file/down-file.directive.ts | 2 +- packages/abc/let/let.directive.ts | 2 +- packages/abc/loading/loading.module.ts | 1 - packages/abc/loading/style/index.less | 5 +- packages/abc/onboarding/onboarding.module.ts | 1 - packages/abc/onboarding/style/index.less | 5 +- packages/abc/st/st.component.ts | 6 +- packages/form/src/module.ts | 3 +- packages/theme/system/utils/_other.less | 5 +- packages/theme/system/widgets/_abs.less | 5 +- schematics/migration.json | 8 +- schematics/ng-add/index.ts | 2 +- .../ng-update/data/attribute-selectors.ts | 2 +- schematics/ng-update/data/class-names.ts | 2 +- .../ng-update/data/constructor-checks.ts | 2 +- schematics/ng-update/data/css-selectors.ts | 2 +- .../ng-update/data/element-selectors.ts | 2 +- schematics/ng-update/data/input-names.ts | 2 +- .../ng-update/data/method-call-checks.ts | 2 +- schematics/ng-update/data/output-names.ts | 2 +- schematics/ng-update/data/property-names.ts | 2 +- schematics/ng-update/index.ts | 6 +- .../ng-update/upgrade-rules/v15/index.ts | 19 +-- scripts/site/tsconfig.json | 1 - src/app/app.module.ts | 3 +- .../shared/json-schema/json-schema.module.ts | 1 - src/app/shared/shared.module.ts | 1 - src/templates/examples.ts | 3 +- tsconfig.json | 4 +- 33 files changed, 97 insertions(+), 126 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 768721366a..ec272ae71f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -171,7 +171,8 @@ module.exports = { '@angular-eslint/no-input-rename': 'off', 'prefer-const': 'off', 'max-len': 'off', - 'deprecation/deprecation': 'warn' + 'deprecation/deprecation': 'warn', + 'jsdoc/newline-after-description': 'off' } }, { diff --git a/.vscode/settings.json b/.vscode/settings.json index 6d741696f7..4a1e42c9c9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,5 +32,6 @@ "*.json": "jsonc", ".prettierrc": "json", ".stylelintrc": "json" - } + }, + "angular.enable-strict-mode-prompt": false } diff --git a/package.json b/package.json index e9f23ff890..5ada15adc2 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "homepage": "https://ng-alain.com", "engines": { - "node": "^16.10.0 || ^18.10.0", + "node": "^16.13.0 || ^18.10.0", "yarn": ">=1.21.1 <2", "npm": "Please use yarn instead of NPM to install dependencies" }, @@ -57,61 +57,61 @@ "ssr:prerender": "ng run site:prerender" }, "dependencies": { - "@angular/animations": "^15.1.0", - "@angular/common": "^15.1.0", - "@angular/compiler": "^15.1.0", - "@angular/core": "^15.1.0", - "@angular/forms": "^15.1.0", - "@angular/platform-browser": "^15.1.0", - "@angular/platform-browser-dynamic": "^15.1.0", - "@angular/router": "^15.1.0", + "@angular/animations": "^16.0.3", + "@angular/common": "^16.0.3", + "@angular/compiler": "^16.0.3", + "@angular/core": "^16.0.3", + "@angular/forms": "^16.0.3", + "@angular/platform-browser": "^16.0.3", + "@angular/platform-browser-dynamic": "^16.0.3", + "@angular/router": "^16.0.3", "rxjs": "~7.8.0", "tslib": "^2.3.0", - "zone.js": "~0.12.0", - "@angular/service-worker": "^15.1.0", - "@angular/platform-server": "^15.1.0", - "@angular/elements": "^15.1.0", + "zone.js": "~0.13.0", + "@angular/service-worker": "^16.0.3", + "@angular/platform-server": "^16.0.3", + "@angular/elements": "^16.0.3", "@antv/data-set": "^0.11.8", - "@antv/g2": "^4.2.8", - "echarts": "^5.4.1", - "@stackblitz/sdk": "^1.8.2", + "@antv/g2": "^4.2.10", + "echarts": "^5.4.2", + "@stackblitz/sdk": "^1.9.0", "codesandbox": "^2.2.3", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", "extend": "^3.0.2", "file-saver": "^2.0.5", "ng-github-button": "^15.0.0", - "ng-zorro-antd": "^15.1.0", - "ngx-color": "~8.0.3", + "ng-zorro-antd": "^16.0.0-beta.0", + "ngx-color": "~9.0.0", "ngx-countdown": "^15.0.0", "ngx-highlight-js": "^15.0.0", "ngx-tinymce": "^15.0.0", "qrious": "^4.0.2", - "@webcomponents/custom-elements": "^1.5.1", + "@webcomponents/custom-elements": "^1.6.0", "aos": "^3.0.0-beta.6", "@ng-util/monaco-editor": "^15.0.0", - "@nguniversal/express-engine": "~15.1.0", + "@nguniversal/express-engine": "~16.0.2", "express": "^4.18.2", "isutf8": "^4.0.0", "@github/hotkey": "^2.0.1" }, "devDependencies": { - "@angular-devkit/build-angular": "^15.1.3", - "@angular/cli": "~15.1.3", - "@angular/compiler-cli": "^15.1.0", + "@angular-devkit/build-angular": "^16.0.3", + "@angular/cli": "~16.0.3", + "@angular/compiler-cli": "^16.0.3", "@types/jasmine": "~4.3.0", - "jasmine-core": "~4.5.0", + "jasmine-core": "~4.6.0", "karma": "~6.4.0", - "karma-chrome-launcher": "~3.1.0", + "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.0.0", - "typescript": "~4.9.4", + "typescript": "~5.0.4", "codelyzer": "^6.0.2", "jasmine-spec-reporter": "^7.0.0", "protractor": "~7.0.0", "ts-node": "~10.9.1", - "@angular/language-service": "^15.1.0", + "@angular/language-service": "^16.0.3", "@types/jasminewd2": "~2.0.10", "karma-junit-reporter": "^2.0.1", "karma-spec-reporter": "0.0.36", @@ -138,51 +138,51 @@ "mark-twain": "^2.0.3", "mockjs": "^1.1.0", "mustache": "^4.2.0", - "ng-packagr": "^15.1.0", + "ng-packagr": "^16.0.1", "parse5": "^7.1.2", - "prettier": "^2.8.3", + "prettier": "^2.8.8", "readline-sync": "^1.4.10", "stream": "0.0.2", - "stylelint": "^14.16.1", - "stylelint-config-prettier": "^9.0.4", + "stylelint": "^15.6.2", + "stylelint-config-prettier": "^9.0.5", "stylelint-config-rational-order": "^0.1.2", - "stylelint-config-standard": "^29.0.0", - "stylelint-declaration-block-no-ignored-properties": "^2.6.0", - "stylelint-order": "^6.0.1", + "stylelint-config-standard": "^33.0.0", + "stylelint-declaration-block-no-ignored-properties": "^2.7.0", + "stylelint-order": "^6.0.3", "source-map-explorer": "^2.5.3", "xlsx": "^0.18.5", "jszip": "^3.10.1", - "plyr": "^3.7.3", - "pdfjs-dist": "^3.6.172", + "plyr": "^3.7.8", + "pdfjs-dist": "~3.6.172", "screenfull": "^6.0.2", "less-bundle-promise": "^1.0.11", "ng-alain-codelyzer": "^0.0.1", "ng-alain-sts": "^0.0.2", "ng-alain-plugin-theme": "^15.0.1", - "tsconfig-paths": "^4.1.2", - "@nguniversal/builders": "^15.1.0", - "@types/express": "^4.17.16", - "html-minifier-terser": "^7.1.0", - "terser": "^5.16.1", - "@commitlint/cli": "^17.4.2", - "@commitlint/config-angular": "^17.4.2", - "@angular-eslint/builder": "~15.2.0", - "@angular-eslint/eslint-plugin": "~15.2.0", - "@angular-eslint/eslint-plugin-template": "~15.2.0", - "@angular-eslint/schematics": "~15.2.0", - "@angular-eslint/template-parser": "~15.2.0", - "@typescript-eslint/eslint-plugin": "~5.49.0", - "@typescript-eslint/parser": "~5.49.0", - "eslint": "^8.33.0", - "eslint-config-prettier": "~8.6.0", - "eslint-plugin-import": "~2.26.0", - "eslint-plugin-jsdoc": "~39.7.4", + "tsconfig-paths": "^4.2.0", + "@nguniversal/builders": "^16.0.2", + "@types/express": "^4.17.17", + "html-minifier-terser": "^7.2.0", + "terser": "^5.17.6", + "@commitlint/cli": "^17.6.3", + "@commitlint/config-angular": "^17.6.3", + "@angular-eslint/builder": "~16.0.3", + "@angular-eslint/eslint-plugin": "~16.0.3", + "@angular-eslint/eslint-plugin-template": "~16.0.3", + "@angular-eslint/schematics": "~16.0.3", + "@angular-eslint/template-parser": "~16.0.3", + "@typescript-eslint/eslint-plugin": "~5.59.8", + "@typescript-eslint/parser": "~5.59.8", + "eslint": "^8.41.0", + "eslint-config-prettier": "~8.8.0", + "eslint-plugin-import": "~2.25.3", + "eslint-plugin-jsdoc": "~45.0.0", "eslint-plugin-prefer-arrow": "~1.2.3", "eslint-plugin-prettier": "~4.2.1", - "eslint-plugin-deprecation": "~1.3.3", - "lint-staged": "^13.1.0", + "eslint-plugin-deprecation": "~1.4.1", + "lint-staged": "^13.2.2", "raw-loader": "^4.0.2", - "swagger-typescript-api": "^12.0.2", + "swagger-typescript-api": "^12.0.4", "sitemap": "^7.1.1" }, "lint-staged": { diff --git a/packages/abc/date-picker/range.directive.ts b/packages/abc/date-picker/range.directive.ts index 353ee06d97..2a0b1afbe0 100644 --- a/packages/abc/date-picker/range.directive.ts +++ b/packages/abc/date-picker/range.directive.ts @@ -57,7 +57,7 @@ export class RangePickerDirective implements OnDestroy, AfterViewInit { get shortcut(): AlainDateRangePickerShortcut | null { return this._shortcut; } - @Input() ngModelEnd: NzSafeAny; + @Input({ required: true }) ngModelEnd: NzSafeAny; @Output() readonly ngModelEndChange = new EventEmitter(); private get dp(): NzDatePickerComponent { diff --git a/packages/abc/down-file/down-file.directive.ts b/packages/abc/down-file/down-file.directive.ts index 15f5a38c53..18e93cecd0 100644 --- a/packages/abc/down-file/down-file.directive.ts +++ b/packages/abc/down-file/down-file.directive.ts @@ -19,7 +19,7 @@ export class DownFileDirective { @Input('http-data') httpData: NzSafeAny; @Input('http-body') httpBody: NzSafeAny; @Input('http-method') httpMethod: string = 'get'; - @Input('http-url') httpUrl!: string; + @Input({ alias: 'http-url', required: true }) httpUrl!: string; @Input('file-name') fileName?: string | ((rep: HttpResponse) => string); @Input() pre?: (ev: MouseEvent) => Promise; @Output() readonly success = new EventEmitter>(); diff --git a/packages/abc/let/let.directive.ts b/packages/abc/let/let.directive.ts index b55ad8a41c..a9037f179b 100644 --- a/packages/abc/let/let.directive.ts +++ b/packages/abc/let/let.directive.ts @@ -16,7 +16,7 @@ export class LetContext { @Directive({ selector: '[let]' }) export class LetDirective { - @Input() let!: T; + @Input({ required: true }) let!: T; constructor(@Inject(ViewContainerRef) vc: ViewContainerRef, @Inject(TemplateRef) ref: TemplateRef>) { vc.createEmbeddedView(ref, new LetContext(this)); diff --git a/packages/abc/loading/loading.module.ts b/packages/abc/loading/loading.module.ts index 721bd98727..81fc7b9405 100644 --- a/packages/abc/loading/loading.module.ts +++ b/packages/abc/loading/loading.module.ts @@ -13,7 +13,6 @@ const COMPONENTS = [LoadingDefaultComponent]; @NgModule({ imports: [CommonModule, OverlayModule, PortalModule, NzIconModule, NzSpinModule], declarations: COMPONENTS, - entryComponents: COMPONENTS, exports: COMPONENTS }) export class LoadingModule {} diff --git a/packages/abc/loading/style/index.less b/packages/abc/loading/style/index.less index c63ad4419f..4d9ced71e0 100644 --- a/packages/abc/loading/style/index.less +++ b/packages/abc/loading/style/index.less @@ -10,10 +10,7 @@ &-default { position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; z-index: @loading-zindex + 1; display: flex; flex-direction: column; diff --git a/packages/abc/onboarding/onboarding.module.ts b/packages/abc/onboarding/onboarding.module.ts index 0c555aef13..0cb8f63b03 100644 --- a/packages/abc/onboarding/onboarding.module.ts +++ b/packages/abc/onboarding/onboarding.module.ts @@ -16,7 +16,6 @@ const COMPONENTS = [OnboardingComponent]; imports: [CommonModule, DelonLocaleModule, NzPopoverModule, NzOutletModule, NzButtonModule, NzNoAnimationModule], declarations: COMPONENTS, providers: [OnboardingService], - entryComponents: COMPONENTS, exports: COMPONENTS }) export class OnboardingModule {} diff --git a/packages/abc/onboarding/style/index.less b/packages/abc/onboarding/style/index.less index ef274d5b75..4947210834 100644 --- a/packages/abc/onboarding/style/index.less +++ b/packages/abc/onboarding/style/index.less @@ -8,10 +8,7 @@ &__mask { position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; z-index: @onboarding-zindex - 1; background-color: @onboarding-mask-background-color; opacity: @onboarding-mask-opacity; diff --git a/packages/abc/st/st.component.ts b/packages/abc/st/st.component.ts index b19c099489..8e0be868d5 100644 --- a/packages/abc/st/st.component.ts +++ b/packages/abc/st/st.component.ts @@ -214,11 +214,11 @@ export class STComponent implements AfterViewInit, OnChanges, OnDestroy { @Input() header?: string | TemplateRef | null; @Input() @InputBoolean() showHeader = true; @Input() footer?: string | TemplateRef | null; - @Input() bodyHeader?: TemplateRef | null; - @Input() body?: TemplateRef | null; + @Input() bodyHeader?: TemplateRef<{ $implicit: STStatisticalResults }> | null; + @Input() body?: TemplateRef<{ $implicit: STStatisticalResults }> | null; @Input() @InputBoolean() expandRowByClick = false; @Input() @InputBoolean() expandAccordion = false; - @Input() expand: TemplateRef<{ $implicit: NzSafeAny; column: STColumn }> | null = null; + @Input() expand: TemplateRef<{ $implicit: NzSafeAny; index: number }> | null = null; @Input() noResult?: string | TemplateRef | null; @Input() @InputBoolean() responsive: boolean = true; @Input() @InputBoolean() responsiveHideHeaderFooter?: boolean; diff --git a/packages/form/src/module.ts b/packages/form/src/module.ts index 52e0bb96cc..b72cad44af 100644 --- a/packages/form/src/module.ts +++ b/packages/form/src/module.ts @@ -124,8 +124,7 @@ const WIDGETS = [ @NgModule({ imports: [CommonModule, FormsModule, DelonLocaleModule, ...ZORROS], declarations: [...COMPONENTS, ...WIDGETS], - exports: COMPONENTS, - entryComponents: WIDGETS + exports: COMPONENTS }) export class DelonFormModule { static forRoot(): ModuleWithProviders { diff --git a/packages/theme/system/utils/_other.less b/packages/theme/system/utils/_other.less index 35775a1613..c4f0480771 100644 --- a/packages/theme/system/utils/_other.less +++ b/packages/theme/system/utils/_other.less @@ -65,10 +65,7 @@ */ .page-loading { position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; z-index: 10000; padding-top: 200px; text-align: center; diff --git a/packages/theme/system/widgets/_abs.less b/packages/theme/system/widgets/_abs.less index bf6e4dcea2..bdbb78a0fb 100644 --- a/packages/theme/system/widgets/_abs.less +++ b/packages/theme/system/widgets/_abs.less @@ -5,10 +5,7 @@ .abs-center { position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; margin: auto; overflow: auto; diff --git a/schematics/migration.json b/schematics/migration.json index c11df07dfd..de75fc0db5 100644 --- a/schematics/migration.json +++ b/schematics/migration.json @@ -1,10 +1,10 @@ { "$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json", "schematics": { - "migration-v15": { - "version": "15", - "description": "Updates NG-ALAIN to v15 [https://github.com/ng-alain/ng-alain/issues/2347]", - "factory": "./ng-update/index#updateToV15" + "migration-v16": { + "version": "16", + "description": "Updates NG-ALAIN to v16 [https://github.com/ng-alain/ng-alain/issues/2390]", + "factory": "./ng-update/index#updateToV16" }, "ng-post-update": { "description": "Performs cleanup after ng-update.", diff --git a/schematics/ng-add/index.ts b/schematics/ng-add/index.ts index a07ccbf1b8..59d79c8196 100644 --- a/schematics/ng-add/index.ts +++ b/schematics/ng-add/index.ts @@ -7,7 +7,7 @@ import { DEFAULT_WORKSPACE_PATH, readJSON, readPackage } from '../utils'; import { getNodeMajorVersion } from '../utils/node'; import { Schema as NgAddOptions } from './schema'; -const V = 15; +const V = 16; function genRules(options: NgAddOptions): Rule { return () => { diff --git a/schematics/ng-update/data/attribute-selectors.ts b/schematics/ng-update/data/attribute-selectors.ts index 1f224ee3b7..15de9ca5c3 100644 --- a/schematics/ng-update/data/attribute-selectors.ts +++ b/schematics/ng-update/data/attribute-selectors.ts @@ -1,5 +1,5 @@ import { AttributeSelectorUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics'; export const attributeSelectors: VersionChanges = { - [TargetVersion.V15]: [] + [TargetVersion.V16]: [] }; diff --git a/schematics/ng-update/data/class-names.ts b/schematics/ng-update/data/class-names.ts index a3f10e7420..50b6d2307a 100644 --- a/schematics/ng-update/data/class-names.ts +++ b/schematics/ng-update/data/class-names.ts @@ -1,5 +1,5 @@ import { ClassNameUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics'; export const classNames: VersionChanges = { - [TargetVersion.V15]: [] + [TargetVersion.V16]: [] }; diff --git a/schematics/ng-update/data/constructor-checks.ts b/schematics/ng-update/data/constructor-checks.ts index 53f952292b..8e1b8c4e3f 100644 --- a/schematics/ng-update/data/constructor-checks.ts +++ b/schematics/ng-update/data/constructor-checks.ts @@ -6,5 +6,5 @@ import { ConstructorChecksUpgradeData, TargetVersion, VersionChanges } from '@an * automatically through type checking. */ export const constructorChecks: VersionChanges = { - [TargetVersion.V15]: [] + [TargetVersion.V16]: [] }; diff --git a/schematics/ng-update/data/css-selectors.ts b/schematics/ng-update/data/css-selectors.ts index 6bad18454e..4cfe940443 100644 --- a/schematics/ng-update/data/css-selectors.ts +++ b/schematics/ng-update/data/css-selectors.ts @@ -1,5 +1,5 @@ import { CssSelectorUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics'; export const cssSelectors: VersionChanges = { - [TargetVersion.V15]: [] + [TargetVersion.V16]: [] }; diff --git a/schematics/ng-update/data/element-selectors.ts b/schematics/ng-update/data/element-selectors.ts index 55c116b425..3cfe48af73 100644 --- a/schematics/ng-update/data/element-selectors.ts +++ b/schematics/ng-update/data/element-selectors.ts @@ -1,5 +1,5 @@ import { ElementSelectorUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics'; export const elementSelectors: VersionChanges = { - [TargetVersion.V15]: [] + [TargetVersion.V16]: [] }; diff --git a/schematics/ng-update/data/input-names.ts b/schematics/ng-update/data/input-names.ts index cf57cde870..2a3cb90ee2 100644 --- a/schematics/ng-update/data/input-names.ts +++ b/schematics/ng-update/data/input-names.ts @@ -1,5 +1,5 @@ import { InputNameUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics'; export const inputNames: VersionChanges = { - [TargetVersion.V15]: [] + [TargetVersion.V16]: [] }; diff --git a/schematics/ng-update/data/method-call-checks.ts b/schematics/ng-update/data/method-call-checks.ts index 27a4fb7dfa..67ebc83f84 100644 --- a/schematics/ng-update/data/method-call-checks.ts +++ b/schematics/ng-update/data/method-call-checks.ts @@ -1,5 +1,5 @@ import { MethodCallUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics'; export const methodCallChecks: VersionChanges = { - [TargetVersion.V15]: [] + [TargetVersion.V16]: [] }; diff --git a/schematics/ng-update/data/output-names.ts b/schematics/ng-update/data/output-names.ts index 8f52de398e..53cf03d777 100644 --- a/schematics/ng-update/data/output-names.ts +++ b/schematics/ng-update/data/output-names.ts @@ -1,5 +1,5 @@ import { OutputNameUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics'; export const outputNames: VersionChanges = { - [TargetVersion.V15]: [] + [TargetVersion.V16]: [] }; diff --git a/schematics/ng-update/data/property-names.ts b/schematics/ng-update/data/property-names.ts index 2968891303..2f8e4df8ca 100644 --- a/schematics/ng-update/data/property-names.ts +++ b/schematics/ng-update/data/property-names.ts @@ -1,5 +1,5 @@ import { PropertyNameUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics'; export const propertyNames: VersionChanges = { - [TargetVersion.V15]: [] + [TargetVersion.V16]: [] }; diff --git a/schematics/ng-update/index.ts b/schematics/ng-update/index.ts index 455a6bdefa..dea89421c1 100644 --- a/schematics/ng-update/index.ts +++ b/schematics/ng-update/index.ts @@ -3,12 +3,12 @@ import { createMigrationSchematicRule, NullableDevkitMigration, TargetVersion } import { chain, Rule, SchematicContext } from '@angular-devkit/schematics'; import { ruleUpgradeData } from './upgrade-data'; -import { v15Rule } from './upgrade-rules/v15'; +import { v16Rule } from './upgrade-rules/v15'; const migrations: NullableDevkitMigration[] = []; -export function updateToV15(): Rule { - return chain([v15Rule(), createMigrationSchematicRule(TargetVersion.V15, migrations, ruleUpgradeData, postUpdate)]); +export function updateToV16(): Rule { + return chain([v16Rule(), createMigrationSchematicRule(TargetVersion.V16, migrations, ruleUpgradeData, postUpdate)]); } /** Post-update schematic to be called when update is finished. */ diff --git a/schematics/ng-update/upgrade-rules/v15/index.ts b/schematics/ng-update/upgrade-rules/v15/index.ts index 8c5a468403..c26ca32b9f 100644 --- a/schematics/ng-update/upgrade-rules/v15/index.ts +++ b/schematics/ng-update/upgrade-rules/v15/index.ts @@ -2,37 +2,26 @@ import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics' import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; import * as colors from 'ansi-colors'; -import { logStart, readPackage, writePackage } from '../../../utils'; +import { logStart } from '../../../utils'; import { addImportNotation } from '../../../utils/less'; import { UpgradeMainVersions } from '../../../utils/versions'; -function removeDuplicateDependencies(): Rule { - return (tree: Tree, context: SchematicContext) => { - const pkg = readPackage(tree); - if (!pkg.devDependencies) return; - delete pkg.devDependencies['ng-alain-sts']; - delete pkg.devDependencies['ng-alain-plugin-theme']; - writePackage(tree, pkg); - logStart(context, `Remove duplicate dev-dependencies: 'ng-alain-sts', 'ng-alain-plugin-theme'`); - }; -} - function finished(): Rule { return (_tree: Tree, context: SchematicContext) => { context.addTask(new NodePackageInstallTask()); context.logger.info( colors.green( - ` ✓ Congratulations, Abort more detail please refer to upgrade guide https://github.com/ng-alain/ng-alain/issues/2347` + ` ✓ Congratulations, Abort more detail please refer to upgrade guide https://github.com/ng-alain/ng-alain/issues/2390` ) ); }; } -export function v15Rule(): Rule { +export function v16Rule(): Rule { return async (tree: Tree, context: SchematicContext) => { logStart(context, `Upgrade @delon/* version number`); UpgradeMainVersions(tree); - return chain([addImportNotation(), removeDuplicateDependencies(), finished()]); + return chain([addImportNotation(), finished()]); }; } diff --git a/scripts/site/tsconfig.json b/scripts/site/tsconfig.json index 016956f6fc..9ad660258f 100755 --- a/scripts/site/tsconfig.json +++ b/scripts/site/tsconfig.json @@ -2,7 +2,6 @@ // use TS-Node to compile the gulp tasks at runtime. { "compilerOptions": { - "suppressImplicitAnyIndexErrors": true, "experimentalDecorators": true, "lib": ["es2015", "dom", "es2016.array.include"], "module": "commonjs", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index aa5cc693ba..633927b509 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -30,7 +30,7 @@ import { RoutesModule } from './routes/routes.module'; import { IconComponent } from './shared/components/icon/icon.component'; import { JsonSchemaModule } from './shared/json-schema/json-schema.module'; import { SharedModule } from './shared/shared.module'; -import { STWidgetModule, STWIDGET_COMPONENTS } from './shared/st-widget/st-widget.module'; +import { STWidgetModule } from './shared/st-widget/st-widget.module'; export function StartupServiceFactory(startupService: StartupService): () => Promise { return () => startupService.load(); @@ -90,7 +90,6 @@ function registerElements(injector: Injector, platformId: {}): void { { provide: ErrorHandler, useClass: CustomErrorHandler } ], declarations: [AppComponent, LayoutComponent, HeaderComponent, HeaderSearchComponent], - entryComponents: STWIDGET_COMPONENTS, bootstrap: [AppComponent] }) export class AppModule { diff --git a/src/app/shared/json-schema/json-schema.module.ts b/src/app/shared/json-schema/json-schema.module.ts index eab627740b..e4c106a0a4 100644 --- a/src/app/shared/json-schema/json-schema.module.ts +++ b/src/app/shared/json-schema/json-schema.module.ts @@ -9,7 +9,6 @@ export const SCHEMA_THIRDS_COMPONENTS = [TinymceWidget]; @NgModule({ declarations: SCHEMA_THIRDS_COMPONENTS, - entryComponents: SCHEMA_THIRDS_COMPONENTS, imports: [SharedModule, DelonFormModule.forRoot()], exports: [...SCHEMA_THIRDS_COMPONENTS] }) diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 6f87beaeeb..5b37cd8a18 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -59,7 +59,6 @@ const THIRDS = [HighlightJsModule, GithubButtonModule, NgxTinymceModule, ColorSk ...THIRDS ], declarations: COMPONENTS, - entryComponents: DIALOG_COMPONENTS, exports: [ CommonModule, FormsModule, diff --git a/src/templates/examples.ts b/src/templates/examples.ts index 6c145c56c8..592a0bc9af 100644 --- a/src/templates/examples.ts +++ b/src/templates/examples.ts @@ -20,7 +20,6 @@ export const EXAMPLE_LIST = [ @NgModule({ imports: [ SharedModule ], - declarations: EXAMPLE_LIST, - entryComponents: EXAMPLE_LIST, + declarations: EXAMPLE_LIST }) export class ExampleModule { } diff --git a/tsconfig.json b/tsconfig.json index f815ba9696..a5d5683ba2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,9 +12,9 @@ "moduleResolution": "node", "importHelpers": true, "target": "ES2022", - "module": "es2020", + "module": "ES2022", "lib": [ - "es2020", + "ES2022", "dom" ], "typeRoots": [