Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lambdacasserole/incv

Simple version bumping tool for Node.js, with customizable tags.
https://github.com/lambdacasserole/incv

cicd javascript npm semver utils versioning

Last synced: 6 days ago
JSON representation

Simple version bumping tool for Node.js, with customizable tags.

Awesome Lists containing this project

README

        

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]





Logo

incv


Simple version bumping tool for Node.js, with customizable tags.


Report Bug
·
Request Feature


Table of Contents



  1. About The Project



  2. Getting Started



  3. Usage


  4. Roadmap

  5. Contributing

  6. License

  7. Contact

  8. Acknowledgments

## About The Project

![incv usage][product-screenshot]

Sometimes you need to bump the version in your package.json file automatically. For example, you might:

* Have a CI/CD pipeline, and want to automatically bump the patch version of your library on merge to your `develop` branch
* Have a workflow (e.g. on Bitbucket Pipelines, GitHub actions etc.) that allows developers to automatically perform version bumps by including tags in their commit message (e.g. `[major]`, `[minor]`)
* Just want to reduce the chances of human error when bumping version numbers manually

incv is a command-line utility for doing all of the above.

This is a rough port of my version bumper library for Python, [dodgem](https://github.com/lambdacasserole/dodgem). That name was taken on the npm package registry aready so I went with incv for _increment version_. My imagination was apparently off its game when I created this repo.

(back to top)

### Built With

This project uses:

* [meow](https://github.com/sindresorhus/meow) for its CLI
* [chalk](https://github.com/chalk/chalk) for colorized CLI output

(back to top)

## Getting Started

Getting started is straightforward.

### Prerequisites

You'll need Node.js 14 or newer with npm to install incv.

### Installation

Install incv using npm and you're done.

```bash
npm install incv --save-dev
```

Test your installation with:

```bash
incv --help
```

You should see help documentation printed.

(back to top)

## Usage

You can use `incv --help` for detailed information on using the utility:

```
Simple version bumping tool for Node.js, with customizable tags.

Usage
$ incv [options]

Options
--commit-message, -c The commit message to use to bump the version (default: '')
--major-tag The major version bump tag to search for in commit messages (default: '[major]')
--minor-tag The minor version bump tag to search for in commit messages (default: '[minor]')
--patch-tag The patch version bump tag to search for in commit messages (default: '[patch]')
--prerelease-tag The prerelease version bump tag to search for in commit messages (default: '[prerelease]')
--build-tag The build version bump tag to search for in commit messages (default: '[build]')
--prerelease-token The prerelease token to prepend to the prerelease version (default: 'prerelease')
--build-token The build token to prepend to the build version (default: '')
--major Specifies that a major version bump should be performed (default: false)
--minor Specifies that a minor version bump should be performed (default: false)
--patch Specifies that a patch version bump should be performed (default: true)
--prerelease Specifies that a prerelease version bump should be performed (default: false)
--build Specifies that a build version bump should be performed (default: false)
--dry Specifies that the bumped version should not be written to disk (default: false)
--quiet Suppresses informational output (default: false)
Boolean options can be inverted by prefixing '--no-' (e.g. '--no-patch').

Examples
$ incv --major # Major version bump.
$ incv --commit-message='[major] First major release!' # Major version bump via commit message.
```

### Example: Bump Minor Version

Bump the minor version of your project like this:

```bash
incv --minor
```

If you don't want to commit the change to disk, use `--dry` like so:

```bash
incv --minor --dry
```

If the informational output given by the CLI is getting in the way of downstream processing, use `--quiet`:

```bash
incv --minor --quiet
```

### Example: From Commit Message

Dodgem can bump your project version based on a commit message. By default.

* If the message contains `[major]` then a major version bump will be performed
* If the message contains `[minor]` then a minor version bump will be performed
* Otherwise, a patch version bump will be performed

For example, to use your last `git` commit message to bump your projects version.

```bash
incv --commit-message="$(git log -1)"
```

### Example: Custom Tags

If the default `[major]` and `[minor]` tags don't suit you, and you'd perfer `(major)`, `(minor)` and an _explicit_ `(patch)` tag:

```bash
incv --commit-message="$(git log -1)" --major-tag='(major)' --minor-tag='(minor)' --patch-tag='(patch)' --no-auto-patch
```

(back to top)

## Roadmap

See the [open issues](https://github.com/lambdacasserole/incv/issues) for a full list of proposed features (and known issues).

(back to top)

## Contributing

Any contributions are very welcome. Please fork the project and open a PR, or open an issue if you've found a bug and/or would like to suggest a feature.

(back to top)

## License

Distributed under the MIT License. See `LICENSE.txt` for more information.

(back to top)

## Contact

Saul Johnson - [@lambdacasserole](https://twitter.com/lambdacasserole) - [email protected]

Project Link: [https://github.com/lambdacasserole/incv](https://github.com/lambdacasserole/incv)

(back to top)

## Acknowledgments

The following resources are awesome:

* [Best-README-Template](https://github.com/othneildrew/Best-README-Template) was used for this readme
* [semver](https://www.npmjs.com/package/semver) was used for parsing and bumping semver numbers

(back to top)

[contributors-shield]: https://img.shields.io/github/contributors/lambdacasserole/incv.svg?style=for-the-badge
[contributors-url]: https://github.com/lambdacasserole/incv/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/lambdacasserole/incv.svg?style=for-the-badge
[forks-url]: https://github.com/lambdacasserole/incv/network/members
[stars-shield]: https://img.shields.io/github/stars/lambdacasserole/incv.svg?style=for-the-badge
[stars-url]: https://github.com/lambdacasserole/incv/stargazers
[issues-shield]: https://img.shields.io/github/issues/lambdacasserole/incv.svg?style=for-the-badge
[issues-url]: https://github.com/lambdacasserole/incv/issues
[license-shield]: https://img.shields.io/github/license/lambdacasserole/incv.svg?style=for-the-badge
[license-url]: https://github.com/lambdacasserole/incv/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/sauljohnson
[product-screenshot]: https://raw.githubusercontent.com/lambdacasserole/incv/main/usage.svg