Skip to content

fix(frontend): export Expo web so Vercel preview serves HTML - #252

Open
gac0812 wants to merge 7 commits into
1024XEngineer:mainfrom
gac0812:fix/vercel-web-preview
Open

fix(frontend): export Expo web so Vercel preview serves HTML#252
gac0812 wants to merge 7 commits into
1024XEngineer:mainfrom
gac0812:fix/vercel-web-preview

Conversation

@gac0812

@gac0812 gac0812 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Closes #251

Summary

  • Vercel 预览当前把 frontend/index.tsvideo/mp2t 发出去,点开 Preview 会下载文件而不是打开页面。
  • 为 Expo Web 增加 SPA 导出配置,并让 Vercel 发布 dist/index.html,而不是源码。
  • CI 增加 Web 导出,并断言生成了 index.html

Scope

  • frontend/app.json:声明 web.output: "single"
  • frontend/vercel.jsonexpo export -p web,输出目录 dist
  • .github/workflows/ci.yml:增加 Web export 门禁
  • frontend/package.json / .gitignore:导出脚本与 dist-web/ 忽略

Out of scope

  • 不把预览变成完整可用的线上环境(不配置生产 API / WebSocket)
  • 不保证语音、定位、闹钟等原生能力在浏览器里可用
  • 不改 Android / iOS 原生构建

Test plan

  • npx expo export --platform web --output-dir dist-web 生成本地 index.htmltext/html SPA)
  • CI Frontend (lint, types, build) 通过,其中 Web export 步骤检查到 dist-web/index.html
  • 本 PR 的 Vercel Preview 根路径返回 HTML 页面,不再下载 index.ts

Vercel was publishing frontend source and serving index.ts as video/mp2t, so preview links downloaded a file instead of opening the app.
@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
timeflow Ready Ready Preview Aug 17, 2026 9:44am

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@gac0812
gac0812 marked this pull request as ready for review August 17, 2026 08:13
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.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已审查锁定提交范围内的完整改动,包括 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 引入且需要修改的正确性、兼容性或可靠性问题。

View job run

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(frontend): Vercel 预览把 index.ts 当视频下载,无法打开网页

1 participant