Restructure: move Vite project into app/, deploy build output to repo root

The webserver serves the repo checkout directly as static files, so
index.html at the repo root must be the production build (pointing at
hashed /assets/*.js) rather than the dev template (/src/main.tsx),
which was being served with an unrecognized application/octet-stream
MIME type and blocked by the browser.

- Move src/, public/, scripts/, server/, package.json, vite.config.ts,
  tsconfig.json, .env(.example), and the dev index.html into app/.
- Add app/scripts/deploy.mjs: copies app/dist/* into the repo root
  after every `vite build`, cleaning up stale hashed filenames.
- Wire it into `npm run build` (app/package.json).
- Update run.sh to operate from app/, and .gitignore for the new layout.
- Commit the current build output (index.html, assets/, manifest,
  sw.js, workbox-*.js, favicon.svg, icons/, LICENSE) to the repo root.
- Update README with the new project layout and deployment model.
This commit is contained in:
oliver committed 2026-11-04 14:05:46 -03:00
1 parent 5245c0a856
commit c7b653ff6a
54 files changed
+224 -34

No files matched your search

+3 -3
View File
@@ -4,7 +4,7 @@
#
# ./run.sh # dev server -> http://localhost:5173
# ./run.sh dev # same as above
# ./run.sh build # production build into dist/
# ./run.sh build # production build, deployed into the repo root
# ./run.sh serve # build if needed, then host + proxy /api/* (needs HERMES_TARGET)
# ./run.sh preview # build, then serve the build with vite preview
# ./run.sh icons # regenerate the PWA icon set
@@ -17,7 +17,7 @@
#
set -eu
cd "$(dirname "$0")"
cd "$(dirname "$0")/app"
MODE="${1:-dev}"
@@ -54,7 +54,7 @@ case "$MODE" in
build)
ensure_deps
ensure_icons
log "Building..."
log "Building and deploying to repo root..."
exec npm run build
;;
serve)