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

Function createEmbeddedWebUISource

apps/cli/src/build.ts:383–403  ·  view source on GitHub ↗
(mode: BuildMode)

Source from the content-addressed store, hash-verified

381// ---------------------------------------------------------------------------
382
383const createEmbeddedWebUISource = async (mode: BuildMode) => {
384 const webDist = await buildWeb(mode);
385 const files = (await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: webDist })))
386 .map((f) => f.replaceAll("\\", "/"))
387 .sort();
388
389 const imports = files.map((file, i) => {
390 const spec = join(webDist, file).replaceAll("\\", "/");
391 return `import file_${i} from ${JSON.stringify(spec)} with { type: "file" };`;
392 });
393
394 const entries = files.map((file, i) => ` ${JSON.stringify(file)}: file_${i},`);
395
396 return [
397 "// Auto-generated — maps web UI paths to embedded file references",
398 ...imports,
399 "export default {",
400 ...entries,
401 "} as Record<string, string>;",
402 ].join("\n");
403};
404
405// ---------------------------------------------------------------------------
406// Embedded legacy v1 drizzle migrations — inlined as text imports so drizzle's

Callers 1

buildBinariesFunction · 0.85

Calls 1

buildWebFunction · 0.85

Tested by

no test coverage detected