Support build-time ditto.json config file

Read an optional ditto.json (or CONFIG_FILE env) at build time, validate
it with Zod, and inject the result via Vite's define. At runtime the
build-time values are merged between the hardcoded defaults and user
localStorage, giving precedence: user > build-time > hardcoded.

Extract canonical Zod schemas into config/schema.ts (no path aliases)
so they can be imported from both vite.config.ts and runtime code.
Move AppConfigSchema out of AppProvider into src/lib/schemas.ts to
eliminate duplication.
This commit is contained in:
Alex Gleason
2026-02-26 17:53:54 -06:00
parent d45adf604a
commit 3eb92f472c
8 changed files with 228 additions and 126 deletions
+3
View File
@@ -33,6 +33,9 @@ deploy.sh
.env.*
!.env.example
# Build-time configuration
ditto.json
# Android build outputs and sensitive files
*.aab
resources/