@uniweb/build 0.67.1 → 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.1",
3
+ "version": "0.68.0",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -57,10 +57,10 @@
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",
61
- "@uniweb/content-writer": "^0.3.4",
62
- "@uniweb/schemas": "^0.8.1",
60
+ "@uniweb/content-reader": "^1.2.6",
63
61
  "@uniweb/semantic-parser": "^1.4.1",
62
+ "@uniweb/schemas": "^0.8.2",
63
+ "@uniweb/content-writer": "^0.3.4",
64
64
  "@uniweb/projections": "^0.7.7",
65
65
  "@uniweb/theming": "^0.1.15"
66
66
  },
@@ -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.2",
78
- "@uniweb/runtime": "^0.27.10"
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
@@ -1012,6 +1010,17 @@ async function processMarkdownFile(filePath, id, siteRoot, defaultStableId = nul
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
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
1019
+ console.warn(
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
+ }
1015
1024
  // ⭐ `grid` — the layout of the section's child sections, `3` or `'40/60'` [Diego,
1016
1025
  // 2026-09-27] — is a name framework reserves, and it stays in the params like
1017
1026
  // `background`: that is where it is stored and synced, with no field of its own.
@@ -1049,8 +1058,6 @@ async function processMarkdownFile(filePath, id, siteRoot, defaultStableId = nul
1049
1058
  id,
1050
1059
  stableId,
1051
1060
  type: type || null,
1052
- preset,
1053
- input,
1054
1061
  params: { ...params, ...props },
1055
1062
  content: proseMirrorContent,
1056
1063
  fetch: parseFetchConfig(resolvedFetch, relative(siteRoot, filePath), { level: 'section' }),
@@ -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,8 +309,7 @@ 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)