@uniweb/build 1.23.2 → 1.23.3
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 +4 -4
- package/src/site/query-processor.js +21 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.3",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"yaml": "^2.5.0",
|
|
60
60
|
"@uniweb/projections": "~1.2.17",
|
|
61
61
|
"@uniweb/content-reader": "~1.5.10",
|
|
62
|
+
"@uniweb/schemas": "~1.7.4",
|
|
63
|
+
"@uniweb/theming": "~1.3.2",
|
|
62
64
|
"@uniweb/content-writer": "~1.3.2",
|
|
63
|
-
"@uniweb/semantic-parser": "~1.13.4"
|
|
64
|
-
"@uniweb/schemas": "~1.7.3",
|
|
65
|
-
"@uniweb/theming": "~1.3.2"
|
|
65
|
+
"@uniweb/semantic-parser": "~1.13.4"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
68
|
"@uniweb/runtime": "~1.6.3"
|
|
@@ -70,7 +70,7 @@ import { resolveRecordSchemas, resolveQueriesConfig, dataKeyTyping } from './que
|
|
|
70
70
|
import { keyOfDefaultRef } from '../uwx/data-key-types.js'
|
|
71
71
|
import { standardTypeFor } from './standard-type-for.js'
|
|
72
72
|
import { parseFrontmatter } from '../utils/frontmatter.js'
|
|
73
|
-
import { toDeliveredRecord, toStoredRecord, storedPath, briefFieldMap, contentBodyField, misplacedFields, undeclaredFields, mapReferences, recordLayout } from '@uniweb/schemas/conform'
|
|
73
|
+
import { toDeliveredRecord, toStoredRecord, storedPath, briefFieldMap, contentBodyField, misplacedFields, undeclaredFields, withoutUndeclared, mapReferences, recordLayout } from '@uniweb/schemas/conform'
|
|
74
74
|
import { ownsType, undeclaredAdvice, listOf } from './undeclared-fields.js'
|
|
75
75
|
import { siteSelfScope } from '../uwx/self-scope.js'
|
|
76
76
|
import { collectNestedRefs } from '@uniweb/schemas/format'
|
|
@@ -593,8 +593,14 @@ export const WHOLE_RECORD = Symbol.for('uniweb.query.whole')
|
|
|
593
593
|
*
|
|
594
594
|
* A record whose data schema this build cannot read (`resolveRecordSchemas`: a foundation that
|
|
595
595
|
* is not local, a schema registered under another scope) is delivered as its file holds it, a
|
|
596
|
-
* markdown body as `content
|
|
597
|
-
*
|
|
596
|
+
* markdown body as `content`. One whose schema the build can read and finds nothing for stops the
|
|
597
|
+
* build (`processQueries`).
|
|
598
|
+
*
|
|
599
|
+
* ⭐ ONE SHAPE ON BOTH LANES [Diego, 2026-11-11: "drop it, one shape on both lanes"]: what a
|
|
600
|
+
* record's schema has no place for is left out, as a host never holds it, since a push refuses it —
|
|
601
|
+
* a key no field declares (`withoutUndeclared`), and a markdown body with no field to hold it. The
|
|
602
|
+
* build says so (`noteUnsendable`). ⛔ Until 2026-11-11 both were delivered, the body as `content`,
|
|
603
|
+
* and a component reading one worked on a static site only. A markdown record
|
|
598
604
|
* also gets `excerpt` and `image` where it states none, derived from its body: the
|
|
599
605
|
* static lane's own, and not what a host adds.
|
|
600
606
|
*
|
|
@@ -632,14 +638,15 @@ function deliverRecord(file, config, where, body = null) {
|
|
|
632
638
|
const misplaced = misplacedFields(schema, record)
|
|
633
639
|
if (misplaced.length) throw new Error(flatFormRefusal(where, config.schema, schema, misplaced))
|
|
634
640
|
noteUnsendable(config, where, schema, record, body)
|
|
635
|
-
|
|
641
|
+
const declared = withoutUndeclared(schema, record)
|
|
642
|
+
out = { ...toDeliveredRecord(schema, declared) }
|
|
636
643
|
if (body) {
|
|
637
644
|
placeBody(out, schema, body)
|
|
638
645
|
out.excerpt = extractExcerpt(out, body.doc, config.excerpt)
|
|
639
646
|
out.image = out.image || extractFirstImage(body.doc)
|
|
640
647
|
}
|
|
641
648
|
if (config.references) out = config.references.deliver(schema, out, where)
|
|
642
|
-
out[WHOLE_RECORD] = storedRecord(
|
|
649
|
+
out[WHOLE_RECORD] = storedRecord(declared, schema, config, where, body, out)
|
|
643
650
|
}
|
|
644
651
|
if (handle !== undefined && handle !== null && handle !== '') {
|
|
645
652
|
out.$name = String(handle)
|
|
@@ -654,8 +661,8 @@ function deliverRecord(file, config, where, body = null) {
|
|
|
654
661
|
/**
|
|
655
662
|
* Keep, for the note a build ends with, what a record holds that a push cannot carry: a key its
|
|
656
663
|
* data schema has no place for (`@uniweb/schemas/conform`'s `undeclaredFields`), and a markdown body
|
|
657
|
-
* with no field to hold it. The record is
|
|
658
|
-
* stop: a static site is not held back by its schemas (`uniweb deploy` warns and ships), and
|
|
664
|
+
* with no field to hold it. The record is delivered without them, as a host delivers it
|
|
665
|
+
* (`deliverRecord`). ⭐ A note, never a stop: a static site is not held back by its schemas (`uniweb deploy` warns and ships), and
|
|
659
666
|
* `uniweb validate`, which the push and the publish run first, reports the same records. ⛔ Until
|
|
660
667
|
* 2026-11-11 nothing before the push said so.
|
|
661
668
|
*/
|
|
@@ -685,14 +692,15 @@ async function warnUnsendable(notes, siteDir) {
|
|
|
685
692
|
const paths = undeclared.map((u) => u.path)
|
|
686
693
|
const top = paths.every((p) => !/[.[]/.test(p))
|
|
687
694
|
parts.push(
|
|
688
|
-
`${listOf(paths.map((p) => `"${p}"`))} ${one ? 'is not a field' : 'are not fields'} of ${ref}, so
|
|
689
|
-
`
|
|
695
|
+
`${listOf(paths.map((p) => `"${p}"`))} ${one ? 'is not a field' : 'are not fields'} of ${ref}, so the site ` +
|
|
696
|
+
`leaves ${one ? 'it' : 'them'} out, as a host does, and a push refuses ${one ? 'it' : 'them'}. ` +
|
|
690
697
|
undeclaredAdvice({ type: ref, owned, declared: top ? undeclared[0].declared : [], count: undeclared.length })
|
|
691
698
|
)
|
|
692
699
|
}
|
|
693
700
|
if (strandedBody) {
|
|
694
701
|
parts.push(
|
|
695
|
-
`its markdown body has no field in ${ref} to hold it (a \`markdown\` or \`richtext\` field), so
|
|
702
|
+
`its markdown body has no field in ${ref} to hold it (a \`markdown\` or \`richtext\` field), so the site leaves it ` +
|
|
703
|
+
'out, as a host does, and a push refuses it.'
|
|
696
704
|
)
|
|
697
705
|
}
|
|
698
706
|
console.warn(`[records] ${where}: ${parts.join(' And ')}`)
|
|
@@ -742,15 +750,13 @@ function placeBodyInFile(file, schema, body) {
|
|
|
742
750
|
/**
|
|
743
751
|
* Put a markdown body where the delivered record carries its schema's content body
|
|
744
752
|
* field (`contentBodyField`) — unless the record already states that field, or the body
|
|
745
|
-
* is empty. With no such field the body
|
|
753
|
+
* is empty. With no such field the body is left out, as a host has no place for it either
|
|
754
|
+
* (`deliverRecord`); ⛔ until 2026-11-11 it was delivered as `content`, at the top.
|
|
746
755
|
*/
|
|
747
756
|
function placeBody(out, schema, body) {
|
|
748
757
|
const blank = !body.markdown || !body.markdown.trim()
|
|
749
758
|
const target = contentBodyField(schema)
|
|
750
|
-
if (!target)
|
|
751
|
-
if (!blank) out.content = body.doc
|
|
752
|
-
return
|
|
753
|
-
}
|
|
759
|
+
if (!target) return
|
|
754
760
|
if (blank) return
|
|
755
761
|
const value = target.field?.type === 'text' ? body.markdown : body.doc
|
|
756
762
|
if (!target.section) {
|