Thank you for being patient! We're working hard on resolving the issue
TuiReconciler + renderTuiGrid are the reference terminal
renderer. They live in @tento-lona/sheets (no DOM dependency) so a
TUI host needs no adapter package — just hand it a Sheet and a
RenderScene.
import {
Sheet, TestBackend,
RenderPluginRegistry, PER_TYPE_SPECS,
buildScene, renderTuiGrid,
} from "@tento-lona/sheets";
const sheet = await Sheet.from(rawSheet, { backend: new TestBackend() });
const registry = new RenderPluginRegistry();
for (const spec of PER_TYPE_SPECS) registry.plugin(spec);
const scene = buildScene({ sheet, registry, /* ... */ });
const lines = renderTuiGrid(scene, {
width: process.stdout.columns,
color: true,
});
for (const line of lines) console.log(line);
renderTuiGrid returns TuiLine[] — already-formatted strings
including ANSI escape sequences. Pipe through stripAnsi if the
output target doesn't support color.
TuiReconciler consumes RenderScene + SceneDiff to update
the previously-rendered grid in place. Pair with TreeWatcher
or roll your own diff loop:
import { TuiReconciler, diffScene } from "@tento-lona/sheets";
const reconciler = new TuiReconciler();
reconciler.bind(initialScene, terminal);
sheet.invalidation.addListener(this, () => {
const next = buildScene(refreshInputs());
for (const change of diffScene(reconciler.scene, next)) {
reconciler.apply(change);
}
});
import { ANSI, colorize, isColorEnabled, stripAnsi } from "@tento-lona/sheets";
console.log(colorize("error", ANSI.red)); // "\x1b[31merror\x1b[0m"
isColorEnabled(); // false when NO_COLOR is set
stripAnsi("\x1b[31mfoo\x1b[0m"); // "foo"
isColorEnabled honors the NO_COLOR env var; snapshot consumers
should call stripAnsi on output before diff.
A second platform exercises the per-type plugin contract that DOM also depends on. If the rows-side scene/diff seam stops working, both DOM and TUI break — but the TUI is simpler and easier to test, so regressions show up there first.
The cross-platform-parity.deno.test.ts test asserts the TUI's
render output is byte-stable against committed snapshots; the
fuzz harness (__architecture/fuzz-harness-tento/tento-lona-js/sheets.md)
generates random sheets and verifies the TUI roundtrip stays
clean.
renderTuiGrid ingestscellValueFormatter
on a spec drives the TUI's per-cell display string