chore: generate

This commit is contained in:
opencode-agent[bot]
2026-03-26 15:05:29 +00:00
committed by opencode
parent 54443bfb7e
commit 9a2482ac09
+9 -10
View File
@@ -65,24 +65,23 @@ const baselineFlag = process.argv.includes("--baseline")
const skipInstall = process.argv.includes("--skip-install") const skipInstall = process.argv.includes("--skip-install")
const skipEmbedWebUi = process.argv.includes("--skip-embed-web-ui") const skipEmbedWebUi = process.argv.includes("--skip-embed-web-ui")
const createEmbeddedWebUIBundle = async () => {
const createEmbeddedWebUIBundle = async()=>{ console.log(`Building Web UI to embed in the binary`)
console.log(`Building Web UI to embed in the binary`); const appDir = path.join(import.meta.dirname, "../../app")
const appDir = path.join(import.meta.dirname, "../../app") await $`bun run --cwd ${appDir} build`
await $`bun run --cwd ${appDir} build`; const allFiles = await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: path.join(appDir, "dist") }))
const allFiles = await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: path.join(appDir, "dist")})); const fileMap = `
const fileMap = `
// Import all files as file_$i with type: "file" // 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")} ${allFiles.map((filePath, i) => `import file_${i} from "${path.join(appDir, "dist", filePath)}" with { type: "file" };`).join("\n")}
// Export with original mappings // Export with original mappings
export default { export default {
${allFiles.map((filePath, i)=>`"${filePath}": file_${i},`).join("\n")} ${allFiles.map((filePath, i) => `"${filePath}": file_${i},`).join("\n")}
} }
`.trim() `.trim()
return fileMap; return fileMap
} }
const embeddedFileMap = skipEmbedWebUi ? null : await createEmbeddedWebUIBundle(); const embeddedFileMap = skipEmbedWebUi ? null : await createEmbeddedWebUIBundle()
const allTargets: { const allTargets: {
os: string os: string