import type { Logger } from "../../telemetry/logging.js"; export interface AppMigrationContext { /** The app's root directory. */ cwd: string; logger: Logger; /** Env for any package manager the migration spawns (userconfig, logs dir). */ env: NodeJS.ProcessEnv; } /** * A one-time change to an app's files that the dev server makes on boot, after * the app is downloaded and before its dependencies are installed. A migration * decides from the app itself whether it still has to run: a migration that * already happened, or that does not apply, answers false from `shouldRun`. * It has to leave the app as it found it when it fails, because boot carries * on without it. * * A migration that depends on something that can be turned off again, like a * feature flag, can also undo itself: `shouldRollback` says whether an app it * changed has to go back, and `rollback` puts it back. A migration that rolls * back doesn't also run on the same boot. */ export interface AppMigration { /** Short, stable name for logs. */ name: string; shouldRun(ctx: AppMigrationContext): Promise; run(ctx: AppMigrationContext): Promise; shouldRollback?(ctx: AppMigrationContext): Promise; rollback?(ctx: AppMigrationContext): Promise; } /** Every migration, in the order they run. */ export declare const APP_MIGRATIONS: readonly AppMigration[]; /** * Rolls back or runs each migration, one after another. `ran` lists what * went through (`name` for a run, `name:rollback` for a rollback) and `failed` * what threw. A failing migration is logged and skipped, so a problem with one * app never stops the dev server from starting it. */ export declare function runAppMigrations(ctx: AppMigrationContext, migrations?: readonly AppMigration[]): Promise<{ ran: string[]; failed: string[]; }>; //# sourceMappingURL=index.d.mts.map