d7e4e52fd3
V2 was the legacy single-app Vite playground. Per the 2026-05-01 atelier design brainstorm, V3 is the sole authoring target going forward. MediaManager and NetworkPanel features explicitly retired (no porting). Removed: - frontend-scratch-v2/ entirely (50 files, ~11k LOC) Retargeted to frontend-v3 + pnpm: - Makefile: FRONTEND_DIR, frontend-typecheck/test/build (renamed from frontend-lint as eslint not yet wired in V3) - tools/dev/zacus.sh: FRONTEND_ROOT, action commands - tools/dev/zacus_tui.py: action_frontend_tests + build cwd - .github/workflows/validate.yml: pnpm/action-setup, cache: pnpm, --frozen-lockfile, typecheck step added Documentation cleanup: - Root CLAUDE.md: Architecture, Where to Look, Nested Guidance lines purged of V2; pointer to atelier design doc added - frontend-v3/CLAUDE.md: V2 vs V3 section removed; editor description points to fusion design doc - desktop/CLAUDE.md: V2 anti-pattern removed - specs/CLAUDE.md: cross-stack pair example updated to packages/scenario-engine Archive: tag archive/frontend-scratch-v2-final on the commit immediately preceding deletion preserves the last state where V2 still worked. Acceptance: - rg "frontend-scratch-v2" in code paths -> 0 hits - make frontend-test -> 11/11 green (3 skipped) - make frontend-build -> 6/6 green
2.0 KiB
2.0 KiB
Desktop — Zacus Studio
macOS Electron control hub for Professeur Zacus escape room kits. Bundles the V3 frontends, talks to ESP32 over USB serial, and ships notarised universal/arm64 builds.
Layout
src/
main/ # Electron main process (Node) — IPC, serial, app lifecycle
preload/ # Context-bridge preload (exposes safe APIs to renderer)
renderer/ # React renderer (UI)
scripts/
build-frontends.sh # Bundles frontend-v3 apps into resources/
notarize.js # Apple notarization (post-build hook)
resources/ # Bundled frontend artefacts + assets
Commands
npm install # Triggers electron-builder install-app-deps + electron-rebuild
npm run dev # Concurrent main + renderer
npm run build # tsc main + vite renderer
npm run build:mac # Universal (x64 + arm64) installer
npm run build:mac-arm64 # Apple Silicon only
npm run rebuild-native # zacus-native addon for current Electron ABI
Patterns
- Three tsconfigs (
tsconfig.main.json,tsconfig.renderer.json, root) — never share between processes; main and renderer have different module systems. - Serial port access lives in
src/main/only. Renderer talks viapreloadIPC, never importsserialport. - Native modules (
serialport,zacus-native) need rebuilding for Electron's Node ABI — runnpm run rebuild-nativeafter Electron upgrades. - Notarization requires
APPLE_ID,APPLE_APP_SPECIFIC_PASSWORD,APPLE_TEAM_IDenv vars; never commit them.
Frontend Bundle
scripts/build-frontends.sh builds frontend-v3/ apps and copies them into resources/. Run it before electron-builder if frontend changed.
Anti-Patterns
- Calling
require('serialport')from renderer (security: nodeIntegration must stay false) - Hardcoding device paths (
/dev/cu.usbserial-*) — enumerate at runtime viaserialport.list() - Skipping notarization on release builds (Gatekeeper will block)