MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / createEmbeddedMigrationsSource

Function createEmbeddedMigrationsSource

apps/cli/src/build.ts:413–433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

411// ---------------------------------------------------------------------------
412
413const 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

Callers 1

buildBinariesFunction · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected