- Install Node 0.10.0 or later and NPM (by installing Node.js).
- Install Yeoman, Grunt and Bower:
(sudo) npm install -g yo grunt-cli bower
- Install Phantom.js (used for tests):
brew update && brew install phantomjs
- Install Ruby via RVM (used for converting SCSS into CSS) and bundler
gem install bundler
- Clone this Git repository.
cd eugenia-live
- Install client-side dependencies (e.g. Spine, Paper):
bower install --save
- Install development dependencies:
npm install
(Node) andbundle install
(Ruby)
Grunt, the Javascript build library, is responsible for compilation of our Coffeescript, launching a development server, running the tests, etc.
- Run
grunt server
- Edit the source files (in
app/scripts
) - When you save your changes, the server will automatically reload the app
- Edit the unit tests (in
test/spec
) - Run
grunt test
- The results will be reported on the console.
- Edit the acceptance tests (in
features
) - Run
bundle exec cucumber
- The results will be reported on the console.
-
Identify the component in bower's repository
-
Run
bower install <component> --save
-
Edit
app/scripts/main.coffee
to load the new component. You will need to add a path, and possible a shim. See the require.js documentation for more information. -
In any other .coffee file, require your new component using the normal require.js syntax:
define [ 'component' ], (Component) -> // use your component, e.g. new Component()
-
Identify the package in NPM's repository. Typically this will be a grunt extension, such as
grunt-symlink
-
Run
npm install <package> --save-dev
-
Add a task to the
Gruntfile.js
that uses your new package:symlink: { bower: { dest: '.tmp/bower_components', relativeSrc: '../app/bower_components', options: {type: 'dir'} }, jasmine: { dest: '.tmp/.grunt', relativeSrc: '../.grunt', options: {type: 'dir'} } }
Follow these steps once to setup your local working copy ready for deployment:
- Run the heroku generator
yo heroku
. Select "Yes" when asked whether you'd like a new Git repository in thedist
directory. - Run
grunt build
. - Add the heroku repository as a remote:
cd dist
thenheroku git:remote --app eugenialive
After following the setup instructions above, just:
- Run
grunt build
cd dist
git push heroku -f
Important: Don't run the git push
command from the root directory for the app!