IF Commons GitHub

logical/scaffold

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0005-repoctl-library-commit-doctor FR-001

repoctl new library <name> (commons repoctl 0005-repoctl-library-commit-doctor FR-001 to FR-003): the files of a new library of commons, as data. A library is a folder with a manifest that declares the table of its layers (Kanon), a package, a typed about.ts, a specification kit with its first specification and the enforcement of it, a test that proves it, the tools verify runs, a TypeScript configuration and, made by the license program, its LICENSE. The name must be one the register accepts and one that no family holds. Pure: the same name, role and summary give the same files.

import { filesOf } from "./scaffold.ts";
filesOf({ name: "widget", summary: "Widgets, made by the book." }).map((f) => f.path).includes("commons/widget/library.ts"); // true

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

7 of 20 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.Roletypeno test imports it
type Role = "foundation" | "pattern" | "program" | "standard";

The roles a library is classified in, for the table of the README.

logical.ROLESconstno test imports it
const ROLES: readonly Role[]

Every role.

logical.Heldtypeno test imports it
type Held = { readonly match: { readonly kind: "exact"; readonly name: string } | { readonly kind: "prefix"; readonly prefix: string }; readonly host: string };

A name held for a family: the exact name or the prefix, and the host it is held for.

logical.NewLibrarytypeno test imports it
type NewLibrary = { readonly name: string; readonly summary: string; /** The folder (from the repository's root) the libraries are in. */ readonly folder: string };

What a new library is given.

logical.NewFiletypeno test imports it
type NewFile = { readonly path: string; readonly text: string };

A file to write: its path from the repository's root and its text.

logical.acceptNamefunctionno test imports it
function acceptName(text: string, held: readonly Held[], existing: readonly string[], folder: string): Result<LibraryName, { readonly code: "E-LIBRARY-EXISTS" | "E-LIBRARY-NAME" | "E-LIBRARY-RESERVED"; readonly message: string; }>

The name, once it is one that is valid, not held for a family and not in use; or why not.

logical.titleOffunctionno test imports it
function titleOf(name: string): string

The title of a library from its name: my-lib is My Lib.

logical.filesOffunctionno test imports it
function filesOf(l: NewLibrary): readonly NewFile[]

The files of a new library.

logical.withSpecKitfunctionno test imports it
function withSpecKit(source: string, name: string, specKit: string): Result<string, string>

The configuration of the documentation site with the spec kit of the new library listed: after the last spec kit it lists, or the source unchanged where the library is listed already.

logical.withRolefunctionno test imports it
function withRole(source: string, name: string, role: Role): Result<string, string>

The README's map of the roles with a line added for the new library: after the last library of its role, or at the end of the map; the source unchanged where the library is there already.

Roletypeno test imports it
type Role = "foundation" | "pattern" | "program" | "standard";

The roles a library is classified in, for the table of the README.

ROLESconst
const ROLES: readonly Role[]

Every role.

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

Heldtype
type Held = { readonly match: { readonly kind: "exact"; readonly name: string } | { readonly kind: "prefix"; readonly prefix: string }; readonly host: string };

A name held for a family: the exact name or the prefix, and the host it is held for.

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

NewLibrarytypeno test imports it
type NewLibrary = { readonly name: string; readonly summary: string; /** The folder (from the repository's root) the libraries are in. */ readonly folder: string };

What a new library is given.

NewFiletypeno test imports it
type NewFile = { readonly path: string; readonly text: string };

A file to write: its path from the repository's root and its text.

acceptNamefunction
function acceptName(text: string, held: readonly Held[], existing: readonly string[], folder: string): Result<LibraryName, { readonly code: "E-LIBRARY-EXISTS" | "E-LIBRARY-NAME" | "E-LIBRARY-RESERVED"; readonly message: string; }>

The name, once it is one that is valid, not held for a family and not in use; or why not.

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

titleOffunction
function titleOf(name: string): string

The title of a library from its name: my-lib is My Lib.

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

filesOffunction
function filesOf(l: NewLibrary): readonly NewFile[]

The files of a new library.

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

withSpecKitfunction
function withSpecKit(source: string, name: string, specKit: string): Result<string, string>

The configuration of the documentation site with the spec kit of the new library listed: after the last spec kit it lists, or the source unchanged where the library is listed already.

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

withRolefunction
function withRole(source: string, name: string, role: Role): Result<string, string>

The README's map of the roles with a line added for the new library: after the last library of its role, or at the end of the map; the source unchanged where the library is there already.

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

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