AutoVersion is a Visual Studio Code extension designed for managing semantic versioning in Node.js projects. It allows developers to easily increment the version number (major, minor, patch) in any file (such as package.json), and also integrates with Git to automatically update the commit message with the new version number.
Features
Automatic Version Incrementing:
Increment the version number (major, minor, patch) in a user-defined file (e.g., package.json).
Git Integration:
Automatically append the new version number to the commit message in Git.
Customizable File:
You can configure which file to edit for versioning (default is package.json).
Commands
AutoVersion - Change Version:
Increment the version of your project in the selected file.
Use Ctrl+Shift+V (Windows/Linux) or Cmd+Shift+V (macOS) to trigger this command.
Installation
Open Visual Studio Code.
Navigate to the Extensions panel.
Search for AutoVersion and install it.
Alternatively, you can install it directly from the marketplace using this link.
Configuration
By default, the extension will modify the package.json file. However, you can configure it to edit any file by setting the autoversion.fileToEdit property in the workspace or user settings:
{
"autoversion.fileToEdit": "myfile.json"
}
Settings
autoversion.fileToEdit: The file to edit for versioning (default is package.json).
Usage
Open a project folder in Visual Studio Code with a versioned file (e.g., package.json).
To update the version, press the assigned keyboard shortcut Ctrl+Shift+V (Windows/Linux) or Cmd+Shift+V (macOS).
The extension will prompt you to select the type of version increment (patch, minor, major).
The version number will be updated in the specified file, and the commit message will be updated with the new version.
Requirements
Visual Studio Code version: 1.96.0 or higher.
Node.js project with a file containing a version number (e.g., package.json).
Git: Required for updating the commit message with the new version number.
Development
To contribute to the development of AutoVersion, clone the repository and run the following commands:
# Install dependencies
npm install
# Run the extension in a development environment
npm run watch
License
This extension is licensed under the GPL-3.0-only license.