ReferencePackages
@mwillbanks/tuil-plugin
Dependency-aware plugin registration, resolution, activation, and teardown for tuil.
Overview
Dependency-aware plugin registration, resolution, activation, and teardown for tuil.
@mwillbanks/tuil-plugin is independently installable and also participates in the
umbrella @mwillbanks/tuil runtime where applicable.
Installation
npm install @mwillbanks/tuil-pluginHow it operates
Plugins declare capabilities and dependencies, register services, commands, events, and typed extension points, then activate in dependency order with deterministic reverse teardown.
API
| API | Signature | Description |
|---|---|---|
DefaultExtensionPoints | interface DefaultExtensionPoints | Public interface DefaultExtensionPoints. |
ExtensionPointMap | type ExtensionPointMap | Public type ExtensionPointMap. |
ExtensionRegistry | interface ExtensionRegistry | Public interface ExtensionRegistry. |
Plugin | interface Plugin | Public interface Plugin. |
PluginCapability | type PluginCapability | Public type PluginCapability. |
PluginContext | interface PluginContext | Public interface PluginContext. |
PluginRegistryEntry | interface PluginRegistryEntry | Public interface PluginRegistryEntry. |
PluginRegistryQuery | interface PluginRegistryQuery | Public interface PluginRegistryQuery. |
Events and lifecycle
Plugins may declare or subscribe to the host application event map. Plugin health is exposed as an observable runtime surface.
All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.
Example
const plugin = createPlugin({ id: "analytics", activate(context) { return context.events.observe(track); } });