Skip to content

feat(cli): add a --check flag - #104

Open
stachbial wants to merge 7 commits into
@stachbial/group-opacityfrom
@stachbial/cli-check
Open

stachbial wants to merge 7 commits into
@stachbial/group-opacityfrom
@stachbial/cli-check

Conversation

@stachbial

@stachbial stachbial commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • --check reports the sets a build would regenerate and exits with 1 if there are any. It builds, writes and links nothing. It checks the sets the same command would build without it: the icon and symbol sets of .nanoicons.json, or only the dynamic sets with --dynamic or --dynamic-app-config.
  • Without --dynamic, a static font set is also out of date when its copy in android/ or ios/ differs from the generated font, e.g. after the Metro plugin rebuilt it without linking.
  • A set is out of date for the same reasons a build regenerates it: a missing file, changed SVGs, options or installed versions, a changed linking mode, or web output turned on or off. Each set is named with its reason.
  • The build and the check use the same up-to-date test.
  • The SVG fingerprint reads CRLF line endings as LF, so a Windows checkout stays up to date. A glyphmap that is not valid JSON, or has no fingerprint or family, is out of date, and the build regenerates it.
  • README: the flag in the CLI table and a CI note under "When fonts are regenerated". FONT_INTEGRITY.md: the CLI run.

Test plan

  • yarn test (653 tests), ts-check and lint clean. New: each reason for an icon set, the flag with every set source, and a real build of fonts and symbols that stays up to date until an SVG changes, with nothing written, and linked fonts that are missing or differ.
  • Bare example: --check names the three font sets whose committed android/ fonts were built from older outputs, and passes after a full CLI run. After editing one of its SVGs it names that set and exits with 1, and the outputs stay byte-identical.
  • Expo example: --check --dynamic-app-config reads the app config and checks only the dynamic set.

@stachbial
stachbial added this pull request to stack #103 October 22, 2026 00:46
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Font benchmark: ✅ pass

base b002d89 → pr ba41806. 3 runs per set. Sizes are exact; times come from separate runners.

Details

Fonts

Raw is the .ttf on disk. Compressed is the same file after deflate at level 9, which is roughly what an APK or IPA carries.

Set Raw Compressed
MaterialIcons_baseline 307,528 → 307,528 (0.0%) 163,775 → 163,775 (0.0%)
MaterialIcons_outline 338,072 → 338,072 (0.0%) 182,651 → 182,651 (0.0%)
MaterialIcons_round 416,936 → 416,936 (0.0%) 216,846 → 216,846 (0.0%)
MaterialIcons_sharp 273,232 → 273,232 (0.0%) 150,630 → 150,630 (0.0%)
MaterialIcons_twotone 451,268 → 451,268 (0.0%) 236,463 → 236,463 (0.0%)
SWMIcons_outline 107,116 → 107,116 (0.0%) 28,632 → 28,632 (0.0%)
SWMIcons_duotone 115,860 → 115,860 (0.0%) 34,184 → 34,184 (0.0%)
SWMIcons_curved 102,524 → 102,524 (0.0%) 31,597 → 31,597 (0.0%)

Package

base pr Δ
Tarball bytes 135,800 137,233 +1.1%
Files 290 290

Checks

Check Limit Result
Raw font growth ≤ 6% per set ✅
Tarball growth ≤ 6% ✅
Byte-identical rebuilds required ✅ (base: yes)
OpenType Sanitizer every font accepted ✅
Build time, median of 3 runs (not gated)
Set base pr Δ
MaterialIcons_baseline 3,578 ms 4,866 ms +36.0%
MaterialIcons_outline 3,825 ms 5,252 ms +37.3%
MaterialIcons_round 4,742 ms 6,521 ms +37.5%
MaterialIcons_sharp 3,232 ms 4,606 ms +42.5%
MaterialIcons_twotone 4,780 ms 6,777 ms +41.8%
SWMIcons_outline 1,851 ms 2,603 ms +40.6%
SWMIcons_duotone 1,972 ms 2,811 ms +42.5%
SWMIcons_curved 1,762 ms 2,496 ms +41.7%

@stachbial
stachbial force-pushed the @stachbial/cli-check branch from a0ba7ad to ce98d56 Compare October 28, 2026 11:46
@stachbial
stachbial marked this pull request as ready for review October 29, 2026 18:03
@stachbial
stachbial force-pushed the @stachbial/cli-check branch from ce98d56 to ba41806 Compare October 29, 2026 20:21
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.

1 participant