@uniweb/build 0.34.0 → 0.35.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 +7 -7
- package/src/site/data-fetcher.js +31 -9
- package/src/uwx/site.js +8 -1
- package/src/validate-data.js +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
"js-yaml": "^4.1.0",
|
|
60
60
|
"sharp": "^0.35.3",
|
|
61
61
|
"yaml": "^2.5.0",
|
|
62
|
-
"@uniweb/
|
|
63
|
-
"@uniweb/content-reader": "^1.2.4",
|
|
62
|
+
"@uniweb/projections": "^0.5.6",
|
|
64
63
|
"@uniweb/theming": "^0.1.15",
|
|
65
64
|
"@uniweb/semantic-parser": "^1.4.0",
|
|
66
|
-
"@uniweb/
|
|
67
|
-
"@uniweb/content-
|
|
65
|
+
"@uniweb/content-writer": "^0.3.4",
|
|
66
|
+
"@uniweb/content-reader": "^1.2.4",
|
|
67
|
+
"@uniweb/schemas": "^0.2.13"
|
|
68
68
|
},
|
|
69
69
|
"optionalDependencies": {
|
|
70
|
-
"@uniweb/runtime": "^0.13.
|
|
70
|
+
"@uniweb/runtime": "^0.13.7"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@tailwindcss/vite": "^4.0.0",
|
|
77
77
|
"@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
|
|
78
78
|
"vite-plugin-svgr": "^4.0.0",
|
|
79
|
-
"@uniweb/core": "^0.
|
|
79
|
+
"@uniweb/core": "^0.18.0"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
82
82
|
"vite": {
|
package/src/site/data-fetcher.js
CHANGED
|
@@ -253,11 +253,11 @@ export function applyPostProcessing(data, config) {
|
|
|
253
253
|
const RECOGNIZED_FETCH_KEYS = {
|
|
254
254
|
refine: new Set(['refine', 'inherit', 'detail', 'limit', 'sort', 'where', 'filter']),
|
|
255
255
|
query: new Set([
|
|
256
|
-
'query', 'schema', 'prerender', 'merge', 'transform',
|
|
256
|
+
'query', 'as', 'schema', 'prerender', 'merge', 'transform',
|
|
257
257
|
'where', 'limit', 'sort', 'detailPage', 'filter',
|
|
258
258
|
]),
|
|
259
259
|
source: new Set([
|
|
260
|
-
'path', 'url', 'schema', 'prerender', 'merge', 'transform', 'detail',
|
|
260
|
+
'path', 'url', 'as', 'schema', 'prerender', 'merge', 'transform', 'detail',
|
|
261
261
|
'detailPage', 'where', 'limit', 'sort', 'filter',
|
|
262
262
|
]),
|
|
263
263
|
}
|
|
@@ -288,11 +288,13 @@ export function parseFetchConfig(fetch) {
|
|
|
288
288
|
|
|
289
289
|
// Simple string: "/data/team.json"
|
|
290
290
|
if (typeof fetch === 'string') {
|
|
291
|
-
const
|
|
291
|
+
const inferred = inferSchemaFromPath(fetch)
|
|
292
292
|
return {
|
|
293
293
|
path: fetch,
|
|
294
294
|
url: undefined,
|
|
295
|
-
|
|
295
|
+
// Both spellings — see the note in the named-query branch below.
|
|
296
|
+
as: inferred,
|
|
297
|
+
schema: inferred,
|
|
296
298
|
prerender: true,
|
|
297
299
|
merge: false,
|
|
298
300
|
transform: undefined,
|
|
@@ -368,10 +370,27 @@ export function parseFetchConfig(fetch) {
|
|
|
368
370
|
query: fetch.query,
|
|
369
371
|
path: queryDataUrl(fetch.query),
|
|
370
372
|
url: undefined,
|
|
371
|
-
// The BINDING KEY — the `content.data.<key>` a
|
|
372
|
-
//
|
|
373
|
-
//
|
|
374
|
-
|
|
373
|
+
// ⭐ **`as`, not `schema`.** The BINDING KEY — the `content.data.<key>` a
|
|
374
|
+
// component reads — defaults to the query name. It was called `schema`
|
|
375
|
+
// until 2026-09-02, which collided with the MODEL REF of the same name on a
|
|
376
|
+
// `queries` declaration; `fetch.schema` is still accepted as input so
|
|
377
|
+
// existing content keeps working, and is never emitted.
|
|
378
|
+
// ⛔ **BOTH SPELLINGS ARE EMITTED, and this is not the overload coming back.**
|
|
379
|
+
// `bindingKey()` reads `as ?? schema`, so NEW core needs only `as`. But a
|
|
380
|
+
// published site renders at ITS OWN pinned runtime version, and every
|
|
381
|
+
// runtime shipped to date bundles a core whose resolver does
|
|
382
|
+
// `if (!cfg?.schema) continue` — so an `as`-only payload served by an older
|
|
383
|
+
// runtime is SKIPPED ENTIRELY. No data, nothing thrown, nothing logged.
|
|
384
|
+
//
|
|
385
|
+
// ⭐ The compatibility runs the OTHER WAY from `bindingKey`'s: that one is
|
|
386
|
+
// old payloads meeting new code, this one is new payloads meeting old code,
|
|
387
|
+
// and only the first was covered. Caught by frontend before it shipped.
|
|
388
|
+
//
|
|
389
|
+
// ⇒ Emit both until every serving runtime carries `bindingKey`, then drop
|
|
390
|
+
// `schema` here. Until then a reader may see this as redundant; it is a
|
|
391
|
+
// compatibility duplicate and the comment is what tells them apart.
|
|
392
|
+
as: fetch.as || fetch.schema || fetch.query,
|
|
393
|
+
schema: fetch.as || fetch.schema || fetch.query,
|
|
375
394
|
prerender: fetch.prerender ?? true,
|
|
376
395
|
merge: fetch.merge ?? false,
|
|
377
396
|
transform: fetch.transform,
|
|
@@ -391,6 +410,7 @@ export function parseFetchConfig(fetch) {
|
|
|
391
410
|
const {
|
|
392
411
|
path,
|
|
393
412
|
url,
|
|
413
|
+
as,
|
|
394
414
|
schema,
|
|
395
415
|
prerender = url ? false : true,
|
|
396
416
|
merge = false,
|
|
@@ -413,7 +433,9 @@ export function parseFetchConfig(fetch) {
|
|
|
413
433
|
return {
|
|
414
434
|
path,
|
|
415
435
|
url,
|
|
416
|
-
|
|
436
|
+
// Both spellings — see the note in the named-query branch above.
|
|
437
|
+
as: as ?? schema ?? inferSchemaFromPath(path || url),
|
|
438
|
+
schema: as ?? schema ?? inferSchemaFromPath(path || url),
|
|
417
439
|
prerender,
|
|
418
440
|
merge,
|
|
419
441
|
transform,
|
package/src/uwx/site.js
CHANGED
|
@@ -263,7 +263,14 @@ function buildPageData(config, ctx) {
|
|
|
263
263
|
// validating — so `fetch` is a blob they carry and framework owns its
|
|
264
264
|
// vocabulary. ⇒ There was nothing to coordinate, and inventing a coordination
|
|
265
265
|
// is how a name stays wrong.
|
|
266
|
-
|
|
266
|
+
// ⛔ `as`, the BINDING KEY — not to be confused with `schema` at
|
|
267
|
+
// DECL_EMITTED_ABOVE / `setIf(data,'schema',d.schema)` below, which is a
|
|
268
|
+
// queries decl's MODEL REF and keeps its name. One word meant both until
|
|
269
|
+
// 2026-09-02; this is the half that moved.
|
|
270
|
+
// Both spellings, deliberately — an `as`-only payload is skipped entirely by
|
|
271
|
+
// any runtime older than `bindingKey` (`if (!cfg?.schema) continue`), with no
|
|
272
|
+
// data and no error. Drop `schema` when every serving runtime carries it.
|
|
273
|
+
fetch = { query, path: queryDataUrl(query), as: query, schema: query, ...rest }
|
|
267
274
|
}
|
|
268
275
|
setIf(data, 'fetch', fetch)
|
|
269
276
|
if (isDynamic) {
|
package/src/validate-data.js
CHANGED
|
@@ -104,7 +104,7 @@ export async function validateDataInputs({ siteRoot, foundationPath }) {
|
|
|
104
104
|
if (!type) return
|
|
105
105
|
const bindings = foundation[type]?.data
|
|
106
106
|
for (const input of collectInputs(section, page.fetch, config.fetch)) {
|
|
107
|
-
const key = input.schema // the content.data KEY
|
|
107
|
+
const key = input.as ?? input.schema // the content.data KEY; `schema` is its pre-2026-09-02 name
|
|
108
108
|
|
|
109
109
|
if (input.url) {
|
|
110
110
|
deferred.push({ route: page.route, section: type, key, reason: 'remote url: source', url: input.url })
|
|
@@ -437,8 +437,14 @@ async function loadStandardSchemas() {
|
|
|
437
437
|
function collectInputs(section, pageFetch, siteFetch) {
|
|
438
438
|
const byKey = new Map()
|
|
439
439
|
for (const f of [siteFetch, pageFetch, section.fetch]) {
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
// ⛔ The binding key is `as`; `schema` is its pre-2026-09-02 name and still
|
|
441
|
+
// arrives on stored payloads. A gate on the old name alone silently yields
|
|
442
|
+
// NOTHING here — no inputs collected, no violations found, a green run — which
|
|
443
|
+
// is exactly how this was caught: the integration test went from flagging the
|
|
444
|
+
// seeded violations to flagging none.
|
|
445
|
+
const key = f?.as ?? f?.schema
|
|
446
|
+
if (f && (f.path || f.url) && typeof key === 'string') {
|
|
447
|
+
byKey.set(key, f)
|
|
442
448
|
}
|
|
443
449
|
}
|
|
444
450
|
return [...byKey.values()]
|