Skip to content

Yeoman Generator usage

Christopher Haugen edited this page Nov 7, 2017 · 17 revisions

What is Yeoman?

The Yeoman Generator is a command line interface which we utilize to create boilerplate for extending the stack with user defined file names and parameters.

Getting started

Installing Stack Yeoman

$ npm install -g yo generator-goatstack

Using Yeoman to build the stack

$ mkdir [appName] && cd [appName]
$ yo goatstack [name?]

NOTE: generator will prompt for the appName, description, keywords to initialize the stack template

Available Yeoman commands

  • Module

    • yo goatstack:module [name?]
      • creates new module with module, routing.module, and main component in a module folder
      • main component is connected to module
      • NOTE: You must connect the module to the app module manually
  • SubModule

    • yo goatstack:submodule [name?]
      • creates new module with module, routing.module, and main component in an existing module folder
      • main component is connected to module
      • NOTE: You must connect the module to the parent module manually
  • Component

    • yo goatstack:component [name?]
      • creates component & component.spec in new component folder (named after name)
      • NOTE: You must connect the component to the module manually
  • Directive

    • yo goatstack:directive [name?]
      • creates new directive template in the directives folder
      • NOTE: You must connect the directive to the scope you want it to belong to
  • Pipe

    • yo goatstack:pipe [name?]
      • creates new pipe template in the pipes folder
      • NOTE: You must connect the pipe to the scope you want it to belong to
  • Service

    • yo goatstack:service [name?]
      • creates new service template in the services folder
      • NOTE: You must connect the service to the scope you want it to belong to
  • Actions

    • yo goatstack:action [name?]
      • creates new actions template in the actions folder
      • NOTE: You must connect the actions to the scope you want it to belong to
  • Store Item

    • yo goatstack:action [name?]
      • creates new initial-state, reducer, reducer.spec, transformers, and types templates in a new attribute folder in the store folder
      • connects the store-item to the IAppState; adds the import, store attribute, and reducer to store index.js
  • Endpoint

    • yo goatstack:endpoint [name?]
      • creates new controller, integration, model, routes, and spec templates in a new endpoint folder in the server api folder
      • connects the endpoint to the router.js file