Scaffold the VS Code extension #1
Labels
No labels
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
justine/accompany#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Scaffold
accompanyas a TypeScript VS Code extension that builds, launches in an Extension Development Host, runs tests, and packages to a.vsix.Decision needed
How to create the files:
yo codenpx --package yo --package generator-code -- yo code, pick New Extension (TypeScript), esbuild, npm. Fast; generator output is then trimmed to match our conventions.What
yoisyois the command-line tool of Yeoman, a general project scaffolder. On its own it creates nothing: it runs "generators", npm packages that each know how to create one kind of project. It asks a few questions, then writes the files.The generator for VS Code extensions is
generator-code, maintained by Microsoft.yo coderuns it. It createspackage.json(the extension manifest),src/extension.tswith a sample command,tsconfig.json, the bundler config, a test setup, and.vscode/launch.jsonandtasks.jsonfor F5 debugging.The
npx --package yo --package generator-code -- yo codeform runs both packages once without installing them globally. After scaffolding, neither stays in the project: they are not dependencies of the extension.Setup, per the official docs
src/extension.tsdist/extension.js,format: 'cjs',platform: 'node',external: ['vscode']; minify and drop sourcemaps only with--productiontsc --noEmitruns beside it (check-types,watch:tsc)compile,check-types,watch(esbuild and tsc in parallel),package,vscode:prepublish->npm run packagecommands,views,languages,customEditors, andauthenticationcontributions infer their activation events; setengines.vscodeto^1.74.0or newer@vscode/test-cliand@vscode/test-electron,.vscode-test.mjsconfig,"test": "vscode-test"; Mocha runs inside a real VS Code;--coveragesupported@vscode/vsce:vsce packagebuilds the.vsix;.vscodeignorekeeps sources out of itDone when
npm run compiletype-checks and bundles with no errorsnpm testruns at least one test throughvscode-testand passesnpx vsce packageproduces a.vsixthat containsdist/and nosrc/Reference docs indexed in mcp-docs
Already indexed:
vscode extension api,esbuild,google-typescript-style,oxlint,vitest.Queued on 2026-10-19:
mocha,typescript,@vscode/test-cli,@vscode/test-electron,@vscode/vsce,generator-code.