feat: support a public browser demo of the kiosk #88

Merged
padreug merged 3 commits from feat/web-demo into dev 2026-09-06 18:04:50 +00:00
3 changed files with 7 additions and 0 deletions
Showing only changes of commit 1b671bf407 - Show all commits

build(machine): add a web-only build:web target

The machine app's `build` script runs vue-tsc, the Vite build, two electron
tsc passes and an esbuild bundle. Serving the kiosk as a plain SPA needs only
the middle one, and the electron passes drag in native-addon typings that a
web build has no use for.

Add `build:web` (just `vite build`) with a turbo task that still builds the
workspace packages first via `dependsOn: ["^build"]`, so a consumer can run
`pnpm build:web` at the repo root and get `apps/machine/dist`.

`env: ["VITE_*"]` is declared on the task because the Vite vars are baked into
the bundle at build time — without it turbo would happily serve a cached
build produced under different env.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013A6683cCHnQxFUosx1krY4
Padreug 2026-09-06 19:24:15 +02:00

View file

@ -15,6 +15,7 @@
"dev:vite": "vite", "dev:vite": "vite",
"electron:dev": "tsc -p electron/tsconfig.json && tsc -p electron/tsconfig.preload.json && electron dist-electron/main.js", "electron:dev": "tsc -p electron/tsconfig.json && tsc -p electron/tsconfig.preload.json && electron dist-electron/main.js",
"build": "vue-tsc --noEmit && vite build && tsc -p electron/tsconfig.json && tsc -p electron/tsconfig.preload.json && npx esbuild electron/fund-atm.ts --bundle --platform=node --format=cjs --external:better-sqlite3 --outfile=dist-electron/fund-atm.bundle.cjs", "build": "vue-tsc --noEmit && vite build && tsc -p electron/tsconfig.json && tsc -p electron/tsconfig.preload.json && npx esbuild electron/fund-atm.ts --bundle --platform=node --format=cjs --external:better-sqlite3 --outfile=dist-electron/fund-atm.bundle.cjs",
"build:web": "vite build",
"build:electron": "pnpm build && electron-builder", "build:electron": "pnpm build && electron-builder",
"preview": "vite preview", "preview": "vite preview",
"typecheck": "vue-tsc --noEmit", "typecheck": "vue-tsc --noEmit",

View file

@ -7,6 +7,7 @@
"scripts": { "scripts": {
"dev": "turbo dev", "dev": "turbo dev",
"build": "turbo build", "build": "turbo build",
"build:web": "turbo build:web",
"test": "turbo test", "test": "turbo test",
"lint": "turbo lint", "lint": "turbo lint",
"format": "prettier --write .", "format": "prettier --write .",

View file

@ -5,6 +5,11 @@
"dependsOn": ["^build"], "dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"] "outputs": ["dist/**", ".next/**", "!.next/cache/**"]
}, },
"build:web": {
"dependsOn": ["^build"],
"outputs": ["dist/**"],
"env": ["VITE_*"]
},
"dev": { "dev": {
"cache": false, "cache": false,
"persistent": true "persistent": true