Skip to content

Add CI and a bundle-size performance budget - #5

Merged
reshimu merged 1 commit into
mainfrom
ci-bundle-size-budget
Jul 28, 2026
Merged

reshimu merged 1 commit into
mainfrom
ci-bundle-size-budget

Conversation

@reshimu

@reshimu reshimu commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • No CI existed for this repo at all until now — every validation command had been run manually, every session. Added .github/workflows/ci.yml: on every push to main and every PR, runs typecheck → lint → test → build → test:consumer → test:react-consumer → test:nextjs-consumer → check:bundle-size.
  • Added scripts/check-bundle-size.mjs (pnpm check:bundle-size) — plain Node, no new dependency. Checks dist/lib/index.js (budget 5 kB, current 2.28 kB), react.js (budget 30 kB, current 20.19 kB), react.css (budget 20 kB, current 11.56 kB), and any shared chunk (budget 2 kB each) — all with real headroom above current verified sizes.
  • Verified the check can actually fail, not just always pass: temporarily patched a copy with an impossibly low budget, confirmed [FAIL] output and a non-zero exit code, then discarded the patched copy.
  • This resolves RISK_PERFORMANCE_AUDIT.md's R-005 — the last Medium-severity open risk. Both Medium risks (R-005, R-006) are now resolved.

Test plan

  • Ran the exact full CI sequence locally end-to-end — all pass, 13 files/43 tests unchanged
  • Confirmed the bundle-size check fails correctly on a deliberately-broken budget before confirming it passes on the real one

🤖 Generated with Claude Code

No CI existed for this repo at all until now -- every validation
command had been run manually, every session, by whoever was working.
Added .github/workflows/ci.yml: on every push to main and every PR,
installs with --frozen-lockfile, then runs typecheck -> lint -> test ->
build -> test:consumer -> test:react-consumer -> test:nextjs-consumer ->
check:bundle-size, in that order -- the exact sequence this project's
sessions have been running by hand.

Added scripts/check-bundle-size.mjs (pnpm check:bundle-size) -- a plain
Node script, no new dependency, consistent with this repo's
minimal-dependencies preference over pulling in something like
size-limit. Checks dist/lib/index.js (budget 5 kB, current 2.28 kB),
react.js (budget 30 kB, current 20.19 kB), react.css (budget 20 kB,
current 11.56 kB), and any other shared chunk (budget 2 kB each,
current 0.48 kB) -- each budget set with real headroom above the
current verified size, not tuned to just barely pass.

Verified the check-script can actually fail, not just always pass:
temporarily patched a copy of the script with an impossibly small
budget, confirmed it printed [FAIL] and exited non-zero, then discarded
the patched copy. A budget check nobody's ever seen fail is
indistinguishable from no check at all.

This resolves RISK_PERFORMANCE_AUDIT.md's R-005 -- the last
Medium-severity open risk. Both Medium risks (R-005, R-006) are now
resolved.

Validated: ran the exact full CI sequence locally end-to-end
(typecheck -> lint -> test -> build -> test:consumer ->
test:react-consumer -> test:nextjs-consumer -> check:bundle-size) --
all pass, 13 files/43 tests unchanged.
@reshimu
reshimu merged commit c94d52b into main Jul 28, 2026
1 check passed
@reshimu
reshimu deleted the ci-bundle-size-budget branch July 28, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants