@uniweb/build 0.50.0 → 0.51.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 +6 -6
- package/src/runtime-schema.js +12 -0
- package/src/site/query-processor.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"sharp": "^0.35.3",
|
|
59
59
|
"yaml": "^2.5.0",
|
|
60
60
|
"@uniweb/content-reader": "^1.2.4",
|
|
61
|
+
"@uniweb/projections": "^0.7.2",
|
|
62
|
+
"@uniweb/content-writer": "^0.3.4",
|
|
61
63
|
"@uniweb/schemas": "^0.2.13",
|
|
62
|
-
"@uniweb/semantic-parser": "^1.4.0",
|
|
63
64
|
"@uniweb/theming": "^0.1.15",
|
|
64
|
-
"@uniweb/
|
|
65
|
-
"@uniweb/content-writer": "^0.3.4"
|
|
65
|
+
"@uniweb/semantic-parser": "^1.4.0"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"@uniweb/runtime": "^0.
|
|
68
|
+
"@uniweb/runtime": "^0.26.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@tailwindcss/vite": "^4.0.0",
|
|
75
75
|
"@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
|
|
76
76
|
"vite-plugin-svgr": "^4.0.0",
|
|
77
|
-
"@uniweb/core": "^0.29.
|
|
77
|
+
"@uniweb/core": "^0.29.1"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
80
|
"vite": {
|
package/src/runtime-schema.js
CHANGED
|
@@ -287,6 +287,18 @@ export function extractRuntimeSchema(fullMeta, dataSchemaMap = {}) {
|
|
|
287
287
|
// declares no key
|
|
288
288
|
} else if (fullMeta.data && typeof fullMeta.data === 'object' && !Array.isArray(fullMeta.data)) {
|
|
289
289
|
for (const [key, value] of Object.entries(fullMeta.data)) {
|
|
290
|
+
// ⛔ A value that is no schema at all declares a key by accident — it would reach the
|
|
291
|
+
// component as `null`, silently. `data: { inherit: [...] }`, the opt-in of April 2026,
|
|
292
|
+
// is the shape this refuses: it declared a key named `inherit`.
|
|
293
|
+
if (typeof value !== 'string' && value !== null && (typeof value !== 'object' || Array.isArray(value))) {
|
|
294
|
+
throw new Error(
|
|
295
|
+
`[uniweb] Invalid 'data.${key}' in meta.js: expected a named ref ('@/x'), an inline field map, ` +
|
|
296
|
+
`a rich-form { fields: [...] }, or {} for a key with no schema — got ${JSON.stringify(value)}.` +
|
|
297
|
+
(key === 'inherit'
|
|
298
|
+
? " `data: { inherit: [...] }` is retired: declare each key the component reads, e.g. `data: { members: {} }`."
|
|
299
|
+
: '')
|
|
300
|
+
)
|
|
301
|
+
}
|
|
290
302
|
runtime.data = runtime.data || {}
|
|
291
303
|
runtime.data[key] = dataRef(value)
|
|
292
304
|
const lean = leanDataSchema(value, dataSchemaMap)
|
|
@@ -152,7 +152,7 @@ function parseQueryConfig(name, config) {
|
|
|
152
152
|
// are emitted at public/data/<name>/<slug>.json. Components that
|
|
153
153
|
// need the full record fetch the per-record file on demand, either
|
|
154
154
|
// automatically on dynamic-route pages (entity-store routes the
|
|
155
|
-
// singular detail there) or via
|
|
155
|
+
// singular detail there) or via kit's useWholeRecord hook.
|
|
156
156
|
deferred: Array.isArray(config.deferred) ? config.deferred.slice() : null,
|
|
157
157
|
// `queryable:` declares the queryable surface — which fields a
|
|
158
158
|
// foundation can offer for filtering UI, with their type and
|
|
@@ -894,7 +894,7 @@ export async function writeQueryFiles(siteDir, byQuery, queriesConfig = null) {
|
|
|
894
894
|
// 1. The cascade JSON at /data/<name>.json with deferred fields stripped.
|
|
895
895
|
// This is what `query: <name>` declarations deliver everywhere.
|
|
896
896
|
// 2. Per-record full files at /data/<name>/<slug>.json with every field.
|
|
897
|
-
// Dynamic-route singular fetches and
|
|
897
|
+
// Dynamic-route singular fetches and kit's useWholeRecord read these.
|
|
898
898
|
const recordsDir = join(dataDir, name)
|
|
899
899
|
await mkdir(recordsDir, { recursive: true })
|
|
900
900
|
|