Skip to content

Instantly share code, notes, and snippets.

@dustintheweb
Last active August 29, 2015 14:03
Show Gist options
  • Save dustintheweb/43df42ad08f1010f52b6 to your computer and use it in GitHub Desktop.
Save dustintheweb/43df42ad08f1010f52b6 to your computer and use it in GitHub Desktop.
Guide: OSX Grunt Setup & Basic Workflow
## First Run:
-----------------------
/// Add Project Dependencies
Homebrew
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Success?
$ brew -v
RVM
-- stuff here later
nodeJS
$ brew install node
Success?
$ node -v
Grunt
$ sudo npm install -g grunt-cli
Success?
$ grunt -v
*you'll get an error, but CLI will have a version number
Yeoman (if init'ing)
$ npm install -g yo
Success?
$ yo -v
PHP?
php-cgi
Installed?
$ which php-cgi
No? Here's how:
$ brew tap homebrew/dupes
$ brew tap josegonzalez/homebrew-php
$ brew install php54
## Per Project:
-----------------------
/// Update Dependencies
Homebrew
$ brew update
$ brew upgrade
$ brew cleanup
$ brew doctor
npm
$ npm update -g npm
npm global packages
npm outdated -g --depth=0
- if found, npm install -g <packageName>
*To see installed packages:* $ npm list -g --depth=0
ruby gems
*To see installed gems:* `$ gem list`
*To see availabe ruby builds* `$ rvm list known`
RVM
$ rvm get stable
$ rvm install ruby-head
$ rvm --default ruby-head
$ rvm all do gem update
$ sudo gem cleanup
$ gem install bundler
$ bundle install (per project as needed)
sass
$ gem update sass
- if not installed: $ sudo gem install sass
compass (if needed)
$ gem update compass
- if not installed: $ sudo gem install compass
/// Include + Update Config Files
Add the following to the root of the project // defaults are available in prev projects or examples
- package.json
- Gruntfile.js
package.json
- open in an editor and update all the content above "devDependencies"
Gruntfile.js
- manipulate as needed on a per project basis
/// Install & Update Node Packages
If fresh install:
update yeoman
$ npm install -g yo
Search https://www.npmjs.com for the package you want to instal & follow instructions
add whatever new packages you want to use on your project
Adding new modules
when installing new modules to use via grunt, use the following command to both install and auto
add to package.json at the same time:
$ npm install moduleName --save-dev
and the reverse
$ npm uninstall moduleName --save-dev
If from a templated / past project file, update packages
$ npm install -g npm-check-updates
$ npm-check-updates -u
$ npm install
- *you can use npm outdated to see what modules are outdated
*** see full list of npm commands
$ npm help
/// Install & Update Bower Packages
If fresh, install whatever new packages you want to use on your project
if you don't already have a bower.json file, this first
$ bower init
If from a templated / past project file, update packages
$ bower update
*** see full list of Bower commands
$ bower help
http://bower.io/docs/api/
## Bi-Monthly Development:
-----------------------
/// Update Homebrew & npm
instructions above
/// Update Yeoman
instructions above
/// Update Node Packages
instructions above
/// Update Bower Packages
instructions above
## Daily Development:
-----------------------
/// Run default Grunt tasks
$ grunt
/// Run Grunt build tasks
$ grunt build
/// Run specific Grunt tasks
$ grunt someTask
* task name specified within the gruntfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment