bump
v1.0.0-rc.0

Introduction

bump releases the packages of a git repository. It finds the packages that changed since their last release and computes their next versions. It writes the new versions into the manifests. Then it makes one release commit, with one annotated tag per released unit.

It works with package.json and Cargo.toml packages, also mixed in one repository.

This example uses independent mode:

Terminal
$ bump minor
BUMP @acme/core 1.2.0 → 1.3.0  (changed)
BUMP @acme/cli 0.4.1 → 0.4.2  (dependent)
EDIT @acme/cli dependencies["@acme/core"] ^1.2.0 → ^1.3.0
EDIT @acme/docs devDependencies["@acme/core"] ^1.2.0 → ^1.3.0
DONE Committed 0394e49 release: @acme/core@1.3.0, @acme/cli@0.4.2
     Tagged @acme/core@1.3.0, @acme/cli@0.4.2

Here @acme/core changed, so it gets the minor release. @acme/cli depends on @acme/core, so it gets a patch release. Each range that names @acme/core gets the new version.

What bump does

  • It finds your packages from your workspace files, or from packages in bump.json. See How it works.
  • It finds the changes since the last release of each package, by its tag.
  • It computes each next version from a type (major, minor, patch, premajor, preminor, prepatch, prerelease) or from an exact version.
  • It releases the packages that depend on a released package. See Lockstep and independent.
  • It edits only the versions and the dependency ranges. Your comments, key order, and whitespace stay the same.
  • It updates Cargo.lock and npm lockfiles in the same commit. See Lockfiles.
  • It undoes the files, the commit, and the tags when a step fails.

What bump does not do

  • Publish. You run npm publish or cargo publish. The JSON result tells you which packages were released, and which ones are publishable.
  • Push. You run git push --follow-tags. See Quick start.
  • Changelogs. bump writes no changelog and no release notes.

Main ideas

Versions come from the manifests

The version in each manifest is the current version. bump reads no version from tags or from its config.

Tags mark the last release

The tag of the current version, such as v1.2.0 or @acme/core@1.2.0, marks the last release commit. bump compares HEAD with that commit to find changes. The manifest and the tag must agree. If they do not, bump stops and tells you why. See Anchors.

Units

bump releases units, not single packages. A unit is a set of packages that always release together, with one version and one tag.

  • In lockstep mode, the default, all versioned packages are one unit.
  • In independent mode, each group is a unit, and each versioned package outside a group is a unit.

See Lockstep and independent.

One commit, one tag per unit

A release is one commit with all the edits. Each released unit gets one annotated tag on that commit.

Undo on failure

bump does all checks before it writes a file. If a later step fails, for example a commit hook or a tag signature, bump undoes the release. See Undo.

Runtime

bump runs on Bun 1.4 or later. It needs git on your PATH. See Install.

Next steps

    Type to search page titles and sections.