Managing npm libraries, done right

How we stopped worrying about releasing code on npm

The problem

Let’s say it, versioning and publishing a package on npm is intricate, risky and… boring!

A typical workflow for publishing a new version of your library on npm may look like:

Decide if the new version should be breaking or not (💥) Increase the version of your package.json (🔢) Update the CHANGELOG.md (😤) Create a new release on GitHub (😤) Publish the updated package on npm (🚀) Pray everything was done in the right way (🙏)

Doing all these steps manually not only requires a big effort, but may also lead to errors that could be prevented by making it less boring as accurately described by the following formula:

RISKY + BORING MANUAL STEPS = EXTREMELY RISKY

Our solution

The solution? Automate everything with smooth-release !

smooth-release is a smart CLI tool we created at buildo to guide us through this intricate process.

Here’s how it works:

First, smooth-release will run some handy validations to avoid some common mistakes such as ensuring that you’re on the right branch or that you’re in sync with origin ! (yes, those errors happened to us…)

Having ensured you’re out of trouble, smooth-release will automatically detect if your release is breaking or not and ask you to validate the computed version.

Now that we have updated the package.json , we can update our CHANGELOG.md and push both files on GitHub…

…and then create a new release on GitHub with a link that will point to the relative section in CHANGELOG.md .

Finally, all that is left is to publish our beloved library on npm …

…and it’s all done in less than 30s! :)