IF Commons GitHub

logical/docs

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0011-repoctl-docs FR-001

The documentation verbs' reasoning (commons repoctl 0011-repoctl-docs FR-001 to FR-004): what repoctl docs build, serve and check ask of the documentation generator ifc-docs of @intellectual-frontiers/docs, as arguments of its command line, and what a missing generator or a failed run is as a finding. The generator is not carried by repoctl: the Physical layer loads it by its package name where it is installed, through the port below, and a test fills the port with its own.

import { docsArguments } from "./docs.ts";
docsArguments("build", { config: "docs.config.ts", out: "_site", generator: undefined }, "/r"); // ["build", "--out", "/r/_site", "--config", "/r/docs.config.ts"]

Source: commons/repoctl/src/logical/docs.ts

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

logical.DocsGeneratortypeno test imports it
type DocsGenerator = { readonly main: (argv: readonly string[], cwd: string) => Promise<number> };

The command line of the generator ifc-docs is the program's main: its arguments and the folder it runs from to the status it ends with.

logical.DocsPorttypeno test imports it
type DocsPort = { readonly load: (repo: string, generator: string | undefined) => Promise<Result<DocsGenerator, string>> };

The port that loads the generator from the repository's own dependencies (or from the module the settings name), or says why it cannot.

logical.DocsAsktypeno test imports it
type DocsAsk = "build" | "check";

What the generator is asked: build into a folder, or check.

logical.docsArgumentsfunctionno test imports it
function docsArguments(ask: DocsAsk, settings: DocsSettings, repo: string, out?: string | undefined): readonly string[]

The arguments of the generator for a request: build writes into the folder given (the settings' by default), check writes nothing; both read the settings' configuration file. Paths are made absolute from the repository's root.

logical.missingGeneratorfunctionno test imports it
function missingGenerator(why: string): Finding

The finding of a generator that is not installed.

logical.failedGeneratorfunctionno test imports it
function failedGenerator(ask: "serve" | DocsAsk, status: number): Finding

The finding of a generator that ended with a status other than 0.

DocsGeneratortypeno test imports it
type DocsGenerator = { readonly main: (argv: readonly string[], cwd: string) => Promise<number> };

The command line of the generator ifc-docs is the program's main: its arguments and the folder it runs from to the status it ends with.

DocsPorttypeno test imports it
type DocsPort = { readonly load: (repo: string, generator: string | undefined) => Promise<Result<DocsGenerator, string>> };

The port that loads the generator from the repository's own dependencies (or from the module the settings name), or says why it cannot.

DocsAsktypeno test imports it
type DocsAsk = "build" | "check";

What the generator is asked: build into a folder, or check.

docsArgumentsfunctionno test imports it
function docsArguments(ask: DocsAsk, settings: DocsSettings, repo: string, out?: string | undefined): readonly string[]

The arguments of the generator for a request: build writes into the folder given (the settings' by default), check writes nothing; both read the settings' configuration file. Paths are made absolute from the repository's root.

missingGeneratorfunctionno test imports it
function missingGenerator(why: string): Finding

The finding of a generator that is not installed.

failedGeneratorfunctionno test imports it
function failedGenerator(ask: "serve" | DocsAsk, status: number): Finding

The finding of a generator that ended with a status other than 0.

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