Skip to content

chore: resolve remaining polish issues (#30, #31, #32) - #35

Merged
timhettler merged 2 commits into
mainfrom
chore/remaining-polish
Aug 10, 2026
Merged

timhettler merged 2 commits into
mainfrom
chore/remaining-polish

Conversation

@timhettler

Copy link
Copy Markdown
Owner

Knocks out the three remaining follow-up issues from the production-readiness review.

#32 — lean tarball

Drops .ts sources and source maps from the published files; ships only compiled dist/*.js + dist/*.d.ts. Verified with npm pack --dry-run: 24 → 12 files, ~61 kB → ~38 kB unpacked. Runtime is unaffected — the compiled bin and the typed helpers are all a consumer uses.

#31 — --hash + --proxy no longer a footgun

The demo proxy route hardcoded public/symbolstore.svg, so --hash (which emits symbolstore-<hash>.svg) would 404. It now resolves the filename from /public (matching ^symbolstore(-[0-9a-f]+)?\.svg$), working with or without --hash, and the README documents the requirement.

#30 — --inline + CSP (docs, deliberately)

I investigated the optional code change and kept it as documentation on purpose: the inline styles hide the sprite in a way that does not break <use> (a plain display:none can stop some browsers resolving the reference), so stripping them risks broken icons or a layout gap. Instead the README now explains that inline mode needs style-src 'unsafe-inline' (or a nonce) under strict CSP — and that the static-file / proxy modes inject nothing into your document and are CSP-clean. Adds the trusted-input note for dangerouslySetInnerHTML too.

Closes #30. Closes #31. Closes #32.

🤖 Generated with Claude Code

timhettler and others added 2 commits August 10, 2026 15:53
Drop the TypeScript sources (bin/**/*.ts, lib/**/*.ts) and source maps
from the published `files` list; ship only the compiled dist .js and
.d.ts. Consumers run the compiled CLI and (rarely) import the typed
helpers — neither needs original sources or maps. Unpacked size drops
from ~61 kB to ~38 kB (24 -> 12 files), verified with npm pack --dry-run.

Closes #32.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The proxy route hardcoded public/symbolstore.svg, so combining --hash
(which emits symbolstore-<hash>.svg) with --proxy produced a route that
404s the sprite. Resolve the filename from /public (matching
symbolstore(-<hash>)?.svg) so the route works with or without --hash,
and document the requirement in the README.

Also document Content-Security-Policy behavior for --inline: it injects
inline styles (a deliberate, <use>-safe way to hide the sprite, since a
plain display:none can stop some browsers resolving the reference), so a
strict CSP needs style-src 'unsafe-inline' or a nonce; the static-file
and proxy modes inject nothing into the document and are CSP-clean.

Closes #31.
Closes #30.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@timhettler
timhettler merged commit ca6ca02 into main Aug 10, 2026
4 checks passed
@timhettler
timhettler deleted the chore/remaining-polish branch August 10, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant