There are so many repeated steps when releasing a new version of a library. The tool semantic-release automates this process by pushing off the responsibility of your releases to continuous integration. Trust us, this will change your workflow for the better.
Wouldn't it be nice if everyone ran the tests before committing code? With ghooks, you can automatically add a githook when dependencies are installed which will allow you to define common scripts to be run at various points during git actions (like committing). In this lesson, we'll add a githook for running the tests before we commit code to make sure we don't commit anything that breaks the tests.
It's nice to know the status of a project. Adding badges to your readme gives first-timers and old-timers an at-a-glance peek into the status of your project. In this lesson, we'll add several badges using shields.io
By default, Travis will build all branches, tags, and Pull Requests. Because we're building our master branch before we release, we don't need Travis building our releases. Also, we don't care to have Travis build all the branches. So we're going to limit Travis to only build our master branch and Pull Requests by configuring travis via our
We can create a package.json automatically by running
npm init and answering the questions it gives. This becomes the “manifest” file for our package; it is used to populate the published npm page as well as to help the package manager to know how to install the package in consuming projects.
In this lesson we will publish our package. We will first add a
prepublish script that runs our
build script; this will ensure the built folder gets added to npm when published. We will also add a
.npmignore so that only our built files get installed. We need to run
npm adduser to log in to an npm account. We can then run
npm publish to publish our package and view it on npm.
Note: if you want to actually publish the package from this course, you'll need to rename it since
sensitive-words is already taken. You can use a scoped package name for this as well.