@niscorp/moss 0.2.4 → 0.3.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 +33 -0
- package/DESIGN.md +8 -8
- package/DOCS.md +15 -13
- package/README.md +5 -5
- package/dist/{chunk-D6E4SV6F.js → chunk-3CJCJKKY.js} +4 -3
- package/dist/chunk-3CJCJKKY.js.map +1 -0
- package/dist/{chunk-CDNJ2CBA.js → chunk-DPFWL7BS.js} +3 -3
- package/dist/{chunk-CDNJ2CBA.js.map → chunk-DPFWL7BS.js.map} +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/node.cjs +2 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/terminal/index.cjs +5 -5
- package/dist/terminal/index.cjs.map +1 -1
- package/dist/terminal/index.js +6 -6
- package/dist/terminal/index.js.map +1 -1
- package/dist/vite.cjs +2 -1
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.js +2 -2
- package/package.json +9 -9
- package/dist/chunk-D6E4SV6F.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @niscorp/moss
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f1cec45: A Prism config that validates no longer names an op Prism does not have. `validate` accepted `{ card: { $fetch: … } }` and `{ $eval: "…" }`: the plain-object branch refused only the names of ops that exist, so any other `$` key passed as a template key. Such a config could be stored — an endpoint request, a vex mapping, a strata migration — and then failed every time it was evaluated (`E_NODE_SHAPE`, "Unsupported node shape").
|
|
8
|
+
|
|
9
|
+
A key that starts with `$` is now an op's name and nothing else. The template branch refuses every `$` key — the rule the evaluator already held — so `validate` reports it with the key and where it is (`card.$fetch: Not a Prism op. A key that starts with "$" names an op; data with such a key goes in $const.`), and `evaluate` and `compile` fail with `E_SCHEMA` before anything runs. An op's name used as a template key keeps its own message. `E_NODE_SHAPE` is left for a tree that never went through the schema: an IR handed to `execute`. Adding an op no longer takes a key away from templates.
|
|
10
|
+
- **prism** — the change, and a grammar narrowing: `nisc.prism` 2, a marker with no document step (a key that never evaluated has nothing to be rewritten to). `$` keys that are data are untouched: a `$const` payload, `$with` names, `$renameKeys` and `$fromEntries` keys. The JSON Schema's template key pattern is `^(?!\$)` instead of a list of every op.
|
|
11
|
+
- **nova, vex, moss, loom, cli, nisc** — no change of their own. They depend on prism and are released with it, so the set installs together; the configs they hand to prism (endpoint `request` and `response`, `$prism` bindings, vex mappings) are held to the same rule.
|
|
12
|
+
- **create-nisc** — the templates' sources are recorded at `nisc.prism` 2.
|
|
13
|
+
|
|
14
|
+
**What to change:** in a config with a `$`-prefixed key that is not a Prism op, remove the key — or put the object in `$const` if it is literal data. An app that keeps a `strata.lock.json` runs `pnpm strata upgrade`, then `pnpm strata verify`; there is nothing to edit unless it has such a config. Everything else: nothing.
|
|
15
|
+
|
|
16
|
+
BREAKING — approved by moccadroid, 2026-10-04: a config with a `$`-prefixed key that is not a Prism op no longer validates, compiles or evaluates — also where evaluation never reached the key (an untaken `$case` branch, a short-circuited `$or`, a `$map` body over an empty array), which used to work. A vex seed mapping with one fails when it is seeded, at boot, instead of on each replay. Code that matched `E_NODE_SHAPE` from `evaluate` gets `E_SCHEMA`. The `@niscorp` packages that depend on prism move with it, so an app moves them together (`@niscorp/nisc` 0.3.0).
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- de6d980: A fix for the last fix: `nova:head` is the document's `<head>`, and holds what a head holds. 0.1.4 gave it five props (`title`, `description`, `image`, `kind`, `structured`) and wrote tags from them, which closed a head to whatever nova had been taught: no `og:image:alt`, no `og:type` but two, no whole address inside structured data. That was wrong, and it is replaced, not extended. The maintainer withdrew 0.1.4's props on 2026-10-04; this ships as a patch on that decision.
|
|
21
|
+
|
|
22
|
+
**What to change** (only an app that used 0.1.4's props): a `nova:head` node no longer takes props. Write its children instead — `nova:title`, `nova:meta`, `nova:link`, `nova:script` — each with the element's attributes as its props. `{ title: X }` becomes `{ component: 'nova:title', children: X }`; `description` becomes `nova:meta` with `name: 'description'`; `image` and `kind` become `nova:meta` with `property: 'og:image'` and `property: 'og:type'`; `structured` becomes `nova:script` with `type: 'application/ld+json'` and `data`. `og:title` and `og:description` are no longer written from the title and description: say them if they are wanted. An address is written as given — a picture's is not made whole from `site`. Code that called `headOf`, `placeHead` or `createTitleKeeper`, or read `head` off `renderDocument`'s result or a route report, takes the new shapes below.
|
|
23
|
+
- **nova** — a head's children are the elements a head holds, named as HTML names them, and **a child's props are that element's attributes, written as given**: nova keeps no list of them, so any `name`, `property` or `rel` can be said. Nothing in a head is drawn on the screen and no name has to be registered. With more than one head on a screen they are read in the order the screen is drawn, and an element that says the same thing as an earlier one (the title, a `<meta>` of that name or property, the canonical address) takes its place; anything else stands beside its like. What runs or styles is refused, left out and named: a script a browser would execute (`nova:script` is a data block — a JSON `type`, never a `src`), a stylesheet, `http-equiv`, a handler attribute. `headOf(api)` returns `{ elements, actions, refused }`. In `@niscorp/nova/document`, `placeHead(html, elements, { site, path })` writes them — an element takes the place of the tag that said the same thing, where it stood; what it wrote is marked `data-nova-head`, and a tag that gave way is kept inert in a `<template data-nova-own>` — and `createHeadKeeper(document)` replaces `createTitleKeeper`: the whole head follows the screen in the page, and the document's own tags come back when the screen stops saying them. Removed: the five props, the `Head` and `HeadProps` types, `createTitleKeeper`.
|
|
24
|
+
- **cli** — `build`, `export` and `start` write each path's head from those elements. A head that holds what it may not fails the path, like any other check. `site` still gives every path its own canonical address and `og:url`; it no longer touches a picture's address.
|
|
25
|
+
- **moss** — `renderDocument` and `exportDocuments` do the same from the snapshot (`head` on the result is `{ elements, actions, refused }`; a refusal is logged and left out), and the terminal keeps the whole head off the wire.
|
|
26
|
+
- **create-nisc** — the two own-shell templates write their welcome screen's head this way.
|
|
27
|
+
|
|
28
|
+
**Where a script goes:** in the app's own `index.html`, which holds anything and from which every page is written, or in the kit component that needs it. A layout is data and does not carry one.
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [de6d980]
|
|
31
|
+
- Updated dependencies [f1cec45]
|
|
32
|
+
- @niscorp/nova@0.2.0
|
|
33
|
+
- @niscorp/prism@0.2.0
|
|
34
|
+
- @niscorp/vex@0.2.0
|
|
35
|
+
|
|
3
36
|
## 0.2.4
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/DESIGN.md
CHANGED
|
@@ -362,14 +362,14 @@ drawing a signed-in screen to a string is 0.4–0.7 ms; a whole anonymous docume
|
|
|
362
362
|
page carries its screen twice (markup and snapshot), 3–5 KB compressed.
|
|
363
363
|
|
|
364
364
|
**The head of the page is part of the screen.** A title, a description and a
|
|
365
|
-
preview card are facts about what the screen shows, so
|
|
366
|
-
layout (nova's `nova:head
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
365
|
+
preview card are facts about what the screen shows, so the page's `<head>` is a
|
|
366
|
+
node in a layout (nova's `nova:head`, holding the elements a head holds) and
|
|
367
|
+
rides in the same trees as everything else: `renderDocument` reads the
|
|
368
|
+
elements off the snapshot and writes them into the template's `<head>`, and the
|
|
369
|
+
terminal reads them off the wire to keep the page's head. Nothing was added to
|
|
370
|
+
the snapshot, the wire or the manifest for it. Where the page lives is known to
|
|
371
|
+
the writer without being told: the `site` plus the path the document was drawn
|
|
372
|
+
at.
|
|
373
373
|
|
|
374
374
|
Six things had to be true, and each is a small, separate decision:
|
|
375
375
|
|
package/DOCS.md
CHANGED
|
@@ -470,19 +470,21 @@ const page = await renderDocument({
|
|
|
470
470
|
- **`htmlAttributes`** is for what a kit would otherwise set on `<html>` from an
|
|
471
471
|
effect, which never runs on a server: a palette, a colour scheme. Read it off
|
|
472
472
|
the same node the effect reads it from. Values are escaped.
|
|
473
|
-
- **The page's head is its screen's own.**
|
|
474
|
-
|
|
475
|
-
`
|
|
476
|
-
snapshot's trees like everything else on the screen,
|
|
477
|
-
and written into the template's `<head>`:
|
|
478
|
-
the tag that said the same thing,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
473
|
+
- **The page's `<head>` is its screen's own.** It is a node in a layout —
|
|
474
|
+
nova's `nova:head`, whose children (`nova:title`, `nova:meta`, `nova:link`,
|
|
475
|
+
`nova:script`) are the elements a head holds, their props the elements'
|
|
476
|
+
attributes. It is in the snapshot's trees like everything else on the screen,
|
|
477
|
+
so the elements are read off them and written into the template's `<head>`:
|
|
478
|
+
one takes the place of the tag that said the same thing, anything else is
|
|
479
|
+
added, and the rest of the head is left as the template has it. `head` in the
|
|
480
|
+
result is what was read (`{ elements, actions, refused }`); absent, the
|
|
481
|
+
screen has no head and the page went out with the template's. What a head may
|
|
482
|
+
not hold — something that runs, or styles — is left out and logged. In the
|
|
483
|
+
browser the terminal keeps the page's head on the same node as the screen
|
|
484
|
+
moves, and the template's own tags come back when it stops saying them.
|
|
485
|
+
- **`site`** is the address the site is served at. With it, every path's
|
|
486
|
+
document says its own canonical address (`<link rel="canonical">`, `og:url`).
|
|
487
|
+
Without it the template's is left as it is.
|
|
486
488
|
- **`template`** must hold the empty root (`root`, default
|
|
487
489
|
`<div id="root"></div>`). The screen goes inside it, the snapshot element
|
|
488
490
|
straight after.
|
package/README.md
CHANGED
|
@@ -85,11 +85,11 @@ Who may keep the page follows from who asked: drawn for nobody it is the same
|
|
|
85
85
|
for everybody; drawn for somebody it is `private, no-store`. A page that cannot
|
|
86
86
|
be drawn goes out undrawn.
|
|
87
87
|
|
|
88
|
-
The page's `<head>` is
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
The page's `<head>` is a node in a layout too — nova's `nova:head`, holding
|
|
89
|
+
the elements a head holds, bound to the action's data. It is read off the
|
|
90
|
+
snapshot and written into the template, and the terminal keeps the page's head
|
|
91
|
+
on it as the screen moves. With `site`, every path says its own canonical
|
|
92
|
+
address.
|
|
93
93
|
|
|
94
94
|
`pages` are the other thing a path can lead to: a shell manifest drawn for
|
|
95
95
|
whoever asks and then let go — a welcome, the docs. A page with nothing left to
|
|
@@ -3270,7 +3270,8 @@ var renderDocument = async (config) => {
|
|
|
3270
3270
|
const attributes = Object.entries(config.htmlAttributes?.(snapshot) ?? {}).map(([name, value]) => ` ${name}="${escapeAttribute(value)}"`).join("");
|
|
3271
3271
|
const placed = template.replace(root, () => `${root.replace("></div>", () => `>${screen}</div>`)}${embedSnapshot(snapshot, principal, request.path)}`).replace(/<html([^>]*)>/, (whole, existing) => attributes === "" ? whole : `<html${existing}${attributes}>`);
|
|
3272
3272
|
const head = headOf({ frame: () => snapshot.frame, canvasTree: (id) => snapshot.trees[id] ?? [] });
|
|
3273
|
-
const
|
|
3273
|
+
for (const why of head?.refused ?? []) console.error(`[moss/document] "${request.path}" \u2014 ${why}`);
|
|
3274
|
+
const html = placeHead(placed, head?.elements, { ...config.site !== void 0 ? { site: config.site } : {}, path: request.path });
|
|
3274
3275
|
return {
|
|
3275
3276
|
html,
|
|
3276
3277
|
...head !== void 0 ? { head } : {},
|
|
@@ -3313,5 +3314,5 @@ var exportDocuments = async (config) => {
|
|
|
3313
3314
|
};
|
|
3314
3315
|
|
|
3315
3316
|
export { DEFAULT_GENERATION_POLL_MS, DEFAULT_IDENTITY_IDLE_MS, DEFAULT_IDENTITY_MAX, DEFAULT_IDLE_MS, GENERATION_DDL, MOSS_SEQUENCE, SESSIONS_SEQUENCE, SNAPSHOT_ELEMENT_ID, TIDE_DDL, TIDE_SEQUENCE, TIDE_TABLES, auditClosure, buildContract, callIntegrationWith, contractAsMarkdown, copyPress, createAssertionSigner, createDataLayer, createGeneration, createIdentityCache, createPageRouter, createServer, createShellHost, createTideStore, describePlacements, devSession, documentHeaders, embedSnapshot, exportDocuments, filterInstalled, hashIntegrationKey, initIntegrations, initSessions, integrationByKey, integrationOfAction, listAttachments, listIntegrations, listPlacements, loadIntegrationActions, memoKeyOf, mintDevToken, mintIntegrationKey, mintSession, mintWrites, renderDocument, resolveCatalog, resolveCatalogForRoles, resolvePolicy, resolvePolicyAtReach, resolvePolicyForRoles, resolveRoles, resolveVariants, resolveVariantsForRoles, revokeAllFor, revokeSession, runIntake, sessionOf, sessionVerifierOf, shellNeedOf, tokenFromCookie, verifyAssertion, verifyVariants, wearableOf, wireFabric };
|
|
3316
|
-
//# sourceMappingURL=chunk-
|
|
3317
|
-
//# sourceMappingURL=chunk-
|
|
3317
|
+
//# sourceMappingURL=chunk-3CJCJKKY.js.map
|
|
3318
|
+
//# sourceMappingURL=chunk-3CJCJKKY.js.map
|