Skip to content

Commit 60f13d9

Browse files
CoderJackZhuclaude
andcommitted
@
fix(vscode): regenerate icon.png and fix SVG font-family icon.png was stale — it was never regenerated after the SVG text changed from "MindDoc" to "MindCtx" (commit 6a7e60d). VS Code uses icon.png, not the SVG, so the extension icon showed the old text. Also changed font-family from "system-ui" (a CSS keyword unresolvable by librsvg/sharp) to "Arial, Helvetica, sans-serif" for consistent cross-platform rendering. Added scripts/generate-icon.mjs to keep PNG in sync going forward. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> @
1 parent 3346dc4 commit 60f13d9

5 files changed

Lines changed: 316 additions & 3 deletions

File tree

packages/vscode/assets/icon.png

277 Bytes
Loading

packages/vscode/assets/icon.svg

Lines changed: 1 addition & 1 deletion
Loading

packages/vscode/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
"build": "node esbuild.config.mjs production",
208208
"dev": "node esbuild.config.mjs --watch",
209209
"typecheck": "tsc --noEmit",
210+
"generate-icon": "node scripts/generate-icon.mjs",
210211
"package": "vsce package --no-dependencies",
211212
"publish": "vsce publish --no-dependencies"
212213
},
@@ -218,6 +219,7 @@
218219
"esbuild": "^0.20",
219220
"html-to-image": "^1.11.13",
220221
"preact": "^10.19",
222+
"sharp": "^0.34.5",
221223
"typescript": "^5.4"
222224
},
223225
"dependencies": {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Generates icon.png from icon.svg.
3+
* Run before packaging: node scripts/generate-icon.mjs
4+
*/
5+
import { readFileSync, mkdirSync } from 'fs';
6+
import { dirname, join } from 'path';
7+
import { fileURLToPath } from 'url';
8+
import sharp from 'sharp';
9+
10+
const __dirname = dirname(fileURLToPath(import.meta.url));
11+
const svgPath = join(__dirname, '..', 'assets', 'icon.svg');
12+
const pngPath = join(__dirname, '..', 'assets', 'icon.png');
13+
14+
const svgBuffer = readFileSync(svgPath);
15+
const info = await sharp(svgBuffer).resize(128, 128).png().toFile(pngPath);
16+
17+
console.log(`icon.png generated (${info.width}x${info.height}, ${info.size} bytes)`);

pnpm-lock.yaml

Lines changed: 296 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)