/** * `.brewing/preview.yaml` schema + parser — 0.16.0-α.5. * * Lightweight config that tells `slowcook preview deploy/teardown` how * to ssh into the consumer's box, where to put files, what port range * to allocate from, and what URL pattern the box's reverse proxy serves. * * Slowcook is stateless re: hosting. Each consumer provides their own * SSH-reachable box (Docker engine + reverse proxy with wildcard cert); * this config tells slowcook how to reach it. * * Hand-parsed (no yaml dep) because the schema is small + flat. If we * ever need anchors / multi-doc / etc, switch to the workspace's `yaml` * package — it's already a transitive dep via cli/dependencies. */ export interface PreviewConfig { type: "ssh"; host: string; user: string; /** GitHub Actions secret NAME holding the SSH private key. */ keySecret: string; port: number; /** Inclusive range to allocate Docker host ports from (e.g. [4000, 4099]). */ portRange: [number, number]; /** URL template; `{port}` is substituted. e.g. https://mock-{port}.preview.example.com */ urlTemplate: string; /** Absolute path on the box where slowcook stages PR builds. */ remoteRoot: string; /** Path within the consumer's repo to the mock app. Default: "mock". */ mockDir: string; } export declare class PreviewConfigError extends Error { constructor(message: string); } export declare const PREVIEW_CONFIG_PATH = ".brewing/preview.yaml"; /** * Parse `.brewing/preview.yaml`. Returns the typed config or throws * `PreviewConfigError` with a precise message identifying the missing * or malformed field. * * Accepts either: * * preview: * type: ssh * host: ... * ... * * or top-level keys (the `preview:` wrapper is optional but * recommended; consumers will likely add a `box:` or other top-level * sections later). */ export declare function parsePreviewConfig(yamlText: string): PreviewConfig; export declare function readPreviewConfig(repoRoot: string): PreviewConfig; /** * Build the preview URL for a given allocated port. */ export declare function urlForPort(cfg: PreviewConfig, port: number): string; /** * Container name for a given PR. Single source of truth so deploy + * teardown agree on the name. */ export declare function containerNameForPr(pr: number): string; /** * Image tag for a given PR. We rebuild per-PR (each PR has its own * scenario set), so tags don't collide. */ export declare function imageTagForPr(pr: number): string; /** * Remote staging directory for a given PR. Build artifacts + the tar * extract live here. */ export declare function remoteDirForPr(cfg: PreviewConfig, pr: number): string; //# sourceMappingURL=config.d.ts.map