@plitzi/sdk-authoring 0.38.24 → 0.39.1
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 +153 -1
- package/dist/index-src.js +21951 -10820
- package/dist/index.d.ts +2963 -774
- package/dist/index.js +2 -2
- package/dist/node.d.ts +1299 -558
- package/dist/node.js +511 -289
- package/dist/plugin.d.ts +57 -1
- package/package.json +8 -8
- package/skills/plitzi-authoring/CHEATSHEET.md +6 -6
- package/skills/plitzi-authoring/SKILL.md +4 -2
- package/skills/plitzi-authoring/recipes/accordion.ts +2 -1
- package/skills/plitzi-authoring/recipes/carousel.ts +24 -3
- package/skills/plitzi-authoring/recipes/detail-page.ts +0 -1
- package/skills/plitzi-authoring/recipes/embed-and-svg.ts +3 -1
- package/skills/plitzi-authoring/recipes/filter-a-list.ts +0 -1
- package/skills/plitzi-authoring/recipes/show-data.ts +0 -1
- package/skills/plitzi-authoring/recipes/typed-data.ts +0 -1
- package/skills/plitzi-authoring/reference/accessibility.md +10 -2
- package/skills/plitzi-authoring/reference/auth.md +15 -4
- package/skills/plitzi-authoring/reference/authoring-errors.md +55 -12
- package/skills/plitzi-authoring/reference/colours-and-motion.md +7 -1
- package/skills/plitzi-authoring/reference/components.md +4 -1
- package/skills/plitzi-authoring/reference/data-and-visibility.md +31 -22
- package/skills/plitzi-authoring/reference/efficiency.md +2 -1
- package/skills/plitzi-authoring/reference/elements-and-styles.md +16 -15
- package/skills/plitzi-authoring/reference/flows.md +29 -17
- package/skills/plitzi-authoring/reference/kept-state.md +20 -0
- package/skills/plitzi-authoring/reference/layouts.md +18 -2
- package/skills/plitzi-authoring/reference/lists.md +20 -4
- package/skills/plitzi-authoring/reference/plugin-reach.md +12 -0
- package/skills/plitzi-authoring/reference/plugins.md +17 -3
- package/skills/plitzi-authoring/reference/realtime.md +8 -5
- package/skills/plitzi-authoring/reference/structure.md +17 -1
- package/skills/plitzi-authoring/reference/templates.md +11 -3
- package/skills/plitzi-authoring/reference/testing.md +82 -5
- package/skills/plitzi-authoring/reference/typed-sources.md +6 -0
- package/skills/plitzi-authoring/reference/validation.md +1 -1
|
@@ -38,6 +38,8 @@ same flags, decided on the server. Use the step builders — they fill in where
|
|
|
38
38
|
value, and one after a `delay` or a server action sees whatever changed meanwhile. To act on the value from BEFORE
|
|
39
39
|
a write, put the step that reads it first.
|
|
40
40
|
- **Keys are flat names.** A dotted key (`docsClosed.start`) is split into a path; use `docsClosedStart`.
|
|
41
|
+
- **Back skips a replaced address.** `navigate({ urlType: 'internal', url, replace: true })` takes the place of the one
|
|
42
|
+
the visitor is on: a sheet a query opened (`?stats=1`), closed, is not reopened by Back.
|
|
41
43
|
- **`setState` types**: `text`, `number` (decimals kept), `boolean` (the word or a real boolean), and `json` for an
|
|
42
44
|
object or a list — `value: '{{ list_rows.item }}'` stores the row itself; JSON text is parsed, and text that is not
|
|
43
45
|
JSON fails the step (the dev tools log it) instead of storing the text.
|
|
@@ -46,20 +48,24 @@ same flags, decided on the server. Use the step builders — they fill in where
|
|
|
46
48
|
|
|
47
49
|
Name the trigger (`named('changed', on('onChange'))`) and read its payload as `{{ changed.<field> }}`:
|
|
48
50
|
|
|
49
|
-
| Trigger | Payload
|
|
50
|
-
| ------------------------------------------------------------------------------------------------------ |
|
|
51
|
-
| `onChange` (formControl) | `value` (a boolean for a checkbox or switch), `name`
|
|
52
|
-
| `onSubmit` (form) | `values` (by control `name`), `actionUrl`, `method`
|
|
53
|
-
| `onPageLoad` (page) | `pageId`, `routeParams`, `queryParams`
|
|
54
|
-
| `onApiSuccess` / `onApiError` (apiContainer) | `url`, `method`, `status`, `data`
|
|
55
|
-
| `onModalOpen` / `onModalClose`, `onDialogOpen` / `onDialogClose` / `onDialogAccept` / `onDialogReject` | `metadata` — what `openModal` / `openDialog` was handed
|
|
56
|
-
| `onPageChange` (pagination) | `page`
|
|
57
|
-
| `onThemeChange` (themeToggle) | `theme`
|
|
51
|
+
| Trigger | Payload |
|
|
52
|
+
| ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------- |
|
|
53
|
+
| `onChange` (formControl) | `value` (a boolean for a checkbox or switch, the `File` for a file), `name` |
|
|
54
|
+
| `onSubmit` (form) | `values` (by control `name`), `actionUrl`, `method` |
|
|
55
|
+
| `onPageLoad` (page) | `pageId`, `routeParams`, `queryParams` |
|
|
56
|
+
| `onApiSuccess` / `onApiError` (apiContainer) | `url`, `method`, `status`, `data` |
|
|
57
|
+
| `onModalOpen` / `onModalClose`, `onDialogOpen` / `onDialogClose` / `onDialogAccept` / `onDialogReject` | `metadata` — what `openModal` / `openDialog` was handed |
|
|
58
|
+
| `onPageChange` (pagination) | `page` |
|
|
59
|
+
| `onThemeChange` (themeToggle) | `theme` |
|
|
58
60
|
|
|
59
61
|
## Reading what came before
|
|
60
62
|
|
|
61
63
|
`named('quote', step)` is how a later step reads an earlier one: `{{ quote.output.total }}`. The trigger too:
|
|
62
|
-
`named('submitted', onSubmit())` → `{{ submitted.values.email }}`. Unnamed steps get ids nothing can refer to.
|
|
64
|
+
`named('submitted', onSubmit())` → `{{ submitted.values.email }}`. Unnamed steps get ids nothing can refer to. An
|
|
65
|
+
element's flows share one record of steps: a name is one step's across all of them (`step-duplicate`). A
|
|
66
|
+
refused submit — a rule a control declares broken — starts `onInvalid()` (`{{ <id>.errors.<name> }}`) instead, and the
|
|
67
|
+
form's source says one was tried, valid or not, as `submitted`: a hint under a field steps aside once the field's own
|
|
68
|
+
error speaks — `visible: { source: '<form id>', template: '{{ not source.submitted }}' }`.
|
|
63
69
|
|
|
64
70
|
`whenSucceeded` / `whenFailed` read a server action's `status` (`runServerAction` only); any other step is asked what
|
|
65
71
|
it publishes (`npx @plitzi/cli explain login` lists it) — after `named('signedIn', authLogin(…))`,
|
|
@@ -99,19 +105,19 @@ where it is written.
|
|
|
99
105
|
|
|
100
106
|
**Something every few seconds** — an autoplay, a clock — is `onInterval(ms)`, a trigger every element has:
|
|
101
107
|
`[[onInterval(5000), cycleState({ key: 'slide', length: 4 })]]`. It
|
|
102
|
-
ticks while
|
|
103
|
-
(`trigger-interval` otherwise). To pause it, give its steps a condition
|
|
104
|
-
`on('onMouseLeave')` clears. `{{ <step>.count }}`
|
|
108
|
+
ticks while mounted and the tab in view, never in the builder outside preview, every 250 ms at least
|
|
109
|
+
(`trigger-interval` otherwise). To pause it, give its steps a condition: a state `on('onMouseEnter')` sets,
|
|
110
|
+
`on('onMouseLeave')` clears. `{{ <step>.count }}` counts its ticks. No plugin needed.
|
|
105
111
|
|
|
106
112
|
**A number that goes round, or stops:** `cycleState({ key: 'slide', length: 4 })` is "next" — after the last the first
|
|
107
113
|
— and `by: -1` "previous"; `stepState({ key: 'shown', by: 40, max: 'apiContainer_site.data.total' })` adds and stops
|
|
108
114
|
at the bound.
|
|
109
115
|
|
|
110
116
|
**Scrolling** is a step on the element whose box scrolls (`overflow-x: auto` on a row of cards): `scrollBy('cards',
|
|
111
|
-
{ x: '80%' })` moves it
|
|
112
|
-
to an end or a place, and `scrollIntoView('answer', { block: 'center' })` brings an element into view. `onScroll()`
|
|
117
|
+
{ x: '80%' })` moves it (`'-80%'` back, `'240'` pixels), `scrollTo('cards', { x: 'end' })` to an end or a place, and `scrollIntoView('answer', { block: 'center' })` brings one into view. `focus('chat-input')` gives it, or its first field, the keyboard. `onScroll()`
|
|
113
118
|
fires as the box moves and once on mount, with `{ x, y, atStart, atEnd }` — what an arrow that hides at the end reads
|
|
114
|
-
(recipes/scroll-a-row.ts). A link to a section
|
|
119
|
+
(recipes/scroll-a-row.ts). `onView()` fires on entering and leaving. A link to a section is an
|
|
120
|
+
`anchor` and a link's `hash`.
|
|
115
121
|
|
|
116
122
|
**A form's flow goes on the `form`**, which hands its submit over with `managedByInteractions: true`
|
|
117
123
|
(`FORM_SUBMIT_UNMANAGED` otherwise — the browser submits it natively and `onSubmit` never fires):
|
|
@@ -161,7 +167,13 @@ Pages that see each other — cursors, presence, a shared board — talk over a
|
|
|
161
167
|
## Lists as state
|
|
162
168
|
|
|
163
169
|
`toggleInState({ key: 'picks', value })` keeps a list; `when({ field: 'state.picks', operator: 'contains', value })`
|
|
164
|
-
asks it.
|
|
170
|
+
asks it. A rule reads PATHS, never templates (refused: `condition-template`): `field` is one — a named step
|
|
171
|
+
(`sent.values.code`), `state.*`, `computed.*`, `flags.*`, route and query params, the sources around the element the
|
|
172
|
+
flow is on (a row's `list_<id>.item.*` from inside the row); `value` is a literal, or another path with
|
|
173
|
+
`isBinding: true` — `{ field: 'state.picks', operator: 'contains', value: 'list_genres.item.id', isBinding: true }`. An
|
|
174
|
+
unset field holds no comparison (`=`, `contains`, `<`) and every negation (`!=`, `doesNotContain`). A list's count is
|
|
175
|
+
`.length`, unset until the list is: three picks at most is `when([{ field: 'state.picks', operator: 'empty' }, { field:
|
|
176
|
+
'state.picks.length', operator: '<', value: 3 }], step, 'or')`; any other expression, a computed value. `appendState({ key, value, withId: true })` stores `{ id, value }` — bind `.value`, address by `.id`.
|
|
165
177
|
`whenFailed` matches every outcome that is not `completed` (also `skipped`, `aborted`). A failed run gives `reason`,
|
|
166
178
|
and `error` only when the server or a step wrote one for the caller (a task throwing `ActionRefusal`, `flow.fail` with
|
|
167
179
|
`tellCaller`) — so show `{{ saved.error ? saved.error : "…" }}`, never the bare `error`. That pair is one call:
|
|
@@ -10,6 +10,14 @@ brought back:
|
|
|
10
10
|
settings: { keepState: true, transientState: ['filter', 'tourStep', 'panelOpen'] }
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
When few keys are kept and many are not — a dismissed notice, and the page's every other key fresh — name the ones
|
|
14
|
+
kept instead, with `keptState`: only those are written and brought back. One of the two, never both (`authorSpace`
|
|
15
|
+
refuses it), and a `paintedState` key is one of the kept:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
settings: { keepState: true, keptState: ['dismissedShow'] }
|
|
19
|
+
```
|
|
20
|
+
|
|
13
21
|
Do not reset kept state from `onPageLoad` instead: what was kept is restored late — after hydration, once auth knows
|
|
14
22
|
who this is — and lands in the middle of that flow, so half of it is undone. A filter restored on the next visit is a
|
|
15
23
|
page that looks broken. Keeping state is the SPACE's setting; a page does not take `keepState`.
|
|
@@ -26,3 +34,15 @@ settings: { keepState: true, paintedState: ['shapesPick', 'name', 'color'], tran
|
|
|
26
34
|
Only what the first paint shows, and small values: the cookie travels with every request and holds a few kilobytes
|
|
27
35
|
(over that, the page falls back to the defaults and the dev tools say so). Never a secret — a key, a token — and never
|
|
28
36
|
a key that is also in `transientState` (`authorSpace` refuses it).
|
|
37
|
+
|
|
38
|
+
Filed under whoever is signed in, what was kept goes when somebody else signs in — the guest's, too, when they sign
|
|
39
|
+
in. A choice made of the BROWSER rather than of the person — the cookie consent — is then asked again on every change
|
|
40
|
+
of account. List those keys in `browserState`: kept in an entry of their own that signing in, out or as somebody else
|
|
41
|
+
does not take away, and restored without waiting for auth. A key of the browser's is a kept one (`authorSpace` refuses
|
|
42
|
+
one that is transient or not in `keptState`), and may be painted too:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
settings: { keepState: true, paintedState: ['consent'], browserState: ['consent'] }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Never something that belongs to an account — a workspace, a name: the next person on the browser would be handed it.
|
|
@@ -31,8 +31,9 @@ pages: [{ name: 'Quickstart', slug: 'quickstart', folder: 'docs', layout: { id:
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
- **The slot** is the element in the layout where the page's body goes. It must be inside the layout (checked).
|
|
34
|
-
- **Not re-mounted on navigation.** Moving between pages of one layout keeps the shell —
|
|
35
|
-
its providers, its state — and swaps only the slot
|
|
34
|
+
- **Not re-mounted on navigation.** Moving between pages of one layout keeps the shell — a scrolling part's scroll,
|
|
35
|
+
its open menus, its providers, its state — and swaps only the slot; the document opens another page at its top, and
|
|
36
|
+
back and forward where the visitor left it. That is also why a layout is cheaper than a copy.
|
|
36
37
|
- **Layouts nest.** `layout: { id: 'app-shell', slot: 'main' }` on a LAYOUT puts a section shell (analytics tabs, docs
|
|
37
38
|
sidebar) inside the application shell. The page resolves the chain from the outside in.
|
|
38
39
|
- **A provider in a layout serves every page** — the plan in a sidebar, a star count in a top bar. A server provider
|
|
@@ -83,6 +84,21 @@ const navGroup = (group: DocsGroup): ElementSpec =>
|
|
|
83
84
|
|
|
84
85
|
Adding a page is one entry in the list: the menu, the index and the neighbours' "next" follow.
|
|
85
86
|
|
|
87
|
+
**Or each page says it**, when pages are added apart — by several people, or a team of agents — and one list would be
|
|
88
|
+
the file they all change. The page carries `nav: { label: 'Pets', order: 3 }`; `navOf(pages)` reads the links, lowest
|
|
89
|
+
`order` first, `current: 'section'` for a page with others under it; with `pagesIn` (`@plitzi/sdk-authoring/node`) the
|
|
90
|
+
entry loads every page of a folder, so a new page is a file of its own and nothing else. It reads the disk: a project
|
|
91
|
+
with a server only — one that authors its space in the browser lists its pages (`plitzi doctor` says `node-in-browser`).
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
const pages = await pagesIn(new URL('./pages/', import.meta.url)); // each module's default export: a page, or a family
|
|
95
|
+
export const space: SpaceSpec = { …, layouts: [siteLayout(navOf(pages))], pages: [...pages, notFound] };
|
|
96
|
+
// layout.ts: menu.map(entry => link({ href: entry.href, content: entry.label, current: entry.current, class: navLink }))
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`nav` is authoring only: the layout's links are what the document keeps. A page with a param in its path has no one
|
|
100
|
+
address to list (`page-nav-invalid`).
|
|
101
|
+
|
|
86
102
|
## The current entry
|
|
87
103
|
|
|
88
104
|
A menu in a layout is the same nodes on every page, so it cannot have the right entry styled by hand — and does not
|
|
@@ -11,6 +11,7 @@ list({ id: 'games', class: gameGrid, items: 'catalog.data.games', row: 'game-car
|
|
|
11
11
|
list({ id: 'games', items: 'catalog.data.games', row: r => listItem({ children: [text({ from: `${r.item}.title` })] }) })
|
|
12
12
|
// typed by a sample (`items: catalog.data.games`): `r.item` is a path — `from: r.item.title`, never `${r.item}.title`
|
|
13
13
|
list({ id: 'plans', items: ['Free', 'Pro'], children: [listItem({ children: [text({ from: 'plans.item' })] })] }) // fixed
|
|
14
|
+
list({ id: 'steps', subType: 'ol', children: [listItem({ children: [text('Mix')] }), listItem({ children: [text('Bake')] })] }) // written out
|
|
14
15
|
```
|
|
15
16
|
|
|
16
17
|
`items` (or `from`) makes a list controlled: an array of its own, or the source its rows come from. `row` is what it renders once
|
|
@@ -40,6 +41,9 @@ row's names: `r.item` and `r.index` for a binding or `from`, `r.inTemplate.item`
|
|
|
40
41
|
reordered, a row's state (an open detail, a field's text) follows its item. Items named by another field say so —
|
|
41
42
|
`itemKey: 'slug'` (`list-item-key-missing` warns when fixed items lack it). A row whose item changes mounts again,
|
|
42
43
|
so a one-row list showing "the current slide" replays the slide's entrance animation.
|
|
44
|
+
- **A data table** (a comparison, a product's specs) is a `markdown` element whose text is a table (`| a | b |`),
|
|
45
|
+
dressed through its slots `table`, `tableHead`, `tableRow`, `tableHeaderCell`, `tableCell`. There is no table
|
|
46
|
+
element: lists laid out as one read as no table to a screen reader or a search engine.
|
|
43
47
|
|
|
44
48
|
## Filtering and sorting
|
|
45
49
|
|
|
@@ -54,7 +58,9 @@ list({
|
|
|
54
58
|
})
|
|
55
59
|
```
|
|
56
60
|
|
|
57
|
-
Only the rows that match are rendered.
|
|
61
|
+
Only the rows that match are rendered. What it filters by may be another source's value, named in full — never a
|
|
62
|
+
literal copied out of the data: `{{ source|filter(p => p.collections|contains(apiContainer_site.data.home.collection))
|
|
63
|
+
}}`. A counter and an empty state read the same predicate over the same source:
|
|
58
64
|
`{{ source|filter(…)|length }}` as text, and `visible: { source: 'catalog.data.games', template: "{{ source is defined
|
|
59
65
|
and source|filter(…)|length == 0 }}" }`.
|
|
60
66
|
|
|
@@ -97,13 +103,23 @@ carousel({ id: 'hero', label: 'Featured', items: 'site.data.slides', autoplay: 5
|
|
|
97
103
|
|
|
98
104
|
A `carousel` takes `items` and a `row` as a list does, and writes the row into a `carouselTrack`; its other children are
|
|
99
105
|
its controls, which read `carousel_hero.index`, `.count`, `.item` and `.items` (`list({ id: 'dots', items: 'hero.items',
|
|
100
|
-
… })` for dots, `activeWhen(dot, '{{ list_dots.index == carousel_hero.index }}')` for the current one)
|
|
101
|
-
|
|
106
|
+
… })` for dots, `activeWhen(dot, '{{ list_dots.index == carousel_hero.index }}')` for the current one), and where it
|
|
107
|
+
stands: `.atStart`, `.atEnd` (a `scroll` row at either end of its box, however many it shows; one that loops is never at
|
|
108
|
+
one) and `.shown` (slides in view whole) — an arrow hidden at its end is `activeWhen(arrow, '{{ carousel_hero.atEnd }}', { variant: 'spent' })`.
|
|
109
|
+
Steps: `carouselNext(id, by?)`, `carouselPrevious(id, by?)` — `'page'` moves a row by as many as it shows —,
|
|
110
|
+
`carouselGoTo(id, index)`, `carouselPlay`, `carouselPause`; it fires `onChange`.
|
|
102
111
|
|
|
103
112
|
- `mode: 'slide'` (one at a time, `transition` `slide`/`fade`/`none`, back enters from the left), `'marquee'` (`speed` px/s,
|
|
104
|
-
no seam), `'scroll'` (a row that snaps and swipes; next moves a slide). Several slides at once: the carousel's class
|
|
113
|
+
no seam), `'scroll'` (a row that snaps and swipes; next moves a slide, or a page). Several slides at once: the carousel's class
|
|
105
114
|
sets `--plitzi-carousel-slide-width` and `--plitzi-carousel-gap`.
|
|
106
115
|
- Autoplay holds still under the pointer (`pauseOnHover`), with keyboard focus inside, in a hidden tab and for reduced
|
|
107
116
|
motion. In the builder it stands on its first slide. `label` names it for a screen reader.
|
|
108
117
|
|
|
109
118
|
See recipes/carousel.ts.
|
|
119
|
+
|
|
120
|
+
## Rows as a chart
|
|
121
|
+
|
|
122
|
+
A `chart` draws rows too — bars, a line, an area or a donut, SVG of its own: bind `items` as a list's
|
|
123
|
+
(`bindTemplate('items', 'stats.data', '{{ source.days }}', { returns: 'value' })`), name the fields (`labelField`,
|
|
124
|
+
`valueField`) and say what it shows (`label`, read aloud with its rows as a table). It takes the colour of the text
|
|
125
|
+
around it; its parts (`bar`, `line`, `grid`, `axisLabel`…) restyle it. Never a plugin for a bar chart.
|
|
@@ -33,6 +33,18 @@ assistant({ id: 'jarvis', flows: [[
|
|
|
33
33
|
The receiver declares the action (`callbacks`) and registers it from its declaration; a name either side does not
|
|
34
34
|
declare is refused when the space is authored.
|
|
35
35
|
|
|
36
|
+
## To the elements inside it: `PluginSource`
|
|
37
|
+
|
|
38
|
+
A plugin the space puts elements in — a player and its buttons — publishes a source to them, as a list or a form does:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
// its declaration: sourceType: 'player', publishes: { track: 'The track playing', playing: 'Whether it plays' }
|
|
42
|
+
return <PluginSource declaration={declaration} data={{ track, playing }}>{children}</PluginSource>;
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Inside, `{{ player_deck.track }}` (`<sourceType>_<id>`), checked when the space is authored. Only what is inside it
|
|
46
|
+
reads it; what every page reads is kept state or a channel.
|
|
47
|
+
|
|
36
48
|
## To the server: `useServerAction`
|
|
37
49
|
|
|
38
50
|
One operation is one server action — `taskAction(tasks.done, …)` or `defineAction(…)` — whose input the server checks
|
|
@@ -21,6 +21,10 @@ and `index.ts` (`Object.assign(Component, declaration, { pluginSettings: Setting
|
|
|
21
21
|
`@plitzi/sdk-authoring/plugin`: the rest of what the builder needs is derived. An event or an action is declared there
|
|
22
22
|
and registered by the component from there, never only in the component.
|
|
23
23
|
|
|
24
|
+
`contentAttributes: ['caption']` names the attributes a person who may edit only a space's content (the **Can edit
|
|
25
|
+
content** role) changes on it — its words, a link, a picture; left out, none, and they change nothing on it. The builder
|
|
26
|
+
offers them as a form, and the server refuses any other change from that role.
|
|
27
|
+
|
|
24
28
|
A plugin fires its events with `const fire = usePluginTrigger(declaration)` (`@plitzi/plitzi-sdk`), typed by the
|
|
25
29
|
declaration: `fire('onPick', { seat })` — an undeclared event, or a payload missing a field its `preview` names, does
|
|
26
30
|
not compile. Nothing fires while the page is edited. Fire whenever there is news — from the first effect too: a flow
|
|
@@ -54,7 +58,8 @@ const NebulaRun = ({ shipColor = 'amber', best = 0, className }: NebulaRunProps)
|
|
|
54
58
|
```
|
|
55
59
|
|
|
56
60
|
- **Render `RootElement`**, not a `div`: it carries the element's id, classes and `data-plitzi-el`, so the CSS
|
|
57
|
-
authored on the element applies, the builder can select it and a test can find it.
|
|
61
|
+
authored on the element applies, the builder can select it and a test can find it. It is a `div` unless `tag` says
|
|
62
|
+
otherwise — `tag="span"` for an effect inside a line of text, `tag="section"`, `tag="button"`.
|
|
58
63
|
- **Render the same thing on the server and on the first client pass** — a plugin is drawn on the server first. A
|
|
59
64
|
clock, a random number or anything read from `window` belongs in an effect; a hydration mismatch discards the whole
|
|
60
65
|
tree, not the plugin. A preference per device (a tab, muted) is never read from `localStorage` while rendering: write
|
|
@@ -169,6 +174,9 @@ the component: the flow is visible in the space, and a button can do the same.
|
|
|
169
174
|
|
|
170
175
|
- An action's param declared `number` or `boolean` arrives as one, written or bound; any other arrives as written.
|
|
171
176
|
- To act when another element appears, `useElementVisible('tools')` (`@plitzi/plitzi-sdk`) — never watch classes.
|
|
177
|
+
- What a visitor changes of its own view — a map's camera, the item it flew to — kept in its element state too,
|
|
178
|
+
`useElement().setElementState({ focus })`: `page play` and `page check --element` read it, where a canvas looks the
|
|
179
|
+
same to them before and after.
|
|
172
180
|
- A name for screen readers is a prop of its own: declare `label`, write it as the root's `aria-label`.
|
|
173
181
|
|
|
174
182
|
## Behaving in the builder
|
|
@@ -187,13 +195,19 @@ belongs to the editor.
|
|
|
187
195
|
|
|
188
196
|
## The plugin's stylesheet and the space's CSS
|
|
189
197
|
|
|
190
|
-
A plugin's stylesheet ships in a layer below the space's (`plitzi-sdk-plugin
|
|
191
|
-
|
|
198
|
+
A plugin's stylesheet ships in a layer below the space's (`plitzi-sdk-plugin`): the space's classes and `customCss`
|
|
199
|
+
win over it whatever their specificity. Write it as
|
|
200
|
+
`.css` files the plugin imports (in the server's head, its tokens seen) — never a CSS string in TypeScript. It comes
|
|
201
|
+
with the plugin: linked on the pages that draw it, on no other. A stylesheet several plugins need — a design system's —
|
|
202
|
+
is imported by each that uses it, never by one for the rest: those go unstyled on every page without that one.
|
|
192
203
|
|
|
193
204
|
A file a library needs whole is imported as Vite imports it, and travels inside the bundle: `worker.js?raw` is its
|
|
194
205
|
text (a worker, started from `URL.createObjectURL(new Blob([source]))`), `engine.wasm?inline` a data URI. Images and
|
|
195
206
|
fonts a stylesheet names are carried the same way.
|
|
196
207
|
|
|
208
|
+
**A plugin's link** reloads the page unless a plain click goes through the SDK: `useStore('navigation.navigate')`,
|
|
209
|
+
then `event.preventDefault(); navigate(href)` — the `href` kept for new tabs.
|
|
210
|
+
|
|
197
211
|
## Components that draw into DOM they do not render
|
|
198
212
|
|
|
199
213
|
A map, a chart library, anything that positions its own markers or popups: its roots are the library's to place. Never
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Realtime channels
|
|
2
2
|
|
|
3
3
|
Pages that see each other — cursors, presence, a shared board — need a channel. Declare its topic pattern on the space,
|
|
4
|
-
then subscribe with a `channel` element; a topic no pattern matches is refused, naming the patterns
|
|
4
|
+
then subscribe with a `channel` element; a topic no pattern matches is refused, naming the patterns. Each `{{ … }}` of
|
|
5
|
+
a topic is checked as one segment, a choice `{{ room.locked ? 'vault' : 'room' }}:{{ id }}` as both words (each needs
|
|
6
|
+
its pattern); a topic put together otherwise is the page's, as a bound `topic` is — only the server checks it:
|
|
5
7
|
|
|
6
8
|
```ts
|
|
7
9
|
channels: {
|
|
@@ -35,8 +37,8 @@ channel({ id: 'order', topic: 'order:{{ id }}', bind: { grant: 'state.follow.gra
|
|
|
35
37
|
|
|
36
38
|
State every screen shows and the server keeps — a dashboard's lists, a board's settings — goes on a channel declared
|
|
37
39
|
`retain: true` (and `publish: 'server'`): the server keeps the latest message of each type, sends it as it is said and
|
|
38
|
-
again to every page that joins —
|
|
39
|
-
`desk.retained.lists` (a plugin, `useChannel('desk').retained`).
|
|
40
|
+
again to every page that joins — to its `onMessage` flows too, marked `replayed`: a moment (a room opened) is
|
|
41
|
+
answered `when` it is not — which reads it as `desk.retained.lists` (a plugin, `useChannel('desk').retained`).
|
|
40
42
|
Publishing `null` forgets the type; a topic keeps at most 64 types and 512 KB. No read of its own, no copy in `state`:
|
|
41
43
|
|
|
42
44
|
```ts
|
|
@@ -49,5 +51,6 @@ for whoever started it and whoever the job's `watch` lets in: `channel({ id: 'tr
|
|
|
49
51
|
binds `training.retained.job` (`{ status, progress, step, result, error }`).
|
|
50
52
|
|
|
51
53
|
Two people writing the same thing at once: `kv.setIf` writes only if the value is still the one the flow read (empty
|
|
52
|
-
`expected` = only if nothing is there yet — claim a seat, a username), `list.put`/`list.range` keep an ordered list
|
|
53
|
-
(latest first, a leaderboard), and `flow.rateLimit` first in a public action that writes
|
|
54
|
+
`expected` = only if nothing is there yet — claim a seat, a username), `list.put`/`list.range` keep an ordered list (a tie by `id`, never the order written)
|
|
55
|
+
(latest first, a leaderboard), and `flow.rateLimit` first in a public action that writes — each step's params:
|
|
56
|
+
`npx @plitzi/cli explain flow.rateLimit`, every one `explain --list tasks`.
|
|
@@ -17,7 +17,7 @@ src/space/
|
|
|
17
17
|
layout.ts the section shell, generated from nav.ts
|
|
18
18
|
page.ts docsPage(id, content) — the shape every page of the section shares
|
|
19
19
|
pages/
|
|
20
|
-
home.ts one file per page, or per page family
|
|
20
|
+
home.ts one file per page, or per page family — `pagesIn` loads the folder (layouts.md, "The menu is data")
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Components are functions
|
|
@@ -97,6 +97,22 @@ the record is the answer instead: one page, as many addresses as records. Its `s
|
|
|
97
97
|
`'{{ apiContainer_post.title }} — Blog'` — read from a provider on the page with `runtime: 'server'`, or from
|
|
98
98
|
`navigation`: the server writes the head with it, so a link preview shows it. Anything else is refused (`page-template`).
|
|
99
99
|
|
|
100
|
+
**For search engines**, beside the title: a page's `robots` (`'noindex'`, `'noindex, nofollow'` — left out, it is
|
|
101
|
+
indexed) and its `structuredData`, schema.org's JSON-LD — `{ '@context': 'https://schema.org', '@type': 'SportsEvent',
|
|
102
|
+
name, startDate, location }`, one object or a list, each text a template as `seoTitle` may be (`name: '{{
|
|
103
|
+
apiContainer_boxer.name }}'` on a detail page) — both written into the head the server sends. The space's
|
|
104
|
+
`/robots.txt` is `settings.robotsTxt` (`'User-agent: *\nAllow: /\n'` when left out), then a `Disallow: /` for each AI
|
|
105
|
+
crawler with `settings.blockAiCrawlers: true`, then the sitemap's address. `/sitemap.xml` lists every page a search
|
|
106
|
+
engine may read — not one only signed-in visitors or a role open, with a param or `*` in its slug, saying `noindex` or
|
|
107
|
+
behind a flag. Keep a page out of search with its `robots`, not a `Disallow` — a crawler barred from a page never reads
|
|
108
|
+
its `noindex`.
|
|
109
|
+
|
|
110
|
+
**Where a link to it is pasted** — a chat, a post: a page's `seoImage` is the picture its card shows (`'/og/home.png'` in
|
|
111
|
+
`public/`, an address, or a template — `'{{ apiContainer_room.cover }}'`), about 1200×630, with `seoImageAlt`; its
|
|
112
|
+
`seoType` is what it is (`'article'`, `'music.playlist'`; `'website'` left out). The space says who it is once, in
|
|
113
|
+
`settings`: `siteName`, `language` (`<html lang>`), `favicon`, `shareImage` (a page with no picture of its own) and
|
|
114
|
+
`themeColor` (`'#ff6a3d'` or `{ light, dark }`). The server writes the card, the page's address and the icon itself.
|
|
115
|
+
|
|
100
116
|
## Names
|
|
101
117
|
|
|
102
118
|
- **Ids:** `area-role` in kebab-case — `hm-traffic-title`, `docs-nav-docs-data`. Never the builder's positional
|
|
@@ -55,7 +55,8 @@ outside the element that publishes it — each with the name it should have been
|
|
|
55
55
|
## The language
|
|
56
56
|
|
|
57
57
|
- Operators: `~` (concat), `+ - * / // % **`, `== != < > <= >=`, `and or not`, `in`, `starts with`, `ends with`,
|
|
58
|
-
`a ? b : c`, `a ? b` (empty when false), `a ?: b` (a when truthy), `a ?? b` (a when defined).
|
|
58
|
+
`a ? b : c`, `a ? b` (empty when false), `a ?: b` (a when truthy), `a ?? b` (a when defined). `or` and `and` answer
|
|
59
|
+
true or false, never a value: `sort or 'listeners'` is `true` — the fallback is `sort ?? 'listeners'` (`template-or-value`).
|
|
59
60
|
- Access: `a.b`, `a.0`, `a[i]`, `(expr).key`, `(expr)[i]`, `['x', 'y'][i]`, `{ k: 1 }.k`.
|
|
60
61
|
- Blocks: `{% set x = … %}`, `{% if %}…{% elseif %}…{% else %}…{% endif %}`, `{% for item in list %}…{% endfor %}`,
|
|
61
62
|
`{% apply upper %}…{% endapply %}`, `{% break %}`, `{% continue %}`.
|
|
@@ -63,8 +64,11 @@ outside the element that publishes it — each with the name it should have been
|
|
|
63
64
|
`rows|sort((a, b) => b.score - a.score)`, `rows|filter(r => r.score >= min)`, `rows|map(r => r.name)`.
|
|
64
65
|
- Tests: `is defined`, `is empty`, `is null`, `is iterable`, `is even`, `is odd`, `is same as(x)` (strict: `false` is
|
|
65
66
|
not `'false'`, `0` or an unset value), `is divisible by(n)`, and their `is not` forms. `null` and `none` are literals.
|
|
67
|
+
A key set to `null` **is defined** (only one never set is not); `is null` holds for both, and `is empty` for those,
|
|
68
|
+
`''` and `[]`.
|
|
66
69
|
- Functions: `range`, `min`, `max`, `cycle`. `abs` is a filter (`x|abs`); floor and ceil are `x|round(0, 'floor')` and
|
|
67
70
|
`x|round(0, 'ceil')`; a clamp is `min(max(x, low), high)`.
|
|
71
|
+
- Filters: `npx @plitzi/cli explain --list filters` lists every one, `explain <filter>` its signature and an example.
|
|
68
72
|
- **Not supported**: `matches` (no regular expressions are evaluated — use `starts with`, `ends with`, `in`), macros,
|
|
69
73
|
`include`/`extends`, and any filter or function not listed here. `authorSpace` refuses them, and anything else the
|
|
70
74
|
interpreter would read past, rather than letting a template render a value nobody wrote.
|
|
@@ -109,5 +113,9 @@ A lookup across two sources — a row joined to the stats around it:
|
|
|
109
113
|
as it is (`\T`). **Always pass a zone** (`'UTC'`) and print it: with no zone the date is formatted in the local time
|
|
110
114
|
of whoever renders it — the server's for the HTML, the visitor's after hydration — and the two disagree.
|
|
111
115
|
- A timestamp can be seconds or milliseconds, a number or a string of digits — all read.
|
|
112
|
-
-
|
|
113
|
-
|
|
116
|
+
- **Now** is `'now'`: `{{ 'now'|date('F Y', 'UTC') }}` is the month the page is rendered in — on the server, then again
|
|
117
|
+
in the browser, so keep it to the day or coarser (a minute can pass between the two). An age, a "this month", a
|
|
118
|
+
countdown reads it instead of a date written into the page.
|
|
119
|
+
- For "3 minutes ago" or "in 2 hours", `|ago` (`|ago('es')` in another language) — rendered on the server, then again
|
|
120
|
+
in the browser, so it holds to the minute. A transformer of a binding does the same: `dateConverter` with
|
|
121
|
+
`{ asAge: true }` (`isUnix: false` for an ISO string).
|
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# Testing what you authored
|
|
2
2
|
|
|
3
|
+
## The space's own tests — `tests` in the spec
|
|
4
|
+
|
|
5
|
+
A space keeps its tests in its document, beside its pages, and every door reads the same records: the builder's
|
|
6
|
+
**Tests** area plays them on its canvas, `plitzi test` and `plitzi verify` run them, the MCP's `plitzi_test` lists, saves
|
|
7
|
+
and runs them, and a snapshot and a publish wait for them. Two kinds, apart — **element checks** (unit tests) and
|
|
8
|
+
**journeys** (e2e tests: what a visitor does, from start to end; not an interaction's flow):
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { e2e, unit } from '@plitzi/sdk-authoring';
|
|
12
|
+
|
|
13
|
+
export const space: SpaceSpec = {
|
|
14
|
+
// …its pages…
|
|
15
|
+
tests: {
|
|
16
|
+
// One element resolved for a state, no browser: attributes, style, `visible`, a class's `variant`, its `state`.
|
|
17
|
+
unit: [
|
|
18
|
+
unit.test({
|
|
19
|
+
id: 'app-lit',
|
|
20
|
+
title: 'Choosing App lights its step',
|
|
21
|
+
element: 'plan-app',
|
|
22
|
+
given: { state: { plan: 'app' } }, // sources too: `list_rows: { item, index }`
|
|
23
|
+
expect: [unit.variant('rung', 'current')]
|
|
24
|
+
})
|
|
25
|
+
],
|
|
26
|
+
// A visitor's steps on a page, what must hold between them — elements by id, a list's copy as `row:3`.
|
|
27
|
+
e2e: [
|
|
28
|
+
e2e.test({
|
|
29
|
+
id: 'adds',
|
|
30
|
+
title: 'A visitor adds a coffee',
|
|
31
|
+
page: '/menu',
|
|
32
|
+
width: 390,
|
|
33
|
+
answers: { 'menu-items': { items: [] } }, // an action answered by the test: the same data every run
|
|
34
|
+
steps: [e2e.click('add-flat-white'), e2e.expectText('cart-count', '1'), e2e.expectPosition('cart.bottom <= footer.top')]
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`plitzi test --unit` runs the element checks alone, no browser.
|
|
42
|
+
|
|
43
|
+
- **Read with the space.** A test the space no longer answers — a page renamed, an element removed, a relation that is
|
|
44
|
+
none — is the warning `test-unreadable` of `lintSpace` and `author`, wherever the space was changed: a `plitzi space
|
|
45
|
+
lint`, an MCP batch ("This change leaves a test of the space unreadable…"), the builder. Fix the test, or the space.
|
|
46
|
+
- **A journey may start on a wrong address** its space answers with its own not-found page (`slug: '*'`), to test it.
|
|
47
|
+
- **Both kinds at once.** `e2e.expectCheck('<element check id>')` holds an element check where the journey has got to —
|
|
48
|
+
its element resolved for the page's state then, not the check's own `given.state`: write a rule once as a check, hold
|
|
49
|
+
it at each point a flow reaches. `given: { state: { … } }` starts a journey with a state, as the page opens: a case
|
|
50
|
+
reached without the steps to it. Both use the page's state bridge, which every runner has.
|
|
51
|
+
- **Tags**: `tags: ['sign-in']`, lower case, each once; `plitzi test --tag sign-in` runs only those.
|
|
52
|
+
- **Signed in: `as` a test account.** `tests.accounts: [e2e.account({ id: 'member', roles: ['author'] })]` and
|
|
53
|
+
`e2e.test({ …, as: 'member' })`: the page shows that visitor signed in (its details; what its roles — the space's
|
|
54
|
+
`settings.visitorRoles` — give; a page for signed-in visitors opens). A role the space removed since is warned. Declared in the tests alone — no real account, no password — so the API answers it as a
|
|
55
|
+
guest: a journey with an account reads and moves, never writes.
|
|
56
|
+
- **A `type` step names the element** — a form control's id — and replaces what the field inside it held; a select is
|
|
57
|
+
chosen from (its option's value or label), a date, a time or a range set whole, a file field given a real file of the
|
|
58
|
+
kind it names: `e2e.type('photo', 'me.png')`.
|
|
59
|
+
- **A point of an element**: `e2e.click('map', { x: 30, y: 60 })` (and `hover`) lands at that percent of its box — a
|
|
60
|
+
marker a canvas draws has no element of its own. `e2e.scroll(id)` brings it into view; with `{ dx, dy }` its own
|
|
61
|
+
content scrolls.
|
|
62
|
+
- **In words.** `parseE2eSteps('click add-flat-white; expect-text cart-count = 1')` reads steps as the CLI's
|
|
63
|
+
`--steps` write them; `e2eStepText` writes one back.
|
|
64
|
+
- **A press acts on the copy a visitor sees**: the first shown, or the one named (`row:3`, `row:last`). An element on
|
|
65
|
+
the page and shown nowhere at the test's width fails as "hidden at this width" — press what that width shows (the
|
|
66
|
+
burger, then the item), or give the test the width that shows it.
|
|
67
|
+
- **A plan keeps a number of journeys per space, and plays a number on the server a month** — Free one journey, more on
|
|
68
|
+
each plan up; element checks and plays in the builder's canvas have no limit. A save past it is refused, naming the
|
|
69
|
+
plan that keeps more: never delete a journey of the space's to make room for yours — say so.
|
|
70
|
+
- **What only a browser of its own plays** — `clock`, `answers`, `reload` — is played by the server's run ("Run on the
|
|
71
|
+
server", `plitzi test`), not by the builder's canvas.
|
|
72
|
+
|
|
3
73
|
## One call: `inspectPage`
|
|
4
74
|
|
|
5
75
|
```ts
|
|
@@ -26,11 +96,13 @@ It checks the open page and returns EVERY problem at once, one sentence each, na
|
|
|
26
96
|
- every image arrived — an image element that failed says so (`data-plitzi-failed`), though its fallback loads. A lazy
|
|
27
97
|
image out of sight (below the fold, or beside the screen in a carousel's track) has not been asked for yet, and waits;
|
|
28
98
|
- nothing scrolls sideways (`the page scrolls sideways by 37px — widest: "cards"`);
|
|
29
|
-
- no text is drawn in the colour painted behind it
|
|
99
|
+
- no text is drawn in the colour painted behind it;
|
|
100
|
+
- a screen reader can follow it: the headings start at an `h1` and skip no level, as the page is drawn — layouts and
|
|
101
|
+
components included (`heading-skipped`), and every link, button and field has a name (`control-unnamed`).
|
|
30
102
|
|
|
31
103
|
It retries for up to 5 s like an assertion does (`timeout`), so a provider still answering is not a failure. Options:
|
|
32
104
|
`page` (id or slug; the home page by default), `elements: 'all'` to owe the unnamed elements too, `ignore: ['id']` for
|
|
33
|
-
what a test knows is not there yet (a typo is refused), `skip: ['images']` for a check a page breaks on purpose.
|
|
105
|
+
what a test knows is not there yet (a typo is refused), `skip: ['images']` (or `'overflow'`, `'legibility'`, `'accessibility'`) for a check a page breaks on purpose.
|
|
34
106
|
`inspectDocument(page)` runs the page checks alone, for a page whose space is not in hand.
|
|
35
107
|
|
|
36
108
|
## Handles
|
|
@@ -54,8 +126,11 @@ Three flags say what a bare visit cannot promise, and `onScreen` leaves out:
|
|
|
54
126
|
|
|
55
127
|
A `formControl`'s id names its wrapper: type into `locate('email').locator('input')`.
|
|
56
128
|
|
|
57
|
-
Select by `data-plitzi-el`, never by a generated class name: authoring derives `<type>-<hash>` for an element's
|
|
58
|
-
rules, and that name changes when the rules do.
|
|
129
|
+
Select by `data-plitzi-el`, never by `#id` or a generated class name: authoring derives `<type>-<hash>` for an element's
|
|
130
|
+
own rules, and that name changes when the rules do. A component's instance has no node of its own — its id is on the
|
|
131
|
+
component's root as `data-plitzi-instance` — so take the selector from `handles.element(id)`, which says which. A
|
|
132
|
+
spec naming an instance by `data-plitzi-el` finds nothing, and `toBeHidden()` passes on it: `plitzi space lint` says it
|
|
133
|
+
(`selector-instance`).
|
|
59
134
|
|
|
60
135
|
## Pressing a shortcut
|
|
61
136
|
|
|
@@ -74,7 +149,7 @@ the space with it (the e2e harness: `renderSpace(page, space, { debugMode: true
|
|
|
74
149
|
## Asking the page what it holds
|
|
75
150
|
|
|
76
151
|
`plitzi page check` lists every flow that failed while the page loaded; `--state` adds the state and every source by its
|
|
77
|
-
full name, `--element <id>` one element — what it reads, its own state, whether it is on screen. They come from the
|
|
152
|
+
full name, each key with what it holds, `--element <id>` one element — what it reads, its own state, whether it is on screen. They come from the
|
|
78
153
|
page's dev tools (debug mode, any development server). In a test, `readDevTools(page, { state: true })` from
|
|
79
154
|
`@plitzi/sdk-authoring` answers the same.
|
|
80
155
|
|
|
@@ -127,6 +202,8 @@ expect(await page.evaluate(() => (window as unknown as { __painted: string[] }).
|
|
|
127
202
|
|
|
128
203
|
- **Both sides of every condition.** An account that has done everything must not see "get started"; a new one must.
|
|
129
204
|
An empty list shows its empty state; a full one does not.
|
|
205
|
+
- **Hidden is not gone.** An element its `visible` hides stays in the page, its id kept, hidden by a class: assert
|
|
206
|
+
`toBeHidden()` / `:visible`, never a count of nodes — an open answer and a closed one are both in the DOM.
|
|
130
207
|
- **Navigation lands on the new page's content.** After `waitForURL`, wait for an element of the NEW page before typing:
|
|
131
208
|
for a frame the previous page is still mounted, and a form field with the same name there takes the keystrokes.
|
|
132
209
|
- **Console errors are failures.** Collect them and assert the list is empty.
|
|
@@ -19,6 +19,12 @@ apiContainer({ id: site.id, query: '/data/home.json', children: [
|
|
|
19
19
|
one).
|
|
20
20
|
- A list fed by a path hands its `row` the item typed: every field any item of the sample has — `p.item`, `p.index`,
|
|
21
21
|
and `p.inTemplate` as an untyped row has it, so turning a list typed changes none of its templates.
|
|
22
|
+
- **Only `items: <path>` types the row.** A list whose `items` are `from` + `as` (sorted, filtered — `as: '{{ source|sort(e
|
|
23
|
+
=> e.date)|reverse }}'`) or written out (`items: CATEGORIES`) hands an untyped row: its names are text, so a field is
|
|
24
|
+
`` `${r.item}.date` ``, never `r.item.date` (undefined — refused `source-name-missing`). Need a sorted list typed? Sort
|
|
25
|
+
the data file, or keep the row's fields as text.
|
|
26
|
+
- A helper of your own that takes a path takes a `SourceName` (`import type { SourceName } from '@plitzi/sdk-authoring'`):
|
|
27
|
+
a typed path or a name written by hand, both — `const dot = (colour: SourceName) => container({ bind: { … } })`.
|
|
22
28
|
- An item of a list is read by position: `site.data.sections[1]`.
|
|
23
29
|
- A provider fed by a server action publishes the action's output at its root: `actionSource('feed', sample)` types
|
|
24
30
|
it — `feed.stories`, and `feed.data` is a type error — with a sample of what the action's last step answers.
|
|
@@ -28,7 +28,7 @@ bar.
|
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
1. **Author once, print everything.** In a project `plitzi create` wrote, `npm run author`. Anywhere else, a file you run
|
|
31
|
-
with `node` (
|
|
31
|
+
with `node` (Node 24 strips the types) — outside the project's source, never committed:
|
|
32
32
|
|
|
33
33
|
```ts
|
|
34
34
|
import { authorSpace } from '@plitzi/sdk-authoring';
|