Skip to content

v0.1.0-alpha.6

Choose a tag to compare

@AlexTiTanium AlexTiTanium released this 11 Mar 07:37
· 33 commits to main since this release

What changed

Export CorePluginContext and RegisterFunction from public API

Two types were defined internally but missing from the public API, forcing framework-layer packages to duplicate them locally:

CorePluginContext<C, S> — the minimal context shape for core plugin authors. Contains only config and state — no emit, require, or has. Core plugins are self-contained infrastructure (log, storage, env) that get injected as APIs onto regular plugin contexts.

RegisterFunction — the typed callback passed to the events factory in plugin specs. Supports two modes:

  • Individual: register<PayloadType>(description?)
  • Bulk: register.map<EventMap>(descriptions?)

Both types are now exported directly from @moku-labs/core so framework authors can import them instead of maintaining local copies.

Why

Framework packages building on @moku-labs/core (e.g. a spa framework layer) need these types to write correctly typed core plugins and event declaration files. Without them being exported, each downstream package had to copy-paste the definitions locally — a maintenance hazard and a spec deviation.