Comparing version 0.3.2 to 0.3.4
@@ -33,3 +33,3 @@ /*COMMAND METHODS*/ | ||
} | ||
options.context = context; | ||
if (context) options.context = context; | ||
@@ -36,0 +36,0 @@ callback( |
@@ -101,10 +101,10 @@ var fs = require('fs') | ||
var flattened = FILE.flattenDependencyTree(tree[k], uniques); | ||
packages = packages.concat( | ||
flattened.map(function (name) { | ||
if (!name.indexOf('@')) { | ||
return name.replace(/^@/, ''); | ||
} | ||
return [k, name].join('/'); | ||
}) | ||
); | ||
packages = packages.concat( | ||
flattened.map(function (name) { | ||
if (!name.indexOf('@')) { | ||
return name.replace(/^@/, ''); | ||
} | ||
return [k, name].join('/'); | ||
}) | ||
); | ||
} | ||
@@ -115,8 +115,24 @@ //using arrays to maintain order o_O | ||
} | ||
//clean uniques | ||
if (callback) { | ||
uniques = uniques.map(function (n) { | ||
return n.replace(/^@/, ''); | ||
//* re order deps *// | ||
var ordered = []; | ||
for (var i = 0, l = packages.length; i < l; i++) { | ||
if (!packages[i]) continue; | ||
var j, reg = RegExp('^' + packages[i]); | ||
for (j = i + 1; j < l; j++) { | ||
if (reg.test(packages[j]) && !~ordered.indexOf(packages[j])) { | ||
ordered.push(packages[j]); | ||
packages[j] = false; | ||
} | ||
} | ||
if (!~ordered.indexOf(packages[i])) ordered.push(packages[i]); | ||
} | ||
uniques = ordered.map(function (item) { | ||
return item.replace(/.*(?=\/.*)\/?/, ''); | ||
}); | ||
return callback(packages, uniques); | ||
return callback(ordered, uniques); | ||
} | ||
@@ -187,3 +203,2 @@ return packages; | ||
FILE.flattenDependencyTree(tree, null, function (packages) { | ||
packages = UTIL.unique(packages); | ||
packages.forEach(function (name, j) { | ||
@@ -190,0 +205,0 @@ var packagePath = path.join('node_modules', name.replace(/\//g, '/node_modules/')) |
@@ -47,3 +47,3 @@ var colors = require('colors') | ||
} else { | ||
context = [type, ENDER.util.unique(ENDER.cmd.normalize(_modules.concat(queue))).join(' ')].join(' ') + options.context; | ||
context = [type, ENDER.util.unique(ENDER.cmd.normalize(_modules.concat(queue))).join(' ')].join(' ') + (options.context || ''); | ||
ENDER.npm.install(queue, function (err, out, stderr) { | ||
@@ -90,3 +90,3 @@ if (err) { | ||
modules = ENDER.util.reject(modules, queue, true); | ||
context = [type, ENDER.util.unique(ENDER.cmd.normalize(modules)).join(' ')].join(' ') + options.context; | ||
context = [type, ENDER.util.unique(ENDER.cmd.normalize(modules)).join(' ')].join(' ') + (options.context || ''); | ||
ENDER.file.assemble(modules, context, options, function (source) { | ||
@@ -129,3 +129,3 @@ var built = 0, isComplete = function () { | ||
type = (typeof _type == 'string' ? _type : type); | ||
context = [type, args.join(' ')].join(' ') + options.context; | ||
context = [type, args.join(' ')].join(' ') + (options.context || ''); | ||
API[type](args, options); | ||
@@ -226,3 +226,3 @@ }); | ||
ENDER.cmd.process(cmd, function(type, args, options) { | ||
context = [type, args.join(' ')].join(' ') + options.context; | ||
context = [type, args.join(' ')].join(' ') + (options.context || ''); | ||
API[type] ? | ||
@@ -229,0 +229,0 @@ API[type](args, options, callback) : |
{ | ||
"name": "ender", | ||
"description": "next level JavaScript modules", | ||
"version": "0.3.2", | ||
"version": "0.3.4", | ||
"authors": ["Dustin Diaz <@ded>", "Jacob Thornton <@fat>"], | ||
@@ -6,0 +6,0 @@ "keywords": ["ender", "modules", "builder", "framework", "packager"], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4356476
1152