...czyli kamerdyner na wezwanie

Tomasz Ducin

12th November 2014, Warsaw

yo coffee!

#147

the butler

Tomek Ducin

JavaScript, Python, Java

senior software engineer @ Hewlett-Packard

blah, blah, blah...

or butler on call

Tomasz Ducin

16th October 2014, Warsaw

yo coffee!

yeoman workflow

previously at warsjawa.pl 2014 under
modern webapp development workflow/tools

agenda

  • motivation
  • yeoman to the resc-yo!
  • friends: npm, bower, grunt
  • yeoman workflow revisited

motivation

  • Find an HTML Boilerplate, add it
  • Find a UI Boilerplate, add it
  • Download project libs, add them
  • Copy boilerplate for models,
    views, setup
  • Setup test runner
  • Setup build process
  • Write Real Code!
  • Manually update dependencies

motivation

brainless

repetitive

work

no more!

housewife manifesto

yeoman demo

yeoman workflow

X ?

benefits of using yeoman

 

an example

yo coffee

my dream

>

Node Package Manager

install npm (along with entire node.js):

[sudo] apt-get install nodejs

install a package globally:

[sudo] npm install -g <package>

or locally:

npm install <package>
npm install <package> --save
npm install <package> --save-dev

initialize package (create package.json manifest file):

npm init

fetch node modules for existing project:

cd my-node-package
npm install

save package in registry:

npm publish

likely to install npm

along with other tools (bower, grunt)

on a CI server!

Bower

install bower tool:

[sudo] npm install -g bower

install bower packages:

bower install <package>
bower install <package> --save
bower install <package> --save-dev

initialize package (create bower.json manifest file):

bower init

register bower package:

bower register <package-name>
    <git-endpoint>

list packages and check for updates:

bower list

install all packages from bower.json:

bower install

dependency conflicts resolved:

Unable to find a suitable version for ember, please choose one:
    1) ember#~1.0.0 which resolved to 1.0.1 and is required by ember-data#0.0.14
    2) ember#1.5.1 which resolved to 1.5.1 and is required by melodrama
"resolutions": {
  "ember": "1.5.1"
}

Grunt

install grunt tool:

[sudo] npm install -g grunt-cli
npm install grunt --save-dev

edit Gruntfile.js (manifest file) manually or using grunt-init:

[sudo] npm install -g grunt-init
# put content into ~/.grunt-init
grunt-init gruntfile

static code analysis:

npm install grunt-contrib-jshint
    --save-dev

Example grunt tasks

minify files (for release):

npm install grunt-contrib-uglify
    --save-dev

background automatic tasks:

npm install grunt-contrib-watch
    --save-dev

other grunt tasks

  • copy
  • concat
  • cssmin
  • sass/compass
  • requirejs
  • compress
  • mocha
  • and many more...

alternatives

Yeoman

install yeoman tool:

[sudo] npm install -g yo

install specific generator:

[sudo] npm install
  -g generator-backbone

run the generator:

mkdir my-yo-project
cd my-yo-project
yo backbone

build entire application:

grunt build

run application in source-mode:

grunt serve

run application in built-mode:

grunt serve:dist

Yeoman workflow criticism

Thank yo!