Ember.js boilerplate using Broccoli
Read the introductory post.
Initially used internally by us. Feel free to fork and adapt it. Send pull requests if something is broken or one of the features is missing.
Development
You will need Node.js installed first.
We use nvm
to get Node up and running.
Once set, follow the installation steps:
$ npm install -g bower
$ npm install -g broccoli-cli
$ npm install -g testem
$ npm install
Use bower.json
to manage third-party dependencies.
Conventions
- app - is where the Ember app lives
- bower.json
- Broccolifile.js - the build tool configuration
- config - configuration files and environment specific settings go here
- package.json - node dependencies
- public - static files folder, put images & such here
- readme.md - this file
- stylesheets - stylesheets folder, less/css goes here
- vendor - external libraries, also used by bower to cache files
Inside the app
folder, you will find an idiomatic Ember application structure.
Use JavaScript ES6 syntax and CoffeeScript to write JavaScript.
Use Sass to write CSS. The default compiler used is the node-sass variant. If you prefer to use the latest Sass version you will need to replace broccoli-sass
with broccoli-ruby-sass
in the Brocfile.js and package.json.
The application has Twitter Bootstrap framework bundled. Make sure you make use of provided widgets and UI components as much as possible.
Usage
Broccoli is our build tool. To run the development server use:
$ broccoli serve
To build a release, use:
$ rm -rf dist
$ BROCCOLI_ENV=production broccoli build ./dist
Testing
We are using QUnit to write tests. Improved Ember.js testing support is provided through ember-qunit package.
To run the tests change the environment to test
and run broccoli
:
$ BROCCOLI_ENV=test broccoli serve
Open the browser, QUnit runner should start on its own.
From the command line you can run the tests using the broccoli-testem plugin:
$ npm install -g iMedicare/broccoli-testem
$ BROCCOLI_ENV=test broccoli-testem
TODO
- Deployments
- Localization
- Improved environments support
Thanks
- iMedicare for sponsoring the initial version.