Skip to content

feat(ext): generate extension icons from a single SVG source#45

Merged
paperhurts merged 1 commit into
mainfrom
feat/extension-icons
Jun 13, 2026
Merged

feat(ext): generate extension icons from a single SVG source#45
paperhurts merged 1 commit into
mainfrom
feat/extension-icons

Conversation

@paperhurts

Copy link
Copy Markdown
Owner

What

Both browser shells shipped with the default puzzle-piece icon. This adds real branding driven from a single source of truth.

  • assets/gitmarks.svg — master artwork (cyan/magenta per spec.md), 512×512 viewBox.
  • scripts/gen-icons.mjs — rasterizes the SVG to 16/32/48/128 px PNGs into each shell's icons/ dir using @resvg/resvg-js (prebuilt binary, no system ImageMagick/librsvg).
  • Generated icons/ dirs are git-ignored and recreated on every build.

Wiring

  • Both manifests declare icons + action.default_icon.
  • prebuild/predev/pree2e run gen-icons.mjs before the existing copy-html.mjs.
  • Chrome: @crxjs/vite-plugin emits icons/ into dist/ from the manifest refs.
  • Firefox: plain Vite (root: src) can't see icons/, so copy-manifest.mjs copies the PNGs into dist/icons/ post-build.

Docs

  • READMEs document the single-source workflow ("edit the SVG, rebuild — no manifest changes").
  • Dropped stale "default puzzle piece" / "icons deferred" notes.
  • Chrome README now documents loading the same dist/ in other Chromium browsers (Brave/Edge/Opera/Vivaldi).
  • .gitignore: ignore generated icons/ per shell; ignore .claude/ + .sid/.

Verification

  • node scripts/gen-icons.mjs → clean, writes 8 PNGs.
  • pnpm --filter @gitmarks/extension-chrome build → icons present in dist/manifest.json + dist/icons/.
  • pnpm --filter @gitmarks/extension-firefox build[firefox] copied icons/ to dist/, dist/icons/ populated.

🤖 Generated with Claude Code

Both shells shipped with the default puzzle-piece icon. Add a single
master artwork (assets/gitmarks.svg, cyan/magenta per spec) and a
build-time rasterizer (scripts/gen-icons.mjs, @resvg/resvg-js) that emits
16/32/48/128 px PNGs into each shell's git-ignored icons/ dir.

- Chrome: crxjs emits icons/ into dist/ from the manifest refs.
- Firefox: plain Vite (root: src) can't see icons/, so copy-manifest.mjs
  copies the PNGs into dist/icons/ post-build.
- Both manifests declare icons + action.default_icon.
- prebuild/predev/pree2e run gen-icons.mjs before the existing copy-html.
- READMEs document the single-source workflow; drop stale "puzzle piece"
  notes. Chrome README also documents loading the same dist/ in other
  Chromium browsers (Brave/Edge/Opera/Vivaldi).
- .gitignore: ignore generated icons/ per shell; ignore .claude/ + .sid/.

Verified: gen-icons.mjs runs clean; both shells build with icons present
in dist/manifest.json and dist/icons/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@paperhurts paperhurts merged commit 85ee513 into main Jun 13, 2026
1 check passed
@paperhurts paperhurts deleted the feat/extension-icons branch June 13, 2026 17:53
paperhurts added a commit that referenced this pull request Jun 13, 2026
feat(ext): generate extension icons from a single SVG source
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