Vite + React + TypeScript virtual pet game with local-first persistence and PWA packaging.
pnpm devstarts the local dev server.pnpm buildtypechecks and builds for production.pnpm deploydeploys an existingdistbuild to thetamakeyCloudflare Pages project.pnpm pages:devbuilds the app and runs Cloudflare Pages locally with Functions.pnpm pages:deploybuilds and deploysdistto thetamakeyCloudflare Pages project.pnpm lintruns ESLint.pnpm typecheckruns TypeScript without emitting files.pnpm testruns Vitest unit tests.pnpm e2eruns Playwright E2E tests.pnpm verifyruns typecheck, lint, unit tests, production build, and E2E.
Current saves use schemaVersion: 3 and tamakey.save.v3. The loader still
accepts tamakey.save.v2 and tamakey.save.v1, migrates them to v3, and writes
future saves back through the v3 key. Invalid JSON or unsupported schemas are
rejected and backed up under tamakey.save.backup.v3.
V1.1 is ready for Cloudflare Pages deployment:
- React/Vite builds static assets into
dist. public/_routes.jsonsends only/api/*through Pages Functions.functions/api/[[route]].tsexposes a Hono API shell./api/healthreturns deployment and local-save status./api/v1/metadocuments disabled V1.1 cloud features for future clients.
The game still uses IndexedDB/localStorage for saves. The Hono structure is reserved for V2, where Pages Functions can add D1, KV, login, and cloud-save routes without changing the frontend hosting model.
Cloudflare build settings:
- Build command:
pnpm run build - Deploy command:
pnpm run deploy - Build output directory:
dist
Do not use npx wrangler deploy for this project. That command targets
Workers, but Tamakey is a Pages app with Pages Functions.
If Wrangler can access multiple Cloudflare accounts in a non-interactive
environment, set CLOUDFLARE_ACCOUNT_ID for the Pages project account.
The app uses vite-plugin-pwa with Workbox and registerType: 'autoUpdate'.
That means service worker updates are applied automatically; there is no
blocking in-app update prompt. PWA acceptance coverage checks the web manifest,
icon assets, and that the game shell remains usable when service workers are
blocked.