@uniweb/build 1.3.11 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/build",
3
- "version": "1.3.11",
3
+ "version": "1.4.0",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,15 +56,15 @@
56
56
  "js-yaml": "^4.1.0",
57
57
  "sharp": "^0.35.3",
58
58
  "yaml": "^2.5.0",
59
- "@uniweb/semantic-parser": "~1.9.0",
60
- "@uniweb/projections": "~1.1.2",
61
59
  "@uniweb/theming": "~1.2.0",
62
- "@uniweb/content-reader": "~1.4.1",
63
- "@uniweb/content-writer": "~1.2.0",
64
- "@uniweb/schemas": "~1.4.0"
60
+ "@uniweb/content-reader": "~1.5.0",
61
+ "@uniweb/semantic-parser": "~1.11.0",
62
+ "@uniweb/content-writer": "~1.3.0",
63
+ "@uniweb/schemas": "~1.5.0",
64
+ "@uniweb/projections": "~1.1.3"
65
65
  },
66
66
  "optionalDependencies": {
67
- "@uniweb/runtime": "~1.1.5"
67
+ "@uniweb/runtime": "~1.1.7"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -73,8 +73,8 @@
73
73
  "@tailwindcss/vite": "^4.0.0",
74
74
  "@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
75
75
  "vite-plugin-svgr": "^4.0.0",
76
- "@uniweb/core": "~1.2.3",
77
- "@uniweb/runtime": "~1.1.5"
76
+ "@uniweb/core": "~1.2.5",
77
+ "@uniweb/runtime": "~1.1.7"
78
78
  },
79
79
  "peerDependenciesMeta": {
80
80
  "vite": {
@@ -592,7 +592,7 @@ export const WHOLE_RECORD = Symbol.for('uniweb.query.whole')
592
592
  * ⭐ THE SHAPE A HOST'S RECORDS SERVICE ANSWERS — measured 2026-09-24 on a local
593
593
  * backend: the brief's fields at the top and every other section under its own name
594
594
  * (`@uniweb/schemas/conform`'s `toDeliveredRecord`), with a markdown body in the
595
- * schema's content body field — the ProseMirror document for a `format: prosemirror`
595
+ * schema's content body field — the ProseMirror document for a `format: richtext`
596
596
  * field (`body.content`, for `@std/article`), the markdown source for a markup
597
597
  * `text` one. A component is written against one shape, so both lanes deliver the same
598
598
  * one — ruled 2026-09-24 [Diego] as a requirement that the shape be one AND a good one,
@@ -85,21 +85,22 @@ export function isMarkupTextField(field) {
85
85
  }
86
86
 
87
87
  /**
88
- * A `json` field constrained to ProseMirror content (`format: prosemirror`):
88
+ * A `json` field holding rich text (`format: richtext`, a ProseMirror document):
89
89
  * authored as markdown on the file side, carried as a ProseMirror document on the
90
90
  * sync wire (the common language with the visual app). The single predicate the
91
91
  * sync producer/projector use to decide md⇄ProseMirror conversion + structural-map
92
92
  * localization. See framework/CLAUDE.md gotcha #21 and uwx-format.md.
93
93
  */
94
94
  export function isProseMirrorField(field) {
95
- return field?.type === 'json' && field?.format === 'prosemirror'
95
+ return field?.type === 'json' && field?.format === 'richtext'
96
96
  }
97
97
 
98
98
  /**
99
99
  * A content BODY field — the markdown-body target of a `.md` record: a markup
100
- * `text` field (raw source string on the wire) or a `format: prosemirror` json
101
- * field (a ProseMirror doc on the wire). Replaces the old `richtext`-or-prosemirror
102
- * test now that `richtext` is retired (2026-06-02).
100
+ * `text` field (raw source string on the wire) or a `format: richtext` json
101
+ * field (a ProseMirror doc on the wire). Replaced the old `richtext`-kind-or-format
102
+ * test when `richtext` stopped being a kind (2026-06-02); it is the format's name
103
+ * since 2026-10-18.
103
104
  */
104
105
  export function isContentBodyField(field) {
105
106
  return isMarkupTextField(field) || isProseMirrorField(field)
@@ -427,7 +428,7 @@ function lowerLeaf(field, resolve, optResolve, { multiple = false, path = '' } =
427
428
  const leafType = field.type
428
429
 
429
430
  // `richtext` is NOT a kind — it is the author alias for a ProseMirror document
430
- // (`json` + `format: prosemirror`), normalized upstream in resolve-data-schema.js,
431
+ // (`json` + `format: richtext`), normalized upstream in resolve-data-schema.js,
431
432
  // so normalized IR never carries a raw `richtext` kind. The only way one reaches
432
433
  // here is a STALE prebuilt schema.json (a foundation built before the 2026-06-02
433
434
  // kind retirement and loaded from dist/meta/schema.json without re-resolving).
@@ -438,7 +439,7 @@ function lowerLeaf(field, resolve, optResolve, { multiple = false, path = '' } =
438
439
  if (leafType === 'richtext') {
439
440
  throw new Error(
440
441
  'This foundation carries the retired `richtext` kind in its built schema — ' +
441
- 'rebuild it (`richtext` is now json + format: prosemirror).'
442
+ 'rebuild it (`type: richtext` is now json + format: richtext).'
442
443
  )
443
444
  }
444
445
  const leafFormat = field.format
@@ -489,8 +490,8 @@ function lowerLeaf(field, resolve, optResolve, { multiple = false, path = '' } =
489
490
  return out
490
491
  }
491
492
 
492
- // A CONTENT field — a markup `text` (format markdown|html) or a `format:
493
- // prosemirror` json — is rich CONTENT (authored as markdown; carried as a raw
493
+ // A CONTENT field — a markup `text` (format markdown) or a `format:
494
+ // richtext` json — is rich CONTENT (authored as markdown; carried as a raw
494
495
  // source string or a ProseMirror doc on sync). Localizable like a text kind, NOT
495
496
  // a machine-ish value-validator format-string (email/url).
496
497
  const isContent = isContentBodyField({ type: leafType, format: leafFormat })
@@ -502,10 +503,10 @@ function lowerLeaf(field, resolve, optResolve, { multiple = false, path = '' } =
502
503
 
503
504
  // Field-narrowing attributes ride on the field. The backend treats them by kind:
504
505
  // `enum` and a value-validator string `format` (email/url) it relocates to the
505
- // owning section's constraint records at ingest; a content format (`markdown`/
506
- // `html` on text, `prosemirror` on json) it carries as a durable type marker
507
- // surfaced in schema reads (NOT a validator, NOT relocated — it tells the app to
508
- // render a rich-text editor).
506
+ // owning section's constraint records at ingest; a content format (`markdown` on
507
+ // text, `richtext` on json) it carries as a durable type marker surfaced in schema
508
+ // reads (NOT relocated — it tells the app to render a rich-text editor, and a
509
+ // `richtext` value is held to the rich-text vocabulary).
509
510
  if (Array.isArray(field.enum)) out.enum = field.enum
510
511
  if (leafFormat) out.format = leafFormat
511
512
 
@@ -17,7 +17,7 @@
17
17
  // A collection `.md` is NOT a page-section `.md`: its frontmatter is structured
18
18
  // DATA whose schema is the collection type's data schema (the `model:` Model), and
19
19
  // its body is the value of the Model's content body field (a markup `text` field,
20
- // or a `format: prosemirror` json field) — not foundation/runtime config. See
20
+ // or a `format: richtext` json field) — not foundation/runtime config. See
21
21
  // docs/reference/entity-content.md §"Markdown (frontmatter + body)".
22
22
 
23
23
  import { readFile } from 'node:fs/promises'
@@ -38,7 +38,7 @@ export function recordFileLayout(declaration) {
38
38
 
39
39
  /**
40
40
  * The schema's CONTENT body field — the one a `.md` record's markdown body fills: a
41
- * markup `text` field (`format: markdown|html`) or a `format: prosemirror` json field,
41
+ * markup `text` field (`format: markdown`) or a `format: richtext` json field,
42
42
  * declared directly on a top-level single section — the brief or another, like
43
43
  * `@std/article`'s `body.content`. The first in declared order.
44
44
  *
@@ -269,7 +269,7 @@ export function recordsToEntities({
269
269
  if (bodyFields > 1) {
270
270
  warnings.push(
271
271
  `${label}: ${declaration.name} has more than one content ` +
272
- `(markdown / html / prosemirror) field — the markdown body maps to ` +
272
+ `(markdown / richtext) field — the markdown body maps to ` +
273
273
  `"${bodyTarget.section}.${bodyTarget.key}"`
274
274
  )
275
275
  }
@@ -660,7 +660,7 @@ function missingIn(def, record, path, missing) {
660
660
  // Post-pass: override a collection record's localized CONTENT body with a per-locale
661
661
  // FREE-FORM body when `locales/freeform/{locale}/records/<schema>/<slug>.md` exists
662
662
  // — the override wins over the structural map, exactly like site-content sections
663
- // (site.js localizeContentTree). Only a `format: prosemirror` localized field can
663
+ // (site.js localizeContentTree). Only a `format: richtext` localized field can
664
664
  // take it (it is a PM doc on the wire; a markup `text` body stays a raw string).
665
665
  // Mutates the entity documents in place. Async — the free-form read hits the disk.
666
666
  async function applyFreeformRecordOverrides({