Merged
Conversation
- Make sure we still always type check using `tsgo --noEmit` - Align names of esbuild files - Convert all esbuild files to typescript. We use the `.mts` extension to avoid annoying node warnings about using pacakges
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors extension esbuild entrypoints and shared esbuild helpers, aiming to standardize filenames, move scripts to TypeScript (.mts), and ensure extension builds are still type-checked via tsgo --noEmit.
Changes:
- Rename/realign per-extension esbuild scripts (e.g.
esbuild.webview.mts,esbuild.notebook.mts) and update package.json scripts accordingly. - Introduce shared
.mtsesbuild helpers (extensions/esbuild-*-common.mts) and update extensions to import them. - Update the build pipeline to run a separate
tsgo --noEmittypecheck step for esbuild-bundled extensions.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/simple-browser/package.json | Updates build script to point at new esbuild entrypoint name. |
| extensions/simple-browser/esbuild.webview.mts | Switches shared helper import to .mts. |
| extensions/notebook-renderers/package.json | Updates notebook build script name. |
| extensions/notebook-renderers/esbuild.notebook.mts | Switches shared helper import to .mts. |
| extensions/mermaid-chat-features/package.json | Updates webview build script name. |
| extensions/mermaid-chat-features/esbuild.webview.mts | Switches shared helper import to .mts. |
| extensions/mermaid-chat-features/esbuild.mts | Switches shared helper import to .mts. |
| extensions/mermaid-chat-features/esbuild.browser.mts | Switches shared helper import to .mts. |
| extensions/media-preview/esbuild.mts | Switches shared helper import to .mts. |
| extensions/media-preview/esbuild.browser.mts | Switches shared helper import to .mts. |
| extensions/markdown-math/tsconfig.browser.json | Adds a browser tsconfig for web typechecking. |
| extensions/markdown-math/package.json | Updates build script to .mts. |
| extensions/markdown-math/esbuild.notebook.mts | Switches shared helper import to .mts and adds a typed callback param. |
| extensions/markdown-math/esbuild.mts | Switches shared helper import to .mts. |
| extensions/markdown-math/esbuild.browser.mts | Switches shared helper import to .mts. |
| extensions/markdown-language-features/tsconfig.browser.json | Narrows browser project inputs for web typechecking. |
| extensions/markdown-language-features/package.json | Reworks build/watch scripts and adds explicit web bundle + typecheck commands. |
| extensions/markdown-language-features/esbuild.webview.mts | Switches shared helper import to .mts. |
| extensions/markdown-language-features/esbuild.notebook.mts | Switches shared helper import to .mts. |
| extensions/markdown-language-features/esbuild.mts | Switches shared helper import to .mts. |
| extensions/markdown-language-features/esbuild.browser.mts | Switches shared helper import to .mts. |
| extensions/ipynb/package.json | Updates notebook build script name. |
| extensions/ipynb/esbuild.notebook.mts | Switches shared helper import to .mts. |
| extensions/esbuild-webview-common.mts | Converts webview helper to TS types and exports typed helpers. |
| extensions/esbuild-extension-common.mts | Adds new shared helper for extension bundling with esbuild. |
| build/lib/tsgo.ts | Adds noEmit option so build pipeline can typecheck without emitting. |
| build/lib/extensions.ts | Switches esbuild config filenames to .mts, adds typecheck stream for esbuild builds, and updates media script list. |
Comments suppressed due to low confidence (2)
extensions/esbuild-webview-common.mts:8
- The comment says “used in in webviews” (duplicate “in”). Please fix the wording (e.g. “used in webviews”).
build/lib/extensions.ts:282 fromLocalEsbuildexecutes the extension’sesbuild.*.mtsscript viacp.execFile(process.argv[0], [esbuildScript])(plainnode). Since those scripts now import.mtshelpers that include TypeScript-only syntax, this invocation will fail unless Node is started with--experimental-strip-types(or another TS loader). Consider adding the flag when invoking.ts/.mtsbuild scripts here.
const esbuildScript = path.join(extensionPath, esbuildConfigFileName);
// Run esbuild, then collect the files
new Promise<void>((resolve, reject) => {
const proc = cp.execFile(process.argv[0], [esbuildScript], {}, (error, _stdout, stderr) => {
if (error) {
return reject(error);
}
const matches = (stderr || '').match(/\> (.+): error: (.+)?/g);
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), esbuildConfigFileName))} with ${matches ? matches.length : 0} errors.`);
bryanchen-d
approved these changes
Feb 12, 2026
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.
tsgo --noEmit.mtsextension to avoid annoying node warnings about using pacakges