everything-dev
Version:
A consolidated product package for building Module Federation apps with oRPC APIs.
50 lines • 2.85 kB
text/typescript
import { BosConfigInput } from "../types.mjs";
import { AppDescriptor, AppRegistry, PipelineFields } from "./schema.mjs";
//#region src/descriptor/resolve.d.ts
/**
* Pipeline-owned fields per app entry, keyed by app name. Authored
* descriptors never carry deployment state — the deploy map resolves local
* refs to URLs (today extracted verbatim from bos.config.json; tomorrow
* written back by the deploy pipeline).
*/
interface AppDeployEntry {
app?: Partial<Record<"host" | "ui" | "api" | "auth", PipelineFields>>;
plugins?: Record<string, PipelineFields>;
}
type DeployMap = Record<string, AppDeployEntry>;
declare const ATTACHMENT_FIELDS: readonly ["name", "proxy", "variables", "secrets", "routes", "shared", "connectSrc", "dependsOn", "version"];
/** Fields the attachment slots carry beyond the shared attachment set. */
declare const SLOT_INPUT_FIELDS: readonly ["development", "extends", "integrity"];
/** Descriptor → authoring-shape `BosConfigInput` (local refs only, no pipeline state). */
declare function toConfigInput(descriptor: AppDescriptor): BosConfigInput;
/**
* Flatten one app against the registry: `extends` inherits the base App's
* composition, the child's entries win (depth-1 — chains are deferred,
* wayfinder ticket 08). The consumed `extends` key is dropped from the
* output; the deploy map injects pipeline state.
*
* `extends` accepts a registry name or an imported App descriptor value —
* an imported parent is an inlined parent: same materialization, no fetch.
*/
declare function resolveApp(name: string, registry: AppRegistry, deployMap?: DeployMap, seen?: Set<string>): BosConfigInput;
/**
* Dev-time overlay — merged child-wins over a resolved config by the dev
* runner (ports, local-vs-remote sources, seeding). Overlays are never
* published: they exist only in `bos.dev.ts` and apply when the environment
* is development.
*/
declare function applyDevOverlay(resolved: BosConfigInput, overlay: Partial<AppDescriptor>): BosConfigInput;
/** Resolve every app in the registry. */
declare function resolveApps(registry: AppRegistry, deployMap?: DeployMap): Record<string, BosConfigInput>;
/**
* The inverse of `toConfigInput` for the scaffold surface: an authoring-shape
* config (as personalizeConfig computes it) back into the authored
* descriptor form a child's `bos.app.ts` embeds. Driven by the same field
* maps as `toConfigInput` so the two directions cannot drift; pipeline state
* (production URLs, integrity) is dropped — it is deploy-map territory,
* never authored.
*/
declare function configInputToDescriptor(input: BosConfigInput): AppDescriptor;
//#endregion
export { ATTACHMENT_FIELDS, AppDeployEntry, DeployMap, SLOT_INPUT_FIELDS, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, toConfigInput };
//# sourceMappingURL=resolve.d.mts.map