diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 239c9f89d..c985eea15 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -83,9 +83,9 @@ "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz" }, "dependency-graph": { - "version": "0.4.1", - "from": "dependency-graph@0.4.1", - "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.4.1.tgz" + "version": "0.5.0", + "from": "dependency-graph@latest", + "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.5.0.tgz" }, "detective": { "version": "4.3.1", @@ -1502,9 +1502,9 @@ } }, "npm": { - "version": "3.10.2", - "from": "npm@3.10.2", - "resolved": "https://registry.npmjs.org/npm/-/npm-3.10.2.tgz", + "version": "3.10.3", + "from": "npm@latest", + "resolved": "https://registry.npmjs.org/npm/-/npm-3.10.3.tgz", "dependencies": { "abbrev": { "version": "1.0.9", @@ -1522,9 +1522,9 @@ "resolved": "https://registry.npmjs.org/ansistyles/-/ansistyles-0.1.3.tgz" }, "aproba": { - "version": "1.0.3", - "from": "aproba@latest", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.0.3.tgz" + "version": "1.0.4", + "from": "aproba@>=1.0.3 <1.1.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.0.4.tgz" }, "archy": { "version": "1.0.0", @@ -1618,14 +1618,14 @@ "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", "dependencies": { "minimatch": { - "version": "3.0.2", - "from": "minimatch@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", + "version": "3.0.0", + "from": "minimatch@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", "dependencies": { "brace-expansion": { - "version": "1.1.5", + "version": "1.1.4", "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz", "dependencies": { "balanced-match": { "version": "0.4.1", @@ -1656,9 +1656,9 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" }, "minimatch": { - "version": "3.0.2", - "from": "minimatch@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", + "version": "3.0.0", + "from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", "dependencies": { "brace-expansion": { "version": "1.1.5", @@ -1692,9 +1692,9 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz" }, "has-unicode": { - "version": "2.0.0", - "from": "has-unicode@2.0.0", - "resolved": "file:../has-unicode" + "version": "2.0.1", + "from": "has-unicode@>=2.0.0 <2.1.0", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" }, "hosted-git-info": { "version": "2.1.5", @@ -1732,14 +1732,13 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", "dependencies": { "minimatch": { - "version": "3.0.2", - "from": "minimatch@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", + "version": "3.0.0", + "from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "dependencies": { "brace-expansion": { - "version": "1.1.5", + "version": "1.1.4", "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz", "dependencies": { "balanced-match": { "version": "0.4.1", @@ -1748,8 +1747,7 @@ }, "concat-map": { "version": "0.0.1", - "from": "concat-map@0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "from": "concat-map@0.0.1" } } } @@ -1871,19 +1869,19 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", "dependencies": { "minimatch": { - "version": "3.0.2", - "from": "minimatch@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", + "version": "2.0.10", + "from": "minimatch@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", "dependencies": { "brace-expansion": { - "version": "1.1.5", + "version": "1.1.3", "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", "dependencies": { "balanced-match": { - "version": "0.4.1", - "from": "balanced-match@>=0.4.1 <0.5.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" + "version": "0.3.0", + "from": "balanced-match@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" }, "concat-map": { "version": "0.0.1", @@ -1897,26 +1895,19 @@ } }, "minimatch": { - "version": "3.0.2", - "from": "minimatch@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", + "version": "1.0.0", + "from": "minimatch@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", "dependencies": { - "brace-expansion": { - "version": "1.1.5", - "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz", - "dependencies": { - "balanced-match": { - "version": "0.4.1", - "from": "balanced-match@>=0.4.1 <0.5.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" - }, - "concat-map": { - "version": "0.0.1", - "from": "concat-map@0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - } - } + "lru-cache": { + "version": "2.7.3", + "from": "lru-cache@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz" + }, + "sigmund": { + "version": "1.0.1", + "from": "sigmund@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz" } } }, @@ -2327,24 +2318,20 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", "dependencies": { "minimatch": { - "version": "3.0.2", - "from": "minimatch@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", + "version": "3.0.0", + "from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "dependencies": { "brace-expansion": { - "version": "1.1.5", + "version": "1.1.3", "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz", "dependencies": { "balanced-match": { - "version": "0.4.1", - "from": "balanced-match@>=0.4.1 <0.5.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" + "version": "0.3.0", + "from": "balanced-match@>=0.3.0 <0.4.0" }, "concat-map": { "version": "0.0.1", - "from": "concat-map@0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "from": "concat-map@0.0.1" } } } @@ -2371,9 +2358,9 @@ } }, "read-package-tree": { - "version": "5.1.4", - "from": "read-package-tree@>=5.1.3 <5.2.0", - "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.4.tgz" + "version": "5.1.5", + "from": "read-package-tree@>=5.1.4 <5.2.0", + "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.5.tgz" }, "readable-stream": { "version": "2.1.4", @@ -2788,9 +2775,9 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz" }, "semver": { - "version": "5.1.1", + "version": "5.1.0", "from": "semver@>=5.1.0 <5.2.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.1.1.tgz" + "resolved": "https://registry.npmjs.org/semver/-/semver-5.1.0.tgz" }, "sha": { "version": "2.0.1", @@ -2981,9 +2968,28 @@ "resolved": "https://registry.npmjs.org/omelette/-/omelette-0.3.1.tgz" }, "opn": { - "version": "1.0.1", - "from": "opn@1.0.1", - "resolved": "https://registry.npmjs.org/opn/-/opn-1.0.1.tgz" + "version": "4.0.2", + "from": "opn@latest", + "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", + "dependencies": { + "object-assign": { + "version": "4.1.0", + "from": "object-assign@>=4.0.1 <5.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz" + }, + "pinkie-promise": { + "version": "2.0.1", + "from": "pinkie-promise@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "dependencies": { + "pinkie": { + "version": "2.0.4", + "from": "pinkie@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + } + } + } + } }, "parse-author": { "version": "1.0.0", @@ -3298,16 +3304,28 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz" }, "watch": { - "version": "0.13.0", - "from": "watch@0.13.0", - "resolved": "https://registry.npmjs.org/watch/-/watch-0.13.0.tgz", + "version": "0.19.1", + "from": "watch@latest", + "resolved": "https://registry.npmjs.org/watch/-/watch-0.19.1.tgz", "dependencies": { + "exec-sh": { + "version": "0.2.0", + "from": "exec-sh@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.0.tgz", + "dependencies": { + "merge": { + "version": "1.2.0", + "from": "merge@>=1.1.3 <2.0.0", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz" + } + } + }, "minimist": { "version": "1.2.0", - "from": "minimist@>=1.1.0 <2.0.0", + "from": "minimist@>=1.2.0 <2.0.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz" } } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 9051eabe1..b8d87cc13 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "aws-sdk": "^2.4.2", "clean-css": "^3.4.18", "colors": "1.1.2", - "dependency-graph": "0.4.1", + "dependency-graph": "^0.5.0", "detective": "^4.3.1", "express": "3.21.2", "falafel": "1.2.0", @@ -66,9 +66,9 @@ "nice-cache": "0.0.5", "node-dir": "^0.1.14", "nomnom": "1.8.1", - "npm": "3.10.2", + "npm": "^3.10.3", "omelette": "0.3.1", - "opn": "1.0.1", + "opn": "^4.0.2", "parse-author": "^1.0.0", "read": "1.0.7", "semver": "^5.1.1", @@ -76,6 +76,6 @@ "tar.gz": "1.0.5", "uglify-js": "^2.6.4", "underscore": "1.8.3", - "watch": "0.13.0" + "watch": "^0.19.1" } } diff --git a/src/registry/domain/plugins-initialiser.js b/src/registry/domain/plugins-initialiser.js index a7c9716d3..7d504853d 100644 --- a/src/registry/domain/plugins-initialiser.js +++ b/src/registry/domain/plugins-initialiser.js @@ -14,34 +14,35 @@ var validatePlugins = function(plugins){ c++; if(!_.isObject(plugin.register) || !_.isFunction(plugin.register.register) || !_.isFunction(plugin.register.execute) || !_.isString(plugin.name)){ + throw new Error(format(strings.errors.registry.PLUGIN_NOT_VALID, plugin.name || c)); } }); }; var checkDependencies = function(plugins){ - var graph = new DepGraph(); + var graph = new DepGraph(); - plugins.forEach(function(p){ - graph.addNode(p.name); - }); + plugins.forEach(function(p){ + graph.addNode(p.name); + }); - plugins.forEach(function(p){ - if(!p.register.dependencies){ - return; - } + plugins.forEach(function(p){ + if(!p.register.dependencies){ + return; + } - p.register.dependencies.forEach(function(d){ - try { - graph.addDependency(p.name, d); - } - catch(err) { - throw new Error('unknown plugin dependency: ' + d); - } - }); + p.register.dependencies.forEach(function(d){ + try { + graph.addDependency(p.name, d); + } + catch(err) { + throw new Error('unknown plugin dependency: ' + d); + } }); + }); - return graph.overallOrder(); + return graph.overallOrder(); }; var deferredLoads = []; @@ -55,11 +56,11 @@ module.exports.init = function(pluginsToRegister, callback){ var registered = {}; try { - validatePlugins(pluginsToRegister); - checkDependencies(pluginsToRegister); + validatePlugins(pluginsToRegister); + checkDependencies(pluginsToRegister); } catch(err){ - return callback(err); + return callback(err); } var dependenciesRegistered = function(dependencies){ @@ -83,7 +84,7 @@ module.exports.init = function(pluginsToRegister, callback){ } if(!plugin.register.dependencies){ - plugin.register.dependencies = []; + plugin.register.dependencies = []; } if(!dependenciesRegistered(plugin.register.dependencies)){