Folo/apps/ssr/scripts
DIYgod 81c5b9f2e0
chore(infra): migrate desktop web to Cloudflare (#4869)
* chore(infra): migrate desktop web from Vercel to Cloudflare Workers

Replaces separate Vercel deployments (follow SPA + follow-external-ssr) with unified Cloudflare Workers + Assets deployment. Implements meta tag injection, OG image generation, and environment variable management in Hono-based Worker. Adds GitHub Actions CI/CD for automatic deployment on push to dev/main branches.

- Replace Fastify with Hono for Cloudflare Workers compatibility
- Create Worker entry point with SSR routes and SPA fallback
- Add AsyncLocalStorage-based request context shim
- Implement WASM-based OG image rendering with R2 font storage
- Split SPA and SSR routing: /share/* and auth routes use SSR, others fallback to SPA
- Add Cloudflare wrangler configuration with dev/prod environments
- Create GitHub Actions workflow for automated deployments
- Add build scripts for font data and WASM patching

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ssr): exclude worker files from typecheck and fix tsdown config

Worker-specific files (*.worker.ts) use Cloudflare Workers types and
generated modules that aren't available during the main tsc typecheck.
Exclude them from tsconfig since they're only used via tsdown aliases.
Also fix broken path.resolve reference in tsdown.worker.config.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 20:58:17 +08:00
..
check-fonts.ts chore(infra): migrate desktop web to Cloudflare (#4869) 2026-02-22 20:58:17 +08:00
cleanup-vercel-build.ts fix(path): change path package to pathe (#4038) 2025-07-07 16:55:37 +08:00
generate-font-data.ts chore(infra): migrate desktop web to Cloudflare (#4869) 2026-02-22 20:58:17 +08:00
patch-worker-build.ts chore(infra): migrate desktop web to Cloudflare (#4869) 2026-02-22 20:58:17 +08:00
prepare-vercel-build.ts fix(path): change path package to pathe (#4038) 2025-07-07 16:55:37 +08:00
skip-ssr-app-vercel-build.sh fix: vercel ssr deploy script 2025-04-03 00:22:17 +08:00
upload-fonts-to-r2.ts chore(infra): migrate desktop web to Cloudflare (#4869) 2026-02-22 20:58:17 +08:00