Files
Wand-Enhancer/web-panel/bridge/build.mjs
T
kitbyte 13759b1db6 feat: ship 1.0.8.0 release automation and runtime overhaul
- reduce ASAR IO overhead with streamed archive reads, buffered copies, faster relative-path handling and placeholder integrity records
- fix in-place app.asar.unpacked packing/extraction self-copy cases that caused locked-file failures
- tighten JS patch discovery with candidate bundle filters and search hints
- require prebuilt remote-panel dist artifacts and clean up embedded bridge/script packaging
- add unified build entrypoints for PowerShell, cmd and bash and move native CMake output under .tmp
- add release metadata validation, changelog section extraction, pre-commit hook and GitHub Actions validation/release pipelines
- make CHANGELOG the source of truth for release notes and document the tag-driven release flow
- add updater release notes UI with latest/full changelog loading and localize the new update strings
- modularize bridge renderer scripts, add installed apps and game status sync, and support remote launch/stop commands
- centralize bridge protocol, IPC and WebSocket constants and improve LAN IP selection for QR pairing
- refactor remote panel controls/state enums, persist accent color, polish library/session UI and refresh assets
2026-05-06 13:07:09 +03:00

57 lines
1.6 KiB
JavaScript

import { build } from "esbuild"
import { readdir } from "node:fs/promises"
import { dirname, resolve } from "node:path"
import { fileURLToPath } from "node:url"
const bridgeRoot = dirname(fileURLToPath(import.meta.url))
const webPanelRoot = resolve(bridgeRoot, "..")
const distRoot = resolve(webPanelRoot, "dist")
const bridgeEntryPoint = resolve(bridgeRoot, "source.cjs")
const bridgeOutfile = resolve(distRoot, "bridge.cjs")
const rendererScriptsRoot = resolve(bridgeRoot, "scripts", "default")
const rendererScriptsOutdir = resolve(distRoot, "renderer-scripts")
await build({
banner: {
js: "// Generated by bridge/build.mjs. Do not edit this bundle by hand.",
},
bundle: true,
entryPoints: [bridgeEntryPoint],
format: "cjs",
legalComments: "none",
minify: true,
outfile: bridgeOutfile,
platform: "node",
target: "node16",
})
const rendererEntries = (
await readdir(rendererScriptsRoot, { withFileTypes: true })
)
.filter((entry) => entry.isFile() && entry.name.endsWith(".js"))
.map((entry) => resolve(rendererScriptsRoot, entry.name))
if (rendererEntries.length === 0) {
throw new Error(`No renderer script entries found in ${rendererScriptsRoot}`)
}
await build({
banner: {
js: "// Generated by bridge/build.mjs. Do not edit this bundle by hand.",
},
bundle: true,
entryNames: "[name]",
entryPoints: rendererEntries,
format: "iife",
legalComments: "none",
minify: true,
outdir: rendererScriptsOutdir,
platform: "browser",
target: "es2020",
})
console.log(`Built ${bridgeOutfile}`)
console.log(
`Built ${rendererEntries.length} renderer script(s) in ${rendererScriptsOutdir}`
)