generator-mo

Another Yeoman Generator. My personal generator for ChaplinJS, SASS and testing.

npm install generator-mo
17 downloads in the last week
33 downloads in the last month

Generator MO

Build Status

Intro

My personal generator for Yeoman with some useful stuff e.g. Chaplin, unit testing, functional tests and some helpers. It has enabled LiveReload. Every sub-generator creates a file with a specfic naming yo mo:controller VodooFoo creates VodooFooController.js.coffee in javascripts/app/controllers. If you enable unit tests then it creates the spec file in tests/busterjs/Specs/App/Controllers/ VoodooFooControllerSpec.js.coffee as well. All generated files are in CoffeeScript - because we love it :-).

Getting Started

  • Make sure you have yo installed: npm install -g yo
  • Install the generator: npm install -g generator-mo
  • Run: yo mo

Includes

Commands

Yeoman

  • yo mo:app initialize the app
  • yo mo:controller <Name> generates controller
  • yo mo:collection <Name> generates collection
  • yo mo:model <Name> generates model
  • yo mo:router <Name> generates router
  • yo mo:layout <Name> generates layout
  • yo mo:collectionview <Name> generates collection view with optional template
  • yo mo:view <Name> generates view with optional template
  • yo mo:template-helper <Name> generates handlebars template helper
  • yo mo:acceptance-test <Name> generates CasperJS scaffolded file
  • yo mo:style <Name> generates SASS/LESS file

Grunt

  • grunt coffeelint lint your coffee scripts (check here Styleguide)
  • grunt unit:test or grunt unit:test:watch runs unit tests
  • grunt functional:test runs acceptance tests
  • grunt compile:assets or grunt compile:assets:production compile all assets
  • grunt compile:less:sprites compile your defined less sprites
  • grunt watch watches files for changes you have also the chance to use livereload (LiveReload)
  • grunt show:help some useful links and documentations

Project Directory Structure

+-\components/
+-\javascripts/
  +-\templates/
  +-\vendor/
  +-\app/
    +-\models/
    +-\collections/
    +-\controllers/
    +-\views/
    +-\routers/
    +-\utils/

+-\stylesheets/
+-\test/
  +-\functional/
    +-\Specs/

  +-\unit/
    +-\Helpers/
    +-\Libs/
    +-\Specs/
      +-\App/
        +-\Models/
        +-\Collections/
        +-\Controllers/
        +-\Views/
        +-\Routers/
        +-\Utils/

Templating

  • Handlebars

Changelog

  • Version 0.1.6 26/08/2013 -- hot fixes
  • Version 0.1.5 21/08/2013 -- hot fixes
  • Version 0.1.4 17/08/2013 -- fixed bug with infinite loop on watching
  • Version 0.1.3 12/08/2013 -- adding templates -- adding less support
  • Version 0.1.1 03/08/2013 -- removing unused files
  • Version 0.1.0 08/07/2013 -- cleanup
  • Version 0.0.1 07/07/2013 -- first release

License

MIT License

npm loves you