Skip to content

refactor(renderers): deduplicate renderer code and centralize constants#43

Merged
evirunurm merged 1 commit into
mainfrom
refactor/deduplicate-renderer-code
Mar 20, 2026
Merged

refactor(renderers): deduplicate renderer code and centralize constants#43
evirunurm merged 1 commit into
mainfrom
refactor/deduplicate-renderer-code

Conversation

@evirunurm
Copy link
Copy Markdown
Owner

@evirunurm evirunurm commented Mar 20, 2026

Summary

  • Extract shared TextAttr, CardAttr, and LanguageDataWithAccum interfaces to scripts/renderers/types.ts
  • Add COLOR_SUBTLE, COLOR_LIGHT, and COLOR_DARK constants to scripts/utils/constants.ts, replacing hardcoded hex strings across all three renderers
  • Extract calcPercentagesPie and calcPercentagesBar into scripts/renderers/calcPercentages.ts; update test imports accordingly

Closes #39

Test plan

  • npx tsc --noEmit passes with no errors
  • npx jest --no-coverage — all 18 tests pass
  • Rendered SVG cards (stat, lang percent, lang pie) are visually unchanged for both dark and white themes

🤖 Generated with Claude Code

Extract shared TextAttr, CardAttr, and LanguageDataWithAccum interfaces to
scripts/renderers/types.ts, move theme color magic strings to COLOR_SUBTLE /
COLOR_LIGHT / COLOR_DARK constants in utils/constants.ts, and extract the two
calcPercentages functions into scripts/renderers/calcPercentages.ts.

Closes #39
@evirunurm evirunurm self-assigned this Mar 20, 2026
@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 0:29am

@evirunurm evirunurm merged commit 9b2500d into main Mar 20, 2026
3 checks passed
@evirunurm evirunurm deleted the refactor/deduplicate-renderer-code branch March 20, 2026 00:33
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.

Phase 4: Deduplicate renderer code and centralize constants

1 participant