use-plugin
Advanced tools
Comparing version 8.2.0 to 9.0.0
{ | ||
"name": "use-plugin", | ||
"version": "8.2.0", | ||
"version": "9.0.0", | ||
"description": "Generic plugin loader functionality for Node.js frameworks.", | ||
@@ -8,2 +8,3 @@ "main": "use.js", | ||
"test": "lab -v test/use.test.js -L -t 85 -r console -o stdout -r html -o test/coverage.html", | ||
"test-some": "lab -v test/*.test.js -g", | ||
"coveralls": "lab -s test/use.test.js -r lcov | coveralls", | ||
@@ -15,3 +16,4 @@ "coverage": "lab -v test/use.test.js -t 85 -r html > coverage.html", | ||
"repo-tag": "REPO_VERSION=`node -e \"console.log(require('./package').version)\"` && echo TAG: v$REPO_VERSION && git commit -a -m v$REPO_VERSION && git push && git tag v$REPO_VERSION && git push --tags;", | ||
"repo-publish": "npm run prettier && npm test && npm run repo-tag --registry http://registry.npmjs.org && npm publish --registry http://registry.npmjs.org " | ||
"repo-publish": "npm run clean && npm i && npm run repo-publish-quick", | ||
"repo-publish": "npm run prettier && npm test && npm run repo-tag && npm publish --registry https://registry.npmjs.org " | ||
}, | ||
@@ -30,3 +32,3 @@ "repository": { | ||
"eraro": "^2.1.0", | ||
"nid": "^1.1.0", | ||
"nid": "^1.3.3", | ||
"norma": "^2.0.2", | ||
@@ -36,6 +38,7 @@ "optioner": "^5.0.1" | ||
"devDependencies": { | ||
"@hapi/lab": "^22.0.4", | ||
"@hapi/code": "^8.0.1", | ||
"coveralls": "^3.1.0", | ||
"prettier": "^2.0.5" | ||
"gubu": "^2.0.0", | ||
"@hapi/code": "^8.0.7", | ||
"@hapi/lab": "^24.5.1", | ||
"coveralls": "^3.1.1", | ||
"prettier": "^2.6.1" | ||
}, | ||
@@ -42,0 +45,0 @@ "files": [ |
20
use.js
@@ -38,2 +38,3 @@ /* Copyright © 2014-2020 Richard Rodger and other contributors, MIT License. */ | ||
merge_defaults: true, | ||
gubu: true, | ||
}, | ||
@@ -114,2 +115,3 @@ useopts | ||
// TODO: deprecate | ||
var Joi = Optioner.Joi | ||
@@ -119,3 +121,7 @@ | ||
plugin_desc.init && | ||
plugin_desc.init.defaults && | ||
(Joi.isSchema(plugin_desc.init.defaults, { legacy: true }) || | ||
// TODO: use Gubu.isShape | ||
(plugin_desc.init.defaults.gubu && | ||
plugin_desc.init.defaults.gubu.gubu$) || | ||
'function' === typeof plugin_desc.init.defaults) | ||
@@ -125,4 +131,7 @@ ) { | ||
} else if ( | ||
Joi.isSchema(plugin_desc.defaults, { legacy: true }) || | ||
'function' === typeof plugin_desc.defaults | ||
plugin_desc.defaults && | ||
(Joi.isSchema(plugin_desc.defaults, { legacy: true }) || | ||
// TODO: use Gubu.isShape | ||
(plugin_desc.defaults.gubu && plugin_desc.defaults.gubu.gubu$) || | ||
'function' === typeof plugin_desc.defaults) | ||
) { | ||
@@ -304,3 +313,3 @@ defaults = plugin_desc.defaults | ||
if (funcdesc.error) | ||
if (funcdesc.error) { | ||
throw handle_load_error( | ||
@@ -312,2 +321,3 @@ funcdesc.error, | ||
) | ||
} | ||
@@ -419,2 +429,6 @@ builtin = false | ||
if ('MODULE_NOT_FOUND' == e.code) { | ||
// TODO: this fails if a sub file of the plugin module fails, | ||
// as the module name is within the file path | ||
// E.g. seneca-entity/lib/common.js | ||
// A require failed inside the plugin. | ||
@@ -421,0 +435,0 @@ if (-1 == e.message.indexOf(search.name)) { |
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
24810
451
5
Updatednid@^1.3.3