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

Function createEmbeddedMigrationsSource

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

Source from the content-addressed store, hash-verified

337// ---------------------------------------------------------------------------
338
339const 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

Callers 1

buildBinariesFunction · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected