chore: add bun support #2254

Merged
Sainan merged 3 commits from bun-ii into main 2025-06-22 19:58:48 -07:00
Showing only changes of commit 73c8a9a257 - Show all commits

View File

@ -14,6 +14,7 @@ args.push("--secret");
args.push(secret);
let buildproc, runproc;
const spawnopts = { stdio: "inherit", shell: true };
function run(changedFile) {
if (changedFile) {
console.log(`Change to ${changedFile} detected`);
@ -28,10 +29,7 @@ function run(changedFile) {
runproc = undefined;
}
const thisbuildproc = spawn("npm", ["run", process.versions.bun ? "verify" : "build:dev"], {
stdio: "inherit",
shell: true
});
const thisbuildproc = spawn("npm", ["run", process.versions.bun ? "verify" : "build:dev"], spawnopts);
const thisbuildstart = Date.now();
buildproc = thisbuildproc;
buildproc.on("exit", code => {
@ -41,10 +39,7 @@ function run(changedFile) {
buildproc = undefined;
if (code === 0) {
console.log(`${process.versions.bun ? "Verified" : "Built"} in ${Date.now() - thisbuildstart} ms`);
runproc = spawn("npm", ["run", process.versions.bun ? "bun-run" : "start", "--", ...args], {
stdio: "inherit",
shell: true
});
runproc = spawn("npm", ["run", process.versions.bun ? "bun-run" : "start", "--", ...args], spawnopts);
runproc.on("exit", () => {
runproc = undefined;
});