Home

Awesome

Publish, please!

Safe and highly functional replacement for npm publish.

Build Status npm version Dependency Status

Publish-please enables you to :

Publish-please is versatile enough to be used only as a validation tool before publishing or as an all-in-one tool when you want to manually handle your releases.

See how the TestCafe team uses publish-please when bumping to the next release.

Other topics:


Validate your package before publishing to the registry

There are numerous ways to "shoot yourself in the foot" using npm publish.

publish-please enables you to check that what will be sent to the registry is valid, free of vulnerabilities and free of useless files.

Before running npm publish, run this command at the root of your project folder:

npx publish-please --dry-run

The following example shows that you are about to push your test files to the registry:

dry-run-demo-with-errors

When all validations pass, publish-please will show you the exact content of the package that will be sent to the registry, so you can check everything is included in the package:

dry-run-demo-success

The Validation Workflow performs by default the following actions:


Customize the Validation Workflow


Publish to the registry on sucessfull validation

To publish on successfull validation, run the following command:

npx publish-please

publish-demo-success

Customize the Publishing Workflow


Run any script on successfull publishing


Upgrading to latest publish-please version


Running in CI mode

You can execute publish-please in CI mode by adding the --ci option:

npm run publish-please --ci

or

npx publish-please --ci

This option will turn off the default elegant-status reporter in favor of the built-in CI reporter. Use this option to disable emoji and spinner usage. When publish-please executes in a CI (Teamcity, Travis, AppVeyor, ...), the CI reporter is automatically activated.


Installing publish-please locally

publish-please can be installed locally:

npm install --save-dev publish-please

Once installed, the configuration wizard will enable you to configure the validation and publishing workflow.

From now on you cannot use anymore the npm publish command in your project.

But don't worry it's done for the good reason to prevent you or your co-workers run unsafe publishing process. Use publish-please instead of npm publish:

npm run publish-please

Check out my other packages used by this tool


Author

Ivan Nikulin (ifaaan@gmail.com)


Maintainer

Henri d'Orgeval