This generator creates a new hapi plugin with all the boilerplate you need to get started.
- Hapi plugin boilerplate
- Unit testing and code coverage with Lab
- Code linting
- Watch tasks for tests and development server
- JavaScript code style check (optional)
- Npm versioning (optional)
Install the generator by running: npm install -g generator-hapi-plugin
Make a new directory, and cd into it. Run the following command and follow the prompts.
yo hapi-plugin
Note that this template will generate files in the current directory, so be sure to first change to a new directory if you don't want to overwrite existing files.
Run the following command from the root of the project:
gulp develop
The develop task starts a development hapi server which requires your plugin. The server gets restarted on changes made in your project folder.
gulp bump
The bump task increments the plugin version in the package.json file on a patch base. You can use the type parameter to specify the type of release:
gulp bump --type (major|minor|patch|prerelease)
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.
Should you have any problems or wishes for improvements, feel free to open up an issue.
##Credits This generator is based on the generator-node-gulp.
Copyright (c) 2014 Kentaro Wakayama. Licensed under the MIT License.