diff --git a/src/events-app/app.ts b/src/events-app/app.ts index 05db852..4e6963f 100644 --- a/src/events-app/app.ts +++ b/src/events-app/app.ts @@ -17,12 +17,15 @@ import { installLenientAuthGuard, markAuthReady, catchAllRoute } from '@/lib/rou import { acceptTokenFromUrl } from '@/lib/url-token' const APP_NAME = (import.meta.env.VITE_APP_NAME as string) || 'Events' +// Console label shows the brand in parens only when it differs from the +// default — avoids the redundant "Events (Events)" on unbranded builds. +const APP_LABEL = APP_NAME.toLowerCase() === 'events' ? 'Events' : `Events (${APP_NAME})` /** * Initialize the standalone events app */ export async function createAppInstance() { - console.log(`🚀 Starting ${APP_NAME}...`) + console.log(`🚀 Starting ${APP_LABEL}...`) // Accept token from URL before anything else (cross-subdomain auth relay) acceptTokenFromUrl(APP_NAME) @@ -116,7 +119,7 @@ export async function createAppInstance() { ;(window as any).__container = container } - console.log(`✅ ${APP_NAME} initialized`) + console.log(`✅ ${APP_LABEL} initialized`) return { app, router } } @@ -124,10 +127,10 @@ export async function startApp() { try { const { app } = await createAppInstance() app.mount('#app') - console.log(`🎉 ${APP_NAME} started!`) + console.log(`🎉 ${APP_LABEL} started!`) eventBus.emit('app:started', {}, 'app') } catch (error) { - console.error(`💥 Failed to start ${APP_NAME}:`, error) + console.error(`💥 Failed to start ${APP_LABEL}:`, error) document.getElementById('app')!.innerHTML = `

Failed to Start

diff --git a/vite.events.config.ts b/vite.events.config.ts index 418bb35..76c2c31 100644 --- a/vite.events.config.ts +++ b/vite.events.config.ts @@ -42,8 +42,7 @@ function eventsHtmlPlugin(): Plugin { * (default: /) → bouge.ariege.io (standalone subdomain) * * Set VITE_APP_NAME to brand the standalone (PWA name, HTML title, console - * logs). cfaun sets "Bouge" via NixOS; future deployments can override - * (e.g. "Bouge"). Defaults to "Events". + * logs). cfaun overrides to "Bouge" via NixOS. Defaults to "Events". */ const APP_NAME = process.env.VITE_APP_NAME || 'Events' // Surface the resolved value back into env so Vite's HTML %VITE_APP_NAME%