An npm scripts
boilerplate for modules intended for production.
- ES6 with Babel
- Lint with ESLint
- Tape tests with coverage report
- Dependency security audits with nsp
- Ensure dependencies are properly declared in package.json
- Git precommit hook enforces quality checks on commit
- Travis CI integration
In a bash terminal:
git clone git@github.com:cloverfield-tools/prod-module-boilerplate.git <your-new-repo-name>
cd <your-repo-name>
rm -rf <.git> # strip the boilerplate .git config
git init # create your own .git config
git add .
git commit -m 'Initial commit'
Open up package.json
. At minimum, you'll need to customize the name
, description
, & version
fields.
This package comes with a .travis.yml
file. You'll need to replace it with your own build config. If you want to continue using TravisCI and you don't see any problems with the config, replacing .travis.yml
is optional. You still need to activate Travis CI for your repository.
Pop open README.md. Find this text:
[![Travis-CI](https://travis-ci.org/cloverfield-tools/prod-module-boilerplate.svg)](https://travis-ci.org/cloverfield-tools/prod-module-boilerplate)
And replace it with your info:
[![Travis-CI](https://travis-ci.org/<your-github-name>/<your-github-repo-name>.svg)](https://travis-ci.org/<your-github-name>/<your-github-repo-name>)
You'll probably also want to replace the content of "Getting Started" & "Features", and ensure that you're refering to the correct repository in the "Contributing" document.
- For production
npm run build
It will run webpack once building full and minified versions of your library in ./build
with sourcemaps.
- For development
npm start
This will run the webpack
build in watch mode and will include ESLint checks on compile time.
Note minified version will not be built in dev mode.