/** * Build-output mapping for deploy bindings (change: add-iac-deploy-binding-commands). * * A deployed handler usually names the BUILT file — `dist/orders.handler`, `build/index.handler` — * while the graph indexes the source. Without a mapping such a handler binds to nothing and the * resource's code reads as absent; with one, `aws_lambda_function.orders` reaches `src/orders.ts`. * * The mapping is the project's own declaration, never a guess: * - TypeScript's `compilerOptions.outDir` + `rootDir`: a path under `outDir` is the same path * under `rootDir` (the rule the config-wiring adapter already applies to a `bin` entry). * - A package's `main` paired with `source` (the parcel/microbundle convention): the one names * the output, the other names the input. * * Only the REPOSITORY ROOT's `tsconfig.json` and `package.json` are read, and an `extends` chain * is not followed: a monorepo whose mapping lives in `packages/api/tsconfig.json`, or a root * config that inherits `rootDir` from a base, has no mapping here. The unresolved binding says * exactly that rather than claiming the project declares none. * * An `outDir` with no `rootDir` and no `source` maps nothing: the output path says nothing about * where its input lives, and a same-basename file elsewhere is a similarity match, which this * substrate does not make. That case is disclosed as `build-output-unmapped`, the same reason the * config-wiring adapter gives. */ export interface BuildOutputMap { /** Normalized `outDir`, without a trailing slash; absent when the project declares none. */ outDir?: string; /** Normalized `rootDir`; absent when the project declares none. */ rootDir?: string; /** Normalized `main` → `source` pair from the package manifest, when it declares both. */ mainToSource?: { main: string; source: string; }; } /** * The build-output mapping a repository declares, from its root `tsconfig.json` and * `package.json`. An absent or unreadable config simply contributes nothing. */ export declare function readBuildOutputMap(files: ReadonlyMap): BuildOutputMap; /** * The source paths the project's declared mapping says a module path came from — repository-root * relative, because that is where the mapping was declared. Empty when the mapping says nothing * about this path. * * These are kept apart from the path itself on purpose: the path is resolved relative to the * template's directory as well, while a mapped stem is only ever meaningful from the root. Joining * a root mapping to a manifest's directory bound `dist/orders` under `services/api/` to * `services/src/orders.ts` for a `rootDir` of `../src` — a file the root config never described. */ export declare function mappedSourceStems(module: string, map: BuildOutputMap | undefined): string[]; /** Whether a module path sits under a declared `outDir` that maps to no declared input. */ export declare function isUnmappedBuildOutput(module: string, map: BuildOutputMap | undefined): boolean; //# sourceMappingURL=build-output.d.ts.map