Deno module for discovering and executing custom extensions, plugins, and add-ons written in TypeScript or any shell executable.
Modern applications utilities should have a small core and allows extensions
that extend functionality without touching core. If you're writing a utility
or application in Deno and want to allow contributors to add or modify
functionality without needing to touch your core, you should use this
Extensions
module.
Plugin
is the base contract for any extension regardless of nature or how it was registered. A plugin (extension) can be either or both andaction
/filter
:ActionPlugin
has anexecute(PluginContext)
method which performs an action and returnsActionResult
FilterPlugin
has afilter(PluginContext)
method which takes input and returnsFilterResult
.
PluginExecutive
is the extensions container (the application or utility itself) which provides extension hooks or commands.PluginRegistrar
is a vehicle for registering discovered plugins.PluginsSupplier
is defines a contract for supplying (either discovered or predefined) plugins.PluginSource
defines where a plugin was discovered or registered from.PluginContext<T extends PluginExecutive>
is given to each plugin when it's being executed.
ShellExePlugin
DenoModulePlugin
- Move Plugin focused interfaces to contract.ts so that each plugin only needs to pull in that specific TS file into its own module
- Create PluginLifecycle events like discover, activate, discard (on error), etc. which can be implemented by PluginExecutive or can be provided in Plugins meta data
- Add serviceHealth (ServiceHealthSupplier) for indicating healthy or unhealthy plugins
- Create plugin dependency management using CxGraph
- Create
ContextPlugin
which has aprepareContext(PluginContext)
method which only prepares a context that multiple extensions can use. - Create
ActionSync
andFilterSync
versions of Action and Filter - Consider adding ActionGenerateSync and FilterGenerateSync versions of Action and Filter
- Allow
Action*
orFilter*
to implementPluginSupplier
or other methods that will force rescanning of plugins in case they generate plugins - Add ability for a
Plugin
to be aPluginSupplier
so a plugin can register other dependent extensions.