Computer

Yeoman File Generation

search

Yeoman File Generation

  • Technique
  • Setup
  1. Install Node
  2. Install Yeoman
    1. npm install -g yo tsd
  3. Create a directory for project
    1. mkdir generator-MYNAMEHERE
    2. cd generator-MYNAMEHERE\
  4. Create json config files
    1. npm init (package.json for node)
    2. tsd init (tsd.json)
  5. Open in VS Code in root directory
    1. "code ."
  6. Edit json file
    1. Add dev-dependencies object
    2. Add dependencies (e.g. Yeoman)
  7. Create the index.js file
    1. mkdir app
    2. Create file "app/index.js"
    3. Set up the index.js to run all the node code (e.g. require section, module.exports section)
  8. Link the root directory to npm (so yeoman project is visible locally)
    1. npm link
  9. Enable typescript for use in Visual Studio Code
    1. Option 1
      1. Set-up typings.json
    2. Option 2
      1. npm install tsd -g (or add to package.json)
      2. tsd install node lodash --save