Created
August 27, 2012 23:33
-
-
Save ottomata/3493383 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r /tmp/connect-compiler/compiler.co node_modules/connect-compiler/compiler.co | |
563a564,600 | |
> class exports.HandlebarsCompiler extends Compiler | |
> id : 'handlebars' | |
> match : /\.html?$/i | |
> ext : '.handlebars' | |
> module : 'handlebars' | |
> options : (opts={}) -> { filename:@info.src, data:{} } <<< opts | |
> -> super ... | |
> | |
> compileSync: (text, options={}) -> | |
> template = @module.compile text, options | |
> template(options.data or {}) | |
> | |
> | |
> class exports.HandlebarsBrowserPrecompiler extends Compiler | |
> id : 'handlebars-browser' | |
> match : /\.handlebars(?:\.mod)?(\.min)?\.js$/i | |
> ext : '.handlebars' | |
> destExt : '.handlebars.js' | |
> module : 'handlebars' | |
> options : (opts={}) -> { filename:@info.src } <<< opts | |
> -> super ... | |
> | |
> compileSync: (text, options={}) -> | |
> template_fn = @module.precompile text, options | |
> # Convert "anonymous" named function statement to function expression | |
> template = String template_fn .replace /^function anonymous\(/, 'function \(' | |
> | |
> """ | |
> var template = #template; | |
> if (typeof module != 'undefined') { | |
> module.exports = exports = template; | |
> } | |
> """ | |
> | |
> | |
> | |
> | |
655a693,694 | |
> HandlebarsCompiler | |
> HandlebarsBrowserPrecompiler | |
diff -r /tmp/connect-compiler/compiler.js node_modules/connect-compiler/compiler.js | |
1c1 | |
< var fs, path, parse, EventEmitter, exec, spawn, Seq, setup, exports, compilers, DEFAULTS, LOG, CompilerMiddleware, register, Compiler, ExternalCompiler, CoffeeScriptCompiler, SnocketsCompiler, CocoCompiler, UglifyCompiler, JadeCompiler, JadeBrowserPrecompiler, StylusCompiler, LessCompiler, SassCompiler, SassRubyCompiler, JisonCompiler, YamlCompiler, helpers, expand, extrema, commonPrefix, commonPath, mkdirp, __ref, __slice = [].slice; | |
--- | |
> var fs, path, parse, EventEmitter, exec, spawn, Seq, setup, exports, compilers, DEFAULTS, LOG, CompilerMiddleware, register, Compiler, ExternalCompiler, CoffeeScriptCompiler, SnocketsCompiler, CocoCompiler, UglifyCompiler, JadeCompiler, JadeBrowserPrecompiler, HandlebarsCompiler, HandlebarsBrowserPrecompiler, StylusCompiler, LessCompiler, SassCompiler, SassRubyCompiler, JisonCompiler, YamlCompiler, helpers, expand, extrema, commonPrefix, commonPath, mkdirp, __ref, __slice = [].slice; | |
405c405 | |
< args = [text].concat(opts != null | |
--- | |
> args = [text] + (opts != null | |
412c412 | |
< return fn.apply(this, __slice.call(args).concat([cb])); | |
--- | |
> return fn.apply(this, args + [cb]); | |
684a685,735 | |
> exports.HandlebarsCompiler = HandlebarsCompiler = (function(superclass){ | |
> HandlebarsCompiler.displayName = 'HandlebarsCompiler'; | |
> var prototype = __extend(HandlebarsCompiler, superclass).prototype, constructor = HandlebarsCompiler; | |
> prototype.id = 'handlebars'; | |
> prototype.match = /\.html?$/i; | |
> prototype.ext = '.handlebars'; | |
> prototype.module = 'handlebars'; | |
> prototype.options = function(opts){ | |
> opts == null && (opts = {}); | |
> return __import({ | |
> filename: this.info.src, | |
> data: {} | |
> }, opts); | |
> }; | |
> function HandlebarsCompiler(){ | |
> superclass.apply(this, arguments); | |
> } | |
> prototype.compileSync = function(text, options){ | |
> var template; | |
> options == null && (options = {}); | |
> template = this.module.compile(text, options); | |
> return template(options.data || {}); | |
> }; | |
> return HandlebarsCompiler; | |
> }(Compiler)); | |
> exports.HandlebarsBrowserPrecompiler = HandlebarsBrowserPrecompiler = (function(superclass){ | |
> HandlebarsBrowserPrecompiler.displayName = 'HandlebarsBrowserPrecompiler'; | |
> var prototype = __extend(HandlebarsBrowserPrecompiler, superclass).prototype, constructor = HandlebarsBrowserPrecompiler; | |
> prototype.id = 'handlebars-browser'; | |
> prototype.match = /\.handlebars(?:\.mod)?(\.min)?\.js$/i; | |
> prototype.ext = '.handlebars'; | |
> prototype.destExt = '.handlebars.js'; | |
> prototype.module = 'handlebars'; | |
> prototype.options = function(opts){ | |
> opts == null && (opts = {}); | |
> return __import({ | |
> filename: this.info.src | |
> }, opts); | |
> }; | |
> function HandlebarsBrowserPrecompiler(){ | |
> superclass.apply(this, arguments); | |
> } | |
> prototype.compileSync = function(text, options){ | |
> var template_fn, template; | |
> options == null && (options = {}); | |
> template_fn = this.module.precompile(text, options); | |
> template = String(template_fn).replace(/^function anonymous\(/, 'function ('); | |
> return "var template = " + template + ";\nif (typeof module != 'undefined') {\n module.exports = exports = template;\n}"; | |
> }; | |
> return HandlebarsBrowserPrecompiler; | |
> }(Compiler)); | |
794c845 | |
< [CoffeeScriptCompiler, CocoCompiler, UglifyCompiler, JadeCompiler, JadeBrowserPrecompiler, StylusCompiler, LessCompiler, SassCompiler, JisonCompiler, SassRubyCompiler, YamlCompiler, SnocketsCompiler].map(register); | |
--- | |
> [CoffeeScriptCompiler, CocoCompiler, UglifyCompiler, JadeCompiler, JadeBrowserPrecompiler, HandlebarsCompiler, HandlebarsBrowserPrecompiler, StylusCompiler, LessCompiler, SassCompiler, JisonCompiler, SassRubyCompiler, YamlCompiler, SnocketsCompiler].map(register); | |
907c958 | |
< } | |
\ No newline at end of file | |
--- | |
> } | |
diff -r /tmp/connect-compiler/node_modules/seq/package.json node_modules/connect-compiler/node_modules/seq/package.json | |
45c45 | |
< "shasum": "3aa70fa59659aed1220608b2def33b671a070bc1" | |
--- | |
> "shasum": "e1fa8ecdad61e252b5ded19ef6347ba613163140" | |
diff -r /tmp/connect-compiler/package.co node_modules/connect-compiler/package.co | |
2c2 | |
< version : '0.1.2' | |
--- | |
> version : '0.1.3' | |
16a17 | |
> 'handlebars' : '>= 1.0.0' | |
diff -r /tmp/connect-compiler/package.json node_modules/connect-compiler/package.json | |
3c3 | |
< "version": "0.1.2", | |
--- | |
> "version": "0.1.3", | |
32a33 | |
> "handlebars": ">= 1.0.0", | |
54,55c55,56 | |
< "readme": "# connect-compiler\n\n[`connect`](http://senchalabs.github.com/connect/) middleware for dynamically recompiling derived files at serve-time. This module is designed for speeding up development; best-practices would have you compile all necessary files as part of your production deploy process. But you knew that, of course.\n\nUsage is the same as all other `connect` middleware:\n\n````js\n var connect = require('connect')\n , compiler = require('connect-compiler')\n \n , server = connect.createServer(\n connect.logger(),\n compiler({\n enabled : [ 'coffee', 'uglify' ],\n src : 'src',\n dest : 'var'\n }),\n connect.static(__dirname + '/public'),\n connect.static(__dirname + '/var')\n )\n ;\n \n server.listen(6969);\n````\n\nOf note, earlier versions of `connect` actually came with a module like this, but not any longer.\n\n\n## Installation\n\nVia [npm](http://npmjs.org/):\n\n````sh\nnpm install connect-compiler\n````\n\nOr if you want to hack on the source:\n\n````sh\ngit clone https://github.com/dsc/connect-compiler.git\ncd connect-compiler\nnpm link\n````\n\n\n## Settings\n\nThe compiler middleware takes a settings object, minimally containing a list of compilers to \nenable (`enabled`). Most uses will also specify a source directory (`src`).\n\n<table>\n <thead>\n <tr>\n <th>\n name\n </th>\n <th>\n type\n </th>\n <th>\n default\n </th>\n <th>\n description\n </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\n <strong>enabled</strong>\n </td>\n <td>\n <code>String</code>, <code>String[]</code>\n </td>\n <td></td>\n <td>\n <strong>Required</strong> Enabled compiler id(s). See below for included compilers.\n </td>\n </tr>\n <tr>\n <td>\n <strong>src</strong>\n </td>\n <td>\n <code>String</code>, <code>String[]</code>\n </td>\n <td>\n cwd\n </td>\n <td>\n Directories to search for source files to compile.\n </td>\n </tr>\n <tr>\n <td>\n <strong>dest</strong>\n </td>\n <td>\n <code>String</code>\n </td>\n <td>\n <code>src</code> or<br>\n <code>src[0]</code> if Array\n </td>\n <td>\n Directory to write compiled result.\n </td>\n </tr>\n <tr>\n <td>\n <strong>roots</strong>\n </td>\n <td>\n <code>{src:dest, ...}</code>,<br>\n <code>[[src, dest], ...]</code>\n </td>\n <td></td>\n <td>\n Allows you to specify multiple, ordered <code>src</code>-<code>dest</code> pairs. One of <code>roots</code> or <code>src</code> is required; <code>roots</code> takes precedence over <code>src</code> if present.\n </td>\n </tr>\n <tr>\n <td>\n <strong>log_level</strong>\n </td>\n <td>\n <code>String</code> , <code>Number</code>\n </td>\n <td>\n <code>WARN</code>\n </td>\n <td>\n Logging verbosity. Valid values (case-insensitive): <code>error</code>, <code>warn</code>, <code>info</code>, <code>debug</code>, <code>silent</code>, or a numeric constant (as found in <code>LOG</code>).\n </td>\n </tr>\n <tr>\n <td>\n <strong>create_dirs</strong>\n </td>\n <td>\n <code>Boolean</code>\n </td>\n <td>\n <code>true</code>\n </td>\n <td>\n Creates intermediate directories for destination files.\n </td>\n </tr>\n <tr>\n <td>\n <strong>mount</strong>\n </td>\n <td>\n <code>String</code>\n </td>\n <td></td>\n <td>\n Prefix trimmed off request path before matching/processing.\n </td>\n </tr>\n <tr>\n <td>\n <strong>delta</strong>\n </td>\n <td>\n <code>Number</code>\n </td>\n <td>\n <code>0</code>\n </td>\n <td>\n Delta <code>mtime</code> (in seconds) required for a derived file to be considered stale, and therefore recompiled. By default, any change will cause a file to be recompiled on next request.\n </td>\n </tr>\n <tr>\n <td>\n <strong>expires</strong>\n </td>\n <td>\n <code>Boolean</code>\n </td>\n <td>\n <code>false</code>\n </td>\n <td>\n Automatically treat files as stale if this old in secs.\n </td>\n </tr>\n <tr>\n <td>\n <strong>external_timeout</strong>\n </td>\n <td>\n <code>Number</code>\n </td>\n <td>\n <code>3000</code>\n </td>\n <td>\n Milliseconds after which to kill subprocess commands.\n </td>\n </tr>\n <tr>\n <td>\n <strong>cascade</strong>\n </td>\n <td>\n <code>Boolean</code>\n </td>\n <td>\n <code>false</code>\n </td>\n <td>\n Invoke all compilers that match? otherwise, only first.\n </td>\n </tr>\n <tr>\n <td>\n <strong>resolve_index</strong>\n </td>\n <td>\n <code>Boolean</code> , <code>String</code>\n </td>\n <td>\n <code>false</code>\n </td>\n <td>\n If <code>true</code>-y, directories are resolved with the supplied filename, where <code>true</code> maps to <code>'index.html'</code>.\n </td>\n </tr>\n <tr>\n <td>\n <strong>ignore</strong>\n </td>\n <td>\n <code>RegExp</code>\n </td>\n <td>\n <code>/\\.(jpe?g|gif|png)$/i</code>\n </td>\n <td>\n Requests matching this pattern are short-circuit ignored, and no compiler matching occurs.\n </td>\n </tr>\n <tr>\n <td>\n <strong>allowed_methods</strong>\n </td>\n <td>\n <code>String[]</code>\n </td>\n <td>\n <code>['GET']</code>\n </td>\n <td>\n HTTP methods compiler should process. This setting is global-only -- per-compiler overrides specified via <code>options</code> will have no effect.\n </td>\n </tr>\n <tr>\n <td>\n <strong>options</strong>\n </td>\n <td>\n <code>{compilerId:settings, ...}</code>\n </td>\n <td></td>\n <td>\n Hash of additional per-compiler options, mapped by compiler id. Each compiler is supplied a copy of the <code>settings</code> object; if additional options are supplied in this way for a given compiler, they will be merged into the settings (and override any colliding top-level keys).\n </td>\n </tr>\n </tbody>\n</table>\n\n\n\n## Compilers\n\nTo enable a compiler, you specify its `id`, which you can get from the handy list that follows. Some\ncompilers take options, which you pass using the `options` setting using the compiler `id` as the\nkey.\n\nFor example, to disable the `bare` option for the CoffeeScript compiler, you'd do something like:\n\n````js\nserver = connect.createServer(\n compiler({\n enabled : [ 'coffee' ],\n src : 'src',\n dest : 'var',\n options : {\n 'coffee' : {\n 'bare' : false\n }\n }\n }),\n connect.static(__dirname + '/public'),\n connect.static(__dirname + '/var')\n)\n````\n\n### Compiler IDs\n\n- [CoffeeScript](http://coffeescript.org/) Compiler: `coffee`\n- [Coco](http://satyr.github.com/coco/) Compiler: `coco`\n- [Uglify](https://github.com/mishoo/UglifyJS) Compiler: `uglify`\n- [Jade](http://jade-lang.com/) Compiler: `jade`\n- [Stylus](http://learnboost.github.com/stylus/) Compiler: `stylus`\n- [Less](http://lesscss.org/) Compiler: `less`\n- [Sass](http://sass-lang.com/) Compiler: `sass` -- Using [sass.js](https://github.com/visionmedia/sass.js).\n- [SassRuby](http://sass-lang.com/) Compiler: `sass_ruby` -- External compiler using a shell command to \n the [Ruby version of Sass](http://sass-lang.com/download.html) (install via `gem install sass`).\n- [Jison](http://zaach.github.com/jison/) Compiler: `jison`\n- [YAML](https://github.com/visionmedia/js-yaml) Compiler: `yaml`\n- [Snockets](http://github.com/TrevorBurnham/snockets) Compiler: `snockets`\n\n\n## Feedback\n\nFind a bug or want to contribute? Open a ticket on [github](http://github.com/dsc/connect-compiler). \nYou're also welcome to send me email at [[email protected]](mailto:[email protected]?subject=connect-compiler).\n\n", | |
< "_id": "[email protected]", | |
--- | |
> "readme": "# connect-compiler\n\n[`connect`](http://senchalabs.github.com/connect/) middleware for dynamically recompiling derived files at serve-time. This module is designed for speeding up development; best-practices would have you compile all necessary files as part of your production deploy process. But you knew that, of course.\n\nUsage is the same as all other `connect` middleware:\n\n````js\n var connect = require('connect')\n , compiler = require('connect-compiler')\n \n , server = connect.createServer(\n connect.logger(),\n compiler({\n enabled : [ 'coffee', 'uglify' ],\n src : 'src',\n dest : 'var'\n }),\n connect.static(__dirname + '/public'),\n connect.static(__dirname + '/var')\n )\n ;\n \n server.listen(6969);\n````\n\nOf note, earlier versions of `connect` actually came with a module like this, but not any longer.\n\n\n## Installation\n\nVia [npm](http://npmjs.org/):\n\n````sh\nnpm install connect-compiler\n````\n\nOr if you want to hack on the source:\n\n````sh\ngit clone https://github.com/dsc/connect-compiler.git\ncd connect-compiler\nnpm link\n````\n\n\n## Settings\n\nThe compiler middleware takes a settings object, minimally containing a list of compilers to \nenable (`enabled`). Most uses will also specify a source directory (`src`).\n\n<table>\n <thead>\n <tr>\n <th>\n name\n </th>\n <th>\n type\n </th>\n <th>\n default\n </th>\n <th>\n description\n </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\n <strong>enabled</strong>\n </td>\n <td>\n <code>String</code>, <code>String[]</code>\n </td>\n <td></td>\n <td>\n <strong>Required</strong> Enabled compiler id(s). See below for included compilers.\n </td>\n </tr>\n <tr>\n <td>\n <strong>src</strong>\n </td>\n <td>\n <code>String</code>, <code>String[]</code>\n </td>\n <td>\n cwd\n </td>\n <td>\n Directories to search for source files to compile.\n </td>\n </tr>\n <tr>\n <td>\n <strong>dest</strong>\n </td>\n <td>\n <code>String</code>\n </td>\n <td>\n <code>src</code> or<br>\n <code>src[0]</code> if Array\n </td>\n <td>\n Directory to write compiled result.\n </td>\n </tr>\n <tr>\n <td>\n <strong>roots</strong>\n </td>\n <td>\n <code>{src:dest, ...}</code>,<br>\n <code>[[src, dest], ...]</code>\n </td>\n <td></td>\n <td>\n Allows you to specify multiple, ordered <code>src</code>-<code>dest</code> pairs. One of <code>roots</code> or <code>src</code> is required; <code>roots</code> takes precedence over <code>src</code> if present.\n </td>\n </tr>\n <tr>\n <td>\n <strong>log_level</strong>\n </td>\n <td>\n <code>String</code> , <code>Number</code>\n </td>\n <td>\n <code>WARN</code>\n </td>\n <td>\n Logging verbosity. Valid values (case-insensitive): <code>error</code>, <code>warn</code>, <code>info</code>, <code>debug</code>, <code>silent</code>, or a numeric constant (as found in <code>LOG</code>).\n </td>\n </tr>\n <tr>\n <td>\n <strong>create_dirs</strong>\n </td>\n <td>\n <code>Boolean</code>\n </td>\n <td>\n <code>true</code>\n </td>\n <td>\n Creates intermediate directories for destination files.\n </td>\n </tr>\n <tr>\n <td>\n <strong>mount</strong>\n </td>\n <td>\n <code>String</code>\n </td>\n <td></td>\n <td>\n Prefix trimmed off request path before matching/processing.\n </td>\n </tr>\n <tr>\n <td>\n <strong>delta</strong>\n </td>\n <td>\n <code>Number</code>\n </td>\n <td>\n <code>0</code>\n </td>\n <td>\n Delta <code>mtime</code> (in seconds) required for a derived file to be considered stale, and therefore recompiled. By default, any change will cause a file to be recompiled on next request.\n </td>\n </tr>\n <tr>\n <td>\n <strong>expires</strong>\n </td>\n <td>\n <code>Boolean</code>\n </td>\n <td>\n <code>false</code>\n </td>\n <td>\n Automatically treat files as stale if this old in secs.\n </td>\n </tr>\n <tr>\n <td>\n <strong>external_timeout</strong>\n </td>\n <td>\n <code>Number</code>\n </td>\n <td>\n <code>3000</code>\n </td>\n <td>\n Milliseconds after which to kill subprocess commands.\n </td>\n </tr>\n <tr>\n <td>\n <strong>cascade</strong>\n </td>\n <td>\n <code>Boolean</code>\n </td>\n <td>\n <code>false</code>\n </td>\n <td>\n Invoke all compilers that match? otherwise, only first.\n </td>\n </tr>\n <tr>\n <td>\n <strong>resolve_index</strong>\n </td>\n <td>\n <code>Boolean</code> , <code>String</code>\n </td>\n <td>\n <code>false</code>\n </td>\n <td>\n If <code>true</code>-y, directories are resolved with the supplied filename, where <code>true</code> maps to <code>'index.html'</code>.\n </td>\n </tr>\n <tr>\n <td>\n <strong>ignore</strong>\n </td>\n <td>\n <code>RegExp</code>\n </td>\n <td>\n <code>/\\.(jpe?g|gif|png)$/i</code>\n </td>\n <td>\n Requests matching this pattern are short-circuit ignored, and no compiler matching occurs.\n </td>\n </tr>\n <tr>\n <td>\n <strong>allowed_methods</strong>\n </td>\n <td>\n <code>String[]</code>\n </td>\n <td>\n <code>['GET']</code>\n </td>\n <td>\n HTTP methods compiler should process. This setting is global-only -- per-compiler overrides specified via <code>options</code> will have no effect.\n </td>\n </tr>\n <tr>\n <td>\n <strong>options</strong>\n </td>\n <td>\n <code>{compilerId:settings, ...}</code>\n </td>\n <td></td>\n <td>\n Hash of additional per-compiler options, mapped by compiler id. Each compiler is supplied a copy of the <code>settings</code> object; if additional options are supplied in this way for a given compiler, they will be merged into the settings (and override any colliding top-level keys).\n </td>\n </tr>\n </tbody>\n</table>\n\n\n\n## Compilers\n\nTo enable a compiler, you specify its `id`, which you can get from the handy list that follows. Some\ncompilers take options, which you pass using the `options` setting using the compiler `id` as the\nkey.\n\nFor example, to disable the `bare` option for the CoffeeScript compiler, you'd do something like:\n\n````js\nserver = connect.createServer(\n compiler({\n enabled : [ 'coffee' ],\n src : 'src',\n dest : 'var',\n options : {\n 'coffee' : {\n 'bare' : false\n }\n }\n }),\n connect.static(__dirname + '/public'),\n connect.static(__dirname + '/var')\n)\n````\n\n### Compiler IDs\n\n- [CoffeeScript](http://coffeescript.org/) Compiler: `coffee`\n- [Coco](http://satyr.github.com/coco/) Compiler: `coco`\n- [Uglify](https://github.com/mishoo/UglifyJS) Compiler: `uglify`\n- [Jade](http://jade-lang.com/) Compiler: `jade`\n- [Handlebars](http://handlebarsjs.com/) Compiler: `handlebars`\n- [Stylus](http://learnboost.github.com/stylus/) Compiler: `stylus`\n- [Less](http://lesscss.org/) Compiler: `less`\n- [Sass](http://sass-lang.com/) Compiler: `sass` -- Using [sass.js](https://github.com/visionmedia/sass.js).\n- [SassRuby](http://sass-lang.com/) Compiler: `sass_ruby` -- External compiler using a shell command to \n the [Ruby version of Sass](http://sass-lang.com/download.html) (install via `gem install sass`).\n- [Jison](http://zaach.github.com/jison/) Compiler: `jison`\n- [YAML](https://github.com/visionmedia/js-yaml) Compiler: `yaml`\n- [Snockets](http://github.com/TrevorBurnham/snockets) Compiler: `snockets`\n\n\n## Feedback\n\nFind a bug or want to contribute? Open a ticket on [github](http://github.com/dsc/connect-compiler). \nYou're also welcome to send me email at [[email protected]](mailto:[email protected]?subject=connect-compiler).\n\n", | |
> "_id": "[email protected]", | |
57c58 | |
< "shasum": "d79a94260d44828685c728da7990172fadde8b4d" | |
--- | |
> "shasum": "918646eef3737a6b4089364e621b24929e8a1746" | |
diff -r /tmp/connect-compiler/README.md node_modules/connect-compiler/README.md | |
308a309 | |
> - [Handlebars](http://handlebarsjs.com/) Compiler: `handlebars` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment