Closed jeromecovington closed 5 years ago
Those are both valid formats for a hapi plugin ({ plugin: { pkg, register } }
and { pkg, register }
), and the fact that good is a hapi plugin is the extent of its public-facing API (aside from it's registration options, of course!). I'm curious in what way you're using good that would cause a breakage. If your hapi wrapper duplicates any of hapi's code for normalizing plugins, perhaps your code doesn't support hapi plugins in this format.
Yep, that makes sense. It'd been a while since I read the details of the normalized plugin pattern in https://github.com/hapijs/hapi/issues/3658
Replace the
exports.register()
and the matching exports.register.attributes withexports.plugin = { register, name, version, multiple, dependencies, once, pkg }
So it looks like this is a previously anticipated spec that Good
finally made "good" on. On my side I am requiring and then re-exporting Good
along with some options as a custom or wrapped logging plugin. It should be a simple matter of just re-exporting (in my code) as exports.plugin = Good.plugin
rather than exports.plugin = Good
. Either way appreciate the quick response @devinivy.
You got it! 👍
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
I was attempting to take the update from v8.1.1 to v.8.1.2 and found that the exports pattern in the new version was breaking the tests in my downstream wrapper around hapi.
The problem seems to be that
register
is no longer exported directly on theexports
object but is now a property ofexports.plugin
.register
directly onexports
in v8.1.1register
as property ofexports.plugin
in v8.1.2I was surprised to see this change in a semver minor publish so wanted to check in on the reason for this before I refactor my code.