chore: enforce folder module discipline in @uncaged/workflow

Each folder now has:
- types.ts for all type definitions
- index.ts with pure re-exports only
- Cross-folder imports go through index.ts

Closes #106
This commit is contained in:
2026-05-08 01:37:23 +00:00
parent a4237c0462
commit 2bbe5a3d0e
38 changed files with 389 additions and 262 deletions
@@ -1,20 +1,10 @@
import type { WorkflowFn } from "../types.js";
import { err, ok, type Result } from "../util/result.js";
import { err, ok, type Result } from "../util/index.js";
import { importWorkflowBundleModule } from "./bundle-import-env.js";
import { ensureUncagedWorkflowSymlink } from "./ensure-uncaged-workflow-symlink.js";
import type { WorkflowDescriptor } from "./workflow-descriptor.js";
import type { ExtractBundleExportsOptions, ExtractedBundleExports } from "./types.js";
import { validateWorkflowDescriptor } from "./workflow-descriptor.js";
export type ExtractedBundleExports = {
run: WorkflowFn;
descriptor: WorkflowDescriptor;
};
export type ExtractBundleExportsOptions = {
/** When set, ensures `node_modules/@uncaged/workflow` exists under this root before import. */
storageRoot: string | null;
};
/** Load a workflow `.esm.js` bundle and read its named exports (`run`, `descriptor`). */
export async function extractBundleExports(
bundlePath: string,