chore: generate

pull/15685/head^2
opencode-agent[bot] 2026-03-26 14:45:01 +00:00 committed by opencode
parent 54443bfb7e
commit 9a2482ac09
1 changed files with 9 additions and 10 deletions

View File

@ -65,24 +65,23 @@ const baselineFlag = process.argv.includes("--baseline")
const skipInstall = process.argv.includes("--skip-install")
const skipEmbedWebUi = process.argv.includes("--skip-embed-web-ui")
const createEmbeddedWebUIBundle = async()=>{
console.log(`Building Web UI to embed in the binary`);
const appDir = path.join(import.meta.dirname, "../../app")
await $`bun run --cwd ${appDir} build`;
const allFiles = await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: path.join(appDir, "dist")}));
const fileMap = `
const createEmbeddedWebUIBundle = async () => {
console.log(`Building Web UI to embed in the binary`)
const appDir = path.join(import.meta.dirname, "../../app")
await $`bun run --cwd ${appDir} build`
const allFiles = await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: path.join(appDir, "dist") }))
const fileMap = `
// Import all files as file_$i with type: "file"
${allFiles.map((filePath, i) => `import file_${i} from "${path.join(appDir, "dist", filePath)}" with { type: "file" };`).join("\n")}
// Export with original mappings
export default {
${allFiles.map((filePath, i)=>`"${filePath}": file_${i},`).join("\n")}
${allFiles.map((filePath, i) => `"${filePath}": file_${i},`).join("\n")}
}
`.trim()
return fileMap;
return fileMap
}
const embeddedFileMap = skipEmbedWebUi ? null : await createEmbeddedWebUIBundle();
const embeddedFileMap = skipEmbedWebUi ? null : await createEmbeddedWebUIBundle()
const allTargets: {
os: string