feat(branding): brand kit architecture (Phase 1) #96

Merged
padreug merged 10 commits from feat/brand-kit into dev 2026-06-10 08:17:56 +00:00
2 changed files with 7 additions and 13 deletions
Showing only changes of commit 4e7502b30c - Show all commits

refactor(branding): drop VITE_APP_NAME compat shim

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) <noreply@anthropic.com>
Padreug 2026-06-09 23:15:58 +02:00

View file

@ -14,10 +14,9 @@ import { brand, brandAlias } from './vite-branding'
// path-mounted standalones at /libra/, /market/, etc. The hub is a // path-mounted standalones at /libra/, /market/, etc. The hub is a
// launcher page; users install the standalones they actually use. // launcher page; users install the standalones they actually use.
// Brand name flows into index.html's `%VITE_APP_NAME% Hub` title. // Brand name flows into index.html's `%VITE_APP_NAME% Hub` title via
// VITE_APP_NAME env override stays during the Phase 2 server-deploy // Vite's HTML env-var substitution.
// migration (aiolabs/webapp#95); drop once all hosts move to BRAND_DIR. process.env.VITE_APP_NAME = brand.name
process.env.VITE_APP_NAME = process.env.VITE_APP_NAME ?? brand.name
export default defineConfig(({ mode }) => ({ export default defineConfig(({ mode }) => ({
// Per-app dep cache so concurrent dev servers don't race on .vite/deps // Per-app dep cache so concurrent dev servers don't race on .vite/deps

View file

@ -43,13 +43,10 @@ function eventsHtmlPlugin(): Plugin {
* (default: /) bouge.ariege.io (standalone subdomain) * (default: /) bouge.ariege.io (standalone subdomain)
* *
* Brand name resolves from brand.json under $BRAND_DIR (see * Brand name resolves from brand.json under $BRAND_DIR (see
* vite-branding.ts and aiolabs/webapp#95). VITE_APP_NAME remains an * vite-branding.ts and aiolabs/webapp#95). Surfaced into Vite's HTML
* env override during the Phase 2 server-deploy migration; drop the * env-var substitution as VITE_APP_NAME for templated titles.
* env path once all hosts have moved to BRAND_DIR.
*/ */
const APP_NAME = process.env.VITE_APP_NAME ?? brandManifestName() const 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.
process.env.VITE_APP_NAME = APP_NAME process.env.VITE_APP_NAME = APP_NAME
export default defineConfig(({ mode }) => ({ export default defineConfig(({ mode }) => ({
@ -88,9 +85,7 @@ export default defineConfig(({ mode }) => ({
], ],
manifest: { manifest: {
name: APP_NAME, name: APP_NAME,
// VITE_APP_NAME, when set, overrides both name and short_name to short_name: brand.shortName ?? APP_NAME,
// preserve the pre-#95 behavior. Otherwise brand.shortName drives.
short_name: process.env.VITE_APP_NAME ?? brand.shortName ?? APP_NAME,
description: 'Discover events near you', description: 'Discover events near you',
theme_color: brand.themeColor ?? '#1f2937', theme_color: brand.themeColor ?? '#1f2937',
background_color: brand.backgroundColor ?? '#ffffff', background_color: brand.backgroundColor ?? '#ffffff',