This guide will help you set up your development environment for contributing to the Cloudinary VS Code Extension.
- Node.js 18.x or later
- npm 8.x or later
- Visual Studio Code 1.85.0 or later
- Git
- Cloudinary account with API credentials
# Clone the repository
git clone https://github.com/cloudinary/cloudinary-vscode.git
cd cloudinary-vscode
# Install dependencies
npm installCreate a Cloudinary configuration file:
macOS/Linux:
mkdir -p ~/.cloudinaryWindows:
mkdir $env:USERPROFILE\.cloudinaryCreate environments.json with your credentials:
{
"your-cloud-name": {
"apiKey": "your-api-key",
"apiSecret": "your-api-secret"
}
}| Command | Description |
|---|---|
npm run compile |
Type check + build |
npm run watch |
Watch mode (auto-rebuild) |
npm run check-types |
TypeScript type checking only |
npm run lint |
Run ESLint |
npm test |
Run tests |
- Open the project in VS Code
- Press
F5(or Run → Start Debugging) - A new VS Code window opens with your extension loaded
- Make changes, then press
Ctrl+R/Cmd+Rin the dev window to reload
- Set breakpoints in
.tsfiles (source maps are enabled) - Launch the Extension Development Host
- Trigger the code path you want to debug
- VS Code will pause at your breakpoints
npm testAfter making changes, verify:
- Extension activates without errors
- Tree view populates with folders/assets
- Commands work from command palette
- Context menus appear on correct items
- Webviews display correctly in light and dark themes
- Upload functionality works
- Error messages are user-friendly
To create a .vsix file for local installation:
npm run packageThis creates cloudinary-x.x.x.vsix in the project root.
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Click
...menu → Install from VSIX... - Select the
.vsixfile
- Use TypeScript strict mode
- Follow existing patterns in the codebase
- Use
handleCloudinaryError()for API errors - Use the webview design system for UI components
- Keep dependencies minimal
When debugging the extension:
| Command | Description |
|---|---|
Developer: Reload Window |
Reload after code changes |
Developer: Toggle Developer Tools |
Open browser dev tools for webviews |
Cloudinary: Show Welcome |
Test the welcome screen |
Cloudinary: Upload |
Test the upload panel |
- Check the Debug Console for errors
- Verify
mainin package.json points todist/extension.js - Run
npm run compileto check for TypeScript errors
- Check credentials in config file
- Verify network connectivity
- Check Debug Console for API errors
- Open Developer Tools (
Help → Toggle Developer Tools) - Check Console tab for JavaScript errors
- Verify Content Security Policy allows your resources