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

Function createEmbeddedWebUISource

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

Source from the content-addressed store, hash-verified

307// ---------------------------------------------------------------------------
308
309const createEmbeddedWebUISource = async (mode: BuildMode) => {
310 const webDist = await buildWeb(mode);
311 const files = (await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: webDist })))
312 .map((f) => f.replaceAll("\\", "/"))
313 .sort();
314
315 const imports = files.map((file, i) => {
316 const spec = join(webDist, file).replaceAll("\\", "/");
317 return `import file_${i} from ${JSON.stringify(spec)} with { type: "file" };`;
318 });
319
320 const entries = files.map((file, i) => ` ${JSON.stringify(file)}: file_${i},`);
321
322 return [
323 "// Auto-generated — maps web UI paths to embedded file references",
324 ...imports,
325 "export default {",
326 ...entries,
327 "} as Record<string, string>;",
328 ].join("\n");
329};
330
331// ---------------------------------------------------------------------------
332// 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