{{ message }}
feat(landing): hero GitHub star badge + shared build-time star fetch (plan 68) - #2228
Merged
Conversation
…(plan 68) Add a star-count CTA to the hero, reusing SocialProof's build-time GitHub fetch instead of duplicating it: extract the fetch into a shared, memoized lib/github-stars.ts (one API call per build), consumed by both the hero badge and the community card. Clicks are tracked via the existing data-cta delegation (github-star-hero / github-star-community) — no new analytics event. Fails open: when the build-time fetch returns no count, the badge renders "Star" with no fabricated number. Unit test covers the fail-open + formatting invariants. Co-Authored-By: duyetbot <bot@duyet.net>
duyet
enabled auto-merge (squash)
July 3, 2026 11:38
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What (plan 68 — GitHub star social proof)
Adds a star-count CTA to the hero and wires click tracking on the star CTAs, reconciling with the star fetch
SocialProof.astroalready does rather than duplicating it.lib/github-stars.ts(new) — extracts the build-time GitHubstargazers_countfetch into a shared, memoized helper so the static build makes one API call, consumed by both the hero badge and the community card. Fails open: on offline/rate-limited/non-200, counts arenull.data-cta="github-star-hero"). When the fetch returns no count it renders "Star" with no fabricated number.data-cta="github-star-community".data-ctadelegation inBase.astro→ allowlistedcta_clickevent (DNT-respecting) — no new analytics event type added.github-stars.test.ts(new) + atestscript for the landing package: covers the fail-open invariant (throw/non-200 → null, never a fake count) and count formatting.Reconciliation note (STOP/DRIFT)
The plan's STOP condition says reconcile if a star count already exists — it did (
SocialProof.astro). So this shares that one data path and adds only the missing hero badge + tracking, instead of a second fetch/duplicate card.OpenSource.astrois not mounted inindex.astro, so the mid-page card stays inSocialProof.Verification
cd apps/landing && bun run build— green (5 pages); built HTML contains bothgithub-star-heroandgithub-star-communityCTAs.bun test apps/landing/src/lib/github-stars.test.ts— 7 pass.bun run check(whole repo) — clean, no format drift. Pre-push (891 unit/package tests) green.Risk
Additive marketing-only; no app/runtime/billing/security change. Honest-marketing invariant held (real count or none).
Co-Authored-By: duyetbot bot@duyet.net