Permalink
Browse files

Adds LiveScript compiler.

  • Loading branch information...
1 parent ae4914d commit 1d2059861da763b5e684143ded473502a9943c4f @dsc committed Apr 13, 2013
Showing with 45 additions and 12 deletions.
  1. +16 −2 .gitignore
  2. +1 −0 compiler.co
  3. +26 −10 compiler.js
  4. +1 −0 package.co
  5. +1 −0 package.json
View
18 .gitignore
@@ -1,11 +1,25 @@
.DS_Store
Icon?
+*~
+*.sw?
+*.pid
+*.db
+*.sqlite
+
+npm-debug.log
node_modules/
node_modules/*
-npm-debug.log
*.sass-cache
-lib-cov
+lib-cov/
test/*.log
test/fixtures/*.json
test/fixtures/logs/*.log
+.cache/
+.tmp/
+
+build
+dist
+var
+log
+tmp
View
1 compiler.co
@@ -703,6 +703,7 @@ class exports.YamlCompiler extends Compiler
[ CoffeeScriptCompiler
CocoCompiler
+ LiveScriptCompiler
UglifyCompiler
JadeCompiler
JadeBrowserPrecompiler
View
36 compiler.js
@@ -1,4 +1,4 @@
-var fs, path, parse, EventEmitter, ref$, 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, slice$ = [].slice;
+var fs, path, parse, EventEmitter, ref$, exec, spawn, Seq, exports, setup, compilers, DEFAULTS, LOG, CompilerMiddleware, register, Compiler, ExternalCompiler, CoffeeScriptCompiler, SnocketsCompiler, CocoCompiler, LiveScriptCompiler, UglifyCompiler, JadeCompiler, JadeBrowserPrecompiler, HandlebarsCompiler, HandlebarsBrowserPrecompiler, StylusCompiler, LessCompiler, SassCompiler, SassRubyCompiler, JisonCompiler, YamlCompiler, helpers, expand, extrema, commonPrefix, commonPath, mkdirp, slice$ = [].slice;
fs = require('fs');
path = require('path');
parse = require('url').parse;
@@ -89,7 +89,7 @@ exports.CompilerMiddleware = CompilerMiddleware = (function(superclass){
CompilerMiddleware.displayName = 'CompilerMiddleware';
var prototype = extend$(CompilerMiddleware, superclass).prototype, constructor = CompilerMiddleware;
function CompilerMiddleware(settings, custom){
- var ref$, srcDirs, destDir, res$, src, dest;
+ var srcDirs, ref$, destDir, res$, src, dest;
settings == null && (settings = {});
this.custom = custom != null
? custom
@@ -162,7 +162,7 @@ exports.CompilerMiddleware = CompilerMiddleware = (function(superclass){
}
try {
Seq(settings.enabled).seqEach(function(id, i){
- var C, ref$, _info, this$ = this;
+ var C, _info, ref$, this$ = this;
C = compilers[id];
if (!(C && (!success || settings.cascade))) {
return this(null);
@@ -279,7 +279,7 @@ exports.Compiler = Compiler = (function(superclass){
}
}
prototype.log = function(level){
- var msgs, that, level_name, compiler, file, len;
+ var msgs, level_name, that, compiler, file, len;
msgs = slice$.call(arguments, 1);
if (this.info.log_level <= level) {
level_name = (that = LOG.levelToString(level)) ? that : '';
@@ -353,7 +353,7 @@ exports.Compiler = Compiler = (function(superclass){
});
};
prototype.stale = function(srcStat, destStat, cb){
- var ref$, delta;
+ var delta, ref$;
delta = ((ref$ = this.info.delta) != null
? ref$
: (ref$ = this.delta) != null ? ref$ : 0) * 1000;
@@ -457,7 +457,7 @@ exports.Compiler = Compiler = (function(superclass){
c = info.instance = new Cls(info);
c.log(LOG.DEBUG, 'run()');
Seq().seq(function(){
- var res$, i$, ref$, len$, ref1$, srcDir, destDir, that, pairs;
+ var pairs, res$, i$, ref$, len$, ref1$, srcDir, destDir, that;
c.log(LOG.DEBUG, 'roots:', info.roots);
res$ = [];
for (i$ = 0, len$ = (ref$ = info.roots).length; i$ < len$; ++i$) {
@@ -538,7 +538,7 @@ exports.ExternalCompiler = ExternalCompiler = (function(superclass){
superclass.apply(this, arguments);
}
prototype.compile = function(text, options, cb){
- var ref$, info_options, cmd, child, this$ = this;
+ var info_options, ref$, cmd, child, this$ = this;
if (!cb) {
cb = options;
options = {};
@@ -560,7 +560,7 @@ exports.ExternalCompiler = ExternalCompiler = (function(superclass){
this.log(LOG.DEBUG, cmd + "");
child = exec(cmd, options, function(err, stdout, stderr){
if (err) {
- return cb(new Error(this + " error:\n" + err));
+ return cb(new Error(this$ + " error:\n" + err));
} else {
return cb(null, String(stdout));
}
@@ -626,6 +626,22 @@ exports.CocoCompiler = CocoCompiler = (function(superclass){
}
return CocoCompiler;
}(Compiler));
+exports.LiveScriptCompiler = LiveScriptCompiler = (function(superclass){
+ LiveScriptCompiler.displayName = 'LiveScriptCompiler';
+ var prototype = extend$(LiveScriptCompiler, superclass).prototype, constructor = LiveScriptCompiler;
+ prototype.id = 'livescript';
+ prototype.ext = '.ls';
+ prototype.destExt = '.js';
+ prototype.module = 'LiveScript';
+ prototype.options = {
+ bare: true
+ };
+ prototype.compileSync = 'compile';
+ function LiveScriptCompiler(){
+ superclass.apply(this, arguments);
+ }
+ return LiveScriptCompiler;
+}(Compiler));
exports.UglifyCompiler = UglifyCompiler = (function(superclass){
UglifyCompiler.displayName = 'UglifyCompiler';
var prototype = extend$(UglifyCompiler, superclass).prototype, constructor = UglifyCompiler;
@@ -854,7 +870,7 @@ exports.YamlCompiler = YamlCompiler = (function(superclass){
}
return YamlCompiler;
}(Compiler));
-[CoffeeScriptCompiler, CocoCompiler, UglifyCompiler, JadeCompiler, JadeBrowserPrecompiler, HandlebarsCompiler, HandlebarsBrowserPrecompiler, StylusCompiler, LessCompiler, SassCompiler, JisonCompiler, SassRubyCompiler, YamlCompiler, SnocketsCompiler].map(register);
+[CoffeeScriptCompiler, CocoCompiler, LiveScriptCompiler, UglifyCompiler, JadeCompiler, JadeBrowserPrecompiler, HandlebarsCompiler, HandlebarsBrowserPrecompiler, StylusCompiler, LessCompiler, SassCompiler, JisonCompiler, SassRubyCompiler, YamlCompiler, SnocketsCompiler].map(register);
helpers = exports.helpers = {};
helpers.expand = expand = function(){
var parts, p, home;
@@ -867,7 +883,7 @@ helpers.expand = expand = function(){
return path.resolve(p);
};
helpers.extrema = extrema = function(its){
- var it, by_length;
+ var by_length, it;
if (!(its != null && its.length)) {
return [];
}
View
1 package.co
@@ -13,6 +13,7 @@ devDependencies :
'express' : '>= 2.5.8'
'coco' : '>= 0.7.0'
'coffee-script' : '>= 1.2.0'
+ 'LiveScript' : '>= 1.1.0'
'jade' : '>= 0.20.3'
'handlebars' : '>= 1.0.0'
'stylus' : '>= 0.24.0'
View
1 package.json
@@ -25,6 +25,7 @@
"express": ">= 2.5.8",
"coco": ">= 0.7.0",
"coffee-script": ">= 1.2.0",
+ "LiveScript": ">= 1.1.0",
"jade": ">= 0.20.3",
"handlebars": ">= 1.0.0",
"stylus": ">= 0.24.0",

0 comments on commit 1d20598

Please sign in to comment.