@homepages/concrete 8.0.0 → 9.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.
- package/CHANGELOG.md +988 -0
- package/README.md +20 -9
- package/codemods/list-grammar.mjs +923 -0
- package/codemods/manifest.json +60 -0
- package/codemods/process-builders.mjs +198 -0
- package/codemods/slot-object.mjs +1097 -0
- package/codemods/steps/content-object-fields.mjs +324 -0
- package/codemods/steps/list-object-form.mjs +6 -7
- package/codemods/table-rows.mjs +568 -0
- package/codemods/unwrap-object-fields.mjs +310 -0
- package/codemods/viewer-slot-document.mjs +131 -0
- package/codemods/write-property-as-facts-document.mjs +716 -0
- package/codemods/write-the-address-line.mjs +255 -0
- package/codemods/write-the-registry-members.mjs +653 -0
- package/codemods/write-the-select-from.mjs +141 -0
- package/codemods/write-the-sole-from.mjs +369 -0
- package/codemods/write-the-table-from.mjs +267 -0
- package/codemods/write-the-whole-item.mjs +512 -0
- package/codemods/writeback-drop.mjs +168 -0
- package/codemods/written-contact-address.mjs +162 -0
- package/codemods/written-media-category.mjs +227 -0
- package/codemods/written-ref-kinds-name-the-layer.mjs +172 -0
- package/codemods/written-uploads-replace-pool-reads.mjs +454 -0
- package/codemods/written-uploads-sort-into-lists.mjs +405 -0
- package/codemods/written-uploads-stated-in-sorted-lists.mjs +295 -0
- package/codemods/written-video-sources-drop.mjs +144 -0
- package/codemods/written-without-pick-none.mjs +146 -0
- package/codemods/written-without-retired-knowledge.mjs +223 -0
- package/codemods/written-without-the-media-key.mjs +202 -0
- package/codemods/written-without-the-property-type.mjs +249 -0
- package/dist/artifact/playground/client/assets/index-BUmdDDX5.js +1259 -0
- package/dist/artifact/playground/client/assets/index-DDOcM0zA.css +1 -0
- package/dist/artifact/playground/client/index.html +2 -2
- package/dist/artifact/playground/client/island-canvas-host.mjs +1 -1
- package/dist/artifact/playground/host.mjs +61 -27
- package/dist/base.css +58 -1
- package/dist/cli/build/artifact.js +6 -9
- package/dist/cli/build/captures.js +2 -12
- package/dist/cli/build/esbuild.js +1 -25
- package/dist/cli/build/fixtures.js +2 -1
- package/dist/cli/build/icons.js +1 -1
- package/dist/cli/build/static.js +2 -2
- package/dist/cli/capture/capture.js +8 -9
- package/dist/cli/check/analyze.js +8 -1
- package/dist/cli/check/load-outdir.js +47 -0
- package/dist/cli/check/load-workspace.js +4 -4
- package/dist/cli/check/render/html.js +1 -2
- package/dist/cli/check/render/inputs.js +10 -3
- package/dist/cli/check/render/island-frames.js +2 -1
- package/dist/cli/check/render/marker-coverage.js +23 -15
- package/dist/cli/check/report.js +5 -0
- package/dist/cli/check/stages/bundles.js +1 -1
- package/dist/cli/check/stages/relations.js +1 -1
- package/dist/cli/check/stages/render.js +48 -33
- package/dist/cli/check/stages/sections.js +83 -31
- package/dist/cli/commands.js +1 -1
- package/dist/cli/dev/crop.js +1 -1
- package/dist/cli/dev/fixture-ladders.js +96 -0
- package/dist/cli/dev/islands.js +12 -123
- package/dist/cli/dev/listen.js +20 -1
- package/dist/cli/dev/load-template.js +1 -1
- package/dist/cli/dev/server.js +35 -10
- package/dist/cli/dev/vite.js +9 -7
- package/dist/cli/dev/workspace-reader.js +16 -16
- package/dist/cli/media/derive.js +43 -57
- package/dist/cli/media/frame-rung-floor.js +0 -1
- package/dist/cli/property/index.js +1 -6
- package/dist/css/inline.js +1 -22
- package/dist/eslint/rules/no-marker-literal.js +1 -1
- package/dist/fixtures/load.js +16 -7
- package/dist/fixtures/media-plugin.js +17 -12
- package/dist/fixtures/media-store.js +115 -0
- package/dist/fixtures/property.js +345 -126
- package/dist/fixtures/resolve.js +263 -251
- package/dist/fixtures/rows.js +4 -11
- package/dist/fixtures.d.ts +234 -109
- package/dist/index.d.ts +25 -16
- package/dist/index.js +10 -6
- package/dist/islands/marker.js +2 -1
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/canvas-core/dist/island-host.js +62 -0
- package/dist/packages/internal/canvas-core/dist/island-shields.js +30 -0
- package/dist/packages/internal/capture-settle/dist/index.js +3 -0
- package/dist/packages/internal/capture-settle/dist/island-markers.d.ts +13 -0
- package/dist/packages/internal/capture-settle/dist/island-markers.js +6 -0
- package/dist/packages/internal/capture-settle/dist/settle.js +150 -0
- package/dist/packages/internal/{image-ladder/dist/crop.js → crop-region/dist/index.js} +21 -20
- package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +251 -33
- package/dist/packages/internal/fill-bake/dist/compute-reads.js +365 -4
- package/dist/packages/internal/fill-bake/dist/derive-source.js +35 -21
- package/dist/packages/internal/fill-bake/dist/index.js +8 -3
- package/dist/packages/internal/fill-bake/dist/item-merge.js +119 -0
- package/dist/packages/internal/fill-bake/dist/item-overrides.js +28 -0
- package/dist/packages/internal/fill-bake/dist/linked-merge.js +40 -0
- package/dist/packages/internal/fill-bake/dist/list-grammar.js +175 -0
- package/dist/packages/internal/fill-vocabulary/dist/holder.js +51 -0
- package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +390 -0
- package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +1 -23
- package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +1 -1
- package/dist/packages/internal/fill-vocabulary/dist/verbs.js +75 -0
- package/dist/packages/internal/format-geometry/dist/capture.js +11 -147
- package/dist/packages/internal/format-geometry/dist/format.d.ts +8 -2
- package/dist/packages/internal/format-geometry/dist/geometry.js +13 -2
- package/dist/packages/internal/image-ladder/dist/encode.js +27 -14
- package/dist/packages/internal/image-ladder/dist/index.js +3 -3
- package/dist/packages/internal/image-ladder/dist/policy.js +28 -53
- package/dist/packages/internal/island-runtime/dist/capture-holds.js +1 -1
- package/dist/packages/internal/island-runtime/dist/contract.d.ts +3 -12
- package/dist/packages/internal/island-runtime/dist/contract.js +2 -2
- package/dist/packages/internal/island-runtime/dist/index.d.ts +3 -7
- package/dist/packages/internal/island-runtime/dist/index.js +2 -1
- package/dist/packages/internal/island-runtime/dist/viewport-schedule.js +1 -1
- package/dist/packages/internal/media-resolution/dist/crop-key.js +7 -0
- package/dist/packages/internal/media-resolution/dist/document.js +63 -0
- package/dist/packages/internal/media-resolution/dist/image.js +228 -0
- package/dist/packages/internal/media-resolution/dist/index.js +11 -0
- package/dist/packages/internal/media-resolution/dist/list.js +112 -0
- package/dist/packages/internal/media-resolution/dist/media.js +59 -0
- package/dist/packages/internal/media-resolution/dist/records.js +7 -0
- package/dist/packages/internal/media-resolution/dist/slot.js +34 -0
- package/dist/packages/internal/media-resolution/dist/store.js +19 -0
- package/dist/packages/internal/media-resolution/dist/tour.js +59 -0
- package/dist/packages/internal/media-resolution/dist/video.js +93 -0
- package/dist/packages/internal/property-facts/dist/registry-facts.js +244 -0
- package/dist/packages/internal/section-contracts/dist/cap-contract.js +8 -17
- package/dist/packages/internal/section-contracts/dist/catalog.js +34 -10
- package/dist/packages/internal/section-contracts/dist/count-bounds-contract.js +11 -2
- package/dist/packages/internal/section-contracts/dist/directly-linked-list-contract.js +27 -0
- package/dist/packages/internal/section-contracts/dist/fill-options.js +12 -0
- package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +95 -0
- package/dist/packages/internal/section-contracts/dist/grammar-scope.js +154 -0
- package/dist/packages/internal/section-contracts/dist/index.js +7 -1
- package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +15 -20
- package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +12 -7
- package/dist/packages/internal/section-contracts/dist/list-source-contract.js +46 -0
- package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +11 -2
- package/dist/packages/internal/section-contracts/dist/object-contract.js +92 -0
- package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +5 -5
- package/dist/packages/internal/section-contracts/dist/reads-acyclic-contract.js +63 -0
- package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +7 -4
- package/dist/packages/internal/section-contracts/dist/row-rule-contract.js +83 -0
- package/dist/packages/internal/section-contracts/dist/row-source-contract.js +67 -0
- package/dist/packages/internal/section-contracts/dist/runners.js +74 -10
- package/dist/packages/internal/section-contracts/dist/select-contract.js +0 -8
- package/dist/packages/internal/section-contracts/dist/source-contract.js +103 -46
- package/dist/packages/internal/section-contracts/dist/sources-contract.js +47 -17
- package/dist/packages/internal/section-contracts/dist/table-member.js +16 -0
- package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +42 -21
- package/dist/packages/internal/source-resolution/dist/index.js +113 -72
- package/dist/packages/internal/static-assets-binding/dist/section-asset-url.js +16 -0
- package/dist/packages/internal/street-address/dist/index.js +72 -0
- package/dist/packages/internal/template-artifact/dist/asset-mime.js +30 -0
- package/dist/packages/internal/template-artifact/dist/layout.js +1 -2
- package/dist/packages/internal/template-artifact/dist/manifest.js +1 -1
- package/dist/packages/internal/template-artifact/dist/verify.js +12 -29
- package/dist/packages/internal/template-contracts/dist/address-value.d.ts +52 -0
- package/dist/packages/internal/template-contracts/dist/address-value.js +90 -0
- package/dist/packages/internal/template-contracts/dist/comparable-address.js +19 -0
- package/dist/{schema → packages/internal/template-contracts/dist}/compute.d.ts +29 -6
- package/dist/{schema → packages/internal/template-contracts/dist}/compute.js +11 -13
- package/dist/packages/internal/template-contracts/dist/content-pick.js +51 -0
- package/dist/packages/internal/template-contracts/dist/decision-fills.js +85 -0
- package/dist/packages/internal/template-contracts/dist/display-overrides.js +7 -0
- package/dist/packages/internal/template-contracts/dist/document-value.d.ts +16 -5
- package/dist/packages/internal/template-contracts/dist/fact-compute.d.ts +24 -0
- package/dist/packages/internal/template-contracts/dist/fact-compute.js +30 -0
- package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +44 -0
- package/dist/packages/internal/template-contracts/dist/fact-keys.js +88 -0
- package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +290 -0
- package/dist/packages/internal/template-contracts/dist/fact-registry.js +598 -0
- package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +10 -24
- package/dist/packages/internal/template-contracts/dist/fill-builders.d.ts +157 -0
- package/dist/packages/internal/template-contracts/dist/fill-builders.js +79 -0
- package/dist/packages/internal/template-contracts/dist/fill-declaration.d.ts +14 -0
- package/dist/{schema → packages/internal/template-contracts/dist}/fill-declaration.js +6 -5
- package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +158 -0
- package/dist/packages/internal/template-contracts/dist/fill-spec.js +291 -0
- package/dist/packages/internal/template-contracts/dist/findable.js +8 -0
- package/dist/packages/internal/template-contracts/dist/floor-presets.js +13 -0
- package/dist/packages/internal/template-contracts/dist/icon-names.d.ts +5 -0
- package/dist/packages/internal/template-contracts/dist/icon-names.js +70 -0
- package/dist/packages/internal/template-contracts/dist/legacy-facts.js +167 -0
- package/dist/packages/internal/template-contracts/dist/list-editing.js +94 -0
- package/dist/packages/internal/template-contracts/dist/list.d.ts +215 -0
- package/dist/packages/internal/template-contracts/dist/list.js +258 -0
- package/dist/packages/internal/template-contracts/dist/markers.d.ts +2 -2
- package/dist/packages/internal/template-contracts/dist/media-candidates.js +38 -0
- package/dist/packages/internal/template-contracts/dist/mirror-kind.js +48 -0
- package/dist/packages/internal/template-contracts/dist/number-display.js +10 -0
- package/dist/packages/internal/template-contracts/dist/object.d.ts +89 -0
- package/dist/packages/internal/template-contracts/dist/object.js +131 -0
- package/dist/packages/internal/template-contracts/dist/poi-row.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/primitive-descriptors.d.ts +1 -0
- package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +162 -0
- package/dist/packages/internal/template-contracts/dist/process-builders.d.ts +77 -0
- package/dist/packages/internal/template-contracts/dist/process-builders.js +73 -0
- package/dist/packages/internal/template-contracts/dist/read-graph.js +250 -0
- package/dist/packages/internal/template-contracts/dist/ref-locate.js +192 -0
- package/dist/packages/internal/template-contracts/dist/registry-aliases.js +77 -0
- package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +268 -0
- package/dist/packages/internal/template-contracts/dist/registry-facts.js +202 -0
- package/dist/packages/internal/template-contracts/dist/registry-shape.d.ts +41 -0
- package/dist/packages/internal/template-contracts/dist/registry-shape.js +135 -0
- package/dist/packages/internal/template-contracts/dist/resolve-scope.js +103 -0
- package/dist/packages/internal/{image-descriptor/dist/index.d.ts → template-contracts/dist/responsive-image.d.ts} +1 -1
- package/dist/packages/internal/template-contracts/dist/row-planners.js +29 -0
- package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +133 -0
- package/dist/packages/internal/template-contracts/dist/row-ref.js +101 -0
- package/dist/packages/internal/template-contracts/dist/row-sources.js +49 -3
- package/dist/packages/internal/template-contracts/dist/row.d.ts +155 -0
- package/dist/packages/internal/template-contracts/dist/row.js +84 -0
- package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +97 -0
- package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +782 -0
- package/dist/packages/internal/template-contracts/dist/slot-builders.js +233 -0
- package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +243 -384
- package/dist/packages/internal/template-contracts/dist/slot-catalog.js +335 -227
- package/dist/packages/internal/template-contracts/dist/slot-overrides.js +21 -0
- package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +155 -0
- package/dist/packages/internal/template-contracts/dist/slot-ref.js +76 -0
- package/dist/packages/internal/template-contracts/dist/slot-types.d.ts +163 -0
- package/dist/packages/internal/template-contracts/dist/slot-types.js +140 -0
- package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +97 -0
- package/dist/packages/internal/template-contracts/dist/table-members.d.ts +25 -0
- package/dist/packages/internal/template-contracts/dist/table-members.js +90 -0
- package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +5 -5
- package/dist/packages/internal/template-contracts/dist/value-contracts.js +15 -0
- package/dist/packages/internal/template-contracts/dist/video-value.d.ts +2 -2
- package/dist/platform/fs.js +5 -2
- package/dist/playground/canvas-island-host.d.ts +11 -0
- package/dist/playground/canvas-island-host.js +29 -0
- package/dist/playground/canvas-markers.js +14 -0
- package/dist/playground-island-runtime.d.ts +3 -2
- package/dist/playground-island-runtime.js +3 -2
- package/dist/primitives/FrameShell.js +0 -1
- package/dist/primitives/Image.d.ts +5 -4
- package/dist/primitives/Tour.d.ts +1 -1
- package/dist/primitives/Video.d.ts +2 -2
- package/dist/primitives/index.d.ts +2 -3
- package/dist/primitives/picture-sources.js +2 -2
- package/dist/primitives/probe-context.js +2 -12
- package/dist/primitives/slot-address.d.ts +44 -0
- package/dist/primitives/slot-address.js +19 -0
- package/dist/primitives/slot-bindings.d.ts +65 -26
- package/dist/primitives/slot-bindings.js +104 -46
- package/dist/primitives/slot-document.d.ts +23 -18
- package/dist/primitives/slot-document.js +39 -14
- package/dist/primitives/slot-download.d.ts +39 -0
- package/dist/primitives/slot-download.js +39 -0
- package/dist/primitives/slot-list.d.ts +3 -3
- package/dist/primitives/slot-list.js +0 -2
- package/dist/primitives/slot-media.d.ts +24 -5
- package/dist/primitives/slot-media.js +6 -9
- package/dist/primitives/slot-object.d.ts +49 -0
- package/dist/primitives/slot-object.js +20 -0
- package/dist/primitives/slot-scalar.d.ts +27 -2
- package/dist/primitives/slot-scalar.js +50 -7
- package/dist/primitives/slot.d.ts +13 -6
- package/dist/primitives/slot.js +10 -3
- package/dist/rules/registry.js +19 -30
- package/dist/schema/define-schema.d.ts +4 -8
- package/dist/schema/define-schema.js +178 -79
- package/dist/schema/extract-fill-spec.js +2 -153
- package/dist/schema/fact.d.ts +57 -15
- package/dist/schema/fact.js +42 -7
- package/dist/schema/facts-view.d.ts +14 -0
- package/dist/schema/format.d.ts +1 -0
- package/dist/schema/format.js +2 -1
- package/dist/schema/manifest.js +24 -0
- package/dist/schema/property-facts.d.ts +8 -12
- package/dist/schema/section-props.d.ts +2 -66
- package/dist/schema/section-schema.d.ts +8 -11
- package/dist/schema/section-schema.js +27 -10
- package/dist/section/declare.d.ts +18 -7
- package/dist/section/declare.js +18 -5
- package/dist/section/materialize.js +3 -8
- package/dist/section/section.d.ts +12 -8
- package/dist/section/section.js +1 -1
- package/dist/template/logic-shim.d.ts +14 -7
- package/dist/template/logic-shim.js +14 -7
- package/dist/template/materialize.js +17 -18
- package/dist/template/mirror-types.js +30 -31
- package/dist/template/section-reads.js +85 -9
- package/guide/reference/cli/INDEX.md +2 -2
- package/guide/reference/cli/build.md +1 -1
- package/guide/reference/cli/check.md +1 -1
- package/guide/reference/cli/dev.md +1 -1
- package/guide/reference/cli/property-add.md +1 -1
- package/guide/reference/cli/property-list.md +2 -2
- package/guide/reference/cli/publish.md +1 -1
- package/guide/reference/cli/upgrade.md +1 -1
- package/guide/reference/rules/INDEX.md +28 -24
- package/package.json +9 -8
- package/dist/artifact/playground/client/assets/index-CckS2ONm.css +0 -1
- package/dist/artifact/playground/client/assets/index-Dn_xT16-.js +0 -1101
- package/dist/fixtures/canonical.d.ts +0 -166
- package/dist/fixtures/media.js +0 -163
- package/dist/packages/internal/fill-vocabulary/dist/origination.js +0 -51
- package/dist/packages/internal/format-geometry/dist/index.js +0 -4
- package/dist/packages/internal/property-facts/dist/derive-facts-view.js +0 -10
- package/dist/packages/internal/property-facts/dist/index.js +0 -3
- package/dist/packages/internal/property-facts/dist/property-facts-Cy7-O4p0.js +0 -189
- package/dist/packages/internal/section-contracts/dist/record-collection-contract.js +0 -24
- package/dist/packages/internal/template-contracts/dist/collection-editing.js +0 -22
- package/dist/packages/internal/template-contracts/dist/facts-view.js +0 -104
- package/dist/packages/internal/template-contracts/dist/select-key.js +0 -7
- package/dist/primitives/slot-group.d.ts +0 -40
- package/dist/primitives/slot-group.js +0 -36
- package/dist/schema/extract-used-facts.js +0 -34
- package/dist/schema/fill-builders.d.ts +0 -115
- package/dist/schema/fill-builders.js +0 -25
- package/dist/schema/fill-declaration.d.ts +0 -14
- package/dist/schema/fill-spec.js +0 -98
- package/dist/schema/layout.d.ts +0 -30
- package/dist/schema/layout.js +0 -14
- package/dist/schema/row-fields.js +0 -88
- package/dist/schema/row-ref.d.ts +0 -59
- package/dist/schema/row-ref.js +0 -28
- package/dist/schema/runtime-values.d.ts +0 -71
- package/dist/schema/section-nav.js +0 -14
- package/dist/schema/slot-builders.d.ts +0 -633
- package/dist/schema/slot-builders.js +0 -177
- package/dist/schema/slot-ref.d.ts +0 -79
- package/dist/schema/slot-ref.js +0 -41
- package/dist/schema/slot-types.d.ts +0 -111
- package/dist/schema/slot-types.js +0 -214
- package/dist/section/groups.js +0 -68
package/codemods/manifest.json
CHANGED
|
@@ -88,6 +88,66 @@
|
|
|
88
88
|
"manual": [
|
|
89
89
|
"in a `compute()` that reads `fact.property.comparables`, read a comp's photo as `comp.photo` wherever it reads `comp.photo_upload_id` \u2014 `{ photo_id: comp.photo, url: \"\", alt: comp.address }`."
|
|
90
90
|
]
|
|
91
|
+
},
|
|
92
|
+
"9.0.0": {
|
|
93
|
+
"codemods": [
|
|
94
|
+
"list-grammar",
|
|
95
|
+
"process-builders",
|
|
96
|
+
"slot-object",
|
|
97
|
+
"table-rows",
|
|
98
|
+
"unwrap-object-fields",
|
|
99
|
+
"viewer-slot-document",
|
|
100
|
+
"write-property-as-facts-document",
|
|
101
|
+
"write-the-address-line",
|
|
102
|
+
"write-the-registry-members",
|
|
103
|
+
"write-the-select-from",
|
|
104
|
+
"write-the-sole-from",
|
|
105
|
+
"write-the-table-from",
|
|
106
|
+
"write-the-whole-item",
|
|
107
|
+
"writeback-drop",
|
|
108
|
+
"written-contact-address",
|
|
109
|
+
"written-media-category",
|
|
110
|
+
"written-ref-kinds-name-the-layer",
|
|
111
|
+
"written-uploads-replace-pool-reads",
|
|
112
|
+
"written-uploads-sort-into-lists",
|
|
113
|
+
"written-uploads-stated-in-sorted-lists",
|
|
114
|
+
"written-video-sources-drop",
|
|
115
|
+
"written-without-pick-none",
|
|
116
|
+
"written-without-retired-knowledge",
|
|
117
|
+
"written-without-the-media-key",
|
|
118
|
+
"written-without-the-property-type"
|
|
119
|
+
],
|
|
120
|
+
"manual": [
|
|
121
|
+
"a compute that reads an asset record's `caption`, `description`, `tags` or `notes` reads a member the record no longer has \u2014 show the asset's `name`, or make the words a slot the user or a declared write fills. An `alt` on a media slot's value is the text a render uses; nothing fills it from the asset.",
|
|
122
|
+
"after `concrete upgrade`, add `none: true` to each list of places that may rightly come back empty for some homes, such as transit stops on a rural listing. Without it, finding nothing is now a failed fill.",
|
|
123
|
+
"a compute that reads an asset record's `author`, `rooms` or `address` reads a member the record no longer has \u2014 the words are in the asset's `account`, for fills to judge from; show the asset's `name`, or make the words a slot the user or a declared write fills.",
|
|
124
|
+
"after `concrete upgrade`, fold each `Manual:` line it reports into the section it names \u2014 a fill's dropped `cap` (lower the kind's own `cap`, or say it in the brief), the first field of a filled `fields` list whose own brief is gone (fold it into the list's brief), an item field reading an earlier field by its const (read what that field read).",
|
|
125
|
+
"add `from` to each media slot `concrete check` names as bound to no fact \u2014 `from: [pool.photos, pool.floor_plans]` keeps an image slot's picker as it was, bar the account's contact media, and `pool.videos`, `pool.tours` and `pool.documents` a video's, a tour's and a document's \u2014 and remove `from` from each one it names as bound.",
|
|
126
|
+
"rename each `Asset`, `ImageAsset`, `VideoAsset`, `TourAsset` or `DocumentAsset` you import from `@homepages/concrete` to `Media`, `ImageMedia`, `VideoMedia`, `TourMedia` or `DocumentMedia` \u2014 for example `(uploads: readonly Media[]) => \u2026` in a `compute()`.",
|
|
127
|
+
"delete `prefix` and `suffix` from every `number({ \u2026 })` call (each one fails to compile, naming the option); where the page should show a unit such as `$` or `sq ft`, write it in the section's markup around `Slot.Number`.",
|
|
128
|
+
"after `concrete upgrade`, settle each line it hands back: a `process` spelled through a variable \u2014 build each entry with its builder (`process.cutout()`) \u2014 and a string naming no process, which no builder constructs.",
|
|
129
|
+
"after `concrete upgrade`, rewrite each list `concrete check` refuses under `sections/row-projection-list` as a list of rows: an item holding a row `from` the table (`row({ from: fact.property.units, source: el })`), its other fields reading members off that row, and a `compute({ reads: [fact.property.units] }, (units) => \u2026)` returning the rows the list starts with. A list that is vocabulary nobody arranges takes `locked: true` instead.",
|
|
130
|
+
"a section that read `crop_key` off an image value reads `url`, which serves the slot's cut whenever the slot is cropped.",
|
|
131
|
+
"after `concrete upgrade`, finish each card it hands back by its file and line \u2014 a card whose `id` or `label` is not a plain string (one card per item of an array), or whose slots it cannot trace to a section (a context value, `{children}`), becomes an `object({ label: compute(() => \"<the card's label>\"), fields })` in the section's `slots`, with its binding passed down to a `<Slot.Object>`; a slot marked in two cards, neither holding the other, stays in one object; a card whose id names another slot takes a new name; a list of objects carded beside other slots stays at the top level \u2014 and wherever another section reads a slot that moved into an object (`Hero.slots.street`), read what that field reads instead, or keep the slot out of the object.",
|
|
132
|
+
"where `concrete upgrade` reports slots that now read a top-level row, group them with the row into an object if they are one card \u2014 `contact: object({ label: compute(() => \"Contact\"), fields: { contact, name, phone } })`, rendered in a `<Slot.Object slot={slot.contact}>` \u2014 and declare by hand any table it reports read by a position other than the first.",
|
|
133
|
+
"after `concrete upgrade`, finish each line it hands back \u2014 rename an object field named `id`, `slot`, `index`, `def`, `value` or `present` for what it holds (`value` \u2192 `figure`), in the section, its fixtures and every read of it, then read it straight off the binding \u2014 keep the field's type and label, and add no other new field of that type and label to the object in the same version, so publishing carries every site's stored value, and the edit pinning it, to the new name; and where an object's fields were enumerated, spread or handed to a library whole (`Object.keys(item.fields)`), name the fields you need instead, since the binding carries its own keys beside them.",
|
|
134
|
+
"after `concrete upgrade`, finish each line it hands back \u2014 where a `compute()` read `display` or `street_no_type` off `fact.property.address`, write the one-line address or the short street from its parts there; where it took the address whole or destructured it, handle the address value and `null`; and give any slot other than a text slot bound to the whole address a `compute()` returning what it shows.",
|
|
135
|
+
"after `concrete upgrade`, finish each line it hands back \u2014 read a contact's `primary` as the table's first row and a unit's `position` as its index where the list renders; draw a unit's floor plans through a row declared from each plan (`const plan = row({ label: \"Plan\", source: el })`, then `plan.image` and `plan.floor`) where a list drew each as a bare image; and wherever a `compute()` hands a table's rows to a helper of your own, read them there by the registry's names.",
|
|
136
|
+
"after `concrete upgrade`, settle each pick it hands back. Most are a media slot offering the user `from: [pool.photos, pool.floor_plans]` whose pick read `of: fact.photos`: the model now picks from every pool in `from`, so keep `from` wide and say in the brief what the model should prefer, or narrow `from` to the pools the model may pick \u2014 then remove `of`. A select whose pick named fewer choices than its `from` is settled the same way.",
|
|
137
|
+
"after `concrete upgrade`, settle each row it hands back. A row mirroring another section's row or list (`source: Hero.slots.agent.fields.contact`), a sibling's, or a `compute()` names the table it holds a row of in `from`, keeping its source. A row over a `compute()`'s own values \u2014 `row({ source: el, locked: true })` inside a list of constants \u2014 references no fact data and is no longer declared: read each item value with a per-field `compute({ reads: [el] }, (value) => value.title)` and drop the row.",
|
|
138
|
+
"after `concrete upgrade`, settle each picked list it hands back. A pick `of` a list slot, a sibling list or a `compute()` chooses only from its item's `from` now: picking a table's rows, name the table on a row field (`row({ label, from: fact.property.comparables })`) and say in the brief which to prefer. An item function whose element no one declaration holds declares the field holding the pick with `from` and no source, and its siblings read that field's const.",
|
|
139
|
+
"after `concrete upgrade`, settle each slot it names by line: a `writeback: false` it removed from a slot reading a stored value \u2014 a fact, a row's member, another slot. That slot now writes its source. Where it should only be seeded from it, free to diverge, source it by `compute({ reads: [contact.name] }, (name) => name)`.",
|
|
140
|
+
"after `concrete upgrade`, state the parts of each fixture contact address it hands back by line \u2014 one it could not read as \"street, [line 2,] city, ST 12345\" \u2014 and, where a section reads a contact row's `address` into a text slot, bind it with `address({ label, source: contact.address })` and print its lines in `Slot.Address`.",
|
|
141
|
+
"after `concrete upgrade`, settle each pool it names by line \u2014 a `from` spelled through a variable, a pool of another kind, or any other read of `pool` \u2014 by stating the media slot's `category`, or none.",
|
|
142
|
+
"after `concrete upgrade`, settle each line it hands back: code comparing a ref's `kind` to `\"direct\"`, `\"fact\"` or `\"slot\"` reads `\"home\"` or `\"section\"` now, and an object tagged with one of those kinds that holds other members is left for you to decide whether it is a ref.",
|
|
143
|
+
"after `concrete upgrade`, settle each line it hands back: a slot or a list sourced by a media pool picks from the uploads instead (`source: fill.pick({ brief })`, `item: image({ category: \"property\" })`), a compute taking a pool by a destructured parameter filters `fact.property.uploads` itself, and a compute reading a member the asset record spells otherwise reads the record's \u2014 a video's `source` is `provider === null ? \"upload\" : \"link\"`, a document's `filename` is `name`, a note's `upload_id` is `id`, and a floor plan's `unit_assignments` is a compute over `fact.property.units`.",
|
|
144
|
+
"after `concrete upgrade`, settle each line it hands back: a media slot narrowed by `category: \"logo\"` or `\"headshot\"` picks from every upload of its kind now \u2014 narrow it by its brief, or bind it to the contact's image (`source: agent.logo_dark`); and any other read of an asset's `category` reads `fact.property.media` or `fact.property.floor_plans` for its subset instead.",
|
|
145
|
+
"after `concrete upgrade`, settle each line it hands back: name an upload entry written inline and state it in the property's `media` or `floor_plans` where it belongs; state `media` and `floor_plans` beside uploads that are not written as an array; and wherever a fixture read an entry's `category`, read the property's `media` or `floor_plans` for that subset.",
|
|
146
|
+
"after `concrete upgrade`, settle each line it hands back: a `sources` it removed through a variable \u2014 the variable may now feed nothing, and a compute counting the videos the slot accepts counts every video, uploaded or linked \u2014 and any type reading a slot definition's `[\"sources\"]`, which no longer exists.",
|
|
147
|
+
"after `concrete upgrade`, remove `none` from each `fill.pick` it hands back by line \u2014 a pick whose options are a variable rather than an object written in the call.",
|
|
148
|
+
"after `concrete upgrade`, write an `account` for each upload it names whose tags were the only statement of what it is, and settle each entry it left because its `caption` and `description` could not be joined as text or it already states an `account`.",
|
|
149
|
+
"where `concrete upgrade` reports a `compute()` that read `fact.property.property_type`, read `fact.property.units` in its place and decide by the count (`units.length === 1` is a single home); where it reports a slot bound to the property type, its registry key as a string, or a read of `property_type` off a fixture `Property`, remove it."
|
|
150
|
+
]
|
|
91
151
|
}
|
|
92
152
|
}
|
|
93
153
|
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
// A media slot's `process` lists built processes, never strings.
|
|
2
|
+
//
|
|
3
|
+
// A process is built by its builder — `process.cutout()`, `process.autocrop({ brief })` —
|
|
4
|
+
// which emits the object the platform runs, so a process can take options (an
|
|
5
|
+
// auto-crop's brief). `image({ process: ["cutout"] })` no longer compiles.
|
|
6
|
+
//
|
|
7
|
+
// What this codemod does, in every `.ts` and `.tsx` under the workspace that imports this
|
|
8
|
+
// package: in the options object of an `image`, `video`, `tour`, `document` or `media`
|
|
9
|
+
// call, each string in a `process` list naming a process becomes its builder's call —
|
|
10
|
+
// `"cutout"` becomes `process.cutout()` — and `process` is added to the file's import
|
|
11
|
+
// from the framework. A file that already uses a `process` of its own (Node's global, a
|
|
12
|
+
// local) imports it as `mediaProcess` instead. A file reaching the framework through a
|
|
13
|
+
// namespace import (`import * as c`) calls `c.process.cutout()` and imports nothing.
|
|
14
|
+
//
|
|
15
|
+
// What it hands back, by line: a `process` spelled through a variable, and a string
|
|
16
|
+
// naming no process the builders construct.
|
|
17
|
+
|
|
18
|
+
import { readdir, readFile, writeFile } from "node:fs/promises";
|
|
19
|
+
import { join, relative, sep } from "node:path";
|
|
20
|
+
|
|
21
|
+
import ts from "typescript";
|
|
22
|
+
|
|
23
|
+
const CONCRETE = "@homepages/concrete";
|
|
24
|
+
const EXTENSIONS = [".ts", ".tsx"];
|
|
25
|
+
const SKIP_DIRS = new Set(["node_modules", ".concrete", ".git", "dist", "build"]);
|
|
26
|
+
|
|
27
|
+
// The media builders, by the name a call reaches them under (`image`, `c.image`).
|
|
28
|
+
const MEDIA_CALL = /(^|\.)(image|video|tour|document|media)$/;
|
|
29
|
+
|
|
30
|
+
// The processes a string named before the builders, and the builder each now is.
|
|
31
|
+
const BUILT = new Set(["cutout"]);
|
|
32
|
+
|
|
33
|
+
async function sourceFiles(root) {
|
|
34
|
+
const found = [];
|
|
35
|
+
async function walk(dir) {
|
|
36
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
37
|
+
if (entry.isDirectory()) {
|
|
38
|
+
if (!SKIP_DIRS.has(entry.name)) await walk(join(dir, entry.name));
|
|
39
|
+
} else if (EXTENSIONS.some((ext) => entry.name.endsWith(ext)) && !entry.name.endsWith(".d.ts")) {
|
|
40
|
+
found.push(join(dir, entry.name));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
await walk(root);
|
|
45
|
+
return found.sort();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function lineOf(sf, pos) {
|
|
49
|
+
return sf.getLineAndCharacterOfPosition(pos).line + 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function nameOf(property) {
|
|
53
|
+
const name = property.name;
|
|
54
|
+
return name !== undefined && (ts.isIdentifier(name) || ts.isStringLiteral(name)) ? name.text : undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function frameworkImports(sf, isFramework) {
|
|
58
|
+
return sf.statements.filter(
|
|
59
|
+
(statement) => ts.isImportDeclaration(statement) && ts.isStringLiteral(statement.moduleSpecifier) && isFramework(statement.moduleSpecifier.text),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Whether the file already binds or reads an identifier `process` (Node's global, a local)
|
|
64
|
+
// — importing the framework's under that name would shadow it.
|
|
65
|
+
function usesProcess(sf) {
|
|
66
|
+
let found = false;
|
|
67
|
+
const visit = (node) => {
|
|
68
|
+
if (found) return;
|
|
69
|
+
if (ts.isIdentifier(node) && node.text === "process") {
|
|
70
|
+
const parent = node.parent;
|
|
71
|
+
const isKey = (ts.isPropertyAssignment(parent) || ts.isPropertySignature(parent) || ts.isPropertyDeclaration(parent)) && parent.name === node;
|
|
72
|
+
const isMember = ts.isPropertyAccessExpression(parent) && parent.name === node;
|
|
73
|
+
if (!isKey && !isMember) found = true;
|
|
74
|
+
}
|
|
75
|
+
ts.forEachChild(node, visit);
|
|
76
|
+
};
|
|
77
|
+
visit(sf);
|
|
78
|
+
return found;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// The edit adding `specifier` to a named import: in alphabetical place when the list is
|
|
82
|
+
// sorted, else last; on its own line when the list breaks one per line.
|
|
83
|
+
function addSpecifier(sf, text, declaration, specifier) {
|
|
84
|
+
const named = declaration.importClause.namedBindings;
|
|
85
|
+
const elements = named.elements;
|
|
86
|
+
const names = elements.map((element) => element.name.text);
|
|
87
|
+
const sorted = names.every((name, index) => index === 0 || names[index - 1].localeCompare(name, "en", { sensitivity: "base" }) <= 0);
|
|
88
|
+
const key = specifier.split(" ")[0];
|
|
89
|
+
let index = sorted ? names.findIndex((name) => name.localeCompare(key, "en", { sensitivity: "base" }) > 0) : -1;
|
|
90
|
+
if (index === -1) index = elements.length;
|
|
91
|
+
const multiline = text.slice(named.getStart(sf), named.getEnd()).includes("\n");
|
|
92
|
+
if (multiline) {
|
|
93
|
+
const anchor = elements[Math.min(index, elements.length - 1)];
|
|
94
|
+
const lineStart = text.lastIndexOf("\n", anchor.getStart(sf) - 1) + 1;
|
|
95
|
+
const indent = text.slice(lineStart, anchor.getStart(sf));
|
|
96
|
+
if (index < elements.length) return { start: lineStart, end: lineStart, insert: `${indent}${specifier},\n` };
|
|
97
|
+
const last = elements[elements.length - 1];
|
|
98
|
+
const hasTrailingComma = elements.hasTrailingComma;
|
|
99
|
+
return hasTrailingComma
|
|
100
|
+
? { start: text.indexOf(",", last.getEnd()) + 1, end: text.indexOf(",", last.getEnd()) + 1, insert: `\n${indent}${specifier},` }
|
|
101
|
+
: { start: last.getEnd(), end: last.getEnd(), insert: `,\n${indent}${specifier}` };
|
|
102
|
+
}
|
|
103
|
+
if (index < elements.length) {
|
|
104
|
+
const at = elements[index].getStart(sf);
|
|
105
|
+
return { start: at, end: at, insert: `${specifier}, ` };
|
|
106
|
+
}
|
|
107
|
+
const end = elements[elements.length - 1].getEnd();
|
|
108
|
+
return { start: end, end, insert: `, ${specifier}` };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Rewrites one file's text; `undefined` when it declares no `process` on a media slot.
|
|
113
|
+
* `isFramework` decides which import specifiers are the framework.
|
|
114
|
+
*/
|
|
115
|
+
export function rewriteSource(fileName, text, isFramework = (specifier) => specifier === CONCRETE) {
|
|
116
|
+
if (!text.includes("process")) return undefined;
|
|
117
|
+
const kind = fileName.endsWith(".tsx") ? ts.ScriptKind.TSX : ts.ScriptKind.TS;
|
|
118
|
+
const sf = ts.createSourceFile(fileName, text, ts.ScriptTarget.Latest, true, kind);
|
|
119
|
+
const imports = frameworkImports(sf, isFramework);
|
|
120
|
+
if (imports.length === 0) return undefined;
|
|
121
|
+
|
|
122
|
+
const namespace = imports.map((statement) => statement.importClause?.namedBindings).find((bindings) => bindings !== undefined && ts.isNamespaceImport(bindings));
|
|
123
|
+
const existing = imports
|
|
124
|
+
.flatMap((statement) => {
|
|
125
|
+
const bindings = statement.importClause?.namedBindings;
|
|
126
|
+
return bindings !== undefined && ts.isNamedImports(bindings) && !statement.importClause.isTypeOnly ? [...bindings.elements] : [];
|
|
127
|
+
})
|
|
128
|
+
.find((element) => (element.propertyName ?? element.name).text === "process" && !element.isTypeOnly);
|
|
129
|
+
const local = existing !== undefined ? existing.name.text : usesProcess(sf) ? "mediaProcess" : "process";
|
|
130
|
+
const callee = namespace !== undefined ? `${namespace.name.text}.process` : local;
|
|
131
|
+
|
|
132
|
+
const edits = [];
|
|
133
|
+
const reasons = [];
|
|
134
|
+
const visit = (node) => {
|
|
135
|
+
if (ts.isObjectLiteralExpression(node) && ts.isCallExpression(node.parent) && node.parent.arguments[0] === node) {
|
|
136
|
+
const media = MEDIA_CALL.exec(node.parent.expression.getText(sf))?.[2];
|
|
137
|
+
if (media !== undefined) {
|
|
138
|
+
for (const property of node.properties) {
|
|
139
|
+
if (!ts.isPropertyAssignment(property) || nameOf(property) !== "process") continue;
|
|
140
|
+
const list = property.initializer;
|
|
141
|
+
if (!ts.isArrayLiteralExpression(list)) {
|
|
142
|
+
reasons.push(
|
|
143
|
+
`line ${String(lineOf(sf, property.getStart(sf)))}: this ${media} slot's \`process\` is not a list written in place — build each entry with its builder (\`process.cutout()\`)`,
|
|
144
|
+
);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
for (const entry of list.elements) {
|
|
148
|
+
if (!ts.isStringLiteralLike(entry)) continue;
|
|
149
|
+
if (!BUILT.has(entry.text)) {
|
|
150
|
+
reasons.push(`line ${String(lineOf(sf, entry.getStart(sf)))}: \`process\` names "${entry.text}", which no builder constructs — remove it`);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
edits.push({ start: entry.getStart(sf), end: entry.getEnd(), insert: `${callee}.${entry.text}()` });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
ts.forEachChild(node, visit);
|
|
159
|
+
};
|
|
160
|
+
visit(sf);
|
|
161
|
+
if (edits.length === 0) return reasons.length > 0 ? { text, changed: false, reasons } : undefined;
|
|
162
|
+
|
|
163
|
+
if (namespace === undefined && existing === undefined) {
|
|
164
|
+
const specifier = local === "process" ? "process" : `process as ${local}`;
|
|
165
|
+
const named = imports.find((statement) => {
|
|
166
|
+
const bindings = statement.importClause?.namedBindings;
|
|
167
|
+
return bindings !== undefined && ts.isNamedImports(bindings) && bindings.elements.length > 0 && !statement.importClause.isTypeOnly;
|
|
168
|
+
});
|
|
169
|
+
if (named !== undefined) {
|
|
170
|
+
edits.push(addSpecifier(sf, text, named, specifier));
|
|
171
|
+
} else {
|
|
172
|
+
const after = imports[imports.length - 1].getEnd();
|
|
173
|
+
edits.push({ start: after, end: after, insert: `\nimport { ${specifier} } from ${imports[0].moduleSpecifier.getText(sf)};` });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
let out = text;
|
|
178
|
+
for (const edit of edits.sort((a, b) => b.start - a.start)) out = out.slice(0, edit.start) + edit.insert + out.slice(edit.end);
|
|
179
|
+
return { text: out, changed: true, reasons };
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** @param {string} root @returns {Promise<{rewritten: string[], notRewritten: {file: string, reason: string}[]}>} */
|
|
183
|
+
export default async function processBuilders(root) {
|
|
184
|
+
const rewritten = [];
|
|
185
|
+
const notRewritten = [];
|
|
186
|
+
for (const file of await sourceFiles(root)) {
|
|
187
|
+
const before = await readFile(file, "utf8");
|
|
188
|
+
const result = rewriteSource(file, before);
|
|
189
|
+
if (result === undefined) continue;
|
|
190
|
+
const rel = relative(root, file).split(sep).join("/");
|
|
191
|
+
if (result.changed) {
|
|
192
|
+
await writeFile(file, result.text, "utf8");
|
|
193
|
+
rewritten.push(rel);
|
|
194
|
+
}
|
|
195
|
+
for (const reason of result.reasons) notRewritten.push({ file: rel, reason });
|
|
196
|
+
}
|
|
197
|
+
return { rewritten, notRewritten };
|
|
198
|
+
}
|