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 itinterface Layer
A layer of a model: what it is called, what it is for and the kinds of element it holds.
| Member | Type | What it is |
|---|
id | string | Its name, as governance. |
title | string | What the layer is, in a sentence. |
summary | string | What a reader may and may not do at this layer, in a sentence or two. |
kinds | readonly string[] | The kinds of element it holds. |
LayerElementinterfaceno test imports itinterface LayerElement
One thing a layer says: a module, a concept, an attribute, a table, a column, a statement, a command.
| Member | Type | What it is |
|---|
id | string | Stable across builds: governance:identity/principal, logical:table:principal. |
layer | string | The layer it is in. |
kind | string | What kind of thing it is, one of the layer's kinds. |
name | string | What it is called. |
definition | string | The words the model gives it; empty where it has none, which is a finding. |
parent? | string | The element that holds it (an attribute's concept, a column's table). |
source? | SourceLocation | Where 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 itinterface LayeredFinding
What the model's builder found wrong.
| Member | Type | What it is |
|---|
rule | string | A rule's code, as undescribed. |
element | string | |
message | string | |
interface LayeredModel
A model that is built in layers, as the generator documents it.
| Member | Type | What it is |
|---|
name | string | Its name and the library it is of, as arca, data. |
library | string | |
title | string | |
summary | string | |
subject? | LayeredSubject | What the model applies to, where it has a subject: models are grouped by it. |
layers | readonly Layer[] | |
elements | readonly LayerElement[] | |
trace | readonly TraceEdge[] | |
findings | readonly LayeredFinding[] | |
Imported by 6 tests of the run (6 passed, 0 failed): the library's results
LayeredSourcetypeno test imports ittype 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 itinterface LayeredSubject
What a model applies to.
| Member | Type | What it is |
|---|
id | string | Its id. |
title | string | Its title. |
about | string | What its models apply to, in a sentence. |
order | number | Its place among the subjects: lower first. |
Locatetypeno test imports ittype 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 itinterface SourceLocation
Where an element is written: a file of the repository and a line.
| Member | Type | What it is |
|---|
file | string | The path from the repository's root. |
line? | number | The line, from 1, where it is declared. |
TraceEdgeinterfaceno test imports itinterface TraceEdge
An element of one layer made into an element of another.
| Member | Type | What it is |
|---|
from | string | |
to | string | |
how | string | How: projects to, written as, read by. |