ump-plugin-core
v0.0.1
Published
UMP Plugin System Core - Plugin manager and interfaces
Downloads
1,062
Readme
ump-plugin-core
UMP Plugin System Core — plugin manager and lifecycle interfaces.
Install
npm install ump-plugin-core --save
This is the foundation every other UMP plugin depends on. Apps don't
typically import it directly; plugins use its UMPPlugin interface as the
contract returned from their factory functions, and the host runtime uses
PluginManager to register / dispatch lifecycle events.
Usage
import type { UMPPlugin } from 'ump-plugin-core'; import { PluginManager } from 'ump-plugin-core';
// Inside a plugin package: export function myPlugin(): UMPPlugin { return { name: 'ump-plugin-my-thing', appDidMount(app) { /* ... / }, appWillUnmount(app) { / ... */ }, }; }
// Inside the runtime / host: const pm = new PluginManager(); pm.register(myPlugin());
See src/index.ts for the full API.
Plugin authoring
This is a UMP plugin. See docs/superpowers/specs/plugin-authoring-guide.md for the plugin model.
