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

Function createEmbeddedWebUISource

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

Source from the content-addressed store, hash-verified

333// ---------------------------------------------------------------------------
334
335const createEmbeddedWebUISource = async (mode: BuildMode) => {
336 const webDist = await buildWeb(mode);
337 const files = (await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: webDist })))
338 .map((f) => f.replaceAll("\\", "/"))
339 .sort();
340
341 const imports = files.map((file, i) => {
342 const spec = join(webDist, file).replaceAll("\\", "/");
343 return `import file_${i} from ${JSON.stringify(spec)} with { type: "file" };`;
344 });
345
346 const entries = files.map((file, i) => ` ${JSON.stringify(file)}: file_${i},`);
347
348 return [
349 "// Auto-generated — maps web UI paths to embedded file references",
350 ...imports,
351 "export default {",
352 ...entries,
353 "} as Record<string, string>;",
354 ].join("\n");
355};
356
357// ---------------------------------------------------------------------------
358// 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