IF Commons GitHub

physical/cli/mod

Written to: 4 requirements: 4 proved, 0 partly, 0 failing, 0 with no test recorded. 0005-archon-assembly FR-001, 0005-archon-assembly FR-002, 0005-archon-assembly FR-003, 0005-archon-assembly FR-004

The assembled command: one archon program made from the plugins a fleet gives it (archon-tool, archon-server, ...), through the composition of Headless. The host is archon: the program, its ladder of tiers (public, operator, administrator) and one verb of its own, plugins, which lists what was assembled. A conflict between plugins is a value, never a winner, and a run says which plugin contributed the command it ran. A fleet is the composition root: it imports the plugins it wants and calls main.

import { assemble } from "./mod.ts";
assemble([], "1.0.0").kind; // "ok"

Source: commons/archon/src/physical/cli/mod.ts

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

PROGRAMconstno test imports it
const PROGRAM: "archon"

The name of the program.

TIER_VARIABLEconst
const TIER_VARIABLE: "ARCHON_TIER"

The variable that says which tier the caller holds.

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

archonHostfunction
function archonHost(version: string, plugins: readonly Plugin[]): ProgramConfig

The host: the program archon with the one verb plugins, which lists the plugins assembled.

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

assemblefunction
function assemble(plugins: readonly Plugin[], version: string): Result<Composed, readonly CompositionError[]>

The program archon from its plugins, or every conflict between them.

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

heldTierfunction
function heldTier(env: (name: string) => string | undefined): { readonly tier: TierName; } | { readonly unknown: string; }

The tier a caller holds from the environment, or the word that is not a tier of the ladder.

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

MainDepstypeno test imports it
type MainDeps = {
  readonly env: (name: string) => string | undefined;
  readonly out: (text: string) => void;
  readonly err: (text: string) => void;
};

What main is given: the environment, and where the report and the problems go. The program of a fleet reads them from its process; a test passes its own.

mainfunction
function main(plugins: readonly Plugin[], version: string, argv: readonly string[], deps: MainDeps): Promise<number>

Runs archon with the plugins and the words after its name; returns the exit status (2 for a tier that is not one, 3 where the plugins cannot be assembled).

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

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