IF Commons GitHub

layered

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

The layered model (commons 0011-documentation FR-029): what a library that is built in layers (governance, logical, physical or surface) gives the generator to document it, as plain data and types only. A library keeps its own pure builder that makes a LayeredModel from its values; the generator's lens turns it into pages, a Markdown twin for each and the model as JSON. The generator depends on no library it shows: a builder's result is checked against these types where a configuration passes it, and by their shape alone.

An element has a stable id (the same across builds, the key of a link and of a diff), a kind, a name, a definition (the words the model gives it), where it is written (a source location) and what is said of it as properties. A trace edge says that an element of one layer is made into an element of the next: a governance concept into a table, a table into the statements that make it and into the typed table that reads it. Operations are an element kind of their own that several libraries share: a governance action, a headless verb, and what they become (a SQL routine, a command, a tool, a route).

Source: commons/docs/src/layered.ts

1 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.

Layerinterfaceno test imports it
interface Layer

A layer of a model: what it is called, what it is for and the kinds of element it holds.

MemberTypeWhat it is
idstringIts name, as governance.
titlestringWhat the layer is, in a sentence.
summarystringWhat a reader may and may not do at this layer, in a sentence or two.
kindsreadonly string[]The kinds of element it holds.
LayerElementinterfaceno test imports it
interface LayerElement

One thing a layer says: a module, a concept, an attribute, a table, a column, a statement, a command.

MemberTypeWhat it is
idstringStable across builds: governance:identity/principal, logical:table:principal.
layerstringThe layer it is in.
kindstringWhat kind of thing it is, one of the layer's kinds.
namestringWhat it is called.
definitionstringThe words the model gives it; empty where it has none, which is a finding.
parent?stringThe element that holds it (an attribute's concept, a column's table).
source?SourceLocationWhere it is written.
properties{ readonly [name: string]: string | number | boolean | readonly string[] | null; }What is said of it, by name: types, multiplicity, annotations, the text of a statement.
LayeredFindinginterfaceno test imports it
interface LayeredFinding

What the model's builder found wrong.

MemberTypeWhat it is
rulestringA rule's code, as undescribed.
elementstring
messagestring
LayeredModelinterface
interface LayeredModel

A model that is built in layers, as the generator documents it.

MemberTypeWhat it is
namestringIts name and the library it is of, as arca, data.
librarystring
titlestring
summarystring
subject?LayeredSubjectWhat the model applies to, where it has a subject: models are grouped by it.
layersreadonly Layer[]
elementsreadonly LayerElement[]
tracereadonly TraceEdge[]
findingsreadonly LayeredFinding[]

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

LayeredSourcetypeno test imports it
type LayeredSource = (locate: Locate) => Promise<readonly LayeredModel[]> | readonly LayeredModel[];

A function that makes the layered models of a repository, and may be told where each element is written.

LayeredSubjectinterfaceno test imports it
interface LayeredSubject

What a model applies to.

MemberTypeWhat it is
idstringIts id.
titlestringIts title.
aboutstringWhat its models apply to, in a sentence.
ordernumberIts place among the subjects: lower first.
Locatetypeno test imports it
type Locate = (value: unknown, member?: string) => SourceLocation | undefined;

Where a value is written (and, for a member of it such as an attribute of a concept, where that is), found by the lens from the exports it knows: by the value's identity.

SourceLocationinterfaceno test imports it
interface SourceLocation

Where an element is written: a file of the repository and a line.

MemberTypeWhat it is
filestringThe path from the repository's root.
line?numberThe line, from 1, where it is declared.
TraceEdgeinterfaceno test imports it
interface TraceEdge

An element of one layer made into an element of another.

MemberTypeWhat it is
fromstring
tostring
howstringHow: projects to, written as, read by.

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