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

Package detail

shipitjs

hideo555340.3.2

npm package release management tool

release management, npm, git, hg

readme

ShipIt.js

A release management tool for NPM packages.

Installation

Install latest version directly from NPM repository:

npm install shipitjs

or, clone and install from local copy (if you plan on hacking on it):

git clone git://github.com/hideo55/node-shipitjs.git
npm install ./shipitjs

Usage

Usage: shipitjs [options] [command]

Commands:

  init                   Write default configuration to `./.shipit.json`.
  release [release-type] Release the package to NPM, where `release-type`
                         is [major|minor|patch|premajor|preminor|prepatch|prerelease|custom].

Options:

  -h, --help     output usage information
  -V, --version  output the version number
  -x, --exec     Actually run commands (defaults to dry-run)

The release command is, by default, run in dry-run mode; so, it is easy and safe to confirm what will happen. You must specify the -x (or --exec) option explicitly in order to actually execute the steps.

Semantic Versioning

Semantic Versioning is used for version numbers. See the the spec for more detailed information.

Basically, version numbers follow these formats:

  • major "." minor "." patch
  • major "." minor "." patch "-" build

For example, 0.0.1 and 0.0.1-1 are valid version numbers; however, x0r3 is not.

If, say, the current version number is 0.0.1, then the next version numbers would be:

  • 1.0.0 for a major version bump
  • 0.1.0 for a minor version bump
  • 0.0.2 for a patch version bump
  • 0.0.2-0 for a prepatch version bump

Configuration

The config file is named .shipit.json. A default config file can be generated with the init command:

$ cd /path/to/module
$ shipitjs init

An example config file:

{
  "steps": ["FindVersion", "ChangeVersion", "CheckChangeLog", "Commit", "Tag", "Publish"],
  "CheckChangeLog": {
    "files": ["History.md"]
  }
}

Steps

FindVersion

Attempts to infer the current version number from VCS tag. If that fails, then the version number in package.json (or package.ls) is used. The next version number is then calculated (according to Semantic Versioning) and the user is prompted for confirmation.

Config

None.

ChangeVersion

Changes the version number specified in package.json (or package.ls). It attempts also to update exports.version if a main script has been defined.

Config

file (String)

If you manage your package.json with LiveScript, then specify package.ls. npm run prepublish will be executed for you automatically.

NOTE: You must also specify a truthy value for the global usePackageLS.

{
  "usePackageLS": true,
  "ChangeVersion": {
    "file": "package.ls"
  }
}

CheckChangeLog

Checks changelog(s) for entries for the new version number. Provides option to edit changelog (using the current user's $EDITOR, defaults to vim) if no entry was found.

Config

files (Array)

An array of changelog filenames to check.

{
  "CheckChangeLog": {
    "files": ["History.md"]
  }
}

Commit

Commits all local changes.

Config

message (String)

Template for commit message.

{
  "Commit": {
    "message": "Checking in changes prior to tagging version \"{{version}}\".\n\nChangelog diff:\n\n{{changelogDiff}}"
  }
}

Tag

Makes a tag for the new version.

Config

message (String)

Template for tag message.

{
  "Tag": {
    "message": "Tagging version \"{{version}}\" using shipitjs."
  }
}

Publish

Publishes module to the NPM registry, asking first for user confirmation.

Config

None.

Version Control Systems

Currently Git and Mercurial are the only VCS supported.

Git

An example git configuration:

{
  "vc": {
    "Git": {
      "PushTo": "origin",
      "SignTag": true,
      "TagPattern": "version-%v"
    }
  }
}

PushTo (String)

Where the new version should be pushed.

SignTag (Boolean)

Whether tags should be GPG/PGP signed.

TagPattern (String)

Custom pattern for tag names (%v is replaced by version number).

Mercurial

An example mercurial configuration:

{
  "vc": {
    "Hg": {
      "PushTo": "remote"
    }
  }
}

PushTo (String)

Where the new version should be pushed.

License

(The MIT License)

Copyright (c) 2011 Hideaki Ohno <hide.o.j55{at}gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

changelog

Revision history for shipitjs

0.3.2 / 2018-08-23

  • Update semver(5.5.1)

0.3.1 / 2017-06-02

  • Use fs.writeSync instead of fs.write

0.3.0 / 2015-01-31

  • Support Semantic Versioning 2.0

0.2.5 / 2015-01-28

  • Remove "preferGlobal" from package.json

0.2.4 / 2014-12-26

  • Fixed error when release subcommand(issue#7)

0.2.3 / 2013-05-27

  • Add configuration for customize the messages generated in the Tag and Commit steps.

0.2.2 / 2013-05-24

  • Improved wording (Thanks to execjosh)
  • Fixed error when step configuration is missing

0.2.1 / 2013-04-16

  • Fixed git repository URL in package.json
  • Fixed typo in README

0.2.0 / 2013-04-15

  • Support versioning from pacakge.ls (clkao)

0.1.15 / 2012-07-19

  • Add "bugs" to package.json

0.1.14 / 2012-07-04

  • Change usage of Readline API(for node v0.8)

0.1.13 / 2012-06-26

  • Change dependency module version for node v0.8 support

0.1.12 / 2012-06-17

  • Change package name

0.1.11 / 2012-06-14

  • node v0.7.10 support

0.1.10 / 2012-06-14

  • Change path.exists() to fs.exists()

0.1.9 / 2012-06-13

  • Remove unused library

0.1.8 / 2012-03-22

  • Fixed runtime error.(Thanks to leecookson.)

0.1.7 / 2011-11-19

  • Change command interface write-config to init for simplification

0.1.6 / 2011-11-18

  • Change internal methods
  • Improved comments
  • Add keywords in package.json

0.1.5 / 2011-11-16

  • Change internal command processing.

0.1.4 / 2011-11-08

  • Add Mercurial support

0.1.3 / 2011-11-06

  • Fixed document
  • Fixed bug in Git
  • Chage git diff target(HEAD => Tag)

0.1.2 / 2011-11-05

  • Fixed bug in git push

0.1.1 / 2011-11-04

  • Add rollback feature
  • Add deleteTag() in VC/Git
  • Add resetRecentCommit() in VC/Git

0.1.0 / 2011-11-02

  • path.existsSync () fs.readFileSync and () ceased to use
  • Change version replacement pattern

0.0.9 / 2011-10-28

  • Add feature that update version in the main file

0.0.8 / 2011-10-25

  • Remove unnecessary pause()/resume() in CheckChangeLog.js

0.0.7 / 2011-10-25

  • Change option of spawn() for support Node v0.6.x

0.0.6 / 2011-10-23

  • Fixed broken -x option

0.0.5 / 2011-10-23

  • Fixed broken 'write-config' command

0.0.4 / 2011-10-21

  • Change command-line interface
  • Fixed bug that git's settings does not reflected
  • Fixed bug that handling 'SignTag'
  • Documentation improved

0.0.3 / 2011-10-20

  • Change command-line options
  • Dry-Run mode is default.

0.0.2 / 2011-10-19

  • Improve 'CheckChangeLog' stability
  • Add confirm message to 'Publish'

0.0.1 / 2011-09-28

  • Initial release