{"_id":"buildy","_rev":"1673415","name":"buildy","description":"A build framework with chaining syntax","dist-tags":{"latest":"0.0.8"},"maintainers":[{"name":"mosen","email":"mosen1@gmail.com"}],"time":{"modified":"2026-11-04T11:21:30.000Z","created":"2012-02-23T06:23:39.296Z","0.0.8":"2012-05-07T06:50:49.078Z","0.0.7":"2012-04-11T02:02:11.954Z","0.0.6":"2012-03-12T06:19:57.355Z","0.0.5":"2012-02-23T06:23:39.296Z"},"users":{"fgribreau":true},"author":{"name":"mosen","url":"https://github.com/mosen"},"repository":{"type":"git","url":"git://github.com/mosen/buildy.git"},"versions":{"0.0.8":{"name":"buildy","version":"0.0.8","description":"A build framework with chaining syntax","keywords":["build","builder"],"author":{"name":"mosen","url":"https://github.com/mosen"},"main":"./lib/buildy","directories":{"lib":"lib","example":"example"},"repository":{"type":"git","url":"git://github.com/mosen/buildy.git"},"dependencies":{"mkdirp":"0.0.x","jslint":"0.1.x","csslint":"0.9.x","less":"1.2.x","uglify-js":"1.2.x","handlebars":"1.0.x","winston":"0.5.x","mime":"1.2.x"},"devDependencies":{"expresso":"0.9.x","temp":"0.4.x"},"engines":{"node":">=0.6.0"},"preferGlobal":true,"_npmUser":{"name":"mosen","email":"mosen1@gmail.com"},"_id":"buildy@0.0.8","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"43d6f856023b736330e1f6ab61d824d5d1a817ca","tarball":"http://registry-npm.ywwl.com/buildy/download/buildy-0.0.8.tgz","integrity":"sha512-+xWJoWQXJJuxZ1IKJHulsXTUQVHXcXdLeGo1yxxgAzeExtmKWRS1jM7TIS++CjMBJbl0YftO5y0QjEdyD5o/kA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAmaNLLzVhPev5pFo62uHz7hu/l07HQBHf2/lJaDkFFQAiBg27gR3eEZUDlZqat1i2jKOhhhj4OUwbu+yUb5sWTzhQ=="}],"size":78571,"noattachment":false,"key":"/buildy/-/buildy-0.0.8.tgz"},"maintainers":[{"name":"mosen","email":"mosen1@gmail.com"}],"publish_time":1336373449078,"_cnpm_publish_time":1336373449078},"0.0.7":{"name":"buildy","version":"0.0.7","description":"A build framework with chaining syntax","keywords":["build","builder"],"author":{"name":"mosen","url":"https://github.com/mosen"},"main":"./lib/buildy","directories":{"lib":"lib","example":"example"},"repository":{"type":"git","url":"git://github.com/mosen/buildy.git"},"dependencies":{"mkdirp":"0.0.x","jslint":"0.1.x","csslint":"0.9.x","less":"1.2.x","uglify-js":"1.2.x","handlebars":"1.0.x","winston":"0.5.x"},"devDependencies":{"expresso":"0.9.x","temp":"0.4.x"},"preferGlobal":true,"_npmUser":{"name":"mosen","email":"mosen1@gmail.com"},"_id":"buildy@0.0.7","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"4e638e7530811f9a4239c935ed67ee4dc2342aa0","tarball":"http://registry-npm.ywwl.com/buildy/download/buildy-0.0.7.tgz","integrity":"sha512-r7hDSIs1zrJ51RHqQ3tJt4Dw5mRhLO8Lgod1BCGN1k6GkUNAJaJl7oM08tCRHZR6yGoSEEst1uECk/wKtW7uaw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBuBzlxgYsqrA+b97cSgD7g+GrftNUeNr6H2G2DpGc92AiAbVPN/1vhTKEyiGkfK7aliJNSku+zI87IxJr/Dm3qYiA=="}],"size":74021,"noattachment":false,"key":"/buildy/-/buildy-0.0.7.tgz"},"maintainers":[{"name":"mosen","email":"mosen1@gmail.com"}],"publish_time":1334109731954,"_cnpm_publish_time":1334109731954},"0.0.6":{"name":"buildy","version":"0.0.6","description":"A build framework with chaining syntax","keywords":["build","builder"],"author":{"name":"mosen","url":"https://github.com/mosen"},"main":"./lib/buildy","directories":{"lib":"lib","example":"example"},"repository":{"type":"git","url":"git://github.com/mosen/buildy.git"},"dependencies":{"mkdirp":"0.0.x","jslint":"0.1.x","csslint":"0.9.x","less":"1.2.x","uglify-js":"1.2.x","handlebars":"1.0.x","winston":"0.5.x"},"devDependencies":{"expresso":"0.9.x","temp":"0.4.x"},"preferGlobal":true,"_npmUser":{"name":"mosen","email":"mosen1@gmail.com"},"_id":"buildy@0.0.6","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"310fb1ea6f7e34e5356d197d0f4c520b693cc217","tarball":"http://registry-npm.ywwl.com/buildy/download/buildy-0.0.6.tgz","integrity":"sha512-XBiK59uhAE0gYkbhiXqfd1o+tACxRdKrd/e66RVTkAFAH5H1atpM3k9bodBkq/RJ/vNkpDxt3r9d629597OhGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEfZPCuAIOwF2NRdfhLZMpxz/TpFQjPUAM6gbhJtRphEAiAEH4t9mt+b+h8lShDIAnSnaKN0/EnLTpvYgCT1uvAFrQ=="}],"size":35547,"noattachment":false,"key":"/buildy/-/buildy-0.0.6.tgz"},"maintainers":[{"name":"mosen","email":"mosen1@gmail.com"}],"publish_time":1331533197355,"_cnpm_publish_time":1331533197355},"0.0.5":{"name":"buildy","version":"0.0.5","description":"A build framework with chaining syntax","keywords":["build","builder"],"author":{"name":"mosen","url":"https://github.com/mosen"},"main":"./lib/buildy","directories":{"lib":"lib","example":"example"},"repository":{"type":"git","url":"git://github.com/mosen/buildy.git"},"dependencies":{"mkdirp":"0.0.x","jslint":"0.1.x","csslint":"0.9.x","less":"1.2.x","uglify-js":"1.2.x","handlebars":"1.0.x","winston":"0.5.x"},"devDependencies":{"expresso":"0.9.x","temp":"0.4.x"},"preferGlobal":true,"_npmUser":{"name":"mosen","email":"mosen1@gmail.com"},"_id":"buildy@0.0.5","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"79a05585f17a1b73bc954de37025b84480e67cf8","tarball":"http://registry-npm.ywwl.com/buildy/download/buildy-0.0.5.tgz","integrity":"sha512-bPVVNXDKATAuVOYtgcMxhzuNdJ8pkAtgsDIjYv9UemI+nbl/wDrFEPi65HbcuddD/54A6drdAYIHvWiDeoS/bA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRJUez3AN3ZYcQowl4jMfhIf3kLbBwTNpF9JsRKMg5NQIgQ8LWv+UCYQHYha+2WclAfdEMTBSqX/JxADifxeiN37w="}],"size":34678,"noattachment":false,"key":"/buildy/-/buildy-0.0.5.tgz"},"maintainers":[{"name":"mosen","email":"mosen1@gmail.com"}],"publish_time":1329978219296,"_cnpm_publish_time":1329978219296}},"readme":"What\n====\n\nBuildy is a build system for web/javascript/node.js projects.\nIt acts like a sequence of 'piped' commands.\n\nMain features:\n    - relatively brief syntax.\n    - can use asynchronous api where practical.\n    - tasks and task queues can execute in serial or parallel.\n    - extend the built in build tasks with your own tools, or 3rd party tools.\n\n*WARNING: API still in development, and may change without notice until v1.0.0*\n\nBuild things\n============\n\nConcatenate scripts, minify, and write to release directory\n-----------------------------------------------------------\n\n```javascript\nnew Queue('release version')\n    .task('files', ['./js/test1.js', './js/test2.js'])\n    .task('concat')\n    .task('minify')\n    .task('write', { name: './build/test-min.js' })\n    .run();\n```\n\nMake a minified version and a non minified version in parallel using the 'fork' task\n------------------------------------------------------------------------------------\n\n```javascript\nnew Queue('build process')\n    .task('files', ['./js/test1.js', './js/test2.js'])\n    .task('concat')\n    .task('fork', {\n        'raw version' : function() {\n            this.task('write', { name: './build/test.js' }).run();\n        },\n        'minified version' : function() {\n            this.task('minify').task('write', { name: './build/test-min.js' }).run();\n        }\n    }).run();\n```\n\nThe fork task changes the flow of the build from serial to parallel when you need to take a single input and do\na number of independent things with it.\n\nWrite a raw version to the release directory and lint the stylesheets simultaneously\n------------------------------------------------------------------------------------\n\n```javascript\nnew Queue('release version')\n    .task('files', ['./js/test1.js', './js/test2.js'])\n    .task('concat')\n    .task('minify')\n    .task('write', { name: './build/test-min.js' })\n    .run();\n\nnew Queue('lint stylesheets')\n    .task('files', ['./css/test1.css', './css/test2.css'])\n    .task('csslint')\n    .run();\n```\n\nYou can have as many queues as you like. They will run independently and in parallel. This is the best situation for\ntwo or more build processes that have nothing to do with each other.\n\nHow it works\n============\n\n- Construct a `Queue` object with a name (for the logger output).\n- Add a chain of tasks to the `Queue` using the `.task(name, options)` method. The input of each task is the output of\nthe previous one. Some tasks, like `files`, generate output.\n- At the end of the `Queue` chain, call the `.run()` method. The `Queue` will then be automatically run as soon as node\nexecutes the queue file.\n\nFlow Control\n------------\n\nThe `fork` task splits the queue into sub-queues. These are run in parallel.\n\nEach time you add a fork task, it becomes a new Queue with the name specified ('raw version' \nin the last example). The new queue inherits its state from the parent, but acts independently from then on.\n\n\nBuilt in tasks\n==============\n\nThe built in tasks are as follows:\n\n`concat`\n\nConcatenate the input from the previous task.\n\n***\n\n`csslint` (async)\n\nCSSLint the input (Note: doesn't try to detect if you are actually supplying CSS).\n\n***\n\n`cssminify`\n\nReformat/Minify the CSS using Less.js (Also doesn't attempt to detect if you are supplying CSS).\n\n***\n\n`files`\n\nGenerate a files list, commonly used as the start of a queue.\n\n***\n\n`fork`\n\nSplit the build process into two or more parallel build processes.\n\nThe fork function takes a hash of new child queue name to function.\n\nThe function is executed in the context of the queue, so you may use this.task() to continue\nadding tasks to the child queue.\n\n*Known limitation* : you cannot chain to the end of a fork task (as in, going from parallel tasks back to serial).\n\n***\n\n`inspect`\n\nLog the output of the previous task.\n\n***\n\n`jslint` (async)\n\nJSLint the input.\n\n***\n\n`minify`\n\nMinify the input using uglify-js.\n\n***\n\n`replace`\n\nApply a regular expression to replace strings in the input.\n\n***\n\n`template`\n\nApply a handlebars template to the input.\n\n***\n\n`write`\n\nWrite the input to the specified file name.\n\nKnown bugs\n----------\n\nThe globbing module doesn't interpret relative paths using . or ..\n\nCustom tasks\n============\n\nIf you need to add to the available tasks (because a 3rd party tool isn't listed in the built in tasks, for example),\nyou can write your own tasks to be loaded before queues are executed.\n\n*WARNING: API Still in development, may change*\n\nBasic guidelines\n----------------\n\nTake a look at some of the built in tasks (in ./lib/tasks) to see how a custom task should be structured.\n\n* Each task has its own source file, but you can publish many tasks in one file if you like.\n* The task file must export a property called `tasks`, which is an object.\n* The `tasks` object contains a property name, which the user supplies when invoking the task, and a function.\n* The task function is called with options, and an event emitter. The queue expects you to emit `complete` or `failed`\nfrom the emitter, to let it know the result of your asynchronous (or synchronous) task.\n\nHello.js - a custom task example\n--------------------------------\n\nhello.js\n\n```javascript\nvar State = require('buildy/lib/state'); // Required to use State.TYPES.*, see switch statement later...\n\nfunction hello() {\n    return 'hello world';\n}\n\nfunction helloHandler(options, promise) {\n    switch (this._state.get().type) { /* What type of input are we handling? we should handle every pseudo constant in\n                                         State.TYPES.* */\n\n        case State.TYPES.STRING:\n            var myStringValue = hello(), // Call another function to handle the functionality of the task\n                myStatusMessage = 'Set new value to ' + myStringValue;\n\n            this._state.set(State.TYPES.STRING, myStringValue); // We set a new value 'hello world' of type string\n            promise.emit('complete', 'hello', myStatusMessage); // Tell the queue we are done successfully\n\n            break;\n\n        case State.TYPES.STRINGS:\n            // Iterate through strings\n            // Set all of them to 'hello world'\n            // Set the new state value from that array\n            break;\n\n        case State.TYPES.FILES:\n            // Behaviour is up to you...\n            break;\n\n        default:\n            promise.emit('failed', 'hello', 'Unrecognized input type: ' + this._state.get().type);\n\n    }\n}\n\nexports.tasks = {\n    'hello' : helloHandler\n}\n```\n\nThis task is now registered as the `hello` task. We can use it now as a part of our build process, like so:\n\ntestqueue.js\n\n```javascript\nvar Registry = require('buildy/lib/registry'),\n    Queue = require('buildy/lib/queue').Queue,\n    customRegistry, testq;\n\ncustomRegistry.add('/path/to/tasks/hello.js'); // Add the custom task OR\n// customRegistry.load('/path/to/tasks/directory'); // Load *.js from this directory\n\ntestq = new Queue('Testing queue', { registry: customRegistry }); // Set up a new queue with custom registry.\n\ntestq.task('hello'); // The current state will be set to 'hello world'\ntestq.write({ dest: './hello.txt' }) // The string will be written out to a file, ./hello.txt\ntestq.run(); // Run the task chain, the hello.txt file is created.\n```\n\nTODO\n====\n\n* Separate task logging from the status object.\n* Clarify the custom task autoloading method.\n* 100% test coverage of each task.\n* Standardise an option for producing .json formatted reports from tasks that produce that kind of output. (probably use\nwinston metadata/custom transports).\n* Determine a strategy for dealing with tasks that operate on a batch of files where the output is also files. Use\ndestination dir, file prefix, file suffix options.\n* Establish a defaults system, so that a task option can be defaulted for the entire queue or set of queues.\n* Files that are cast into strings should retain filename throughout the process, so that they may be written out based upon the original name.\n* Dont use an inspect task in the unit tests, the unit test might expose a problem with inspect instead of the subject.\n\nnon piped file output should take these options:\n{ dir: '/output/directory', prefix: 'prepended-to-filename', suffix: 'appended-to-filename' }\nthis is to handle a multiple-string or multiple-file operation","_attachments":{}}