()
| 411 | // --------------------------------------------------------------------------- |
| 412 | |
| 413 | const createEmbeddedMigrationsSource = async () => { |
| 414 | const migrationsDir = resolve(webRoot, "drizzle-legacy-v1"); |
| 415 | const files = (await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: migrationsDir }))) |
| 416 | .map((f) => f.replaceAll("\\", "/")) |
| 417 | .sort(); |
| 418 | |
| 419 | const imports = files.map((file, i) => { |
| 420 | const spec = join(migrationsDir, file).replaceAll("\\", "/"); |
| 421 | return `import file_${i} from ${JSON.stringify(spec)} with { type: "text" };`; |
| 422 | }); |
| 423 | |
| 424 | const entries = files.map((file, i) => ` ${JSON.stringify(file)}: file_${i},`); |
| 425 | |
| 426 | return [ |
| 427 | "// Auto-generated — maps migration paths to inlined file contents", |
| 428 | ...imports, |
| 429 | "export default {", |
| 430 | ...entries, |
| 431 | "} as Record<string, string>;", |
| 432 | ].join("\n"); |
| 433 | }; |
| 434 | |
| 435 | // --------------------------------------------------------------------------- |
| 436 | // Build platform binaries |
no test coverage detected