diff --git a/angular.json b/angular.json index 1e77407..f7a89fb 100644 --- a/angular.json +++ b/angular.json @@ -53,7 +53,9 @@ } ], "styles": ["src/styles.scss"], - "scripts": [] + "scripts": [], + "serviceWorker": true, + "ngswConfigPath": "ngsw-config.json" }, "configurations": { "production": { diff --git a/ngsw-config.json b/ngsw-config.json new file mode 100644 index 0000000..a9dfe96 --- /dev/null +++ b/ngsw-config.json @@ -0,0 +1,21 @@ +{ + "$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": ["/assets/**/*.(png|svg|mp3)"] + } + } + ] +} diff --git a/package.json b/package.json index d6d43ec..2aef0af 100644 --- a/package.json +++ b/package.json @@ -1,48 +1,49 @@ { - "name": "retroski", - "version": "1.1.2", - "scripts": { - "ng": "ng", - "start": "ng serve", - "build": "ng build", - "watch": "ng build --watch --configuration development", - "test": "ng test", - "lint": "biome lint --write src", - "format": "biome format --write src", - "postbuild": "cp src/.htaccess dist/" - }, - "private": true, - "dependencies": { - "@angular/animations": "^19.0.5", - "@angular/common": "^19.0.5", - "@angular/compiler": "^19.0.5", - "@angular/core": "^19.0.5", - "@angular/forms": "^19.0.5", - "@angular/platform-browser": "^19.0.5", - "@angular/platform-browser-dynamic": "^19.0.5", - "@angular/router": "^19.0.5", - "date-fns": "4.1.0", - "dexie": "^4.0.9", - "excalibur": "0.30.2", - "pocketbase": "0.22.1", - "rxjs": "~7.8.0", - "tslib": "^2.3.0", - "zone.js": "~0.15.0" - }, - "devDependencies": { - "@angular-devkit/build-angular": "^19.0.5", - "@angular/cli": "^19.0.5", - "@angular/compiler-cli": "^19.0.5", - "@biomejs/biome": "1.9.4", - "@types/jasmine": "~5.1.0", - "@types/node": "22.10.2", - "jasmine-core": "~5.1.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", - "typescript": "~5.6.3", - "vite": "^5.0.0" - } -} + "name": "retroski", + "version": "1.1.2", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "watch": "ng build --watch --configuration development", + "test": "ng test", + "lint": "biome lint --write src", + "format": "biome format --write src", + "postbuild": "cp src/.htaccess dist/" + }, + "private": true, + "dependencies": { + "@angular/animations": "^19.0.5", + "@angular/common": "^19.0.5", + "@angular/compiler": "^19.0.5", + "@angular/core": "^19.0.5", + "@angular/forms": "^19.0.5", + "@angular/platform-browser": "^19.0.5", + "@angular/platform-browser-dynamic": "^19.0.5", + "@angular/router": "^19.0.5", + "@angular/service-worker": "^19.0.5", + "date-fns": "4.1.0", + "dexie": "^4.0.9", + "excalibur": "0.30.2", + "pocketbase": "0.22.1", + "rxjs": "~7.8.0", + "tslib": "^2.3.0", + "zone.js": "~0.15.0" + }, + "devDependencies": { + "@angular-devkit/build-angular": "^19.0.5", + "@angular/cli": "^19.0.5", + "@angular/compiler-cli": "^19.0.5", + "@biomejs/biome": "1.9.4", + "@types/jasmine": "~5.1.0", + "@types/node": "22.10.2", + "jasmine-core": "~5.1.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", + "typescript": "~5.6.3", + "vite": "^5.0.0" + } +} \ No newline at end of file diff --git a/public/icons/icon-128x128.png b/public/icons/icon-128x128.png new file mode 100644 index 0000000..5a9a2cc Binary files /dev/null and b/public/icons/icon-128x128.png differ diff --git a/public/icons/icon-144x144.png b/public/icons/icon-144x144.png new file mode 100644 index 0000000..11702cd Binary files /dev/null and b/public/icons/icon-144x144.png differ diff --git a/public/icons/icon-152x152.png b/public/icons/icon-152x152.png new file mode 100644 index 0000000..ff4e06b Binary files /dev/null and b/public/icons/icon-152x152.png differ diff --git a/public/icons/icon-192x192.png b/public/icons/icon-192x192.png new file mode 100644 index 0000000..afd36a4 Binary files /dev/null and b/public/icons/icon-192x192.png differ diff --git a/public/icons/icon-384x384.png b/public/icons/icon-384x384.png new file mode 100644 index 0000000..613ac79 Binary files /dev/null and b/public/icons/icon-384x384.png differ diff --git a/public/icons/icon-512x512.png b/public/icons/icon-512x512.png new file mode 100644 index 0000000..7574990 Binary files /dev/null and b/public/icons/icon-512x512.png differ diff --git a/public/icons/icon-72x72.png b/public/icons/icon-72x72.png new file mode 100644 index 0000000..033724e Binary files /dev/null and b/public/icons/icon-72x72.png differ diff --git a/public/icons/icon-96x96.png b/public/icons/icon-96x96.png new file mode 100644 index 0000000..3090dc2 Binary files /dev/null and b/public/icons/icon-96x96.png differ diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest index 21f1117..03b65a3 100644 --- a/public/manifest.webmanifest +++ b/public/manifest.webmanifest @@ -1,7 +1,7 @@ { "name": "RetroSki", "short_name": "RetroSki", - "description": "Retroski is a small game development project designed for peaceful mountain rides and friendly competition. Challenge your friends on randomly generated 2D alpine ski tracks!", + "description": "Retroski is a small game development project designed for peaceful mountain rides and friendly competition.", "theme_color": "#9747ff", "lang": "en", "background_color": "#ffffff", diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 51b684b..d76b229 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,8 +1,12 @@ -import { type ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; +import { type ApplicationConfig, provideZoneChangeDetection, isDevMode } from '@angular/core'; import { provideRouter, withHashLocation } from '@angular/router'; import { routes } from './app.routes'; +import { provideServiceWorker } from '@angular/service-worker'; export const appConfig: ApplicationConfig = { - providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes, withHashLocation())] + providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes, withHashLocation()), provideServiceWorker('ngsw-worker.js', { + enabled: !isDevMode(), + registrationStrategy: 'registerWhenStable:30000' + })] }; diff --git a/yarn.lock b/yarn.lock index 2727e8a..00e0175 100644 --- a/yarn.lock +++ b/yarn.lock @@ -238,6 +238,13 @@ dependencies: tslib "^2.3.0" +"@angular/service-worker@^19.0.5": + version "19.0.5" + resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-19.0.5.tgz#5ae776df8b75161b87dcaf735102ad161cc99541" + integrity sha512-qU5lgx1WJ+feCOV/EhkN9m20xFdIslpEQcSZZC+VJnEwcG6VTbofg1dRaHWZ9HAjS1uP7bFoK0HUYu4el0bHGA== + dependencies: + tslib "^2.3.0" + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2": version "7.26.2" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85"