From 72da8862b331645a67d12d268e9dc9b885ed733c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 23 Sep 2026 14:42:18 +0200 Subject: [PATCH] Fix the spawnServeProcess stdio type after making stdin optional A non-literal first stdio element loses spawn()'s typed-tuple overload entirely (verified on Yggdrasil: tsc failed on the two other, unrelated serve helpers' stdout/stderr going nullable), not just for stdin's varying element. Asserted at the one call site instead. Co-Authored-By: Claude Sonnet 5 --- packages/cultnet-ts/test/interop/cultnet-interop.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cultnet-ts/test/interop/cultnet-interop.test.ts b/packages/cultnet-ts/test/interop/cultnet-interop.test.ts index 3d9fd257..48ac1b1c 100644 --- a/packages/cultnet-ts/test/interop/cultnet-interop.test.ts +++ b/packages/cultnet-ts/test/interop/cultnet-interop.test.ts @@ -2566,11 +2566,15 @@ interface RunningServeProcess { } async function spawnServeProcess(name: string, command: ServeCommand): Promise { + // A non-literal first stdio element (it varies per caller) loses `spawn`'s + // typed-tuple overload entirely, including for the two fixed "pipe" + // elements, so this is asserted rather than inferred: stdout/stderr are + // always piped here, and only stdin's presence varies. const child = spawn(command.command, command.args, { cwd: command.cwd, env: { ...process.env, ...command.env }, stdio: [command.stdin ?? "ignore", "pipe", "pipe"], - }); + }) as ChildProcessByStdio; const stderr: string[] = []; let stdoutBuffer = "";