From 64f61004d181a2d334b70b61a03bbe4cce5460e4 Mon Sep 17 00:00:00 2001 From: "Adrien W." Date: Sun, 11 Oct 2026 12:51:47 +0200 Subject: [PATCH] version 1.0.0 --- README.fr.md | 2 ++ README.md | 2 ++ docker/Caddyfile | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/App.svelte | 4 ++-- src/lib/updates.svelte.js | 14 ++++++++++++++ src/routes/About.svelte | 1 + vite.config.js | 15 +++++++++++++++ 9 files changed, 40 insertions(+), 6 deletions(-) diff --git a/README.fr.md b/README.fr.md index d2917f4..2e96ef4 100644 --- a/README.fr.md +++ b/README.fr.md @@ -5,6 +5,8 @@ elle peut démarrer automatiquement la journée et proposer sa clôture. Chaque commence là où la précédente s’est terminée. Les journées clôturées ont un récapitulatif concis, prêt à être recopié dans un registre papier. +Version actuelle de l’application : **1.0.0**. + Conçue pour l’extérieur : contraste élevé, grandes zones tactiles et utilisable avec des gants. Les données sont enregistrées localement dans IndexedDB. Une synchronisation facultative chiffrée de bout en bout les partage entre appareils diff --git a/README.md b/README.md index af830e7..d072720 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ the app is open, it can start a workday automatically and prompt to close it. Ea task starts when the previous one ends. Closed days have concise summaries ready to copy into a paper logbook. +Current application version: **1.0.0**. + Designed for outdoor use: high contrast, large touch targets, and usable with gloves. Data is stored locally in IndexedDB. Optional end-to-end encrypted synchronization shares it between authorized devices without requiring an email address or password. diff --git a/docker/Caddyfile b/docker/Caddyfile index f03af1a..9143c4a 100644 --- a/docker/Caddyfile +++ b/docker/Caddyfile @@ -44,7 +44,7 @@ http://{$SITE_ADDRESS} { # If a browser is allowed to serve sw.js from its own cache, a new build is # never discovered and the in-app update prompt can never fire — the app would # silently freeze on whatever version it first installed. - @volatile path / /index.html /sw.js /manifest.webmanifest + @volatile path / /index.html /sw.js /manifest.webmanifest /app-version.json header @volatile Cache-Control "no-cache, must-revalidate" # Content-hashed filenames; the name changes whenever the bytes do. diff --git a/package-lock.json b/package-lock.json index 940a485..1de2138 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pardis", - "version": "0.8.0", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pardis", - "version": "0.8.0", + "version": "1.0.0", "dependencies": { "@hpke/core": "^1.9.0", "@zxing/browser": "^0.2.1", diff --git a/package.json b/package.json index 3b89e44..496105a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pardis", "private": true, - "version": "0.8.0", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src/App.svelte b/src/App.svelte index ee25cc3..8f3c418 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -4,7 +4,7 @@ import { loadBackupStatus } from './lib/backup-state.svelte.js'; import { go, router } from './lib/router.svelte.js'; import { loadSettings, settings } from './lib/settings.svelte.js'; - import { needsRefresh, applyUpdate } from './lib/updates.svelte.js'; + import { needsRefresh, availableVersion, applyUpdate } from './lib/updates.svelte.js'; import Resume from './routes/Resume.svelte'; import Settings from './routes/Settings.svelte'; import Today from './routes/Today.svelte'; @@ -105,7 +105,7 @@
- Mise à jour disponible + Mise à jour disponible{#if availableVersion.value} (v{availableVersion.value}){/if}
{/if} diff --git a/src/lib/updates.svelte.js b/src/lib/updates.svelte.js index 8e0f09d..cafee01 100644 --- a/src/lib/updates.svelte.js +++ b/src/lib/updates.svelte.js @@ -13,6 +13,19 @@ import { registerSW } from 'virtual:pwa-register'; const CHECK_INTERVAL = 60 * 60 * 1000; export const needsRefresh = $state({ value: false }); +export const availableVersion = $state({ value: '' }); + +async function loadAvailableVersion() { + availableVersion.value = ''; + try { + const response = await fetch('/app-version.json', { cache: 'no-store' }); + if (!response.ok) return; + const result = await response.json(); + if (typeof result.version === 'string') availableVersion.value = result.version; + } catch { + // The update prompt remains useful if a proxy briefly makes version data unavailable. + } +} /** @type {(reloadPage?: boolean) => Promise} */ let update = async () => {}; @@ -22,6 +35,7 @@ if (typeof window !== 'undefined') { immediate: true, onNeedRefresh() { needsRefresh.value = true; + void loadAvailableVersion(); }, onRegisteredSW(_url, registration) { if (!registration) return; diff --git a/src/routes/About.svelte b/src/routes/About.svelte index 437b6df..6ed92ab 100644 --- a/src/routes/About.svelte +++ b/src/routes/About.svelte @@ -10,6 +10,7 @@ enregistre les journées, les tâches, les clients, les repas et les pauses, puis prépare un récapitulatif à consulter ou à copier.

+

Version 1.0.0

L'application, son code source, et le service de synchronisation sont fournis gratuitement et sans aucune garantie.

diff --git a/vite.config.js b/vite.config.js index 8fb0b52..7057085 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,21 @@ +import { readFileSync } from 'node:fs'; import { svelte } from '@sveltejs/vite-plugin-svelte'; import { defineConfig } from 'vite'; import { VitePWA } from 'vite-plugin-pwa'; +const { version: appVersion } = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')); + +const appVersionAsset = { + name: 'pardis-app-version', + generateBundle() { + this.emitFile({ + type: 'asset', + fileName: 'app-version.json', + source: JSON.stringify({ version: appVersion }), + }); + }, +}; + export default defineConfig({ server: { host: '0.0.0.0', @@ -9,6 +23,7 @@ export default defineConfig({ }, preview: { proxy: { '/api/sync': 'http://127.0.0.1:3001' } }, plugins: [ + appVersionAsset, svelte(), VitePWA({ // Never `autoUpdate`: a worker swap mid-day reloads the page under the