2 Commits
Author SHA1 Message Date
Kevin Codex 04e8e8be6d fix: move repoSocial into api/_lib so Vercel functions can import it
Both api/repo-page and api/og crashed in production with
ERR_MODULE_NOT_FOUND on /var/task/src/lib/repoSocial: Vercel compiles
TypeScript under api/ only, so a function importing ../src/lib/* ships
an import specifier the Node runtime can't resolve — and the
/repos/:owner/:name rewrite meant every direct repo-page load 500'd.
The module was already runtime-agnostic by design; it now lives in
api/_lib with the browser hook importing across, and tsconfig.api's
src special-case is gone.
2026-07-22 13:54:57 +08:00
Kevin Codex c682af2e9e feat: per-repo social metadata — SSR share pages + dynamic OG images
Crawler-visible metadata for /repos/:owner/:name without turning the SPA
into an SSR app: a Vercel function fetches the built index.html, swaps
the marker-delimited social-meta block for repo-specific tags, and a
sibling function renders per-repo OG cards with @vercel/og (JetBrains
Mono TTFs; Satori can't consume WOFF2). Private repos and upstream
errors always get the generic site metadata plus noindex — repository
data is never interpolated on those paths. The client hook keeps
document meta in sync during SPA navigation, and the /api proxy narrows
to /api/v1 so local functions are reachable. Cache tiers: immutable
versioned OG URLs, 5m/1h SWR for pages, no-store on errors.
2026-07-22 12:48:19 +08:00