@uniweb/build 0.28.2 → 0.29.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 +5 -5
- package/src/uwx/collections.js +28 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
"js-yaml": "^4.1.0",
|
|
60
60
|
"sharp": "^0.35.3",
|
|
61
61
|
"yaml": "^2.5.0",
|
|
62
|
+
"@uniweb/content-reader": "^1.2.4",
|
|
63
|
+
"@uniweb/semantic-parser": "^1.3.1",
|
|
62
64
|
"@uniweb/projections": "^0.5.1",
|
|
63
|
-
"@uniweb/theming": "^0.1.15",
|
|
64
65
|
"@uniweb/content-writer": "^0.3.4",
|
|
65
|
-
"@uniweb/
|
|
66
|
-
"@uniweb/
|
|
67
|
-
"@uniweb/schemas": "^0.2.11"
|
|
66
|
+
"@uniweb/schemas": "^0.2.11",
|
|
67
|
+
"@uniweb/theming": "^0.1.15"
|
|
68
68
|
},
|
|
69
69
|
"optionalDependencies": {
|
|
70
70
|
"@uniweb/runtime": "^0.13.1"
|
package/src/uwx/collections.js
CHANGED
|
@@ -81,12 +81,36 @@ const SKIP_KEYS = new Set([
|
|
|
81
81
|
function stripSigils(value) {
|
|
82
82
|
if (Array.isArray(value)) return value.map(stripSigils)
|
|
83
83
|
if (value && typeof value === 'object') {
|
|
84
|
+
// ⛔ A `@uniweb/folder` REF LEAF ENCODES ONE REFERENCE TWO WAYS, and hashing the
|
|
85
|
+
// encoding rather than the reference made the folder's hash unreproducible.
|
|
86
|
+
//
|
|
87
|
+
// `refLeaf` (uwx/folder.js) emits `$ref: "<collection>/<slug>"` while the record
|
|
88
|
+
// is brand-new and `entry: { model, entity: <uuid> }` once it has been minted.
|
|
89
|
+
// Both denote the same record. A push hashes the folder BEFORE submitting, then
|
|
90
|
+
// back-fills the minted `$uuid` into every record's source file — so the very
|
|
91
|
+
// next emit builds the OTHER encoding, and the hash the push just banked can
|
|
92
|
+
// never be recomputed. Measured on the matinee manor 2026-08-29: `uniweb status`
|
|
93
|
+
// reported the folder changed immediately after a successful push, permanently.
|
|
94
|
+
// Stripping the back-filled uuids from the sources reproduced the banked hash
|
|
95
|
+
// exactly, which is what identified the encoding as the variable.
|
|
96
|
+
//
|
|
97
|
+
// ⭐ Neither encoding is content. What the folder SAYS is "this branch contains
|
|
98
|
+
// this record, here, in this order" — and that is already hashed: a leaf carries
|
|
99
|
+
// `path_segment` (the record's slug) inside a branch carrying the collection's.
|
|
100
|
+
// A `folders:` branch's entries are COLLECTION names, so every leaf under one
|
|
101
|
+
// comes from a single collection, where a slug is unique. Position plus segment
|
|
102
|
+
// therefore identify the record on their own; `$ref` adds a payload-local handle
|
|
103
|
+
// and `entry` adds identity, and both are exactly what `$uuid` is stripped for.
|
|
104
|
+
//
|
|
105
|
+
// ⚖️ The previous rule kept `$ref` "so a reference change is visible". It still
|
|
106
|
+
// is: point a leaf at a different record and its `path_segment` moves with it.
|
|
107
|
+
const isFolderRefLeaf = value.kind === 'ref'
|
|
84
108
|
const out = {}
|
|
85
109
|
for (const [k, v] of Object.entries(value)) {
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
if (k === '$children'
|
|
110
|
+
if (isFolderRefLeaf && (k === '$ref' || k === 'entry')) continue
|
|
111
|
+
// `$children` (a self-nesting subtree) is structural CONTENT, not an identity
|
|
112
|
+
// sigil — kept and recursed into, so a nesting change stays visible.
|
|
113
|
+
if (k === '$children') {
|
|
90
114
|
out[k] = stripSigils(v)
|
|
91
115
|
continue
|
|
92
116
|
}
|