IF Commons GitHub

logical/manager

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-package-managers-logical FR-005, 0003-package-managers-logical FR-006, 0003-package-managers-logical FR-007

A manager as a dialect needs it, as data (ManagerSpec: the dialect's id, the manager of the ontology it drives, what it guarantees, how it writes an exact version and the status its query of an installed package ends with where there is none), the job a requirement of kind tool asks of it, the command lines of a job, and the plan file that names them. A job is the packages of the tool's binding for this manager; where the tool is at a version, the version is written for the first package.

import { jobOf } from "./manager.ts";
// jobOf(spec, requirement) is a job where the requirement asks this manager, and nothing where it asks another

Source: commons/package-managers/src/logical/manager.ts

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

ManagerSpectype
type ManagerSpec = { /** The id of the dialect (`apt`). */ readonly id: string; readonly manager: ManagerId; rea… (420 characters)
type ManagerSpec = {
  /** The id of the dialect (`apt`). */
  readonly id: string;
  readonly manager: ManagerId;
  readonly summary: string;
  readonly guarantees: ToolGuarantees;
  readonly versioning: Versioning;
  /** The exit status of the query of an installed package that means it is not installed; none where it is not known, and then the dialect has no check. */
  readonly missingExit: number | undefined;
};

A manager as a dialect needs it.

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

CommandSourcetypeno test imports it
type CommandSource = (manager: string, operation: Operation) => Result<CommandSpec, string>;

Where the commands of a manager come from: the packaging ontology, through its reader.

PackageJobtype
type PackageJob = {
  readonly requirement: string;
  readonly tool: string;
  readonly program: string;
  readonly alsoNamed: readonly string[];
  readonly versionArgs: readonly string[];
  readonly version: string | null;
  readonly packages: readonly string[];
};

What a tool asks of a manager.

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

jobOffunction
function jobOf(spec: ManagerSpec, r: Requirement): PackageJob | undefined

The job a requirement asks of the manager, or nothing where it is not a tool, asks another dialect or another manager.

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

jobArgvfunctionno test imports it
function jobArgv(spec: ManagerSpec, commands: CommandSource, job: PackageJob, op: "Install" | "QueryInstalled" | "QueryVersion" | "Refresh", shape: Shape): Result<Argv, string>

The command a job asks for one operation, or why it cannot be made.

PlanLinetypeno test imports it
type PlanLine = { readonly tool: string; readonly version: string | null; readonly packages: readonly string[]; … (408 characters)
type PlanLine = {
  readonly tool: string;
  readonly version: string | null;
  readonly packages: readonly string[];
  readonly install: readonly string[];
  readonly check: readonly string[] | null;
  /** The exit status of the check that means the package is not installed; none where there is no check. */
  readonly missingExit: number | null;
  readonly admin: boolean;
  readonly verified: boolean;
};

One line of the plan file: what is installed and the commands that do and check it.

planFileTextfunction
function planFileText(spec: ManagerSpec, lines: readonly PlanLine[]): string

The text of a plan file: JSON that says it is generated, with its keys in a fixed order. It names what the steps run, so that the digest of a render covers it.

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

planLinesfunction
function planLines(spec: ManagerSpec, commands: CommandSource, jobs: readonly PackageJob[], shape: Shape): Result<readonly PlanLine[], readonly string[]>

The plan lines of jobs, or every reason one cannot be made.

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

readPlanFilefunction
function readPlanFile(text: string): Result<{ readonly dialect: string; readonly manager: string; readonly lines: readonly PlanLine[]; }, string>

A plan file from its text, or why it is not one: what the program of the kit runs, and refuses anything else.

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

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