feat: introduce a shared config with an optional local override

The mairie form needs an organiser, an email and the café defaults. Ship the
defaults in the repo and let each volunteer override the personal bits in
config.local.json (gitignored, optional: a fresh clone still works).

config.js carries neither import nor export on purpose, so that it loads both
as a classic script (content script, background) and as an ESM module. That is
what lets presentation.js drop its duplicated café address.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Pierre Martin
2026-07-17 13:07:17 +02:00
co-authored by Claude Opus 4.8
parent 342fda9a0b
commit b103ab78ec
4 changed files with 113 additions and 2 deletions
+7 -2
View File
@@ -2,11 +2,16 @@
// Fonctions pures, sans DOM (testables). Locale et fuseau sont des constantes :
// l'appli est mono-locale (bénévoles de Cugnaux).
// config.js n'exporte rien : il pose globalThis.EchoConfig (cf. DECISIONS.md
// 2026-07-17). L'import ne sert qu'à son effet de bord.
import "./config.js";
const LOCALE = "fr-FR";
const FUSEAU = "Europe/Paris";
// RECHERCHE.md §2 : adresse du café de l'Atelier du Huit.
export const LIEU_PAR_DEFAUT = "8 Rue du Pré Vicinal 31270 Cugnaux";
// Source unique : le formulaire mairie a besoin de la même adresse (et de ses
// coordonnées) que la liste.
export const LIEU_PAR_DEFAUT = globalThis.EchoConfig.DEFAUTS.cafe.adresse;
// Un événement horodaté porte un vrai instant : on l'affiche à l'heure de
// Cugnaux, quel que soit le fuseau de la machine.