Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/lib/init/ui/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions test/lib/init/ui/factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading