@uniweb/build 0.67.0 → 0.68.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/build",
3
- "version": "0.67.0",
3
+ "version": "0.68.0",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -57,15 +57,15 @@
57
57
  "js-yaml": "^4.1.0",
58
58
  "sharp": "^0.35.3",
59
59
  "yaml": "^2.5.0",
60
- "@uniweb/content-reader": "^1.2.5",
60
+ "@uniweb/content-reader": "^1.2.6",
61
61
  "@uniweb/semantic-parser": "^1.4.1",
62
- "@uniweb/projections": "^0.7.7",
62
+ "@uniweb/schemas": "^0.8.2",
63
63
  "@uniweb/content-writer": "^0.3.4",
64
- "@uniweb/theming": "^0.1.15",
65
- "@uniweb/schemas": "^0.8.1"
64
+ "@uniweb/projections": "^0.7.7",
65
+ "@uniweb/theming": "^0.1.15"
66
66
  },
67
67
  "optionalDependencies": {
68
- "@uniweb/runtime": "^0.27.9"
68
+ "@uniweb/runtime": "^0.27.10"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -74,8 +74,8 @@
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.32.1",
78
- "@uniweb/runtime": "^0.27.9"
77
+ "@uniweb/runtime": "^0.27.10",
78
+ "@uniweb/core": "^0.32.2"
79
79
  },
80
80
  "peerDependenciesMeta": {
81
81
  "vite": {
package/src/schema.js CHANGED
@@ -17,6 +17,7 @@ import { isFontVar } from '@uniweb/theming'
17
17
  import { join, dirname, extname, basename } from 'node:path'
18
18
  import { pathToFileURL } from 'node:url'
19
19
  import { describeChildren, describeVisuals } from '@uniweb/schemas/component'
20
+ import { SECTION_PARAMS } from '@uniweb/schemas/section'
20
21
  import { collectSchemaRefs, buildDataSchemaMap, ownSchemaRefs } from './resolve-data-schema.js'
21
22
  import {
22
23
  composeSupports,
@@ -957,13 +958,17 @@ export function reportPlacementDeclarations(components) {
957
958
  `provides renders "Component not found".`
958
959
  )
959
960
  }
960
- // `grid` is a section key framework reserves for the layout of a section's children,
961
- // so a param by that name never receives what an author writes as `grid:`.
962
- if (entry.params && typeof entry.params === 'object' && Object.hasOwn(entry.params, 'grid')) {
961
+ // A name framework reserves in a section's params whose value the component never
962
+ // receives — `component: false` in `@uniweb/schemas/section`, as `grid` is.
963
+ const params = entry.params && typeof entry.params === 'object' ? entry.params : {}
964
+ for (const [param, reserved] of Object.entries(SECTION_PARAMS)) {
965
+ if (reserved.component || !Object.hasOwn(params, param)) continue
963
966
  console.warn(
964
- `Warning: ${name} (meta.js): a param named "grid" never receives the author's grid: — it is a section ` +
965
- `key reserved for the layout of child sections. Offer layouts with children: { grid: [...] } and ` +
966
- `lay the children out with kit's ChildGrid, or rename the param.`
967
+ `Warning: ${name} (meta.js): a param named "${param}" never receives the author's ${param}: — framework ` +
968
+ `reserves it in a section's params (@uniweb/schemas/section). Rename the param.` +
969
+ (param === 'grid'
970
+ ? ` To offer layouts for the child sections, declare children: { grid: [...] } and lay them out with kit's ChildGrid.`
971
+ : '')
967
972
  )
968
973
  }
969
974
  }
@@ -10,8 +10,6 @@
10
10
  *
11
11
  * Section frontmatter reserved properties:
12
12
  * - type: Component type (e.g., "Hero", "Features")
13
- * - preset: Preset configuration name
14
- * - input: Input field mapping
15
13
  * - props: Additional component props (merged with other params)
16
14
  * - fetch: The section's binding — names a query (query, as, where, sort, limit, current,
17
15
  * prerender, detailPage); `query:` is its shorthand
@@ -1011,14 +1009,27 @@ async function processMarkdownFile(filePath, id, siteRoot, defaultStableId = nul
1011
1009
 
1012
1010
  // `query`, `fetch` and `data` are never params: `query:` / `fetch:` declare the
1013
1011
  // section's own data, and a leftover `data:` is refused (`declaredFetch`).
1014
- // ⭐ Nor is `grid`: a section key framework reserves for the layout of the section's
1015
- // child sections — `3` or `'40/60'` [Diego, 2026-09-27] — laid out by kit's
1016
- // `ChildGrid` from `block.grid`. A component offers layouts in `meta.js`
1017
- // `children.grid`; it never receives the choice as a param.
1018
- const { type, preset, input, props, fetch, query, data, grid, id: frontmatterId, ...params } = frontMatter
1019
- if (grid !== undefined && !parseGrid(grid)) {
1012
+ const { type, preset, input, props, fetch, query, data, id: frontmatterId, ...params } = frontMatter
1013
+ // ⛔ `preset:` and `input:` do nothing, so they are dropped with a warning rather than
1014
+ // handed to the component as params. Nothing ever read either [2026-09-27]: a preset is
1015
+ // a named set of params a section type's `meta.js` offers an editor, and a file writes
1016
+ // the params themselves (`uniweb add section <Type> --starter --preset <name>` writes them).
1017
+ for (const [key, value] of [['preset', preset], ['input', input]]) {
1018
+ if (value === undefined) continue
1020
1019
  console.warn(
1021
- `[content-collector] ${relative(siteRoot, filePath)}: grid: ${JSON.stringify(grid)} is not a layout — ` +
1020
+ `[content-collector] ${relative(siteRoot, filePath)}: ${key}: ${JSON.stringify(value)} has no effect and is ignored` +
1021
+ (key === 'preset' ? ' — write the preset’s params in the frontmatter instead.' : '.')
1022
+ )
1023
+ }
1024
+ // ⭐ `grid` — the layout of the section's child sections, `3` or `'40/60'` [Diego,
1025
+ // 2026-09-27] — is a name framework reserves, and it stays in the params like
1026
+ // `background`: that is where it is stored and synced, with no field of its own.
1027
+ // `@uniweb/core` lifts it to `block.grid` (a component never receives it as a param)
1028
+ // and kit's `ChildGrid` lays the children out. ⛔ For a few hours on 2026-09-27 it was
1029
+ // taken out of the params into a field the sync wire could not carry.
1030
+ if (params.grid !== undefined && !parseGrid(params.grid)) {
1031
+ console.warn(
1032
+ `[content-collector] ${relative(siteRoot, filePath)}: grid: ${JSON.stringify(params.grid)} is not a layout — ` +
1022
1033
  `write a column count (grid: 3) or relative widths (grid: '40/60'). The component's own layout applies.`
1023
1034
  )
1024
1035
  }
@@ -1047,12 +1058,9 @@ async function processMarkdownFile(filePath, id, siteRoot, defaultStableId = nul
1047
1058
  id,
1048
1059
  stableId,
1049
1060
  type: type || null,
1050
- preset,
1051
- input,
1052
1061
  params: { ...params, ...props },
1053
1062
  content: proseMirrorContent,
1054
1063
  fetch: parseFetchConfig(resolvedFetch, relative(siteRoot, filePath), { level: 'section' }),
1055
- ...(grid !== undefined ? { grid } : {}),
1056
1064
  subsections: []
1057
1065
  }
1058
1066
 
@@ -425,7 +425,7 @@ function reinlineInsets(content, insets) {
425
425
  * Project one section `$`-record (from `page_sections` / `layout_sections`) to a
426
426
  * section `.md` file — the inverse of site.js `mapSectionData`. Frontmatter is
427
427
  * `type` + the flat `params` + `background` / `theme` (`theme_override`) /
428
- * `preset` / `input` / `fetch` / `id` (`stable_id`); the body is the section's
428
+ * `fetch` / `id` (`stable_id`); the body is the section's
429
429
  * content (insets re-inlined) serialized to markdown. Idempotent.
430
430
  *
431
431
  * Note: `$children` (a section's child sections) are NOT written here — the page
@@ -442,7 +442,9 @@ function reinlineInsets(content, insets) {
442
442
  * @returns {'updated'|'unchanged'}
443
443
  */
444
444
  export function sectionRecordToFile({ filePath, record, sourceLocale = LOCALIZED_FIELD_ASSUMPTION.defaultSourceLocale, collector, freeformRelPath, freeformCandidates = null, writeId = true, context = null }) {
445
- const { type, stable_id, preset, input, params, content, insets, fetch, background, theme_override } = record || {}
445
+ // ⛔ A stored `preset` or `input` is not written back: neither has an effect, and the build
446
+ // would only warn about it (2026-09-27).
447
+ const { type, stable_id, params, content, insets, fetch, background, theme_override } = record || {}
446
448
 
447
449
  // A localized `content` field unwraps to the source-locale doc for the body; its
448
450
  // target-locale structural maps are captured into the locales/ collector, and any
@@ -455,8 +457,6 @@ export function sectionRecordToFile({ filePath, record, sourceLocale = LOCALIZED
455
457
  if (params && typeof params === 'object') Object.assign(frontmatter, params)
456
458
  if (background !== undefined) frontmatter.background = background
457
459
  if (theme_override !== undefined) frontmatter.theme = theme_override
458
- if (preset !== undefined) frontmatter.preset = preset
459
- if (input !== undefined) frontmatter.input = input
460
460
  // Invert the build's resolution rather than copy it — see fetch-shapes.js. A new
461
461
  // file gets `query:` for a declaration of names alone; a section that declares
462
462
  // its data locally keeps it (`writeSectionFile`, the declaration keys).
package/src/uwx/site.js CHANGED
@@ -142,8 +142,8 @@ function stripCredentials(block, label) {
142
142
  }
143
143
 
144
144
  // page_sections and layout_sections share this content shape.
145
- // processMarkdownFile only destructures type/component/preset/input/props/
146
- // fetch/data/id out of frontmatter, so `background:` and `theme:` stay
145
+ // processMarkdownFile takes only type/props/fetch/query/data/id out of the
146
+ // frontmatter (and drops preset/input), so `background:` and `theme:` stay
147
147
  // inside section.params — lift them into the entity type's dedicated fields.
148
148
  // The `type` a push sends for a section whose file names none — the Model requires one. A pull does
149
149
  // not write it back into a file that names none (`sectionRecordToFile`): absent, the foundation's
@@ -309,23 +309,12 @@ function mapSectionData(section) {
309
309
 
310
310
  const data = { type: section.type || FILLED_SECTION_TYPE } // entity type requires `type`
311
311
  setIf(data, 'stable_id', section.stableId ?? undefined)
312
- setIf(data, 'preset', section.preset ?? undefined)
313
- setIf(data, 'input', section.input ?? undefined)
312
+ // No `preset` or `input`: nothing read either, and the collector drops them (2026-09-27).
314
313
  if (Object.keys(params).length > 0) data.params = params
315
314
  data.content = section.content // leaf insets in it as written — no `insets` field since 2026-09-27
316
315
  setIf(data, 'fetch', section.fetch ?? undefined)
317
316
  setIf(data, 'background', background)
318
317
  setIf(data, 'theme_override', themeOverride)
319
- // ⛔ `grid` — the section's layout for its children — is NOT SENT YET: it is a new
320
- // field, and the store refuses a whole push carrying a key it has not declared
321
- // (kb/framework/build/uwx-format.md § A page section's fields). It goes on the wire
322
- // once backend declares it; until then a static build renders it and the file keeps it.
323
- if (section.grid !== undefined) {
324
- console.warn(
325
- `[uwx] section ${section.stableId ?? section.id}: grid: ${JSON.stringify(section.grid)} is not sent — ` +
326
- `the backend does not store a section's grid yet. It renders on a static build; the file keeps it.`
327
- )
328
- }
329
318
  return data
330
319
  }
331
320