--- import { getTotalRuleCount, getTotalExporterCount, data } from '../data/rules'; import { GITHUB_API_REPO_URL, GITHUB_URL } from '../data/site'; const totalRules = getTotalRuleCount(); const totalExporters = getTotalExporterCount(); const totalGroups = data.groups.length; const STAR_MILESTONE = 10000; const MILESTONE_LABEL = '10k'; let stars = 0; try { const res = await fetch(GITHUB_API_REPO_URL, { headers: { 'Accept': 'application/vnd.github+json' } }); if (res.ok) { const json = await res.json(); stars = json.stargazers_count ?? 0; } } catch {} const starsLabel = stars > 0 ? (stars >= 1000 ? `${(stars / 1000).toFixed(1)}k` : String(stars)) : '—'; const progressPct = stars > 0 ? Math.min(100, (stars / STAR_MILESTONE) * 100).toFixed(1) : '0'; const starsFormatted = stars > 0 ? stars.toLocaleString('en') : ''; const milestoneFormatted = STAR_MILESTONE.toLocaleString('en'); ---
{totalRules}
alert rules
{totalExporters}
exporters
{totalGroups}
categories
{starsLabel}
engineers starred
{starsFormatted}{stars > 0 ? ` / ${milestoneFormatted} — help us reach ${MILESTONE_LABEL}!` : ''} Star it