@delurio/cli 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +36 -5
- package/SPEC.md +170 -27
- package/dist/changes.d.ts +4 -2
- package/dist/changes.js +32 -10
- package/dist/check.d.ts +1 -1
- package/dist/check.js +208 -27
- package/dist/diff-nav.js +15 -5
- package/dist/domain-names.d.ts +18 -0
- package/dist/domain-names.js +124 -0
- package/dist/domain.js +1 -1
- package/dist/graph.d.ts +21 -2
- package/dist/graph.js +149 -30
- package/dist/html.d.ts +1 -1
- package/dist/html.js +1 -1
- package/dist/invokes.d.ts +10 -0
- package/dist/invokes.js +67 -0
- package/dist/kit.d.ts +2 -1
- package/dist/kit.js +1 -1
- package/dist/model.d.ts +9 -1
- package/dist/model.js +89 -33
- package/dist/nav-page.js +15 -3
- package/dist/nav.d.ts +20 -1
- package/dist/nav.js +37 -25
- package/dist/needs.d.ts +50 -0
- package/dist/needs.js +311 -0
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +4 -2
- package/dist/starts.js +8 -1
- package/dist/tutorial-check.d.ts +9 -0
- package/dist/tutorial-check.js +297 -0
- package/dist/ui-check.d.ts +1 -1
- package/dist/ui-check.js +58 -13
- package/dist/wireframe.js +26 -2
- package/dist/yaml.d.ts +1 -0
- package/dist/yaml.js +36 -5
- package/package.json +2 -1
- package/schemas/domain.schema.json +7 -7
- package/schemas/gaps.schema.json +49 -0
- package/schemas/nav.schema.json +34 -3
- package/schemas/needs.schema.json +189 -0
- package/schemas/ui.schema.json +42 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
While the version is 0.x, a release that can judge the same graphs differently (a new check, a stricter schema) bumps the minor; a fix that judges nothing differently bumps the patch.
|
|
4
4
|
|
|
5
|
+
## 0.9.0 (2026-11-16)
|
|
6
|
+
|
|
7
|
+
- `check` parses each file once however many graphs read it. Before, it parsed a flow's domain again for every flow that names it, and every flow again for every flow that starts another: on delurio's own 41 flows it took 12.7 s, of which more than half was parsing the same files again; it now takes 5.8 s. It judges nothing differently: the same graphs give the same findings, in text and in SARIF, as 0.8.0 gives.
|
|
8
|
+
- A graph that cannot be loaded is reported, and the other graphs are still checked. Before, a `ui.yaml` with no `catalog` stopped the whole check with a stack trace (`ERR_INVALID_ARG_TYPE`), and so did a catalog file that was not there (`ENOENT`), a catalog that was not JSON, a `flow.yaml` or `ui.yaml` that was not a map, a flow with no `states`, a state that was not a map, and a guard, an assertion or a `starts` value that did not parse. Each is now a `load` error (exit 1), in text and in SARIF. A `ui.yaml` with no `samples` or no `nodes` now loads (the `schema` rule still reports a missing `nodes`); before, one whose words had a placeholder stopped the check the same way.
|
|
9
|
+
- A `load` error is given at its place (SPEC.md §10): the file it is in and the line of what it is about, or the line and column a parser gave. Before, every load error but a YAML one was given at `flow.yaml:1:1`, and a YAML error of `ui.yaml` at its line but in `flow.yaml`. Now a transition to a state that does not exist is given at the transition; a node's unknown state at that item of its `in`, `unless` or `disabledIn`; an unknown `focus` state, a `checked` that cannot be read and a kit that cannot be read at their keys in `ui.yaml`; a missing or unreadable catalog at `catalog`; a catalog that is not JSON in the catalog, at the place the parser gave; a guard that does not parse, or names what is not a variable or a guard, at the transition that uses it (a named guard at its own line); an unknown effect at its transition; a non-exhaustive `always` at its `always`; an assertion at its `never`. Their messages and fingerprints are unchanged, so a baseline still knows them.
|
|
10
|
+
- A started flow is looked up among the graphs beside a flow without reading one that cannot be read: before, a neighbour's YAML error was also reported as a `load` error of every flow that starts another one.
|
|
11
|
+
- `--baseline`: a known error that keeps a graph from loading is printed as `error`, since it fails the run (exit 1) however often it was seen. Before, it was printed as `warning` while the run failed and the last line counted it as an error. The last line now counts each finding at the level it is printed at, so a known error printed as `warning` is counted as a warning. Exit codes are unchanged.
|
|
12
|
+
- New rules of `check`, which fail `--strict` (SPEC.md §2): `state-unreachable`, a state that no situation the flow starts in reaches, which the page already marked; and `state-no-way-out`, a state that is not an exit (`type: final`) and has no `on`, `always` or `invoke`, so that a flow that reaches it stops there without ending. Both are given at the state. Before, `initial: cart`, `cart: { on: { CONTINUE: done } }`, `pay: { by: human }` and `done: { type: final }` gave no error at all; now `pay` gives both. Transitions that no situation takes still fail nothing (#2).
|
|
13
|
+
- `catalog-key-missing` holds the catalog of every locale in `locales` (SPEC.md §4), at the key in `ui.yaml`, and a locale whose catalog file is not there is one error at `locales`. Before, only the catalog `ui.yaml` names was read, and a key missing from another locale's catalog (`tr.json` beside `catalog: catalog/en.json`) passed. A placeholder with no sample value is still looked for in the named catalog only.
|
|
14
|
+
- `check` replays a flow's `tutorial.yaml` on the flow (SPEC.md §7). The new rule `tutorial-mismatch`, which fails `--strict`, is given at the step where the tutorial no longer matches: its `flow` is another flow; its `scenario` names a variable or a value the flow does not have, or gives none for a variable that starts from any value; a step names a state, a node, an event, a variable of `then` or a value the graph does not have, or a `{word}` that is neither a sample value nor a node with visible text; or the replay stops at the step (`show` where the flow is in another state, `press` on a node that is not shown, is disabled or sends no event the state handles, `after` an event the state does not handle, `cut` to a state no reachable situation is in, `reveal` or `focus` a node the screen does not show, `end` where the flow is not, a `then` no case matches). A tutorial told on the diagram (`stage: diagram`) is replayed as SPEC.md §7 says, and one that points at a node stops. Before, `check` did not read tutorials: a tutorial that named a step, an event or a node its flow no longer had passed. A tutorial may also carry `samples` of its own, which `check` counts as sample values for `{word}`; SPEC.md does not describe that key yet.
|
|
15
|
+
- New rules of `check`, which fail `--strict` (SPEC.md §5): `invoke-unknown`, a state that invokes an action the flow's domain does not have, a `failures.<state>.from` that names another action the domain does not have, or a flow whose named domain is not found beside it while its states invoke actions; and `refusal-unknown`, a failure class of a state that invokes an action listing a code that is neither one of that action's `refusals` nor a transport code. The transport codes are `network` (no answer comes back), `timeout` (none in the time the caller waits) and `5xx` (a status from 500 to 599 that the action does not list): a class may list them though the action has no such refusal. A failure the action answers with a code of its own, such as a protocol's `server_error`, is one of its refusals. A state that invokes an `external` or a `flow` is not held to the domain. The owner decided on 16 Nov 2026 that these are errors from this release, with no release in which they only warn (#5, for names). A project whose graphs give them can record them with `--baseline`: they are then printed as warnings until they are fixed, and a new one fails.
|
|
16
|
+
- `check` looks a domain up once per run, however many flows name it; the `changes` rule and the rules above share it.
|
|
17
|
+
- `examples/notes/edit`: a tutorial for the owner of a note, which `check` replays.
|
|
18
|
+
- The examples give the same findings as before: none.
|
|
19
|
+
- `examples/notes/kit`: a kit to start from (SPEC.md §8), which the screens of `examples/notes` are now drawn with (`kit: ../kit`). It has a template for every component of `ui.yaml`, and for the roles graphs most often give them: a `Button` or a `LinkButton` that is a link; a `List` that is a radio group, a group or a tab list; a `ListItem` that is a checkbox, a radio, a tab, a link or a button. It also draws `Checkbox`, `Radio` and `Select`, which `ui.yaml` does not name as components yet; a kit may give templates that no screen uses. Its colours, spaces, radius and type are design tokens in the W3C format, light and dark, each colour it draws text in at a contrast of at least 4.5:1 with its background, and its CSS takes every value from them. Nothing is judged differently: the examples give the same findings, and only the notes pages look different.
|
|
20
|
+
- README: how to write a product's own kit, starting from that one.
|
|
21
|
+
- `ui.yaml` may disable a control by what the context holds (SPEC.md §4): `disabledWhen: "<expression>"` beside `disabledIn`, which names states only. A Continue button disabled until a VAT number is typed is `disabledWhen: "not vatGiven"`, where typing it is an event whose effect sets `vatGiven`; one disabled until a box is ticked is `disabledWhen: "not accepted"`, beside the box's `checked: accepted`. A node is disabled where either says so, and a replay compares it in each situation it stops in. The graph cannot be loaded (exit 1) when the expression does not parse or names what is not a variable, a guard or `state`, as for `checked`. The page writes "disabled when …" on the node. Before, the `schema` rule refused the key; graphs without it are judged as before.
|
|
22
|
+
- A `returnsFocus` may give the focus back to whichever of several nodes opened its dialog (SPEC.md §4): `{ returnsFocus: [<dialog>, [<node>, ..]] }`, one of those listed, or `{ returnsFocus: [<dialog>, opener] }`, any node that opens it. A dialog that edits any of four fields gives the focus back to the Edit button that was pressed. `focusAfter` in `@delurio/cli/graph` takes the node pressed to open the dialog as a fourth argument, which a replay knows and the graph does not; without it, a list gives the one node of it the new state shows, and `opener`, or a list of which the new state shows several, gives null. `check` holds each node a list names, and each node that opens the dialog for `opener`, to `focus-not-shown`, and a dialog that no node opens fails it too. The `schema` rule refuses a node called `opener`. Before, the `schema` rule refused anything but one node in the second place; graphs that use one node are judged as before.
|
|
23
|
+
- `Checkbox`, `Radio` and `Select` are components (SPEC.md §4): each is named by its `text`, its label; a checkbox (role `checkbox` or `switch`) and a radio (role `radio`) say with `checked` whether they are checked; a select (role `combobox`) shows its `value` as the option chosen. The page draws them as a labelled box or `<select>`, and the expected accessibility tree, which a kit check holds a product's kit to, names each by its label. A kit's templates gain the flag `{?checked}` (SPEC.md §8). Before, the `schema` rule refused these components and the page had no renderer for them, so a graph wrote a checkbox as a `ListItem` with the role (which still works) or as a `TextField`, drawn as a text box. The examples' pages differ only by the CSS of the new box.
|
|
24
|
+
- `ui.yaml` may name its flow as its users know it, in every locale: `task: { key: <catalog key> }` (SPEC.md §4), such as "Edit a note", as `changes` gives the changes note. Rehber names the task by it in the page's language, where it borrowed the words of the flow's first button. New rule of `check`, which fails `--strict`: `task-locale`, a `task` key missing from, or empty in, the catalog of any locale. Graphs without `task` are judged as before.
|
|
25
|
+
- SPEC.md §4: while scripts do not run, an action of a page marked `script: actions` is not there, or is disabled and says why with an accessible description, such as that it needs JavaScript. A replay's `--no-js` walk checks each action such a state shows, and a dead button (visible, enabled, doing nothing) is a mismatch. The checker does not replay, so nothing is judged differently.
|
|
26
|
+
- SPEC.md §7: what a replay does with a binding. A walk reads every screen against the flow's catalog of its browser's language (`browser.locale`, or `--locale`), found by the whole tag and then by its language (`tr-TR` reads `catalog/tr.json`), and a locale with no catalog is refused; `--locale` may be given more than once, for walks in each language. `browser.ignoreHTTPSErrors: true` opens a page with a self-signed certificate. A walk keeps through a `havoc` the value its scenario's `given` gives a variable that starts from any value. Where several nodes send a step's event, the binding's `events.<EVENT>` says which is pressed. A navigation graph's binding may give `pages.<page>.samples`, the `:params` of one page's route, and its replay takes `--locale` too. The checker does not read bindings, so nothing is judged differently.
|
|
27
|
+
- A flow may list what must exist for its users, as a closed list beside its `flow.yaml` (`needs.yaml`, `kind: needs`), and a product the needs of its flows that are missing, at the root of its graphs (`needs.gaps.yaml`, `kind: gaps`) (SPEC.md §13). A need names its evidence: a `source` (a file, a line, a name it holds), a `test` (a file and a test's name), a `scenario` of a binding that walks it, a `state` or a `node` it is drawn as, or a `setting` that a deployment's environment file sets; or it says that it is `missing`, and why. So a product built in phases is written whole, the planned parts included, and its CI stays green while every gap is listed.
|
|
28
|
+
- `check` validates both files against their schemas (`schemas/needs.schema.json`, `schemas/gaps.schema.json`), and holds them to each other with new rules, which fail `--strict`: `evidence-unresolved`, at evidence that names what is not there (a file, a line past its end, a name the file does not hold, a binding or a scenario, a state, a node, a setting no line sets); `need-no-evidence`, at a need that is not missing and names only what the graph draws; `need-unlisted`, at a missing need that the gaps do not list; `gap-met` and `gap-unknown`, at an entry of the gaps whose need is met now or that no flow has, so the gaps only shrink; `need-twice`, at a need id given twice; and `needs-place`, at a `needs.yaml` that is beside no flow or names another one. A gap that is listed fails nothing: it is a finding at the level `note` (`need-gap`), in text and in SARIF, and the summary line counts the gaps among the needs (`1 gap of 4 needs`), and how many are new since `--baseline`. Evidence paths are relative to the folder `check` runs in, or to `--app <dir>`. A graph with no `needs.yaml` is judged as before, and its output is the same.
|
|
29
|
+
- `@delurio/cli/needs`: `readNeeds` reads a flow's needs, and `planned` gives the states and the nodes that only missing needs are drawn as, each with those needs, for a replay or a video to leave out rather than fail on.
|
|
30
|
+
- `examples/notes/restore` has needs: three that are met, with the code and the tests of a small app in `examples/notes/app` and the scenario of a binding, and one gap, drawn as a node of its page and listed in `examples/notes/needs.gaps.yaml`. README: needs and gaps.
|
|
31
|
+
- New rules of `check`, which fail `--strict` (SPEC.md §5): `entity-unknown`, an action's `result.returns`, or a `references` on a field of an entity or anywhere in a `body`, a `query`, a `result` or a refusal's `body`, that names an entity the domain does not have; and `field-unknown`, an entity's `key` or `required` that names a field the entity does not have (an entity none of whose files gives `fields` is not held to them). And `policy-unknown`, which fails `--strict` too: a policy's `do` that names an action the domain does not have, or its `read` or `write` an entity. Each is given in the file of a split domain that gives the name, at its line, and in SARIF. Where another domain among the graphs checked has the entity, a note says where: a domain names only its own entities, and a large one is split across the files of its directory instead. Before, `result: { returns: AuthCode }`, `references: Clinet`, `required: [challengeMethod]` and `do: [revoke]` all passed, exit 0, and a graph's writers had to check these names with scripts of their own. A name that only another domain has is an error with that note (decided on 16 Nov 2026). Checking secrets and what a policy lets each actor do is still #5.
|
|
32
|
+
- `examples/qauth-authorize`: `validate` returns the `AuthorizationRequest` it parses. It named `ValidatedRequest`, which is no entity of the domain, and `entity-unknown` now finds it.
|
|
33
|
+
- A `GET` that a policy lists writes only when one of its `sideEffects` is more than an audit record of the call (`audit:<event>`) (SPEC.md §4, decided on 16 Nov 2026). A policy names its actor's reads and writes together, so before, every `GET` in the `do` of a policy that writes counted as a write, and a flow that only read through one, such as a page whose every read is audited, failed `changes-note-missing` unless it carried a changes note. An action whose method is not `GET`, and a step inside the service, write as before, whatever their side effects.
|
|
34
|
+
- Graphs that give none of these names, and whose flows write through no such `GET`, give the same findings as before, in text and in SARIF; so do the examples.
|
|
35
|
+
- A writing flow whose app has no message that says what it changes may say why, instead of giving a changes note: `changes: { missing: "<why>" }` in `ui.yaml` (SPEC.md §4, decided on 16 Nov 2026). Rehber does not guide its writing steps, as for a writing flow without a note. `check` gives no `changes-note-missing` for it, but a gap: the new rule `changes-note-gap`, at `missing`, with its words, at the level `note` in text and in SARIF, which fails nothing. The summary line counts these gaps, and those new since `--baseline`: `1 gap of 4 needs, 1 missing changes note`. The `schema` rule takes `{ key }` or `{ missing }`, exactly one, and `missing` is not empty. Before, a captured graph had to carry a message that its app does not have. A writing flow that says neither fails as before.
|
|
36
|
+
- A navigation page that nothing in the app links to, such as a sign-in page that another site sends people to or a catch-all that any unknown address lands on, may say `byAddress: true` (SPEC.md §6, decided on 16 Nov 2026): people open it by its address, typed or followed from outside the app. A persona whom no way from `start` brings there reaches it so, with no clicks, and the pages that only it leads to are counted from it, so none of them is `unreachable`; every way from `start` stays as it is. The navigation page says "by its address" (or "by the address of <page>, then …") where it gives the way, and tags the page; the revision diff says it where it gives a way, and says when a page is now, or no longer, opened by its address. `@delurio/cli/nav`: `Page.byAddress`, and `Reach.byAddress`, the page the way starts at. Before, the `schema` rule refused the key, and such a page was `unreachable`, which fails `--strict`.
|
|
37
|
+
- A navigation graph's `source.locales` may list every message file the app reads, and `extract.entries` may lay `when`, `data`, `label`, `how`, `back` or `clicks` over a generated entry, keyed by its ends as an entry is cited, or leave it out with `skip: <why>` (SPEC.md §6), as the engine's extractor reads them. A route's `{...name}` stands for any number of segments, a catch-all. Before, the `schema` rule refused a list of locales and `extract.entries`. `@delurio/cli/nav` types `NavGraph.source` as `NavSource` and gives `ExtractCfg.entries`.
|
|
38
|
+
- SPEC.md §7: what a replay does with a binding, as the engine does it. The action `attach` gives a file input fixtures (`file:`, relative to the binding's file and kept inside its folder) or what a helper writes to its standard output (`run:`, `fileName:`, `mimeType:`), and presses what opens a file chooser when the locator finds no file input; `fill` on a native `<select>` chooses the option by its visible text, and a value no option shows fails the step. `--scenario <name>` keeps the walks to some scenarios, and `--cover` walks every scenario at least once. `--absent` on an exit that opens another page of the same frame leaves out the frame's chrome and nodes found by a landmark's role alone. The checker does not read bindings, so nothing is judged differently.
|
|
39
|
+
- The container image copies `schemas/`. Before, its `check` stopped with a stack trace (`ENOENT` on `schemas/flow.schema.json`) before it gave a finding.
|
|
40
|
+
|
|
5
41
|
## 0.8.0 (2026-11-15)
|
|
6
42
|
|
|
7
43
|
- `ui.yaml` may say where the focus goes after a step, what a control holds, and which pages work without JavaScript (SPEC.md §4), so that a replay can check them on the app. Before, the `schema` rule refused all five keys.
|
package/README.md
CHANGED
|
@@ -44,13 +44,24 @@ Several folders may be given (`check graphs examples`); a graph under two of the
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
- **SARIF:** `--format sarif --output delurio.sarif` writes SARIF 2.1.0 for code scanning. The same input gives the same bytes.
|
|
47
|
-
- **Baseline:** `--baseline <sarif>` fails only on errors that are new since an earlier run.
|
|
47
|
+
- **Baseline:** `--baseline <sarif>` fails only on errors that are new since an earlier run; a graph that cannot be loaded fails it, new or not.
|
|
48
48
|
|
|
49
49
|
| Exit | Meaning |
|
|
50
50
|
|---|---|
|
|
51
51
|
| 0 | every graph loads, and under `--strict` nothing is wrong |
|
|
52
52
|
| 1 | a graph cannot be loaded, or is written for a newer format than this version reads |
|
|
53
|
-
| 2 | under `--strict`: a guarantee is broken, a catalog key or a sample is missing, the main story cannot be walked, a writing flow has no changes note… |
|
|
53
|
+
| 2 | under `--strict`: a guarantee is broken, a state cannot be reached or has no way out, a catalog key is missing from a locale or a sample is missing, the main story cannot be walked, a tutorial no longer matches its flow, a writing flow has no changes note, a domain names an entity or a field it does not have, a flow invokes an action or lists a failure code its domain does not have, a policy names one, a need's evidence is not there or a product's gaps and its needs disagree… |
|
|
54
|
+
|
|
55
|
+
## What a product must have: needs and gaps
|
|
56
|
+
|
|
57
|
+
A flow draws what the product does and may leave the rest out, so a feature that is missing is simply not drawn. Beside the flow, `needs.yaml` lists what must exist for its users, as a closed list: each need names its evidence (the code, a test, a scenario of a binding that walks it, the states and nodes it is drawn as, a setting a deployment gives), or says that it is `missing`, and why. Every missing need of a product is listed in one file at the root of its graphs, `needs.gaps.yaml` (SPEC.md §13). [`examples/notes/restore/needs.yaml`](examples/notes/restore/needs.yaml) has three needs that are met and one gap.
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
examples/notes/restore/needs.yaml:47:5: note: need says-when-it-is-erased is missing: archived notes are not erased yet; … [need-gap]
|
|
61
|
+
delurio check: 5 graphs, 0 errors, 0 warnings, 1 gap of 4 needs; exit 0
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`check --strict` fails where evidence names what is not there (a file, a line, a name, a scenario, a state, a node), where a missing need is not in the gaps, and where the gaps list a need that is met or that no flow has. A gap that is listed fails nothing: it is counted, and given as a note. So a product built in phases is written whole, the planned parts included, while its CI stays green, and the gaps only shrink: a need that is met must leave the list, and a new gap is a line added to it, which a review reads. Evidence paths are relative to the repository root, the folder `check` runs in; `--app <dir>` names another.
|
|
54
65
|
|
|
55
66
|
## A graph's page
|
|
56
67
|
|
|
@@ -66,9 +77,27 @@ Given a folder of graphs instead, it writes the page of every graph under it, ea
|
|
|
66
77
|
npx @delurio/cli page graphs --out viz
|
|
67
78
|
```
|
|
68
79
|
|
|
80
|
+
## Draw the screens with your product's look: a kit
|
|
81
|
+
|
|
82
|
+
A kit (SPEC.md §8) says how the components of `ui.yaml` look in one product, so that the page and the videos draw its screens as the product does rather than as plain wireframes. It is data, in a folder of its own: nothing in it runs or is fetched. [`examples/notes/kit`](examples/notes/kit) is a small kit to start from, which the screens of `examples/notes` are drawn with.
|
|
83
|
+
|
|
84
|
+
1. Copy `examples/notes/kit` beside your graphs (`graphs/kit/`) and give it your own `id` (lowercase letters, digits and dashes) and `title`.
|
|
85
|
+
2. Name it from each `ui.yaml` whose screens it draws, by its path from that graph's folder: `kit: ../kit`. `page --kit <path>` draws with another kit for one run, and `--kit none` draws the plain wireframes.
|
|
86
|
+
3. Put your design tokens in `tokens.json`, in the W3C Design Tokens format (2025.10): groups nest, a token has `$value`, `$type` is inherited from its group, and `"{color.accent}"` is an alias. Each token becomes a CSS custom property named by its path: `color.accent` is `--color-accent`, `font.size-body` is `--font-size-body`. `dark.json` gives the same names other values for a dark page; a name that `tokens.json` lacks is refused.
|
|
87
|
+
4. Write the CSS in `kit.css`, from the tokens. It is scoped to the drawn screen: `&` is the screen itself, a rule never reaches the rest of the page, `:root`, `html` and `body` are refused as they never match there, and only `@media`, `@supports` and `@container` may wrap rules. Nothing is fetched: `url()` takes only `data:` addresses.
|
|
88
|
+
5. Give each component its screens use a `template`, one HTML element or a few, filled per node:
|
|
89
|
+
- slots: `{text}`, the node's visible text; `{name}`, its accessible name; `{id}`, the node's id; `{intent}`, the word `intents` gives its intent (`confirm`, `dismiss`, `secondary`, and `default` for a node with none); `{children}`, the items of a `List`;
|
|
90
|
+
- flags, each a section that opens and closes in the same place: `{?disabled}..{/disabled}` where the node is disabled, `{!disabled}..{/disabled}` where it is not, `{?named}` where the graph gives an accessible name other than the visible text (so `aria-label="{name}"` goes inside it), and `{?conditional}` where the node shows only when a flag holds;
|
|
91
|
+
- `roles`: a template of its own for a node whose ARIA role differs, such as a `Button` drawn as a link or a `ListItem` that is a checkbox or a radio;
|
|
92
|
+
- a `List`'s and a `ListItem`'s template is one element, which the page marks with the node it draws.
|
|
93
|
+
|
|
94
|
+
Templates take no `<script>`, `<style>`, `<iframe>`, `<form>` or event handler, and no address other than one inside the page (`#…`) or, for `src`, a `data:image`. Write the roles, names and disabled states the graph expects: a `<button>` for a button, a `<label>` around a field, `aria-label="{name}"` where it is named.
|
|
95
|
+
|
|
96
|
+
`Page` has no template: it is the screen itself, styled with `&`, and a dialog is a page node whose role is `dialog`, drawn as its screen. A component a screen uses that the kit has no template for, or an intent with no word in `intents`, is drawn with the fixed component and reported (`kit-uncovered`), which fails `--strict`. A kit that cannot be read, such as a template that is not well-formed or a token that refers to one no file defines, keeps every graph that names it from loading.
|
|
97
|
+
|
|
69
98
|
## Write a graph in an editor
|
|
70
99
|
|
|
71
|
-
The package ships a JSON Schema (2020-12) for each kind of graph file in `schemas/`: `flow`, `ui`, `nav` (also `nav.extracted.yaml`), `domain` and `
|
|
100
|
+
The package ships a JSON Schema (2020-12) for each kind of graph file in `schemas/`: `flow`, `ui`, `nav` (also `nav.extracted.yaml`), `domain`, `catalog`, `needs` and `gaps` (`needs.gaps.yaml`). With them an editor completes keys, explains each one from SPEC.md on hover, and marks a typo, a value of the wrong kind, or a title cut short by a comma inside `{ }`. In VS Code, with the YAML extension, put this in `.vscode/settings.json`:
|
|
72
101
|
|
|
73
102
|
```json
|
|
74
103
|
{
|
|
@@ -76,7 +105,9 @@ The package ships a JSON Schema (2020-12) for each kind of graph file in `schema
|
|
|
76
105
|
"https://unpkg.com/@delurio/cli@0.2.0/schemas/flow.schema.json": "**/flow.yaml",
|
|
77
106
|
"https://unpkg.com/@delurio/cli@0.2.0/schemas/ui.schema.json": "**/ui.yaml",
|
|
78
107
|
"https://unpkg.com/@delurio/cli@0.2.0/schemas/nav.schema.json": ["**/nav.yaml", "**/nav.extracted.yaml"],
|
|
79
|
-
"https://unpkg.com/@delurio/cli@0.2.0/schemas/domain.schema.json": ["**/domain.yaml", "**/domain/*.yaml"]
|
|
108
|
+
"https://unpkg.com/@delurio/cli@0.2.0/schemas/domain.schema.json": ["**/domain.yaml", "**/domain/*.yaml"],
|
|
109
|
+
"https://unpkg.com/@delurio/cli@0.9.0/schemas/needs.schema.json": "**/needs.yaml",
|
|
110
|
+
"https://unpkg.com/@delurio/cli@0.9.0/schemas/gaps.schema.json": "**/needs.gaps.yaml"
|
|
80
111
|
},
|
|
81
112
|
"json.schemas": [
|
|
82
113
|
{ "fileMatch": ["**/catalog/*.json"], "url": "https://unpkg.com/@delurio/cli@0.2.0/schemas/catalog.schema.json" }
|
|
@@ -114,7 +145,7 @@ const g = load('graphs/billing/billing.payment');
|
|
|
114
145
|
const configurations = explore(new Model(g.flow)).configs.length;
|
|
115
146
|
```
|
|
116
147
|
|
|
117
|
-
The entry points are `graph`, `model`, `story`, `wireframe`, `kit`, `edges`, `html`, `nav`, `expr` and `
|
|
148
|
+
The entry points are `graph`, `model`, `story`, `wireframe`, `kit`, `edges`, `html`, `nav`, `expr`, `yaml` and `needs`, each with its types. `yaml` reads a graph file's text as the CLI does (`readYaml`), refusing what SPEC.md §1 rules out before the text is resolved; a server that reads graphs it was sent should read them with it. `needs` reads a flow's needs (`readNeeds`) and gives the states and nodes that only missing needs are drawn as (`planned`), which a tool that walks the flow on the app leaves out. While the version is 0.x their API may change in any minor release: pin an exact version.
|
|
118
149
|
|
|
119
150
|
## Licence
|
|
120
151
|
|