/** * Static answer to "will Veryfront Cloud be able to read this config file?". * * A hosted project's `veryfront.config.ts` is never imported: the shared * multi-project runtime evaluates it as data through the bounded declarative * evaluator, which accepts only literals and the four `veryfront` helpers. * Anything else is rejected on every request, so the deploy itself looks * healthy while the environment answers 500 to all traffic. * * This module lets a deploy make that verdict before it creates a release. It * reports a rejection only when this evaluation and the hosted one are bound to * agree: * * - `validate`-phase rejections are decided by the parsed program alone, so a * caller without the deployment environment's variables reaches exactly the * verdict the hosted evaluator will. * - `result`-phase rejections are decided by the evaluated configuration. When * nothing in the source can read deployment environment data, that record is * the source's own literals and the verdict is equally fixed. `cache.dir` is * the plain case: a literal config that sets it is refused on every hosted * request, and the deploy that shipped it reported success. * * A source that can read the environment is left alone in the `result` phase: a * config whose `security.cors.origin` comes from `getEnv("ORIGINS")` evaluates * to nothing against an empty local environment, and a deploy must never be * blocked by a difference the developer cannot see. * * @module config/hosted-compatibility */ import { type DeclarativeConfigErrorCode, type DeclarativeConfigErrorReason, type DeclarativeConfigFileName } from "./declarative-evaluator.js"; /** A statically decided reason a config cannot run on Veryfront Cloud. */ export interface HostedConfigIncompatibility { readonly code: DeclarativeConfigErrorCode; readonly reason: DeclarativeConfigErrorReason; /** One-based line of the offending construct, when the evaluator located it. */ readonly line?: number; /** The offending source line, trimmed and bounded, when one was located. */ readonly excerpt?: string; /** What the hosted runtime cannot do, in one sentence. */ readonly summary: string; /** The change that makes the project deployable. */ readonly remedy: string; } /** * Describe why `source` cannot be evaluated by the hosted runtime, or return * `null` when nothing statically rules it out. * * Never throws: an evaluator that cannot run (no parser installed, for * example) reports "nothing statically ruled out" rather than blocking a * deploy on this check's own unavailability. */ export declare function findHostedConfigIncompatibility(source: string, fileName?: DeclarativeConfigFileName): Promise; /** * Render an incompatibility as the message a developer reads in their * terminal: what was found, where, and what to do about it. */ export declare function formatHostedConfigIncompatibility(incompatibility: HostedConfigIncompatibility, fileName: string): string; /** * The same explanation, for a rejection that was only discovered once the * hosted runtime tried to serve the project. Keeps the terminal message and * the served error saying the same thing about the same config. */ export declare function describeHostedConfigRejection(reason: DeclarativeConfigErrorReason): string; //# sourceMappingURL=hosted-compatibility.d.ts.map