Maintainer: Anthony Bull
The scaffolding tool for Ember.js apps.
- npm
npm install -g yo grunt-cli bower
npm install -g grunt-contrib-compass
- Ruby
You should have one path each for:
which ruby && which compass
npm install -g generator-ember
mkdir webapp && cd webapp
yo ember
npm install -g grunt-mocha
grunt server
A welcome page should appear in your browser.
Available generators:
- ember
- ember:view
- ember:controller
- ember:model
Creates the basic infrastructure for your app.
Creates a view and template given an arg, as in
yo ember:view Foo
KNOWN ISSUE: IF YOU ADD A NEW VIEW, REGARDLESS OF WITH WHICH GENERATOR, YOU HAVE TO RESTART THE SERVER.
Creates a view, handlebar, controller and route given an arg, as in:
yo ember:controller Bar
(and updates router.js, overwrite when prompted)
see: http://localhost:9000/#/bar
Creates a model, view, handlebar, controller, and route given an arg, as in:
yo ember:model Baz name:string postal_code:number
see http://localhost:9000/#/baz
-
--skip-install
Skips the automatic execution of
bower
andnpm
after scaffolding has finished. -
--test-framework=[framework]
Defaults to
mocha
. Can be switched for another supported testing framework likejasmine
. -
--coffee
Enable support for CoffeeScript.
-
--karma
Enables support for karma test runner
Testing your app is as simple as running grunt test
. The generator ships with the
karma test runner for running the tests. Integration
tests are written with ember-testing
and preferably mocha. Karma is highly configurable and you can take a look at the varity of options
on its website.
Manifests as: -bash: yo: command not found
You need to make sure that npm is on your path. Add the following to your .bash_profile (or .bashrc):
PATH=/usr/local/share/npm/bin:$PATH
Manifests as: You specified the templateName ... but it did not exist.
You probably added a view; restart the server.
- abandon dependencies changes; not working
- change dependencies for npm
- more dependency-moving out of readme
- moving dependencies out of readme
- new look!
- tests!
- Fixed #79 (srsly considering dropping CoffeeScript support for now)
- Re-introduced @fayimora's testing improvement; now working with
grunt test
- documentation updates
- Added basic scaffolding
- By default, include Ember Data
- Reverted changes for testing improvement
- Added testing improvement
- Upgraded to RC6
- Upgraded to grunt-contrib-compass 0.3.0
- Added install step to address PhantomJS issue
- Upgraded to Ember 1.0 RC5
- Support for scaffolding out CoffeeScript via
--coffee
- Support for jasmine as alternative test framework via
--test-framework
- Automatic script inclusions via
grunt-neuter
- New prompt
- Change tests to instantiate and test objects instead of grepping for text
- DRY up/refactor tests
- Consider ES6 as base structure
- Remove Ruby dependency
See the contributing docs
When submitting an issue, please follow the guidelines. Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.
When submitting a bugfix, write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix.
When submitting a new feature, add tests that cover the feature.
Here are some of the techniques I use; maybe they're useful for you.
When developing...
- in generator-ember dir,
npm link
to use what's in the local repo foryo ember
- wipe the example webapp dir clean (
cd .. && rm -rf webapp
) from time-to-time to ensure the code output is coming from the latest generator (will re-install everything via npm, so be forewarned)
- Originally inspired by the Ember Starter Kit
- Taking influence from ember_data_example