Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coffeebar

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffeebar - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

7

History.md

@@ -0,1 +1,8 @@

4/21/2015 - 0.5.0
=================
* Updated CoffeeScript to 1.9.2
* Updated all other dependencies.
* Fixed a bug in the source create constructor.
* Altered some of the test asserts for sanity.
3/7/2014 - 0.4.0

@@ -2,0 +9,0 @@ =================

300

lib/coffeebar.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.9.2
var Coffeebar, Source, beholder, coffee, exts, fs, glob, mkdirp, path, sourcemap, xcolor;

@@ -25,19 +25,18 @@

Coffeebar = (function() {
function Coffeebar(inputPaths, options) {
var _base, _base1, _base2, _base3, _base4, _base5, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
this.inputPaths = inputPaths;
this.options = options != null ? options : {};
function Coffeebar(inputPaths1, options1) {
var base, base1, base2, base3, base4, base5;
this.inputPaths = inputPaths1;
this.options = options1 != null ? options1 : {};
this.sources = [];
if ((_ref = (_base = this.options).watch) == null) {
_base.watch = false;
if ((base = this.options).watch == null) {
base.watch = false;
}
if ((_ref1 = (_base1 = this.options).silent) == null) {
_base1.silent = true;
if ((base1 = this.options).silent == null) {
base1.silent = true;
}
if ((_ref2 = (_base2 = this.options).minify) == null) {
_base2.minify = false;
if ((base2 = this.options).minify == null) {
base2.minify = false;
}
if ((_ref3 = (_base3 = this.options).sourceMap) == null) {
_base3.sourceMap = false;
if ((base3 = this.options).sourceMap == null) {
base3.sourceMap = false;
}

@@ -50,7 +49,7 @@ if (this.options.minify) {

}
if ((_ref4 = (_base4 = this.options).bare) == null) {
_base4.bare = false;
if ((base4 = this.options).bare == null) {
base4.bare = false;
}
if ((_ref5 = (_base5 = this.options).header) == null) {
_base5.header = true;
if ((base5 = this.options).header == null) {
base5.header = true;
}

@@ -63,56 +62,52 @@ this.initColors();

Coffeebar.prototype.initPaths = function() {
var i, inputPath, _i, _len, _ref, _results;
var i, inputPath, j, len, ref, results;
if (!Array.isArray(this.inputPaths)) {
this.inputPaths = [this.inputPaths];
}
_ref = this.inputPaths;
_results = [];
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
inputPath = _ref[i];
ref = this.inputPaths;
results = [];
for (i = j = 0, len = ref.length; j < len; i = ++j) {
inputPath = ref[i];
inputPath = path.normalize(inputPath);
if (!path.extname(inputPath)) {
_results.push(this.inputPaths[i] = "" + inputPath + "/**/*.{" + exts + "}");
results.push(this.inputPaths[i] = inputPath + "/**/*.{" + exts + "}");
} else {
_results.push(void 0);
results.push(void 0);
}
}
return _results;
return results;
};
Coffeebar.prototype.addSources = function() {
var file, files, inputPath, _i, _len, _ref, _results;
_ref = this.inputPaths;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
inputPath = _ref[_i];
var file, files, inputPath, j, len, ref, results;
ref = this.inputPaths;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
inputPath = ref[j];
files = glob.sync(inputPath);
_results.push((function() {
var _j, _len1, _results1;
_results1 = [];
for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
file = files[_j];
_results1.push(this.sources.push(new Source(this.options, file, inputPath)));
results.push((function() {
var k, len1, results1;
results1 = [];
for (k = 0, len1 = files.length; k < len1; k++) {
file = files[k];
results1.push(this.sources.push(new Source(this.options, file, inputPath)));
}
return _results1;
return results1;
}).call(this));
}
return _results;
return results;
};
Coffeebar.prototype.start = function() {
var i, _i, _len, _ref, _results;
var i, j, len, ref, results;
this.addSources();
this.build();
if (this.options.watch) {
_ref = this.inputPaths;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
i = _ref[_i];
_results.push(this.watch(i));
ref = this.inputPaths;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
i = ref[j];
results.push(this.watch(i));
}
return _results;
return results;
}

@@ -138,38 +133,34 @@ };

Coffeebar.prototype.compileSources = function() {
var source, _i, _len, _ref, _results;
var j, len, ref, results, source;
this.outputs = this.options.join ? this.joinSources() : this.sources;
_ref = this.outputs;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
source = _ref[_i];
ref = this.outputs;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
source = ref[j];
if (source.updated) {
_results.push(source.compile());
results.push(source.compile());
}
}
return _results;
return results;
};
Coffeebar.prototype.minifySources = function() {
var source, _i, _len, _ref, _results;
_ref = this.outputs;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
source = _ref[_i];
var j, len, ref, results, source;
ref = this.outputs;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
source = ref[j];
if (source.outputReady()) {
_results.push(source.minify());
results.push(source.minify());
}
}
return _results;
return results;
};
Coffeebar.prototype.mapSources = function() {
var smNew, smOld, source, _i, _len, _ref,
_this = this;
var j, len, ref, smNew, smOld, source;
if (!this.options.join) {
_ref = this.sources;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
source = _ref[_i];
ref = this.sources;
for (j = 0, len = ref.length; j < len; j++) {
source = ref[j];
source.writeMapComment();

@@ -185,7 +176,9 @@ }

file: smOld.file,
sourceRoot: "" + (path.basename(this.options.output, '.js')) + "_mapsrc"
sourceRoot: (path.basename(this.options.output, '.js')) + "_mapsrc"
});
smOld.eachMapping(function(map) {
return smNew.addMapping(_this.offsetMapping(map));
});
smOld.eachMapping((function(_this) {
return function(map) {
return smNew.addMapping(_this.offsetMapping(map));
};
})(this));
return this.outputs[0].writeMapComment(smNew.toString());

@@ -195,4 +188,3 @@ };

Coffeebar.prototype.reportErrors = function() {
var source, _i, _len, _ref, _results;
var j, len, ref, results, source;
if (this.options.join && this.outputs[0].error) {

@@ -203,100 +195,97 @@ source = this.getOriginalSource(this.outputs[0].errorLine);

}
_ref = this.outputs;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
source = _ref[_i];
ref = this.outputs;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
source = ref[j];
if (source.error) {
_results.push(source.reportError());
results.push(source.reportError());
}
}
return _results;
return results;
};
Coffeebar.prototype.writeSources = function() {
var source, _i, _len, _ref, _results;
_ref = this.outputs;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
source = _ref[_i];
var j, len, ref, results, source;
ref = this.outputs;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
source = ref[j];
if (source.outputReady()) {
_results.push(source.write());
results.push(source.write());
}
}
return _results;
return results;
};
Coffeebar.prototype.writeJoinSources = function() {
var outputPath, source, _i, _len, _ref, _results;
outputPath = path.join(path.dirname(this.options.output), "" + (path.basename(this.options.output, '.js')) + "_mapsrc");
_ref = this.sources;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
source = _ref[_i];
var j, len, outputPath, ref, results, source;
outputPath = path.join(path.dirname(this.options.output), (path.basename(this.options.output, '.js')) + "_mapsrc");
ref = this.sources;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
source = ref[j];
if (source.outputReady()) {
_results.push(source.writeSource(outputPath));
results.push(source.writeSource(outputPath));
}
}
return _results;
return results;
};
Coffeebar.prototype.watch = function(inputPath) {
var watcher,
_this = this;
var watcher;
watcher = beholder(inputPath);
watcher.on('change', function(file) {
var source;
source = _this.getSource(file);
source.read();
return _this.build();
});
watcher.on('new', function(file) {
_this.sources.push(new Source(_this.options, file));
return _this.build();
});
return watcher.on('remove', function(file) {
var i;
_this.sources = (function() {
var _i, _len, _ref, _results;
_ref = this.sources;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
i = _ref[_i];
if (i.file !== file) {
_results.push(i);
watcher.on('change', (function(_this) {
return function(file) {
var source;
source = _this.getSource(file);
source.read();
return _this.build();
};
})(this));
watcher.on('new', (function(_this) {
return function(file) {
_this.sources.push(new Source(_this.options, file));
return _this.build();
};
})(this));
return watcher.on('remove', (function(_this) {
return function(file) {
var i;
_this.sources = (function() {
var j, len, ref, results;
ref = this.sources;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
i = ref[j];
if (i.file !== file) {
results.push(i);
}
}
return results;
}).call(_this);
if (_this.options.join) {
return _this.build();
}
return _results;
}).call(_this);
if (_this.options.join) {
return _this.build();
}
});
};
})(this));
};
Coffeebar.prototype.offsetSources = function() {
var offset, source, _i, _len, _ref, _results;
var j, len, offset, ref, results, source;
offset = 0;
_ref = this.sources;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
source = _ref[_i];
ref = this.sources;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
source = ref[j];
source.offset = offset;
_results.push(offset += source.lines);
results.push(offset += source.lines);
}
return _results;
return results;
};
Coffeebar.prototype.getOriginalSource = function(line) {
var source, _i, _len, _ref;
_ref = this.sources;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
source = _ref[_i];
var j, len, ref, source;
ref = this.sources;
for (j = 0, len = ref.length; j < len; j++) {
source = ref[j];
if (source.offset + source.lines > line) {

@@ -310,3 +299,2 @@ return source;

var newMap, source;
source = this.getOriginalSource(map.originalLine - 1);

@@ -327,8 +315,7 @@ return newMap = {

Coffeebar.prototype.joinSources = function() {
var i, joinSource, joinSrc, _i, _len, _ref;
var i, j, joinSource, joinSrc, len, ref;
joinSrc = "";
_ref = this.sources;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
i = _ref[_i];
ref = this.sources;
for (j = 0, len = ref.length; j < len; j++) {
i = ref[j];
joinSrc = joinSrc.concat(i.src + "\n");

@@ -343,7 +330,6 @@ }

Coffeebar.prototype.getSource = function(file) {
var i, _i, _len, _ref;
_ref = this.sources;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
i = _ref[_i];
var i, j, len, ref;
ref = this.sources;
for (j = 0, len = ref.length; j < len; j++) {
i = ref[j];
if (i.file === file) {

@@ -350,0 +336,0 @@ return i;

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.9.2
var coffeebar, program;

@@ -10,3 +10,2 @@

var options;
program.version('0.3.2').usage('[options] [path ...]').option('-b, --bare', 'compile without a top-level function wrapper').option('-m, --minify', 'minify output files').option('-M, --map', 'create source maps').option('-o, --output <path>', 'output path').option('-s, --silent', 'suppress console output').option('-w, --watch', 'watch files for changes');

@@ -13,0 +12,0 @@ program.parse(process.argv);

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.9.2
var Source, coffee, fs, mkdirp, path, sourcemap, uglify, xcolor;

@@ -28,3 +28,3 @@

if (this.file) {
this.inputFile = path.resolve(file);
this.inputFile = path.resolve(this.file);
this.read();

@@ -43,3 +43,2 @@ }

var err;
try {

@@ -63,3 +62,2 @@ this.error = false;

var result;
result = uglify.minify(this.compiled, {

@@ -86,3 +84,2 @@ fromString: true

var outputPath;
outputPath = path.join(base, this.file);

@@ -95,3 +92,2 @@ mkdirp.sync(path.dirname(outputPath));

var mapOutput;
mapOutput = this.outputPath.replace('.js', '.coffee');

@@ -103,7 +99,6 @@ return fs.writeFileSync(mapOutput, this.src, 'utf8');

var commentMap;
map || (map = JSON.stringify(this.sourceMap));
commentMap = new Buffer(map).toString('base64');
commentMap = "//@ sourceMappingURL=data:application/json;base64," + commentMap;
return this.compiled = "" + this.compiled + "\n" + commentMap;
return this.compiled = this.compiled + "\n" + commentMap;
};

@@ -133,3 +128,2 @@

var base, baseDir, baseFragment, baseInputDir, baseOutputDir, dir, fileName;
if (this.outputPath) {

@@ -145,3 +139,3 @@ return;

baseInputDir = this.inputPath.replace('**/*.{coffee,litcoffee,coffee.md}', '');
baseInputDir = baseInputDir.replace(new RegExp("" + (path.basename(baseInputDir)) + "/?$"), '');
baseInputDir = baseInputDir.replace(new RegExp((path.basename(baseInputDir)) + "/?$"), '');
baseInputDir = path.normalize(baseInputDir);

@@ -148,0 +142,0 @@ baseOutputDir = dir.replace(baseInputDir, '');

{
"name": "coffeebar",
"version": "0.4.0",
"version": "0.5.0",
"author": "Charles Moncrief",

@@ -35,16 +35,16 @@ "description": "Simplified CoffeeScript build tool.",

"dependencies": {
"commander": "~2.1.0",
"commander": "~2.8.0",
"beholder": "0.2.0",
"xcolor": "~0.1.0",
"coffee-script": "1.7.1",
"uglify-js": "~2.4.2",
"mkdirp": "~0.3.5",
"glob": "~3.2.6",
"source-map": "~0.1.31"
"coffee-script": "1.9.2",
"uglify-js": "~2.4.20",
"mkdirp": "~0.5.0",
"glob": "~5.0.5",
"source-map": "~0.4.2"
},
"devDependencies": {
"mocha": "~1.17.1",
"coffee-script": "1.7.1",
"rimraf": "~2.2.2"
"mocha": "~2.2.4",
"coffee-script": "1.9.2",
"rimraf": "~2.3.2"
}
}

@@ -1,9 +0,9 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.2
(function() {
var i, letters, letters2, numbers, _i, _j, _k, _len, _len1, _len2;
var i, j, k, l, len, len1, len2, letters, letters2, numbers;
numbers = [1, 2, 3, 4];
for (_i = 0, _len = numbers.length; _i < _len; _i++) {
i = numbers[_i];
for (j = 0, len = numbers.length; j < len; j++) {
i = numbers[j];
console.log(i);

@@ -14,4 +14,4 @@ }

for (_j = 0, _len1 = letters.length; _j < _len1; _j++) {
i = letters[_j];
for (k = 0, len1 = letters.length; k < len1; k++) {
i = letters[k];
console.log(i);

@@ -22,4 +22,4 @@ }

for (_k = 0, _len2 = letters2.length; _k < _len2; _k++) {
i = letters2[_k];
for (l = 0, len2 = letters2.length; l < len2; l++) {
i = letters2[l];
console.log(i);

@@ -26,0 +26,0 @@ }

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.2
(function() {

@@ -3,0 +3,0 @@ var letters;

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.2
(function() {

@@ -3,0 +3,0 @@ var numbers;

@@ -14,2 +14,2 @@ // Generated by CoffeeScript 1.7.1

//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0cHV0L3N1Yi9sZXR0ZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsibGV0dGVycy5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQUEsTUFBQSxvQkFBQTs7QUFBQSxFQUFBLE9BQUEsR0FBVSxDQUFDLEdBQUQsRUFBSyxHQUFMLEVBQVMsR0FBVCxFQUFhLEdBQWIsRUFBaUIsR0FBakIsRUFBc0IsR0FBdEIsQ0FBVixDQUFBOztBQUVBLE9BQUEsOENBQUE7b0JBQUE7QUFBQSxJQUFBLE9BQU8sQ0FBQyxHQUFSLENBQVksQ0FBWixDQUFBLENBQUE7QUFBQSxHQUZBO0FBQUEifQ==
//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0cHV0L3N1Yi9sZXR0ZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsibGV0dGVycy5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQUEsTUFBQSxvQkFBQTs7QUFBQSxFQUFBLE9BQUEsR0FBVSxDQUFDLEdBQUQsRUFBSyxHQUFMLEVBQVMsR0FBVCxFQUFhLEdBQWIsRUFBaUIsR0FBakIsRUFBc0IsR0FBdEIsQ0FBVixDQUFBOztBQUVBLE9BQUEsOENBQUE7b0JBQUE7QUFBQSxJQUFBLE9BQU8sQ0FBQyxHQUFSLENBQVksQ0FBWixDQUFBLENBQUE7QUFBQSxHQUZBO0FBQUEifQ==

@@ -1,14 +0,1 @@

// Generated by CoffeeScript 1.7.1
(function() {
var i, letters, _i, _len;
letters = ['a', 'b', 'c', 'd', 'e', 'x'];
for (_i = 0, _len = letters.length; _i < _len; _i++) {
i = letters[_i];
console.log(i);
}
}).call(this);
//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGV0dGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImxldHRlcnMuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUFBLE1BQUEsb0JBQUE7O0FBQUEsRUFBQSxPQUFBLEdBQVUsQ0FBQyxHQUFELEVBQUssR0FBTCxFQUFTLEdBQVQsRUFBYSxHQUFiLEVBQWlCLEdBQWpCLEVBQXNCLEdBQXRCLENBQVYsQ0FBQTs7QUFFQSxPQUFBLDhDQUFBO29CQUFBO0FBQUEsSUFBQSxPQUFPLENBQUMsR0FBUixDQUFZLENBQVosQ0FBQSxDQUFBO0FBQUEsR0FGQTtBQUFBIn0=
// Generated by CoffeeScript 1.9.2\n(function() {\n var i, j, len, letters;\n\n letters = ['a', 'b', 'c', 'd', 'e', 'x'];\n\n for (j = 0, len = letters.length; j < len; j++) {\n i = letters[j];\n console.log(i);\n }\n\n}).call(this);\n\n//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGV0dGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImxldHRlcnMuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUFBLE1BQUEsa0JBQUE7O0FBQUEsRUFBQSxPQUFBLEdBQVUsQ0FBQyxHQUFELEVBQUssR0FBTCxFQUFTLEdBQVQsRUFBYSxHQUFiLEVBQWlCLEdBQWpCLEVBQXNCLEdBQXRCLENBQVYsQ0FBQTs7QUFFQSxPQUFBLHlDQUFBO21CQUFBO0FBQUEsSUFBQSxPQUFPLENBQUMsR0FBUixDQUFZLENBQVosQ0FBQSxDQUFBO0FBQUEsR0FGQTtBQUFBIn0=

@@ -1,9 +0,9 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.2
(function() {
var i, numbers, _i, _len;
var i, j, len, numbers;
numbers = [1, 2, 3, 4];
for (_i = 0, _len = numbers.length; _i < _len; _i++) {
i = numbers[_i];
for (j = 0, len = numbers.length; j < len; j++) {
i = numbers[j];
console.log(i);

@@ -10,0 +10,0 @@ }

@@ -1,1 +0,1 @@

(function(){var l,o,n,c;for(o=[1,2,3,4],n=0,c=o.length;c>n;n++)l=o[n],console.log(l)}).call(this);
(function(){var i,j,len,numbers;numbers=[1,2,3,4];for(j=0,len=numbers.length;j<len;j++){i=numbers[j];console.log(i)}}).call(this);

@@ -1,9 +0,9 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.2
(function() {
var i, letters, _i, _len;
var i, j, len, letters;
letters = ['a', 'b', 'c', 'd', 'e', 'x'];
for (_i = 0, _len = letters.length; _i < _len; _i++) {
i = letters[_i];
for (j = 0, len = letters.length; j < len; j++) {
i = letters[j];
console.log(i);

@@ -10,0 +10,0 @@ }

@@ -1,9 +0,9 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.2
(function() {
var i, letters2, _i, _len;
var i, j, len, letters2;
letters2 = ['x', 'y', 'z'];
for (_i = 0, _len = letters2.length; _i < _len; _i++) {
i = letters2[_i];
for (j = 0, len = letters2.length; j < len; j++) {
i = letters2[j];
console.log(i);

@@ -10,0 +10,0 @@ }

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc