@homepages/concrete 1.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 +59 -0
- package/README.md +174 -0
- package/codemods/manifest.json +9 -0
- package/dist/artifact/playground/client/assets/index-BSA1yutg.css +1 -0
- package/dist/artifact/playground/client/assets/index-JloQyj8h.js +1101 -0
- package/dist/artifact/playground/client/index.html +13 -0
- package/dist/artifact/playground/client/island-canvas-host.mjs +1 -0
- package/dist/artifact/playground/host.mjs +127 -0
- package/dist/asset-modules.d.ts +99 -0
- package/dist/base.css +220 -0
- package/dist/browser/site-config.d.ts +18 -0
- package/dist/browser/site-config.js +56 -0
- package/dist/browser/submit-lead.d.ts +98 -0
- package/dist/browser/submit-lead.js +188 -0
- package/dist/browser.d.ts +3 -0
- package/dist/browser.js +4 -0
- package/dist/cli/build/artifact.js +225 -0
- package/dist/cli/build/captures.js +67 -0
- package/dist/cli/build/esbuild.js +127 -0
- package/dist/cli/build/fixtures.js +96 -0
- package/dist/cli/build/icons.js +76 -0
- package/dist/cli/build/index.js +38 -0
- package/dist/cli/build/playground.js +31 -0
- package/dist/cli/build/sections.js +236 -0
- package/dist/cli/build/source.js +62 -0
- package/dist/cli/build/static.js +156 -0
- package/dist/cli/capture/bundle.js +37 -0
- package/dist/cli/capture/capture-browser.js +51 -0
- package/dist/cli/capture/capture.js +121 -0
- package/dist/cli/check/analyze.js +95 -0
- package/dist/cli/check/index.js +19 -0
- package/dist/cli/check/load-workspace.js +119 -0
- package/dist/cli/check/messages.js +16 -0
- package/dist/cli/check/render/class-conflicts.js +39 -0
- package/dist/cli/check/render/html.js +86 -0
- package/dist/cli/check/render/inputs.js +53 -0
- package/dist/cli/check/render/invariants.js +58 -0
- package/dist/cli/check/render/island-frames.js +72 -0
- package/dist/cli/check/render/marker-coverage.js +102 -0
- package/dist/cli/check/render/nav.js +64 -0
- package/dist/cli/check/report.js +73 -0
- package/dist/cli/check/stages/bundles.js +129 -0
- package/dist/cli/check/stages/composition.js +67 -0
- package/dist/cli/check/stages/contracts.js +22 -0
- package/dist/cli/check/stages/dependencies.js +261 -0
- package/dist/cli/check/stages/fixtures.js +74 -0
- package/dist/cli/check/stages/lint.js +41 -0
- package/dist/cli/check/stages/logic.js +63 -0
- package/dist/cli/check/stages/render.js +144 -0
- package/dist/cli/check/stages/sections.js +83 -0
- package/dist/cli/check/stages/stylesheet.js +31 -0
- package/dist/cli/check/stages/typecheck.js +68 -0
- package/dist/cli/check/stages/workspace.js +26 -0
- package/dist/cli/commands.js +342 -0
- package/dist/cli/currency/cache.js +89 -0
- package/dist/cli/currency/decide.js +65 -0
- package/dist/cli/currency/opt-out.js +16 -0
- package/dist/cli/currency/preamble.js +183 -0
- package/dist/cli/currency/prompt.js +28 -0
- package/dist/cli/currency/refresh.js +44 -0
- package/dist/cli/currency/resolve-latest.js +185 -0
- package/dist/cli/currency/version-order.js +38 -0
- package/dist/cli/dev/crop.js +22 -0
- package/dist/cli/dev/hmr.js +26 -0
- package/dist/cli/dev/http.js +129 -0
- package/dist/cli/dev/index.js +70 -0
- package/dist/cli/dev/islands.js +390 -0
- package/dist/cli/dev/load-template.js +46 -0
- package/dist/cli/dev/request-error.js +22 -0
- package/dist/cli/dev/server.js +307 -0
- package/dist/cli/dev/tsconfig-paths.js +95 -0
- package/dist/cli/dev/vite.js +85 -0
- package/dist/cli/dev/workspace-reader.js +274 -0
- package/dist/cli/io.d.ts +14 -0
- package/dist/cli/media/cache.js +125 -0
- package/dist/cli/media/derive.js +252 -0
- package/dist/cli/media/deriver-plugin.js +71 -0
- package/dist/cli/property/index.js +180 -0
- package/dist/cli/property/library.js +137 -0
- package/dist/cli/publish/client.js +119 -0
- package/dist/cli/publish/freshness.js +66 -0
- package/dist/cli/publish/git.js +43 -0
- package/dist/cli/publish/index.js +207 -0
- package/dist/cli/publish/pack.js +78 -0
- package/dist/cli/publish/report.js +98 -0
- package/dist/cli/publish/target.js +87 -0
- package/dist/cli/publish/wire.js +29 -0
- package/dist/cli/tar.js +87 -0
- package/dist/cli/upgrade/codemod.js +56 -0
- package/dist/cli/upgrade/index.js +263 -0
- package/dist/cli/upgrade/manifest.js +72 -0
- package/dist/cli/upgrade/plan.js +68 -0
- package/dist/cli/upgrade/stage.js +71 -0
- package/dist/cli/version.d.ts +12 -0
- package/dist/cli/version.js +15 -0
- package/dist/cli/workspace.js +108 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +94 -0
- package/dist/css/compile.js +77 -0
- package/dist/css/graph.js +109 -0
- package/dist/css/inline.js +132 -0
- package/dist/css/rules.js +65 -0
- package/dist/design-system/format-variants.js +127 -0
- package/dist/eslint/authoring.js +46 -0
- package/dist/eslint/correctness.js +42 -0
- package/dist/eslint/rules/editor-declaration.js +103 -0
- package/dist/eslint/rules/editor-reason.js +135 -0
- package/dist/eslint/rules/island-imports.js +20 -0
- package/dist/eslint/rules/jsx-visitor.js +20 -0
- package/dist/eslint/rules/no-client-runtime.js +88 -0
- package/dist/eslint/rules/no-editor-globals.js +60 -0
- package/dist/eslint/rules/no-hard-coded-color.js +183 -0
- package/dist/eslint/rules/no-inline-style.js +24 -0
- package/dist/eslint/rules/no-marker-literal.js +37 -0
- package/dist/eslint/rules/no-nondeterminism.js +44 -0
- package/dist/eslint/rules/no-px-breakpoint.js +44 -0
- package/dist/eslint/rules/no-raw-values.js +45 -0
- package/dist/eslint/rules/serializable-props.js +95 -0
- package/dist/eslint.d.ts +6 -0
- package/dist/eslint.js +26 -0
- package/dist/fixtures/brand.d.ts +4 -0
- package/dist/fixtures/brand.js +9 -0
- package/dist/fixtures/bundle-rule.js +67 -0
- package/dist/fixtures/canonical.d.ts +149 -0
- package/dist/fixtures/image-dimensions.js +59 -0
- package/dist/fixtures/load.js +154 -0
- package/dist/fixtures/media-plugin.js +141 -0
- package/dist/fixtures/media.js +165 -0
- package/dist/fixtures/property.js +210 -0
- package/dist/fixtures/resolve.js +202 -0
- package/dist/fixtures/rows.js +108 -0
- package/dist/fixtures/synthesize-empties.js +42 -0
- package/dist/fixtures.d.ts +213 -0
- package/dist/fixtures.js +37 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +37 -0
- package/dist/islands/client-module.js +97 -0
- package/dist/islands/marker.d.ts +43 -0
- package/dist/islands/marker.js +44 -0
- package/dist/node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/browser.js +687 -0
- package/dist/packages/external/concrete/package.js +5 -0
- package/dist/packages/internal/fact-interpolation/dist/index.js +22 -0
- package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +111 -0
- package/dist/packages/internal/fill-bake/dist/display.js +9 -0
- package/dist/packages/internal/fill-bake/dist/index.js +6 -0
- package/dist/packages/internal/fill-bake/dist/reconcile-cross-section.js +170 -0
- package/dist/packages/internal/fill-vocabulary/dist/facts.d.ts +32 -0
- package/dist/packages/internal/fill-vocabulary/dist/facts.js +131 -0
- package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +73 -0
- package/dist/packages/internal/format-geometry/dist/capture.js +404 -0
- package/dist/packages/internal/format-geometry/dist/format.d.ts +41 -0
- package/dist/packages/internal/format-geometry/dist/geometry.js +58 -0
- package/dist/packages/internal/format-geometry/dist/index.js +4 -0
- package/dist/packages/internal/image-descriptor/dist/index.d.ts +35 -0
- package/dist/packages/internal/image-ladder/dist/crop.js +82 -0
- package/dist/packages/internal/image-ladder/dist/encode.js +23 -0
- package/dist/packages/internal/image-ladder/dist/index.js +4 -0
- package/dist/packages/internal/image-ladder/dist/policy.js +102 -0
- package/dist/packages/internal/island-runtime/dist/capture-holds.d.ts +13 -0
- package/dist/packages/internal/island-runtime/dist/capture-holds.js +45 -0
- package/dist/packages/internal/island-runtime/dist/contract.d.ts +176 -0
- package/dist/packages/internal/island-runtime/dist/contract.js +94 -0
- package/dist/packages/internal/island-runtime/dist/editor-instance-context.js +15 -0
- package/dist/packages/internal/island-runtime/dist/index.d.ts +103 -0
- package/dist/packages/internal/island-runtime/dist/index.js +163 -0
- package/dist/packages/internal/island-runtime/dist/use-capture-ready.d.ts +19 -0
- package/dist/packages/internal/island-runtime/dist/use-capture-ready.js +39 -0
- package/dist/packages/internal/island-runtime/dist/use-editor.d.ts +22 -0
- package/dist/packages/internal/island-runtime/dist/use-editor.js +54 -0
- package/dist/packages/internal/island-runtime/dist/viewport-schedule.js +105 -0
- package/dist/packages/internal/property-facts/dist/derive-facts-view.js +25 -0
- package/dist/packages/internal/property-facts/dist/index.js +3 -0
- package/dist/packages/internal/property-facts/dist/property-facts-CSdkSuD7.js +181 -0
- package/dist/packages/internal/section-contracts/dist/cap-contract.js +59 -0
- package/dist/packages/internal/section-contracts/dist/catalog.js +102 -0
- package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +24 -0
- package/dist/packages/internal/section-contracts/dist/count-bounds-contract.js +48 -0
- package/dist/packages/internal/section-contracts/dist/display-contract.js +30 -0
- package/dist/packages/internal/section-contracts/dist/display-evidence-contract.js +17 -0
- package/dist/packages/internal/section-contracts/dist/group-contract.js +21 -0
- package/dist/packages/internal/section-contracts/dist/index.js +26 -0
- package/dist/packages/internal/section-contracts/dist/interpolation-contract.js +48 -0
- package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +53 -0
- package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +70 -0
- package/dist/packages/internal/section-contracts/dist/name-title-contract.js +27 -0
- package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +12 -0
- package/dist/packages/internal/section-contracts/dist/option-source-contract.js +22 -0
- package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +18 -0
- package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +30 -0
- package/dist/packages/internal/section-contracts/dist/record-collection-contract.js +24 -0
- package/dist/packages/internal/section-contracts/dist/row-contract.js +37 -0
- package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +38 -0
- package/dist/packages/internal/section-contracts/dist/runners.js +181 -0
- package/dist/packages/internal/section-contracts/dist/select-contract.js +28 -0
- package/dist/packages/internal/section-contracts/dist/source-contract.js +48 -0
- package/dist/packages/internal/section-contracts/dist/source-filter-contract.js +15 -0
- package/dist/packages/internal/section-contracts/dist/sources-contract.js +28 -0
- package/dist/packages/internal/section-contracts/dist/url-contract.js +20 -0
- package/dist/packages/internal/source-resolution/dist/index.js +222 -0
- package/dist/packages/internal/template-artifact/dist/hash.js +50 -0
- package/dist/packages/internal/template-artifact/dist/index.js +7 -0
- package/dist/packages/internal/template-artifact/dist/layout.js +165 -0
- package/dist/packages/internal/template-artifact/dist/manifest.js +73 -0
- package/dist/packages/internal/template-artifact/dist/sha256.js +138 -0
- package/dist/packages/internal/template-artifact/dist/verify.js +275 -0
- package/dist/packages/internal/template-contracts/dist/collection-editing.js +38 -0
- package/dist/packages/internal/template-contracts/dist/content-categories.d.ts +10 -0
- package/dist/packages/internal/template-contracts/dist/content-categories.js +17 -0
- package/dist/packages/internal/template-contracts/dist/document-value.d.ts +33 -0
- package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +81 -0
- package/dist/packages/internal/template-contracts/dist/facts-view.js +136 -0
- package/dist/packages/internal/template-contracts/dist/layout.js +17 -0
- package/dist/packages/internal/template-contracts/dist/markers.d.ts +40 -0
- package/dist/packages/internal/template-contracts/dist/markers.js +41 -0
- package/dist/packages/internal/template-contracts/dist/poi-row.d.ts +63 -0
- package/dist/packages/internal/template-contracts/dist/select-key.js +13 -0
- package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +1112 -0
- package/dist/packages/internal/template-contracts/dist/slot-catalog.js +1109 -0
- package/dist/packages/internal/template-contracts/dist/slot-overrides.js +11 -0
- package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +45 -0
- package/dist/packages/internal/template-contracts/dist/video-value.d.ts +63 -0
- package/dist/playground/host/page-state.js +12 -0
- package/dist/playground/host/paths.js +9 -0
- package/dist/playground/layout.js +24 -0
- package/dist/playground/wire.js +36 -0
- package/dist/playground-island-runtime.d.ts +3 -0
- package/dist/playground-island-runtime.js +4 -0
- package/dist/primitives/FrameShell.d.ts +29 -0
- package/dist/primitives/FrameShell.js +34 -0
- package/dist/primitives/Image.d.ts +119 -0
- package/dist/primitives/Image.js +173 -0
- package/dist/primitives/Section.d.ts +22 -0
- package/dist/primitives/Section.js +26 -0
- package/dist/primitives/Tour.d.ts +43 -0
- package/dist/primitives/Tour.js +72 -0
- package/dist/primitives/Video.d.ts +57 -0
- package/dist/primitives/Video.js +116 -0
- package/dist/primitives/embed-playback.js +50 -0
- package/dist/primitives/index.d.ts +11 -0
- package/dist/primitives/marker-attrs.js +44 -0
- package/dist/primitives/object-fit.js +11 -0
- package/dist/primitives/picture-sources.d.ts +24 -0
- package/dist/primitives/picture-sources.js +52 -0
- package/dist/primitives/probe-context.js +24 -0
- package/dist/primitives/slot-bindings.d.ts +96 -0
- package/dist/primitives/slot-bindings.js +226 -0
- package/dist/primitives/slot-document.d.ts +35 -0
- package/dist/primitives/slot-document.js +37 -0
- package/dist/primitives/slot-group.d.ts +40 -0
- package/dist/primitives/slot-group.js +45 -0
- package/dist/primitives/slot-list.d.ts +21 -0
- package/dist/primitives/slot-list.js +23 -0
- package/dist/primitives/slot-media.d.ts +71 -0
- package/dist/primitives/slot-media.js +98 -0
- package/dist/primitives/slot-scalar.d.ts +53 -0
- package/dist/primitives/slot-scalar.js +98 -0
- package/dist/primitives/slot.d.ts +26 -0
- package/dist/primitives/slot.js +28 -0
- package/dist/rules/registry.js +479 -0
- package/dist/schema/compute.d.ts +22 -0
- package/dist/schema/compute.js +30 -0
- package/dist/schema/define-schema.d.ts +27 -0
- package/dist/schema/define-schema.js +73 -0
- package/dist/schema/extract-fill-spec.js +246 -0
- package/dist/schema/extract-used-facts.js +176 -0
- package/dist/schema/fact.d.ts +65 -0
- package/dist/schema/fact.js +33 -0
- package/dist/schema/fill-builders.d.ts +387 -0
- package/dist/schema/fill-builders.js +263 -0
- package/dist/schema/fill-declaration.d.ts +76 -0
- package/dist/schema/fill-declaration.js +43 -0
- package/dist/schema/fill-spec.d.ts +18 -0
- package/dist/schema/fill-spec.js +170 -0
- package/dist/schema/format-presets.d.ts +27 -0
- package/dist/schema/format-presets.js +76 -0
- package/dist/schema/format.d.ts +22 -0
- package/dist/schema/format.js +40 -0
- package/dist/schema/formats.d.ts +6 -0
- package/dist/schema/formats.js +7 -0
- package/dist/schema/layout.d.ts +32 -0
- package/dist/schema/layout.js +30 -0
- package/dist/schema/manifest.js +300 -0
- package/dist/schema/property-facts.d.ts +83 -0
- package/dist/schema/runtime-values.d.ts +88 -0
- package/dist/schema/section-nav.d.ts +38 -0
- package/dist/schema/section-nav.js +29 -0
- package/dist/schema/section-props.d.ts +98 -0
- package/dist/schema/section-schema.d.ts +53 -0
- package/dist/schema/section-schema.js +54 -0
- package/dist/schema/slot-builders.d.ts +497 -0
- package/dist/schema/slot-builders.js +331 -0
- package/dist/schema/slot-types.d.ts +110 -0
- package/dist/schema/slot-types.js +187 -0
- package/dist/section/declare.d.ts +44 -0
- package/dist/section/declare.js +27 -0
- package/dist/section/discovery.js +76 -0
- package/dist/section/groups.js +74 -0
- package/dist/section/materialize.js +28 -0
- package/dist/section/placements.js +28 -0
- package/dist/section/section.d.ts +69 -0
- package/dist/section/section.js +101 -0
- package/dist/site-analytics.d.ts +1 -0
- package/dist/site-analytics.js +15 -0
- package/dist/site-runtime/analytics.js +97 -0
- package/dist/site-runtime/site-integrations.js +97 -0
- package/dist/styles.css +60 -0
- package/dist/template/define-template.d.ts +139 -0
- package/dist/template/define-template.js +98 -0
- package/dist/template/logic-build.js +191 -0
- package/dist/template/logic-shim.d.ts +43 -0
- package/dist/template/logic-shim.js +52 -0
- package/dist/template/logic-transform.js +92 -0
- package/dist/template/materialize.js +107 -0
- package/dist/template/reconcile.d.ts +67 -0
- package/dist/template/reconcile.js +25 -0
- package/dist/template/running-copy.js +58 -0
- package/guide/reference/cli/INDEX.md +79 -0
- package/guide/reference/cli/build.md +48 -0
- package/guide/reference/cli/check.md +49 -0
- package/guide/reference/cli/dev.md +46 -0
- package/guide/reference/cli/property-add.md +53 -0
- package/guide/reference/cli/property-list.md +46 -0
- package/guide/reference/cli/publish.md +54 -0
- package/guide/reference/cli/upgrade.md +48 -0
- package/guide/reference/rules/INDEX.md +190 -0
- package/package.json +137 -0
- package/tsconfig.base.json +16 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { recordPlacements } from "../section/placements.js";
|
|
2
|
+
import { TemplateManifest } from "../schema/manifest.js";
|
|
3
|
+
import { createElement } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/template/materialize.ts
|
|
6
|
+
/**
|
|
7
|
+
* Render each page under the placement probe and build the composition.
|
|
8
|
+
*
|
|
9
|
+
* @throws when a page emits markup that is not a section; when one instance id names
|
|
10
|
+
* two different sections; when a rule reads a section no page places; and on every
|
|
11
|
+
* `TemplateManifest` rule (duplicate page id, duplicate instance on one page, the
|
|
12
|
+
* website page rules, the canvas partition, the name cap, the format rules).
|
|
13
|
+
*/
|
|
14
|
+
function materializeTemplate(template, options = {}) {
|
|
15
|
+
const sections = /* @__PURE__ */ new Map();
|
|
16
|
+
const sectionOfInstance = /* @__PURE__ */ new Map();
|
|
17
|
+
const placements = [];
|
|
18
|
+
const instances = [];
|
|
19
|
+
const instanceBySection = {};
|
|
20
|
+
const pages = template.pages.map((page) => {
|
|
21
|
+
const recorded = recordPlacements(createElement(page.page));
|
|
22
|
+
if (recorded.markup !== "") {
|
|
23
|
+
const where = options.locate?.(page.page) ?? page.page.name ?? "";
|
|
24
|
+
throw new Error(`Page "${page.id}"${where === "" ? "" : ` (${where})`} emits markup that is not a section: ${excerpt(recorded.markup)}. A page may contain only sections and components that contain only sections — the platform has nowhere to put page markup.`);
|
|
25
|
+
}
|
|
26
|
+
for (const placement of recorded.placements) {
|
|
27
|
+
placements.push(placement);
|
|
28
|
+
const prior = sectionOfInstance.get(placement.instance);
|
|
29
|
+
if (prior !== void 0 && prior !== placement.key) throw new Error(`Instance "${placement.instance}" names two sections: "${prior}" and "${placement.key}" (on page "${page.id}"). An instance id is one section's; name the second placement with \`instance\`.`);
|
|
30
|
+
if (prior === void 0) {
|
|
31
|
+
sectionOfInstance.set(placement.instance, placement.key);
|
|
32
|
+
instances.push({
|
|
33
|
+
key: placement.key,
|
|
34
|
+
instanceId: placement.instance
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (!(placement.key in instanceBySection)) instanceBySection[placement.key] = placement.instance;
|
|
38
|
+
sections.set(placement.key, placement.section);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
id: page.id,
|
|
42
|
+
label: page.label,
|
|
43
|
+
...page.path === void 0 ? {} : { path: page.path },
|
|
44
|
+
optional: page.optional,
|
|
45
|
+
sections: recorded.placements.map((placement) => ({
|
|
46
|
+
section: placement.key,
|
|
47
|
+
instance_id: placement.instance,
|
|
48
|
+
required: placement.section.required
|
|
49
|
+
}))
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
manifest: TemplateManifest.parse({
|
|
54
|
+
key: template.key,
|
|
55
|
+
name: template.name,
|
|
56
|
+
output: template.output,
|
|
57
|
+
formats: template.formats,
|
|
58
|
+
pages,
|
|
59
|
+
canvases: template.canvases,
|
|
60
|
+
...template.preview === void 0 ? {} : { preview: template.preview }
|
|
61
|
+
}),
|
|
62
|
+
instances,
|
|
63
|
+
reads: resolveReads(template.reconcile, instanceBySection),
|
|
64
|
+
instanceBySection,
|
|
65
|
+
placements,
|
|
66
|
+
sections
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function excerpt(markup) {
|
|
70
|
+
const oneLine = markup.replace(/\s+/g, " ").trim();
|
|
71
|
+
return oneLine.length > 80 ? `${oneLine.slice(0, 77)}…` : oneLine;
|
|
72
|
+
}
|
|
73
|
+
function resolveReads(rules, instanceBySection) {
|
|
74
|
+
const seen = /* @__PURE__ */ new Set();
|
|
75
|
+
const out = [];
|
|
76
|
+
for (const rule of rules) for (const ref of rule.reads) {
|
|
77
|
+
const instanceId = instanceBySection[ref.section];
|
|
78
|
+
if (instanceId === void 0) throw new Error(`Reconcile rule "${rule.description}" reads section "${ref.section}", which no page places. A rule reads only sections the site map composes.`);
|
|
79
|
+
const key = `${instanceId} ${ref.slot}`;
|
|
80
|
+
if (seen.has(key)) continue;
|
|
81
|
+
seen.add(key);
|
|
82
|
+
out.push({
|
|
83
|
+
instanceId,
|
|
84
|
+
slot: ref.slot
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Address a rule's edits to instances: the shape the template logic bundle exports and
|
|
91
|
+
* the interpreter joins to a content document by id. Also compiled INTO that bundle,
|
|
92
|
+
* so keep it dependency-free.
|
|
93
|
+
*/
|
|
94
|
+
function resolveEdit(edit, instanceBySection) {
|
|
95
|
+
const setEdit = edit;
|
|
96
|
+
const instanceId = instanceBySection[setEdit.section];
|
|
97
|
+
if (instanceId === void 0) throw new Error(`reconcile set(): no placed instance for section "${setEdit.section}"`);
|
|
98
|
+
return {
|
|
99
|
+
op: "set",
|
|
100
|
+
instanceId,
|
|
101
|
+
slot: setEdit.slot,
|
|
102
|
+
value: setEdit.value
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
export { materializeTemplate, resolveEdit };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Facts } from "../packages/internal/template-contracts/dist/facts-view.js";
|
|
2
|
+
import { SlotRef } from "../section/declare.js";
|
|
3
|
+
//#region src/template/reconcile.d.ts
|
|
4
|
+
/** Replace a slot's value on the section instance the composition placed. */
|
|
5
|
+
interface SetEdit {
|
|
6
|
+
readonly op: "set";
|
|
7
|
+
readonly section: string;
|
|
8
|
+
readonly slot: string;
|
|
9
|
+
readonly value: unknown;
|
|
10
|
+
}
|
|
11
|
+
/** The edits a reconcile rule may return — today exactly one kind, `set`. */
|
|
12
|
+
type Edit = SetEdit;
|
|
13
|
+
/**
|
|
14
|
+
* The erased site shape a STORED rule's fn runs over: one flat namespace keyed by
|
|
15
|
+
* section key, each entry holding that instance's current slot values. A shared
|
|
16
|
+
* instance appears once however many pages render it.
|
|
17
|
+
*/
|
|
18
|
+
type SiteValues = Record<string, Record<string, unknown>>;
|
|
19
|
+
/**
|
|
20
|
+
* The `site` view a rule body receives, typed by the rule's own `reads`: exactly
|
|
21
|
+
* the sections and slots it declared, each value `unknown`. A slot the body reads
|
|
22
|
+
* without declaring is a compile error, which is the contract — an undeclared
|
|
23
|
+
* read is a slot whose edits never re-run the rule.
|
|
24
|
+
*/
|
|
25
|
+
type SiteViewOf<Reads extends readonly SlotRef[]> = { readonly [S in Reads[number]["section"]]: { readonly [K in Extract<Reads[number], {
|
|
26
|
+
readonly section: S;
|
|
27
|
+
}>["slot"]]: unknown; }; };
|
|
28
|
+
/** The arguments a `rule()` body receives. */
|
|
29
|
+
interface ReconcileContext<Reads extends readonly SlotRef[]> {
|
|
30
|
+
readonly site: SiteViewOf<Reads>;
|
|
31
|
+
/** The same derive-time view a `compute()` callback receives. */
|
|
32
|
+
readonly facts: Facts;
|
|
33
|
+
}
|
|
34
|
+
/** The declaration block `rule()` takes between its description and its body. */
|
|
35
|
+
interface ReconcileRuleOptions<Reads extends readonly SlotRef[]> {
|
|
36
|
+
/**
|
|
37
|
+
* Every slot the rule's body reads off `site`. Required, because the editor's
|
|
38
|
+
* propagate trigger matches an edited slot against this set: an undeclared slot
|
|
39
|
+
* means a user edit to it will not re-run the rule. An empty list is legal and
|
|
40
|
+
* meaningful — a rule that reads only `facts`, which no slot edit should trigger.
|
|
41
|
+
*/
|
|
42
|
+
readonly reads: Reads;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* One authored rule: a description (used in failure logs), the slots it reads and
|
|
46
|
+
* its pure function. Stored against the erased `SiteValues` so rules over different
|
|
47
|
+
* read sets share one transport type; `rule()` gives the author the reads-typed
|
|
48
|
+
* view at the call site.
|
|
49
|
+
*/
|
|
50
|
+
interface ReconcileRule {
|
|
51
|
+
readonly description: string;
|
|
52
|
+
readonly reads: readonly SlotRef[];
|
|
53
|
+
readonly fn: (ctx: {
|
|
54
|
+
readonly site: SiteValues;
|
|
55
|
+
readonly facts: Facts;
|
|
56
|
+
}) => readonly Edit[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Declare a cross-section rule. `site` is typed by `reads`, so a slot the body
|
|
60
|
+
* reads must be declared; an `async` body fails to typecheck — its `Promise`
|
|
61
|
+
* return is not assignable to `readonly Edit[]`.
|
|
62
|
+
*/
|
|
63
|
+
declare function rule<const Reads extends readonly SlotRef[]>(description: string, options: ReconcileRuleOptions<Reads>, fn: (ctx: ReconcileContext<Reads>) => readonly Edit[]): ReconcileRule;
|
|
64
|
+
/** The one edit verb: replace `ref`'s slot on the instance the composition placed for its section. */
|
|
65
|
+
declare function set(ref: SlotRef, value: unknown): SetEdit;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { Edit, ReconcileContext, ReconcileRule, ReconcileRuleOptions, SetEdit, SiteValues, SiteViewOf, rule, set };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/template/reconcile.ts
|
|
2
|
+
/**
|
|
3
|
+
* Declare a cross-section rule. `site` is typed by `reads`, so a slot the body
|
|
4
|
+
* reads must be declared; an `async` body fails to typecheck — its `Promise`
|
|
5
|
+
* return is not assignable to `readonly Edit[]`.
|
|
6
|
+
*/
|
|
7
|
+
function rule(description, options, fn) {
|
|
8
|
+
return {
|
|
9
|
+
description,
|
|
10
|
+
reads: options.reads,
|
|
11
|
+
fn
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** The one edit verb: replace `ref`'s slot on the instance the composition placed for its section. */
|
|
15
|
+
function set(ref, value) {
|
|
16
|
+
return {
|
|
17
|
+
op: "set",
|
|
18
|
+
section: ref.section,
|
|
19
|
+
slot: ref.slot,
|
|
20
|
+
value
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { rule, set };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
//#region src/template/running-copy.ts
|
|
6
|
+
const PACKAGE = "@homepages/concrete";
|
|
7
|
+
const SOURCE_ENTRIES = {
|
|
8
|
+
".": "src/index.ts",
|
|
9
|
+
"./fixtures": "src/fixtures/index.ts",
|
|
10
|
+
"./browser": "src/browser/index.ts",
|
|
11
|
+
"./eslint": "src/eslint/index.ts"
|
|
12
|
+
};
|
|
13
|
+
function packageRoot() {
|
|
14
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
for (;;) {
|
|
16
|
+
const manifest = join(dir, "package.json");
|
|
17
|
+
if (existsSync(manifest) && JSON.parse(readFileSync(manifest, "utf8")).name === PACKAGE) return dir;
|
|
18
|
+
const parent = dirname(dir);
|
|
19
|
+
if (parent === dir) throw new Error(`${PACKAGE}: could not find this package's own package.json above ${fileURLToPath(import.meta.url)}.`);
|
|
20
|
+
dir = parent;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
let cached;
|
|
24
|
+
/** Specifier (`@homepages/concrete`, `@homepages/concrete/fixtures`, …) → the running copy's absolute entry file. */
|
|
25
|
+
function runningCopyEntries() {
|
|
26
|
+
if (cached !== void 0) return cached;
|
|
27
|
+
const root = packageRoot();
|
|
28
|
+
const entries = /* @__PURE__ */ new Map();
|
|
29
|
+
if (import.meta.url.endsWith(".ts")) for (const [subpath, file] of Object.entries(SOURCE_ENTRIES)) entries.set(PACKAGE + subpath.slice(1), join(root, file));
|
|
30
|
+
else {
|
|
31
|
+
const { exports } = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
32
|
+
for (const [subpath, target] of Object.entries(exports)) {
|
|
33
|
+
const file = typeof target === "object" && target !== null ? target.default : void 0;
|
|
34
|
+
if (typeof file === "string" && file.endsWith(".js")) entries.set(PACKAGE + subpath.slice(1), join(root, file));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
cached = entries;
|
|
38
|
+
return entries;
|
|
39
|
+
}
|
|
40
|
+
/** An esbuild plugin resolving the package's JavaScript subpaths to the running copy, kept external. */
|
|
41
|
+
function runningCopyPlugin() {
|
|
42
|
+
const entries = runningCopyEntries();
|
|
43
|
+
return {
|
|
44
|
+
name: "concrete-running-copy",
|
|
45
|
+
setup(build) {
|
|
46
|
+
build.onResolve({ filter: /^@homepages\/concrete(?:\/[a-z-]+)?$/ }, (args) => {
|
|
47
|
+
const path = entries.get(args.path);
|
|
48
|
+
return path === void 0 ? null : {
|
|
49
|
+
path,
|
|
50
|
+
external: true
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { runningCopyEntries, runningCopyPlugin };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: Every `concrete` command, with its full flag surface, exit codes and constraints.
|
|
3
|
+
mode: reference
|
|
4
|
+
status: generated
|
|
5
|
+
generated_from: the concrete command table
|
|
6
|
+
applies_to: "@homepages/concrete >=1.0.0 <2.0.0"
|
|
7
|
+
related: [INDEX.md]
|
|
8
|
+
---
|
|
9
|
+
# Command reference
|
|
10
|
+
|
|
11
|
+
One page per command, generated from the command's own definitions — so a flag
|
|
12
|
+
reaches this reference because it was declared, not because someone remembered the
|
|
13
|
+
page. Run `concrete --help` for the same list at the terminal.
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
| Command | What it does | Synopsis |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| [`dev`](dev.md) | Serve this workspace's template in the local editor | `concrete dev [--port <n>] [--no-auto-update]` |
|
|
20
|
+
| [`check`](check.md) | Grade the template against every requirement the platform accepts it on | `concrete check [--json] [--no-auto-update]` |
|
|
21
|
+
| [`build`](build.md) | Run check, then write the template's artifact | `concrete build [--out <dir>] [--no-auto-update]` |
|
|
22
|
+
| [`upgrade`](upgrade.md) | Move the workspace to a newer @homepages/concrete and run its codemods | `concrete upgrade [--dry-run] [--to <version>]` |
|
|
23
|
+
| [`property list`](property-list.md) | List the sample properties a workspace can copy in | `concrete property list [--no-auto-update]` |
|
|
24
|
+
| [`property add`](property-add.md) | Copy a sample property into this workspace's fixtures/properties/ | `concrete property add <slug> [--no-auto-update]` |
|
|
25
|
+
| [`publish`](publish.md) | Publish the template to HomePages | `concrete publish [--rebuild] [--dry-run] [--json] [--no-auto-update]` |
|
|
26
|
+
|
|
27
|
+
## Global options
|
|
28
|
+
|
|
29
|
+
Accepted in place of a command. Both are answered without reading the workspace or the
|
|
30
|
+
registry, so they work when everything else is broken.
|
|
31
|
+
|
|
32
|
+
| Option | What it does |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `--version`, `-v`, `-V` | Print the installed version |
|
|
35
|
+
| `--help`, `-h` | Print this message |
|
|
36
|
+
|
|
37
|
+
## Staying current
|
|
38
|
+
|
|
39
|
+
`dev`, `check`, `build`, `property list`, `property add`, `publish` each begin by comparing the workspace's installed
|
|
40
|
+
`@homepages/concrete` with the registry's published release, and then:
|
|
41
|
+
|
|
42
|
+
- **On the published release, or ahead of it** — nothing is said and nothing moves.
|
|
43
|
+
- **Behind inside the same major** — in a terminal, with a `package-lock.json` at the
|
|
44
|
+
workspace root, the package is refreshed (`npm update @homepages/concrete`) before the
|
|
45
|
+
command runs. Outside a terminal, or without a lockfile, the gap is reported and
|
|
46
|
+
nothing is installed.
|
|
47
|
+
- **A new major is published** — the command asks once, `[Y/n]`, defaulting to yes. Yes
|
|
48
|
+
runs `concrete upgrade` to that version — the install and every codemod between
|
|
49
|
+
here and there — and the command you typed runs afterwards, still on the version it
|
|
50
|
+
started as. A whole-word no is remembered for that exact version, and the next major
|
|
51
|
+
asks again. Outside a terminal it is only reported.
|
|
52
|
+
|
|
53
|
+
Every line of this goes to stderr, so `check --json`'s report on stdout is never
|
|
54
|
+
touched. Nothing here can fail the command it runs in front of: an unreachable registry,
|
|
55
|
+
a refresh that does not complete, an install that exits non-zero — each is reported and
|
|
56
|
+
stepped over.
|
|
57
|
+
|
|
58
|
+
The registry is read at most once per 1 hour per user (the answer is cached under
|
|
59
|
+
`XDG_CACHE_HOME`, else `~/.cache`) and the read gives up after 2 seconds. A workspace
|
|
60
|
+
that installs the package from somewhere other than the registry — `workspace:*`,
|
|
61
|
+
`file:`, `link:` — is never checked at all.
|
|
62
|
+
|
|
63
|
+
Two switches turn the whole thing off:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
export HOMEPAGES_NO_AUTO_UPDATE=1 # every command, for this shell
|
|
67
|
+
concrete check --no-auto-update # this one command
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Any value except `0` counts as on. `upgrade` is the one command that moves the version
|
|
71
|
+
itself, so nothing runs in front of it — which is also why `--no-auto-update` is not one
|
|
72
|
+
of its flags.
|
|
73
|
+
|
|
74
|
+
## Versions
|
|
75
|
+
|
|
76
|
+
These pages describe `@homepages/concrete` **>=1.0.0 <2.0.0**. The range, rather than
|
|
77
|
+
the exact version they were generated from: this reference is committed build output,
|
|
78
|
+
so a page stamped with a patch version would be stale the day it shipped.
|
|
79
|
+
`concrete --version` prints the installed one.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: The `concrete build` command — its flags, exit codes and constraints.
|
|
3
|
+
mode: reference
|
|
4
|
+
status: generated
|
|
5
|
+
generated_from: the concrete command table
|
|
6
|
+
applies_to: "@homepages/concrete >=1.0.0 <2.0.0"
|
|
7
|
+
related: [reference/cli/INDEX.md]
|
|
8
|
+
---
|
|
9
|
+
# concrete build
|
|
10
|
+
|
|
11
|
+
Run check, then write the template's artifact.
|
|
12
|
+
|
|
13
|
+
## Synopsis
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
concrete build [--out <dir>] [--no-auto-update]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Flags
|
|
20
|
+
|
|
21
|
+
| Flag | Type | Default | What it does |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| `--out <dir>` | string | `.concrete/build` | Directory to write the artifact into, relative to the workspace root |
|
|
24
|
+
| `--no-auto-update` | boolean | `false` | Skip the package refresh this command runs first when the workspace is behind the published release |
|
|
25
|
+
|
|
26
|
+
## Exit codes
|
|
27
|
+
|
|
28
|
+
| Code | When |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `0` | the artifact was written |
|
|
31
|
+
| `1` | `check` is not green, a capture failed, or the artifact cannot be written |
|
|
32
|
+
|
|
33
|
+
## Constraints
|
|
34
|
+
|
|
35
|
+
- The only producer of an artifact. Nothing else — no bare bundler — writes one.
|
|
36
|
+
- Deterministic: the same tree builds to the same artifact hash.
|
|
37
|
+
- An image or document template also carries `captures/`: every authored fixture at every declared format, taken exactly as `dev`'s *Download fixture render* takes it — the enabled pages and their zip, or the PDF. Captures sit outside the artifact hash, and need Playwright: without it, build refuses with the install line.
|
|
38
|
+
- The default output directory, `.concrete/build/`, is gitignored by the scaffold.
|
|
39
|
+
|
|
40
|
+
## Before it runs
|
|
41
|
+
|
|
42
|
+
This command first checks that the workspace is on the published release of
|
|
43
|
+
`@homepages/concrete` and refreshes it when it is behind inside the same major —
|
|
44
|
+
[Staying current](INDEX.md#staying-current) has the rules. `--no-auto-update` skips that for one run.
|
|
45
|
+
|
|
46
|
+
## See also
|
|
47
|
+
|
|
48
|
+
- [Every command](INDEX.md) — the rest of the command's surface.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: The `concrete check` command — its flags, exit codes and constraints.
|
|
3
|
+
mode: reference
|
|
4
|
+
status: generated
|
|
5
|
+
generated_from: the concrete command table
|
|
6
|
+
applies_to: "@homepages/concrete >=1.0.0 <2.0.0"
|
|
7
|
+
related: [reference/cli/INDEX.md]
|
|
8
|
+
---
|
|
9
|
+
# concrete check
|
|
10
|
+
|
|
11
|
+
Grade the template against every requirement the platform accepts it on.
|
|
12
|
+
|
|
13
|
+
## Synopsis
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
concrete check [--json] [--no-auto-update]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Flags
|
|
20
|
+
|
|
21
|
+
| Flag | Type | Default | What it does |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| `--json` | boolean | `false` | Print one machine-readable report on stdout instead of human output |
|
|
24
|
+
| `--no-auto-update` | boolean | `false` | Skip the package refresh this command runs first when the workspace is behind the published release |
|
|
25
|
+
|
|
26
|
+
## Exit codes
|
|
27
|
+
|
|
28
|
+
| Code | When |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `0` | the template and the workspace pass every rule that could be measured |
|
|
31
|
+
| `1` | any rule reports a finding, or the run cannot proceed at all |
|
|
32
|
+
|
|
33
|
+
## Constraints
|
|
34
|
+
|
|
35
|
+
- Under `--json` the report is the only thing written to stdout; every notice goes to stderr.
|
|
36
|
+
- Grades with the toolchain this package ships — TypeScript, ESLint, esbuild — never with a version the workspace declares.
|
|
37
|
+
- Every threshold is a platform acceptance criterion, not a preference. No flag or config file raises one.
|
|
38
|
+
- Every run reports what each placed section's built bundles weigh: the renderer, each island chunk and each asset, in the human output and as `weights` under `--json`.
|
|
39
|
+
- `build` runs this first and refuses on red: an artifact exists only because check passed.
|
|
40
|
+
|
|
41
|
+
## Before it runs
|
|
42
|
+
|
|
43
|
+
This command first checks that the workspace is on the published release of
|
|
44
|
+
`@homepages/concrete` and refreshes it when it is behind inside the same major —
|
|
45
|
+
[Staying current](INDEX.md#staying-current) has the rules. `--no-auto-update` skips that for one run.
|
|
46
|
+
|
|
47
|
+
## See also
|
|
48
|
+
|
|
49
|
+
- [Every command](INDEX.md) — the rest of the command's surface.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: The `concrete dev` command — its flags, exit codes and constraints.
|
|
3
|
+
mode: reference
|
|
4
|
+
status: generated
|
|
5
|
+
generated_from: the concrete command table
|
|
6
|
+
applies_to: "@homepages/concrete >=1.0.0 <2.0.0"
|
|
7
|
+
related: [reference/cli/INDEX.md]
|
|
8
|
+
---
|
|
9
|
+
# concrete dev
|
|
10
|
+
|
|
11
|
+
Serve this workspace's template in the local editor.
|
|
12
|
+
|
|
13
|
+
## Synopsis
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
concrete dev [--port <n>] [--no-auto-update]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Flags
|
|
20
|
+
|
|
21
|
+
| Flag | Type | Default | What it does |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| `--port <n>` | string | `5180` | Port to serve on. A non-integer or non-positive value falls back to the default |
|
|
24
|
+
| `--no-auto-update` | boolean | `false` | Skip the package refresh this command runs first when the workspace is behind the published release |
|
|
25
|
+
|
|
26
|
+
## Exit codes
|
|
27
|
+
|
|
28
|
+
| Code | When |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `0` | the server is interrupted (Ctrl-C, SIGTERM) and shuts down cleanly |
|
|
31
|
+
| `1` | the server cannot start |
|
|
32
|
+
|
|
33
|
+
## Constraints
|
|
34
|
+
|
|
35
|
+
- Runs until interrupted — it is a server, not a one-shot command.
|
|
36
|
+
- Serves this one workspace: its template over its fixtures, in the platform's own editor.
|
|
37
|
+
|
|
38
|
+
## Before it runs
|
|
39
|
+
|
|
40
|
+
This command first checks that the workspace is on the published release of
|
|
41
|
+
`@homepages/concrete` and refreshes it when it is behind inside the same major —
|
|
42
|
+
[Staying current](INDEX.md#staying-current) has the rules. `--no-auto-update` skips that for one run.
|
|
43
|
+
|
|
44
|
+
## See also
|
|
45
|
+
|
|
46
|
+
- [Every command](INDEX.md) — the rest of the command's surface.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: The `concrete property add` command — its flags, exit codes and constraints.
|
|
3
|
+
mode: reference
|
|
4
|
+
status: generated
|
|
5
|
+
generated_from: the concrete command table
|
|
6
|
+
applies_to: "@homepages/concrete >=1.0.0 <2.0.0"
|
|
7
|
+
related: [reference/cli/INDEX.md]
|
|
8
|
+
---
|
|
9
|
+
# concrete property add
|
|
10
|
+
|
|
11
|
+
Copy a sample property into this workspace's fixtures/properties/.
|
|
12
|
+
|
|
13
|
+
## Synopsis
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
concrete property add <slug> [--no-auto-update]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Arguments
|
|
20
|
+
|
|
21
|
+
| Argument | What it is |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `<slug>` | The property to copy, as `concrete property list` names it |
|
|
24
|
+
|
|
25
|
+
## Flags
|
|
26
|
+
|
|
27
|
+
| Flag | Type | Default | What it does |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `--no-auto-update` | boolean | `false` | Skip the package refresh this command runs first when the workspace is behind the published release |
|
|
30
|
+
|
|
31
|
+
## Exit codes
|
|
32
|
+
|
|
33
|
+
| Code | When |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `0` | the folder was copied |
|
|
36
|
+
| `1` | the folder already exists, the library has no property by that slug, the library cannot be read, or it runs outside a workspace |
|
|
37
|
+
|
|
38
|
+
## Constraints
|
|
39
|
+
|
|
40
|
+
- Copies the whole folder — property.ts, media/, README.md, sources.json — to `fixtures/properties/<slug>/`. From then on it is the workspace's to edit.
|
|
41
|
+
- Never overwrites: an existing `fixtures/properties/<slug>/` is refused and named, and nothing is copied.
|
|
42
|
+
- The workspace never depends on the library: nothing is added to package.json, so no later release of it can change a copied property.
|
|
43
|
+
- Reads the library the way `property list` does, through the same per-user cache.
|
|
44
|
+
|
|
45
|
+
## Before it runs
|
|
46
|
+
|
|
47
|
+
This command first checks that the workspace is on the published release of
|
|
48
|
+
`@homepages/concrete` and refreshes it when it is behind inside the same major —
|
|
49
|
+
[Staying current](INDEX.md#staying-current) has the rules. `--no-auto-update` skips that for one run.
|
|
50
|
+
|
|
51
|
+
## See also
|
|
52
|
+
|
|
53
|
+
- [Every command](INDEX.md) — the rest of the command's surface.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: The `concrete property list` command — its flags, exit codes and constraints.
|
|
3
|
+
mode: reference
|
|
4
|
+
status: generated
|
|
5
|
+
generated_from: the concrete command table
|
|
6
|
+
applies_to: "@homepages/concrete >=1.0.0 <2.0.0"
|
|
7
|
+
related: [reference/cli/INDEX.md]
|
|
8
|
+
---
|
|
9
|
+
# concrete property list
|
|
10
|
+
|
|
11
|
+
List the sample properties a workspace can copy in.
|
|
12
|
+
|
|
13
|
+
## Synopsis
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
concrete property list [--no-auto-update]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Flags
|
|
20
|
+
|
|
21
|
+
| Flag | Type | Default | What it does |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| `--no-auto-update` | boolean | `false` | Skip the package refresh this command runs first when the workspace is behind the published release |
|
|
24
|
+
|
|
25
|
+
## Exit codes
|
|
26
|
+
|
|
27
|
+
| Code | When |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `0` | the listing was printed |
|
|
30
|
+
| `1` | the library cannot be read from the registry and no earlier copy of it is cached |
|
|
31
|
+
|
|
32
|
+
## Constraints
|
|
33
|
+
|
|
34
|
+
- Prints one line per property on stdout: its slug, its description, then its property type, listing intent and non-zero counts.
|
|
35
|
+
- Reads the latest @homepages/sample-properties from the registry the workspace installs from, and caches each version per user under `XDG_CACHE_HOME`, else `~/.cache`.
|
|
36
|
+
- When the registry cannot be read, lists the newest cached version and says so on stderr.
|
|
37
|
+
|
|
38
|
+
## Before it runs
|
|
39
|
+
|
|
40
|
+
This command first checks that the workspace is on the published release of
|
|
41
|
+
`@homepages/concrete` and refreshes it when it is behind inside the same major —
|
|
42
|
+
[Staying current](INDEX.md#staying-current) has the rules. `--no-auto-update` skips that for one run.
|
|
43
|
+
|
|
44
|
+
## See also
|
|
45
|
+
|
|
46
|
+
- [Every command](INDEX.md) — the rest of the command's surface.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: The `concrete publish` command — its flags, exit codes and constraints.
|
|
3
|
+
mode: reference
|
|
4
|
+
status: generated
|
|
5
|
+
generated_from: the concrete command table
|
|
6
|
+
applies_to: "@homepages/concrete >=1.0.0 <2.0.0"
|
|
7
|
+
related: [reference/cli/INDEX.md]
|
|
8
|
+
---
|
|
9
|
+
# concrete publish
|
|
10
|
+
|
|
11
|
+
Publish the template to HomePages.
|
|
12
|
+
|
|
13
|
+
## Synopsis
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
concrete publish [--rebuild] [--dry-run] [--json] [--no-auto-update]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Flags
|
|
20
|
+
|
|
21
|
+
| Flag | Type | Default | What it does |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| `--rebuild` | boolean | `false` | Build the artifact again even when the tree still matches the one on disk |
|
|
24
|
+
| `--dry-run` | boolean | `false` | Upload and verify the artifact, report what publishing would change, and write nothing |
|
|
25
|
+
| `--json` | boolean | `false` | Print the settled publication record on stdout instead of the summary |
|
|
26
|
+
| `--no-auto-update` | boolean | `false` | Skip the package refresh this command runs first when the workspace is behind the published release |
|
|
27
|
+
|
|
28
|
+
## Exit codes
|
|
29
|
+
|
|
30
|
+
| Code | When |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `0` | the template was published, the environment already held it as current, or a dry run passed verification |
|
|
33
|
+
| `1` | `check` is not green, or the platform refuses the publication, fails its verification or cannot finish it |
|
|
34
|
+
| `2` | no publisher key is set, the key is malformed or not accepted, the endpoint cannot be reached, or it runs outside a workspace |
|
|
35
|
+
|
|
36
|
+
## Constraints
|
|
37
|
+
|
|
38
|
+
- The key is the environment: `CONCRETE_TOKEN` names production, staging or dev in its prefix (`cpt_prod_…`), and publish goes where it points. There is no environment flag.
|
|
39
|
+
- Reads `CONCRETE_TOKEN` from the environment, then from the workspace's `.env`. `CONCRETE_API_URL` replaces the endpoint the key's prefix names.
|
|
40
|
+
- Builds first when it matters: the artifact in `.concrete/build/` is reused while the workspace's files match the ones it was built from, and rebuilt — check included — when they do not.
|
|
41
|
+
- Prints one line per stage on stderr as it settles: target, build, upload, verify, write, adopt.
|
|
42
|
+
- Publishing a tree the environment already holds as current changes nothing, says so, and exits 0. Rolling back is publishing the older tree.
|
|
43
|
+
- Under `--json` the publication record is the only thing written to stdout; every stage line goes to stderr.
|
|
44
|
+
- Never prompts, in any environment.
|
|
45
|
+
|
|
46
|
+
## Before it runs
|
|
47
|
+
|
|
48
|
+
This command first checks that the workspace is on the published release of
|
|
49
|
+
`@homepages/concrete` and refreshes it when it is behind inside the same major —
|
|
50
|
+
[Staying current](INDEX.md#staying-current) has the rules. `--no-auto-update` skips that for one run.
|
|
51
|
+
|
|
52
|
+
## See also
|
|
53
|
+
|
|
54
|
+
- [Every command](INDEX.md) — the rest of the command's surface.
|