/** * Port-time source transforms — 0.16.0-α.8. * * `slowcook port` is the deterministic mock → src copy step. It walks * mock/src/components/ + mock/src/app/, copies each file to the * mirrored src/ path, and applies a small set of import + hook * rewrites so the production component reads its data from the real * Supabase layer instead of the mock-runtime scenarios. * * The transform is intentionally narrow: * * import { useScenarioFixture } from "@slowcook-ai/mock-runtime"; * ↓ * import { useDataDomain } from "@/lib/data"; * * const x = useScenarioFixture("pins"); * ↓ * const x = useDataDomain("pins"); * * The new `@/lib/data#useDataDomain` is brew's territory (α.9 writes * the real implementation against Supabase). At port-time, all that * exists in src/lib/data/ may be a stub `useDataDomain` — brew fills * the body. That keeps tests red until brew's done. * * Pure functions over strings. No fs access. Same input → same output. */ export interface PortTransformResult { /** New file body. */ output: string; /** Each rewrite that fired (for the audit-trail commit message). */ rewrites: string[]; } /** * Apply all port-time source transforms to a single file's contents. * Returns the transformed body + the list of rewrites that fired. */ export declare function transformForPort(input: string, opts?: { storyId?: string; }): PortTransformResult; /** * Translate a `mock/` path into the corresponding `src/` * path. Used by the file walker. * * Examples: * mock/src/components/rewo/RewoCard.tsx → src/components/rewo/RewoCard.tsx * mock/src/app/(main)/u/[handle]/page.tsx → src/app/(main)/u/[handle]/page.tsx * mock/src/lib/scenario-registry.ts → null (mock-only; never ports) * mock/scenarios/story-017.ts → null (mock-only; never ports) * * Note: collisions with the consumer's hand-written src/ files (e.g. * mock/src/app/layout.tsx vs the consumer's real src/app/layout.tsx) * are NOT filtered here. The walker handles them at write-time by * checking for the @slowcook-port-from marker on the destination — * unmarked destinations are skipped, never overwritten. That keeps * this mapping a pure path translation (no hardcoded shell list). */ export declare function mockPathToSrcPath(mockPath: string): string | null; /** * File-level skip marker. A mock file that contains * `@slowcook-port-skip` in its first 20 lines is treated as * mock-only — port walks past it without writing anything in src/. * * Use this for mock-only shims (e.g. a `mock/src/lib/mock-foo.ts` * that exists only so the mock app builds; the corresponding prod * code lives elsewhere). */ export declare function isMockOnlyFile(input: string): boolean; //# sourceMappingURL=transform.d.ts.map