Skip to content

feat(renderers): migrate renderErrorCard to satori (phase 2)#51

Merged
evirunurm merged 1 commit into
feat/migrate-to-satorifrom
feat/satori-phase2-migrate-error-card
Mar 20, 2026
Merged

feat(renderers): migrate renderErrorCard to satori (phase 2)#51
evirunurm merged 1 commit into
feat/migrate-to-satorifrom
feat/satori-phase2-migrate-error-card

Conversation

@evirunurm
Copy link
Copy Markdown
Owner

@evirunurm evirunurm commented Mar 20, 2026

Summary

  • Add ErrorCard.tsx JSX component with satori-compatible flexbox layout (title, divider, message)
  • Refactor renderErrorCard to async, using satori to generate SVG from the JSX component
  • Add Inter WOFF fonts (weight 400 & 600) to scripts/assets/fonts/ — required since satori's bundled opentype.js supports WOFF but not WOFF2
  • Update api/stats.ts and api/languages.ts to await renderErrorCard(...)
  • Update tests to async; replace the literal-text assertion with a diff-output assertion (satori renders text as SVG path outlines, not plain text nodes)

Closes #46

Test plan

  • Run npm test — all 18 tests pass
  • Run npm run typecheck — no TypeScript errors
  • Verify the error card renders correctly by triggering an error (e.g., invalid GitHub username) in the API

🤖 Generated with Claude Code

- Add ErrorCard.tsx JSX component for satori-compatible layout
- Refactor renderErrorCard to async, using satori for SVG generation
- Add Inter WOFF fonts (400, 600) for satori font rendering
- Update callers in api/stats.ts and api/languages.ts to await
- Update tests to be async; replace literal text check with diff check
  since satori renders text as SVG path outlines
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 20, 2026

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

Project Deployment Actions Updated (UTC)
github-stats-uvqq Ready Ready Preview, Comment Mar 20, 2026 1:14am

@evirunurm evirunurm merged commit 78e40bb into feat/migrate-to-satori Mar 20, 2026
2 checks passed
@evirunurm evirunurm deleted the feat/satori-phase2-migrate-error-card branch March 20, 2026 01:16
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.

1 participant