Skip to content

Instantly share code, notes, and snippets.

@nathanpalmer
Created February 13, 2015 16:02
Show Gist options
  • Save nathanpalmer/2a3e358c8af0a663d8cd to your computer and use it in GitHub Desktop.
Save nathanpalmer/2a3e358c8af0a663d8cd to your computer and use it in GitHub Desktop.
Creating a new ember-cli project using coffeescript, sass and a few dependencies
# First you'll want to make sure to install ember-cli
# Install 0.1.12 explicitely until we make sure the latest is working. I ran into several first-run issues on the newest version.
npm install -g [email protected]
# Then create the initial project. This will create all the basic files you need
# install the npm and bower dependencies and create an initial git commit.
ember new todo
cd todo/
# Now install coffeescript. We use the ember-cli-coffees6 so we don't need
# to use backticks in most cases.
ember install:addon ember-cli-coffees6
# The installation of the addon however doesn't convert the existing files.
# You need to convert app.js and router.js manually
# This is the ghetto version of conversion
cat app/app.js \
| sed -e 's/;//' -e 's/var //' \
> app/app.coffee && rm app/app.js
# For some reason doing this in 1 regex wasn't working but I didn't want to spend
# any time looking into it. So we're left with 4..
cat app/router.js \
| sed -e 's/;//' -e 's/var //' \
| perl -p -e 's/Router.map\(function\(\) \{\n/Router.map(->\n)/m' \
| sed -e 's/)})/)/' \
> app/router.coffee && rm app/router.js
# Add these two lines to config/environment.js to
#
# podModulePrefix: 'todo/pods',
# usePodsByDefault: true,
#
# Right after modulePrefix: 'todo'
# Now install SCSS support
ember install:addon ember-cli-sass && touch app/styles/app.scss
# Now to get the uncharted generators so files show up in the "right" place
ember install:addon ember-cli-uncharted-alternate-pod-structure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment