/** * adapters.ts — which adapters a recipe can really produce, and the refusal * when a user asks for one it cannot. * * A recipe DECLARES its adapters in `recipe.config.ts`. This module never * looks at which `template-/` directories are on disk, because a * recipe that extends another inherits its base's overlays: supernova has * starlight's FAST overlay in its lineage while having no FAST landing page of * its own, and scaffolding that combination produced a mixed app with exit 0. * * No external dependencies — uses Node.js built-ins only. */ import type { LitroAdapter, LitroRecipe } from './types.js'; /** Every adapter the CLI knows, in the order the prompt offers them. */ export declare const ADAPTERS: readonly LitroAdapter[]; /** * Adapters that still work but are no longer offered. * * Deprecated is not removed. `--adapter elena` still resolves through * `supportedAdapters()`, still scaffolds, and still builds — a project someone * already has must not change. What deprecation costs is the prompt: a user * who has not asked for it is never offered it. */ export declare const DEPRECATED_ADAPTERS: readonly LitroAdapter[]; /** The release that removes the adapters in `DEPRECATED_ADAPTERS`. */ export declare const REMOVED_IN = "v1"; /** * The adapters `recipe` supports, in prompt order. * * A recipe config with no `adapters` field falls back to `['lit']` rather than * to every adapter. `adapters` is required by the type, so only a hand-written * config can reach this, and the quiet answer for one is the default adapter — * not permission to build the three combinations nobody checked. */ export declare function supportedAdapters(recipe: LitroRecipe): LitroAdapter[]; /** True when `recipe` declares `adapter`. */ export declare function supportsAdapter(recipe: LitroRecipe, adapter: LitroAdapter): boolean; /** True when `adapter` is deprecated. */ export declare function isDeprecatedAdapter(adapter: LitroAdapter): boolean; /** * The adapters `recipe` OFFERS — what it supports, minus what is deprecated. * * Separate from `supportedAdapters()` on purpose. That function answers "can * this recipe produce it", which a deprecated adapter still can, and * `assertAdapterSupported()` reads it so `--adapter elena` keeps working. This * one answers "should we suggest it", which is the only thing deprecation * changes. * * A recipe whose every adapter is deprecated falls back to the supported list: * an empty prompt is worse than a deprecated default. */ export declare function offeredAdapters(recipe: LitroRecipe): LitroAdapter[]; /** The prompt choices for `recipe`, in the order `ADAPTERS` lists them. */ export declare function adapterChoices(recipe: LitroRecipe): string[]; /** * The one-line notice for a deprecated adapter, or `null` for a live one. * * Printed on stdout, not stderr, and worded as information rather than a * failure: the scaffold succeeded, and the app it wrote works. */ export declare function deprecationNotice(adapter: LitroAdapter): string | null; /** Turn a choice line from `adapterChoices` back into its adapter name. */ export declare function adapterFromChoice(choice: string): LitroAdapter; /** * Refuse an adapter the chosen recipe cannot produce. * * Scaffolding it anyway is the bug: the user gets an app whose config names * one framework and whose first page is written in another, and nothing says * so. The message names the recipe, what it does support, and the adapter that * was asked for, so the next command is obvious. */ export declare function assertAdapterSupported(recipe: LitroRecipe, adapter: LitroAdapter): void; //# sourceMappingURL=adapters.d.ts.map