Thank you for your interest in contributing to the DocumentDB for VS Code extension. This guide helps you set up your development environment and configure Visual Studio Code to effectively contribute to the extension.
The document consists of four sections:
The repository follows a structured branching strategy to ensure smooth development and release processes:
main— Production-ready code. All releases are tagged here.next— Staging for the upcoming release. Completed features are merged here.dev/<user>/<feature>— Individual feature branches for personal development.feature/<big-feature>— Shared branches for large features requiring collaboration.
GitHub Actions are configured to perform automated checks on the repository. The intensity of these checks depends on the target branch:
-
Push to
next,dev/*, orfeature/*branches:- Runs basic code quality checks and tests.
- Skips resource-intensive jobs like integration tests and packaging to focus on code validation.
-
Pull Requests to
mainornext:- Executes all jobs, including code checks, tests, and packaging.
- Ensures complete validation before merging, including artifact generation.
-
Push to
main:- Runs the full workflow for release validation and artifact generation.
This setup ensures that contributions are thoroughly validated while optimizing resource usage during development.
Platform coverage: The detailed setup instructions below are written for Windows + WSL2. Stub sections for macOS, Windows (native), and plain Linux are included but not yet filled in; Contributors on those platforms are warmly invited to submit a PR expanding those sections!
Follow these instructions to configure your machine for JavaScript/TypeScript development using Windows Subsystem for Linux (WSL2) and Visual Studio Code.
- Install Ubuntu 22.* from the Microsoft Store and launch it to configure your Linux user account.
- Your development environment and tools will reside within
WSL2. - VS Code integrates seamlessly with
WSL2instances, enabling smooth development from your Windows machine.
- Your development environment and tools will reside within
Open your Ubuntu terminal and run:
sudo apt update
sudo apt upgradeFNM helps with installing and switching Node.js versions easily. This is useful for testing compatibility across different Node.js versions.
The minimum required versions are Node.js 22.18.0 and npm 10.0.0 (see engines in package.json).
Run the following commands:
curl -fsSL https://fnm.vercel.app/install | bash
source ~/.bashrc
fnm install 22.18.0
fnm use 22.18.0
fnm default 22.18.0
node --version # should print v22.18.0 or later
npm --version # should print 10.x or laternpm install -g typescriptHelp wanted! If you develop on macOS, please consider contributing setup instructions for this section. The general flow (install Node.js via a version manager such as
nvmorfnm, clone the repo,npm install && npm run build) should be very similar to the WSL2 path above.
Help wanted! If you develop on Windows without WSL2, please consider contributing setup instructions for this section.
Help wanted! If you develop on Linux natively, please consider contributing setup instructions for this section. The WSL2 Ubuntu steps above should translate almost verbatim.
This section explains how to clone the DocumentDB for VS Code repository and set up Visual Studio Code for development and debugging.
-
Ensure you have completed the Machine Setup steps.
-
Fork or directly clone the official repository:
-
Open your WSL2 terminal and clone the repository:
cd ~
git clone https://github.com/microsoft/vscode-documentdb- Install dependencies and build the project:
cd ~/vscode-documentdb
npm install
npm run buildTo effectively isolate development environments, it is beneficial to create and use a separate VS Code profile.
- Open the cloned repository in VS Code:
cd ~/vscode-documentdb
code .- Start debugging the extension:
- Switch to the
Run and Debugpanel. - Select
Launch Extension (webpack). - Press
F5.
- Switch to the
Before opening or marking a pull request as ready for review, all of the following steps must pass locally. The same checks run in CI, so catching failures locally saves time.
If you added, changed, or removed any user-facing string (anything passed to vscode.l10n.t()), regenerate the localization bundle:
npm run l10nCommit any changes to the l10n/ folder together with your code changes.
Run Prettier to ensure all files meet the project's formatting standards:
npm run prettier-fixCommit any files that Prettier reformats.
Run ESLint and fix all reported issues before submitting:
npm run lintVerify the extension can be packaged successfully without errors:
npm run packageThis step catches webpack bundling issues and missing assets that unit tests alone won't surface.
Summary — run these four commands before every PR:
npm run l10n npm run prettier-fix npm run lint npm run package
You've now successfully set up your development environment and are ready to contribute to DocumentDB for VS Code. We appreciate your contributions!