()
| 337 | // --------------------------------------------------------------------------- |
| 338 | |
| 339 | const createEmbeddedMigrationsSource = async () => { |
| 340 | const migrationsDir = resolve(webRoot, "drizzle-legacy-v1"); |
| 341 | const files = (await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: migrationsDir }))) |
| 342 | .map((f) => f.replaceAll("\\", "/")) |
| 343 | .sort(); |
| 344 | |
| 345 | const imports = files.map((file, i) => { |
| 346 | const spec = join(migrationsDir, file).replaceAll("\\", "/"); |
| 347 | return `import file_${i} from ${JSON.stringify(spec)} with { type: "text" };`; |
| 348 | }); |
| 349 | |
| 350 | const entries = files.map((file, i) => ` ${JSON.stringify(file)}: file_${i},`); |
| 351 | |
| 352 | return [ |
| 353 | "// Auto-generated — maps migration paths to inlined file contents", |
| 354 | ...imports, |
| 355 | "export default {", |
| 356 | ...entries, |
| 357 | "} as Record<string, string>;", |
| 358 | ].join("\n"); |
| 359 | }; |
| 360 | |
| 361 | // --------------------------------------------------------------------------- |
| 362 | // Build platform binaries |
no test coverage detected