Betabeers

Noviembre 2014

require('build');

 

About

Drupal e integración continua

 

Desarrollo de juegos en html5

 

Los gruñidos de mi build

QUÉ ES?

Un proceso

Automatizado

Que genera un entregable

necesario para la integración continua

y facilita la entrada de nuevos miembros al equipo

PREPARE

COMPILE

UNIT TEST

PACKAGE

INTEGRATION TEST

VERIFY

npm install 

bower install

sass less coffee

karma mocha qunit jasmine

zip nar min

pioneer selenium phantomJS

jslint jshint coverage

#!/bin/sh
 
grunt test
 
exit $?

Pre-commit

TOOLS

 

Task oriented

 

Product oriented

Ant

Grunt 

Gulp*

      MsBuild ..

Maven

Make

Rake*

grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'browserify',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'cssmin',
    'uglify',
    'copy:dist',
    'modernizr',
    'usemin',
    'htmlmin'
  ]);

Evolve Your

BUILD & Deployment System Incrementally

python -m SimpleHTTPServer
UGLIFYJS = ./node_modules/.bin/uglifyjs
BANNER = "/*! Backbone Validater - MIT License - https://github.com/rafinskipg/Backbone.Validater */"
KARMA = ./node_modules/karma/bin/karma

default:	test

test:	karma build

karma:
	$(KARMA) start

build:
	$(UGLIFYJS) app/main.js --mangle --preamble $(BANNER) > dist/Backbone.Validater.min.js

loc:
	wc -l app/main.js

publish: test build
	git push --tags origin HEAD:master

BE EFFECTIVE

TAKE CARE OF YOUR BUILD

Los gruñidos de mi build

REQUIRE

CommonJS

'use strict';

var jquery = require('jquery');

function doSomething(){
  console.log('Hey BBMad!');
}

module.exports = doSomething

AMD

define(['jquery'], function ($) {
    //    methods
    function doSomething(){
        console.log('Hey BBMad!');
    };

    //    exposed public methods
    return doSomething;
});

UMD

(function (root, factory) {
    if (typeof define === "function" && define.amd) {
        define(["jquery"], factory);
    } else if (typeof exports === "object") {
        module.exports = factory(require("jquery")));
    } else {
        root.Requester = factory(root.$);
    }
}(this, function ($) {
    var doSomething = function(){
        console.log('Hey BBMad!');
    }

    return doSomething;
}));

THERE'S A GRUNT PLUGIN FOR THAT

CODE TIME

https://github.com/rafinskipg/talkbetabeersnov
language: node_js
node_js:
  - "0.10"
before_install: 
  - npm install -g grunt-cli
  - npm install -g bower
install: 
  - npm install
  - bower install

SOMOS MÁS EFECTIVOS?

@rafinskipg

rvpg.me

Referencias

 

  • BROWSERIFY
  • Brunch http://brunch.io/
  • Gulp http://gulpjs.com/
  • Grunt http://gruntjs.com/
  • Bower http://bower.io/
  • Yeoman http://yeoman.io/
  • Lineman http://linemanjs.com/
  • Grunt usemin https://github.com/yeoman/grunt-usemin
  • Karma http://karma-runner.github.io/
  • NAR https://github.com/h2non/nar
  • VINYL FS https://github.com/wearefractal/vinyl-fs
  • MAKE "the ultimate front end build tool" https://algorithms.rdio.com/post/make/

Los require de mi build

By rafinskipg

Los require de mi build

  • 1,296