Git Product home page Git Product logo

conventional-recommended-bump's Introduction

NPM version Build Status Dependency Status Coverage Status

Get a recommended version bump based on conventional commits

Got the idea from conventional-changelog/conventional-changelog#29

Install

$ npm install --save conventional-recommended-bump

Usage

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

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

API

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

options

ignoreReverted

Type: boolean Default: true

If true, reverted commits will be ignored.

preset

Type: string Possible values: 'angular'

It's recommended to use a preset so you don't have to define everything yourself. Presets are names of built-in config.

config

Type: object

This should serve as default values for other arguments of conventionalRecommendedBump so you don't need to rewrite the same or similar config across your projects. Any value in this could be overwritten.

NOTE: options.config will be overwritten by the values of preset. You should use either preset or config, but not both.

whatBump

Type: function

A function that takes parsed commits as argument.

This should return an object including but not limited to level and reason. level is a number indicating what bump it should be and reason is the reason of such release.

For backward compatibility, it could return 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 with level 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, object)
object

Object includes what's returned by whatBump and

####### releaseType

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

The value of what it should release as.

Related

License

MIT © Steve Mao

conventional-recommended-bump's People

Contributors

blowsie avatar dgreif avatar fusionstrings avatar stevemao avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.