JSPM

  • Created
  • Published
  • Downloads 3871
  • Score
    100M100P100Q115984F
  • License MIT

Publish your npm modules safely and gracefully.

Package Exports

  • publish-please

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (publish-please) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Publish, please!

Build Status

CLI tool and Gulp plugin that allows you publish npm modules safely and gracefully.

demo

So what it does exactly?

  • Can run tests or build steps before publishing (because prepublish is broken).
  • Checks that you are in the correct git branch.
  • Checks that git tag matches version specified in the package.json.
  • Checks that there are no uncommitted changes in the working tree.
  • Checks that there are no untracked files in the working tree (log files can leak sensitive information).
  • Can force usage of the npm publish tag.
  • Provides release summary and asks for the confirmation.
  • Can be configured via .publishrc file.
  • Can be used as CLI tool or Gulp plugin.

Install

As CLI tool:

npm install -g publish-please

As Gulp plugin:

npm install --save-dev publish-please

Usage

As CLI tool

cd to_your_project_dir
publish-please

That's it. You can change publish configuration using .publishrc file.

As Gulp plugin

const gulp    = require('gulp');
const publish = require('publish-please');

...

// NOTE: you can setup prepublish actions as the dependency for the task
gulp.task('publish', ['test'], () => publish(options));

options will override options specified in the .publishrc file.

Options

  • confirm - Ask for the confirmation before publishing. Default: true.
  • checkUncommitted - Check that there are no uncommitted changes in the working tree. Default: true.
  • checkUntracked - Check that there are no untracked files in the working tree. Default: true.
  • validateGitTag - Check that git tag matches version specified in the package.json. Default: true.
  • validateBranch - Check that current branch matches the specified branch. Default: master.
  • tag - Specifies tag with which package will be published. See npm publish docs for more info. Default: latest.
  • prepublishScript - Specifies command that will be run before publish (e.g. npm test). Use it for builds and tests. Default: null.

.publishrc file

You can specify publish options in the JSON form via .publishrc file in your project directory. E.g.:

{
    "validateGitTag":   false,
    "validateBranch":   "master",
    "tag":              "beta",
    "prepublishScript": "mocha"
}

Author

Ivan Nikulin (ifaaan@gmail.com)