Move bugged peerDependencies -> engines

This commit is contained in:
Nick Farina
2015-11-02 12:04:18 -08:00
parent 1779ddd754
commit 15cc98217b
3 changed files with 6 additions and 5 deletions

View File

@@ -6,7 +6,8 @@
"keywords": [
"homebridge-plugin"
],
"peerDepdendencies": {
"engines": {
"node": ">=0.12.0",
"homebridge": ">=0.2.0"
},
"dependencies": {

View File

@@ -37,11 +37,11 @@ Plugin.prototype.load = function(options) {
var pjson = Plugin.loadPackageJSON(this.pluginPath);
// pluck out the HomeBridge version requirement
if (!pjson.peerDepdendencies || !pjson.peerDepdendencies.homebridge) {
throw new Error("Plugin " + this.pluginPath + " does not contain the 'homebridge' package in 'peerDepdendencies'.");
if (!pjson.engines || !pjson.engines.homebridge) {
throw new Error("Plugin " + this.pluginPath + " does not contain the 'homebridge' package in 'engines'.");
}
var versionRequired = pjson.peerDepdendencies.homebridge;
var versionRequired = pjson.engines.homebridge;
// make sure the version is satisfied by the currently running version of HomeBridge
if (!semver.satisfies(version, versionRequired)) {

View File

@@ -25,7 +25,7 @@
"homebridge": "bin/homebridge"
},
"engines": {
"node": ">= 0.12.0"
"node": ">=0.12.0"
},
"preferGlobal": true,
"dependencies": {