@parel/plugin-sdk
v0.7.0
Published
Plugin authoring helpers for PAREL runtime plugins.
Readme
@parel/plugin-sdk
Plugin authoring helpers for PAREL runtime plugins.
Part of PAREL.
Install
npm install @parel/plugin-sdkUsage
Author a runtime plugin with definePlugin:
import { definePlugin, LifecycleEvent } from "@parel/plugin-sdk";
export default definePlugin({
name: "@example/my-plugin",
version: "0.1.0",
async setup(ctx) {
ctx.hook(LifecycleEvent.ContextBuild, async (hookCtx) => ({
action: "continue",
mutations: {
system: hookCtx.system ? `${hookCtx.system}\n\nBe concise.` : "Be concise.",
},
}));
},
});See the plugin protocol for the full context API and lifecycle events.
License
MIT — see LICENSE.
