Repository navigation
chore(vscode): generate the extension icon at package time instead of committing a duplicate - #44
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extensions/vscode/images/icon.pngwas a byte-for-byte committed duplicate ofassets/kiritan.png, kept only becausevscerequires the manifest"icon"field to point at a real file physically inside the extension's own directory tree — confirmed by readingvsce'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 withThe specified icon '...' wasn't found in the extension.). Unlike a README's markdown image link, this can't just be an external/absolute URL.ASSETS_LICENSE.md's "Covered Files" list (which only enumerates paths underassets/), so a second persisted copy of the image existed outside that document's own stated scope.extensions/vscode/package.jsonnow has abuild:iconscript (node -ecopy, no new dependency) thatpackage/publishboth run first, copyingassets/kiritan.pngtoimages/icon.pngat build time.images/is now gitignored —assets/kiritan.pngstays the single persisted copy, already fully covered byASSETS_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.Test plan
npm run ci(prettier + eslint)npm run typechecknpm run test(no behavioral change to app code, full existing suite passes)images/, rannpm run build:iconstandalone and confirmed the copied file is byte-identical toassets/kiritan.png; ran the fullnpm run packagefrom a clean state and confirmed the resulting.vsixcorrectly bundlesimages/icon.png(verified viavsce's own file listing output)fix-unnatural-line-breakslint on both edited files