@bastian-paredes/version-manager
v1.4.1
Published
Command-line tool to easily bump versions, handle pre-releases, and create Git tags for both monorepos and standalone packages.
Downloads
241
Readme
@bastian-paredes/version-manager
A CLI tool to automatically manage semantic versioning for Node.js packages.
Designed for Falabella projects, it works with both single packages and monorepos.
Installation
You can run it directly using npm exec or npx:
npm exec @bastian-paredes/version-manager@latest <command>
# or
npx @bastian-paredes/version-manager <command>Commands
bump-version
Automatically determines the next version and updates the package, commit, and tag accordingly.
Usage
npm exec @bastian-paredes/version-manager@latest bump-version [options]Options
--dry-runRuns the versioning process without making any changes.--commit-msg-template="<template>"Customize the commit message and tag name. Supports placeholders:{package_name}– The name of the package{package_version}– The new version
--commit-msg-template="{package_name}@{package_version}"--preid=<identifier>Specify a pre-release identifier (likealpha,beta,rc). If not provided, the script will automatically choose one when needed.
Behavior
- Detects if the current directory is a monorepo or a single package.
- Checks the current branch, remote tags, and published versions on NPM.
- Determines the next semantic version and tag based on all the information.
- Stops execution if there are uncommitted changes in the repository.
Examples
Bump a package version with default behavior:
npm exec @bastian-paredes/version-manager@latest bump-versionRun a dry run to see the changes without applying them:
npm exec @bastian-paredes/version-manager@latest bump-version --dry-runBump a package version with a custom commit message:
npm exec @bastian-paredes/version-manager@latest bump-version --commit-msg-template="{package_name}@{package_version}"Bump a pre-release version with a specific identifier:
npm exec @bastian-paredes/version-manager@latest bump-version --preid=beta