From 4e7502b30c0f89cea97ef964abd2055c491ca0cb Mon Sep 17 00:00:00 2001 From: Padreug Date: Tue, 9 Jun 2026 23:15:58 +0200 Subject: [PATCH] refactor(branding): drop VITE_APP_NAME compat shim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per the pre-public-launch policy in CLAUDE.md, strict-from-the-start. brand.json is the sole source for app naming; VITE_APP_NAME no longer overrides. Migration responsibility moves to aiolabs/server-deploy#8 (Phase 2): hosts that currently set VITE_APP_NAME (cfaun → "Bouge") must instead declare BRAND_DIR pointing at a per-host branding/ directory before their next webapp flake input bump. process.env.VITE_APP_NAME is still set internally (from brand.name) to keep Vite's HTML %VITE_APP_NAME% substitution working — but it's internal wiring now, not a user-facing knob. Part of aiolabs/webapp#95. Co-Authored-By: Claude Opus 4.7 (1M context) --- vite.config.ts | 7 +++---- vite.events.config.ts | 13 ++++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index a6a25f3..68cc1aa 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -14,10 +14,9 @@ import { brand, brandAlias } from './vite-branding' // path-mounted standalones at /libra/, /market/, etc. The hub is a // launcher page; users install the standalones they actually use. -// Brand name flows into index.html's `%VITE_APP_NAME% Hub` title. -// VITE_APP_NAME env override stays during the Phase 2 server-deploy -// migration (aiolabs/webapp#95); drop once all hosts move to BRAND_DIR. -process.env.VITE_APP_NAME = process.env.VITE_APP_NAME ?? brand.name +// Brand name flows into index.html's `%VITE_APP_NAME% Hub` title via +// Vite's HTML env-var substitution. +process.env.VITE_APP_NAME = brand.name export default defineConfig(({ mode }) => ({ // Per-app dep cache so concurrent dev servers don't race on .vite/deps diff --git a/vite.events.config.ts b/vite.events.config.ts index c855806..9f5cd4d 100644 --- a/vite.events.config.ts +++ b/vite.events.config.ts @@ -43,13 +43,10 @@ function eventsHtmlPlugin(): Plugin { * (default: /) → bouge.ariege.io (standalone subdomain) * * Brand name resolves from brand.json under $BRAND_DIR (see - * vite-branding.ts and aiolabs/webapp#95). VITE_APP_NAME remains an - * env override during the Phase 2 server-deploy migration; drop the - * env path once all hosts have moved to BRAND_DIR. + * vite-branding.ts and aiolabs/webapp#95). Surfaced into Vite's HTML + * env-var substitution as VITE_APP_NAME for templated titles. */ -const APP_NAME = process.env.VITE_APP_NAME ?? brandManifestName() -// Surface the resolved value back into env so Vite's HTML %VITE_APP_NAME% -// substitution picks up the fallback when nothing was explicitly set. +const APP_NAME = brandManifestName() process.env.VITE_APP_NAME = APP_NAME export default defineConfig(({ mode }) => ({ @@ -88,9 +85,7 @@ export default defineConfig(({ mode }) => ({ ], manifest: { name: APP_NAME, - // VITE_APP_NAME, when set, overrides both name and short_name to - // preserve the pre-#95 behavior. Otherwise brand.shortName drives. - short_name: process.env.VITE_APP_NAME ?? brand.shortName ?? APP_NAME, + short_name: brand.shortName ?? APP_NAME, description: 'Discover events near you', theme_color: brand.themeColor ?? '#1f2937', background_color: brand.backgroundColor ?? '#ffffff',