Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@skypilot/bump-version

skypilotcc16ISCdeprecated1.0.11TypeScript support: included

This package has been renamed to @skypilot/quick-release. Please install that package instead.

Automatically bumps a project's version number

automatically, bump, file, number, package, semantic, version

readme

@skypilot/quick-release

npm stable stable build npm next next build Codacy grade downloads license: ISC

Automatic generator of version numbers for releases & prereleases

What it does

Quick Release analyzes a project's version number, commit history, and version tags to determine the version to use for the next release.

How it works

Quick Release analyzes the following data to determine the next version number:

  • the current version in package.json
  • the commit messages since the last stable-release tag
  • release and prerelease version tags
  • the branch name

The master branch is treated as the stable-release branch. A version bump on this branch results in a new version number in the form X.X.X (example: 1.0.0).

If the stable-release branch has a name other than master, set it using the STABLE_RELEASE_BRANCH environment variable in each of the workflow files. Note that the use of master is deprecated, and main will become the default stable-release branch name in a future version of this library.

All branches other than the stable-release branch are treated as prerelease branches. A version bump on a prerelease branch results in a new version number in the form X.X.X-<BRANCH NAME>.X (example: 1.0.0-beta.1).

How to install

$ yarn add --dev @skypilot/quick-release
# or
$ npm add --save-dev @skypilot/quick-release

How to use

Quick Release exposes six commands:

  • bump-version: Computes the next version number for your project and writes it to package.json

  • get-current-version: Displays your project's current version number from package.json

  • get-next-version: Computes the next version number for your project and displays it to standard output

  • is-published VERSION: Returns true if the version has been published, otherwise false

  • is-tagged VERSION turns true if the version tag has been used, otherwise false

  • spqr-option KEY: Returns the value mapped to a key in the .skypilot/quick-release.yaml options file. If no value is set there, it defaults to the value in the defaults file.

See the files in .github/workflows in this repo for examples of how to use Quick Release in a GitHub Actions workflow (Quick Release is used for its own releases).

Default prefixes

  • Major change (X.x.x): CHG!, DROP!, MAJOR, MAJOR!
  • Minor change (x.X.x): add, chg, drop, feat, minor
  • Patch change (x.x.X):
    • Fixes: bug, fix, patch
    • Refactoring: chore, refactor, task
    • Internal features: util
    • Other: no prefix
  • No change (patch change if released):
    • Documentation & code style: docs, style

These values will soon be customizable.

How to customize

Quick Release checks for a configuration file at .skypilot/quick-release.yaml in your project's root directory; the settings in that file can be used to customize Quick Release's behaviour. See the defaults file for available settings.

Advanced API

The library also exposes the following functions:

  • getCoreVersion(): string
  • getCurrentVersion(): string
  • parseMessageChangeLevel(message: string): ChangeLevel
  • parseMessagesChangeLevel(messages: string[]): ChangeLevel

Coming soon

These features are slated for development in the near future:

  • Changelog generation
  • Automated creation of GitHub Releases

changelog

1.0.11 (2020-02-09)

Bug Fixes

  • Single-commit retrieval fails at merge commit (d8371d3)

1.0.10 (2020-02-09)

1.0.9-beta.9 (2020-02-09)

1.0.9 (2020-02-09)

1.0.9-beta.8 (2020-02-09)

Bug Fixes

  • Version fails with invalid version string (dae7488)

1.0.8 (2020-02-06)

1.0.8-next.0 (2020-02-06)

1.0.7-next.1 (2020-02-06)

Bug Fixes

  • Tip of stable branch is not identified (afa380e)

1.0.7-next.0 (2020-02-06)

Bug Fixes

  • Prerelease at tip of stable branch should not bump version (8a65aa6)

1.0.5 (2020-02-06)

Bug Fixes

  • Prerelease relative to stable branch should be at least patch bump (a0975e5)

1.0.4 (2020-02-06)

1.0.3-next.1 (2020-02-06)

1.0.3-next.0 (2020-02-06)

1.0.2 (2020-02-06)

1.0.1 (2020-02-06)

Bug Fixes

  • getNextReleaseVersion unit test fails (ed35ee1)

1.0.0-next.0 (2020-02-06)

Bug Fixes

  • Next release version is always a patch bump (33ad06b)

1.0.0 (2020-02-05)

0.1.0-alpha.14 (2020-02-05)

Bug Fixes

  • Prerelease bump fails when processing release tags (42e7adc)

0.1.0-alpha.13 (2020-02-05)

Features

  • Improve prerelease versioning by including published versions (74f2e78)

0.1.0-alpha.12 (2020-02-05)

Bug Fixes

  • Next version call may receive a version with a 'v' prefix (f10715f)

0.1.0-alpha.11 (2020-02-05)

Features

  • Parse published versions to avoid version conflicts (fad9ba1)

0.1.0-alpha.10 (2020-02-04)

Bug Fixes

  • get-next-version is confused by edge cases (aa80e0a)
  • Next release version must always be higher than previous release (4c6e561)

0.1.0-alpha.7 (2020-02-03)

Bug Fixes

  • findCommitsSinceMaster returns only the HEAD commit (16c77a5)

0.1.0-alpha.6 (2020-02-03)

Features

  • Can get the current version from the package file (f01178e)

0.1.0-alpha.5 (2020-02-03)

Bug Fixes

  • Package commands are not executable (08f49ae)

0.1.0-alpha.4 (2020-02-03)

Features

  • Can bump the version from the command line (95bc320)
  • Can get the next prerelease version (447a3b7)
  • Can get the next release or prerelease version, as appropriate (e4d3e6d)
  • Can get the next release version (e195972)
  • Can get the next version at the command line (876b984)
  • Can get the version from the package file (2c6fbfb)
  • Can parse the change level of a commit message (894c080)
  • Can the parse the change level of multiple commit messages (d8ea816)