Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
release-it
Advanced tools
Interactive release tool for Git repositories. Increment version, commit, tag, push, build, publish to npm. Supports to build and release to a distribution/component repository.
release-it is a versatile command-line tool for automating versioning and package publishing. It simplifies the release process by handling version bumps, changelogs, Git tags, and publishing to npm and other platforms.
Version Bumping
Automatically bumps the version of your project. In this example, it bumps the minor version.
release-it minor
Changelog Generation
Generates a changelog based on the commits since the last release.
release-it --changelog
Git Tagging
Creates a new Git tag for the release.
release-it --git.tag
NPM Publishing
Publishes the package to the npm registry.
release-it --npm.publish
Custom Hooks
Allows you to define custom hooks to run at various points in the release process.
{ "hooks": { "before:init": "echo 'This is a custom hook'" } }
standard-version is a tool for versioning and changelog generation based on conventional commits. It focuses on standardizing the release process and is less customizable compared to release-it.
semantic-release automates the versioning and package publishing process based on the commit history. It is highly configurable and integrates with CI/CD pipelines, making it more suitable for complex workflows compared to release-it.
lerna is a tool for managing JavaScript projects with multiple packages. It can handle versioning and publishing for monorepos, offering more advanced features for multi-package repositories compared to release-it.
Interactive release tool for Git repositories. Options: run build command first, release to distribution repository (or branch), create GitHub release, publish to npm.
Automatically bump version, commit, tag, push, done.
Here's an extended article about Using Release It!
Obviously, Release It has released itself. Cool, heh?! There's also a Grunt plugin.
npm install release-it -g
Release a new patch (increments from e.g. 1.0.4
to 1.0.5
):
release-it
Release a patch, minor, major, or specific version:
release-it minor
release-it 0.8.3
release-it 2.0.0-rc.3
Create a pre-release using prelease
, prepatch
, preminor
, or premajor
:
release-it premajor --prereleaseId="beta"
release-it premajor
The first example would increment from e.g. 1.0.6
to 2.0.0-beta.0
, the second from 2.0.0-beta.0
to 2.0.0-beta.1
.
See node-semver for more details.
You can also do a dry run, which won't write/touch anything, but does output the commands it would execute, and show the interactivity:
release-it --dry-run
If you don't like questions and trust the tool, you can use the non-interactive
mode:
release-it --non-interactive
Provide a custom name for the GitHub release:
release-it --github.releaseName="Awesome Ants"
Release It can do a lot out-of-the-box, but has plenty of options to configure it.
$ release --help
Release It! v2.1.0
Usage: release <increment> [options]
Use e.g. "release minor" directly as shorthand for "release --increment=minor".
Options:
-c, --config Path to local configuration options [default: ".release.json"]
-d, --dry-run Do not touch or write anything, but show the commands and interactivity
-e, --debug Output exceptions
-f, --force Force tagging with Git
-h, --help Print help
-i, --increment Increment "major", "minor", "patch", or "pre*" version; or specify version [default: "patch"]
-m, --message Commit message [default: "Release %s"]
-n, --non-interactive No interaction (assume default answers to questions)
--prereleaseId Identifier for pre-releases (e.g. "beta" in "1.0.0-beta.1")
-p, --npm.publish Auto-publish to npm (only relevant in --non-interactive mode)
--npm.tag Register published package with given tag (default: "latest")
-v, --version Print version number
-V, --verbose Verbose output
{
"non-interactive": false,
"dry-run": false,
"verbose": false,
"force": false,
"pkgFiles": ["package.json"],
"increment": "patch",
"prereleaseId": null,
"commitMessage": "Release %s",
"tagName": "%s",
"tagAnnotation": "Release %s",
"buildCommand": false,
"changelogCommand": "git log --pretty=format:'* %s (%h)' [REV_RANGE]",
"requireCleanWorkingDir": false,
"src": {
"pushRepo": null,
"beforeStartCommand": false,
"beforeStageCommand": false,
"afterReleaseCommand": false
},
"dist": {
"repo": false,
"stageDir": ".stage",
"baseDir": "dist",
"files": ["**/*"],
"pkgFiles": null,
"beforeStageCommand": false,
"afterReleaseCommand": false
},
"npm": {
"publish": false,
"publishPath": ".",
"tag": "latest",
"private": false,
"forcePublishSourceRepo": false
},
"github": {
"release": false,
"releaseName": "Release %s",
"tokenRef": "GITHUB_TOKEN"
}
}
Notes:
src.pushRepo
has a falsey value, just git push
is used. Otherwise, it's the url or name of a remote in git push <src.pushRepo>
.dist.pkgFiles
has a falsey value, it will take the value of pkgFiles
.after*/before*
commands are executed from the root/working directory of the source or distribution repository. The beforeStageCommand
is executed before files are staged for commit, and after a version bump.Some projects use a special distribution repository. There might be multiple reasons to do.
Notes:
dist.repo
to a git endpoint (e.g. "git@github.com:components/ember.git"
).#
notation (e.g. "git@github.com:webpro/release-it.git#gh-pages"
).dist.repo
, but still want to publish the source repository to npm, make sure to set "forcePublishSourceRepo": true
.The tool assumes you've configured your SSH keys and remotes correctly. In case you need to configure things for GitHub, the following pages might be of help.
To create GitHub releases, you'll need to set github.release
to true
, get a GitHub access token, and make this available as the environment variable defined with github.tokenRef
. With the default settings, you could set it like this:
export GITHUB_TOKEN="f941e0..."
In non-interactive mode, the release is created only for the source repository.
Place a .release.json
file in your project root, and Release It will use it to overwrite default settings. You can use --config
if you want to use another filename/location. Most options can be set on the command-line (these will have highest priority).
To keep you in control, many steps need your confirmation before execution. This is what happens if you answer "Yes" to each question:
With the current repository:
pkgFiles
.buildCommand
provided? Clean dist.baseDir
and execute the buildCommand
.commitMessage
(%s
is replaced with the new version).tagName
(and tagAnnotation
).github.releaseName
and output of changelogCommand
).dist.repo
? Publish package to npm.Additionally, if a distribution repository is configured:
dist.repo
in dist.stageDir
.dist.files
from dist.baseDir
to dist.repo
.dist.pkgFiles
, commit, tag, push dist.repo
.github.releaseName
and output of changelogCommand
).Notes:
"private": true
setting in package.json will be respected and you will not be bothered with the question to publish to npm.Major dependencies:
The following Grunt plugins have been a source of inspiration:
Why did I need to create yet another "release" tool/plugin? I think this tool stands out:
FAQs
Generic CLI tool to automate versioning and package publishing-related tasks.
The npm package release-it receives a total of 415,583 weekly downloads. As such, release-it popularity was classified as popular.
We found that release-it demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.