From be56544400abbb4474e1215113f9a6f9209c7cea Mon Sep 17 00:00:00 2001 From: Matteo Figus Date: Fri, 1 Jul 2016 17:10:57 +0100 Subject: [PATCH 1/4] Dependency-graph upgraded --- npm-shrinkwrap.json | 6 +-- package.json | 2 +- src/registry/domain/plugins-initialiser.js | 43 +++++++++++----------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 239c9f89d..9425e8320 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", diff --git a/package.json b/package.json index 9051eabe1..1ae547aa3 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", 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)){ From e4583e965d57fb8c3d8bd674571c2ba80df7d453 Mon Sep 17 00:00:00 2001 From: Matteo Figus Date: Fri, 1 Jul 2016 17:14:56 +0100 Subject: [PATCH 2/4] npm --- npm-shrinkwrap.json | 121 ++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 55 insertions(+), 68 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9425e8320..b10ac0907 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -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", @@ -3310,4 +3297,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 1ae547aa3..d486369dc 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "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", "parse-author": "^1.0.0", From ebb815f89997bfc4af8425be27875a6c6c5166cb Mon Sep 17 00:00:00 2001 From: Matteo Figus Date: Fri, 1 Jul 2016 17:21:12 +0100 Subject: [PATCH 3/4] watch --- npm-shrinkwrap.json | 20 ++++++++++++++++---- package.json | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b10ac0907..3a16975f0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -3285,13 +3285,25 @@ "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" } } diff --git a/package.json b/package.json index d486369dc..d979a7749 100644 --- a/package.json +++ b/package.json @@ -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" } } From ffd80ba19f3ada09180179e03b0201f35b3c89c0 Mon Sep 17 00:00:00 2001 From: Matteo Figus Date: Fri, 1 Jul 2016 17:25:35 +0100 Subject: [PATCH 4/4] opn --- npm-shrinkwrap.json | 25 ++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 3a16975f0..c985eea15 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2968,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", diff --git a/package.json b/package.json index d979a7749..b8d87cc13 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "nomnom": "1.8.1", "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",