module-deps
Advanced tools
Comparing version 0.10.1 to 0.10.2
41
index.js
@@ -42,16 +42,2 @@ var fs = require('fs'); | ||
var trx = []; | ||
parent.packageFilter = function (pkg) { | ||
if (opts.packageFilter) pkg = opts.packageFilter(pkg); | ||
if (opts.transformKey) { | ||
var n = pkg; | ||
opts.transformKey.forEach(function (key) { | ||
if (n && typeof n === 'object') n = n[key]; | ||
}); | ||
trx = [].concat(n).filter(Boolean); | ||
} | ||
return pkg; | ||
}; | ||
var c = opts.cache && opts.cache[parent.id]; | ||
@@ -66,3 +52,3 @@ var resolver = c && typeof c === 'object' | ||
resolver(id, parent, function (err, file) { | ||
resolver(id, parent, function (err, file, pkg) { | ||
if (err) return output.emit('error', err); | ||
@@ -80,8 +66,17 @@ if (!file) return output.emit('error', new Error([ | ||
var trx = []; | ||
if (opts.transformKey) { | ||
var n = pkg; | ||
opts.transformKey.forEach(function (key) { | ||
if (n && typeof n === 'object') n = n[key]; | ||
}); | ||
trx = [].concat(n).filter(Boolean); | ||
} | ||
if (cache && cache[file]) { | ||
parseDeps(file, cache[file]); | ||
parseDeps(file, cache[file], pkg); | ||
} | ||
else fs.readFile(file, 'utf8', function (err, src) { | ||
if (err) return output.emit('error', err); | ||
applyTransforms(file, trx, src); | ||
applyTransforms(file, trx, src, pkg); | ||
}); | ||
@@ -91,3 +86,3 @@ }); | ||
function applyTransforms (file, trx, src) { | ||
function applyTransforms (file, trx, src, pkg) { | ||
var isTopLevel = mains.some(function (main) { | ||
@@ -106,3 +101,3 @@ var m = path.relative(path.dirname(main), file); | ||
s.on('error', output.emit.bind(output, 'error')); | ||
s.pipe(concatStream(function (err, data) { | ||
s.pipe(concatStream(function (data) { | ||
src = data; | ||
@@ -116,7 +111,7 @@ ap(trs.slice(1)); | ||
function done () { | ||
parseDeps(file, src); | ||
parseDeps(file, src, pkg); | ||
} | ||
} | ||
function parseDeps (file, src) { | ||
function parseDeps (file, src, pkg) { | ||
var deps; | ||
@@ -143,3 +138,3 @@ if (!Buffer.isBuffer(src) && typeof src === 'object') { | ||
var p = deps.length; | ||
var current = { id: file, filename: file, paths: [] }; | ||
var current = { id: file, filename: file, paths: [], package: pkg }; | ||
var resolved = {}; | ||
@@ -153,3 +148,3 @@ | ||
} | ||
walk(id, current, function (r) { | ||
@@ -156,0 +151,0 @@ resolved[id] = r; |
{ | ||
"name": "module-deps", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "walk the dependency graph to generate json output that can be fed into browser-pack", | ||
@@ -10,8 +10,8 @@ "main": "index.js", | ||
"dependencies": { | ||
"through": "~2.3.2", | ||
"JSONStream": "~0.4.3", | ||
"browser-resolve": "~0.1.0", | ||
"resolve": "~0.3.0", | ||
"detective": "~2.1.1", | ||
"concat-stream": "~0.1.1" | ||
"through": "~2.3.4", | ||
"JSONStream": "~0.6.4", | ||
"browser-resolve": "git://github.com/substack/node-browser-resolve.git#dir-replace", | ||
"resolve": "~0.4.0", | ||
"detective": "~2.1.2", | ||
"concat-stream": "~1.0.0" | ||
}, | ||
@@ -18,0 +18,0 @@ "devDependencies": { |
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
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
24090
57
525
1
11
+ AddedJSONStream@0.6.4(transitive)
+ Addedbops@0.0.6(transitive)
+ Addedconcat-stream@1.0.1(transitive)
+ Addedresolve@0.4.3(transitive)
+ Addedthrough@2.2.7(transitive)
+ Addedto-utf8@0.0.1(transitive)
- RemovedJSONStream@0.4.4(transitive)
- Removedbrowser-resolve@0.1.1(transitive)
- Removedbuffer-browserify@0.0.5(transitive)
- Removedconcat-stream@0.0.80.1.1(transitive)
- Removedconsole-browserify@0.1.6(transitive)
- Removedcrypto-browserify@0.2.1(transitive)
- Removedhttp-browserify@0.1.11(transitive)
- Removedresolve@0.3.1(transitive)
- Removedvm-browserify@0.0.1(transitive)
- Removedzlib-browserify@0.0.1(transitive)
UpdatedJSONStream@~0.6.4
Updatedbrowser-resolve@git://github.com/substack/node-browser-resolve.git#dir-replace
Updatedconcat-stream@~1.0.0
Updateddetective@~2.1.2
Updatedresolve@~0.4.0
Updatedthrough@~2.3.4