check-peer-dependencies
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -0,1 +1,11 @@ | ||
## 1.0.5 (2019-11-24) | ||
[Compare `check-peer-dependencies` versions 1.0.4 and 1.0.5](https://github.com/christopherthielen/check-peer-dependencies/compare/1.0.4...1.0.5) | ||
### Features | ||
* Recursively check for new unmet peer dependencies after installing when using --install ([b632efb](https://github.com/christopherthielen/check-peer-dependencies/commit/b632efb)) | ||
## 1.0.4 (2019-10-26) | ||
@@ -2,0 +12,0 @@ [Compare `check-peer-dependencies` versions 1.0.3 and 1.0.4](https://github.com/christopherthielen/check-peer-dependencies/compare/1.0.3...1.0.4) |
@@ -20,3 +20,3 @@ #!/usr/bin/env node | ||
var solution_1 = require("./solution"); | ||
function checkPeerDependencies(packageManager, installMissingPeerDependencies) { | ||
function getAllNestedPeerDependencies() { | ||
var gatheredDependencies = packageUtils_1.gatherPeerDependencies("."); | ||
@@ -28,3 +28,8 @@ var allNestedPeerDependencies = gatheredDependencies.map(function (dep) { | ||
return __assign(__assign({}, dep), { installedVersion: installedVersion, semverSatisfies: semverSatisfies, isYalc: isYalc }); | ||
}).sort(function (a, b) { return ("" + a.name + a.depender).localeCompare("" + b.name + b.depender); }); | ||
}); | ||
return allNestedPeerDependencies.sort(function (a, b) { return ("" + a.name + a.depender).localeCompare("" + b.name + b.depender); }); | ||
} | ||
var recursiveCount = 0; | ||
function checkPeerDependencies(packageManager, installMissingPeerDependencies) { | ||
var allNestedPeerDependencies = getAllNestedPeerDependencies(); | ||
allNestedPeerDependencies.forEach(function (dep) { | ||
@@ -75,2 +80,16 @@ if (dep.semverSatisfies) { | ||
}); | ||
var newUnsatisfiedDeps = getAllNestedPeerDependencies().filter(function (dep) { return !dep.semverSatisfies; }); | ||
if (newUnsatisfiedDeps.length > 0) { | ||
console.log("Found " + newUnsatisfiedDeps.length + " new unmet peerDependencies..."); | ||
if (++recursiveCount < 5) { | ||
return checkPeerDependencies(packageManager, installMissingPeerDependencies); | ||
} | ||
else { | ||
console.error('Recursion limit reached (5)'); | ||
process.exit(5); | ||
} | ||
} | ||
else { | ||
console.log('All peer dependencies are met'); | ||
} | ||
} | ||
@@ -77,0 +96,0 @@ else { |
{ | ||
"name": "check-peer-dependencies", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Checks peer dependencies of the current package. Offers solutions for any that are unmet.", | ||
@@ -5,0 +5,0 @@ "main": "dist/check_peer_dependencies.js", |
Sorry, the diff of this file is not supported yet
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
35806
399