Socket
Socket
Sign inDemoInstall

conventional-recommended-bump

Package Overview
Dependencies
106
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    conventional-recommended-bump

Get a recommended version bump based on conventional commits


Version published
Weekly downloads
2M
decreased by-5%
Maintainers
1
Install size
2.46 MB
Created
Weekly downloads
 

Package description

What is conventional-recommended-bump?

The conventional-recommended-bump npm package is a tool that analyzes conventional-style commit messages (like those used by AngularJS) to determine the type of version bump (major, minor, or patch) that should be recommended based on the changes made. It is often used in automated versioning and release workflows to ensure semantic versioning practices are followed.

What are conventional-recommended-bump's main functionalities?

Determining the type of version bump

This feature allows you to determine whether your next release should be a major, minor, or patch version. The code sample shows how to use the package with the Angular preset to get a recommendation.

const conventionalRecommendedBump = require('conventional-recommended-bump');

conventionalRecommendedBump({
  preset: 'angular'
}, (error, recommendation) => {
  console.log(recommendation.releaseType);
});

Customizable preset options

This feature allows you to customize the preset options for analyzing commit messages. The code sample demonstrates how to specify a custom header pattern and correspondence for the Angular preset.

const conventionalRecommendedBump = require('conventional-recommended-bump');

conventionalRecommendedBump({
  preset: 'angular',
  config: {
    headerPattern: /^\[(.*)\] (.*)$/,
    headerCorrespondence: ['type', 'subject']
  }
}, (error, recommendation) => {
  console.log(recommendation.releaseType);
});

Using a custom parser

This feature allows you to use a custom parser for commit messages. The code sample shows how to pass custom parser options to the package.

const conventionalRecommendedBump = require('conventional-recommended-bump');
const customParserOpts = require('./custom-parser-opts');

conventionalRecommendedBump({
  parserOpts: customParserOpts
}, (error, recommendation) => {
  console.log(recommendation.releaseType);
});

Other packages similar to conventional-recommended-bump

Readme

Source

NPM version Build Status Dependency Status Coverage Status

Get a recommended version bump based on conventional commits

Got the idea from https://github.com/ajoslin/conventional-changelog/pull/29

Install

$ npm install --save conventional-recommended-bump

Usage

var conventionalRecommendedBump = require('conventional-recommended-bump');

conventionalRecommendedBump({
  conventionalRecommendedBump({
    preset: 'angular'
  }, function(err, releaseAs) {
    console.log(releaseAs);
    //=> 'major'
  });
});
$ npm install --global conventional-recommended-bump
$ conventional-recommended-bump --help

  Get a recommended version bump based on conventional commits

  Usage
    conventional-recommended-bump

  Example
    conventional-recommended-bump

  Options
    -p, --preset                   Name of the preset you want to use
    -h, --header-pattern           Regex to match header pattern
    -c, --header-correspondence    Comma separated parts used to define what capturing group of headerPattern captures what
    -r, --reference-actions        Comma separated keywords that used to reference issues
    -i, --issue-prefixes           Comma separated prefixes of an issue
    -n, --note-keywords            Comma separated keywords for important notes
    -f, --field-pattern            Regex to match other fields
    -v, --verbose                  Verbose output

API

conventionalRecommendedBump(options, [parserOpts], [callback])

options
ignoreReverted

Type: boolean Default: true

If true, reverted commits will be ignored.

preset

Type: string Possible values: 'angular'

A set of options of a popular project.

whatBump

Type: function

A function that takes parsed commits as argument and returns a number indicating what bump it should be.

whatBump(commits)

####### commits

Type: array

An array of parsed commits. The commits are from last semver tag to HEAD and is parsed by conventional-commits-parser.

If it returns 0 it will be a major bump. If 1, minor bump. If 2, patch.

parserOpts

See the conventional-commits-parser docs.

callback

Type: function

callback(error, releaseAs)
releaseAs

Type: string Possible values: 'major', 'minor' and 'patch'

The value of what it should release as. If it cannot decide this is an empty string.

License

MIT © Steve Mao

Keywords

FAQs

Last updated on 12 Aug 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc