# cutoff

> An opinionated command line utility for cutting releases and publishing to npm.

Latest version **0.2.8** (published 2020-03-03) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install cutoff
pnpm add cutoff
yarn add cutoff
bun add cutoff
```

Provides the commands `cutoff`, `cutoff-lerna`, `publish-cutoff`, `publish-lerna-cutoff`, `publish-lerna-cutoff-pkg`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.8 |
| Published | 2020-03-03 |
| First published | 2018-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | < 10.16.0 |
| Dependencies | 4 |
| Unpacked size | 93.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dylan Aubrey |
| Maintainers | dylanaubrey |
| Keywords | command line, cli, lerna, npm, releases |

## Links

- npm: https://www.npmjs.com/package/cutoff
- Repository: https://github.com/badbatch/cutoff
- Issues: https://github.com/badbatch/cutoff/issues
- npm.io page: https://npm.io/package/cutoff

## Dependencies (4)

- [yargs](https://npm.io/package/yargs.md) ^15.1.0
- [semver](https://npm.io/package/semver.md) ^7.1.3
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.1
- [generate-changelog](https://npm.io/package/generate-changelog.md) ^1.7.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.2.8 (latest) — 2020-03-03
- 0.1.0-beta.0 (beta) — 2018-12-18
- 0.2.7 — 2019-07-02
- 0.2.6 — 2019-07-02
- 0.2.5 — 2019-07-01
- 0.2.4 — 2019-06-28
- 0.2.3 — 2019-06-24
- 0.2.2 — 2019-06-21
- 0.2.1 — 2019-04-16
- 0.2.0 — 2019-03-19
- 0.1.2 — 2019-01-18
- 0.1.1 — 2019-01-14
- 0.1.0 — 2018-12-18
- 0.0.15 — 2018-07-02
- 0.0.14 — 2018-06-29
- … 13 more at https://npm.io/package/cutoff/versions

## README

# Cutoff

An opinionated command line utility for cutting releases and publishing to npm.

[![Build Status](https://travis-ci.org/badbatch/cutoff.svg?branch=master)](https://travis-ci.org/badbatch/cutoff)
[![codecov](https://codecov.io/gh/badbatch/cutoff/branch/master/graph/badge.svg)](https://codecov.io/gh/badbatch/cutoff)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![npm version](https://badge.fury.io/js/cutoff.svg)](https://badge.fury.io/js/cutoff)

## Summary

* Works exclusively with Yarn... sorry npm, it is just better.
* Cuts major, minor or patch releases from master branch.
* Generates changelog based on angular-style commits since last git tag.
* Updates package version and git tag automatically based on release type.
* Exposes pre- and post-versioning npm script hooks to run custom tasks.
* Commits changelog, version and custom task changes to master prior to cutting tag.
* Provides separate cli command to publish new version to npm.
* Offers all of the above for fixed-mode Lerna-based monorepos.
* Allows force updates of all monorepo packages to next version.

## Installation

```bash
yarn add cutoff --dev
```

## Commands

### cutoff

The script cuts a major, minor or patch release, generates/updates the changelog, runs the pre-versioning
npm script hook, updates the project version, runs the post-versioning npm script hook, commits the changes to master
with the message `"Release version <version>."`, and then commits a new tag with the same message.

Include the `--dryrun` flag to stop the script after the versioning is completed, so no changes are
committed to master. Include the `--skip-checkout` flag to commit the changes to current branch.

If a `preid` is provided it is appended to the release tag.

```json
"scripts": {
  "cutoff": "cutoff"
}
```

```bash
yarn run cutoff
  [--type <major | premajor | minor | preminor | patch | prepatch | prerelease>]
  [--tag <alpha | beta | unstable> [--preid <string>]]
  [--skip-checkout]
  [--skip-prehook]
  [--skip-posthook]
  [--dryrun]
```

### cutoff-lerna

The script cuts a major, minor or patch release, generates/updates the changelog, runs the pre-versioning npm script
hook, updates the project, lerna config and package versions, writes the list of updated packages to
`.lerna.updated.json`, runs the post-versioning npm script hook, commits the changes to master with the message
`"Release version <version>."`, and then commits a new tag with the same message.

Include the `--dryrun` flag to stop the script after the versioning is completed, so no changes are
committed to master. Include the `--force` flag to force update all packages to the new version. Include the
`--skip-checkout` flag to commit the changes to current branch.

If a `preid` is provided it is appended to the release tag.

```json
"scripts": {
  "cutoff-lerna": "cutoff-lerna"
}
```

```bash
yarn run cutoff-lerna
  [--type <major | premajor | minor | preminor | patch | prepatch | prerelease>]
  [--tag <alpha | beta | unstable> [--preid <string>]]
  [--skip-checkout]
  [--skip-prehook]
  [--skip-posthook]
  [--dryrun]
  [--force]
```

### publish-cutoff

The script publishes the project to npm with the new version.

```json
"scripts": {
  "publish-cutoff": "publish-cutoff"
}
```

```bash
yarn run publish-cutoff
```

### publish-lerna-cutoff

The script reads the `.lerna.updated.json`, iterates over each package in the list and publishes it to npm with the
new version.

```json
"scripts": {
  "publish-lerna-cutoff": "publish-lerna-cutoff"
}
```

```bash
yarn run publish-lerna-cutoff
```

## Script hooks

### cutoff:pre-version

Any tasks you want to run prior to npm package versions getting updated should be run in this script hook.

```json
"scripts": {
  "cutoff:pre-version": "yarn run pre-version-tasks"
}
```

### cutoff:post-version

Any tasks you want to run after npm package versions have been updated should be run in this script hook.

```json
"scripts": {
  "cutoff:post-version": "yarn run post-version-tasks"
}
```

## Changelog

Check out the [features, fixes and more](CHANGELOG.md) that go into each major, minor and patch version.

## License

Cutoff is [MIT Licensed](LICENSE).

---
_Source: https://npm.io/package/cutoff · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
