genkio / blog

Stay hungry stay foolish
https://slashbit.github.io/blog/
0 stars 1 forks source link

Yeoman Fundamentals #125

Closed genkio closed 7 years ago

genkio commented 7 years ago

study notes taken from the Yeoman Fundamentals course

Yo

check out the code repo for detail implementation

Setup

$ npm i -g yo
$ mkdir generator-yang
$ cd generator-yang && npm init
$ npm i yeoman-generator --save
# create the entry point for the generator
$ mkdir app && cd app && touch index.js

How to Use

# include the current directory into the npm packages path
$ npm link
$ yo yang

# after implementation added
$ yo yang --help
$ yo yang MyAwesomeApp
$ yo yang MyAwesomeApp --includerouter
$ yo yang MyAwesomeApp --skip-install

# try out the sub-generator
$ yo yang:ngc ContactDetailCtrl
$ yo yang:ngc ContactDetailCtrl --view

Test

$ npm test