From 4b6b4d96eff7769ec3f09171cb31b50c32148d3b Mon Sep 17 00:00:00 2001 From: medic-bot Date: Wed, 11 Mar 2026 08:03:08 -0400 Subject: [PATCH] fix: sync public/ changelogs and automate copy on build/dev (#37) The in-app changelog page reads from public/CHANGELOG*.md which were stale (last synced at 0.6.3). Add automatic sync via Vite config (runs on dev/build start) and npm prebuild script so public/ copies are always up to date without manual intervention. Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 2 +- package.json | 1 + public/CHANGELOG.fr.md | 24 ++++++++++++++++++++++++ public/CHANGELOG.md | 24 ++++++++++++++++++++++++ vite.config.ts | 25 +++++++++++++++++++++++-- 5 files changed, 73 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index e6f3283..2b356b1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -141,7 +141,7 @@ La documentation technique est centralisée dans `docs/` : - `CHANGELOG.fr.md` (français) — traduction - Catégories : Added/Ajouté, Changed/Modifié, Fixed/Corrigé, Removed/Supprimé - Format [Keep a Changelog](https://keepachangelog.com/). Le contenu est extrait automatiquement par le CI pour les release notes et affiché dans l'app selon la langue de l'utilisateur. -- Les deux fichiers sont copiés dans `public/` par le CI (`release.yml`). En dev, synchroniser manuellement : `cp CHANGELOG*.md public/` +- The `public/` copies are synced automatically: Vite copies them on `dev`/`build` start (`vite.config.ts`), and the `prebuild` npm script handles standalone builds. No manual sync needed. --- diff --git a/package.json b/package.json index f02b823..d2de1cd 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "vite", "build": "tsc && vite build", + "prebuild": "cp CHANGELOG.md public/CHANGELOG.md && cp CHANGELOG.fr.md public/CHANGELOG.fr.md", "preview": "vite preview", "tauri": "tauri", "test": "vitest run", diff --git a/public/CHANGELOG.fr.md b/public/CHANGELOG.fr.md index 60e63aa..4fb3f87 100644 --- a/public/CHANGELOG.fr.md +++ b/public/CHANGELOG.fr.md @@ -2,6 +2,30 @@ ## [Non publié] +## [0.6.5] + +### Ajouté +- Tableau de bord : menu déroulant de sélection du mois pour la section Budget vs Réel avec le dernier mois complété par défaut (#31) + +### Modifié +- Rapports et tableau de bord : police réduite dans le menu déroulant de mois pour un meilleur équilibre visuel (#31) + +## [0.6.4] + +### Ajouté +- Tableau de budget : colonne du total de l'année précédente affichée comme première colonne de données pour servir de référence (#16) + +### Corrigé +- Tableau de bord : les catégories de niveau 4+ apparaissent maintenant sous leur parent au lieu du bas de la section (#23) +- Tableau de bord : la hiérarchie de catégories supporte maintenant une profondeur de niveaux arbitraire (#23) + +### Modifié +- Tableau de bord : le graphique circulaire prend 1/3 de la largeur au lieu de 1/2, donnant plus d'espace au tableau budget (#23) +- Tableau de bord : les étiquettes du graphique circulaire s'affichent uniquement au survol via le tooltip (#23) +- Budget vs Réel : la colonne des catégories reste désormais fixe lors du défilement horizontal (#29) +- Budget vs Réel : titre changé pour « Budget vs Réel pour le mois de [mois] » avec un menu déroulant pour sélectionner le mois (#29) +- Budget vs Réel : le mois par défaut est maintenant le dernier mois complété au lieu du mois courant (#29) + ## [0.6.3] ### Ajouté diff --git a/public/CHANGELOG.md b/public/CHANGELOG.md index 491f0f9..7b384a4 100644 --- a/public/CHANGELOG.md +++ b/public/CHANGELOG.md @@ -2,6 +2,30 @@ ## [Unreleased] +## [0.6.5] + +### Added +- Dashboard: month dropdown selector for the Budget vs Actual section with last completed month as default (#31) + +### Changed +- Reports & Dashboard: reduced font size of month dropdown for better visual balance (#31) + +## [0.6.4] + +### Added +- Budget table: previous year total column displayed as first data column for baseline reference (#16) + +### Fixed +- Dashboard: level 4+ categories now appear under their parent instead of at the bottom of the section (#23) +- Dashboard: category hierarchy now supports arbitrary nesting depth (#23) + +### Changed +- Dashboard: pie chart takes 1/3 width instead of 1/2, giving more space to the budget table (#23) +- Dashboard: pie chart labels now shown only on hover via tooltip instead of permanent legend (#23) +- Budget vs Actual: category column now stays fixed when scrolling horizontally (#29) +- Budget vs Actual: title changed to "Budget vs Réel pour le mois de [month]" with a dropdown month selector (#29) +- Budget vs Actual: default month is now the last completed month instead of current month (#29) + ## [0.6.3] ### Added diff --git a/vite.config.ts b/vite.config.ts index 429a2de..0aa465c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,12 +1,33 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; +import { copyFileSync } from "fs"; +import { resolve, dirname } from "path"; +import { fileURLToPath } from "url"; + +const __dirname = dirname(fileURLToPath(import.meta.url)); + +// Sync root CHANGELOG files to public/ so the app always shows the latest version history +function syncChangelogs() { + const files = ["CHANGELOG.md", "CHANGELOG.fr.md"]; + for (const file of files) { + try { + copyFileSync(resolve(__dirname, file), resolve(__dirname, "public", file)); + } catch { + // Ignore if source file doesn't exist + } + } +} // @ts-expect-error process is a nodejs global const host = process.env.TAURI_DEV_HOST; // https://vite.dev/config/ -export default defineConfig(async () => ({ +export default defineConfig(async () => { + // Sync changelogs before starting dev server or building + syncChangelogs(); + + return { plugins: [react(), tailwindcss()], // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` @@ -30,4 +51,4 @@ export default defineConfig(async () => ({ ignored: ["**/src-tauri/**"], }, }, -})); +}});