@jetci/runtime-shim
v0.1.4-alpha.3
Published
Readme
@jetci/runtime-shim
Generic discovery shim used by @jetci/ir.
This package mirrors the shape of @jetci/sdk, but instead of running workflow logic it records event and job registrations. @jetci/ir uses it while safely inspecting workflow bundles to find out which events and jobs were declared.
Provider packages should usually not create their own runtime shim. Instead, provider SDKs define events using @jetci/sdk/extend; during discovery, @jetci/ir aliases those SDK imports to this reusable shim.
How It Is Used
Normal workflow code imports a real SDK:
import {onPullRequest} from "@jetci/github-sdk"During discovery, @jetci/ir bundles @jetci/github-sdk and redirects its imports:
@jetci/sdk -> @jetci/runtime-shim
@jetci/sdk/extend -> @jetci/runtime-shim/extendThat lets provider-defined events register into the active generic registrar. Imports from untrusted dependencies are routed to isolated shim islands instead, so dependency-created registrations do not affect the host-visible registrar.
Exports
@jetci/runtime-shim: shimmed baselineonPushanddefineJobAPIs.@jetci/runtime-shim/extend: shimmedcreateSdkScope,createEventEmitter, and helper types.@jetci/runtime-shim/registrar: registrar access used by@jetci/irgenerated discovery entrypoints.
The registrar subpath is exported for IR discovery plumbing, not for workflow authors. The older internal dist path should not be used by new code.
Build
pnpm --dir packages/runtime-shim build