Skip to content

feat(ci): add size-limit bundle-size checks on PRs#112

Merged
zeevdr merged 2 commits into
mainfrom
feat/size-limit
Jun 3, 2026
Merged

feat(ci): add size-limit bundle-size checks on PRs#112
zeevdr merged 2 commits into
mainfrom
feat/size-limit

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented Jun 3, 2026

Summary

  • Adds size-limit and @size-limit/preset-small-lib as dev dependencies
  • Adds .size-limit.js config with a 160 kB budget for dist/index.js (node platform, ~150% of the 103.87 kB baseline)
  • Adds .github/workflows/size.yml — triggers on PRs, builds the SDK, then runs andresz1/size-limit-action which posts a before/after delta comment and fails if the budget is exceeded
  • Adds size npm script (npx size-limit)

Baseline

Size limit:  160 kB
Size:        103.87 kB with all dependencies, minified and brotlied

Test plan

  • CI size workflow triggers on this PR and posts a bundle-size comment
  • Workflow passes (103.87 kB < 160 kB budget)
  • npm run size works locally after npm run build

Closes #11

Adds size-limit + @size-limit/preset-small-lib dev deps with a
.size-limit.js config (node platform, 160 kB budget — ~150% of the
103.87 kB baseline). The new size.yml workflow runs on every PR,
comments with the before/after delta, and fails if the budget is
exceeded.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

andresz1/size-limit-action runs `npx size-limit` in an isolated context
that doesn't have `@size-limit/preset-small-lib`, causing the check to fail.
Replace with inline steps: run the local binary directly, then post a PR
comment via actions/github-script.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Bundle size

Entry Size Budget Status
dist/index.js 101.4 kB 160000

@zeevdr zeevdr merged commit 656ba01 into main Jun 3, 2026
13 checks passed
@zeevdr zeevdr deleted the feat/size-limit branch June 3, 2026 10:04
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.

Add size-limit action for bundle-size PR checks

1 participant