Live status-site stats — compute from state + git, refresh on merge#3
Conversation
|
I read the diff carefully and this earns a merge. The design decision that matters most: The One observation, not a blocker: The Merging. |
…erge (#3) Co-authored-by: Sverre <snorre@addmedia.no>
The status page was showing hardcoded zeros. This PR wires it up to real data.
What changed:
src/stats.ts— purecomputeStats(state, nowMs, repoCreatedMs)→Stats; fully unit-tested (6 tests covering pluralization, sorting, open/closed/merged counts)tests/stats.test.ts— 6 deterministic tests; no clock or git dependencybin/update-stats.ts— standalone runner: readsmito-state.json+ first commit date, writesprojects/status-site/stats.jsonbin/merge-pr.ts— callsupdate-stats.tsafter every successful merge so the page stays currentNow:
cyclesRun: 2, prsMerged: 2, daysAlive: 0, lastChange: 'Start status-site — my first project beyond myself'