feat: add public-api app and route update checks through it

- Add `apps/public-api` (`@sofa/public-api`) — minimal Hono app
  deployable to Vercel; `GET /v1/version` fetches the latest GitHub
  release and returns `{ version, releaseUrl }` with a 15-minute
  CDN cache (`s-maxage=900, stale-while-revalidate=3600`)
- Update `packages/core/src/update-check.ts` to call
  `PUBLIC_API_URL/v1/version` instead of the GitHub API directly;
  `PUBLIC_API_URL` defaults to `https://public-api.sofa.watch`
This commit is contained in:
2026-03-13 19:53:51 -04:00
parent e7ffceb278
commit 1798107afc
7 changed files with 120 additions and 12 deletions
+13
View File
@@ -85,6 +85,17 @@
"typescript": "catalog:",
},
},
"apps/public-api": {
"name": "@sofa/public-api",
"version": "0.1.0",
"dependencies": {
"hono": "4.12.7",
},
"devDependencies": {
"@types/bun": "catalog:",
"typescript": "catalog:",
},
},
"apps/server": {
"name": "@sofa/server",
"version": "0.1.0",
@@ -997,6 +1008,8 @@
"@sofa/native": ["@sofa/native@workspace:apps/native"],
"@sofa/public-api": ["@sofa/public-api@workspace:apps/public-api"],
"@sofa/server": ["@sofa/server@workspace:apps/server"],
"@sofa/tmdb": ["@sofa/tmdb@workspace:packages/tmdb"],