As an introduction to VSC extensions development, please refer to vsc-extension-quickstart.md file.
You can explore the code starting from src/extension.ts
.
Available commands:
npm run compile # Builds extension code.
npm run watch # Watches and rebuilds sources on every change.
npm run test # Runs tests.
npm run test:cc # Runs tests with code coverage.
The easiest way to start development is to run Watch and Run Extension
task. This way you can iterate quickly.
To run tests:
npm run test # Runs tests.
npm run test:cc # Runs tests with code coverage.
If you are in a GUI-less environment (like CI runner or WSL), you can use:
DONT_PROMPT_WSL_INSTALL=1 xvfb-run -a npm run test
For manual testing you can test in development mode by running Watch and Run Extension
task. You can also pack and install the extension by running:
vsce package
And then using Install from VSIX option in VSC.
Most of the release process is done automatically through GitHub CI. However it requires few manual steps:
- Make sure you are on
main
branch and have latest changes and no local modifications:
git checkout main
git fetch --all
git reset --hard origin/main
-
Update
CHANGELOG.md
file with release info (if needed) and push tomain
branch. -
Run
npm version [patch|minor|major]
to bump package version and push (main
and tag) to remote:
npm version patch
git push origin main
git push origin vA.B.C
Pushing a tag to remote triggers release process (see release.yaml
workflow file), which publishes
to VSC marketplace and creates GitHub release.
You can verify the release by:
- Looking on the Marketplace page to see if latest release is there.
- Looking on GitHub release list to see if latest release is there.
If for any reason you need to release manually, see steps below.
Releasing requires @vscode/vsce
package installed.
IMPORTANT: To keep telemetry working, before running any vsce
command, please update SEGMENT_API_KEY
in src/config.ts
to correct value for a time of building the extension (DO NOT COMMIT THOUGH!).
After that, run:
vsce login kubeshop # You need PAT to login successfully.
And then either use publish
directly:
vsce publish [version] # patch, minor, major, A.B.C
Or package
+ publish
(this allows to test packaged extension before publishing)
vsce package [version] # patch, minor, major, A.B.C
vsce publish -i monokle-[version].vsix