generator-lob
v2.0.0
Published
Lob's Yeoman generator for creating Node modules
Downloads
47
Maintainers
Keywords
Readme
Generator
Lob's Yeoman generator for creating Node modules.
Installation
$ yarn install --global generator-lob
Usage
To generate a complete repository:
$ yo lob
To generate a portion of a repository, you may use a sub-generator.
Sub-Generators
Config yo lob:config
Continuous Integration yo lob:ci
Lint yo lob:lint
Node Version yo lob:node-version
Release yo lob:release
Test yo lob:test
Config
$ yo lob:config
- Prompts for whether to generate a
config
directory - Generates a
config/index.js
file that reads an object of config variables from one ofconfig/developments.js
,config/production.js
,config/staging.js
, orconfig/test.js
based on theNODE_ENV
. Initializes each environment's config file to export an empty object.
Continuous Integration
$ yo lob:ci
- Prompts for a CI platform (CircleCI or Travis) and Node version and composes a
.yml
file accordingly
Lint
$ yo lob:lint
- Installs
eslint
andeslint-config-lob
- Creates an
.eslintrc
file that configures the linter to useeslint-config-lob
's default rules - Creates an
.eslintignore
file that excludes thecoverage/
folder from linting - Adds a
lint
yarn script to lint all javascript files in the project
Node Version
$ yo lob:node-version
- Prompts for a node version and uses it in a
.node-version
file
Release
$ yo lob:release
- Installs generate-changelog
- Adds yarn scripts for
release:patch
,release:minor
, andrelease:major
Test
$ yo lob:test
- Installs chai, istanbul, and mocha
- Creates
test/setup.js
file that defines anexpect
global - Adds yarn scripts for
enforce
,test
, andtest-no-cover
Extension
To learn more about building generators, read the Yeoman Guide to Authoring Generators. New sub-generators can be added in the generators/
folder and made available as a yo lob:SUB
command through the index.js
file. To modify the list of sub-generators that are run as part of the default yo lob
command, modify the generators/index.js
file.