Skip to content

Commit 2431e91

Browse files
xujing0521why520crazy
authored andcommitted
feat: upgrade angular v20
1 parent 2d58137 commit 2431e91

30 files changed

+2131
-3755
lines changed

.docgeni/public/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import '@docgeni/template/styles/index.scss';
1+
@forward '@docgeni/template/styles/index.scss';

.docgeni/public/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"moduleResolution": "node",
1111
"esModuleInterop": false,
1212
"importHelpers": true,
13-
"target": "es2015",
13+
"target": "ES2022",
14+
"useDefineForClassFields": true,
1415
"lib": ["esnext", "dom"],
1516
"types": ["node"],
1617
"paths": {

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"extends": ["plugin:@angular-eslint/recommended", "plugin:@angular-eslint/template/process-inline-templates"],
1212
"rules": {
1313
"@angular-eslint/prefer-standalone": "off",
14+
"@angular-eslint/prefer-inject": "off",
1415
"@angular-eslint/directive-selector": [
1516
"error",
1617
{

angular.json

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"prefix": "lib",
1515
"architect": {
1616
"build": {
17-
"builder": "@angular-devkit/build-angular:ng-packagr",
17+
"builder": "@angular/build:ng-packagr",
1818
"options": {
1919
"tsConfig": "packages/store/tsconfig.lib.json",
2020
"project": "packages/store/ng-package.json"
@@ -26,7 +26,7 @@
2626
}
2727
},
2828
"test": {
29-
"builder": "@angular-devkit/build-angular:karma",
29+
"builder": "@angular/build:karma",
3030
"options": {
3131
"tsConfig": "packages/store/tsconfig.spec.json",
3232
"codeCoverage": true,
@@ -50,6 +50,30 @@
5050
},
5151
"@angular-eslint/schematics:library": {
5252
"setParserOptionsProject": true
53+
},
54+
"@schematics/angular:component": {
55+
"type": "component"
56+
},
57+
"@schematics/angular:directive": {
58+
"type": "directive"
59+
},
60+
"@schematics/angular:service": {
61+
"type": "service"
62+
},
63+
"@schematics/angular:guard": {
64+
"typeSeparator": "."
65+
},
66+
"@schematics/angular:interceptor": {
67+
"typeSeparator": "."
68+
},
69+
"@schematics/angular:module": {
70+
"typeSeparator": "."
71+
},
72+
"@schematics/angular:pipe": {
73+
"typeSeparator": "."
74+
},
75+
"@schematics/angular:resolver": {
76+
"typeSeparator": "."
5377
}
5478
}
5579
}

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,35 @@
2727
},
2828
"private": true,
2929
"dependencies": {
30-
"@angular/animations": "^19.2.3",
31-
"@angular/cdk": "^19.2.6",
32-
"@angular/common": "^19.2.3",
33-
"@angular/compiler": "^19.2.3",
34-
"@angular/core": "^19.2.3",
35-
"@angular/forms": "^19.2.3",
36-
"@angular/platform-browser": "^19.2.3",
37-
"@angular/platform-browser-dynamic": "^19.2.3",
38-
"@angular/router": "^19.2.3",
39-
"@tethys/cdk": "^19.0.0",
40-
"rxjs": "~6.6.0",
30+
"@angular/animations": "^20.3.10",
31+
"@angular/cdk": "^20.2.12",
32+
"@angular/common": "^20.3.10",
33+
"@angular/compiler": "^20.3.10",
34+
"@angular/core": "^20.3.10",
35+
"@angular/forms": "^20.3.10",
36+
"@angular/platform-browser": "^20.3.10",
37+
"@angular/platform-browser-dynamic": "^20.3.10",
38+
"@angular/router": "^20.3.10",
39+
"@tethys/cdk": "^20.0.0-next.0",
40+
"rxjs": "^7.8.0",
4141
"tslib": "^2.0.0",
4242
"zone.js": "~0.15.0"
4343
},
4444
"devDependencies": {
45-
"@angular-devkit/build-angular": "^19.2.4",
46-
"@angular-eslint/builder": "19.3.0",
47-
"@angular-eslint/eslint-plugin": "19.3.0",
48-
"@angular-eslint/eslint-plugin-template": "19.3.0",
49-
"@angular-eslint/schematics": "19.3.0",
50-
"@angular-eslint/template-parser": "19.3.0",
51-
"@angular/cli": "^19.2.4",
52-
"@angular/compiler-cli": "^19.2.3",
45+
"@angular-eslint/builder": "20.6.0",
46+
"@angular-eslint/eslint-plugin": "20.6.0",
47+
"@angular-eslint/eslint-plugin-template": "20.6.0",
48+
"@angular-eslint/schematics": "20.6.0",
49+
"@angular-eslint/template-parser": "20.6.0",
50+
"@angular/build": "^20.3.10",
51+
"@angular/cli": "^20.3.9",
52+
"@angular/compiler-cli": "^20.3.10",
5353
"@commitlint/cli": "^12.0.1",
5454
"@commitlint/config-angular": "^12.0.1",
55-
"@docgeni/cli": "2.5.0",
56-
"@docgeni/template": "2.5.0",
55+
"@docgeni/cli": "2.6.0-next.0",
56+
"@docgeni/template": "2.6.0-next.0",
5757
"@types/jasmine": "~3.6.0",
58-
"@types/node": "^20.0.0",
58+
"@types/node": "^24.10.0",
5959
"@typescript-eslint/eslint-plugin": "^7.2.0",
6060
"@typescript-eslint/parser": "^7.2.0",
6161
"@worktile/pkg-manager": "0.0.9",
@@ -69,11 +69,11 @@
6969
"karma-coverage": "~2.2.0",
7070
"karma-jasmine": "~5.1.0",
7171
"karma-jasmine-html-reporter": "~2.0.0",
72-
"ng-packagr": "^19.2.0",
72+
"ng-packagr": "^20.3.0",
7373
"prettier": "^3.3.3",
7474
"pretty-quick": "^4.0.0",
7575
"todomvc-app-css": "^2.4.1",
7676
"ts-node": "~8.3.0",
77-
"typescript": "~5.5.4"
77+
"typescript": "~5.9.2"
7878
}
79-
}
79+
}

packages/store/karma.conf.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
module.exports = function (config) {
55
config.set({
66
basePath: '',
7-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
7+
frameworks: ['jasmine'],
88
plugins: [
99
require('karma-jasmine'),
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
12-
require('karma-coverage'),
13-
require('@angular-devkit/build-angular/plugins/karma')
12+
require('karma-coverage')
1413
],
1514
client: {
1615
jasmine: {

packages/store/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "@tethys/store",
33
"version": "19.0.1",
44
"peerDependencies": {
5-
"@angular/common": "^19.0.0",
6-
"@angular/core": "^19.0.0",
7-
"@tethys/cdk": ">=19.0.0"
5+
"@angular/common": "^20.0.0",
6+
"@angular/core": "^20.0.0",
7+
"@tethys/cdk": ">=20.0.0-next.0"
88
},
99
"dependencies": {
1010
"tslib": "^2.0.0"

packages/store/store/examples/active/active.component.html

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
<section class="item-app" *ngIf="items$ | async as items">
2-
<section class="main">
3-
<ul class="item-list">
4-
<li
5-
*ngFor="let item of items; trackBy: activeItemsStore.trackByFn"
6-
[class.active]="activeItemsStore.activeId === item.id"
7-
[class.editing]="item.editing"
8-
>
9-
<div class="view">
10-
<label (click)="setActiveItem(item.id)" (dblclick)="edit(item)">{{ item.title }}</label>
11-
</div>
12-
<input
13-
class="edit"
14-
*ngIf="item.editing"
15-
[value]="item.title"
16-
#editor
17-
(blur)="stopEditing(item, editor.value)"
18-
(keyup.enter)="update(item, editor.value)"
19-
(keyup.escape)="cancelEditing(item)"
20-
/>
21-
</li>
22-
</ul>
1+
@if (items$ | async; as items) {
2+
<section class="item-app">
3+
<section class="main">
4+
<ul class="item-list">
5+
@for (item of items; track item._id) {
6+
<li [class.active]="activeItemsStore.activeId === item.id" [class.editing]="item.editing">
7+
<div class="view">
8+
<label (click)="setActiveItem(item.id)" (dblclick)="edit(item)">{{ item.title }}</label>
9+
</div>
10+
@if (item.editing) {
11+
<input
12+
class="edit"
13+
[value]="item.title"
14+
#editor
15+
(blur)="stopEditing(item, editor.value)"
16+
(keyup.enter)="update(item, editor.value)"
17+
(keyup.escape)="cancelEditing(item)"
18+
/>
19+
}
20+
</li>
21+
}
22+
</ul>
23+
</section>
24+
<footer class="footer">
25+
@if (activeItemsStore.activeId) {
26+
<button class="clear-active" (click)="clearActiveItem()">Clear active</button>
27+
}
28+
</footer>
2329
</section>
24-
<footer class="footer">
25-
<button class="clear-active" *ngIf="activeItemsStore.activeId" (click)="clearActiveItem()">Clear active</button>
26-
</footer>
27-
</section>
30+
}
2831

2932
<p>activeItemsStore.activeId :{{ activeItemsStore.activeId }}</p>
3033
<p>activeItemsStore.activeEntity:{{ activeItemsStore.activeEntity | json }}</p>

packages/store/store/examples/active/active.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, inject, OnInit } from '@angular/core';
22
import { ActiveItem, ActiveItemsStore } from './active.store';
33

44
@Component({
@@ -8,14 +8,14 @@ import { ActiveItem, ActiveItemsStore } from './active.store';
88
standalone: false
99
})
1010
export class ThyStoreActiveItemsExampleComponent implements OnInit {
11+
public activeItemsStore = inject(ActiveItemsStore);
12+
1113
items$ = this.activeItemsStore.select$(ActiveItemsStore.itemsSelector);
1214

1315
activeId$ = this.activeItemsStore.select$(ActiveItemsStore.activeIdSelector);
1416

1517
activeEntity$ = this.activeItemsStore.activeEntity$;
1618

17-
constructor(public activeItemsStore: ActiveItemsStore) {}
18-
1919
ngOnInit(): void {
2020
this.activeItemsStore.fetchItems();
2121
}

packages/store/store/examples/active/active.store.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable } from '@angular/core';
1+
import { Injectable, inject } from '@angular/core';
22
import { Action, EntityState, EntityStore } from '@tethys/store';
33
import { Observable, of } from 'rxjs';
44
import { tap } from 'rxjs/operators';
@@ -13,6 +13,8 @@ interface ActiveItemsState extends EntityState<ActiveItem> {}
1313

1414
@Injectable({ providedIn: 'root' })
1515
export class ActiveItemsStore extends EntityStore<ActiveItemsState, ActiveItem> {
16+
private activeItemsApiService = inject(ActiveItemsApiService);
17+
1618
static itemsSelector(state: ActiveItemsState) {
1719
return state.entities;
1820
}
@@ -21,7 +23,7 @@ export class ActiveItemsStore extends EntityStore<ActiveItemsState, ActiveItem>
2123
return state.activeId;
2224
}
2325

24-
constructor(private activeItemsApiService: ActiveItemsApiService) {
26+
constructor() {
2527
super(
2628
{
2729
entities: [],

0 commit comments

Comments
 (0)