(mode: BuildMode)
| 333 | // --------------------------------------------------------------------------- |
| 334 | |
| 335 | const 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 |
no test coverage detected