{%= name %} [![npm version][npmv-img]][npmv-url] ![License][license-img]
{%= description %}
Please consider following this project's author, Charlike Mike Reagent, and ⭐ the project to show your ❤️ and support.
If you have any how-to kind of questions, please read the Contributing Guide and Code of Conduct documents.
For bugs reports and feature requests, please create an issue or ping
@tunnckoCore at Twitter.
[![NPM Downloads Weekly][downloads-weekly-img]][npmv-url] [![NPM Downloads Monthly][downloads-monthly-img]][npmv-url] [![NPM Downloads Total][downloads-total-img]][npmv-url]
Project is semantically & automatically released on CircleCI with [new-release][] and its New Release GitHub App.
This project requires Node.js {%= engines.node %}. Install it using
yarn or npm.
We highly recommend to use Yarn when you think to contribute to this project.
$ yarn add {%= name %}
Generated using docks.
Calculates recommended bump (next version), based on given commits
.
It always returns an object. If no commits are given it is { increment: false }
.
Otherwise it may contain patch
, minor
, or major
properties which are
of Array<Commit>
type, based on [parse-commit-message][].
ProTip: Use result[result.increment]
to get most meanigful result.
Each item passed as commits
is validated against the Convetional Comits Specification
and using [parse-commit-message][]. Commits can be string, array of commit message strings,
array of objects (of type Commit as defined) or mix of previous
posibilities.
See the tests and examples for more clarity.
Params
commits
{string||} commit messages one ofstring
,Array<string>
orArray<Commit>
[options]
{object} pass additionaloptions.plugins
to be passed to [parse-commit-message][]
Returns
object
result like{ increment: boolean | string, patch?, minor?, major? }
Examples
import recommendedBump from 'recommended-bump';
const commits = [
'chore: foo bar baz',
`fix(cli): some bugfix msg here
Some awesome body.
Great footer and GPG sign off, yeah!
Signed-off-by: Awesome footer <foobar@gmail.com>`
];
const { increment, isBreaking, patch } = recommendedBump(commits);
console.log(isBreaking); // => false
console.log(increment); // => 'patch'
console.log(patch);
// => [{ header: { type, scope, subject }, body, footer }, { ... }]
console.log(patch[0].header.type); // => 'fix'
console.log(patch[0].header.scope); // => 'cli'
console.log(patch[0].header.subject); // => 'some bugfix msg here'
console.log(patch[0].body); // => 'Some awesome body.'
console.log(patch[0].footer);
// => 'Great footer and GPG sign off, yeah!\nSigned-off-by: Awesome footer <foobar@gmail.com>'
import { parse } from 'parse-commit-message';
import recommendedBump from 'recommended-bump';
const commitOne = parse('fix: foo bar');
const commitTwo = parse('feat: some feature subject');
const result = recommendedBump([commitOne, commitTwo]);
console.log(result.increment); // => 'minor'
console.log(result.isBreaking); // => false
console.log(result.minor); // => [{ ... }]
{% if (verb.related && verb.related.list && verb.related.list.length) { %}
Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!
{%= related(verb.related.list, { words: 11 }) %}
back to top {% } %}
Please read the Contributing Guide and Code of Conduct documents for advices.
For bugs reports and feature requests, please create an issue or ping
@tunnckoCore at Twitter.
Become a Partner or Sponsor? 💵 Check the Partner, Sponsor or Omega-level tiers! 🎉 You can get your company logo, link & name on this file. It's also rendered on package page in [npmjs.com][npmv-url] and [yarnpkg.com](https://yarnpkg.com/en/package/{%= name %}) sites too! 🚀
Not financial support? Okey! Pull requests, stars and all kind of contributions are always welcome. ✨
This project is following OPEN Open Source model
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is built on collective efforts and it's not strongly guarded by its founders.
There are a few basic ground-rules for its contributors
- Any significant modifications must be subject to a pull request to get feedback from other contributors.
- Pull requests to get feedback are encouraged for any other trivial contributions, but are not required.
- Contributors should attempt to adhere to the prevailing code-style and development workflow.
Thanks to the hard work of these wonderful people this project is alive! It follows the
all-contributors specification.
Don't hesitate to add yourself to that list if you have made any contribution! ;) See how,
here.
Charlike Mike Reagent 💻 📖 💬 👀 🔍 |
---|
Consider showing your support to them. 💖
Copyright (c) 2018-present, Charlike Mike Reagent <mameto2011@gmail.com>
& contributors.
Released under the Apache-2.0 License.
[npmv-url]: https://www.npmjs.com/package/{%= name %} [npmv-img]: https://badgen.net/npm/v/{%= name %}?icon=npm
[license-img]: https://badgen.net/npm/license/{%= name %}
[downloads-weekly-img]: https://badgen.net/npm/dw/{%= name %} [downloads-monthly-img]: https://badgen.net/npm/dm/{%= name %} [downloads-total-img]: https://badgen.net/npm/dt/{%= name %}