conventional-recommended-bump
Version:
Get a recommended version bump based on conventional commits.
108 lines (71 loc) • 3.33 kB
Markdown
[![ESM-only package][package]][package-url]
[![NPM version][npm]][npm-url]
[![Node version][node]][node-url]
[![Dependencies status][deps]][deps-url]
[![Install size][size]][size-url]
[![Build status][build]][build-url]
[![Coverage status][coverage]][coverage-url]
[]: https://img.shields.io/badge/package-ESM--only-ffe536.svg
[]: https://nodejs.org/api/esm.html
[]: https://img.shields.io/npm/v/conventional-recommended-bump.svg
[]: https://npmjs.com/package/conventional-recommended-bump
[]: https://img.shields.io/node/v/conventional-recommended-bump.svg
[]: https://nodejs.org
[]: https://img.shields.io/librariesio/release/npm/conventional-recommended-bump
[]: https://libraries.io/npm/conventional-recommended-bump/tree
[]: https://packagephobia.com/badge?p=conventional-recommended-bump
[]: https://packagephobia.com/result?p=conventional-recommended-bump
[]: https://img.shields.io/github/actions/workflow/status/conventional-changelog/conventional-changelog/tests.yaml?branch=master
[]: https://github.com/conventional-changelog/conventional-changelog/actions
[]: https://coveralls.io/repos/github/conventional-changelog/conventional-changelog/badge.svg?branch=master
[]: https://coveralls.io/github/conventional-changelog/conventional-changelog?branch=master
Get a recommended version bump based on conventional commits.
> Got the idea from https://github.com/conventional-changelog/conventional-changelog/pull/29
<hr />
<a href="#install">Install</a>
<span> • </span>
<a href="#usage">Usage</a>
<span> • </span>
<a href="#api">API</a>
<span> • </span>
<a href="#cli">CLI</a>
<br />
<hr />
```bash
pnpm add conventional-recommended-bump
yarn add conventional-recommended-bump
npm i conventional-recommended-bump
```
```js
import { Bumper } from 'conventional-recommended-bump'
const bumper = new Bumper().loadPreset('angular')
const recommendation = await bumper.bump()
console.log(recommendation.releaseType) // 'major'
```
Create a new Bumper instance. `cwdOrGitClient` is the current working directory or a `ConventionalGitClient` instance.
Set params to get the last semver tag or set the tag directly.
Set params to get the commits.
Set the commits directly.
Load and set necessary params from a preset.
Set the config directly.
Get a recommended version bump based on conventional commits. `whatBump` function is required if preset is not loaded.
```sh
conventional-recommended-bump --help
```
MIT © [Steve Mao](https://github.com/stevemao)