buildline

scriptable asset builder/pipeline for node compatablie with grunt

npm install buildline
12 downloads in the last week
12 downloads in the last month

NPM version Build Status Coverage Status Dependency Status

Buildline

scriptable asset builder/pipeline for node compatablie with grunt

NOTE: this module is still under heavy ass development

Overview

Buildline allows you to setup an asset compilation system with your existing grunt, have grunt run minification, tests, etc. and compilation, and everything else is handled by buildline

Included Modules

  • SASS Compiler (buildline.scss)
  • LESS Compiler (buildline.less)
  • CoffeeScript Compiler (buildline.coffee)
  • Grunt task helper (buildine.grunt)

How to use it

  1. install npm install -g buildline
  2. install to your project npm install buildline --save-dev
  3. make a new file inside your project called buildfile.js
  4. edit your buildfile to contain the following boilerplate code
var buildline = require('buildline');
var run = buildline.runner();

run('');
  1. the run() function is a function to run any code you place in there basically a safteynet or if you wish to employ some scripting in the build file
  2. example of our SASS task
var buildline = require('buildline');
var run = buildline.runner();
// Tasks
var scss = buildline.scss();
scss(true, './src/styles/scss/*', './output/styles/*');

lets run through this, first off the true. All Buildline tasks (will) have a true/false flag to turn them on or off, for debugging purposes or what not, lets face it, you want grunt to have that. after that its just input and output in that order.

Writing a Compiler/plugin

the basic layout for writing a compiler/module is the following

//run shell script from node
var exec = require('sh');

// Prototype Function for the compiler (we have in core so our modules are more sperated but for a plugin this is ok to have it here)
var AssetsPaths = function(path, action, cb) {
    this.path = path;
    this.action = action;
    return cb;
};

//using the sass source code as an example
var mySasscompiler = function(active, path, output) {
    if (active === true) { //the active falg
        var ACTION = exec('sass ' + path + ' ' + output);
        return new AssetsPath(path, ACTION, function() {
            console.log('Finished SASS Compilation');
        });
    } else{
        console.log("SCSS/SASS Compilation is turned off");
    }
};

module.exports = mySasscompiler

Tests

run tests with npm test or grunt test

npm loves you