/** * The features a generated app can be composed from, each a directory of * `examples/full`, which CI boots and tours on every push - a template nobody runs * rots. `bun run sync:templates` copies them in and `features.test.ts` fails on * drift. * * The wiring is not copied: `app.module.ts`, `config.ts` and `main.ts` name every * feature at once, so they are generated from the selection. */ export interface Feature { /** Flag name, and the directory under `templates/features/`. */ readonly name: string; /** The directory in `examples/full/src` this mirrors. */ readonly source: string; readonly summary: string; /** Features this one imports from, pulled in automatically. */ readonly requires: readonly string[]; /** The module class to import, and the file it comes from. */ readonly module: { readonly klass: string; readonly from: string; }; /** Runtime dependencies this feature adds to the generated manifest. */ readonly dependencies: readonly string[]; /** Config groups this feature reads, contributed to the generated config. */ readonly config: readonly string[]; /** * A service that has to be running for the feature to do anything, named so the * prompt and the generated README list it instead of the app failing obscurely. */ readonly service?: string; } /** * Config groups, keyed by the name a feature asks for. `env` lands in * `.env.example`, `schema` is the zod line, `field` the `AppConfig` member and * `map` how the flat variable becomes the shaped one: what `examples/full`'s * `config.ts` states for every group at once, split so a selection states its own. */ interface ConfigGroup { readonly schema: readonly string[]; readonly field: string; readonly map: string; readonly env: readonly { readonly name: string; readonly value: string; }[]; } export declare const CONFIG_GROUPS: Readonly>; /** Always present, whatever is selected: the port and the logger need them. */ export declare const BASE_CONFIG: readonly string[]; export declare const FEATURES: readonly Feature[]; export declare const featureNames: readonly string[]; export declare class UnknownFeatureError extends Error { readonly name = "UnknownFeatureError"; } /** * The selection plus everything it requires, in **import order** - which is * construction order, and shutdown runs in reverse. A feature is emitted after * everything it requires, so the database outlives the features reading it, the * same ordering `examples/full/src/app.module.ts` states by hand. * * Depth-first over `requires`, with a visited set, so a diamond resolves once and * the result is stable whatever order the caller asked in. */ export declare const resolveFeatures: (requested: readonly string[]) => readonly Feature[]; /** Which of the resolved features the caller did not ask for. */ export declare const impliedBy: (requested: readonly string[], resolved: readonly Feature[]) => readonly string[]; export {};