@homepages/concrete 6.2.0 → 8.0.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.
Files changed (87) hide show
  1. package/CHANGELOG.md +152 -0
  2. package/codemods/manifest.json +19 -0
  3. package/codemods/object-form-only.mjs +39 -0
  4. package/codemods/steps/list-object-form.mjs +688 -0
  5. package/codemods/steps/select-object-form.mjs +210 -0
  6. package/dist/artifact/playground/client/assets/index-Dn_xT16-.js +1101 -0
  7. package/dist/artifact/playground/client/index.html +1 -1
  8. package/dist/artifact/playground/host.mjs +14 -14
  9. package/dist/asset-modules.d.ts +2 -1
  10. package/dist/cli/check/stages/render.js +1 -1
  11. package/dist/cli/check/stages/sections.js +1 -1
  12. package/dist/fixtures/canonical.d.ts +2 -5
  13. package/dist/fixtures/media.js +11 -25
  14. package/dist/fixtures/property.js +28 -16
  15. package/dist/fixtures/resolve.js +31 -17
  16. package/dist/fixtures/rows.js +3 -83
  17. package/dist/fixtures.d.ts +17 -9
  18. package/dist/index.d.ts +9 -9
  19. package/dist/packages/external/concrete/package.js +1 -1
  20. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +32 -10
  21. package/dist/packages/internal/fill-bake/dist/derive-source.js +15 -4
  22. package/dist/packages/internal/fill-bake/dist/index.js +2 -2
  23. package/dist/packages/internal/fill-vocabulary/dist/origination.js +6 -61
  24. package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +15 -0
  25. package/dist/packages/internal/property-facts/dist/index.js +1 -1
  26. package/dist/packages/internal/property-facts/dist/{property-facts-5pxZnlkh.js → property-facts-Cy7-O4p0.js} +2 -5
  27. package/dist/packages/internal/section-contracts/dist/catalog.js +2 -22
  28. package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +6 -1
  29. package/dist/packages/internal/section-contracts/dist/group-contract.js +1 -3
  30. package/dist/packages/internal/section-contracts/dist/index.js +0 -5
  31. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +16 -7
  32. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +1 -5
  33. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +14 -0
  34. package/dist/packages/internal/section-contracts/dist/runners.js +3 -28
  35. package/dist/packages/internal/section-contracts/dist/source-contract.js +93 -20
  36. package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +19 -9
  37. package/dist/packages/internal/source-resolution/dist/index.js +48 -57
  38. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +6 -17
  39. package/dist/packages/internal/template-contracts/dist/facts-view.js +4 -23
  40. package/dist/packages/internal/template-contracts/dist/row-sources.js +20 -0
  41. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +362 -380
  42. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +289 -293
  43. package/dist/primitives/slot-bindings.d.ts +7 -40
  44. package/dist/primitives/slot-bindings.js +10 -12
  45. package/dist/schema/define-schema.d.ts +1 -1
  46. package/dist/schema/define-schema.js +13 -1
  47. package/dist/schema/extract-fill-spec.js +14 -17
  48. package/dist/schema/fact.d.ts +2 -19
  49. package/dist/schema/fill-builders.d.ts +4 -3
  50. package/dist/schema/fill-spec.js +18 -1
  51. package/dist/schema/layout.d.ts +6 -8
  52. package/dist/schema/layout.js +3 -9
  53. package/dist/schema/property-facts.d.ts +17 -47
  54. package/dist/schema/row-fields.js +88 -0
  55. package/dist/schema/row-ref.d.ts +59 -0
  56. package/dist/schema/row-ref.js +28 -0
  57. package/dist/schema/runtime-values.d.ts +8 -13
  58. package/dist/schema/section-props.d.ts +19 -26
  59. package/dist/schema/section-schema.d.ts +6 -6
  60. package/dist/schema/section-schema.js +2 -2
  61. package/dist/schema/slot-builders.d.ts +247 -122
  62. package/dist/schema/slot-builders.js +57 -28
  63. package/dist/schema/slot-ref.d.ts +18 -2
  64. package/dist/schema/slot-ref.js +11 -3
  65. package/dist/schema/slot-types.d.ts +7 -7
  66. package/dist/schema/slot-types.js +55 -19
  67. package/dist/section/declare.d.ts +1 -1
  68. package/dist/section/section.d.ts +3 -3
  69. package/dist/template/logic-shim.d.ts +1 -1
  70. package/guide/reference/cli/INDEX.md +2 -2
  71. package/guide/reference/cli/build.md +1 -1
  72. package/guide/reference/cli/check.md +1 -1
  73. package/guide/reference/cli/dev.md +1 -1
  74. package/guide/reference/cli/property-add.md +1 -1
  75. package/guide/reference/cli/property-list.md +1 -1
  76. package/guide/reference/cli/publish.md +1 -1
  77. package/guide/reference/cli/upgrade.md +1 -1
  78. package/guide/reference/rules/INDEX.md +3 -8
  79. package/package.json +1 -1
  80. package/tsconfig.base.json +1 -0
  81. package/dist/artifact/playground/client/assets/index-Cqz-jjVw.js +0 -1101
  82. package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +0 -20
  83. package/dist/packages/internal/section-contracts/dist/name-title-contract.js +0 -20
  84. package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +0 -20
  85. package/dist/packages/internal/section-contracts/dist/row-contract.js +0 -37
  86. package/dist/packages/internal/section-contracts/dist/source-filter-contract.js +0 -15
  87. package/dist/packages/internal/template-contracts/dist/layout.js +0 -10
@@ -1,20 +0,0 @@
1
- import { originationFor } from "../../fill-vocabulary/dist/origination.js";
2
- import { isListFill } from "./fill-spec-view.js";
3
-
4
- //#region ../../internal/section-contracts/dist/choose-select-contract.js
5
- function assertChooseSelectContract(schema, decision, sectionKey) {
6
- if (!isListFill(decision)) return;
7
- for (const slotId of decision.produces) {
8
- const slot = schema.slots[slotId];
9
- if (slot === void 0) continue;
10
- const origination = originationFor(slot);
11
- if (origination?.kind !== "unkeyed-rows") continue;
12
- const where = `Section "${sectionKey}": list fill "${decision.id}" originates rows of "${slotId}"`;
13
- const declared = Object.keys(slot.fields ?? {});
14
- if (origination.title !== void 0) throw new Error(`${where}, keyed by \`title: "${origination.title}"\` — ${origination.titleType === void 0 ? "which is not one of its declared fields" : `a \`${origination.titleType}\` field${origination.titleType === "select" ? " with no declared `values`" : ""}`}. Rows are keyed on a \`text\` field the model writes or a \`select.of([...])\` field it picks from, so point \`title:\` at one of those.`);
15
- throw new Error(`${where}, but declares neither a \`title:\` to key them by nor exactly one \`select\` field with \`values\` to fall back to (found ${origination.selects.length}; declared: ${declared.length > 0 ? declared.join(", ") : "none"}). Title the list by the field that names a row, give the row exactly one \`select.of([...])\` field, or originate the rows another way.`);
16
- }
17
- }
18
-
19
- //#endregion
20
- export { assertChooseSelectContract };
@@ -1,20 +0,0 @@
1
- import { originationFor } from "../../fill-vocabulary/dist/origination.js";
2
- import { isListFill } from "./fill-spec-view.js";
3
-
4
- //#region ../../internal/section-contracts/dist/name-title-contract.js
5
- function assertNameTitleContract(schema, decision, sectionKey) {
6
- if (!isListFill(decision)) return;
7
- for (const slotId of decision.produces) {
8
- const slot = schema.slots[slotId];
9
- if (slot === void 0) continue;
10
- const origination = originationFor(slot);
11
- if (origination?.kind !== "keyed-rows" || origination.keys !== "written") continue;
12
- const key = origination.keyField;
13
- const where = `Section "${sectionKey}": list fill "${decision.id}" writes each row of "${slotId}" into "${key}"`;
14
- if (typeof (slot.fields?.[key])?.cap !== "number") throw new Error(`${where}, which declares no \`cap\` — a written name needs its character budget.`);
15
- if (decision.fields?.[key] !== void 0) throw new Error(`${where}, which also carries its own fill — the written name is that field's value, so it takes none.`);
16
- }
17
- }
18
-
19
- //#endregion
20
- export { assertNameTitleContract };
@@ -1,20 +0,0 @@
1
- import { poolingPrimitiveOf } from "../../fill-vocabulary/dist/row-planners.js";
2
- import { isListFill } from "./fill-spec-view.js";
3
-
4
- //#region ../../internal/section-contracts/dist/pooling-field-contract.js
5
- function poolingDeclarationsOf(slot) {
6
- if (slot.fields !== void 0) return Object.entries(slot.fields).filter(([, field]) => field.source === void 0 && poolingPrimitiveOf(field) !== void 0).map(([name]) => name);
7
- return poolingPrimitiveOf(slot.element ?? {}) !== void 0 ? ["element"] : [];
8
- }
9
- function assertPoolingFieldContract(schema, decision, sectionKey) {
10
- if (!isListFill(decision)) return;
11
- for (const slotId of decision.produces) {
12
- const slot = schema.slots[slotId];
13
- if (!slot) continue;
14
- const pooling = poolingDeclarationsOf(slot);
15
- if (pooling.length > 1) throw new Error(`Section "${sectionKey}": list fill "${decision.id}" produces "${slotId}", whose item declares ${pooling.length} pooled fields (${pooling.join(", ")}) — a record item carries at most one, since the pool it draws from IS where its rows come from. Bind all but one to a fact with \`source:\`, or split the list.`);
16
- }
17
- }
18
-
19
- //#endregion
20
- export { assertPoolingFieldContract };
@@ -1,37 +0,0 @@
1
- import { flattenLayout, isShortSlot } from "../../template-contracts/dist/layout.js";
2
-
3
- //#region ../../internal/section-contracts/dist/row-contract.js
4
- function assertRowContract(schema, sectionKey) {
5
- for (const group of schema.groups ?? []) assertRowPairs(group.members, schema.slots, `group "${group.id}"`, sectionKey);
6
- for (const [slotId, slot] of Object.entries(schema.slots)) {
7
- if (slot.type !== "list") continue;
8
- if (!slot.layout) continue;
9
- const label = `${slot.type} "${slotId}"`;
10
- const itemFields = slot.fields ?? {};
11
- assertRowPairs(slot.layout, itemFields, label, sectionKey);
12
- const flat = flattenLayout(slot.layout);
13
- const dup = flat.find((id, i) => flat.indexOf(id) !== i);
14
- if (dup) throw new Error(`Section "${sectionKey}": ${label} layout lists "${dup}" more than once.`);
15
- for (const id of flat) if (!(id in itemFields)) throw new Error(`Section "${sectionKey}": ${label} layout names unknown field "${id}".`);
16
- for (const key of Object.keys(itemFields)) if (!flat.includes(key)) throw new Error(`Section "${sectionKey}": ${label} layout omits field "${key}".`);
17
- }
18
- }
19
- function assertRowPairs(layout, slots, ctx, sectionKey) {
20
- const order = Object.keys(slots);
21
- for (const entry of layout) {
22
- if (typeof entry === "string") continue;
23
- const [a, b] = entry;
24
- for (const id of [a, b]) {
25
- const slot = slots[id];
26
- if (!slot) throw new Error(`Section "${sectionKey}": ${ctx} row names unknown slot "${id}".`);
27
- if (!isShortSlot({
28
- type: slot.type ?? "",
29
- size: slot.size
30
- })) throw new Error(`Section "${sectionKey}": ${ctx} row pairs non-short slot "${id}" (type "${slot.type}"); only number/short-text slots may share a row.`);
31
- }
32
- if (order.indexOf(b) !== order.indexOf(a) + 1) throw new Error(`Section "${sectionKey}": ${ctx} row [${a}, ${b}] must be adjacent and in order; reorder the declaration so "${b}" immediately follows "${a}".`);
33
- }
34
- }
35
-
36
- //#endregion
37
- export { assertRowContract };
@@ -1,15 +0,0 @@
1
- import { SOURCE_FILTERS, isSourceFilter } from "../../template-contracts/dist/slot-catalog.js";
2
-
3
- //#region ../../internal/section-contracts/dist/source-filter-contract.js
4
- function assertSourceFilterContract(schema, sectionKey) {
5
- for (const [slotId, slot] of Object.entries(schema.slots)) check(slot, sectionKey, slotId);
6
- }
7
- function check(slot, sectionKey, path) {
8
- const filter = slot.sourceFilter;
9
- if (filter !== void 0 && !isSourceFilter(filter)) throw new Error(`Section "${sectionKey}": image "${path}" declares unknown sourceFilter ${JSON.stringify(filter)} (allowed: ${SOURCE_FILTERS.join(", ")}). An unknown tag silently falls back to the property photo pool.`);
10
- if (slot.element) check(slot.element, sectionKey, `${path}.element`);
11
- if (slot.fields) for (const [fieldId, field] of Object.entries(slot.fields)) check(field, sectionKey, `${path}.${fieldId}`);
12
- }
13
-
14
- //#endregion
15
- export { assertSourceFilterContract };
@@ -1,10 +0,0 @@
1
- //#region ../../internal/template-contracts/dist/layout.js
2
- function flattenLayout(layout) {
3
- return layout.flatMap((entry) => typeof entry === "string" ? [entry] : [entry[0], entry[1]]);
4
- }
5
- function isShortSlot(slot) {
6
- return slot.type === "number" || slot.type === "url" || slot.type === "text" && (slot.size === void 0 || slot.size === "short");
7
- }
8
-
9
- //#endregion
10
- export { flattenLayout, isShortSlot };