@homepages/concrete 12.0.0 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/README.md +8 -10
  3. package/codemods/fixtures-are-data.mjs +7 -0
  4. package/codemods/fixtures-list-properties.mjs +6 -0
  5. package/codemods/manifest.json +11 -0
  6. package/codemods/steps/fixtures-list-properties.mjs +16 -0
  7. package/codemods/steps/fixtures-to-data.mjs +41 -0
  8. package/dist/artifact/playground/client/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
  9. package/dist/artifact/playground/client/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
  10. package/dist/artifact/playground/client/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
  11. package/dist/artifact/playground/client/assets/index-Bmvcss4B.js +1338 -0
  12. package/dist/artifact/playground/client/assets/index-C01UCAWD.css +1 -0
  13. package/dist/artifact/playground/client/index.html +2 -2
  14. package/dist/artifact/playground/client/island-canvas-host.mjs +1 -1
  15. package/dist/artifact/playground/host.mjs +110 -59
  16. package/dist/base.css +2 -2
  17. package/dist/cli/build/icons.js +1 -1
  18. package/dist/cli/build/index.js +11 -10
  19. package/dist/cli/build/manifest.js +44 -0
  20. package/dist/cli/build/record.js +123 -0
  21. package/dist/cli/build/sections.js +28 -18
  22. package/dist/cli/build/source.js +1 -1
  23. package/dist/cli/build/static.js +8 -5
  24. package/dist/cli/build/template-build.js +614 -0
  25. package/dist/cli/check/analyze.js +18 -1
  26. package/dist/cli/check/load-workspace.js +2 -2
  27. package/dist/cli/check/portable-names.js +1 -1
  28. package/dist/cli/check/render/corpus.js +119 -0
  29. package/dist/cli/check/render/invariants.js +1 -0
  30. package/dist/cli/check/stages/bundles.js +15 -18
  31. package/dist/cli/check/stages/composition.js +8 -25
  32. package/dist/cli/check/stages/fixtures.js +14 -10
  33. package/dist/cli/check/stages/logic.js +7 -23
  34. package/dist/cli/check/stages/render.js +12 -14
  35. package/dist/cli/check/stages/sections.js +22 -66
  36. package/dist/cli/check/stages/stylesheet.js +4 -26
  37. package/dist/cli/check/stages/workspace.js +27 -22
  38. package/dist/cli/commands.js +51 -23
  39. package/dist/cli/currency/preamble.js +1 -1
  40. package/dist/cli/currency/resolve-latest.js +3 -2
  41. package/dist/cli/dev/capture-browser.js +26 -0
  42. package/dist/cli/dev/fixture-schema.js +441 -0
  43. package/dist/cli/dev/folder-files.js +244 -0
  44. package/dist/cli/dev/index.js +7 -3
  45. package/dist/cli/dev/playground-server.js +34 -0
  46. package/dist/cli/dev/section-ladders.js +76 -0
  47. package/dist/cli/dev/server.js +120 -304
  48. package/dist/cli/install/background.js +16 -0
  49. package/dist/cli/install/index.js +45 -0
  50. package/dist/cli/install/tools.js +27 -0
  51. package/dist/cli/media/derive.js +19 -13
  52. package/dist/cli/media/deriver-plugin.js +14 -3
  53. package/dist/cli/property/fixture-list.js +46 -0
  54. package/dist/cli/property/index.js +12 -9
  55. package/dist/cli/property/library.js +12 -10
  56. package/dist/cli/publish/artifact.js +90 -0
  57. package/dist/cli/publish/captures.js +61 -0
  58. package/dist/cli/publish/fixtures.js +17 -0
  59. package/dist/cli/publish/index.js +10 -18
  60. package/dist/cli/{build → publish}/playground.js +3 -3
  61. package/dist/cli/publish/report.js +15 -33
  62. package/dist/cli/upgrade/codemod.d.ts +14 -0
  63. package/dist/cli/upgrade/fixture-conversion.d.ts +11 -0
  64. package/dist/cli/upgrade/fixture-conversion.js +54 -0
  65. package/dist/cli/upgrade/fixture-modules.js +125 -0
  66. package/dist/cli/upgrade/fixtures-to-data.d.ts +40 -0
  67. package/dist/cli/upgrade/fixtures-to-data.js +498 -0
  68. package/dist/cli/upgrade/index.js +18 -2
  69. package/dist/cli/upgrade/legacy-fixtures.d.ts +34 -0
  70. package/dist/cli/upgrade/legacy-fixtures.js +22 -0
  71. package/dist/cli/upgrade/stage.js +1 -1
  72. package/dist/cli/workspace-fixtures.js +80 -0
  73. package/dist/cli.js +1 -0
  74. package/dist/css/compile.js +9 -3
  75. package/dist/fixtures/bundle-rule.js +16 -16
  76. package/dist/fixtures/media-plugin.js +12 -33
  77. package/dist/fixtures/synthesize-empties.js +3 -2
  78. package/dist/index.d.ts +7 -7
  79. package/dist/{playground-island-runtime.d.ts → island-runtime.d.ts} +1 -2
  80. package/dist/{playground-island-runtime.js → island-runtime.js} +1 -2
  81. package/dist/islands/client-module.js +1 -1
  82. package/dist/{cli/dev → islands}/tsconfig-paths.js +2 -14
  83. package/dist/islands/wrap.js +40 -0
  84. package/dist/node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.js +5119 -0
  85. package/dist/packages/external/concrete/package.js +1 -1
  86. package/dist/packages/internal/bundle-evaluation/dist/cache.js +36 -0
  87. package/dist/packages/internal/bundle-evaluation/dist/evaluate.js +174 -0
  88. package/dist/packages/internal/bundle-evaluation/dist/index.js +5 -0
  89. package/dist/packages/internal/bundle-evaluation/dist/section-code.js +10 -0
  90. package/dist/packages/internal/capture-settle/dist/index.js +2 -2
  91. package/dist/packages/internal/capture-settle/dist/settle.js +88 -13
  92. package/dist/packages/internal/code-fingerprint/dist/index.js +57 -0
  93. package/dist/packages/internal/content-doc-ops/dist/index.js +176 -0
  94. package/dist/packages/internal/content-doc-ops/dist/made-rows.js +15 -0
  95. package/dist/packages/internal/deliverable-reads/dist/bootstrap.js +81 -0
  96. package/dist/packages/internal/deliverable-reads/dist/display.js +21 -0
  97. package/dist/packages/internal/deliverable-reads/dist/format.js +15 -0
  98. package/dist/packages/internal/deliverable-reads/dist/index.js +7 -0
  99. package/dist/packages/internal/deliverable-reads/dist/pages.js +29 -0
  100. package/dist/packages/internal/deliverable-reads/dist/requirements.js +72 -0
  101. package/dist/{cli/capture → packages/internal/download-files/dist}/bundle.js +8 -4
  102. package/dist/packages/internal/download-files/dist/capture-origin.js +126 -0
  103. package/dist/packages/internal/download-files/dist/capture-routes.js +139 -0
  104. package/dist/packages/internal/download-files/dist/capture-shell.js +38 -0
  105. package/dist/packages/internal/download-files/dist/capture.js +74 -0
  106. package/dist/packages/internal/download-files/dist/egress-watch.js +38 -0
  107. package/dist/packages/internal/download-files/dist/files.js +7 -0
  108. package/dist/packages/internal/download-files/dist/finish.js +35 -0
  109. package/dist/packages/internal/download-files/dist/fleet.js +94 -0
  110. package/dist/packages/internal/download-files/dist/format.js +40 -0
  111. package/dist/packages/internal/download-files/dist/make.js +105 -0
  112. package/dist/packages/internal/download-files/dist/master-tally.js +32 -0
  113. package/dist/packages/internal/download-files/dist/names.js +24 -0
  114. package/dist/packages/internal/download-files/dist/pdf-boxes.js +33 -0
  115. package/dist/packages/internal/download-files/dist/pdf-image-placements.js +194 -0
  116. package/dist/packages/internal/download-files/dist/pdf-images.js +289 -0
  117. package/dist/packages/internal/file-store/dist/files.js +8 -0
  118. package/dist/packages/internal/file-store/dist/lru.js +40 -0
  119. package/dist/packages/internal/file-store/dist/refusal.js +12 -0
  120. package/dist/packages/internal/file-store/dist/trees.js +151 -0
  121. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +1 -1
  122. package/dist/packages/internal/fill-bake/dist/compute-reads.js +47 -21
  123. package/dist/packages/internal/fill-bake/dist/index.js +5 -1
  124. package/dist/packages/internal/fill-bake/dist/item-merge.js +4 -3
  125. package/dist/packages/internal/fill-bake/dist/resolve-instance.js +9 -0
  126. package/dist/packages/internal/fill-bake/dist/resolve.js +3 -0
  127. package/dist/packages/internal/fill-bake/dist/round-trip.js +2 -0
  128. package/dist/packages/internal/fill-bake/dist/strip.js +6 -0
  129. package/dist/packages/internal/fill-vocabulary/dist/holder.js +1 -1
  130. package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +1 -1
  131. package/dist/packages/internal/fill-vocabulary/dist/verbs.js +1 -1
  132. package/dist/packages/internal/island-runtime/dist/index.js +1 -10
  133. package/dist/packages/internal/island-runtime/dist/use-capture-ready.d.ts +5 -0
  134. package/dist/packages/internal/lead-fields/dist/ingest.js +72 -0
  135. package/dist/packages/internal/media-resolution/dist/video.js +6 -2
  136. package/dist/packages/internal/page-render/dist/addresses.js +57 -0
  137. package/dist/packages/internal/page-render/dist/index.js +6 -0
  138. package/dist/packages/internal/page-render/dist/kept.js +30 -0
  139. package/dist/packages/internal/page-render/dist/nav.js +42 -0
  140. package/dist/packages/internal/page-render/dist/render.js +152 -0
  141. package/dist/packages/internal/page-shell/dist/assemble.js +161 -0
  142. package/dist/packages/internal/page-shell/dist/escape.js +10 -0
  143. package/dist/packages/internal/page-shell/dist/frame.js +23 -0
  144. package/dist/packages/internal/page-shell/dist/index.js +26 -0
  145. package/dist/packages/internal/playground/dist/build-fingerprint.js +18 -0
  146. package/dist/packages/internal/playground/dist/fixture-conversions/list-names-properties.js +76 -0
  147. package/dist/packages/internal/playground/dist/fixture-formats.d.ts +37 -0
  148. package/dist/packages/internal/playground/dist/fixture-formats.js +20 -0
  149. package/dist/packages/internal/playground/dist/host/bootstrap.js +108 -0
  150. package/dist/packages/internal/playground/dist/host/built.js +202 -0
  151. package/dist/packages/internal/playground/dist/host/catalog-fixture.js +53 -0
  152. package/dist/packages/internal/playground/dist/host/download.js +34 -0
  153. package/dist/packages/internal/playground/dist/host/env.js +11 -0
  154. package/dist/packages/internal/playground/dist/host/everywhere-saves.js +353 -0
  155. package/dist/packages/internal/playground/dist/host/fixture-addresses.js +52 -0
  156. package/dist/packages/internal/playground/dist/host/fixture-documents.js +494 -0
  157. package/dist/packages/internal/playground/dist/host/fixture-operations.js +364 -0
  158. package/dist/packages/internal/playground/dist/host/fixture-units.js +93 -0
  159. package/dist/{fixtures → packages/internal/playground/dist/host}/image-dimensions.js +1 -1
  160. package/dist/packages/internal/playground/dist/host/leads.js +41 -0
  161. package/dist/packages/internal/playground/dist/host/media-saves.js +309 -0
  162. package/dist/{fixtures → packages/internal/playground/dist/host}/media-store.js +79 -26
  163. package/dist/packages/internal/playground/dist/host/overridable.js +9 -0
  164. package/dist/packages/internal/playground/dist/host/owned-saves.js +203 -0
  165. package/dist/{playground → packages/internal/playground/dist}/host/page-state.js +1 -1
  166. package/dist/packages/internal/playground/dist/host/program.js +54 -0
  167. package/dist/packages/internal/playground/dist/host/property-derive.js +216 -0
  168. package/dist/packages/internal/playground/dist/host/property-saves.js +74 -0
  169. package/dist/{fixtures → packages/internal/playground/dist/host}/property.js +88 -229
  170. package/dist/packages/internal/playground/dist/host/provenance.js +49 -0
  171. package/dist/packages/internal/playground/dist/host/resolve.js +553 -0
  172. package/dist/packages/internal/playground/dist/host/row-images.js +41 -0
  173. package/dist/{fixtures → packages/internal/playground/dist/host}/rows.js +1 -1
  174. package/dist/packages/internal/playground/dist/host/save.js +429 -0
  175. package/dist/packages/internal/playground/dist/host/serve.js +952 -0
  176. package/dist/packages/internal/playground/dist/host/site.js +79 -0
  177. package/dist/packages/internal/playground/dist/host/slots.js +202 -0
  178. package/dist/packages/internal/playground/dist/host/stated-content.js +93 -0
  179. package/dist/packages/internal/playground/dist/host/stored-fixtures.js +135 -0
  180. package/dist/packages/internal/playground/dist/host/violations.js +7 -0
  181. package/dist/packages/internal/playground/dist/jobs/lanes.js +24 -0
  182. package/dist/packages/internal/playground/dist/jobs/memory-queue.js +112 -0
  183. package/dist/packages/internal/playground/dist/jobs/probe.js +37 -0
  184. package/dist/packages/internal/playground/dist/jobs/queue.js +28 -0
  185. package/dist/packages/internal/playground/dist/jobs/runner.js +207 -0
  186. package/dist/packages/internal/playground/dist/layout.js +14 -0
  187. package/dist/packages/internal/playground/dist/platform.js +33 -0
  188. package/dist/packages/internal/playground/dist/server/changes.js +57 -0
  189. package/dist/packages/internal/playground/dist/server/crop.js +47 -0
  190. package/dist/packages/internal/playground/dist/server/derived-files.js +88 -0
  191. package/dist/packages/internal/playground/dist/server/download.js +158 -0
  192. package/dist/{cli/dev → packages/internal/playground/dist/server}/http.js +4 -12
  193. package/dist/packages/internal/playground/dist/server/jobs.js +29 -0
  194. package/dist/{cli/dev → packages/internal/playground/dist/server}/listen.js +4 -11
  195. package/dist/packages/internal/playground/dist/server/playground-server.js +424 -0
  196. package/dist/{cli/dev → packages/internal/playground/dist/server}/request-error.js +1 -1
  197. package/dist/packages/internal/playground/dist/server/size-ladders.js +170 -0
  198. package/dist/packages/internal/playground/dist/server/verification.js +75 -0
  199. package/dist/packages/internal/playground/dist/server/verify-build.js +139 -0
  200. package/dist/packages/internal/playground/dist/wire.js +78 -0
  201. package/dist/packages/internal/property-facts/dist/registry-facts.js +1 -1
  202. package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +1 -1
  203. package/dist/packages/internal/section-contracts/dist/reads-acyclic-contract.js +1 -1
  204. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +1 -1
  205. package/dist/packages/internal/site-files/dist/head.js +59 -0
  206. package/dist/packages/internal/site-files/dist/index.js +4 -0
  207. package/dist/packages/internal/site-files/dist/site.js +211 -0
  208. package/dist/packages/internal/static-assets-binding/dist/index.js +32 -0
  209. package/dist/packages/internal/static-assets-binding/dist/section-asset-url.js +38 -5
  210. package/dist/packages/internal/template-artifact/dist/asset-mime.js +8 -1
  211. package/dist/packages/internal/template-artifact/dist/build.js +148 -0
  212. package/dist/packages/internal/template-artifact/dist/composition.js +62 -0
  213. package/dist/packages/internal/template-artifact/dist/index.js +2 -2
  214. package/dist/packages/internal/template-artifact/dist/layout.js +48 -12
  215. package/dist/packages/internal/template-artifact/dist/manifest.js +3 -10
  216. package/dist/packages/internal/template-artifact/dist/verify.js +51 -31
  217. package/dist/packages/internal/template-contracts/dist/address-value.js +6 -1
  218. package/dist/packages/internal/template-contracts/dist/content-categories.js +10 -1
  219. package/dist/packages/internal/template-contracts/dist/fact-compute.d.ts +1 -1
  220. package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +1 -1
  221. package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +3 -3
  222. package/dist/packages/internal/template-contracts/dist/fact-registry.js +59 -32
  223. package/dist/packages/internal/template-contracts/dist/fill-spec.js +14 -1
  224. package/dist/packages/internal/template-contracts/dist/list.d.ts +3 -3
  225. package/dist/packages/internal/template-contracts/dist/media-candidates.js +67 -2
  226. package/dist/packages/internal/template-contracts/dist/media-offer.js +180 -0
  227. package/dist/packages/internal/template-contracts/dist/object.d.ts +2 -2
  228. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +9 -2
  229. package/dist/packages/internal/template-contracts/dist/read-graph.js +36 -2
  230. package/dist/packages/internal/template-contracts/dist/ref-locate.js +16 -1
  231. package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +9 -10
  232. package/dist/packages/internal/template-contracts/dist/registry-facts.js +12 -1
  233. package/dist/packages/internal/template-contracts/dist/registry-graph.js +112 -0
  234. package/dist/packages/internal/template-contracts/dist/registry-shape.js +15 -2
  235. package/dist/packages/internal/template-contracts/dist/require-graph.js +300 -0
  236. package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +3 -3
  237. package/dist/packages/internal/template-contracts/dist/row.d.ts +3 -3
  238. package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +1 -1
  239. package/dist/{schema → packages/internal/template-contracts/dist}/section-nav.d.ts +1 -1
  240. package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +4 -4
  241. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +3 -1
  242. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +24 -1
  243. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +26 -1
  244. package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +1 -1
  245. package/dist/packages/internal/template-contracts/dist/slot-types.js +1 -1
  246. package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +1 -1
  247. package/dist/packages/internal/template-contracts/dist/table-members.js +7 -2
  248. package/dist/packages/internal/template-contracts/dist/video-value.d.ts +1 -1
  249. package/dist/packages/internal/upload-formats/dist/heic.js +35 -0
  250. package/dist/packages/internal/upload-formats/dist/index.js +80 -0
  251. package/dist/packages/internal/upload-formats/dist/magic-bytes.js +293 -0
  252. package/dist/platform/paths.js +1 -0
  253. package/dist/platform/process.js +49 -1
  254. package/dist/rules/registry.js +27 -3
  255. package/dist/schema/fact.d.ts +2 -2
  256. package/dist/schema/facts-view.d.ts +1 -1
  257. package/dist/schema/section-props.d.ts +1 -1
  258. package/dist/schema/section-schema.d.ts +1 -1
  259. package/dist/schema/section-schema.js +1 -0
  260. package/dist/section/declare.d.ts +1 -1
  261. package/dist/section/discovery.js +6 -2
  262. package/dist/section/publish-shape.js +38 -0
  263. package/dist/section/section.d.ts +1 -1
  264. package/dist/template/define-template.d.ts +14 -4
  265. package/dist/template/define-template.js +2 -0
  266. package/dist/template/logic-shim.d.ts +1 -1
  267. package/dist/template/materialize.js +1 -1
  268. package/dist/template/running-copy.js +0 -1
  269. package/dist/template/section-reads.js +1 -1
  270. package/guide/reference/cli/INDEX.md +6 -5
  271. package/guide/reference/cli/build.md +10 -8
  272. package/guide/reference/cli/check.md +4 -2
  273. package/guide/reference/cli/dev.md +6 -2
  274. package/guide/reference/cli/install.md +41 -0
  275. package/guide/reference/cli/property-add.md +5 -4
  276. package/guide/reference/cli/property-list.md +2 -2
  277. package/guide/reference/cli/publish.md +5 -5
  278. package/guide/reference/cli/upgrade.md +1 -1
  279. package/guide/reference/rules/INDEX.md +8 -4
  280. package/package.json +14 -30
  281. package/dist/artifact/playground/client/assets/index-BcLGpWLR.js +0 -1266
  282. package/dist/artifact/playground/client/assets/index-CxWPYOH2.css +0 -1
  283. package/dist/cli/build/artifact.js +0 -220
  284. package/dist/cli/build/captures.js +0 -48
  285. package/dist/cli/build/fixtures.js +0 -92
  286. package/dist/cli/capture/capture-browser.js +0 -37
  287. package/dist/cli/capture/capture.js +0 -115
  288. package/dist/cli/check/render/inputs.js +0 -60
  289. package/dist/cli/check/render/nav.js +0 -31
  290. package/dist/cli/dev/crop.js +0 -20
  291. package/dist/cli/dev/fixture-ladders.js +0 -96
  292. package/dist/cli/dev/hmr.js +0 -26
  293. package/dist/cli/dev/islands.js +0 -234
  294. package/dist/cli/dev/load-template.js +0 -52
  295. package/dist/cli/dev/vite.js +0 -114
  296. package/dist/cli/dev/workspace-reader.js +0 -249
  297. package/dist/cli/publish/freshness.js +0 -64
  298. package/dist/fixtures/brand.d.ts +0 -4
  299. package/dist/fixtures/brand.js +0 -8
  300. package/dist/fixtures/load.js +0 -159
  301. package/dist/fixtures/resolve.js +0 -392
  302. package/dist/fixtures.d.ts +0 -429
  303. package/dist/fixtures.js +0 -23
  304. package/dist/packages/internal/canvas-core/dist/island-host.js +0 -62
  305. package/dist/packages/internal/canvas-core/dist/island-shields.js +0 -30
  306. package/dist/playground/canvas-island-host.d.ts +0 -11
  307. package/dist/playground/canvas-island-host.js +0 -29
  308. package/dist/playground/canvas-markers.js +0 -14
  309. package/dist/playground/host/paths.js +0 -8
  310. package/dist/playground/layout.js +0 -17
  311. package/dist/playground/wire.js +0 -28
package/dist/base.css CHANGED
@@ -93,7 +93,7 @@
93
93
  *
94
94
  * `.concrete-frame` spells this file's namespace but is not this file's to name: it
95
95
  * is FRAME_ROOT_CLASS, derived once in `@homepages/format-geometry` and stamped by
96
- * every capture surface — the published page shell, the render worker, the editing
96
+ * every capture surface — the published page shell, the download worker, the editing
97
97
  * canvas and <FrameShell>. This file only styles it, so a change to the spelling
98
98
  * belongs at that derivation point and nowhere else. The private custom properties
99
99
  * and counters below ARE concrete's.
@@ -150,7 +150,7 @@
150
150
  * Silent when the two agree: fully transparent, absolutely positioned (never a flex
151
151
  * item in the rigid stack), so a correctly windowed document renders byte-identical
152
152
  * pixels and identical layout to one with no witness at all. On a mismatch it covers
153
- * the artifact and names both geometries, because a frame measured against the wrong
153
+ * the page and names both geometries, because a frame measured against the wrong
154
154
  * box is not a preview of anything and must not read as one. */
155
155
  .concrete-frame::after {
156
156
  counter-reset:
@@ -29,7 +29,7 @@ async function loadSharp() {
29
29
  try {
30
30
  return (await import("sharp")).default;
31
31
  } catch {
32
- throw new Error("The template's site icons cannot be derived: `sharp` is not installed. It is an optional dependency of @homepages/concrete; reinstall so its native binary lands, then build again.");
32
+ throw new Error("The template's site icons cannot be derived: `sharp` did not load. It is a dependency of @homepages/concrete; reinstall so its native binary lands, then build again.");
33
33
  }
34
34
  }
35
35
  async function deriveSiteIcons(path) {
@@ -1,7 +1,7 @@
1
+ import { qualify } from "../../rules/registry.js";
1
2
  import { DEFAULT_BUILD_DIR, parseSpec, stringFlag } from "../commands.js";
2
3
  import { findWorkspaceRoot } from "../workspace.js";
3
- import { formatHuman } from "../check/report.js";
4
- import { buildArtifact } from "./artifact.js";
4
+ import { buildTemplate } from "./template-build.js";
5
5
  import { resolve } from "node:path";
6
6
  import { parseArgs } from "node:util";
7
7
 
@@ -13,9 +13,9 @@ const runBuild = async (argv, io) => {
13
13
  });
14
14
  const root = await findWorkspaceRoot(io.cwd);
15
15
  const out = resolve(root, stringFlag(values, "out") ?? ".concrete/build");
16
- let outcome;
16
+ let build;
17
17
  try {
18
- outcome = await buildArtifact({
18
+ build = await buildTemplate({
19
19
  root,
20
20
  out
21
21
  });
@@ -23,14 +23,15 @@ const runBuild = async (argv, io) => {
23
23
  io.stderr.write(`concrete build: ${cause instanceof Error ? cause.message : String(cause)}\n`);
24
24
  return 1;
25
25
  }
26
- if (!outcome.ok) {
27
- io.stderr.write(formatHuman(outcome.report));
28
- io.stderr.write("concrete build: check is not green, so no artifact was written.\n");
26
+ if (build.output === null) {
27
+ for (const failure of build.failures) io.stderr.write(`${failure.file}${failure.line === void 0 ? "" : `:${String(failure.line)}`} ${qualify(failure.rule)}\n ${failure.message.replace(/\n/g, "\n ")}\n`);
28
+ io.stderr.write("concrete build: the template did not build, so nothing was written.\n");
29
29
  return 1;
30
30
  }
31
- const { manifest } = outcome;
32
- const count = manifest.sections.length;
33
- io.stdout.write(`concrete build: wrote ${out} — template ${manifest.key} ${manifest.template.content_hash.slice(0, 12)}, ${String(count)} ${count === 1 ? "section" : "sections"}.\n`);
31
+ const { record } = build.output;
32
+ const count = record.sections.length;
33
+ const rebuilt = record.sections.filter((section) => section.rebuilt).length;
34
+ io.stdout.write(`concrete build: wrote ${out} — template ${record.key} ${record.template.content_hash.slice(0, 12)}, ${String(count)} ${count === 1 ? "section" : "sections"}, ${String(rebuilt)} built and ${String(count - rebuilt)} unchanged.\n`);
34
35
  return 0;
35
36
  };
36
37
 
@@ -0,0 +1,44 @@
1
+ import { orgsForScope } from "../../template/define-template.js";
2
+ import { CONCRETE_CLI_VERSION } from "../version.js";
3
+ import { resolveReference } from "../../packages/internal/playground/dist/host/fixture-documents.js";
4
+ import { sourceDigest } from "../../packages/internal/template-artifact/dist/hash.js";
5
+ import { ArtifactManifest } from "../../packages/internal/template-artifact/dist/manifest.js";
6
+ import "../../packages/internal/template-artifact/dist/index.js";
7
+ import { TEMPLATE_FILE } from "../check/load-workspace.js";
8
+ import { collectSourceFiles } from "./source.js";
9
+
10
+ //#region src/cli/build/manifest.ts
11
+ function scopeOf(scope) {
12
+ return scope === "global" ? "global" : { orgs: [...orgsForScope(scope)] };
13
+ }
14
+ function fixtureListOf(template) {
15
+ if (template.fixtures === void 0) return null;
16
+ const list = resolveReference(TEMPLATE_FILE, template.fixtures);
17
+ return "path" in list ? list.path : null;
18
+ }
19
+ async function buildManifest(input) {
20
+ const { template } = input;
21
+ const fields = {
22
+ artifact_schema: 5,
23
+ framework_version: CONCRETE_CLI_VERSION,
24
+ key: template.key,
25
+ display_name: template.name,
26
+ deliverable_type: template.output,
27
+ scope: scopeOf(template.scope),
28
+ source_digest: sourceDigest(await collectSourceFiles(input.root, [input.out])),
29
+ template: { content_hash: input.templateHash },
30
+ sections: [...input.sections].sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0).map((section) => ({
31
+ key: section.key,
32
+ display_name: section.label,
33
+ content_hash: section.contentHash
34
+ }))
35
+ };
36
+ const list = fixtureListOf(template);
37
+ return list === null ? fields : ArtifactManifest.parse({
38
+ ...fields,
39
+ fixture_list: list
40
+ });
41
+ }
42
+
43
+ //#endregion
44
+ export { buildManifest, fixtureListOf };
@@ -0,0 +1,123 @@
1
+ import { RUNNING_FROM_SOURCE, packageRoot } from "../../platform/paths.js";
2
+ import { CONCRETE_CLI_VERSION } from "../version.js";
3
+ import { basename, dirname, join } from "node:path";
4
+ import { readFile, readdir, stat } from "node:fs/promises";
5
+ import { createHash } from "node:crypto";
6
+ import { z } from "zod";
7
+
8
+ //#region src/cli/build/record.ts
9
+ const LEGACY_BUILD_RECORD_FILE = "build.json";
10
+ function buildRecordPath(out) {
11
+ return join(dirname(out), `${basename(out)}.json`);
12
+ }
13
+ const BUILD_RECORD_SCHEMA = 2;
14
+ const IslandRecord = z.object({
15
+ island_key: z.string(),
16
+ filename: z.string(),
17
+ content_hash: z.string(),
18
+ file: z.string(),
19
+ frameless: z.boolean()
20
+ });
21
+ const SourceRecord = z.object({
22
+ file: z.string(),
23
+ bytes: z.number(),
24
+ largestRungBytes: z.number().optional()
25
+ });
26
+ const SectionRecord = z.object({
27
+ key: z.string(),
28
+ content_hash: z.string(),
29
+ rebuilt: z.boolean(),
30
+ identity: z.string(),
31
+ inputs: z.record(z.string(), z.string()),
32
+ islands: z.array(IslandRecord),
33
+ sources: z.array(SourceRecord),
34
+ masters: z.record(z.string(), z.string()),
35
+ passthrough: z.array(z.string()),
36
+ pending: z.array(z.string()),
37
+ files: z.array(z.string())
38
+ });
39
+ const BuildRecord = z.object({
40
+ build_schema: z.literal(2),
41
+ framework_version: z.string(),
42
+ key: z.string(),
43
+ template: z.object({ content_hash: z.string() }),
44
+ sections: z.array(SectionRecord),
45
+ files: z.record(z.string(), z.string())
46
+ });
47
+ async function readBuildRecord(out) {
48
+ let text;
49
+ try {
50
+ text = await readFile(buildRecordPath(out), "utf8");
51
+ } catch (cause) {
52
+ if (cause.code === "ENOENT") return null;
53
+ throw cause;
54
+ }
55
+ try {
56
+ const parsed = BuildRecord.safeParse(JSON.parse(text));
57
+ return parsed.success ? parsed.data : null;
58
+ } catch {
59
+ return null;
60
+ }
61
+ }
62
+ async function stampOf(file) {
63
+ try {
64
+ const stats = await stat(file, { bigint: true });
65
+ return `${String(stats.size)}:${String(stats.mtimeNs)}`;
66
+ } catch (cause) {
67
+ if (cause.code === "ENOENT") return "absent";
68
+ throw cause;
69
+ }
70
+ }
71
+ async function stampInputs(files) {
72
+ const stamps = await Promise.all(files.map(async (file) => [file, await stampOf(file)]));
73
+ return Object.fromEntries(stamps);
74
+ }
75
+ async function inputsUnchanged(inputs) {
76
+ return (await Promise.all(Object.entries(inputs).map(async ([file, recorded]) => await stampOf(file) === recorded))).every(Boolean);
77
+ }
78
+ async function outputsPresent(out, files) {
79
+ return (await Promise.all(files.map(async (path) => await stampOf(join(out, ...path.split("/"))) !== "absent"))).every(Boolean);
80
+ }
81
+ let framework;
82
+ function frameworkFingerprint() {
83
+ framework ??= (async () => {
84
+ const hash = createHash("sha256").update(CONCRETE_CLI_VERSION);
85
+ await stampTree(join(packageRoot(), RUNNING_FROM_SOURCE ? "src" : "dist"), hash);
86
+ return hash.digest("hex");
87
+ })();
88
+ return framework;
89
+ }
90
+ async function stampTree(dir, hash) {
91
+ const visit = async (at) => {
92
+ let entries;
93
+ try {
94
+ entries = await readdir(at, { withFileTypes: true });
95
+ } catch (cause) {
96
+ if (cause.code === "ENOENT") return;
97
+ throw cause;
98
+ }
99
+ entries.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
100
+ for (const entry of entries) {
101
+ if (entry.name === ".concrete" || entry.name === "node_modules") continue;
102
+ const path = join(at, entry.name);
103
+ if (entry.isDirectory()) await visit(path);
104
+ else if (entry.isFile()) hash.update(`${path}\0${await stampOf(path)}\n`);
105
+ }
106
+ };
107
+ await visit(dir);
108
+ }
109
+ function sectionIdentity(parts) {
110
+ return createHash("sha256").update(JSON.stringify([
111
+ parts.framework,
112
+ parts.key,
113
+ parts.module,
114
+ parts.exportName,
115
+ parts.minRungWidth ?? null
116
+ ])).digest("hex");
117
+ }
118
+ function sha256Hex(bytes) {
119
+ return createHash("sha256").update(bytes).digest("hex");
120
+ }
121
+
122
+ //#endregion
123
+ export { BuildRecord, LEGACY_BUILD_RECORD_FILE, buildRecordPath, frameworkFingerprint, inputsUnchanged, outputsPresent, readBuildRecord, sectionIdentity, sha256Hex, stampInputs, stampTree };
@@ -1,20 +1,15 @@
1
1
  import { isWorkspaceFile, toPosix, workspacePath } from "../../platform/paths.js";
2
- import { declaresNoServerFrame, stubClientModule, wrapClientModule } from "../dev/islands.js";
2
+ import { bundledFrameworkPlugin, emittedAssets, javascriptOutput, runPass, workspaceLoaders } from "./esbuild.js";
3
+ import { ISLAND_REACT_EXTERNALS } from "../../packages/internal/static-assets-binding/dist/index.js";
4
+ import { declaresNoServerFrame, stubClientModule, wrapClientModule } from "../../islands/wrap.js";
3
5
  import { mediaCacheDir } from "../media/cache.js";
4
6
  import { createMediaDeriver } from "../media/deriver-plugin.js";
5
- import { bundledFrameworkPlugin, emittedAssets, javascriptOutput, runPass, workspaceLoaders } from "./esbuild.js";
6
7
  import nodePath, { basename, dirname, extname, join } from "node:path";
7
8
  import { readFile } from "node:fs/promises";
8
- import { createHash } from "node:crypto";
9
9
  import { build } from "esbuild";
10
+ import { createHash } from "node:crypto";
10
11
 
11
12
  //#region src/cli/build/sections.ts
12
- const ISLAND_REACT_EXTERNALS = [
13
- "react",
14
- "react-dom",
15
- "react-dom/client",
16
- "react/jsx-runtime"
17
- ];
18
13
  const MARKER_SPECIFIER = "@homepages/concrete";
19
14
  const COMPONENT_EXT = /\.[jt]sx$/;
20
15
  function sanitizeKey(key) {
@@ -132,7 +127,13 @@ async function buildSection(input) {
132
127
  const sources = /* @__PURE__ */ new Map();
133
128
  const masters = /* @__PURE__ */ new Map();
134
129
  const passthrough = /* @__PURE__ */ new Set();
130
+ const pending = /* @__PURE__ */ new Set();
131
+ const inputs = /* @__PURE__ */ new Set();
135
132
  const collect = (deriver, outputFiles, metafile) => {
133
+ for (const input of Object.keys(metafile.inputs)) {
134
+ const file = inputFile(root, input);
135
+ if (file !== null) inputs.add(file);
136
+ }
136
137
  const emitted = emittedAssets(outputFiles);
137
138
  const sourceByEmitted = sourcesOf(metafile);
138
139
  for (const asset of [...emitted, ...derivedAssets(deriver)]) if (!assets.has(asset.filename)) assets.set(asset.filename, asset);
@@ -153,19 +154,19 @@ async function buildSection(input) {
153
154
  }
154
155
  for (const [masterKey, filename] of deriver.masters) masters.set(masterKey, filename);
155
156
  for (const path of deriver.passthrough) passthrough.add(path);
157
+ for (const path of deriver.pending) pending.add(path);
156
158
  };
157
- const rendererDeriver = createMediaDeriver({
159
+ const deriverOptions = {
158
160
  cacheDir,
159
- minRungWidth
160
- });
161
+ minRungWidth,
162
+ ...input.pending === void 0 ? {} : { pending: input.pending }
163
+ };
164
+ const rendererDeriver = createMediaDeriver(deriverOptions);
161
165
  const rendered = await rendererPass(input, rendererDeriver, found, true);
162
166
  collect(rendererDeriver, rendered.outputFiles, rendered.metafile);
163
167
  const islands = [];
164
168
  for (const [islandKey, file] of [...found].sort(([a], [b]) => a < b ? -1 : 1)) {
165
- const deriver = createMediaDeriver({
166
- cacheDir,
167
- minRungWidth
168
- });
169
+ const deriver = createMediaDeriver(deriverOptions);
169
170
  const bytes = await runPass(`The island chunk ${islandKey}`, async () => {
170
171
  const result = await build({
171
172
  entryPoints: [file],
@@ -207,9 +208,18 @@ async function buildSection(input) {
207
208
  assets: [...assets.values()],
208
209
  sources: [...sources.values()].sort((a, b) => a.file < b.file ? -1 : a.file > b.file ? 1 : 0),
209
210
  masters,
210
- passthrough
211
+ passthrough,
212
+ pending,
213
+ inputs: [...inputs].sort()
211
214
  };
212
215
  }
216
+ const NAMESPACED = /^([a-z][a-z-]+):(.+)$/;
217
+ function inputFile(root, input) {
218
+ if (input === "<stdin>") return null;
219
+ const namespaced = NAMESPACED.exec(input);
220
+ const path = namespaced === null ? input : namespaced[2];
221
+ return nodePath.isAbsolute(path) ? path : join(root, path);
222
+ }
213
223
  async function buildFramedRenderer(input) {
214
224
  return (await rendererPass(input, createMediaDeriver({
215
225
  cacheDir: mediaCacheDir(input.root),
@@ -221,4 +231,4 @@ function framedRendererPath(root, key, bytes) {
221
231
  }
222
232
 
223
233
  //#endregion
224
- export { ISLAND_REACT_EXTERNALS, buildFramedRenderer, buildSection, framedRendererPath, isIslandSource, sanitizeKey };
234
+ export { buildFramedRenderer, buildSection, framedRendererPath, isIslandSource, sanitizeKey };
@@ -1,8 +1,8 @@
1
1
  import { toPosix, workspacePath } from "../../platform/paths.js";
2
2
  import { execGit } from "../../platform/process.js";
3
- import { NON_SOURCE_DIRS } from "../workspace.js";
4
3
  import { byCodeUnit } from "../../platform/order.js";
5
4
  import { listDir } from "../../platform/fs.js";
5
+ import { NON_SOURCE_DIRS } from "../workspace.js";
6
6
  import { join, relative } from "node:path";
7
7
  import { readFile } from "node:fs/promises";
8
8
 
@@ -1,15 +1,15 @@
1
1
  import { externalSpecifier, packageFile } from "../../platform/paths.js";
2
+ import { javascriptOutput, runPass } from "./esbuild.js";
3
+ import { ISLAND_REACT_EXTERNALS } from "../../packages/internal/static-assets-binding/dist/index.js";
4
+ import { sanitizeKey } from "./sections.js";
2
5
  import { CAPTURE_ISLANDS_READY_GLOBAL } from "../../packages/internal/capture-settle/dist/settle.js";
3
6
  import "../../packages/internal/capture-settle/dist/index.js";
4
- import { islandRuntimeFile } from "../dev/islands.js";
5
- import { javascriptOutput, runPass } from "./esbuild.js";
6
- import { ISLAND_REACT_EXTERNALS, sanitizeKey } from "./sections.js";
7
7
  import { dirname, join } from "node:path";
8
8
  import { pathToFileURL } from "node:url";
9
9
  import { readFile } from "node:fs/promises";
10
+ import { build } from "esbuild";
10
11
  import { createHash } from "node:crypto";
11
12
  import { createRequire } from "node:module";
12
- import { build } from "esbuild";
13
13
 
14
14
  //#region src/cli/build/static.ts
15
15
  function sha256(bytes) {
@@ -23,6 +23,9 @@ function bundleOf(stem, ext, bytes) {
23
23
  bytes
24
24
  };
25
25
  }
26
+ function islandRuntimeFile() {
27
+ return packageFile("cli/build/island-runtime.ts", "island-runtime.js");
28
+ }
26
29
  async function baseCssBundle() {
27
30
  const bytes = await readFile(packageFile("css/base.css", "base.css"));
28
31
  return bundleOf("base", ".css", new Uint8Array(bytes));
@@ -132,4 +135,4 @@ async function analyticsBundle() {
132
135
  }
133
136
 
134
137
  //#endregion
135
- export { analyticsBundle, baseCssBundle, islandRuntimeBundle, reactVendorBundles };
138
+ export { analyticsBundle, baseCssBundle, islandRuntimeBundle, islandRuntimeFile, reactVendorBundles };