Skip to content

perf: shrink the published package - #13

Merged
hyamero merged 3 commits into
mainfrom
perf/package-size
Sep 29, 2026
Merged

hyamero merged 3 commits into
mainfrom
perf/package-size

Conversation

@hyamero

@hyamero hyamero commented Sep 29, 2026

Copy link
Copy Markdown
Member

Unpacked package size goes from 1.61 MB to 825 KB. The tarball is 318 KB.

file before after
dist/cli.js 918 KB 173 KB
dist/viewer.html 644 KB 622 KB
  • zod tree-shaking: import { z } from 'zod' pulled in the whole namespace, including 358 KB of error messages in every language. import * as z lets the bundler drop them. The CLI is also minified now.
  • Kerning table: stored as a compact string instead of an object literal, 119 KB down to 49 KB. The tabular-digits face is stored as the weight-500 face minus its 212 digit pairs. The decoded table matches the old one pair for pair; I checked every face. The generator writes through the same encoder.
  • Brand icons: brands.gen.ts keeps only title and path for each allowlisted mark, dropping colour, source URLs and licence fields. The table is regenerated with bun run icons:gen, and a test fails if it drifts from simple-icons.

All unit tests, typecheck, viewer and CLI e2e, and the smoke test pass locally.

@hyamero
hyamero merged commit eb69dd5 into main Sep 29, 2026
2 checks passed
@hyamero
hyamero deleted the perf/package-size branch September 30, 2026 03:31
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.1.0-rc.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant