Comparing version 17.6.4 to 17.7.0
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -381,2 +381,5 @@ 'use strict'; | ||
internals.semver = Joi.string(); | ||
internals.plugin = internals.register.keys({ | ||
@@ -389,4 +392,12 @@ options: Joi.any(), | ||
multiple: Joi.boolean().default(false), | ||
dependencies: Joi.array().items(Joi.string()).single(), | ||
dependencies: [ | ||
Joi.array().items(Joi.string()).single(), | ||
Joi.object().pattern(/.+/, internals.semver) | ||
], | ||
once: true, | ||
requirements: Joi.object({ | ||
hapi: Joi.string(), | ||
node: Joi.string() | ||
}) | ||
.default(), | ||
pkg: Joi.object({ | ||
@@ -393,0 +404,0 @@ name: Joi.string(), |
@@ -19,2 +19,3 @@ 'use strict'; | ||
const Podium = require('podium'); | ||
const Somever = require('somever'); | ||
const Statehood = require('statehood'); | ||
@@ -342,7 +343,7 @@ | ||
for (const dependency of this.dependencies) { | ||
for (const dep of dependency.deps) { | ||
if (!this.registrations[dep]) { | ||
throw new Error('Plugin ' + dependency.plugin + ' missing dependency ' + dep); | ||
} | ||
for (const { deps, plugin } of this.dependencies) { | ||
for (const dep in deps) { | ||
const version = deps[dep]; | ||
Hoek.assert(this.registrations[dep], 'Plugin', plugin, 'missing dependency', dep); | ||
Hoek.assert(version === '*' || Somever.match(this.registrations[dep].version, version), 'Plugin', plugin, 'requires', dep, 'version', version, 'but found', this.registrations[dep].version); | ||
} | ||
@@ -349,0 +350,0 @@ } |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -8,2 +8,3 @@ 'use strict'; | ||
const Shot = require('shot'); | ||
const Somever = require('somever'); | ||
@@ -190,7 +191,20 @@ const Config = require('./config'); | ||
dependencies = [].concat(dependencies); | ||
// Normalize to { plugin: version } | ||
if (typeof dependencies === 'string') { | ||
dependencies = { [dependencies]: '*' }; | ||
} | ||
else if (Array.isArray(dependencies)) { | ||
const map = {}; | ||
for (const dependency of dependencies) { | ||
map[dependency] = '*'; | ||
} | ||
dependencies = map; | ||
} | ||
this._core.dependencies.push({ plugin: this.realm.plugin, deps: dependencies }); | ||
if (after) { | ||
this.ext('onPreStart', after, { after: dependencies }); | ||
this.ext('onPreStart', after, { after: Object.keys(dependencies) }); | ||
} | ||
@@ -407,2 +421,8 @@ } | ||
// Validate requirements | ||
const requirements = item.plugin.requirements; | ||
Hoek.assert(!requirements.node || Somever.match(process.version, requirements.node), 'Plugin', name, 'requires node version', requirements.node, 'but found', process.version); | ||
Hoek.assert(!requirements.hapi || Somever.match(this.version, requirements.hapi), 'Plugin', name, 'requires hapi version', requirements.hapi, 'but found', this.version); | ||
// Protect against multiple registrations | ||
@@ -409,0 +429,0 @@ |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
{ | ||
"version": "17.6.4", | ||
"version": "17.7.0", | ||
"name": "hapi", | ||
@@ -111,2 +111,7 @@ "lockfileVersion": 1, | ||
}, | ||
"somever": { | ||
"version": "2.0.0", | ||
"resolved": "https://registry.npmjs.org/somever/-/somever-2.0.0.tgz", | ||
"integrity": "sha512-9JaIPP+HxwYGqCDqqK3tRaTqdtQHoK6Qy3IrXhIt2q5x8fs8RcfU7BMWlFTCOgFazK8p88zIv1tHQXvAwtXMyw==" | ||
}, | ||
"statehood": { | ||
@@ -113,0 +118,0 @@ "version": "6.0.8", |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://hapijs.com", | ||
"version": "17.6.4", | ||
"version": "17.7.0", | ||
"repository": { | ||
@@ -32,2 +32,3 @@ "type": "git", | ||
"shot": "4.x.x", | ||
"somever": "2.x.x", | ||
"statehood": "6.x.x", | ||
@@ -34,0 +35,0 @@ "subtext": "6.x.x", |
@@ -11,5 +11,5 @@ <img src="https://raw.github.com/hapijs/hapi/master/images/17.png" align="right"/> | ||
Version 17.x only supports node v8.9.0 and over. For older version of node please use version 16.x. | ||
Version 17.x only supports node v8.12.0 and over. For older version of node please use version 16.x. | ||
Development version: **17.6.x** ([release notes](https://github.com/hapijs/hapi/issues?labels=release+notes&page=1&state=closed)) | ||
Development version: **17.7.x** ([release notes](https://github.com/hapijs/hapi/issues?labels=release+notes&page=1&state=closed)) | ||
[![Linux Build Status](https://secure.travis-ci.org/hapijs/hapi.svg?branch=master)](https://travis-ci.org/hapijs/hapi) | ||
@@ -16,0 +16,0 @@ [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/hapijs/hapi?branch=master&svg=true)](https://ci.appveyor.com/project/hueniverse/hapi) |
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
183013
4386
18
+ Addedsomever@2.x.x
+ Addedsomever@2.0.0(transitive)