Skip to content

Commit

Permalink
chore: bump angular to 18
Browse files Browse the repository at this point in the history
  • Loading branch information
devcui committed Jul 3, 2024
1 parent 6ea8074 commit f52401e
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 88 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Comment on github
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Comment on github
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install node modules
Expand All @@ -118,7 +118,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install node modules
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18.0
18.19.1
10 changes: 10 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,18 @@
"zone.js"
],
"assets": [
{
"glob": "**/*",
"input": "public"
},
"src/assets",
"src/favicon.ico"
],
"styles": [
"src/styles.less"
],
"scripts": [],
"inlineStyleLanguage": "less",
"allowedCommonJsDependencies": [
"ajv",
"ajv-formats",
Expand Down Expand Up @@ -108,9 +113,14 @@
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "less",
"scripts": [],
"styles": [],
"assets": [
{
"glob": "**/*",
"input": "public"
},
"src/assets"
]
}
Expand Down
117 changes: 59 additions & 58 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,81 +37,82 @@
"color-less": "ng-yunzai-plugin-theme -t=colorLess",
"theme": "ng-yunzai-plugin-theme -t=themeCss",
"icon": "ng g ng-yunzai:plugin icon",
"prepare": "husky install",
"postinstall": "ng-less-javascript-enabled-patch"
"prepare": "husky install"
},
"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",
"@stomp/rx-stomp": "^2.0.0",
"@stomp/stompjs": "^7.0.0",
"@yelon/abc": "^17.3.2",
"@yelon/acl": "^17.3.2",
"@yelon/auth": "^17.3.2",
"@yelon/cache": "^17.3.2",
"@yelon/chart": "^17.3.2",
"@yelon/form": "^17.3.2",
"@yelon/mock": "^17.3.2",
"@yelon/theme": "^17.3.2",
"@yelon/util": "^17.3.2",
"@yelon/bis": "^17.3.2",
"@yelon/bcs": "^17.3.2",
"@yelon/socket": "^17.3.2",
"ng-zorro-antd": "^17.3.0",
"ngx-tinymce": "^17.0.0",
"@angular/animations": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/compiler": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/forms": "^18.0.0",
"@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/router": "^18.0.0",
"rxjs": "~7.8.0",
"screenfull": "^6.0.2",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
"zone.js": "~0.14.3",
"@stomp/rx-stomp": "^2.0.0",
"@stomp/stompjs": "^7.0.0",
"ng-zorro-antd": "^18.0.1",
"@yelon/abc": "^18.0.0",
"@yelon/acl": "^18.0.0",
"@yelon/auth": "^18.0.0",
"@yelon/cache": "^18.0.0",
"@yelon/chart": "^18.0.0",
"@yelon/form": "^18.0.0",
"@yelon/mock": "^18.0.0",
"@yelon/theme": "^18.0.0",
"@yelon/bis": "^18.0.0",
"@yelon/bcs": "^18.0.0",
"@yelon/socket": "^18.0.0",
"@yelon/util": "^18.0.0",
"ngx-tinymce": "^18.0.0",
"screenfull": "^6.0.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.2.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",
"@angular/cli": "^17.2.1",
"@angular/compiler-cli": "^17.2.0",
"@angular/language-service": "^17.2.0",
"@yelon/testing": "^17.3.2",
"@angular-devkit/build-angular": "^18.0.4",
"@angular/cli": "^18.0.4",
"@angular/compiler-cli": "^18.0.0",
"@types/jasmine": "~5.1.0",
"@types/jasminewd2": "~2.0.13",
"@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-deprecation": "~2.0.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",
"husky": "^8.0.3",
"jasmine-core": "~5.1.0",
"jasmine-spec-reporter": "^7.0.0",
"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",
"lint-staged": "^15.2.2",
"ng-yunzai": "^17.3.2",
"ng-less-javascript-enabled-patch": "^17.0.2",
"prettier": "^3.2.5",
"protractor": "~7.0.0",
"typescript": "~5.4.2",
"@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",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "~9.1.0",
"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",
"eslint-plugin-deprecation": "^3.0.0",
"@angular/language-service": "^18.0.0",
"source-map-explorer": "^2.5.3",
"stylelint": "^16.2.1",
"stylelint-config-clean-order": "^5.4.1",
"prettier": "^3.3.2",
"stylelint": "^16.6.1",
"stylelint-config-standard": "^36.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
"stylelint-config-clean-order": "^6.0.0",
"@yelon/testing": "^18.0.1",
"ng-yunzai": "^18.0.0",
"@types/jasminewd2": "~2.0.13",
"jasmine-spec-reporter": "^7.0.0",
"protractor": "~7.0.0",
"ts-node": "~10.9.2",
"typescript": "~5.3.2"
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"ng-yunzai-plugin-theme": "latest",
"ngx-tinymce": "^18.0.0",
"@ng-util/monaco-editor": "^18.0.0"
},
"lint-staged": {
"(src)/**/*.{html,ts}": [
Expand Down
File renamed without changes.
9 changes: 6 additions & 3 deletions src/app/core/i18n/i18n.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { TestBed } from '@angular/core/testing';
import { YelonLocaleService, SettingsService } from '@yelon/theme';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
Expand Down Expand Up @@ -33,12 +34,14 @@ describe('Service: I18n', () => {

function genModule(): void {
injector = TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
imports: [],
providers: [
I18NService,
{ provide: SettingsService, useValue: MockSettingsService },
{ provide: NzI18nService, useValue: MockNzI18nService },
{ provide: YelonLocaleService, useValue: MockYelonLocaleService }
{ provide: YelonLocaleService, useValue: MockYelonLocaleService },
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting()
]
});
srv = TestBed.inject(I18NService);
Expand Down
5 changes: 2 additions & 3 deletions src/app/routes/yelon/qr/qr.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Component } from '@angular/core';
import type { ERROR_LEVEL_MAP } from 'ng-zorro-antd/qr-code/qrcode';

@Component({
selector: 'app-qr',
templateUrl: './qr.component.html'
})
export class QRComponent {
value = 'https://ng-alain.com/';
value = 'https://ng.yunzainfo.com/';
background = '#ffffff';
foreground = '#000000';
level: keyof typeof ERROR_LEVEL_MAP = 'L';
level: 'L' | 'M' | 'Q' | 'H' = 'L';
mime = 'image/png';
padding = 10;
size = 220;
Expand Down
4 changes: 2 additions & 2 deletions src/app/routes/yelon/zip/zip.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, inject } from '@angular/core';
import { ZipService } from '@yelon/abc/zip';
import * as JSZip from 'jszip';
import type jsZipType from 'jszip';
import { NzMessageService } from 'ng-zorro-antd/message';

@Component({
Expand All @@ -14,7 +14,7 @@ export class ZipComponent implements OnInit {
private readonly cdr = inject(ChangeDetectorRef);

list: any;
instance: JSZip | null = null;
instance: jsZipType | null = null;
data: Array<{ path?: string; url?: string }> = [
{ path: 'demo.docx', url: 'https://ng.yunzainfo.com/assets/demo.docx' },
{
Expand Down
3 changes: 2 additions & 1 deletion src/styles/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// - `default` Default theme
// - `dark` Import the official dark less style file
// - `compact` Import the official compact less style file
// - `variable` Import the official compact less style file
@import '@yelon/theme/theme-default.less';

// ==========The following is the custom theme variable area==========
// The theme paraments can be generated at https://hbyunzai.github.io/ng-yunzai/
// The theme paraments can be generated at https://ng-alain.github.io/ng-alain/
// @primary-color: #f50;
13 changes: 9 additions & 4 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": ["node"]
"types": []
},
"files": ["src/main.ts"],
"include": ["src/**/*.d.ts"]
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
}
19 changes: 10 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"esModuleInterop": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
"importHelpers": true,
"target": "ES2022",
"module": "es2020",
"module": "ES2022",
"useDefineForClassFields": false,
"lib": [
"es2020",
"ES2022",
"dom"
],
"baseUrl": "./",
"paths": {
"@shared": [
"src/app/shared/index"
Expand All @@ -34,9 +37,7 @@
"@_mock": [
"_mock/index"
]
},
"allowSyntheticDefaultImports": true,
"useDefineForClassFields": false
}
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
Expand Down
12 changes: 9 additions & 3 deletions tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": ["jasmine", "node"]
"types": [
"jasmine"
]
},
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}

0 comments on commit f52401e

Please sign in to comment.