buddy
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -80,15 +80,15 @@ var Builder, CONFIG, file, fs, log, path, target, term, trace; | ||
Builder.prototype.compile = function(compress) { | ||
var t, type, _i, _len, _ref, _results; | ||
_ref = [this.JS, this.CSS]; | ||
Builder.prototype.compile = function(compress, types) { | ||
var t, type, _i, _len, _results; | ||
if (types == null) types = [this.JS, this.CSS]; | ||
_results = []; | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
type = _ref[_i]; | ||
for (_i = 0, _len = types.length; _i < _len; _i++) { | ||
type = types[_i]; | ||
if (this[type + 'Targets'].length) { | ||
_results.push((function() { | ||
var _j, _len2, _ref2, _results2; | ||
_ref2 = this[type + 'Targets']; | ||
var _j, _len2, _ref, _results2; | ||
_ref = this[type + 'Targets']; | ||
_results2 = []; | ||
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { | ||
t = _ref2[_j]; | ||
for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) { | ||
t = _ref[_j]; | ||
_results2.push(t.run(compress, this.watching)); | ||
@@ -211,5 +211,5 @@ } | ||
if (contents.match(this.RE_BUILT_HEADER)) return null; | ||
return new file.JSFile(filepath, base, contents); | ||
return new file.JSFile(this.JS, filepath, base, contents); | ||
} else if (filepath.match(this.RE_CSS_SRC_EXT)) { | ||
return new file.CSSFile(filepath, base); | ||
return new file.CSSFile(this.CSS, filepath, base); | ||
} else { | ||
@@ -253,13 +253,11 @@ return null; | ||
return watcher = fs.watch(file.filepath, callback = function(event) { | ||
var last, nstat, size; | ||
var last, nstat; | ||
if (event === 'change') { | ||
nstat = fs.statSync(file.filepath); | ||
last = +nstat.mtime; | ||
size = nstat.size; | ||
if (size !== file.lastSize && last !== file.lastChange) { | ||
last = +nstat.mtime / 1000; | ||
if (last !== file.lastChange) { | ||
file.lastChange = last; | ||
file.lastSize = size; | ||
term.out("[" + (new Date().toLocaleTimeString()) + "] change detected in " + (term.colour(file.filename, term.GREY)), 0); | ||
file.updateContents(fs.readFileSync(file.filepath, 'utf8')); | ||
return _this.compile(compress); | ||
return _this.compile(compress, [file.type]); | ||
} | ||
@@ -266,0 +264,0 @@ } |
@@ -12,3 +12,4 @@ var CSSFile, File, JSFile, fs, log, path; | ||
function File(filepath, base) { | ||
function File(type, filepath, base) { | ||
this.type = type; | ||
this.filepath = filepath; | ||
@@ -22,3 +23,2 @@ this.base = base; | ||
this.lastChange = null; | ||
this.lastSize = null; | ||
} | ||
@@ -54,4 +54,4 @@ | ||
function JSFile(filepath, base, contents) { | ||
JSFile.__super__.constructor.call(this, filepath, base); | ||
function JSFile(type, filepath, base, contents) { | ||
JSFile.__super__.constructor.call(this, type, filepath, base); | ||
this.compile = this.RE_COFFEE_EXT.test(this.filepath); | ||
@@ -134,4 +134,4 @@ this.module = this._getModuleName(); | ||
function CSSFile(filepath, base) { | ||
CSSFile.__super__.constructor.call(this, filepath, base); | ||
function CSSFile(type, filepath, base) { | ||
CSSFile.__super__.constructor.call(this, type, filepath, base); | ||
this.compile = true; | ||
@@ -138,0 +138,0 @@ this.updateContents(fs.readFileSync(this.filepath, 'utf8')); |
@@ -36,3 +36,4 @@ | ||
}; | ||
return window.require = require; | ||
window.require = require; | ||
return window.module = require.module; | ||
})(); |
@@ -79,9 +79,7 @@ var CSSTarget, JSTarget, Target, coffee, file, fs, growl, less, log, path, stylus, term, uglify; | ||
Target.prototype._notifyError = function(filepath, error) { | ||
var options; | ||
term.out("" + (term.colour('error', term.RED)) + " building " + (term.colour(path.basename(filepath), term.GREY)) + ": " + error, 4); | ||
options = { | ||
title: 'BUILDER' | ||
}; | ||
try { | ||
return growl.notify("error building " + filepath + ": " + error, options); | ||
return growl.notify("error building " + filepath + ": " + error, { | ||
title: 'BUDDY' | ||
}); | ||
} catch (_error) {} | ||
@@ -88,0 +86,0 @@ }; |
{ | ||
"name": "buddy", | ||
"description": "A tooling framework for the compilation of higher order js/css languages (coffeescript/stylus/less).", | ||
"version": "0.3.0", | ||
"author": "Alexander Pope <alex@pope-industries.com>", | ||
"description": "A build framework for the compilation of higher order js/css languages (coffeescript/stylus/less).", | ||
"version": "0.3.1", | ||
"author": "popeindustries <alex@pope-industries.com>", | ||
"keywords": ["javascript", "coffeescript", "styus", "less"], | ||
@@ -13,3 +13,2 @@ "dependencies": { | ||
"uglify-js": "1.1.x", | ||
"underscore": "1.1.x", | ||
"commander": "0.x.x" | ||
@@ -30,3 +29,5 @@ }, | ||
}, | ||
"engine": "node >= 0.6.0", | ||
"engines": { | ||
"node": ">=0.6.0" | ||
}, | ||
"repository": { | ||
@@ -33,0 +34,0 @@ "type": "git", |
# Buddy | ||
Buddy is primarily a tooling framework for the compilation of higher order js/css languages (coffeescript/stylus/less). | ||
Buddy is primarily a build framework for the compilation of higher order js/css languages (coffeescript/stylus/less). | ||
Additionally, by enabling Node.js-style module wrapping and syntax, it promotes better js code organization, | ||
@@ -5,0 +5,0 @@ and provides automatic concatenation of code for more efficient delivery to the browser. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
48801
6
655
- Removedunderscore@1.1.x
- Removedunderscore@1.1.7(transitive)