@homepages/concrete 8.0.0 → 9.1.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 +1005 -0
- package/README.md +20 -9
- package/codemods/list-grammar.mjs +923 -0
- package/codemods/manifest.json +64 -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-BOYbgBnP.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/check/stages/workspace.js +2 -0
- package/dist/cli/check/template-key.js +16 -0
- 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 +260 -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 +250 -46
- package/dist/packages/internal/fill-bake/dist/compute-reads.js +361 -4
- package/dist/packages/internal/fill-bake/dist/derive-source.js +25 -18
- package/dist/packages/internal/fill-bake/dist/index.js +9 -3
- package/dist/packages/internal/fill-bake/dist/item-merge.js +113 -0
- package/dist/packages/internal/fill-bake/dist/item-overrides.js +1 -0
- package/dist/packages/internal/fill-bake/dist/linked-merge.js +38 -0
- package/dist/packages/internal/fill-bake/dist/list-grammar.js +174 -0
- package/dist/packages/internal/fill-bake/dist/stored-row-reader.js +1 -0
- package/dist/packages/internal/fill-vocabulary/dist/holder.js +51 -0
- package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +363 -0
- package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +1 -23
- package/dist/packages/internal/fill-vocabulary/dist/verbs.js +60 -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 +226 -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 +37 -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 +245 -0
- package/dist/packages/internal/section-contracts/dist/cap-contract.js +8 -17
- package/dist/packages/internal/section-contracts/dist/catalog.js +34 -14
- 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 +21 -0
- package/dist/packages/internal/section-contracts/dist/fill-options.js +12 -0
- package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +1 -5
- 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 -2
- package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +2 -36
- package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +12 -21
- 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 +9 -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 +6 -17
- package/dist/packages/internal/section-contracts/dist/row-rule-contract.js +80 -0
- package/dist/packages/internal/section-contracts/dist/row-source-contract.js +67 -0
- package/dist/packages/internal/section-contracts/dist/runners.js +77 -18
- package/dist/packages/internal/section-contracts/dist/select-contract.js +0 -8
- package/dist/packages/internal/section-contracts/dist/source-contract.js +89 -95
- 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 +39 -23
- package/dist/packages/internal/source-resolution/dist/index.js +113 -73
- 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 +81 -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 +93 -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 +93 -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 +240 -0
- package/dist/packages/internal/template-contracts/dist/ref-locate.js +176 -0
- package/dist/packages/internal/template-contracts/dist/registry-aliases.js +77 -0
- package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +270 -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 +127 -0
- package/dist/packages/internal/template-contracts/dist/row-ref.js +101 -0
- package/dist/packages/internal/template-contracts/dist/row-sources.js +41 -5
- 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 +233 -405
- package/dist/packages/internal/template-contracts/dist/slot-catalog.js +331 -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 +139 -0
- package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +95 -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 +25 -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 +29 -25
- 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/fill-vocabulary/dist/row-reads.js +0 -15
- 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/group-contract.js +0 -19
- 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/dist/base.css
CHANGED
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* - The section box model (.concrete-section, emitted by the <Section> primitive)
|
|
26
26
|
* - The frame shell's static half (.concrete-frame, emitted by the <FrameShell> primitive)
|
|
27
27
|
* and the window witness that holds every host to the geometry it owes that shell
|
|
28
|
+
* - A folded print's sheet (.concrete-sheet): the panels' frames side by side, the
|
|
29
|
+
* window contract moved up to the sheet
|
|
28
30
|
* - The <Image>/<Video>/<Tour> box's geometry default (.concrete-image-block), layered so
|
|
29
31
|
* an author's own width utility beats it
|
|
30
32
|
* - The <Image>/<Video> frame's placeholder fill (.concrete-image-frame)
|
|
@@ -128,7 +130,32 @@
|
|
|
128
130
|
* extended symmetrically by the bleed. */
|
|
129
131
|
--concrete-frame-window-w: calc(var(--frame-w) + 2 * var(--frame-bleed));
|
|
130
132
|
--concrete-frame-window-h: calc(var(--frame-h) + 2 * var(--frame-bleed));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* A folded print's sheet: `panels` consecutive page frames side by side on one
|
|
136
|
+
* printed sheet side. Like `.concrete-frame`, the class is derived in
|
|
137
|
+
* `@homepages/format-geometry` (SHEET_ROOT_CLASS) and only styled here; only a
|
|
138
|
+
* print document's assembler emits it, so the canvas and every lone frame never
|
|
139
|
+
* see one.
|
|
140
|
+
*
|
|
141
|
+
* The sheet takes over the frame's window contract: in a print document the
|
|
142
|
+
* sheet is the window and the paper, so it fills the window, clips at its edge,
|
|
143
|
+
* and the witness measures the window against the sheet's bleed box — the
|
|
144
|
+
* panels' trim widths side by side, extended by the bleed on the sheet's outer
|
|
145
|
+
* edges only. */
|
|
146
|
+
.concrete-sheet {
|
|
147
|
+
position: relative;
|
|
148
|
+
width: 100vw;
|
|
149
|
+
height: 100vh;
|
|
150
|
+
overflow: clip;
|
|
151
|
+
display: flex;
|
|
152
|
+
|
|
153
|
+
--concrete-frame-window-w: calc(var(--sheet-w) + 2 * var(--frame-bleed));
|
|
154
|
+
--concrete-frame-window-h: calc(var(--sheet-h) + 2 * var(--frame-bleed));
|
|
155
|
+
}
|
|
131
156
|
|
|
157
|
+
.concrete-frame,
|
|
158
|
+
.concrete-sheet {
|
|
132
159
|
/* 1 when the real window misses the owed one on either axis, 0 when it does not.
|
|
133
160
|
* max(d, -d) is an absolute difference and `/ 1px` makes it a plain number. The
|
|
134
161
|
* -1 is the tolerance: a browser window is whole CSS px while a physical format's
|
|
@@ -159,7 +186,8 @@
|
|
|
159
186
|
* pixels and identical layout to one with no witness at all. On a mismatch it covers
|
|
160
187
|
* the artifact and names both geometries, because a frame measured against the wrong
|
|
161
188
|
* box is not a preview of anything and must not read as one. */
|
|
162
|
-
.concrete-frame::after
|
|
189
|
+
.concrete-frame::after,
|
|
190
|
+
.concrete-sheet::after {
|
|
163
191
|
counter-reset:
|
|
164
192
|
concrete-frame-owed-w calc(var(--concrete-frame-window-w) / 1px)
|
|
165
193
|
concrete-frame-owed-h calc(var(--concrete-frame-window-h) / 1px)
|
|
@@ -191,6 +219,35 @@
|
|
|
191
219
|
flex-shrink: 0;
|
|
192
220
|
}
|
|
193
221
|
|
|
222
|
+
/* A page frame inside a sheet is a panel. It is sized from its own tokens — its
|
|
223
|
+
* full bleed box, never the window, which is the sheet's — and laid at panel
|
|
224
|
+
* pitch: each frame overlaps the next by both bleeds, so panel N's trim starts
|
|
225
|
+
* N trim widths in. Nothing crosses a fold: every panel paints to the bleed on
|
|
226
|
+
* all four sides, and the clip keeps only its trim plus its OUTER bleed — the
|
|
227
|
+
* first panel its left, the last its right, every panel its top and bottom.
|
|
228
|
+
* The window witness is the sheet's alone; a panel measuring 100vw against its
|
|
229
|
+
* own box would always cry mismatch. */
|
|
230
|
+
.concrete-sheet > .concrete-frame {
|
|
231
|
+
flex-shrink: 0;
|
|
232
|
+
width: calc(var(--frame-w) + 2 * var(--frame-bleed));
|
|
233
|
+
height: calc(var(--frame-h) + 2 * var(--frame-bleed));
|
|
234
|
+
margin-right: calc(-2 * var(--frame-bleed));
|
|
235
|
+
clip-path: inset(0 var(--frame-bleed));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.concrete-sheet > .concrete-frame:first-child {
|
|
239
|
+
clip-path: inset(0 var(--frame-bleed) 0 0);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.concrete-sheet > .concrete-frame:last-child {
|
|
243
|
+
margin-right: 0;
|
|
244
|
+
clip-path: inset(0 0 0 var(--frame-bleed));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.concrete-sheet > .concrete-frame::after {
|
|
248
|
+
content: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
194
251
|
/* The geometry DEFAULT of every <Image>/<Video>/<Tour> box — the unframed element
|
|
195
252
|
* itself, and the framed wrapper. It is a class here rather than the `block w-full` the
|
|
196
253
|
* primitives used to prepend to the caller's className, because a utility cannot serve
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { stampTableBounds } from "../../packages/internal/template-contracts/dist/slot-catalog.js";
|
|
2
2
|
import { orgsForScope } from "../../template/define-template.js";
|
|
3
3
|
import { qualify } from "../../rules/registry.js";
|
|
4
4
|
import { isInsideRoot } from "../../platform/paths.js";
|
|
@@ -8,11 +8,11 @@ import { sectionContentHash, sourceDigest, templateContentHash } from "../../pac
|
|
|
8
8
|
import { ArtifactManifest } from "../../packages/internal/template-artifact/dist/manifest.js";
|
|
9
9
|
import { verifyArtifact } from "../../packages/internal/template-artifact/dist/verify.js";
|
|
10
10
|
import "../../packages/internal/template-artifact/dist/index.js";
|
|
11
|
+
import { sectionGraphOf } from "../../packages/internal/template-contracts/dist/read-graph.js";
|
|
11
12
|
import { compileTemplateCss } from "../../css/compile.js";
|
|
12
13
|
import { removeTree } from "../../platform/fs.js";
|
|
13
14
|
import { frameRungFloor } from "../media/frame-rung-floor.js";
|
|
14
15
|
import { unportablePaths } from "../../platform/names.js";
|
|
15
|
-
import { usedFactsFromSchema } from "../../schema/extract-used-facts.js";
|
|
16
16
|
import { exportSite } from "../../section/discovery.js";
|
|
17
17
|
import { buildSection } from "./sections.js";
|
|
18
18
|
import { TEMPLATE_FILE } from "../check/load-workspace.js";
|
|
@@ -67,7 +67,6 @@ async function buildArtifact(options) {
|
|
|
67
67
|
const publishedKey = (local) => publishedSectionKey(template.key, local);
|
|
68
68
|
const entryByKey = new Map(sections.map((entry) => [entry.key, entry]));
|
|
69
69
|
const builtByKey = /* @__PURE__ */ new Map();
|
|
70
|
-
const usedByKey = /* @__PURE__ */ new Map();
|
|
71
70
|
for (const [local, section] of byKey(composition.sections)) {
|
|
72
71
|
const key = publishedKey(local);
|
|
73
72
|
if (!isSectionKey(key)) throw new Error(`Section key "${local}" cannot name an artifact directory: a key is one path segment of letters, digits, ".", "_" and "-".`);
|
|
@@ -77,9 +76,8 @@ async function buildArtifact(options) {
|
|
|
77
76
|
if (entry === void 0 || site === void 0 || sectionLogic === void 0) throw new Error(`build: check passed without materializing, discovering or bundling the logic of section "${local}".`);
|
|
78
77
|
const module = join(root, site.module);
|
|
79
78
|
const schema = JSON.parse(JSON.stringify(entry.schema));
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
usedByKey.set(key, usedFacts);
|
|
79
|
+
stampTableBounds(schema.slots);
|
|
80
|
+
const readGraph = sectionGraphOf(schema, entry.fillSpec);
|
|
83
81
|
const built = context.built?.get(local) ?? await buildSection({
|
|
84
82
|
root,
|
|
85
83
|
key,
|
|
@@ -91,7 +89,7 @@ async function buildArtifact(options) {
|
|
|
91
89
|
builtByKey.set(key, built);
|
|
92
90
|
files.set(sectionPath(key, SECTION_FILES.schema), json(schema));
|
|
93
91
|
files.set(sectionPath(key, SECTION_FILES.fillSpec), json(entry.fillSpec));
|
|
94
|
-
files.set(sectionPath(key, SECTION_FILES.
|
|
92
|
+
files.set(sectionPath(key, SECTION_FILES.readGraph), json(readGraph));
|
|
95
93
|
files.set(sectionPath(key, SECTION_FILES.logic), encoder.encode(sectionLogic));
|
|
96
94
|
files.set(sectionPath(key, SECTION_FILES.renderer), built.renderer);
|
|
97
95
|
for (const island of built.islands) files.set(islandPath(key, island.filename), island.bytes);
|
|
@@ -115,7 +113,6 @@ async function buildArtifact(options) {
|
|
|
115
113
|
}))
|
|
116
114
|
};
|
|
117
115
|
files.set(templatePath(TEMPLATE_FILES.composition), json(compositionColumn));
|
|
118
|
-
files.set(templatePath(TEMPLATE_FILES.usedFacts), json([...new Set([...usedByKey.values()].flat())].sort()));
|
|
119
116
|
files.set(templatePath(TEMPLATE_FILES.preview), json(manifest.preview ?? null));
|
|
120
117
|
const css = await compileTemplateCss({
|
|
121
118
|
root,
|
|
@@ -177,7 +174,7 @@ async function buildArtifact(options) {
|
|
|
177
174
|
for (const key of builtByKey.keys()) sectionHashes.set(key, sectionContentHash(files, key));
|
|
178
175
|
const sourceFiles = await collectSourceFiles(root, [out]);
|
|
179
176
|
const artifactManifest = ArtifactManifest.parse({
|
|
180
|
-
artifact_schema:
|
|
177
|
+
artifact_schema: 3,
|
|
181
178
|
framework_version: CONCRETE_CLI_VERSION,
|
|
182
179
|
key: template.key,
|
|
183
180
|
display_name: template.name,
|
|
@@ -2,28 +2,18 @@ import { CAPTURE_FILES, capturePath } from "../../packages/internal/template-art
|
|
|
2
2
|
import "../../packages/internal/template-artifact/dist/index.js";
|
|
3
3
|
import { enabledPages } from "../../playground/host/page-state.js";
|
|
4
4
|
import { ROUTES } from "../../playground/wire.js";
|
|
5
|
+
import { freeDevPort } from "../dev/listen.js";
|
|
5
6
|
import { startDevServer } from "../dev/server.js";
|
|
6
|
-
import { createServer } from "node:net";
|
|
7
7
|
import { Writable } from "node:stream";
|
|
8
8
|
|
|
9
9
|
//#region src/cli/build/captures.ts
|
|
10
|
-
function freePort() {
|
|
11
|
-
return new Promise((resolvePort, reject) => {
|
|
12
|
-
const probe = createServer();
|
|
13
|
-
probe.once("error", reject);
|
|
14
|
-
probe.listen(0, () => {
|
|
15
|
-
const address = probe.address();
|
|
16
|
-
probe.close(() => typeof address === "object" && address !== null ? resolvePort(address.port) : reject(/* @__PURE__ */ new Error("no free port for the capture host")));
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
10
|
const silent = new Writable({ write: (_chunk, _encoding, done) => done() });
|
|
21
11
|
async function captureFiles(options) {
|
|
22
12
|
const files = /* @__PURE__ */ new Map();
|
|
23
13
|
if (options.output === "website") return files;
|
|
24
14
|
const server = await startDevServer({
|
|
25
15
|
root: options.root,
|
|
26
|
-
port: await
|
|
16
|
+
port: await freeDevPort(),
|
|
27
17
|
log: silent,
|
|
28
18
|
...options.capturer === void 0 ? {} : { capturer: options.capturer }
|
|
29
19
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assetContentType } from "../../packages/internal/template-artifact/dist/asset-mime.js";
|
|
1
2
|
import { MEDIA_LOADERS } from "../../fixtures/media-plugin.js";
|
|
2
3
|
import { runningCopyEntries } from "../../template/running-copy.js";
|
|
3
4
|
import { basename, dirname, extname, join } from "node:path";
|
|
@@ -6,31 +7,6 @@ import { readFile } from "node:fs/promises";
|
|
|
6
7
|
//#region src/cli/build/esbuild.ts
|
|
7
8
|
const ASSET_PUBLIC_PATH = "/section-assets";
|
|
8
9
|
const ASSET_NAMES = "[name]-[hash]";
|
|
9
|
-
const CONTENT_TYPES = {
|
|
10
|
-
".svg": "image/svg+xml",
|
|
11
|
-
".png": "image/png",
|
|
12
|
-
".jpg": "image/jpeg",
|
|
13
|
-
".jpeg": "image/jpeg",
|
|
14
|
-
".gif": "image/gif",
|
|
15
|
-
".webp": "image/webp",
|
|
16
|
-
".avif": "image/avif",
|
|
17
|
-
".ico": "image/x-icon",
|
|
18
|
-
".woff": "font/woff",
|
|
19
|
-
".woff2": "font/woff2",
|
|
20
|
-
".ttf": "font/ttf",
|
|
21
|
-
".otf": "font/otf",
|
|
22
|
-
".eot": "application/vnd.ms-fontobject",
|
|
23
|
-
".mp4": "video/mp4",
|
|
24
|
-
".webm": "video/webm",
|
|
25
|
-
".mov": "video/quicktime",
|
|
26
|
-
".mp3": "audio/mpeg",
|
|
27
|
-
".wav": "audio/wav",
|
|
28
|
-
".pdf": "application/pdf",
|
|
29
|
-
".zip": "application/zip"
|
|
30
|
-
};
|
|
31
|
-
function assetContentType(filename) {
|
|
32
|
-
return CONTENT_TYPES[extname(filename).toLowerCase()] ?? "application/octet-stream";
|
|
33
|
-
}
|
|
34
10
|
const MANIFEST_NAMESPACE = "concrete-build-manifest";
|
|
35
11
|
function bundledFrameworkPlugin() {
|
|
36
12
|
const entries = runningCopyEntries();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ASSET_URL_PREFIX, FIXTURE_FILES, fixturePath, isFixtureId } from "../../packages/internal/template-artifact/dist/layout.js";
|
|
2
2
|
import "../../packages/internal/template-artifact/dist/index.js";
|
|
3
|
-
import { assetContentType } from "
|
|
3
|
+
import { assetContentType } from "../../packages/internal/template-artifact/dist/asset-mime.js";
|
|
4
4
|
import { mediaUrl } from "../../fixtures/property.js";
|
|
5
5
|
import { basename } from "node:path";
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
@@ -52,6 +52,7 @@ async function fixtureFiles(input) {
|
|
|
52
52
|
const media = {};
|
|
53
53
|
for (const [id, entry] of fixture.media) {
|
|
54
54
|
const poster = entry.posterFile === void 0 ? null : await artifactFile(entry.posterFile);
|
|
55
|
+
if (poster !== null) for (const [from, to] of poster.urls) urls.set(from, to);
|
|
55
56
|
const withPoster = poster === null ? entry : {
|
|
56
57
|
...entry,
|
|
57
58
|
posterFile: poster.file
|
package/dist/cli/build/icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assetContentType } from "
|
|
1
|
+
import { assetContentType } from "../../packages/internal/template-artifact/dist/asset-mime.js";
|
|
2
2
|
import { extname } from "node:path";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { createHash } from "node:crypto";
|
package/dist/cli/build/static.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CAPTURE_ISLANDS_READY_GLOBAL } from "../../packages/internal/format-geometry/dist/capture.js";
|
|
2
|
-
import "../../packages/internal/format-geometry/dist/index.js";
|
|
3
1
|
import { externalSpecifier, packageFile } from "../../platform/paths.js";
|
|
2
|
+
import { CAPTURE_ISLANDS_READY_GLOBAL } from "../../packages/internal/capture-settle/dist/settle.js";
|
|
3
|
+
import "../../packages/internal/capture-settle/dist/index.js";
|
|
4
4
|
import { islandRuntimeFile } from "../dev/islands.js";
|
|
5
5
|
import { javascriptOutput, runPass } from "./esbuild.js";
|
|
6
6
|
import { ISLAND_REACT_EXTERNALS, sanitizeKey } from "./sections.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../packages/internal/
|
|
1
|
+
import { captureViewport, printPageSize, printViewport } from "../../packages/internal/format-geometry/dist/capture.js";
|
|
2
|
+
import { CAPTURE_WAIT_UNTIL, settleCapture } from "../../packages/internal/capture-settle/dist/settle.js";
|
|
3
|
+
import "../../packages/internal/capture-settle/dist/index.js";
|
|
3
4
|
import { bundlePages } from "./bundle.js";
|
|
4
5
|
import { closeCapturePage, createCaptureBrowserPool } from "./capture-browser.js";
|
|
5
6
|
import { join } from "node:path";
|
|
@@ -47,10 +48,8 @@ function createCapturer(options) {
|
|
|
47
48
|
throw new CaptureUnavailableError(`chromium is not available — run: npx playwright install chromium\n(${err instanceof Error ? err.message : String(err)})`);
|
|
48
49
|
}
|
|
49
50
|
}));
|
|
50
|
-
const withPage = async (
|
|
51
|
-
const
|
|
52
|
-
const viewport = captureViewport(format);
|
|
53
|
-
const page = await browser.newPage({
|
|
51
|
+
const withPage = async (viewport, run) => {
|
|
52
|
+
const page = await (await pool.acquire()).newPage({
|
|
54
53
|
viewport: {
|
|
55
54
|
width: viewport.width,
|
|
56
55
|
height: viewport.height
|
|
@@ -69,8 +68,8 @@ function createCapturer(options) {
|
|
|
69
68
|
return new Uint8Array(await page.screenshot({ fullPage: false }));
|
|
70
69
|
};
|
|
71
70
|
return {
|
|
72
|
-
screenshot: (url, format) => withPage(format, (page) => shoot(page, url)),
|
|
73
|
-
bundle: (entries, format) => withPage(format, async (page) => {
|
|
71
|
+
screenshot: (url, format) => withPage(captureViewport(format), (page) => shoot(page, url)),
|
|
72
|
+
bundle: (entries, format) => withPage(captureViewport(format), async (page) => {
|
|
74
73
|
const members = [];
|
|
75
74
|
for (const entry of entries) members.push({
|
|
76
75
|
name: entry.name,
|
|
@@ -78,7 +77,7 @@ function createCapturer(options) {
|
|
|
78
77
|
});
|
|
79
78
|
return new Uint8Array(bundlePages(members));
|
|
80
79
|
}),
|
|
81
|
-
print: (url, format) => withPage(format, async (page) => {
|
|
80
|
+
print: (url, format) => withPage(printViewport(format), async (page) => {
|
|
82
81
|
await page.emulateMedia({ media: "screen" });
|
|
83
82
|
await page.goto(url, { waitUntil: CAPTURE_WAIT_UNTIL });
|
|
84
83
|
await settleCapture(settleHost(page));
|
|
@@ -55,7 +55,13 @@ async function analyzeWorkspace(options) {
|
|
|
55
55
|
for (const violation of outcome.violations) {
|
|
56
56
|
const rule = ruleById(violation.rule);
|
|
57
57
|
if (rule.stage !== id) throw new Error(`check: the ${id} stage reported ${violation.rule}, which the rule registry places in the ${rule.stage} stage.`);
|
|
58
|
+
if (rule.severity === "warn") throw new Error(`check: the ${id} stage reported the warning ${violation.rule} as a violation — a warning is a hint.`);
|
|
58
59
|
}
|
|
60
|
+
for (const hint of outcome.hints ?? []) {
|
|
61
|
+
const rule = ruleById(hint.rule);
|
|
62
|
+
if (rule.stage !== id || rule.severity !== "warn") throw new Error(`check: the ${id} stage reported ${hint.rule} as a hint, which the rule registry does not list as a ${id} warning.`);
|
|
63
|
+
}
|
|
64
|
+
const hints = (outcome.hints ?? []).map(reportViolation);
|
|
59
65
|
const unmeasured = (outcome.unmeasured ?? []).map((u) => ({
|
|
60
66
|
rule: reportViolation({
|
|
61
67
|
rule: u.rule,
|
|
@@ -74,7 +80,8 @@ async function analyzeWorkspace(options) {
|
|
|
74
80
|
id,
|
|
75
81
|
status: outcome.violations.length === 0 ? "passed" : "failed",
|
|
76
82
|
violations: outcome.violations.map(reportViolation),
|
|
77
|
-
...unmeasured.length === 0 ? {} : { unmeasured }
|
|
83
|
+
...unmeasured.length === 0 ? {} : { unmeasured },
|
|
84
|
+
...hints.length === 0 ? {} : { hints }
|
|
78
85
|
});
|
|
79
86
|
}
|
|
80
87
|
return {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { listDir, removeTree, removeTreeSync } from "../../platform/fs.js";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { mkdir, mkdtemp } from "node:fs/promises";
|
|
4
|
+
import { hostname } from "node:os";
|
|
5
|
+
|
|
6
|
+
//#region src/cli/check/load-outdir.ts
|
|
7
|
+
const OWNED = /^(\d+)-/;
|
|
8
|
+
const claimed = /* @__PURE__ */ new Set();
|
|
9
|
+
let removesOnExit = false;
|
|
10
|
+
function loadOutdirParent(root) {
|
|
11
|
+
return join(root, ".concrete", "cache", "check", "loads", hostname().replace(/[^A-Za-z0-9.-]/g, "_"));
|
|
12
|
+
}
|
|
13
|
+
async function claimLoadOutdir(root) {
|
|
14
|
+
const parent = loadOutdirParent(root);
|
|
15
|
+
await mkdir(parent, { recursive: true });
|
|
16
|
+
await sweepOrphans(parent);
|
|
17
|
+
const dir = await mkdtemp(join(parent, `${String(process.pid)}-`));
|
|
18
|
+
claimed.add(dir);
|
|
19
|
+
if (!removesOnExit) {
|
|
20
|
+
process.once("exit", () => {
|
|
21
|
+
for (const path of claimed) try {
|
|
22
|
+
removeTreeSync(path);
|
|
23
|
+
} catch {}
|
|
24
|
+
});
|
|
25
|
+
removesOnExit = true;
|
|
26
|
+
}
|
|
27
|
+
return dir;
|
|
28
|
+
}
|
|
29
|
+
function isAlive(pid) {
|
|
30
|
+
try {
|
|
31
|
+
process.kill(pid, 0);
|
|
32
|
+
return true;
|
|
33
|
+
} catch (err) {
|
|
34
|
+
return err.code === "EPERM";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function sweepOrphans(parent) {
|
|
38
|
+
for (const entry of await listDir(parent)) {
|
|
39
|
+
const owner = OWNED.exec(entry.name)?.[1];
|
|
40
|
+
if (owner === void 0) continue;
|
|
41
|
+
const pid = Number(owner);
|
|
42
|
+
if (pid !== process.pid && !isAlive(pid)) await removeTree(entry.path);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { claimLoadOutdir, loadOutdirParent };
|
|
@@ -4,6 +4,7 @@ import { listModules } from "../../section/discovery.js";
|
|
|
4
4
|
import { MEDIA_LOADERS, createFixtureMediaPlugin, externalOutsideWorkspace } from "../../fixtures/media-plugin.js";
|
|
5
5
|
import { runningCopyPlugin } from "../../template/running-copy.js";
|
|
6
6
|
import { createPackageStylesheetsPlugin } from "../../fixtures/package-stylesheets.js";
|
|
7
|
+
import { claimLoadOutdir } from "./load-outdir.js";
|
|
7
8
|
import { existsSync } from "node:fs";
|
|
8
9
|
import { join } from "node:path";
|
|
9
10
|
import { pathToFileURL } from "node:url";
|
|
@@ -15,7 +16,6 @@ function buildMessages(err) {
|
|
|
15
16
|
const messages = err.errors;
|
|
16
17
|
return Array.isArray(messages) ? messages : null;
|
|
17
18
|
}
|
|
18
|
-
let importSerial = 0;
|
|
19
19
|
async function loadWorkspace(root) {
|
|
20
20
|
const templateFile = join(root, TEMPLATE_FILE);
|
|
21
21
|
if (!existsSync(templateFile)) return {
|
|
@@ -32,6 +32,7 @@ async function loadWorkspace(root) {
|
|
|
32
32
|
const files = listModules(root);
|
|
33
33
|
const media = createFixtureMediaPlugin(root);
|
|
34
34
|
const stylesheets = await createPackageStylesheetsPlugin(root);
|
|
35
|
+
const outdir = await claimLoadOutdir(root);
|
|
35
36
|
let result;
|
|
36
37
|
try {
|
|
37
38
|
result = await build({
|
|
@@ -41,7 +42,7 @@ async function loadWorkspace(root) {
|
|
|
41
42
|
format: "esm",
|
|
42
43
|
platform: "node",
|
|
43
44
|
target: "node22",
|
|
44
|
-
outdir
|
|
45
|
+
outdir,
|
|
45
46
|
outbase: root,
|
|
46
47
|
absWorkingDir: root,
|
|
47
48
|
packages: "external",
|
|
@@ -87,9 +88,8 @@ async function loadWorkspace(root) {
|
|
|
87
88
|
for (const file of files) {
|
|
88
89
|
const out = outputByInput.get(file);
|
|
89
90
|
if (out === void 0) throw new Error(`check: esbuild produced no output for ${workspacePath(root, file)}.`);
|
|
90
|
-
const url = `${pathToFileURL(out).href}?load=${String(Date.now())}-${String(importSerial++)}`;
|
|
91
91
|
try {
|
|
92
|
-
modules.set(file, await import(
|
|
92
|
+
modules.set(file, await import(pathToFileURL(out).href));
|
|
93
93
|
} catch (cause) {
|
|
94
94
|
violations.push({
|
|
95
95
|
rule: "workspace/module-invalid",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ATTR_SECTION_INSTANCE_ID, ATTR_SLOT_FIELD,
|
|
1
|
+
import { ATTR_SECTION_INSTANCE_ID, ATTR_SLOT_FIELD, ATTR_SLOT_ID, ATTR_SLOT_ITEM, ATTR_SLOT_TEXT_LEAF, ATTR_SLOT_UNSELECTABLE, ATTR_TR_ENHANCE } from "../../../packages/internal/template-contracts/dist/markers.js";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/check/render/html.ts
|
|
4
4
|
const VOID_TAGS = /* @__PURE__ */ new Set([
|
|
@@ -65,7 +65,6 @@ function parseHtml(html) {
|
|
|
65
65
|
children: []
|
|
66
66
|
};
|
|
67
67
|
if (attrs["data-slot-id"]) node.slotId = attrs[ATTR_SLOT_ID];
|
|
68
|
-
if (attrs["data-slot-group"]) node.slotGroup = attrs[ATTR_SLOT_GROUP];
|
|
69
68
|
if (attrs["data-slot-field"]) node.slotField = attrs[ATTR_SLOT_FIELD];
|
|
70
69
|
if ("data-slot-item" in attrs) {
|
|
71
70
|
const idx = Number(attrs[ATTR_SLOT_ITEM]);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fixtureAssetRecords, fixtureMediaStore, resolveFixtureSlots } from "../../../fixtures/media-store.js";
|
|
2
2
|
import { resolveNav } from "./nav.js";
|
|
3
3
|
|
|
4
4
|
//#region src/cli/check/render/inputs.ts
|
|
5
|
-
function* renderInputs(composition, sections, corpus) {
|
|
5
|
+
async function* renderInputs(composition, sections, corpus, assets) {
|
|
6
6
|
const byKey = new Map(sections.map((entry) => [entry.key, entry]));
|
|
7
7
|
const { manifest } = composition;
|
|
8
8
|
for (const entry of corpus) {
|
|
9
9
|
const { fixture } = entry;
|
|
10
|
+
const store = fixtureMediaStore(fixture.media);
|
|
11
|
+
const records = fixtureAssetRecords(fixture.facts, fixture.media, (path) => assets?.get(path)?.bytes);
|
|
10
12
|
const enabled = (instanceId) => fixture.contentDoc.instances.find((i) => i.instance_id === instanceId)?.enabled === true;
|
|
11
13
|
const navPages = manifest.pages.map((page) => ({
|
|
12
14
|
id: page.id,
|
|
@@ -34,7 +36,12 @@ function* renderInputs(composition, sections, corpus) {
|
|
|
34
36
|
instanceId: placed.instance_id,
|
|
35
37
|
entry: section,
|
|
36
38
|
props: {
|
|
37
|
-
slots:
|
|
39
|
+
slots: await resolveFixtureSlots({
|
|
40
|
+
slots: instance.slots,
|
|
41
|
+
declared: section.section.schema.slots,
|
|
42
|
+
assets: records,
|
|
43
|
+
store
|
|
44
|
+
}),
|
|
38
45
|
nav: {
|
|
39
46
|
selfAnchor: section.schema.anchor,
|
|
40
47
|
anchors,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ATTR_ISLAND_KEY
|
|
1
|
+
import { ATTR_ISLAND_KEY } from "../../../packages/internal/capture-settle/dist/island-markers.js";
|
|
2
|
+
import { ISLAND_ELEMENT } from "../../../packages/internal/island-runtime/dist/contract.js";
|
|
2
3
|
|
|
3
4
|
//#region src/cli/check/render/island-frames.ts
|
|
4
5
|
const CONTENT_ELEMENTS = /* @__PURE__ */ new Set([
|
|
@@ -10,10 +10,12 @@ function collectMarkerCoverage(root) {
|
|
|
10
10
|
selectableSlotIds: /* @__PURE__ */ new Set(),
|
|
11
11
|
itemScopesBySlot: /* @__PURE__ */ new Map(),
|
|
12
12
|
rowFieldsBySlot: /* @__PURE__ */ new Map(),
|
|
13
|
-
|
|
13
|
+
objectFieldsBySlot: /* @__PURE__ */ new Map(),
|
|
14
|
+
fieldPlacements: []
|
|
14
15
|
};
|
|
15
|
-
const walk = (node, parentScope, parentItemSlot
|
|
16
|
-
const
|
|
16
|
+
const walk = (node, parentScope, parentItemSlot) => {
|
|
17
|
+
const repeatsField = node.slotId === void 0 && node.slotField !== void 0 && parentScope?.slotId === void 0 && parentScope?.fieldName === node.slotField;
|
|
18
|
+
const opensScope = !repeatsField && (node.slotId !== void 0 || node.slotField !== void 0);
|
|
17
19
|
let scope = parentScope;
|
|
18
20
|
if (opensScope) {
|
|
19
21
|
scope = {
|
|
@@ -30,18 +32,24 @@ function collectMarkerCoverage(root) {
|
|
|
30
32
|
push(coverage.itemScopesBySlot, node.slotId, scope.items);
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
const groups = node.slotGroup ? /* @__PURE__ */ new Set([...parentGroups, node.slotGroup]) : parentGroups;
|
|
34
35
|
if (node.slotId !== void 0) {
|
|
35
36
|
coverage.slotIds.add(node.slotId);
|
|
36
|
-
if (node.unselectable !== true)
|
|
37
|
-
coverage.selectableSlotIds.add(node.slotId);
|
|
38
|
-
push(coverage.enclosingGroupsBySlot, node.slotId, new Set(groups));
|
|
39
|
-
}
|
|
37
|
+
if (node.unselectable !== true) coverage.selectableSlotIds.add(node.slotId);
|
|
40
38
|
}
|
|
41
|
-
if (node.slotField !== void 0 &&
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
coverage.
|
|
39
|
+
if (node.slotField !== void 0 && node.unselectable !== true && !repeatsField) {
|
|
40
|
+
const owner = parentScope?.slotId;
|
|
41
|
+
const inItem = owner !== void 0 && parentItemSlot === owner;
|
|
42
|
+
coverage.fieldPlacements.push({
|
|
43
|
+
field: node.slotField,
|
|
44
|
+
owner,
|
|
45
|
+
inItem
|
|
46
|
+
});
|
|
47
|
+
if (owner !== void 0) {
|
|
48
|
+
const bySlot = inItem ? coverage.rowFieldsBySlot : coverage.objectFieldsBySlot;
|
|
49
|
+
const seen = bySlot.get(owner) ?? /* @__PURE__ */ new Set();
|
|
50
|
+
seen.add(node.slotField);
|
|
51
|
+
bySlot.set(owner, seen);
|
|
52
|
+
}
|
|
45
53
|
}
|
|
46
54
|
let itemSlot = parentItemSlot;
|
|
47
55
|
if (node.slotItem !== void 0 && scope !== void 0) {
|
|
@@ -51,9 +59,9 @@ function collectMarkerCoverage(root) {
|
|
|
51
59
|
}
|
|
52
60
|
itemSlot = scope.slotId;
|
|
53
61
|
}
|
|
54
|
-
for (const child of node.children) walk(child, scope, itemSlot
|
|
62
|
+
for (const child of node.children) walk(child, scope, itemSlot);
|
|
55
63
|
};
|
|
56
|
-
walk(root, void 0, void 0
|
|
64
|
+
walk(root, void 0, void 0);
|
|
57
65
|
return coverage;
|
|
58
66
|
}
|
|
59
67
|
function checkItemIndices(rowCount, scopes) {
|
|
@@ -71,7 +79,7 @@ function checkItemIndices(rowCount, scopes) {
|
|
|
71
79
|
if (scope.unselectable || scope.ownItem) continue;
|
|
72
80
|
const withinScope = new Set(scope.selectableIndices);
|
|
73
81
|
const missingHere = rowRange.filter((index) => !withinScope.has(index) && selectable.has(index));
|
|
74
|
-
if (missingHere.length > 0) problems.push(`a rendered copy of the
|
|
82
|
+
if (missingHere.length > 0) problems.push(`a rendered copy of the list marks ${withinScope.size} of its ${rowCount} rows (missing data-slot-item ${missingHere.join(", ")}) — the editor targets every copy, so each one must mark every row, or opt out of selection entirely`);
|
|
75
83
|
}
|
|
76
84
|
const stray = [...all].filter((index) => index < 0 || index >= rowCount).sort((a, b) => a - b);
|
|
77
85
|
if (stray.length > 0) problems.push(`data-slot-item ${stray.join(", ")} ${stray.length === 1 ? "is" : "are"} outside the ${rowCount} row${rowCount === 1 ? "" : "s"} this fixture renders — the index must be the array position`);
|
package/dist/cli/check/report.js
CHANGED
|
@@ -27,6 +27,11 @@ function formatHuman(report) {
|
|
|
27
27
|
lines.push(` ${at} ${v.rule}`);
|
|
28
28
|
for (const text of v.message.split("\n")) lines.push(` ${text}`);
|
|
29
29
|
}
|
|
30
|
+
for (const h of stage.hints ?? []) {
|
|
31
|
+
const at = h.line === void 0 ? h.file : `${h.file}:${String(h.line)}`;
|
|
32
|
+
lines.push(` hint: ${at} ${h.rule}`);
|
|
33
|
+
for (const text of h.message.split("\n")) lines.push(` ${text}`);
|
|
34
|
+
}
|
|
30
35
|
if (stage.id === "bundles") lines.push(...formatWeights(report.weights));
|
|
31
36
|
for (const u of stage.unmeasured ?? []) {
|
|
32
37
|
lines.push(` not measured: ${u.gates.join(", ")}. ${u.reason}`);
|
|
@@ -100,7 +100,7 @@ async function gradeServerFrames(ctx, input, entry, section, composition, sectio
|
|
|
100
100
|
await writeFile(path, bytes);
|
|
101
101
|
const Component = (await import(pathToFileURL(path).href)).default;
|
|
102
102
|
const proven = /* @__PURE__ */ new Map();
|
|
103
|
-
for (const render of renderInputs(composition, sections, corpus)) {
|
|
103
|
+
for await (const render of renderInputs(composition, sections, corpus, ctx.assets)) {
|
|
104
104
|
if (render.entry.key !== entry.key) continue;
|
|
105
105
|
let html;
|
|
106
106
|
try {
|
|
@@ -37,7 +37,7 @@ function relationsStage(ctx) {
|
|
|
37
37
|
for (const mismatch of mirrorMismatches(composition.sections)) violations.push({
|
|
38
38
|
rule: "relations/mirror-type",
|
|
39
39
|
file: TEMPLATE_FILE,
|
|
40
|
-
message: `Section "${mismatch.section}"'s \`${mismatch.slot}\` mirrors "${mismatch.upstream.section}".${mismatch.upstream.slot}, but holds ${mismatch.mirrorKind} where its upstream holds ${mismatch.upstreamKind}. A mirror IS its upstream's value — declare the mirror at the upstream's kind, or derive the value with a \`compute()\`.`
|
|
40
|
+
message: `Section "${mismatch.section}"'s \`${mismatch.slot}\` mirrors "${mismatch.upstream.section}".${mismatch.upstream.slot}, but holds ${mismatch.mirrorKind} where its upstream holds ${mismatch.upstreamKind}. A mirror IS its upstream's value — declare the mirror at the upstream's kind (a row \`from\` the upstream row's table, a list of its element), or derive the value with a \`compute()\`.`
|
|
41
41
|
});
|
|
42
42
|
return Promise.resolve({ violations });
|
|
43
43
|
}
|