Socket
Book a DemoInstallSign in
Socket

@wroud/conventional-commits-bump

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wroud/conventional-commits-bump

A utility for determining version bump types (major, minor, patch) based on conventional commit messages, facilitating semantic versioning in your projects.

latest
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

@wroud/conventional-commits-bump

ESM-only package NPM version

@wroud/conventional-commits-bump is a utility designed to determine the appropriate version bump type based on conventional commits. This library helps automate the versioning process by analyzing commit messages and categorizing them as major, minor, or patch updates.

Features

  • Version Bumping Logic: Automatically determines the version bump type ("major", "minor", or "patch") based on commit types and breaking changes.
  • TypeScript Support: Written in TypeScript for enhanced type safety and modern JavaScript features.
  • Pure ESM package

Installation

Install via npm:

npm install @wroud/conventional-commits-bump @wroud/conventional-commits-parser

Usage

Use the getConventionalCommitsBump function to analyze an array of conventional commits and determine the appropriate version bump:

import type { IConventionalCommit } from "@wroud/conventional-commits-parser";
import { getConventionalCommitsBump } from "@wroud/conventional-commits-bump";

const commits: IConventionalCommit[] = [
  { type: "feat", breakingChanges: [] },
  { type: "fix", breakingChanges: [] },
];

const bump = getConventionalCommitsBump(commits);
console.log(bump); // Output: "minor"

How does this relate to SemVer?

  • fix type commits should be translated to PATCH releases.
  • feat type commits should be translated to MINOR releases.
  • Commits with BREAKING CHANGE in the commit messages, regardless of type, should be translated to MAJOR releases.

In this example, if any commit includes breaking changes, the bump will be "major". If there are no breaking changes but a commit of type "feat" is present, it will result in a "minor" bump; otherwise, it will return "patch" if there are any "fix" commits.

Changelog

All notable changes to this project will be documented in the CHANGELOG file.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

semantic-versioning

FAQs

Package last updated on 22 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts