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

Function createEmbeddedMigrationsSource

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

Source from the content-addressed store, hash-verified

363// ---------------------------------------------------------------------------
364
365const 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

Callers 1

buildBinariesFunction · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected