On Github lyzadanger / workflow-2014
Made by Lyza Danger Gardner / @lyzadanger
Grunt for People Who Think Things Like Grunt are Weird and Hard
by Chris Coyier
This actually installs the grunt CLI, not grunt itself.
$ npm install -g grunt-cli
Possibly not...
$ \curl -sSL https://get.rvm.io | bash -s stable —ruby
One liner: Installs RVM, installs stable ruby
$ npm install -g grunt-cliInstall ruby via a ruby version manager if you need to:
$ \curl -sSL https://get.rvm.io | bash -s stable —ruby
The contributors to reveal.js defined grunt tasksto take care of all of these workflow components.
A good workflow brings joy to your team by emphasizing the "yay" moments and de-emphasizing the misery
$ git clone git@github.com:hakimel/reveal.js.git
$ git clone git@github.com:hakimel/reveal.js.git $ cd reveal.js
$ git clone git@github.com:hakimel/reveal.js.git $ cd reveal.js $ npm install
$ git clone git@github.com:hakimel/reveal.js.git $ cd reveal.js $ npm install $ grunt [task]
$ grunt serve
defaulttask on change
$ grunt [task]What did the creators of the grunt workflow for reveal.js do to get to the point where `$grunt [task]` executed tasks relevant to the project?
// Default task grunt.registerTask('default', ['jshint', 'cssmin', 'uglify', 'qunit']); // Theme task grunt.registerTask('themes', ['sass']); // Package presentation to archive grunt.registerTask('package', [ 'default', 'zip']); // Serve presentation locally grunt.registerTask('serve', ['connect', 'watch'] ); // Run tests grunt.registerTask('test',[ 'jshint', 'qunit']);
gruntfile.js
watch: { main: { files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ], tasks: 'default' }, theme: { files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ], tasks: 'themes' } }
gruntfile.jsSee grunt-contrib-watch documentation
grunt.loadNpmTasks( 'grunt-contrib-qunit' ); grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); grunt.loadNpmTasks( 'grunt-contrib-uglify' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); grunt.loadNpmTasks( 'grunt-contrib-sass' ); grunt.loadNpmTasks( 'grunt-contrib-connect' ); grunt.loadNpmTasks( 'grunt-zip' );
gruntfile.js
devDependenciesfor grunt
$ npm install
{ "name": "reveal.js", "version": "2.6.1", "description": "The HTML Presentation Framework", "homepage": "http://lab.hakim.se/reveal-js", "subdomain": "revealjs", "devDependencies": { "grunt-contrib-qunit": "~0.2.2", "grunt-contrib-jshint": "~0.6.4", "grunt-contrib-cssmin": "~0.4.1", "grunt-contrib-uglify": "~0.2.4", "grunt-contrib-watch": "~0.5.3", "grunt-contrib-sass": "~0.5.0", "grunt-contrib-connect": "~0.4.1", "grunt-zip": "~0.7.0", "grunt": "~0.4.0" } }
package.json
Designed with Reveal.js with lovely help from @tylersticka on the Cloud Four theme. Most photos are my own, with the exceptions of photos of me (taken by immediate family or friends) and photos of Cloud Four staff, taken by Lisa Teso.
Read the A List Apart column that inspired this talk at http://alistapart.com/column/workflow-orchestration-for-the-wary