⚙ npm module (UMD, CJS, ES6) boilerplate generator
⚙️ This generator generates a (universal) npm module boilerplate
/dist/cjs
) via Babel
/dist/es
) via Babel
/dist/umd
) via Rollup (unminified & minified version)npm run (test|build):watch
package.json
npm run build
files
field in package.json
)+ Invisible contract which states that you will use gitmoji for commits ? (just kidding, but you should)
You should probably enable greenkeeper (keeps your dependencies up to date)
install yeoman & this module globally via yarn
(this is one of the 'never install modules globally' exceptions)
yarn global add yo
yarn global add generator-module-boilerplate
or via npm
npm install yo -g
npm install generator-module-boilerplate -g
yo module-boilerplate
Testing via Jest in interactive watch mode
npm run test:watch
CommonJS build (/dist/cjs
) via Babel
npm run build:watch
ℹ️ use a split terminal window for maximum developer experience
npm run build
The build command runs the following steps:
/dist/cjs
) via Babel
/dist/es
) via Babel
/dist
) via Rollup
which equals to:
npm run lint
npm run test:coverage
npm run build:cjs
npm run build:es
npm run build:umd
Tests your src
folder via Jest, (test env is included in .babelrc
)
npm run test
or with coverage (also used in precommit / prepush / prepublish)
npm run test:coverage
ℹ️ more info on webpro/release-it
ℹ️ premajor = x.x.x-beta.x
⚠️ watch out, semver has different rules pre 1.0.0
npm run release (premajor|patch|minor|major)
npm publish
(with npm run build
as prepublish script)⚠️ don't forget to answer Y
on the 'publish to npm' question
You can change the release settings in the .release.json
file in the root of your module folder.
There are 2 git hooks defined in scripts
in package.json
they check for broken builds and prevent push or commit.
prepush
and precommit
trigger:
The code is available under the MIT license.