chore: Replace Bun's deprecated OptionsObject with SpawnOptions and

remove stdout cast. Fix warning.
This commit is contained in:
Jonas Perusquia Morales
2026-03-28 02:55:58 -06:00
parent 9628720f87
commit 2417833ed7
+3 -2
View File
@@ -3,10 +3,11 @@ import path from "node:path";
import c from "picocolors"; import c from "picocolors";
const basePath = new URL(import.meta.resolve("../../")).pathname.slice(0, -1); const basePath = new URL(import.meta.resolve("../../")).pathname.slice(0, -1);
type RunOptions = Omit<Bun.SpawnOptions.SpawnOptions<"ignore", "pipe", "pipe">, "stdout" | "stderr">;
async function run( async function run(
cmd: string[] | string, cmd: string[] | string,
opts: Bun.SpawnOptions.OptionsObject & {}, opts: RunOptions,
onChunk: (chunk: string, resolve: (data: any) => void, reject: (err: Error) => void) => void, onChunk: (chunk: string, resolve: (data: any) => void, reject: (err: Error) => void) => void,
): Promise<{ proc: Bun.Subprocess; data: any }> { ): Promise<{ proc: Bun.Subprocess; data: any }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@@ -17,7 +18,7 @@ async function run(
}); });
// Read from stdout // Read from stdout
const reader = (proc.stdout as ReadableStream).getReader(); const reader = proc.stdout.getReader();
const decoder = new TextDecoder(); const decoder = new TextDecoder();
// Function to read chunks // Function to read chunks