module-deps
Advanced tools
Comparing version 0.11.0 to 0.11.1
28
index.js
@@ -16,4 +16,10 @@ var fs = require('fs'); | ||
if (!Array.isArray(mains)) mains = [ mains ].filter(Boolean); | ||
mains = mains.map(function (file) { | ||
return typeof file === 'object' ? file : path.resolve(file); | ||
var basedir = opts.basedir || process.cwd(); | ||
var entries = mains.map(function (file) { | ||
if (file && typeof file.pipe === 'function') { | ||
var n = Math.floor(Math.pow(16,8) * Math.random()).toString(16); | ||
return path.join(basedir, 'fake_' + n + '.js'); | ||
} | ||
return path.resolve(file); | ||
}); | ||
@@ -30,3 +36,8 @@ | ||
var top = { id: '/', filename: '/', paths: [] }; | ||
mains.forEach(function (main) { walk(main, top) }); | ||
mains.forEach(function (main, ix) { | ||
if (typeof main === 'object') { | ||
walk({ stream: main, file: entries[ix] }, top); | ||
} | ||
else walk(main, top) | ||
}); | ||
@@ -44,7 +55,4 @@ if (mains.length === 0) { | ||
if (id && typeof id === 'object' && typeof id.pipe === 'function') { | ||
return id.pipe(concat(function (src) { | ||
var n = Math.floor(Math.pow(16,8) * Math.random()).toString(16); | ||
var basedir = opts.basedir || process.cwd(); | ||
var file = path.join(basedir, 'fake_' + n + '.js'); | ||
if (typeof id === 'object') { | ||
return id.stream.pipe(concat(function (src) { | ||
var pkgfile = path.join(basedir, 'package.json'); | ||
@@ -58,3 +66,3 @@ fs.readFile(pkgfile, function (err, pkgsrc) { | ||
var trx = getTransform(pkg); | ||
applyTransforms(file, trx, src, pkg); | ||
applyTransforms(id.file, trx, src, pkg); | ||
}); | ||
@@ -184,3 +192,3 @@ })); | ||
}; | ||
if (mains.indexOf(file) >= 0) { | ||
if (entries.indexOf(file) >= 0) { | ||
rec.entry = true; | ||
@@ -187,0 +195,0 @@ } |
{ | ||
"name": "module-deps", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"description": "walk the dependency graph to generate json output that can be fed into browser-pack", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"JSONStream": "~0.6.4", | ||
"browser-resolve": "git://github.com/substack/node-browser-resolve.git#dir-replace", | ||
"browser-resolve": "~1.1.0", | ||
"resolve": "~0.4.0", | ||
@@ -15,0 +15,0 @@ "detective": "~2.1.2", |
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
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
26464
595
0
+ Addedbrowser-resolve@1.1.4(transitive)
+ Addedresolve@0.5.1(transitive)
Updatedbrowser-resolve@~1.1.0