fix(frontend): export Expo web so Vercel preview serves HTML - #252
fix(frontend): export Expo web so Vercel preview serves HTML#252gac0812 wants to merge 7 commits into
Conversation
Vercel was publishing frontend source and serving index.ts as video/mp2t, so preview links downloaded a file instead of opening the app.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Reviewed the complete fixed diff for the Expo web export, CI coverage, and Vercel deployment/routing contract. The generated web build contains index.html, the local lint/format/typecheck/Vitest/Jest checks pass (Jest reports its existing open-handle warning after all suites pass), and the deployed preview serves text/html at both / and /login plus application/javascript for the bundle asset. I found no actionable correctness, compatibility, or reliability regression introduced by this PR.
ExpoPlayAudioStream crashes web at import time. Use getUserMedia and Web Audio so preview can record 16kHz PCM and play streaming TTS without the native module.
Reviewers can enter a web-only local session when the API is unavailable. Preview auth failures no longer sign out, so the calendar stays open even if voice or cloud sync cannot connect.
Skip login on web so the calendar opens without a backend. Voice chrome stays visible, but capture and playback are no-ops so native audio does not crash the preview.
Vitest loads migrateScheduleDatabase for schedule integration tests. Importing Platform pulled react-native into that path and failed the CI parse. Fall back when exclusive transactions are unsupported instead.
There was a problem hiding this comment.
已审查锁定提交范围内的完整改动,包括 Expo Web/Vercel 导出与 SPA 路由、Web 音频替代实现,以及浏览器端 SQLite 初始化和迁移事务。平台分支与现有调用契约一致:Web 不再加载原生音频模块,SQLite 使用 Expo 支持的非独占事务,并保留原生端 WAL 与独占迁移路径。
验证通过:TypeScript 类型检查、Web 音频架构测试、AppRoot 与数据库迁移的 13 个 Jest 测试、生产 Web 导出;线上 Preview 的 / 与 /login 返回 HTML,主 bundle/worker 返回 JavaScript,SQLite WASM 返回 application/wasm。未发现由本 PR 引入且需要修改的正确性、兼容性或可靠性问题。
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Codecov flagged the new withTransactionAsync fallback as uncovered. Exercise commit and rollback so the patch coverage gate can pass.
Closes #251
Summary
frontend/index.ts当video/mp2t发出去,点开 Preview 会下载文件而不是打开页面。dist/index.html,而不是源码。index.html。Scope
frontend/app.json:声明web.output: "single"frontend/vercel.json:expo export -p web,输出目录dist.github/workflows/ci.yml:增加 Web export 门禁frontend/package.json/.gitignore:导出脚本与dist-web/忽略Out of scope
Test plan
npx expo export --platform web --output-dir dist-web生成本地index.html(text/htmlSPA)Frontend (lint, types, build)通过,其中 Web export 步骤检查到dist-web/index.htmlindex.ts