Skip to content

fix(build): transpile watcher stages codicon.ttf so dev-mode icons render#59

Merged
Pterjudin merged 1 commit into
mainfrom
fix/transpile-stages-codicon-font-2026-05-31
May 31, 2026
Merged

fix(build): transpile watcher stages codicon.ttf so dev-mode icons render#59
Pterjudin merged 1 commit into
mainfrom
fix/transpile-stages-codicon-font-2026-05-31

Conversation

@Pterjudin
Copy link
Copy Markdown

Summary

codicon.ttf ships in node_modules/@vscode/codicons/dist/ and is normally moved into src/vs/base/browser/ui/codicons/codicon/ by gulp's copy-codicons task before transpile runs. The font file is .gitignore'd (correctly — it's a build artifact).

The watch-client-transpile entry point (build/next/index.ts) doesn't depend on gulp. So a dev who runs only:

npm run watch-client-transpile
./scripts/code.sh

(instead of the full npm run watch, which fans out to both) ends up with:

  • no font in src/
  • no font in out/ (because copyAllNonTsFiles globs src/**/*)
  • every workbench glyph rendering as a tofu box (□)

I hit this myself running the dev IDE this afternoon — the symptom is unambiguous and a fresh contributor would lose at least 20 minutes chasing it through Chromium's font-query logs before finding the gulp task.

Fix

One idempotent helper ensureCodiconFontStaged() called from the top of copyAllNonTsFiles():

  • destination exists → no-op (the common case after first build)
  • node_modules source missing → warn and continue (don't break the build over an icon)
  • otherwise → copy once, log it

Cost per build cycle: one fs.existsSync() call.

1 file changed, +21 / -0.

Test plan

  • Hygiene passes (was the second commit attempt; brace-style violation fixed)
  • rm -rf src/vs/base/browser/ui/codicons/codicon/codicon.ttf && npm run watch-client-transpile — confirm [codicons] Staged codicon.ttf into … appears on the next build cycle
  • ./scripts/code.sh after the above — confirm workbench icons render correctly
  • Re-run the watcher with the font already staged — confirm no log line and the build still succeeds (idempotent path)

🤖 Generated with Claude Code

…nder

codicon.ttf ships in node_modules/@vscode/codicons and is normally moved
into src/ by gulp's copy-codicons task before transpile runs. The
watch-client-transpile entry point (build/next/index.ts) doesn't depend
on gulp, so a dev who runs only `npm run watch-client-transpile`
(instead of the full `npm run watch`) ends up with no font in src/, no
font in out/, and every workbench glyph rendering as a tofu box.

Add a small idempotent ensureCodiconFontStaged() called from
copyAllNonTsFiles() — checks the destination, copies once if missing,
no-op afterwards. The cost is one stat per build cycle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Pterjudin Pterjudin merged commit 4036eb0 into main May 31, 2026
12 of 23 checks passed
@Pterjudin Pterjudin deleted the fix/transpile-stages-codicon-font-2026-05-31 branch May 31, 2026 13:30
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