@plitzi/sdk-server 0.38.23 → 0.39.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 +172 -1
- package/README.md +55 -9
- package/dist/actions.d.ts +4 -1
- package/dist/actions.js +3 -2
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +5 -4
- package/dist/core/auth/api/accounts.d.ts +11 -0
- package/dist/core/auth/api/accounts.js +175 -0
- package/dist/core/auth/api/admin.d.ts +41 -0
- package/dist/core/auth/api/admin.js +146 -0
- package/dist/core/auth/api/context.d.ts +119 -0
- package/dist/core/auth/api/context.js +262 -0
- package/dist/core/auth/api/factors.d.ts +31 -0
- package/dist/core/auth/api/factors.js +209 -0
- package/dist/core/auth/api/index.d.ts +94 -0
- package/dist/core/auth/api/index.js +43 -0
- package/dist/core/auth/api/profile.d.ts +43 -0
- package/dist/core/auth/api/profile.js +243 -0
- package/dist/core/auth/api/session.d.ts +62 -0
- package/dist/core/auth/api/session.js +312 -0
- package/dist/core/auth/{api.d.ts → api/types.d.ts} +41 -195
- package/dist/core/auth/api/values.d.ts +67 -0
- package/dist/core/auth/api/values.js +90 -0
- package/dist/core/auth/createAuth.d.ts +49 -39
- package/dist/core/auth/createAuth.js +21 -1
- package/dist/core/auth/oauth/client.d.ts +2 -2
- package/dist/core/auth/oauth/client.js +6 -1
- package/dist/core/auth/oauth/index.d.ts +30 -7
- package/dist/core/auth/oauth/index.js +33 -14
- package/dist/core/auth/oauth/providers/github.js +1 -1
- package/dist/core/auth/oauth/providers/google.js +1 -1
- package/dist/core/auth/oauth/providers/oidc.d.ts +40 -0
- package/dist/core/auth/oauth/providers/oidc.js +197 -0
- package/dist/core/auth/oauth/state.d.ts +2 -0
- package/dist/core/auth/oauth/state.js +2 -0
- package/dist/core/auth/oauth/types.d.ts +21 -3
- package/dist/core/auth/oauth/types.js +4 -1
- package/dist/core/auth/routes.js +1 -1
- package/dist/core/auth/tokens.d.ts +3 -1
- package/dist/core/auth/tokens.js +2 -1
- package/dist/core/configSeam.d.ts +0 -4
- package/dist/core/configSeam.js +12 -1
- package/dist/core/createServer.js +16 -4
- package/dist/core/freePort.d.ts +10 -0
- package/dist/core/freePort.js +39 -1
- package/dist/core/handlers/socialRouteHandlers.d.ts +9 -1
- package/dist/core/handlers/socialRouteHandlers.js +46 -12
- package/dist/core/health.d.ts +1 -0
- package/dist/core/health.js +2 -1
- package/dist/core/http/stages/authRoutes.d.ts +6 -0
- package/dist/core/http/stages/authRoutes.js +42 -1
- package/dist/core/http/stages/images.js +5 -3
- package/dist/core/http/stages/livePages.js +1 -1
- package/dist/core/server/fleet/relay.js +9 -1
- package/dist/core/server/fleet/stores.d.ts +7 -0
- package/dist/core/server/fleet/stores.js +15 -2
- package/dist/core/server/pageServer.js +5 -1
- package/dist/core/services/realtime.js +4 -2
- package/dist/core/services/registry.js +7 -1
- package/dist/core/services/robotsTxt.d.ts +16 -0
- package/dist/core/services/robotsTxt.js +50 -0
- package/dist/core/services/servedSpace.d.ts +8 -0
- package/dist/core/services/servedSpace.js +16 -0
- package/dist/core/services/sitemapXml.d.ts +7 -0
- package/dist/core/services/sitemapXml.js +37 -0
- package/dist/functions-api.d.ts +75 -2
- package/dist/helpers/fileStore.d.ts +60 -0
- package/dist/helpers/fileStore.js +127 -0
- package/dist/helpers/outboundGuard.d.ts +32 -3
- package/dist/helpers/outboundGuard.js +50 -5
- package/dist/hosts/project/agentRuns.d.ts +24 -0
- package/dist/hosts/project/agentRuns.js +107 -0
- package/dist/hosts/project/laterAsks.d.ts +41 -0
- package/dist/hosts/project/laterAsks.js +117 -0
- package/dist/hosts/project/plugins.js +11 -4
- package/dist/hosts/project/serveProject.d.ts +11 -3
- package/dist/hosts/project/serveProject.js +94 -36
- package/dist/hosts/project/spaceFailure.d.ts +4 -0
- package/dist/hosts/project/spaceFailure.js +10 -0
- package/dist/hosts/project/watchSpace.d.ts +5 -5
- package/dist/hosts/project/watchSpace.js +15 -6
- package/dist/index.js +2 -2
- package/dist/kernel.js +1 -1
- package/dist/modules/actions/connectorWrite.js +3 -1
- package/dist/modules/actions/index.js +1 -1
- package/dist/modules/actions/jobs/fileQueue.d.ts +34 -0
- package/dist/modules/actions/jobs/fileQueue.js +72 -0
- package/dist/modules/actions/jobs/index.js +3 -3
- package/dist/modules/actions/jobs/memoryQueue.js +6 -215
- package/dist/modules/actions/jobs/queueDocument.d.ts +14 -0
- package/dist/modules/actions/jobs/queueDocument.js +22 -0
- package/dist/modules/actions/jobs/queueRules.d.ts +39 -0
- package/dist/modules/actions/jobs/queueRules.js +270 -0
- package/dist/modules/actions/moduleFor.js +2 -0
- package/dist/modules/actions/runtime/fileKv.d.ts +3 -1
- package/dist/modules/actions/runtime/fileKv.js +12 -98
- package/dist/modules/actions/runtime/guards.d.ts +19 -1
- package/dist/modules/actions/runtime/guards.js +10 -1
- package/dist/modules/actions/runtime/kvChange.d.ts +40 -0
- package/dist/modules/actions/runtime/kvChange.js +23 -1
- package/dist/modules/actions/runtime/kvList.d.ts +4 -0
- package/dist/modules/actions/runtime/kvList.js +5 -1
- package/dist/modules/actions/runtime/kvStore.js +15 -1
- package/dist/modules/actions/runtime/namespaceKv.js +2 -0
- package/dist/modules/actions/runtime/renderResolver.js +31 -5
- package/dist/modules/actions/runtime/runAction.js +16 -6
- package/dist/modules/actions/runtime/scope.js +11 -0
- package/dist/modules/actions/runtime/taskContext.js +11 -32
- package/dist/modules/actions/tasks/auth.js +2 -0
- package/dist/modules/actions/tasks/connector.js +6 -2
- package/dist/modules/actions/tasks/flow.js +5 -0
- package/dist/modules/actions/tasks/http.js +2 -1
- package/dist/modules/actions/tasks/kv.js +5 -0
- package/dist/modules/actions/tasks/list.js +11 -2
- package/dist/modules/actions/tasks/transform.js +2 -0
- package/dist/modules/actions/transport/callHandler.js +25 -4
- package/dist/modules/actions/types.d.ts +46 -1
- package/dist/modules/connectors/engine.d.ts +7 -2
- package/dist/modules/connectors/engine.js +4 -4
- package/dist/modules/connectors/resolver.d.ts +2 -1
- package/dist/modules/connectors/resolver.js +3 -2
- package/dist/modules/functions/build.d.ts +7 -2
- package/dist/modules/functions/build.js +90 -6
- package/dist/modules/functions/capabilities.js +21 -0
- package/dist/modules/functions/context.js +6 -2
- package/dist/modules/functions/contract.d.ts +45 -1
- package/dist/modules/functions/driver.d.ts +2 -1
- package/dist/modules/functions/driver.js +39 -0
- package/dist/modules/functions/load.d.ts +1 -1
- package/dist/modules/functions/load.js +2 -2
- package/dist/modules/functions/manifest.js +7 -1
- package/dist/modules/functions/oauth.d.ts +3 -1
- package/dist/modules/functions/oauth.js +20 -7
- package/dist/modules/functions/protocol.d.ts +9 -0
- package/dist/modules/functions/sandbox/guest/bytes.d.ts +27 -0
- package/dist/modules/functions/sandbox/guest/bytes.js +108 -0
- package/dist/modules/functions/sandbox/guest/crypto.d.ts +47 -0
- package/dist/modules/functions/sandbox/guest/crypto.js +144 -0
- package/dist/modules/functions/sandbox/guest/events.d.ts +152 -0
- package/dist/modules/functions/sandbox/guest/events.js +143 -0
- package/dist/modules/functions/sandbox/guest/fetch.d.ts +305 -0
- package/dist/modules/functions/sandbox/guest/fetch.js +237 -0
- package/dist/modules/functions/sandbox/guest/index.d.ts +28 -0
- package/dist/modules/functions/sandbox/guest/index.js +130 -0
- package/dist/modules/functions/sandbox/{guest.d.ts → guest/types.d.ts} +5 -12
- package/dist/modules/functions/sandbox/isolate.js +20 -6
- package/dist/modules/functions/space.js +2 -8
- package/dist/modules/images/imageProxy.d.ts +3 -2
- package/dist/modules/images/imageProxy.js +2 -2
- package/dist/modules/mongo/jobQueue.js +0 -19
- package/dist/modules/mysql/accounts.js +12 -5
- package/dist/modules/mysql/jobs/index.d.ts +1 -1
- package/dist/modules/mysql/jobs/schema.d.ts +0 -6
- package/dist/modules/mysql/jobs/schema.js +2 -46
- package/dist/modules/mysql/schema.js +26 -1
- package/dist/modules/mysql/sessions.js +2 -1
- package/dist/modules/realtime/handlers.d.ts +9 -4
- package/dist/modules/realtime/handlers.js +20 -3
- package/dist/modules/realtime/hub.d.ts +4 -2
- package/dist/modules/realtime/hub.js +36 -4
- package/dist/modules/realtime/index.d.ts +14 -0
- package/dist/modules/realtime/index.js +14 -1
- package/dist/modules/realtime/presence.d.ts +33 -0
- package/dist/modules/realtime/presence.js +56 -0
- package/dist/modules/realtime/socket.d.ts +3 -1
- package/dist/modules/realtime/socket.js +2 -2
- package/dist/modules/rsc/connectorRscData.d.ts +6 -1
- package/dist/modules/rsc/connectorRscData.js +27 -6
- package/dist/modules/rsc/externalQueryReader.d.ts +28 -0
- package/dist/modules/rsc/externalQueryReader.js +43 -0
- package/dist/modules/rsc/handler.js +1 -1
- package/dist/modules/rsc/resolveRscData.d.ts +11 -1
- package/dist/modules/rsc/resolveRscData.js +86 -16
- package/dist/modules/runtime/inside.js +1 -1
- package/dist/modules/runtime/runner.js +2 -1
- package/dist/modules/sqlite/jobQueue.d.ts +35 -0
- package/dist/modules/sqlite/jobQueue.js +56 -0
- package/dist/modules/sqlite/kv.d.ts +1 -1
- package/dist/modules/sqlite/kv.js +2 -10
- package/dist/modules/sqlite/open.d.ts +3 -0
- package/dist/modules/sqlite/open.js +13 -0
- package/dist/modules/ssr/Component.d.ts +5 -1
- package/dist/modules/ssr/Component.js +3 -1
- package/dist/modules/ssr/applySSRResult.d.ts +8 -1
- package/dist/modules/ssr/applySSRResult.js +23 -3
- package/dist/modules/ssr/handler.js +30 -5
- package/dist/modules/ssr/prepareRender.js +27 -5
- package/dist/modules/ssr/preview.d.ts +2 -0
- package/dist/modules/ssr/preview.js +6 -3
- package/dist/modules/ssr/registerExternalPlugins.d.ts +2 -6
- package/dist/modules/ssr/registerExternalPlugins.js +2 -2
- package/dist/modules/ssr/resolvePageSeo.d.ts +11 -0
- package/dist/modules/ssr/resolvePageSeo.js +13 -2
- package/dist/modules/ssr/streamBody.js +2 -2
- package/dist/modules/ssr/views/template.ejs +21 -17
- package/dist/mysql.d.ts +1 -1
- package/dist/mysql.js +2 -2
- package/dist/plugins/manager.d.ts +5 -0
- package/dist/plugins/manager.js +9 -0
- package/dist/sqlite.d.ts +8 -1
- package/dist/sqlite.js +3 -1
- package/package.json +5 -5
- 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 +7 -2
- package/skills/plitzi-authoring/reference/auth.md +15 -4
- package/skills/plitzi-authoring/reference/authoring-errors.md +51 -10
- 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 +20 -8
- package/skills/plitzi-authoring/reference/kept-state.md +8 -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 +13 -2
- 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
- package/dist/core/auth/api.js +0 -1323
- package/dist/modules/functions/sandbox/guest.js +0 -662
|
@@ -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
|
|
@@ -169,6 +173,9 @@ the component: the flow is visible in the space, and a button can do the same.
|
|
|
169
173
|
|
|
170
174
|
- An action's param declared `number` or `boolean` arrives as one, written or bound; any other arrives as written.
|
|
171
175
|
- To act when another element appears, `useElementVisible('tools')` (`@plitzi/plitzi-sdk`) — never watch classes.
|
|
176
|
+
- What a visitor changes of its own view — a map's camera, the item it flew to — kept in its element state too,
|
|
177
|
+
`useElement().setElementState({ focus })`: `page play` and `page check --element` read it, where a canvas looks the
|
|
178
|
+
same to them before and after.
|
|
172
179
|
- A name for screen readers is a prop of its own: declare `label`, write it as the root's `aria-label`.
|
|
173
180
|
|
|
174
181
|
## Behaving in the builder
|
|
@@ -187,13 +194,17 @@ belongs to the editor.
|
|
|
187
194
|
|
|
188
195
|
## The plugin's stylesheet and the space's CSS
|
|
189
196
|
|
|
190
|
-
A plugin's stylesheet ships in a layer below the space's (`plitzi-sdk-plugin
|
|
191
|
-
|
|
197
|
+
A plugin's stylesheet ships in a layer below the space's (`plitzi-sdk-plugin`): the space's classes and `customCss`
|
|
198
|
+
win over it whatever their specificity. Write it as
|
|
199
|
+
`.css` files the plugin imports (in the server's head, its tokens seen) — never a CSS string in TypeScript.
|
|
192
200
|
|
|
193
201
|
A file a library needs whole is imported as Vite imports it, and travels inside the bundle: `worker.js?raw` is its
|
|
194
202
|
text (a worker, started from `URL.createObjectURL(new Blob([source]))`), `engine.wasm?inline` a data URI. Images and
|
|
195
203
|
fonts a stylesheet names are carried the same way.
|
|
196
204
|
|
|
205
|
+
**A plugin's link** reloads the page unless a plain click goes through the SDK: `useStore('navigation.navigate')`,
|
|
206
|
+
then `event.preventDefault(); navigate(href)` — the `href` kept for new tabs.
|
|
207
|
+
|
|
197
208
|
## Components that draw into DOM they do not render
|
|
198
209
|
|
|
199
210
|
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
|
+
A journey is held by an e2e test; an element check holds what one element makes of a state. `plitzi test --unit` runs
|
|
42
|
+
no browser.
|
|
43
|
+
|
|
44
|
+
- **Read with the space.** A test the space no longer answers — a page renamed, an element removed, a relation that is
|
|
45
|
+
none — is the warning `test-unreadable` of `lintSpace` and `author`, wherever the space was changed: a `plitzi space
|
|
46
|
+
lint`, an MCP batch ("This change leaves a test of the space unreadable…"), the builder. Fix the test, or the space.
|
|
47
|
+
- **A journey may start on a wrong address** its space answers with its own not-found page (`slug: '*'`), to test it.
|
|
48
|
+
- **Both kinds at once.** `e2e.expectCheck('<element check id>')` holds an element check where the journey has got to —
|
|
49
|
+
its element resolved for the page's state then, not the check's own `given.state`: write a rule once as a check, hold
|
|
50
|
+
it at each point a flow reaches. `given: { state: { … } }` starts a journey with a state, as the page opens: a case
|
|
51
|
+
reached without the steps to it. Both use the page's state bridge, which every runner has.
|
|
52
|
+
- **Tags**: `tags: ['sign-in']`, lower case, each once; `plitzi test --tag sign-in` runs only those.
|
|
53
|
+
- **Signed in: `as` a test account.** `tests.accounts: [e2e.account({ id: 'member', roles: ['author'] })]` and
|
|
54
|
+
`e2e.test({ …, as: 'member' })`: the page shows that visitor signed in (its details; what its roles — the space's
|
|
55
|
+
`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
|
|
56
|
+
guest: a journey with an account reads and moves, never writes.
|
|
57
|
+
- **A `type` step names the element** — a form control's id — and replaces what the field inside it held; a select is
|
|
58
|
+
chosen from (its option's value or label), a date, a time or a range set whole.
|
|
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';
|