Files
qqq-cli/scripts/binary-with-tui.ts
T
james.maesandClaude Fable 5.1 690a7ef533 build: the qqq binary carries the terminal UI by default
James's decision: one qqq binary per platform with the UI is the release
artifact. npm run binaries and release.mjs bundle the TUI unless
--cli-only. Both entries now start the built CLI (packages/cli/dist),
the module the TUI imports as @qrun-io/qqq-cli/program, so the CLI
program is in the bundle once (darwin-arm64: 100.8 -> 100.5 MB; the rest
of the 16 MB over the CLI-only build is React, OpenTUI and its native
library).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-31 19:09:53 -05:00

19 lines
711 B
TypeScript

/*
* Copyright 2026 QRun.IO, Inc.
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
/**
* Entry point of a qqq binary that carries the terminal UI (scripts/build-binaries.mjs --with-tui).
* Only Bun builds it: the CLI stays a Node program, and `qqq ui` hands over to the bundled TUI in the
* same process instead of spawning `bun run packages/tui/src/main.tsx` from a checkout.
*/
globalThis.__qqqRunTui = async (args: string[]) => {
process.argv = [process.argv[0]!, 'qqq-ui', ...args]
await import('../packages/tui/src/main.tsx')
}
// the built CLI, the same module the TUI imports as @qrun-io/qqq-cli/program, so it is bundled once
await import('../packages/cli/dist/main.js')