@uniweb/build 1.10.6 → 1.10.7
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 +7 -7
- package/src/uwx/backfill.js +9 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.7",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
"sharp": "^0.35.5",
|
|
58
58
|
"yaml": "^2.5.0",
|
|
59
59
|
"@uniweb/content-reader": "~1.5.7",
|
|
60
|
-
"@uniweb/schemas": "~1.6.5",
|
|
61
60
|
"@uniweb/semantic-parser": "~1.13.0",
|
|
61
|
+
"@uniweb/schemas": "~1.6.5",
|
|
62
62
|
"@uniweb/theming": "~1.2.1",
|
|
63
|
-
"@uniweb/
|
|
64
|
-
"@uniweb/
|
|
63
|
+
"@uniweb/content-writer": "~1.3.1",
|
|
64
|
+
"@uniweb/projections": "~1.2.3"
|
|
65
65
|
},
|
|
66
66
|
"optionalDependencies": {
|
|
67
|
-
"@uniweb/runtime": "~1.2.
|
|
67
|
+
"@uniweb/runtime": "~1.2.5"
|
|
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.4.
|
|
77
|
-
"@uniweb/runtime": "~1.2.
|
|
76
|
+
"@uniweb/core": "~1.4.9",
|
|
77
|
+
"@uniweb/runtime": "~1.2.5"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
80
|
"vite": {
|
package/src/uwx/backfill.js
CHANGED
|
@@ -225,11 +225,16 @@ export function backfillBibFile(filePath, uuidBySlug) {
|
|
|
225
225
|
|
|
226
226
|
// Unwrap a localized wire value `{ <locale>: v }` back to the authored bare value
|
|
227
227
|
// (the source locale, else the first present). Non-localized values pass through.
|
|
228
|
+
// ⛔ One with no locale at all, `{}`, is no value: undefined, and the field is not written.
|
|
229
|
+
// Until 2026-10-26 it passed through as the empty map, so a record's emptied caption was
|
|
230
|
+
// written `caption: {}` — an object where its schema says string, which `uniweb validate`
|
|
231
|
+
// refuses, and a publish stopped on fifteen of them.
|
|
228
232
|
export function unwrapLocalized(value, sourceLocale) {
|
|
229
233
|
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
230
234
|
if (Object.prototype.hasOwnProperty.call(value, sourceLocale)) return value[sourceLocale]
|
|
231
235
|
const keys = Object.keys(value)
|
|
232
236
|
if (keys.length) return value[keys[0]]
|
|
237
|
+
return undefined
|
|
233
238
|
}
|
|
234
239
|
return value
|
|
235
240
|
}
|
|
@@ -238,7 +243,8 @@ export function unwrapLocalized(value, sourceLocale) {
|
|
|
238
243
|
// field element-wise. An array unwraps each element; a bare localized map unwraps to
|
|
239
244
|
// one value. The container shape is preserved (mirrors how the producer built it).
|
|
240
245
|
export function unwrapLocalizedList(value, sourceLocale) {
|
|
241
|
-
|
|
246
|
+
// An element with no locale at all is no element (`unwrapLocalized`).
|
|
247
|
+
if (Array.isArray(value)) return value.map((v) => unwrapLocalized(v, sourceLocale)).filter((v) => v !== undefined)
|
|
242
248
|
return unwrapLocalized(value, sourceLocale)
|
|
243
249
|
}
|
|
244
250
|
|
|
@@ -347,7 +353,8 @@ function decodeRecord(fields, value, dec, sectionName) {
|
|
|
347
353
|
const isBody = Boolean(dec.bodyAt) && sectionName === dec.bodyAt.section && key === dec.bodyAt.key
|
|
348
354
|
const decoded = decodeLeaf(raw, field, dec, isBody)
|
|
349
355
|
if (isBody) dec.body = typeof decoded === 'string' ? decoded : String(decoded ?? '')
|
|
350
|
-
|
|
356
|
+
// A translatable value with no text in any language is no value: the field is not written.
|
|
357
|
+
else if (decoded !== undefined) out[key] = decoded
|
|
351
358
|
}
|
|
352
359
|
return out
|
|
353
360
|
}
|