logical.Roletypeno test imports ittype Role = "foundation" | "pattern" | "program" | "standard";The roles a library is classified in, for the table of the README.
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"); // truelogical.Roletypeno test imports ittype Role = "foundation" | "pattern" | "program" | "standard";The roles a library is classified in, for the table of the README.
logical.ROLESconstno test imports itconst ROLES: readonly Role[]Every role.
logical.Heldtypeno test imports ittype 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 ittype 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 ittype 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 itfunction 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 itfunction titleOf(name: string): stringThe title of a library from its name: my-lib is My Lib.
logical.filesOffunctionno test imports itfunction filesOf(l: NewLibrary): readonly NewFile[]The files of a new library.
logical.withSpecKitfunctionno test imports itfunction 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 itfunction 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 ittype Role = "foundation" | "pattern" | "program" | "standard";The roles a library is classified in, for the table of the README.
ROLESconstconst ROLES: readonly Role[]Every role.
Heldtypetype 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.
NewLibrarytypeno test imports ittype 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 ittype NewFile = { readonly path: string; readonly text: string };A file to write: its path from the repository's root and its text.
acceptNamefunctionfunction 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.
titleOffunctionfunction titleOf(name: string): stringThe title of a library from its name: my-lib is My Lib.
filesOffunctionfunction filesOf(l: NewLibrary): readonly NewFile[]The files of a new library.
withSpecKitfunctionfunction 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.
withRolefunctionfunction 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.