Skip to content

feat: add extension icons - #11

Merged
tmlksu merged 1 commit into
mainfrom
feat/icons
Sep 1, 2026
Merged

tmlksu merged 1 commit into
mainfrom
feat/icons

Conversation

@tmlksu

@tmlksu tmlksu commented Sep 1, 2026

Copy link
Copy Markdown
Owner

アイコンが一つも無かった。manifest に icons キーが無く、画像ファイルも 0 枚。Chrome は頭文字のタイルを自動生成して表示していた。ウェブストアは 128x128 を必須にしているので、掲載の前提としても要る。

生成スクリプトにした理由

この機体には画像ツールが 1 つも入っていない(Pillow / ImageMagick / rsvg / inkscape すべて無し)。依存ゼロを売りにしているリポジトリに依存を足すのは筋が悪いので、make-icons.mjs が PNG を直接書いている。package.mjs が zip を直接書いているのと同じ理屈。

形はベクタ定義 1 箇所(角丸長方形 2 つの和)で決まるので、色や形を変えたければ 2 行いじって npm run icons で作り直せる。バイナリを不透明なまま置くより、あとで直せる。

図案

青の角丸正方形に白いフォルダ。全サイズ同一。16px で確認済みで、細かい装飾は潰れるが、タブの段差はこの大きさでも読める。

--- 16x16 ---
  ............
 ..............
................
................
................
...@@@@.........
...@@@@++++++...
...@@@@@@@@@@...
...@@@@@@@@@@...
...@@@@@@@@@@...
...@@@@@@@@@@...
...++++++++++...
................
................
 ..............
  ............

check の強化

npm run check が manifest の参照するファイルの実在を全部見るようにした(アイコンを含む)。128 が無ければ落ちる。生成物はパッケージから漏れやすいので。icons と action.default_icon が同じパスを指すぶんは重複を畳んでいる。

アイコンを 1 枚消して落ちること、npm run package の zip に 4 枚とも入ることを確認済み。

🤖 Generated with Claude Code

There were none — no icons key in the manifest and no image files at all.
Chrome fell back to a generated letter tile, and the Web Store requires a
128x128 before an extension can be listed.

The icons are generated by a script rather than committed as opaque binaries.
This machine has no image tooling at all (no Pillow, ImageMagick, rsvg or
inkscape), and adding a dependency to a repository whose selling point is
having none seemed the wrong trade — so make-icons.mjs writes the PNGs
directly, the way package.mjs already writes the zip. The shape lives in one
vector definition, so changing the colour or the form means editing two lines
and re-running it.

The artwork is a white folder on a blue rounded square, identical at every
size. It was checked at 16px, where anything with fine detail turns to mush;
the tab still reads there.

npm run check now verifies that every file the manifest names actually exists,
icons included, and that a 128 is present. Generated assets are the ones most
likely to go missing from a package.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tmlksu
tmlksu merged commit c1c5974 into main Sep 1, 2026
3 checks passed
@tmlksu
tmlksu deleted the feat/icons branch September 1, 2026 23:43
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