Skip to content

Commit

Permalink
chore: bump angular to 18 (#1798)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Jun 30, 2024
1 parent 6db6763 commit cde8b78
Show file tree
Hide file tree
Showing 155 changed files with 3,887 additions and 4,155 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.13.0
18.19.1
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"source.fixAll.stylelint": "explicit"
},
"[html]": {
"editor.formatOnSave": true
"editor.formatOnSave": false
},
"[typescript]": {
"editor.formatOnSave": true
Expand Down
7 changes: 7 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- remove ng-antd-color-picker
- styles javaenabled
- eslint upgrade
- 过期函数
- cli
- remove ng-less-javascript-enabled-patch
-
197 changes: 99 additions & 98 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
},
"homepage": "https://ng-alain.com",
"engines": {
"node": "^18.13.0"
"node": "^18.19.1 || ^20.11.1 || ^22.0.0"
},
"scripts": {
"ng-high-memory": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng",
"prepare": "husky install",
"start": "npm run site:gen && ng s -o --hmr",
"lint": "bash scripts/ci/lint.sh -ts -less",
"lint": "npm run lint:ts && npm run lint:style",
"lint:ts": "eslint --cache . --ext .ts,.html",
"lint:fix": "eslint --cache . --ext .ts,.html --fix",
"lint:style": "npx stylelint 'packages/**/*.less'",
Expand All @@ -38,7 +38,8 @@
"build_artifacts": "bash scripts/ci/build-artifacts.sh",
"analyze": "npm run ng-high-memory build -- --source-map",
"analyze:view": "source-map-explorer src/dist/browser/*.js",
"site:gen": "node scripts/site/main init && ng-alain-plugin-theme -t=themeCss && ng-alain-plugin-theme -t=colorLess",
"site:gen": "node scripts/site/main init",
"site:gen:TODO": "node scripts/site/main init && ng-alain-plugin-theme -t=themeCss && ng-alain-plugin-theme -t=colorLess",
"site:build": "npm run site:gen && ng b site && npm run site:ngsw && npm run site:minify && npm run site:sitemap && npm run site:helper",
"site:helper": "bash scripts/ci/helper.sh",
"site:minify": "node scripts/build/minify.js",
Expand All @@ -48,133 +49,133 @@
"pre-publish": "node scripts/publish/publish.js && node scripts/publish/publish-scaffold.js",
"publish:next": "bash scripts/publish/publish.sh -next",
"publish": "bash scripts/publish/publish.sh",
"sync-scaffold-version": "node scripts/publish/sync-scaffold-version.js",
"postinstall": "ng-less-javascript-enabled-patch"
"sync-scaffold-version": "node scripts/publish/sync-scaffold-version.js"
},
"dependencies": {
"@angular/animations": "^17.2.0",
"@angular/common": "^17.2.0",
"@angular/compiler": "^17.2.0",
"@angular/core": "^17.2.0",
"@angular/forms": "^17.2.0",
"@angular/platform-browser": "^17.2.0",
"@angular/platform-browser-dynamic": "^17.2.0",
"@angular/router": "^17.2.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3",
"@angular/service-worker": "^17.2.0",
"@angular/platform-server": "^17.2.0",
"@angular/ssr": "^17.2.0",
"express": "^4.18.3",
"@angular/elements": "^17.2.0",
"@angular/animations": "^18.0.0",
"@angular/cdk": "^18.0.5",
"@angular/common": "^18.0.0",
"@angular/compiler": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/elements": "^18.0.0",
"@angular/forms": "^18.0.0",
"@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/platform-server": "^18.0.0",
"@angular/router": "^18.0.0",
"@angular/service-worker": "^18.0.0",
"@angular/ssr": "^18.0.0",
"@antv/data-set": "^0.11.8",
"@antv/g2": "^4.2.10",
"echarts": "^5.5.0",
"@stackblitz/sdk": "^1.9.0",
"@github/hotkey": "^3.1.1",
"@ng-util/monaco-editor": "^18.0.0",
"@stackblitz/sdk": "^1.10.0",
"@webcomponents/custom-elements": "^1.6.0",
"ajv": "^8.16.0",
"ajv-formats": "^3.0.1",
"aos": "^3.0.0-beta.6",
"codesandbox": "^2.2.3",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"echarts": "^5.5.0",
"express": "^4.19.2",
"extend": "^3.0.2",
"file-saver": "^2.0.5",
"ng-github-button": "^17.0.0",
"ng-zorro-antd": "^17.3.0",
"@angular/cdk": "^17.2.0",
"ngx-countdown": "^17.1.1",
"ngx-highlight-js": "^17.0.0",
"ngx-tinymce": "^17.0.0",
"qrious": "^4.0.2",
"@webcomponents/custom-elements": "^1.6.0",
"aos": "^3.0.0-beta.6",
"@ng-util/monaco-editor": "^17.0.1",
"isutf8": "^4.0.0",
"@github/hotkey": "^2.3.1",
"ng-antd-color-picker": "^1.1.0"
"ng-antd-color-picker": "^1.1.0",
"ng-github-button": "^18.0.0",
"ng-zorro-antd": "^18.0.1",
"ngx-countdown": "^18.0.0",
"ngx-highlight-js": "^18.0.0",
"ngx-tinymce": "^18.0.0",
"qrious": "^4.0.2",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.2.1",
"@angular/cli": "^17.2.1",
"@angular/compiler-cli": "^17.2.0",
"@angular-devkit/build-angular": "^18.0.4",
"@angular-eslint/builder": "^18.0.1",
"@angular-eslint/eslint-plugin": "^18.0.0",
"@angular-eslint/eslint-plugin-template": "^18.0.0",
"@angular-eslint/schematics": "^18.0.0",
"@angular-eslint/template-parser": "^18.0.0",
"@angular/cli": "^18.0.4",
"@angular/compiler-cli": "^18.0.0",
"@angular/language-service": "^18.0.0",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-angular": "^19.3.0",
"@types/aos": "^3.0.7",
"@types/deep-extend": "^0.6.2",
"@types/express": "^4.17.21",
"@types/extend": "^3.0.4",
"@types/file-saver": "^2.0.7",
"@types/fs-extra": "^11.0.4",
"@types/jasmine": "~5.1.0",
"@types/jasminewd2": "~2.0.13",
"@types/mockjs": "^1.0.10",
"@types/node": "^18.19.39",
"@types/parse5": "^7.0.0",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"chalk": "^5.3.0",
"codecov": "^3.8.3",
"conventional-changelog-cli": "^5.0.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "~9.1.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-header": "~3.1.1",
"eslint-plugin-import": "~2.25.3",
"eslint-plugin-jsdoc": "~46.8.2",
"eslint-plugin-prefer-arrow": "~1.2.2",
"eslint-plugin-prettier": "~5.0.0",
"fs-extra": "^11.2.0",
"html-minifier-terser": "^7.2.0",
"husky": "^9.0.11",
"jasmine": "^5.1.0",
"jasmine-core": "~5.1.0",
"jasmine-spec-reporter": "^7.0.0",
"jsonml.js": "^0.1.0",
"jszip": "^3.10.1",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.3.2",
"jasmine": "^5.1.0",
"jasmine-spec-reporter": "^7.0.0",
"ts-node": "~10.9.2",
"@angular/language-service": "^17.2.0",
"@types/jasminewd2": "~2.0.13",
"karma-junit-reporter": "^2.0.1",
"karma-parallel": "^0.3.1",
"karma-spec-reporter": "0.0.36",
"karma-viewport": "^1.0.9",
"@types/aos": "^3.0.7",
"@types/file-saver": "^2.0.7",
"@types/deep-extend": "^0.6.2",
"@types/extend": "^3.0.4",
"@types/mockjs": "^1.0.10",
"@types/parse5": "^7.0.0",
"karma-summary-reporter": "^4.0.1",
"karma-parallel": "^0.3.1",
"chalk": "^5.3.0",
"codecov": "^3.8.3",
"conventional-changelog-cli": "^4.1.0",
"fs-extra": "^11.2.0",
"@types/fs-extra": "^11.0.4",
"husky": "^8.0.3",
"jsonml.js": "^0.1.0",
"karma-viewport": "^1.0.9",
"klaw-sync": "^6.0.0",
"less-vars-to-js": "^1.3.0",
"less-bundle-promise": "^1.0.11",
"less-plugin-clean-css": "^1.5.1",
"less-plugin-npm-import": "^2.1.0",
"less-vars-to-js": "^1.3.0",
"lint-staged": "^15.2.7",
"mark-twain": "^2.0.3",
"mockjs": "^1.1.0",
"mustache": "^4.2.0",
"ng-packagr": "^17.2.0",
"ng-alain-plugin-theme": "^16.0.2",
"ng-alain-sts": "^0.0.2",
"ng-less-javascript-enabled-patch": "17.0.2",
"ng-packagr": "^18.0.0",
"parse5": "^7.1.2",
"prettier": "^3.2.5",
"plyr": "^3.7.8",
"prettier": "^3.3.2",
"readline-sync": "^1.4.10",
"screenfull": "^6.0.2",
"sitemap": "^8.0.0",
"source-map-explorer": "^2.5.3",
"stream": "0.0.2",
"stylelint": "^16.2.1",
"stylelint": "^16.6.1",
"stylelint-config-clean-order": "^6.0.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
"stylelint-config-clean-order": "^5.4.1",
"source-map-explorer": "^2.5.3",
"xlsx": "^0.18.5",
"jszip": "^3.10.1",
"plyr": "^3.7.8",
"screenfull": "^6.0.2",
"less-bundle-promise": "^1.0.11",
"ng-alain-sts": "^0.0.2",
"ng-alain-plugin-theme": "^16.0.2",
"ng-less-javascript-enabled-patch": "17.0.2",
"tsconfig-paths": "^4.2.0",
"@types/express": "^4.17.21",
"@types/node": "^18.19.22",
"html-minifier-terser": "^7.2.0",
"terser": "^5.29.1",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-angular": "^18.6.1",
"@angular-eslint/builder": "^17.2.0",
"@angular-eslint/eslint-plugin": "^17.2.0",
"@angular-eslint/eslint-plugin-template": "^17.2.0",
"@angular-eslint/schematics": "^17.2.0",
"@angular-eslint/template-parser": "^17.2.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "~9.1.0",
"eslint-plugin-import": "~2.29.1",
"eslint-plugin-jsdoc": "~48.0.6",
"eslint-plugin-prefer-arrow": "~1.2.3",
"eslint-plugin-prettier": "~5.1.3",
"eslint-plugin-deprecation": "~2.0.0",
"lint-staged": "^15.2.2",
"swagger-typescript-api": "^12.0.4",
"sitemap": "^7.1.1"
"terser": "^5.31.1",
"ts-node": "~10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "~5.4.2",
"xlsx": "^0.18.5"
},
"lint-staged": {
"(schematics|scripts|packages)/**/!(tslint-rules|testing)/!(polyfills).{html,ts}": [
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/footer-toolbar/footer-toolbar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Component, DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { FooterToolbarModule } from './footer-toolbar.module';
import { ErrorCollectModule } from '../error-collect/error-collect.module';
import { FooterToolbarModule } from './footer-toolbar.module';

describe('abc: footer-toolbar', () => {
let fixture: ComponentFixture<TestComponent>;
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/hotkey/hotkey.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Platform } from '@angular/cdk/platform';
import { Component, ViewChild } from '@angular/core';
import { TestBed } from '@angular/core/testing';

import { createTestContext } from '../../testing';
import { HotkeyDirective } from './hotkey.directive';
import { HotkeyModule } from './hotkey.module';
import { createTestContext } from '../../testing';

describe('abc: hotkey', () => {
let context: TestComponent;
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/notice-icon/notice-icon.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
<nz-dropdown-menu #noticeMenu="nzDropdownMenu">
<nz-spin [nzSpinning]="loading" [nzDelay]="0">
<nz-tabset nzSelectedIndex="0" [nzCentered]="centered">
<nz-tabset [nzSelectedIndex]="0" [nzCentered]="centered">
@for (i of data; track $index) {
<nz-tab [nzTitle]="i.title">
<notice-icon-tab [locale]="locale" [data]="i" (select)="onSelect($event)" (clear)="onClear($event)" />
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/page-header/page-header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {
import { NzAffixComponent } from 'ng-zorro-antd/affix';
import { NzSafeAny } from 'ng-zorro-antd/core/types';

import { ReuseTabService } from '../reuse-tab/reuse-tab.service';
import { PageHeaderComponent } from './page-header.component';
import { PageHeaderModule } from './page-header.module';
import { ReuseTabService } from '../reuse-tab/reuse-tab.service';

class MockI18NServiceFake extends AlainI18NServiceFake {
fanyi(key: string): string {
Expand Down
9 changes: 7 additions & 2 deletions packages/abc/page-header/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
max-width: @page-header-wide;
margin: auto;
}

.@{ant-prefix}-breadcrumb {
margin-bottom: @margin-md;
}

.@{ant-prefix}-tabs {
margin: 0 0 (-(@margin-md + 1)) 0;
margin: 0 0 (-(@margin-md + 1));

&-bar {
border-bottom: @border-width-base @border-style-base @border-color-split;
Expand Down Expand Up @@ -131,17 +133,20 @@

@media screen and (max-width: @screen-xs) {
&__action {

.@{ant-prefix}-btn-group,
.@{ant-prefix}-btn {
display: block;
margin-bottom: 8px;
}

.@{ant-prefix}-input-search-enter-button {
.@{ant-prefix}-btn {
margin-bottom: 0;
}
}
.@{ant-prefix}-btn-group > .@{ant-prefix}-btn {

.@{ant-prefix}-btn-group>.@{ant-prefix}-btn {
display: inline-block;
margin-bottom: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/qr/qr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { of } from 'rxjs';
import { createTestContext } from '@delon/testing';
import { NzSafeAny } from 'ng-zorro-antd/core/types';

import { AlainConfigService, LazyService } from '../../util';
import { QRComponent } from './qr.component';
import { QRModule } from './qr.module';
import { AlainConfigService, LazyService } from '../../util';

describe('abc: qr', () => {
let fixture: ComponentFixture<TestComponent>;
Expand Down
6 changes: 4 additions & 2 deletions packages/abc/result/result.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Directionality } from '@angular/cdk/bidi';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { Component, DebugElement, TemplateRef, ViewChild } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { createTestContext } from '@delon/testing';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
Expand All @@ -17,7 +18,8 @@ describe('abc: result', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ResultModule, HttpClientTestingModule],
imports: [ResultModule, NoopAnimationsModule],
providers: [provideHttpClientTesting()],
declarations: [TestComponent]
});
({ fixture, dl, context } = createTestContext(TestComponent));
Expand Down
Loading

0 comments on commit cde8b78

Please sign in to comment.