Upgrade to Pro — share decks privately, control downloads, hide ads and more …

My Webapp Workflow

My Webapp Workflow

My Webapp Workflow with Yeoman, Grunt and bower.
From Kerala Ruby User Group meetup.

Revath S Kumar

August 11, 2013
Tweet

More Decks by Revath S Kumar

Other Decks in Programming

Transcript

  1. Boiler plate your code / * g l o b

    a l d e f i n e * / d e f i n e ( [ ' u n d e r s c o r e ' , ' b a c k b o n e ' ] , f u n c t i o n ( _ , B a c k b o n e ) { ' u s e s t r i c t ' ; v a r T o d o M o d e l = B a c k b o n e . M o d e l . e x t e n d ( { d e f a u l t s : { } } ) ; r e t u r n T o d o M o d e l ; } ) ;
  2. INSTALL INSTALL YEOMAN $ n p m i n s

    t a l l - g y o USAGE $ y o b a c k b o n e $ y o b a c k b o n e : m o d e l T o d o $ y o b a c k b o n e : c o l l e c t i o n T o d o s $ y o b a c k b o n e : v i e w I n d e x V i e w $ y o b a c k b o n e : r o u t e r T o d o
  3. WHY GRUNT? Task runner based on CLI Alternative to Rake/Cake/Make/Jake

    100+ plugins Lint, test, concat, watch, min etc .... Customize task as you wish!
  4. GRUNTFILE . JS m o d u l e .

    e x p o r t s = f u n c t i o n ( g r u n t ) { g r u n t . i n i t C o n f i g ( { u g l i f y : { d i s t : { f i l e s : { " d i s t / s c r i p t s / a p p . j s " : " a p p / s c r i p t s / * . j s " } } } , c l e a n : [ ' d i s t / * ' ] , } ) ; g r u n t . l o a d N p m T a s k s ( " g r u n t - c o n t r i b - u g l i f y " ) ; g r u n t . l o a d N p m T a s k s ( " g r u n t - c o n t r i b - c l e a n " ) ; g r u n t . r e g i s t e r T a s k ( ' b u i l d ' , [ ' c l e a n ' , ' u g l i f y ' ] ) ; }
  5. TASKS $ g r u n t c l e

    a n $ g r u n t u g l i f y $ g r u n t b u i l d OTHER TASKS l i n t , t e s t , l i v e r e l o a d , c o p y , c o m p i l e t e m p l a t e s
  6. FLOW Create boilerplate code with yo Install dependencies with bower

    Start grunt server Compiles coffeescipt Compiles sass/scss open page in default web browser live reload
  7. grunt lint grunt test grunt build jslint, run tests concat

    and minify your dependencies copy assets to dist dir