apps/extension/docs/extension-development-guide.md
This VS Code extension uses a 3-file packaging system to avoid dependency conflicts during publishing:
apps/extension/
āāā package.json # Development configuration
āāā package.publish.json # Clean publishing configuration
āāā package.mjs # Build script for packaging
āāā .vscodeignore # Files to exclude from extension package
āāā vsix-build/ # Generated clean package directory
package.json (Development)devDependencies needed for buildingbuild, watch, lint, etc.)"taskr"package.publish.json (Publishing)keywords, repository, categories)"taskr-kanban"package.mjs (Build Script)build:js + build:css)vsix-build/ directorypackage.publish.json ā package.jsonvsce package# Install dependencies
npm install
# Start development with hot reload
npm run watch
# Run just JavaScript build
npm run build:js
# Run just CSS build
npm run build:css
# Full production build
npm run build
# Type checking
npm run typecheck
# Linting
npm run lint
F5 in VS Code to launch Extension Development HostDeveloper: Reload Window to reload after changesnpm run package
This creates vsix-build/ with clean distribution files.
cd vsix-build
npx vsce package --no-dependencies
Creates: taskr-kanban-1.0.1.vsix
npm run package && cd vsix-build && npx vsce package --no-dependencies
When updating extension metadata, ensure these fields match between package.json and package.publish.json:
{
"version": "1.0.1", // ā ļø MUST MATCH
"publisher": "Hamster", // ā ļø MUST MATCH
"displayName": "taskr: Task Master Kanban", // ā ļø MUST MATCH
"description": "A visual Kanban board...", // ā ļø MUST MATCH
}
{
"engines": { "vscode": "^1.101.0" }, // ā ļø MUST MATCH
"categories": [...], // ā ļø MUST MATCH
"activationEvents": [...], // ā ļø MUST MATCH
"main": "./dist/extension.js", // ā ļø MUST MATCH
"contributes": { ... } // ā ļø MUST MATCH EXACTLY
}
// package.json (dev)
{
"name": "taskr", // ā
Short dev name
"devDependencies": { ... }, // ā
Only in dev file
"scripts": { ... } // ā
Build scripts
}
// package.publish.json (publishing)
{
"name": "taskr-kanban", // ā
Marketplace name
"keywords": [...], // ā
Only in publish file
"repository": "https://github.com/...", // ā
Only in publish file
// NO devDependencies // ā
Clean for publishing
// NO build scripts // ā
Not needed in package
}
This extension uses Changesets for automated version management and publishing.
When making changes to the extension:
# From project root
npx changeset add
taskr-kanban when promptedpatch: Bug fixes, minor updatesminor: New features, backwards compatiblemajor: Breaking changesThe automation workflow runs on pushes to main:
Version Workflow (.github/workflows/version.yml):
Release Process (scripts/release.sh):
VSCE_PAT is set)OVSX_PAT is set)For automated publishing, these secrets must be set in the repository:
VSCE_PAT: Personal Access Token for VS Code MarketplaceOVSX_PAT: Personal Access Token for Open VSX RegistryGITHUB_TOKEN: Automatically provided by GitHub ActionsIf needed, you can manually trigger a release:
# From project root
./scripts/release.sh
The extension uses a separate tagging strategy from the main package:
[email protected][email protected]This allows independent versioning and prevents conflicts in the monorepo.
Problem: vsce package fails with missing dependencies
Solution: Use the 3-file system - never run vsce package from root
Problem: Extension not working after build Check:
vsix-build/dist/package.publish.json has correct main fieldProblem: Extension works locally but fails when packaged Check: Ensure critical fields are synced between package files
Problem: Version workflow not triggering Check:
.changeset/package.publish.jsonmain branchProblem: Publishing fails Check:
package.publish.json has correct repository URLnpx changeset addpackage.json and package.publish.jsonF5 in VS Codenpx changeset addvsce packageRemember: Always use npx changeset add for changes, then push to trigger automated releases! š