Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Deploy Staging ExtensionNew to Visual Studio Code? Get it now.
Deploy Staging Extension

Deploy Staging Extension

Fredrik Lysén

|
1 install
| (0) | Free
Toggle a status bar checkbox to automatically append custom messages (like [deploy staging]) to Git commit messages. Includes configurable message length validation to maintain commit message best practices.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Deploy Staging Extension

A Visual Studio Code extension that adds a configurable checkbox in the status bar to automatically append custom messages (like [deploy staging]) to Git commit messages. Includes configurable message length validation to maintain commit message best practices.

Features

  • Status Bar Checkbox: Clickable item in the bottom left that toggles between checked (✓) and unchecked (○) states
  • Automatic Message Appending: When checked, automatically appends a custom message to the first line of commit messages
  • Length Validation: Warns when commit message first line exceeds the configured maximum length
  • Smart Toggle Prevention: Prevents enabling the checkbox if it would exceed the maximum commit message length
  • Fully Configurable: Customize the message, checkbox name, and maximum line length via VS Code settings

Requirements

  • Visual Studio Code 1.70.0 or higher
  • Git extension enabled (built into VS Code)
  • Node.js 20.18.1 or higher (for building from source)

Installation

Install from VSIX

  1. Build the extension (or get the .vsix file from a colleague):

    cd vscode-deploy-staging-extension
    npm install
    npm run compile
    npx @vscode/vsce package
    

    This creates a file like deploy-staging-extension-1.0.1.vsix

  2. Install in VS Code:

    • Open VS Code
    • Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
    • Type "Extensions: Install from VSIX..."
    • Select the .vsix file
    • Reload VS Code when prompted

For Developers

  1. Clone the repository:

    git clone https://klarna.ghe.com/klarna/kafka_dis-tooling-misc-scripts.git
    cd kafka_dis-tooling-misc-scripts/vscode-deploy-staging-extension
    
  2. Install Node.js 20+ (if not already installed):

    nvm install 20
    nvm use 20
    

    Or with Homebrew:

    brew install node@20
    export PATH="/opt/homebrew/opt/node@20/bin:$PATH"
    
  3. Install dependencies:

    npm install
    
  4. Compile TypeScript:

    npm run compile
    
  5. Open in VS Code and test:

    code .
    

    Press F5 to launch the Extension Development Host

Usage

  1. Open a Git repository in VS Code
  2. Find the checkbox in the status bar (bottom left) - default name is "○ Deploy Staging"
  3. Click to toggle - changes to "✓ Deploy Staging" when enabled
  4. Write your commit message in Source Control (Cmd+Shift+G)
  5. Custom message is appended automatically to the first line when checkbox is enabled
  6. Length validation warns if the first line exceeds the configured maximum (default: 50 characters)
  7. Click again to disable and remove the custom message

Length Validation

  • Warning appears when typing if the first line exceeds the maximum length
  • Checkbox cannot be enabled if adding the custom message would exceed the limit
  • Helps maintain Git commit message best practices (50 character first line)

Configuration

Customize the extension in VS Code settings:

Settings

Setting Default Description
deployStagingExtension.customMessage [deploy staging] Message to append to commit messages
deployStagingExtension.checkboxName Deploy Staging Name displayed on the status bar checkbox
deployStagingExtension.maxCommitMessageLength 50 Maximum length for the first line of commit messages

How to Configure

Via Settings UI:

  1. Open Settings (Cmd+,)
  2. Search for "Deploy Staging Extension"
  3. Modify the desired settings

Via settings.json:

{
  "deployStagingExtension.customMessage": "[your custom message]",
  "deployStagingExtension.checkboxName": "Custom Name",
  "deployStagingExtension.maxCommitMessageLength": 72
}

Development

Building from Source

  1. Compile TypeScript:

    npm run compile
    
  2. Watch for changes (auto-recompile):

    npm run watch
    

Testing

  1. Make your code changes
  2. Ensure npm run watch is running (or run npm run compile)
  3. Press F5 in VS Code to launch Extension Development Host
  4. Test the extension in the new window
  5. Check the Debug Console for errors
  6. Reload the debug window to see new changes

Version Management

Update version in package.json using semantic versioning:

{
  "version": "1.0.1"
}

Semantic Versioning:

  • MAJOR (1.0.0 → 2.0.0): Breaking changes
  • MINOR (1.0.0 → 1.1.0): New features, backwards compatible
  • PATCH (1.0.0 → 1.0.1): Bug fixes, backwards compatible

Packaging for Distribution

Prerequisites:

  • Node.js 20.18.1 or higher
  • Install vsce globally: npm install -g @vscode/vsce

Create VSIX file:

# Update version in package.json first
npm run compile
vsce package

This creates a .vsix file named deploy-staging-extension-<version>.vsix

Quick version bump and package:

# Automatically increment version and package
vsce package --patch  # 1.0.0 → 1.0.1
vsce package --minor  # 1.0.0 → 1.1.0
vsce package --major  # 1.0.0 → 2.0.0

Note: The .vsix files are not committed to Git. Users must build the extension from source.

Publishing (Optional)

If you want to publish to the VS Code Marketplace:

  1. Create a publisher account at https://marketplace.visualstudio.com/manage

  2. Get a Personal Access Token from https://dev.azure.com

  3. Publish:

    vsce publish
    

Troubleshooting

Extension not activating

  • Ensure Git extension is enabled
  • Check Output panel (View → Output) and select "Log (Extension Host)"
  • Look for errors related to the extension

Warnings not appearing

  • Verify you have a Git repository open
  • Open Source Control view (Cmd+Shift+G) to initialize Git integration
  • Check the maximum length setting matches your expectations

Build errors

  • Ensure Node.js version is 20.18.1 or higher: node --version

  • Delete node_modules and out folders, then run:

    npm install
    npm run compile
    

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE.txt file for details.

Author

Fredrik Lysén
Email: fredrik.lysen@klarna.com

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft