npm install git+https://github.com/lucentminds/builder-bob.gitmodule.exports = function( bob ) {
const job = bob.createJob( 'build' );
// Do this first.
job.addTask( 'step_1', function(){
return new Promise(( resolve ) => {
console.log( '\nRunning step_1...' );
setTimeout( resolve( 'foo' ), 3000 );
});
});
// Do this second.
job.addTask( 'step_2', function( previous_result, next ){
console.log( `${previous_result} bar` ) // foo bar
return next();
});
// Always return bob. :)
return bob;
};// /exports()Or all at once.
module.exports = function( bob ) {
const job = bob.createJob( 'task' );
job.setTasks([
// Do this first.
{
task: 'empty',
do: function(){
// Create promises here.
},
},
// Do this second.
{
task: 'copy',
do: function(){
// Create promises here.
},
},
]);
// Always return bob. :)
return bob;
};// /exports()For more see the builder-bob wiki.
- Make it so that if a build job is running, it MUST complete before allowing another to run. This is because of file contention issues. So make a combo throttle/debouncer to wait until previous job is complete before allowing the latest request.
- Develop a spiffy CLI for bob.
