|
| 1 | +# Brunch with Ember Reloaded |
| 2 | + |
| 3 | +A [Brunch](http://brunch.io) skeleton for creating ambitious web applications using [Ember.js](http://emberjs.com). Based on the official Ember [Starter Kit](https://github.com/emberjs/starter-kit/archive/master.zip). |
| 4 | + |
| 5 | +## Demo |
| 6 | + |
| 7 | +I built a demo app using this skeleton, based on the [Building an App with Ember.js](http://www.youtube.com/watch?v=Ga99hMi7wfY) video by [Tom Dale](http://twitter.com/tomdale). |
| 8 | + |
| 9 | +**Demo**: [ember-bloggr](http://dev.gcollazo.com/ember-bloggr) |
| 10 | + |
| 11 | +**Source**: [https://github.com/gcollazo/ember-bloggr](https://github.com/gcollazo/ember-bloggr) |
| 12 | + |
| 13 | +## Versions |
| 14 | +- [Ember 1.2.1+pre.ce3a6b7c](http://emberjs.com) |
| 15 | +- [Ember Data 1.0.0-beta.4+canary.0e124357](https://github.com/emberjs/data) |
| 16 | +- [Handlebars 1.1.2](http://handlebarsjs.com) |
| 17 | +- [jQuery v2.0.3](http://jquery.com) |
| 18 | +- [HTML5 Boilerplate v4.3.0](http://html5boilerplate.com) |
| 19 | + |
| 20 | +## Other versions of this skeleton |
| 21 | + |
| 22 | +- [ES6](https://github.com/gcollazo/brunch-with-ember-reloaded/tree/es6): Experimental version using ES6 module syntax. |
| 23 | +- [CoffeeScript](https://github.com/gcollazo/brunch-with-ember-reloaded/tree/coffeescript) |
| 24 | + |
| 25 | + |
| 26 | +## Getting started |
| 27 | + |
| 28 | +Before using brunch-with-ember-reloaded you will need to install [Brunch](http://brunch.io/). |
| 29 | + |
| 30 | +``` |
| 31 | +brunch new gh:gcollazo/brunch-with-ember-reloaded <appname> |
| 32 | +cd <appname> |
| 33 | +brunch watch -s |
| 34 | +``` |
| 35 | +Open [http://localhost:3333](http://localhost:3333) on your browser. |
| 36 | + |
| 37 | +## Generators |
| 38 | + |
| 39 | +This skeleton makes use of [scaffolt](https://github.com/paulmillr/scaffolt#readme) generators to help you create common files quicker. To use first install scaffolt globally with `npm install -g scaffolt`. Then you can use the following command to generate files. |
| 40 | + |
| 41 | +``` |
| 42 | +scaffolt model <name> → app/models/Name.js |
| 43 | +scaffolt view <name> → app/views/NameView.js |
| 44 | +scaffolt controller <name> → app/controllers/NameController.js |
| 45 | +scaffolt arraycontroller <name> → app/controllers/NamesController.js |
| 46 | +scaffolt route <name> → app/routes/NameRoute.js |
| 47 | +scaffolt template <name> → app/templatesname.hbs |
| 48 | +scaffolt component <name> → app/components/NameComponent.js |
| 49 | + app/templates/components/name.hbs |
| 50 | +``` |
| 51 | + |
| 52 | +There are more commands you can do with scaffolt and also instruction on how to create your own generators, so make sure you check out the [docs](https://github.com/paulmillr/scaffolt#readme). |
| 53 | + |
| 54 | +## Testing |
| 55 | + |
| 56 | +To run you will need [Karma](https://github.com/karma-runner) you will need to install [phantomjs](https://github.com/ariya/phantomjs). If you want to run your tests on other browsers consult the Karma docs. |
| 57 | + |
| 58 | +``` |
| 59 | +brew update && brew install phantomjs |
| 60 | +``` |
| 61 | + |
| 62 | +To run tests continiously as you write code and tests (for now) you must open two terminal windows. |
| 63 | + |
| 64 | +``` |
| 65 | +brunch watch -s |
| 66 | +``` |
| 67 | + |
| 68 | +``` |
| 69 | +karma start |
| 70 | +``` |
| 71 | + |
| 72 | +## Building for production |
| 73 | +This skeleton supports the production versions of ember and ember-data. Just build using the --production flags. |
| 74 | + |
| 75 | +``` |
| 76 | +brunch build --production |
| 77 | +``` |
| 78 | + |
| 79 | +You can also have modules load only when you are on a specific environment (production / development). Just add the modules you want loaded to the corresponging subdirectory of the `envs` top level directory. All modules will be imported by the module `'config/env'`. |
| 80 | + |
| 81 | +```js |
| 82 | +var myEnvVars = require('config/env'); |
| 83 | +myEnvVars.envFileName.property; |
| 84 | +``` |
| 85 | + |
| 86 | + |
| 87 | +## Updating Ember |
| 88 | + |
| 89 | +To updated ember.js, ember-data.js and handlebars.js to the latest stable versions, just run this command on the project root. |
| 90 | + |
| 91 | +``` |
| 92 | +npm run update:ember |
| 93 | +``` |
| 94 | + |
| 95 | +## Updating Skeleton |
| 96 | + |
| 97 | +This command will replace `package.json`, `README.md`, `config.js`, `karma.conf.js` and the `generators` directory with the latest version from the GitHub repository. |
| 98 | + |
| 99 | +``` |
| 100 | +npm run update:skeleton |
| 101 | +npm install |
| 102 | +``` |
| 103 | +If you want to update an older version of the skeleton which doesn't have support for the update:skeleton command you can get the `setup.js` by running: |
| 104 | + |
| 105 | +``` |
| 106 | +curl https://raw.github.com/gcollazo/brunch-with-ember-reloaded/master/setup.js > setup.js |
| 107 | +node setup.js update:skeleton |
| 108 | +``` |
| 109 | + |
| 110 | +## License |
| 111 | + |
| 112 | +All of brunch-with-ember-reloaded is licensed under the MIT license. |
| 113 | + |
| 114 | +Copyright (c) 2013 Giovanni Collazo |
| 115 | + |
| 116 | +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
| 117 | + |
| 118 | +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
| 119 | + |
| 120 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
0 commit comments