Skip to content

fix(cli): keep headless configuration independent of JSX - #483

Merged
shuv1337 merged 2 commits into
integration-v2from
cli-test-runtime
Nov 10, 2026
Merged

shuv1337 merged 2 commits into
integration-v2from
cli-test-runtime

Conversation

@shuv1337

Copy link
Copy Markdown
Owner

Summary

  • Keep headless CLI configuration and V1 migration on JSX-free schema modules instead of importing Solid providers.
  • Preserve the existing TUI config exports by re-exporting the same schemas; no React dependency, preload workaround, skipped tests, or changed assertions.
  • Run the two CLI config regression files in the PR typecheck workflow (about 11 seconds locally).

Root cause

The CLI entry point eagerly loads configuration. Its schema and migration modules imported packages/tui/src/config/index.tsx and config/v1/index.tsx, which mixed schemas with Solid JSX providers. The new tests start the source CLI with an absolute entry point and a temporary working directory. That child does not load packages/cli/bunfig.toml's @opentui/solid/preload; Bun falls back to its React JSX runtime and fails before the command runs. The release unit job leaves NODE_ENV unset, not production. Adding React would mask the wrong runtime rather than fix this dependency boundary.

Locally, /home/shuv/node_modules/react also masked the undeclared dependency even in a freshly installed worktree. Clean validation below hides that ancestor directory in a mount namespace without modifying the host installation.

Fixes the eight failures in release 2.2.6-shuv.3.

Verification

Fresh disk-backed clone, no existing node_modules or build output; bun install --frozen-lockfile with Bun 1.4.4 (38afee6c8) and Node 24.22.2. Used an isolated HOME, CI=true, GITHUB_ACTIONS=false for tests, no NODE_ENV, and masked ambient ~/node_modules using bwrap --bind / / --dev-bind /dev /dev --tmpfs /home/shuv/node_modules.

  • Baseline e3a9fcb376: both regression files reproduce 3 pass / 8 fail, with the exact missing react/jsx-dev-runtime error.
  • Fixed full CLI suite, via the release job's Turbo path (bun turbo test --filter=shuvcode --concurrency=3 --force): 464 pass / 7 existing skips / 0 fail, 471 tests across 68 files, 316.55 seconds. No cache hits.
  • bun run check: passed, lint plus all 39 typecheck tasks, no cache hits.
  • Official compiler: bun run typecheck:tsc in both packages/cli and packages/tui: passed.
  • Existing V1/V2 TUI config tests: 36 pass / 0 fail.
  • Both CLI regression files with NODE_ENV=production: 11 pass / 0 fail (10.22 seconds).
  • Full CLI suite also passed independently in the implementation worktree: 464 pass / 7 existing skips / 0 fail.

Feature flag: none; this repairs source CLI startup without introducing new behavior.

Visual

Headless commands load schemas directly; JSX providers remain on the TUI path.

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">
  <g fill="none" stroke="currentColor">
    <rect x="8" y="18" width="64" height="36" rx="6"/>
    <path d="M80 36h72m-6-5 6 5-6 5" opacity=".5"/>
    <rect x="160" y="18" width="72" height="36" rx="6"/>
  </g>
  <g fill="currentColor" font-family="monospace" font-size="12" text-anchor="middle">
    <text x="40" y="40">CLI</text><text x="196" y="40">Schema</text>
    <circle cx="112" cy="36" r="3"><animate attributeName="opacity" values="1;.25;1" dur="2s" repeatCount="indefinite"/></circle>
  </g>
</svg>

@shuv1337
shuv1337 merged commit 72423e0 into integration-v2 Nov 10, 2026
5 checks passed
@shuv1337
shuv1337 deleted the cli-test-runtime branch November 10, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant