generator-jolzee-node-module v2.0.3
generator-jolzee-node-module
āļø This generator generates a (universal) npm module boilerplate
What does module-boilerplate offer?
- Project structure to create a cross build npm module
- Linting: via ESLint
- Testing: with Coverage via Jest
- CommonJS: build (
/dist/cjs) via Babel - ES2015: build (
/dist/es) via Babel - UMD build: (
/dist/umd) via Rollup (unminified & minified version) - Watch scripts:
npm run (test|build):watch - Git hooks: precommit, prepush hooks defined in
package.json - prepublish (before publishing to npm) script
npm run build - Only publish what's needed (
filesfield inpackage.json)
Nice to haves
- README.md template :memo:
- ... with npm, Travis, David, Gitmoji badges :chart_with_upwards_trend:
- License generation
- Travis CI integration :construction_worker:
- Coverage Reporting via Coveralls
- Typechecking: via Flow (optional)
- webpro/release-it integration
- Optimized for modern bundlers
- unpkg ready š
+ 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)
Getting Started
Dependencies
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-jolzee-node-moduleor via npm
npm install yo -g
npm install generator-jolzee-node-module -gRunning the generator
yo jolzee-node-moduleGetting Started / Scripts
watch š
Testing via Jest in interactive watch mode
npm run test:watchCommonJS build (/dist/cjs) via Babel
npm run build:watchā¹ļø use a split terminal window for maximum developer experience
build āļø
npm run buildThe build command runs the following steps:
- Linting via ESLint (+ optional Flow typechecking)
- Testing (with Coverage) via Jest
- CommonJS build (
/dist/cjs) via Babel - ES2015 build (
/dist/es) via Babel - UMD builds (
/dist) via Rollup
which equals to:
npm run lintnpm run test:coveragenpm run build:cjsnpm run build:esnpm run build:umd
testing :white_check_mark:
Tests your src folder via Jest, (test env is included in .babelrc)
npm run testor with coverage (also used in precommit / prepush / prepublish)
npm run test:coveragereleasing š
ā¹ļø 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)- Creates a version bump in package.json
- Commits a change with this message 'š vX.X.X'
- Creates a tag (github release) with the name 'vX.X.X' and as description 'Version X.X.X'
- Push to remote (with tags)
npm publish(withnpm run buildas 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.
Git Hooks ā
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:
License
The code is available under the MIT license.