Skip to content

feat(badges): add country flag "built in {country}" provider#117

Merged
jal-co merged 1 commit into
mainfrom
feat/flag-provider
Jun 7, 2026
Merged

feat(badges): add country flag "built in {country}" provider#117
jal-co merged 1 commit into
mainfrom
feat/flag-provider

Conversation

@jal-co

@jal-co jal-co commented Jun 7, 2026

Copy link
Copy Markdown
Owner

What

Adds a new /flag/{code} badge provider that renders a "built in {country}" badge with the country flag as a natural-aspect chip on the left.

  • Supports all 265 country-flag-icons codes (ISO 3166-1 alpha-2 plus regions/subdivisions like eu, gb-eng, es-ct)
  • Case-insensitive (/flag/us, /flag/US)
  • Automatic definite-article phrasing (us → "the USA", gb → "the UK", nl → "the Netherlands")
  • Common short names (cn → "China", not "People's Republic of China")
  • Unknown codes return a readable fallback badge, never a broken image

Why

A frequently-requested "made in / built in {country}" badge for READMEs, product pages, and OSS profiles. Flags render as a crisp chip at their natural 3:2 proportions — no stretching, no cropping — so every flag (stripes, circles, emblems) reads correctly.

Closes #

Type

  • feat — New feature

How

  • coregetFlagBadge() provider + flags.json (265 code→name map); FlagEl renders the flag SVG as a Satori <img> chip (preserves original multi-color fills, unlike the monochrome icon path); route handler wires /flag/{code}, defaults to the secondary variant.
  • web — docs page (/docs/badges/flag), sidebar nav, API reference, README badge table, badge-builder preset (new "Other" group), showcase Location category, and a 30-flag /dev/social seed for social screenshots.
  • Also removed a stale, now-unused eslint-disable directive in badge-builder-core.tsx that was failing lint-staged --max-warnings 0 (pre-existing on main).

Checklist

  • Branch follows conventional naming (feat/flag-provider)
  • Commits follow Conventional Commits
  • Tested locally with pnpm dev
  • Badge renders correctly in SVG and PNG
  • Docs updated (new provider page, API reference, README, sidebar)

Screenshots

Renders verified locally (SVG + PNG) for US, UK, Japan, Germany, France, Canada, Brazil, India, South Korea, Australia, Mexico, South Africa, EU — all at correct proportions in both dark and light mode.

/flag/us.svg → 🇺🇸 built in the USA

Add a /flag/{code} provider that renders a "built in {country}" badge with
the country flag as a natural-aspect chip on the left. Supports all 265
country-flag-icons codes (ISO 3166-1 alpha-2 plus regions/subdivisions like
eu, gb-eng, es-ct), case-insensitive, with automatic definite-article
phrasing (us -> "the USA").

- core: getFlagBadge provider + flags.json code->name map (265 entries)
- core: FlagEl renders the flag SVG as a 3:2 <img> chip (preserves colors)
- core: route handler wires /flag/{code}, defaults to secondary variant
- web: docs page, sidebar nav, API reference, README, badge builder preset
- web: showcase Location category + 30-flag /dev/social seed for socials

Also drops a stale, now-unused eslint-disable directive in
badge-builder-core.tsx that blocked lint-staged.
@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
shieldcn Ready Ready Preview, Comment Jun 7, 2026 5:55pm

Request Review

@github-actions github-actions Bot added feature New feature or enhancement docs Documentation changes core labels Jun 7, 2026
Comment thread packages/core/src/badges/render.tsx
@jal-co jal-co merged commit 130bcc0 into main Jun 7, 2026
4 checks passed
@jal-co jal-co deleted the feat/flag-provider branch June 7, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core docs Documentation changes feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant