Comparing version 0.0.1 to 0.0.2
11
deps.js
@@ -9,3 +9,4 @@ import graphlib from 'graphlib'; | ||
packages.forEach((pkg) => { | ||
Object.keys(packages).forEach((key) => { | ||
const pkg = packages[key]; | ||
const info = require(pkg.file); | ||
@@ -16,4 +17,4 @@ const pkgDeps = info.dependencies || {}; | ||
Object.keys(pkgDeps) | ||
.filter(dName => packages.has(dName)) | ||
.filter(dName => lenient || semver.satisfies(packages.get(dName).version, pkgDeps[dName])) | ||
.filter(dName => packages[dName]) | ||
.filter(dName => lenient || semver.satisfies(packages[dName].version, pkgDeps[dName])) | ||
.forEach(dName => graph.setEdge(pkg.name, dName, pkgDeps[dName])); | ||
@@ -26,5 +27,5 @@ }); | ||
pName, | ||
packages.get(pName).version, | ||
packages[pName].version, | ||
graph.successors(pName).map(dName => dName + '#' + graph.edge(pName, dName)), | ||
packages.get(pName).file | ||
packages[pName].file | ||
]); | ||
@@ -31,0 +32,0 @@ }; |
@@ -30,3 +30,4 @@ 'use strict'; | ||
packages.forEach(function (pkg) { | ||
Object.keys(packages).forEach(function (key) { | ||
var pkg = packages[key]; | ||
var info = require(pkg.file); | ||
@@ -37,5 +38,5 @@ var pkgDeps = info.dependencies || {}; | ||
Object.keys(pkgDeps).filter(function (dName) { | ||
return packages.has(dName); | ||
return packages[dName]; | ||
}).filter(function (dName) { | ||
return lenient || _semver2.default.satisfies(packages.get(dName).version, pkgDeps[dName]); | ||
return lenient || _semver2.default.satisfies(packages[dName].version, pkgDeps[dName]); | ||
}).forEach(function (dName) { | ||
@@ -47,5 +48,5 @@ return graph.setEdge(pkg.name, dName, pkgDeps[dName]); | ||
return _graphlib2.default.alg.topsort(graph).reverse().map(function (pName) { | ||
return [pName, packages.get(pName).version, graph.successors(pName).map(function (dName) { | ||
return [pName, packages[pName].version, graph.successors(pName).map(function (dName) { | ||
return dName + '#' + graph.edge(pName, dName); | ||
}), packages.get(pName).file]; | ||
}), packages[pName].file]; | ||
}); | ||
@@ -52,0 +53,0 @@ }; |
{ | ||
"name": "croc-deps", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "", | ||
@@ -15,6 +15,6 @@ "main": "dist/deps-es5.js", | ||
"dependencies": { | ||
"croc-list": "0.0.1", | ||
"graphlib": "^1.0.7", | ||
"semver": "^5.0.3" | ||
"croc-list": "~0.0.2", | ||
"graphlib": "~1.0.7", | ||
"semver": "~5.0.3" | ||
} | ||
} |
3674
78
+ Addedcroc-list@0.0.10(transitive)
+ Addedsemver@5.0.3(transitive)
+ Addedshelljs@0.6.1(transitive)
- Removedcroc-list@0.0.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedshelljs@0.5.3(transitive)
Updatedcroc-list@~0.0.2
Updatedgraphlib@~1.0.7
Updatedsemver@~5.0.3