refactor(tui): rombak renderer ke OpenTUI React bindings

Ganti renderer ANSI line-based (render.ts) dan event loop raw stdin dengan
OpenTUI React bindings (@opentui/react + @opentui/core, React 19.2):

- ui.tsx: komponen ZesdexApp (header/scrollbox transkrip/input/footer),
  adaptor toControllerKey (OpenTUI KeyEvent -> controller KeyEvent),
  bootTui (createCliRenderer + createRoot + mount).
- run.ts: pakai bootTui, jalankan OpenTUI sampai user quit.
- state/action/command/controller tetap logika murni (tidak tersentuh).
- 5 unit test baru untuk toControllerKey; 79 test total hijau.
- tsconfig: jsx react-jsx + jsxImportSource @opentui/react.
- hapus render.ts (tidak terpakai); hapus script format rusak (bun fmt).
- deps: @opentui/core, @opentui/react, react, @types/react.

verify: tsc 0 err, bun test 79 pass, dist/zesdex merender TUI via pty.
This commit is contained in:
asepharyana
2026-09-03 00:10:01 +07:00
parent b7006d1ad8
commit 3e260e6077
8 changed files with 358 additions and 252 deletions
+5 -2
View File
@@ -10,7 +10,6 @@
"build": "bun build src/interfaces/cli/index.ts --compile --outfile=dist/zesdex",
"check": "tsc --noEmit",
"test": "bun test",
"format": "bun fmt",
"cli": "bun src/interfaces/cli/index.ts",
"bootstrap": "bun src/interfaces/cli/bootstrap.ts",
"api": "bun src/interfaces/api/main.ts",
@@ -22,9 +21,13 @@
},
"devDependencies": {
"@types/bun": "^1.2.0",
"@types/react": "^19.2.18",
"typescript": "^5.7.0"
},
"dependencies": {
"@node-rs/argon2": "^2.2.0"
"@node-rs/argon2": "^2.2.0",
"@opentui/core": "^0.5.10",
"@opentui/react": "^0.5.10",
"react": "^19.2.8"
}
}