Initialize progress web app (#2351)

Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
ACX
2026-01-20 09:08:05 -07:00
committed by GitHub
co-authored by acx10
parent 66dee6d7e0
commit 36546061b5
21 changed files with 120 additions and 5 deletions
+2 -1
View File
@@ -85,7 +85,8 @@
"maximumError": "25kB"
}
],
"outputHashing": "all"
"outputHashing": "all",
"serviceWorker": "ngsw-config.json"
},
"development": {
"optimization": false,
+30
View File
@@ -0,0 +1,30 @@
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.csr.html",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
]
}
}
]
}
+20
View File
@@ -17,6 +17,7 @@
"@angular/platform-browser": "^21.1.0",
"@angular/platform-browser-dynamic": "^21.1.0",
"@angular/router": "^21.1.0",
"@angular/service-worker": "^21.1.0",
"@iharbeck/ngx-virtual-scroller": "^19.0.1",
"@primeng/themes": "^21.0.3",
"@stomp/rx-stomp": "^2.3.0",
@@ -810,6 +811,25 @@
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@angular/service-worker": {
"version": "21.1.0",
"resolved": "https://registry.npmjs.org/@angular/service-worker/-/service-worker-21.1.0.tgz",
"integrity": "sha512-6Kb9xrq7nFZ8MYnayEojI3HjIn2of4RJSr1CEPux/18KRPHml1IwXFjkwfnKkVZ8WzOVC2robt1Edp9ooLPsyg==",
"license": "MIT",
"dependencies": {
"tslib": "^2.3.0"
},
"bin": {
"ngsw-config": "ngsw-config.js"
},
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
},
"peerDependencies": {
"@angular/core": "21.1.0",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@asamuzakjp/css-color": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-4.1.1.tgz",
+2 -1
View File
@@ -21,6 +21,7 @@
"@angular/platform-browser": "^21.1.0",
"@angular/platform-browser-dynamic": "^21.1.0",
"@angular/router": "^21.1.0",
"@angular/service-worker": "^21.1.0",
"@iharbeck/ngx-virtual-scroller": "^19.0.1",
"@primeng/themes": "^21.0.3",
"@stomp/rx-stomp": "^2.3.0",
@@ -66,4 +67,4 @@
"typescript-eslint": "^8.53.0",
"vitest": "^4.0.17"
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

+57
View File
@@ -0,0 +1,57 @@
{
"name": "booklore",
"short_name": "booklore",
"display": "standalone",
"scope": "./",
"start_url": "./",
"icons": [
{
"src": "icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable any"
}
]
}
+3 -1
View File
@@ -6,11 +6,13 @@
<title>BookLore</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/svg+xml" href="assets/favicon.svg" />
<link rel="icon" type="image/svg+xml" href="assets/favicon.svg"/>
<link rel="manifest" href="manifest.webmanifest">
</head>
<body>
<app-root></app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
</body>
</html>
+6 -2
View File
@@ -14,11 +14,12 @@ import {routes} from './app/app.routes';
import {AuthInterceptorService} from './app/core/security/auth-interceptor.service';
import {AuthService, websocketInitializer} from './app/shared/service/auth.service';
import {OAuthStorage, provideOAuthClient} from 'angular-oauth2-oidc';
import {inject, provideAppInitializer, provideZoneChangeDetection} from '@angular/core';
import {inject, provideAppInitializer, provideZoneChangeDetection, isDevMode} from '@angular/core';
import {initializeAuthFactory} from './app/core/security/auth-initializer';
import {StartupService} from './app/shared/service/startup.service';
import {provideCharts, withDefaultRegisterables} from 'ng2-charts';
import ChartDataLabels from 'chartjs-plugin-datalabels';
import { provideServiceWorker } from '@angular/service-worker';
export function storageFactory(): OAuthStorage {
return localStorage;
@@ -64,6 +65,9 @@ bootstrapApplication(AppComponent, {
darkModeSelector: '.p-dark'
}
}
})
}), provideServiceWorker('ngsw-worker.js', {
enabled: !isDevMode(),
registrationStrategy: 'registerWhenStable:30000'
})
]
}).catch(err => console.error(err));