1.0.0 • Published 7 years ago

generator-node-service-bespoke v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

service-generator

Yeoman generator for new services.

Try it out

Install Yeoman:

npm i -g yo

Clone the repo, install, link and build:

git clone git@github.com:msinton/generator-node-service-bespoke.git && \
cd generator-node-service-bespoke && \
npm i && \
npm link && \
npm run build # or npm run watch

And then, inside of the directory of the new package you want to create:

yo node-service-bespoke

Documents

There are several generated documents that describe best practices.

Development

Basics

The generation of the project is done in several steps. "Prompting" is the first step, where the user must select the project characteristics. Then the templates are generated during the "writing" step. At the "end" step, some commands are run to setup the project (e.g. install npm dependencies, copy githooks, etc). Some related source files are:

There is the option to try the generator inside the repo with: npm run generate-example, which will create the directory example-project which will not be tracked by git. You must have the generator previously linked.

Patterns

  • Use the .tpl name in files when it has conditional content, so it is copied with this.fs.copyTpl
  • If you want to create a subgenerator, e.g. yo node-service-bespoke:foo, place the new generator within src/foo/ (more info)

External links