Skip to content

chore(vscode): generate the extension icon at package time instead of committing a duplicate - #44

Merged
otnc merged 1 commit into
mainfrom
chore/vscode-icon-build-time-copy
Sep 14, 2026
Merged

otnc merged 1 commit into
mainfrom
chore/vscode-icon-build-time-copy

Conversation

@otnc

@otnc otnc commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • extensions/vscode/images/icon.png was a byte-for-byte committed duplicate of assets/kiritan.png, kept only because vsce requires the manifest "icon" field to point at a real file physically inside the extension's own directory tree — confirmed by reading vsce's own source (this.icon = ... path.posix.normalize(...), checked against the collected file list; a path outside the extension folder wouldn't be found and packaging would fail with The specified icon '...' wasn't found in the extension.). Unlike a README's markdown image link, this can't just be an external/absolute URL.
  • The committed duplicate also wasn't covered by ASSETS_LICENSE.md's "Covered Files" list (which only enumerates paths under assets/), so a second persisted copy of the image existed outside that document's own stated scope.
  • Instead of keeping the duplicate committed, extensions/vscode/package.json now has a build:icon script (node -e copy, no new dependency) that package/publish both run first, copying assets/kiritan.png to images/icon.png at build time. images/ is now gitignored — assets/kiritan.png stays the single persisted copy, already fully covered by ASSETS_LICENSE.md's existing terms (including its explicit exception for "the icon of its own VS Code extension"), so no license text changes are needed.
  • No documentation referenced the old committed file's path, so nothing else needed updating.

Test plan

  • npm run ci (prettier + eslint)
  • npm run typecheck
  • npm run test (no behavioral change to app code, full existing suite passes)
  • Manual verification: deleted images/, ran npm run build:icon standalone and confirmed the copied file is byte-identical to assets/kiritan.png; ran the full npm run package from a clean state and confirmed the resulting .vsix correctly bundles images/icon.png (verified via vsce's own file listing output)
  • fix-unnatural-line-breaks lint on both edited files

… committing a duplicate

extensions/vscode/images/icon.png was a byte-for-byte committed copy
of assets/kiritan.png, kept only because vsce requires the icon file
to physically exist inside the extension's own directory tree (it
can't reference an external URL or a path outside it, unlike a
README's markdown image links). A committed duplicate outside assets/
also wasn't covered by ASSETS_LICENSE.md's "Covered Files" list.

Adds a build:icon script (a plain node -e copy, no new dependency)
that both package/publish now run first, and gitignores the generated
images/ directory instead of committing its output. assets/kiritan.png
stays the single persisted copy of the image, which
ASSETS_LICENSE.md's existing terms already cover.
@otnc
otnc merged commit 19e9ae4 into main Sep 14, 2026
4 checks passed
@otnc
otnc deleted the chore/vscode-icon-build-time-copy branch September 14, 2026 14:29
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