tuil
ReferencePackages

@mwillbanks/tuil-plugin

Dependency-aware plugin registration, resolution, activation, and teardown for tuil.

View rawEdit

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-plugin

How it operates

Plugins declare capabilities and dependencies, register services, commands, events, and typed extension points, then activate in dependency order with deterministic reverse teardown.

Documentation flow diagram. resolve graph; register; initialize; activate; deactivate; dispose; S0 leads to S1; S1 leads to S2
Documentation flow diagram. resolve graph; register; initialize; activate; deactivate; dispose; S0 leads to S1; S1 leads to S2

API

APISignatureDescription
DefaultExtensionPointsinterface DefaultExtensionPointsPublic interface DefaultExtensionPoints.
ExtensionPointMaptype ExtensionPointMapPublic type ExtensionPointMap.
ExtensionRegistryinterface ExtensionRegistryPublic interface ExtensionRegistry.
Plugininterface PluginPublic interface Plugin.
PluginCapabilitytype PluginCapabilityPublic type PluginCapability.
PluginContextinterface PluginContextPublic interface PluginContext.
PluginRegistryEntryinterface PluginRegistryEntryPublic interface PluginRegistryEntry.
PluginRegistryQueryinterface PluginRegistryQueryPublic 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); } });

On this page