IF Commons GitHub

surfaces/cli/render

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0004-headless-cli FR-001, 0004-headless-cli FR-003

The closing block drawn for a terminal (commons headless 0004-headless-cli FR-001, FR-003): the lines the logical layer chose, in the order it chose them, each with its palette mark and colour; the verdict; the one next: line. In quiet mode only the verdict is drawn. Nothing is decided here: which lines come, in which order, is closingOf's.

import { renderClosing } from "./render.ts";
import { closingOf, outcomeOf } from "@intellectual-frontiers/headless/logical";
const look = { tty: false, colour: false, emoji: false, columns: 80 };
renderClosing(closingOf(outcomeOf(null), { fix: { commands: [], own: [] }, shownHints: [] }), { look, verbosity: "calm" }); // "\n[ok] Up to date\n"

Source: commons/headless/src/surfaces/cli/render.ts

1 of 3 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

RenderOptionstypeno test imports it
type RenderOptions = {
  readonly look: Look;
  readonly verbosity: Verbosity;
  /** Where the run's log is, shown in verbose mode. */
  readonly logPath?: string;
};

What the drawing depends on.

drawVerdictfunctionno test imports it
function drawVerdict(c: Closing, look: Look): string

The verdict line.

renderClosingfunction
function renderClosing(c: Closing, o: RenderOptions): string

The text a closing block is written as: a blank line, the lines, the verdict, the one next command; or the verdict alone in quiet mode. Ends in a newline.

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.