From 8ad70b7fa4242805396d572100809dfcde64c75b Mon Sep 17 00:00:00 2001 From: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com> Date: Sat, 9 May 2026 15:25:31 +0000 Subject: [PATCH] chore: remove dead isBunRuntime() export The function lost its only caller in #938 when shouldUseLogging() stopped gating on the Bun runtime. Remove the definition and the stale test-file comment that referenced it. --- src/lib/init/ui/factory.ts | 12 ------------ test/lib/init/ui/factory.test.ts | 11 ++++------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/lib/init/ui/factory.ts b/src/lib/init/ui/factory.ts index add6b0344..eb436cb6b 100644 --- a/src/lib/init/ui/factory.ts +++ b/src/lib/init/ui/factory.ts @@ -52,18 +52,6 @@ export type UIFactoryOptions = { forceLegacy?: boolean; }; -/** - * Detect whether the CLI is running inside the Bun-compiled binary - * vs. the npm/Node distribution. The `Bun` global only exists in - * the Bun runtime. - */ -export function isBunRuntime(): boolean { - return ( - typeof globalThis.Bun !== "undefined" && - typeof process.versions.bun === "string" - ); -} - /** * Detect whether the current process can run an interactive prompt. * Both stdin (read keystrokes) and stdout (render the prompt) must be diff --git a/test/lib/init/ui/factory.test.ts b/test/lib/init/ui/factory.test.ts index 15827090a..89c377e12 100644 --- a/test/lib/init/ui/factory.test.ts +++ b/test/lib/init/ui/factory.test.ts @@ -12,13 +12,10 @@ * bundle into our CJS npm distribution). * * We patch the env and `process.stdin.isTTY` / `process.stdout.isTTY` - * around each test so the assertions are deterministic. The - * Bun-runtime branch is exercised by leaving `isBunRuntime()` to its - * real return value — the test runner is invoked via `bun test` so - * the Bun global is present and `getUIAsync` can attempt the Ink - * path. To keep tests fast and TTY-independent we use the - * `forceLegacy` / non-TTY / `--yes` paths to assert `LoggingUI` is - * returned without ever spinning up a real renderer. + * around each test so the assertions are deterministic. To keep tests + * fast and TTY-independent we use the `forceLegacy` / non-TTY / `--yes` + * paths to assert `LoggingUI` is returned without ever spinning up a + * real renderer. */ import { afterEach, beforeEach, describe, expect, test } from "bun:test";