1.0.0 ā€¢ Published 3 years ago

prerelease-checks v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

prerelease-checks

Run essential pre-release checks before releasing an npm package.

šŸ’ž Works well with standard-version!

If you like this project, please star it & follow me to see what other cool projects I'm working on! ā¤ļø

šŸ™‹ā€ā™‚ļø Why?

Because there are many points of failure when making a release.

This CLI runs a thorough check to guarantee a successful package release:

npm

  • āœ… Assert npm version
  • āœ… Validate package.json
    • āœ… Check valid npm name
    • āœ… Check valid semver version
    • āœ… Verify public package
  • āœ… Verify npm registry is reachable (in case custom)
  • āœ… Verify npm publish registry is reachable
  • āœ… Verify user is authenticated to publish registry and has permissions

Git

  • āœ… Assert Git version
  • āœ… Verify working directory is clean
  • āœ… Verify current branch is release branch
  • āœ… Verify remote head exists
  • āœ… Verify current branch is identical to upstream

šŸš€ Install

npm i -D prerelease-checks

npx

You can also install-and-run as you need it via npx:

npx prerelease-checks

šŸš¦ Quick Setup

As a prepublish hook

Add prerelease-checks as a prepublishOnly hook in your package.json:

 {
   "scripts": {
+    "prepublishOnly": "prerelease-checks"
   }
 }

With standard-version

If you're using standard-version, add it to their prerelease hook.

 {
   "scripts": {
+    "prerelease": "prerelease-checks",
     "release": "standard-version"
   }
 }

Other

You can prepend your release script with prerelease-checks.

 {
   "scripts": {
+    "release": "prerelease-checks && my-custom-release-command",
   }
 }

šŸ™ Credits

Many inspirations taken from the prerequisite checks from np.