//#region src/migration-ts.d.ts /** * Utilities for reading/writing `migration.ts` files. * * Rendering migration.ts source is the target's responsibility — the CLI * obtains source strings from a planner's `plan.renderTypeScript()`. The * helper here is limited to file I/O: writing the returned source with the * right executable bit and probing for existence. */ /** * Writes a pre-rendered `migration.ts` source string to the given package * directory. If the source begins with a shebang, the file is written with * executable permissions (0o755) so it can be run directly via * `./migration.ts` — the rendered scaffold ends with * `MigrationCLI.run(import.meta.url, M)` from * `@prisma-next/cli/migration-cli` (re-exported by the postgres facade), * which guards on the entrypoint and serializes when the file is the main * module. * * The source is run through prettier before writing so migration renderers * can produce structurally-correct but loosely-indented source and rely on * a single canonical format on disk. Matches what `@prisma-next/emitter` * already does for generated `contract.d.ts`. */ declare function writeMigrationTs(packageDir: string, content: string): Promise; /** * Checks whether a migration.ts file exists in the package directory. */ declare function hasMigrationTs(packageDir: string): Promise; //#endregion //#region src/runtime-detection.d.ts type ScaffoldRuntime = 'node' | 'bun' | 'deno'; declare function detectScaffoldRuntime(): ScaffoldRuntime; declare function shebangLineFor(runtime: ScaffoldRuntime): string; //#endregion export { type ScaffoldRuntime, detectScaffoldRuntime, hasMigrationTs, shebangLineFor, writeMigrationTs }; //# sourceMappingURL=migration-ts.d.mts.map