adamsilver/jessie — pull request #4 by sjhewitt (2012-05-09 11:13:01+00:00)
Title: Build script implementation

I've implemented a build script that takes a list of functions to include (and optionally the specific renditions) and outputs the concatenated script. It can optionally optimize and minify the script if needed.

It's written using node.js and has the following npm dependencies:

* uglify-js
* cli-table
* simplesets
* commander

It has the following usage:

Usage: jessie [options]

Options:

-h, --help output usage information
-V, --version output the version number
-l, --list Print a list of available functions
-o, --output [file] The file to output to (outputs to stdout by default)
-a, --all Include all Functions and Renditions
--all-renditions Include all renditions of a function if not specified explicitly
-u, --uglify Minify the output using UglifyJS
--mangle Mangle the generated output via UglifyJS
--beautify Output beautified JS
--root [path] the folder that jessie functions are located in
--no-wrap Don't wrap the built file with the header/footer file contents
--header [path] The header file
--footer [path] The footer file
--namespace [name] The name of the global variable to export

It requires that each rendition has a jslint style global variable declaration in the code (ideally at the top of the file.) This is parsed by the builder to determine the dependencies of each rendition.