Upgrade from Angular 20 to 21 + update other dependencies (#1916)

Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
ACX
2025-12-16 23:29:18 -07:00
committed by GitHub
co-authored by acx10
parent 6df338a0d7
commit 690dbb0aa2
17 changed files with 2285 additions and 7079 deletions
+4 -4
View File
@@ -22,7 +22,7 @@
"prefix": "app", "prefix": "app",
"architect": { "architect": {
"build": { "build": {
"builder": "@angular-devkit/build-angular:application", "builder": "@angular/build:application",
"options": { "options": {
"outputPath": "dist/booklore", "outputPath": "dist/booklore",
"index": "src/index.html", "index": "src/index.html",
@@ -91,7 +91,7 @@
"defaultConfiguration": "production" "defaultConfiguration": "production"
}, },
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular/build:dev-server",
"configurations": { "configurations": {
"production": { "production": {
"buildTarget": "booklore:build:production" "buildTarget": "booklore:build:production"
@@ -103,10 +103,10 @@
"defaultConfiguration": "development" "defaultConfiguration": "development"
}, },
"extract-i18n": { "extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n" "builder": "@angular/build:extract-i18n"
}, },
"test": { "test": {
"builder": "@angular-devkit/build-angular:karma", "builder": "@angular/build:karma",
"options": { "options": {
"polyfills": [ "polyfills": [
"zone.js", "zone.js",
+2107 -6898
View File
File diff suppressed because it is too large Load Diff
+21 -21
View File
@@ -12,17 +12,17 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^20.3.5", "@angular/animations": "^21.0.5",
"@angular/cdk": "^20.2.9", "@angular/cdk": "^21.0.3",
"@angular/common": "^20.3.5", "@angular/common": "^21.0.5",
"@angular/compiler": "^20.3.5", "@angular/compiler": "^21.0.5",
"@angular/core": "^20.3.5", "@angular/core": "^21.0.5",
"@angular/forms": "^20.3.5", "@angular/forms": "^21.0.5",
"@angular/platform-browser": "^20.3.5", "@angular/platform-browser": "^21.0.5",
"@angular/platform-browser-dynamic": "^20.3.5", "@angular/platform-browser-dynamic": "^21.0.5",
"@angular/router": "^20.3.5", "@angular/router": "^21.0.5",
"@iharbeck/ngx-virtual-scroller": "^19.0.1", "@iharbeck/ngx-virtual-scroller": "^19.0.1",
"@primeng/themes": "^20.4.0", "@primeng/themes": "^21.0.2",
"@stomp/rx-stomp": "^2.3.0", "@stomp/rx-stomp": "^2.3.0",
"@stomp/stompjs": "^7.2.1", "@stomp/stompjs": "^7.2.1",
"@tweenjs/tween.js": "^25.0.0", "@tweenjs/tween.js": "^25.0.0",
@@ -34,10 +34,10 @@
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"ng-lazyload-image": "^9.1.3", "ng-lazyload-image": "^9.1.3",
"ng2-charts": "^8.0.0", "ng2-charts": "^8.0.0",
"ngx-extended-pdf-viewer": "^25.6.1", "ngx-extended-pdf-viewer": "^25.6.4",
"ngx-infinite-scroll": "^20.0.0", "ngx-infinite-scroll": "^21.0.0",
"primeicons": "^7.0.0", "primeicons": "^7.0.0",
"primeng": "^20.4.0", "primeng": "^21.0.2",
"quill": "^2.0.3", "quill": "^2.0.3",
"rxjs": "^7.8.2", "rxjs": "^7.8.2",
"showdown": "^2.1.0", "showdown": "^2.1.0",
@@ -47,16 +47,16 @@
"zone.js": "^0.16.0" "zone.js": "^0.16.0"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^20.3.5", "@angular/build": "^21.0.3",
"@angular/cli": "^20.3.5", "@angular/cli": "^21.0.3",
"@angular/compiler-cli": "^20.3.5", "@angular/compiler-cli": "^21.0.5",
"@tailwindcss/typography": "^0.5.19", "@tailwindcss/typography": "^0.5.19",
"@types/jasmine": "^5.1.13", "@types/jasmine": "^5.1.13",
"@types/showdown": "^2.0.6", "@types/showdown": "^2.0.6",
"angular-eslint": "^20.3.5", "angular-eslint": "^21.1.0",
"autoprefixer": "^10.4.22", "autoprefixer": "^10.4.23",
"eslint": "^9.39.1", "eslint": "^9.39.2",
"jasmine-core": "^5.12.1", "jasmine-core": "^5.13.0",
"karma": "^6.4.4", "karma": "^6.4.4",
"karma-chrome-launcher": "^3.2.0", "karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1", "karma-coverage": "^2.2.1",
@@ -64,6 +64,6 @@
"karma-jasmine-html-reporter": "^2.1.0", "karma-jasmine-html-reporter": "^2.1.0",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"typescript": "~5.9.3", "typescript": "~5.9.3",
"typescript-eslint": "^8.48.0" "typescript-eslint": "^8.50.0"
} }
} }
@@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core'; import { Component, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog'; import { DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';
import { Select } from 'primeng/select'; import { Select } from 'primeng/select';
@@ -29,14 +29,13 @@ interface UploadingFile {
selector: 'app-additional-file-uploader', selector: 'app-additional-file-uploader',
standalone: true, standalone: true,
imports: [ imports: [
CommonModule,
FormsModule, FormsModule,
Select, Select,
Button, Button,
FileUpload, FileUpload,
Badge, Badge,
Tooltip Tooltip
], ],
templateUrl: './additional-file-uploader.component.html', templateUrl: './additional-file-uploader.component.html',
styleUrls: ['./additional-file-uploader.component.scss'] styleUrls: ['./additional-file-uploader.component.scss']
}) })
@@ -1,5 +1,5 @@
import {Component, DestroyRef, inject, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core'; import {Component, DestroyRef, inject, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core';
import {CommonModule} from '@angular/common';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {BookReview, BookReviewService} from './book-review-service'; import {BookReview, BookReviewService} from './book-review-service';
import {ProgressSpinner} from 'primeng/progressspinner'; import {ProgressSpinner} from 'primeng/progressspinner';
@@ -16,7 +16,7 @@ import {AppSettingsService} from '../../../../shared/service/app-settings.servic
@Component({ @Component({
selector: 'app-book-reviews', selector: 'app-book-reviews',
standalone: true, standalone: true,
imports: [CommonModule, ProgressSpinner, Rating, Tag, Button, FormsModule, Tooltip], imports: [ProgressSpinner, Rating, Tag, Button, FormsModule, Tooltip],
templateUrl: './book-reviews.component.html', templateUrl: './book-reviews.component.html',
styleUrl: './book-reviews.component.scss' styleUrl: './book-reviews.component.scss'
}) })
@@ -1,5 +1,5 @@
@if (filteredBooks$ | async; as books) { @if (filteredBooks$ | async; as books) {
<div class="rounded-xl overflow-hidden border-[1px] border-solid border-[var(--p-content-border-color)]"> <div class="rounded-xl overflow-hidden border-[1px] border-solid border-[var(--p-content-border-color)]">
<p-tabs [value]="tab" lazy="true" scrollable> <p-tabs [value]="tab" lazy="true" scrollable>
<p-tablist> <p-tablist>
<p-tab value="view"> <p-tab value="view">
@@ -95,13 +95,17 @@
<div class="grid series-items-grid overflow-y-auto" #Container <div class="grid series-items-grid overflow-y-auto" #Container
[ngStyle]="{'grid-template-columns': 'repeat(auto-fill, minmax(' + gridColumnMinWidth + ', 1fr))'}"> [ngStyle]="{'grid-template-columns': 'repeat(auto-fill, minmax(' + gridColumnMinWidth + ', 1fr))'}">
<div class="grid-item" *ngFor="let book of books; let i = index" @for (book of books; track book; let i = $index) {
<div class="grid-item"
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}"> [ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
<app-book-card [index]="i" [book]="book" [isCheckboxEnabled]="false" [isSelected]="false" <app-book-card [index]="i" [book]="book" [isCheckboxEnabled]="false" [isSelected]="false"
[isSeriesCollapsed]="false"> [isSeriesCollapsed]="false">
</app-book-card> </app-book-card>
</div> </div>
<div *ngIf="books.length === 0" class="empty-state">No books found for this series.</div> }
@if (books.length === 0) {
<div class="empty-state">No books found for this series.</div>
}
</div> </div>
</div> </div>
@@ -112,15 +116,15 @@
</p-tabpanel> </p-tabpanel>
</p-tabpanels> </p-tabpanels>
</p-tabs> </p-tabs>
</div> </div>
} @else { } @else {
<div class="flex flex-col justify-center items-center h-full gap-4"> <div class="flex flex-col justify-center items-center h-full gap-4">
<p-progressSpinner strokeWidth="4" fill="transparent" animationDuration=".8s"> <p-progressSpinner strokeWidth="4" fill="transparent" animationDuration=".8s">
</p-progressSpinner> </p-progressSpinner>
<p style="color: var(--primary-color);"> <p style="color: var(--primary-color);">
Loading series details... Loading series details...
</p> </p>
</div> </div>
} }
@@ -2,7 +2,7 @@ import { Component, inject, ViewChild } from "@angular/core";
import { FormsModule } from "@angular/forms"; import { FormsModule } from "@angular/forms";
import { Button } from "primeng/button"; import { Button } from "primeng/button";
import { ActivatedRoute } from "@angular/router"; import { ActivatedRoute } from "@angular/router";
import { AsyncPipe, NgClass, NgFor, NgIf, NgStyle } from "@angular/common"; import { AsyncPipe, NgClass, NgStyle } from "@angular/common";
import { map, filter, switchMap } from "rxjs/operators"; import { map, filter, switchMap } from "rxjs/operators";
import { Observable, combineLatest } from "rxjs"; import { Observable, combineLatest } from "rxjs";
import { Book, ReadStatus } from "../../model/book.model"; import { Book, ReadStatus } from "../../model/book.model";
@@ -25,8 +25,6 @@ import { Router } from "@angular/router";
AsyncPipe, AsyncPipe,
Button, Button,
FormsModule, FormsModule,
NgIf,
NgFor,
NgStyle, NgStyle,
NgClass, NgClass,
BookCardComponent, BookCardComponent,
@@ -37,9 +35,8 @@ import { Router } from "@angular/router";
TabPanels, TabPanels,
TabPanel, TabPanel,
Tag, Tag,
VirtualScrollerModule
VirtualScrollerModule, ],
],
}) })
export class SeriesPageComponent { export class SeriesPageComponent {
@@ -1,6 +1,6 @@
import {Component, inject, OnInit} from '@angular/core'; import {Component, inject, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormBuilder, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
import {CommonModule} from '@angular/common';
import {InputText} from 'primeng/inputtext'; import {InputText} from 'primeng/inputtext';
import {Button} from 'primeng/button'; import {Button} from 'primeng/button';
import {Tooltip} from 'primeng/tooltip'; import {Tooltip} from 'primeng/tooltip';
@@ -18,7 +18,6 @@ import {filter, take} from "rxjs/operators";
selector: 'app-bulk-metadata-update-component', selector: 'app-bulk-metadata-update-component',
standalone: true, standalone: true,
imports: [ imports: [
CommonModule,
ReactiveFormsModule, ReactiveFormsModule,
FormsModule, FormsModule,
InputText, InputText,
@@ -28,7 +27,7 @@ import {filter, take} from "rxjs/operators";
Checkbox, Checkbox,
ProgressSpinner, ProgressSpinner,
AutoComplete AutoComplete
], ],
providers: [MessageService], providers: [MessageService],
templateUrl: './bulk-metadata-update-component.html', templateUrl: './bulk-metadata-update-component.html',
styleUrl: './bulk-metadata-update-component.scss' styleUrl: './bulk-metadata-update-component.scss'
@@ -1,14 +1,15 @@
<div class="comic-reader-container" tabindex="0"> <div class="comic-reader-container" tabindex="0">
<div class="navigation"> <div class="navigation">
<div class="goto-page-controls"> <div class="goto-page-controls">
@if (currentBook?.metadata?.seriesName) {
<button <button
*ngIf="currentBook?.metadata?.seriesName"
class="series-nav-button prev-book" class="series-nav-button prev-book"
(click)="navigateToPreviousBook()" (click)="navigateToPreviousBook()"
[disabled]="!previousBookInSeries" [disabled]="!previousBookInSeries"
[title]="getPreviousBookTooltip()"> [title]="getPreviousBookTooltip()">
<span>← Previous Book</span> <span>← Previous Book</span>
</button> </button>
}
<div class="input-group"> <div class="input-group">
<input <input
@@ -27,14 +28,15 @@
</button> </button>
</div> </div>
@if (currentBook?.metadata?.seriesName) {
<button <button
*ngIf="currentBook?.metadata?.seriesName"
class="series-nav-button next-book" class="series-nav-button next-book"
(click)="navigateToNextBook()" (click)="navigateToNextBook()"
[disabled]="!nextBookInSeries" [disabled]="!nextBookInSeries"
[title]="getNextBookTooltip()"> [title]="getNextBookTooltip()">
<span>Next Book →</span> <span>Next Book →</span>
</button> </button>
}
</div> </div>
<div class="page-controls"> <div class="page-controls">
@@ -21,12 +21,12 @@ import {BookState} from '../../book/model/state/book-state.model';
import {ProgressSpinner} from 'primeng/progressspinner'; import {ProgressSpinner} from 'primeng/progressspinner';
import {FormsModule} from "@angular/forms"; import {FormsModule} from "@angular/forms";
import {NewPdfReaderService} from '../../book/service/new-pdf-reader.service'; import {NewPdfReaderService} from '../../book/service/new-pdf-reader.service';
import {NgIf} from '@angular/common';
@Component({ @Component({
selector: 'app-cbx-reader', selector: 'app-cbx-reader',
standalone: true, standalone: true,
imports: [ProgressSpinner, FormsModule, NgIf], imports: [ProgressSpinner, FormsModule],
templateUrl: './cbx-reader.component.html', templateUrl: './cbx-reader.component.html',
styleUrl: './cbx-reader.component.scss' styleUrl: './cbx-reader.component.scss'
}) })
@@ -1,5 +1,5 @@
import {Component, inject, OnDestroy, OnInit} from '@angular/core'; import {Component, inject, OnDestroy, OnInit} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {InputText} from 'primeng/inputtext'; import {InputText} from 'primeng/inputtext';
import {ToggleSwitch} from 'primeng/toggleswitch'; import {ToggleSwitch} from 'primeng/toggleswitch';
@@ -16,14 +16,13 @@ import {ExternalDocLinkComponent} from '../../../../../shared/components/externa
standalone: true, standalone: true,
selector: 'app-koreader-settings-component', selector: 'app-koreader-settings-component',
imports: [ imports: [
CommonModule,
FormsModule, FormsModule,
InputText, InputText,
ToggleSwitch, ToggleSwitch,
Button, Button,
ToastModule, ToastModule,
ExternalDocLinkComponent ExternalDocLinkComponent
], ],
providers: [MessageService], providers: [MessageService],
templateUrl: './koreader-settings-component.html', templateUrl: './koreader-settings-component.html',
styleUrls: ['./koreader-settings-component.scss'] styleUrls: ['./koreader-settings-component.scss']
@@ -8,19 +8,18 @@ import {ExternalDocLinkComponent} from '../../../shared/components/external-doc-
import {UserService} from '../user-management/user.service'; import {UserService} from '../user-management/user.service';
import {Subject} from 'rxjs'; import {Subject} from 'rxjs';
import {filter, takeUntil, tap} from 'rxjs/operators'; import {filter, takeUntil, tap} from 'rxjs/operators';
import {CommonModule} from '@angular/common';
@Component({ @Component({
selector: 'app-email-v2', selector: 'app-email-v2',
imports: [ imports: [
CommonModule,
FormsModule, FormsModule,
TableModule, TableModule,
Divider, Divider,
EmailV2ProviderComponent, EmailV2ProviderComponent,
EmailV2RecipientComponent, EmailV2RecipientComponent,
ExternalDocLinkComponent ExternalDocLinkComponent
], ],
templateUrl: './email-v2.component.html', templateUrl: './email-v2.component.html',
styleUrls: ['./email-v2.component.scss'], styleUrls: ['./email-v2.component.scss'],
}) })
@@ -1,5 +1,5 @@
import {Component, inject, OnDestroy, OnInit} from '@angular/core'; import {Component, inject, OnDestroy, OnInit} from '@angular/core';
import {CommonModule} from '@angular/common';
import {Button} from 'primeng/button'; import {Button} from 'primeng/button';
import {InputText} from 'primeng/inputtext'; import {InputText} from 'primeng/inputtext';
import {API_CONFIG} from '../../../core/config/api-config'; import {API_CONFIG} from '../../../core/config/api-config';
@@ -23,7 +23,6 @@ import {Select} from 'primeng/select';
@Component({ @Component({
selector: 'app-opds-settings', selector: 'app-opds-settings',
imports: [ imports: [
CommonModule,
Button, Button,
InputText, InputText,
Tooltip, Tooltip,
@@ -35,7 +34,7 @@ import {Select} from 'primeng/select';
ToggleSwitch, ToggleSwitch,
ExternalDocLinkComponent, ExternalDocLinkComponent,
Select Select
], ],
providers: [ConfirmationService], providers: [ConfirmationService],
templateUrl: './opds-settings.html', templateUrl: './opds-settings.html',
styleUrl: './opds-settings.scss' styleUrl: './opds-settings.scss'
@@ -3,7 +3,7 @@ import {DynamicDialogRef} from 'primeng/dynamicdialog';
import {UtilityService} from './utility.service'; import {UtilityService} from './utility.service';
import {TableModule} from 'primeng/table'; import {TableModule} from 'primeng/table';
import {InputText} from 'primeng/inputtext'; import {InputText} from 'primeng/inputtext';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {ProgressSpinner} from 'primeng/progressspinner'; import {ProgressSpinner} from 'primeng/progressspinner';
import {MenuItem} from 'primeng/api'; import {MenuItem} from 'primeng/api';
@@ -20,7 +20,6 @@ import {Tooltip} from 'primeng/tooltip';
imports: [ imports: [
TableModule, TableModule,
InputText, InputText,
CommonModule,
FormsModule, FormsModule,
ProgressSpinner, ProgressSpinner,
CheckboxModule, CheckboxModule,
@@ -29,7 +28,7 @@ import {Tooltip} from 'primeng/tooltip';
InputIcon, InputIcon,
IconField, IconField,
Tooltip Tooltip
], ],
styleUrls: ['./directory-picker.component.scss'] styleUrls: ['./directory-picker.component.scss']
}) })
export class DirectoryPickerComponent implements OnInit { export class DirectoryPickerComponent implements OnInit {
@@ -1,5 +1,5 @@
import {Component, inject, ChangeDetectionStrategy, ChangeDetectorRef, OnDestroy} from '@angular/core'; import {Component, inject, ChangeDetectionStrategy, ChangeDetectorRef, OnDestroy} from '@angular/core';
import {CommonModule} from '@angular/common';
import {DialogModule} from 'primeng/dialog'; import {DialogModule} from 'primeng/dialog';
import {ButtonModule} from 'primeng/button'; import {ButtonModule} from 'primeng/button';
import {Subscription} from 'rxjs'; import {Subscription} from 'rxjs';
@@ -8,7 +8,7 @@ import {DownloadProgress, DownloadProgressService} from '../../service/download-
@Component({ @Component({
selector: 'app-download-progress-dialog', selector: 'app-download-progress-dialog',
standalone: true, standalone: true,
imports: [CommonModule, DialogModule, ButtonModule], imports: [DialogModule, ButtonModule],
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './download-progress-dialog.component.html', templateUrl: './download-progress-dialog.component.html',
styleUrl: './download-progress-dialog.component.scss' styleUrl: './download-progress-dialog.component.scss'
@@ -2,7 +2,7 @@ import {Component, inject} from '@angular/core';
import {NotificationEventService} from '../../websocket/notification-event.service'; import {NotificationEventService} from '../../websocket/notification-event.service';
import {LogNotification} from '../../websocket/model/log-notification.model'; import {LogNotification} from '../../websocket/model/log-notification.model';
import {Tag} from 'primeng/tag'; import {Tag} from 'primeng/tag';
import {NgIf} from '@angular/common';
import {TagComponent} from '../tag/tag.component'; import {TagComponent} from '../tag/tag.component';
@Component({ @Component({
+2 -2
View File
@@ -14,7 +14,7 @@ import {routes} from './app/app.routes';
import {AuthInterceptorService} from './app/core/security/auth-interceptor.service'; import {AuthInterceptorService} from './app/core/security/auth-interceptor.service';
import {AuthService, websocketInitializer} from './app/shared/service/auth.service'; import {AuthService, websocketInitializer} from './app/shared/service/auth.service';
import {OAuthStorage, provideOAuthClient} from 'angular-oauth2-oidc'; import {OAuthStorage, provideOAuthClient} from 'angular-oauth2-oidc';
import {APP_INITIALIZER, provideAppInitializer} from '@angular/core'; import {APP_INITIALIZER, provideAppInitializer, provideZoneChangeDetection} from '@angular/core';
import {initializeAuthFactory} from './app/core/security/auth-initializer'; import {initializeAuthFactory} from './app/core/security/auth-initializer';
export function storageFactory(): OAuthStorage { export function storageFactory(): OAuthStorage {
@@ -27,7 +27,7 @@ import ChartDataLabels from 'chartjs-plugin-datalabels';
bootstrapApplication(AppComponent, { bootstrapApplication(AppComponent, {
providers: [ providers: [
provideCharts(withDefaultRegisterables(), ChartDataLabels), provideZoneChangeDetection(),provideCharts(withDefaultRegisterables(), ChartDataLabels),
{ {
provide: APP_INITIALIZER, provide: APP_INITIALIZER,
useFactory: websocketInitializer, useFactory: websocketInitializer,