RFC: Config key for components
As more and more components are developed, our config files are bound to be full of different strategies for configuring these components unless this is standardised. A code search reveals a few ways already:
-
@pubsweet/component-send-email
uses themailer
config key -
pubsweeet-component-ink-backend
used thepubsweet-component-ink-backend
config key -
@pubsweet/db-manager
usesdbManager
-
pubsweet-component-aws-s3
usespubsweet-component-aws-s3
I propose that we specify config for components in the same way everywhere and propose that way to be (as it already is in a few components):
'pubsweet-component-name': {
yourConfigHere: 'someconfig'
}
One case where this could be perceived as awkward is if a component's name is under the @pubsweet
npm org, e.g. @pubsweet/component-polling-server
:
'@pubsweet/component-polling-server': {
somePollingConfig: 'here'
}
Which is then accessed as config.get('@pubsweet/component-polling-server')
. In that case we could omit the @pubsweet
namespace and use e.g. component-polling-server
, but I propose we keep it simple and use the package name full stop.
- Use
👍 to vote for option 1: full package name. - Use
👌 to vote for option 2: full package name, with the exception of namespaced packages, in which case the@pubsweet
namespace is omitted - Use
👎 for 'none of the above, here's my suggestion'