You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add the plugin to custody settings, by which I mean, at minimum, adding the name of the plugin to the "plugins" array.
Post-install setup
A wrinkle in step 2 above is that some plugins like @custody/plugin-log-notifier require additional arguments in settings (patterns has no default here). Some thoughts on how to handle this:
Without doing anything
We let the user observe that the plugin isn't working and check custody's logs, in which case they would see an error (thrown here) and go check the plugin's README to fix it.
Placeholder settings
We make it possible for plugins to export "placeholder settings", to write into custody's settings, e.g. in the case of @custody/plugin-log-notifier maybe we have that plugin do
module.exports=function(){/* the plugin definition */};module.exports.settings={patterns: []};
Other ways of doing this without messing with module.exports would be to optionally define settings.json file in the root of the plugin, or put the settings under some new field in the plugin's package.json.
Either way, the contents of settings(.json) would get written into custody settings like
Although this is still not functional (just suppresses the error)—the user has to fill that array out. (If an empty array would truly suffice, the plugin could have just made that a default argument here.)
So, to get the user to fill that out, custody-cli install might:
if it discovers any settings on installation
print a message saying "One or more plugins require post-install setup. Open settings to finish installation?"
And then if the user says yes, pop custody-cli settings like previous.
The text was updated successfully, but these errors were encountered:
There's probably an opportunity for plugins to provide (a link to) setup instructions in tandem with, or in place of, the "placeholder settings" idea above.
custody-cli install <plugin package name>
shouldnpm install
the pluginPost-install setup
A wrinkle in step 2 above is that some plugins like
@custody/plugin-log-notifier
require additional arguments in settings (patterns
has no default here). Some thoughts on how to handle this:Without doing anything
We let the user observe that the plugin isn't working and check custody's logs, in which case they would see an error (thrown here) and go check the plugin's README to fix it.
Placeholder settings
We make it possible for plugins to export "placeholder settings", to write into custody's settings, e.g. in the case of
@custody/plugin-log-notifier
maybe we have that plugin doOther ways of doing this without messing with
module.exports
would be to optionally definesettings.json
file in the root of the plugin, or put the settings under some new field in the plugin'spackage.json
.Either way, the contents of
settings(.json)
would get written into custody settings likeAlthough this is still not functional (just suppresses the error)—the user has to fill that array out. (If an empty array would truly suffice, the plugin could have just made that a default argument here.)
So, to get the user to fill that out,
custody-cli install
might:custody-cli settings
like previous.The text was updated successfully, but these errors were encountered: