()
| 363 | // --------------------------------------------------------------------------- |
| 364 | |
| 365 | const createEmbeddedMigrationsSource = async () => { |
| 366 | const migrationsDir = resolve(webRoot, "drizzle-legacy-v1"); |
| 367 | const files = (await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: migrationsDir }))) |
| 368 | .map((f) => f.replaceAll("\\", "/")) |
| 369 | .sort(); |
| 370 | |
| 371 | const imports = files.map((file, i) => { |
| 372 | const spec = join(migrationsDir, file).replaceAll("\\", "/"); |
| 373 | return `import file_${i} from ${JSON.stringify(spec)} with { type: "text" };`; |
| 374 | }); |
| 375 | |
| 376 | const entries = files.map((file, i) => ` ${JSON.stringify(file)}: file_${i},`); |
| 377 | |
| 378 | return [ |
| 379 | "// Auto-generated — maps migration paths to inlined file contents", |
| 380 | ...imports, |
| 381 | "export default {", |
| 382 | ...entries, |
| 383 | "} as Record<string, string>;", |
| 384 | ].join("\n"); |
| 385 | }; |
| 386 | |
| 387 | // --------------------------------------------------------------------------- |
| 388 | // Build platform binaries |
no test coverage detected