Files
hanzo.ai/lib/repos.ts
zeekay 24e67d965e landing: what we ship is counted, and drawn from the page's own parts
The commits section read numbers that were typed into scripts/sync-oss.ts
(5,420 repositories, 214 orgs, 784 pushes a day, 245,417 commits, each
contributor's count), a day's count scaled by a made-up factor, and a star
count that began at 1,420. The forge's database holds 1,150 repositories
and 46 orgs; none of that was read. Its panels were tinted rgba over a
stylesheet, DualStarButton showed its guess before GitHub answered, and
BulkStarModal said "successfully starred" over a forge PUT.

scripts/sync-oss.ts (was .mjs) now counts GitHub's public activity for the
orgs we publish: commits a day, the year, the week, active repositories and
the newest commits, written at each build with the moment it was read. A
figure the snapshot does not hold is not drawn. The grid, bars and
repository card are @hanzo/ui/marketing (8.29.19); the showcase stylesheet
and DayActivityModal are deleted. The org and repo pages lose their typed
"velocity" banners.

Design lint is zero in components/oss, home/OpenSource and ForgeBetaBanner.
e2e/gates/activity.spec.ts holds each figure to the snapshot, the cards to
one fill and edge in both schemes, a card's name, line and foot to their own
rows, and the phone to no sideways scroll.

Claude-Session: https://claude.ai/code/session_017vrVus6PPBgP5YRzKV1iqW
2026-10-26 09:57:01 -07:00

15 lines
644 B
TypeScript

import oss from './data/oss.json' with { type: 'json' }
/**
* Whether a reader can open github.com/<owner>/<name>: it is one of our public
* repositories, as scripts/sync-oss.ts lists them. A private repository
* answers a reader with a 404, so a link to one is a dead link.
*/
export const opens = (full: string): boolean => oss.public.includes(full)
/** A GitHub link a reader can open: the repository when it is public, the fallback otherwise. */
export function openable(url: string, fallback: string): string {
const repo = /^https:\/\/github\.com\/([^/]+\/[^/?#]+)/.exec(url)?.[1]
return repo && !opens(repo) ? fallback : url
}