mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-05 00:56:23 +00:00
Guard buildHyperframesRuntimeScript() against missing entry.ts so it returns null instead of crashing with esbuild stderr output. Add getHyperframeRuntimeScript() that returns the pre-built IIFE as a baked-in string constant — no esbuild, no file I/O, no import.meta.url. Consolidate CLI runtime source resolution into a single module with a clear priority chain: esbuild from source (dev) → inlined constant (production) → pre-built artifact file (fallback). Add CI smoke test that npm-packs the CLI, installs globally, runs hyperframes preview, and asserts no stderr errors + runtime endpoint returns JS. Bump version to 0.4.16.
23 lines
750 B
TypeScript
23 lines
750 B
TypeScript
import { buildHyperframesRuntimeScript } from "./hyperframesRuntime.engine";
|
|
import { HYPERFRAME_BRIDGE_SOURCES, HYPERFRAME_RUNTIME_GLOBALS } from "./runtimeContract";
|
|
|
|
export const HYPERFRAME_RUNTIME_ARTIFACTS = {
|
|
iife: "hyperframe.runtime.iife.js",
|
|
esm: "hyperframe.runtime.mjs",
|
|
manifest: "hyperframe.manifest.json",
|
|
} as const;
|
|
|
|
export type HyperframeRuntimeContract = {
|
|
globals: typeof HYPERFRAME_RUNTIME_GLOBALS;
|
|
messageSources: typeof HYPERFRAME_BRIDGE_SOURCES;
|
|
};
|
|
|
|
export const HYPERFRAME_RUNTIME_CONTRACT: HyperframeRuntimeContract = {
|
|
globals: HYPERFRAME_RUNTIME_GLOBALS,
|
|
messageSources: HYPERFRAME_BRIDGE_SOURCES,
|
|
};
|
|
|
|
export function loadHyperframeRuntimeSource(): string | null {
|
|
return buildHyperframesRuntimeScript();
|
|
}
|