@homepages/concrete 13.0.1 → 14.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 (67) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +4 -5
  3. package/codemods/manifest.json +7 -0
  4. package/dist/artifact/playground/client/assets/index-DZbV6Ucf.js +1338 -0
  5. package/dist/artifact/playground/client/index.html +1 -1
  6. package/dist/artifact/playground/host.mjs +22 -22
  7. package/dist/cli/build/manifest.js +1 -1
  8. package/dist/cli/build/record.js +1 -1
  9. package/dist/cli/check/load-workspace.js +3 -6
  10. package/dist/cli/commands.js +63 -15
  11. package/dist/cli/media/deriver-plugin.js +10 -1
  12. package/dist/cli/publish/artifact.js +18 -40
  13. package/dist/cli/publish/fixtures.js +1 -1
  14. package/dist/cli/publish/index.js +90 -115
  15. package/dist/cli/publish/report.js +36 -56
  16. package/dist/cli/publish/send.js +142 -0
  17. package/dist/cli/publish/target.js +33 -31
  18. package/dist/cli/publish/verdict.js +65 -0
  19. package/dist/cli/release/client.js +69 -0
  20. package/dist/cli/release/index.js +143 -0
  21. package/dist/cli/release/report.js +73 -0
  22. package/dist/cli/upgrade/fixture-modules.js +3 -5
  23. package/dist/cli.js +1 -0
  24. package/dist/css/graph.js +29 -40
  25. package/dist/fixtures/media-plugin.js +7 -25
  26. package/dist/fixtures/package-stylesheets.js +12 -48
  27. package/dist/packages/external/concrete/package.js +1 -1
  28. package/dist/packages/internal/media-resolution/dist/image.js +23 -0
  29. package/dist/packages/internal/playground/dist/fixture-formats.js +5 -1
  30. package/dist/packages/internal/playground/dist/host/built.js +4 -12
  31. package/dist/packages/internal/playground/dist/host/catalog-fixture.js +0 -1
  32. package/dist/packages/internal/playground/dist/host/download.js +1 -8
  33. package/dist/packages/internal/playground/dist/host/fixture-addresses.js +3 -4
  34. package/dist/packages/internal/playground/dist/host/program.js +1 -2
  35. package/dist/packages/internal/playground/dist/host/serve.js +4 -30
  36. package/dist/packages/internal/playground/dist/host/stored-fixtures.js +2 -9
  37. package/dist/packages/internal/playground/dist/layout.js +5 -5
  38. package/dist/packages/internal/playground/dist/send-wire.js +9 -0
  39. package/dist/packages/internal/playground/dist/server/changes.js +0 -1
  40. package/dist/packages/internal/playground/dist/server/listen.js +2 -19
  41. package/dist/packages/internal/property-facts/dist/registry-facts.js +0 -7
  42. package/dist/packages/internal/template-artifact/dist/framework-floor.js +33 -0
  43. package/dist/packages/internal/template-artifact/dist/index.js +3 -3
  44. package/dist/packages/internal/template-artifact/dist/layout.js +2 -39
  45. package/dist/packages/internal/template-artifact/dist/manifest.js +1 -1
  46. package/dist/packages/internal/template-artifact/dist/verify.js +6 -57
  47. package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +1 -1
  48. package/dist/packages/internal/template-contracts/dist/video-value.d.ts +1 -1
  49. package/dist/template/logic-build.js +38 -19
  50. package/guide/reference/cli/INDEX.md +5 -4
  51. package/guide/reference/cli/build.md +1 -1
  52. package/guide/reference/cli/check.md +1 -1
  53. package/guide/reference/cli/dev.md +1 -1
  54. package/guide/reference/cli/install.md +1 -1
  55. package/guide/reference/cli/property-add.md +1 -1
  56. package/guide/reference/cli/property-list.md +1 -1
  57. package/guide/reference/cli/publish.md +17 -16
  58. package/guide/reference/cli/release.md +57 -0
  59. package/guide/reference/cli/upgrade.md +1 -1
  60. package/guide/reference/rules/INDEX.md +1 -1
  61. package/package.json +6 -4
  62. package/dist/artifact/playground/client/assets/index-Bmvcss4B.js +0 -1338
  63. package/dist/cli/publish/captures.js +0 -61
  64. package/dist/cli/publish/client.js +0 -118
  65. package/dist/cli/publish/pack.js +0 -77
  66. package/dist/cli/publish/playground.js +0 -27
  67. package/dist/cli/publish/wire.js +0 -23
@@ -1,23 +1,6 @@
1
- import { createServer } from "node:net";
1
+ import "node:net";
2
2
 
3
3
  //#region ../../internal/playground/dist/server/listen.js
4
- function probe(port) {
5
- return new Promise((resolveProbe) => {
6
- const server = createServer();
7
- server.once("error", () => resolveProbe(null));
8
- server.listen(port, () => {
9
- const address = server.address();
10
- server.close(() => resolveProbe(typeof address === "object" && address !== null ? address.port : null));
11
- });
12
- });
13
- }
14
- async function freeDevPort() {
15
- for (let attempt = 0; attempt < 20; attempt += 1) {
16
- const port = await probe(0);
17
- if (port !== null) return port;
18
- }
19
- throw new Error("no free port for the dev server");
20
- }
21
4
  function listenRefusal(err, what) {
22
5
  if (err.code === "EADDRINUSE") return /* @__PURE__ */ new Error(`${what} is already in use — pick another with --port <n>`);
23
6
  if (err.code === "EACCES") return /* @__PURE__ */ new Error(`${what} is reserved or not permitted on this machine — pick another with --port <n>`);
@@ -35,4 +18,4 @@ function listenOn(server, port, what) {
35
18
  }
36
19
 
37
20
  //#endregion
38
- export { freeDevPort, listenOn, listenRefusal };
21
+ export { listenOn, listenRefusal };
@@ -178,13 +178,6 @@ const MediaReferenceSchema = z.object({
178
178
  crop: CropSchema.nullable().optional(),
179
179
  renditions: placeRenditions.partial().strict().optional()
180
180
  }).strict();
181
- const StoredHomeValueSchema = z.object({
182
- id: z.string(),
183
- file: z.string(),
184
- crop: CropSchema.nullable(),
185
- name: z.string().nullable(),
186
- renditions: placeRenditions.partial().strict()
187
- }).strict();
188
181
  const REGISTRIES = {
189
182
  property: propertyFacts,
190
183
  library: libraryFacts
@@ -0,0 +1,33 @@
1
+ //#region ../../internal/template-artifact/dist/framework-floor.js
2
+ const SEMVER = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
3
+ function compareVersions(a, b) {
4
+ const x = SEMVER.exec(a);
5
+ const y = SEMVER.exec(b);
6
+ if (x === null || y === null) return null;
7
+ for (let i = 1; i <= 3; i++) {
8
+ const d = Number(x[i]) - Number(y[i]);
9
+ if (d !== 0) return d;
10
+ }
11
+ const pa = x[4];
12
+ const pb = y[4];
13
+ if (pa === void 0 || pb === void 0) return pa === pb ? 0 : pa === void 0 ? 1 : -1;
14
+ const ia = pa.split(".");
15
+ const ib = pb.split(".");
16
+ for (let i = 0; i < Math.max(ia.length, ib.length); i++) {
17
+ const sa = ia[i];
18
+ const sb = ib[i];
19
+ if (sa === void 0) return -1;
20
+ if (sb === void 0) return 1;
21
+ const na = /^\d+$/.test(sa);
22
+ const nb = /^\d+$/.test(sb);
23
+ if (na && nb) {
24
+ const d = Number(sa) - Number(sb);
25
+ if (d !== 0) return d;
26
+ } else if (na !== nb) return na ? -1 : 1;
27
+ else if (sa !== sb) return sa < sb ? -1 : 1;
28
+ }
29
+ return 0;
30
+ }
31
+
32
+ //#endregion
33
+ export { compareVersions };
@@ -1,7 +1,7 @@
1
- import { ASSETS_DIR, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_DOCUMENT_EXTENSION, MANIFEST_FILE, PLAYGROUND_CANVAS_ISLAND_HOST, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, STORED_DIRS, TEMPLATE_DIR, TEMPLATE_FILES, UNHASHED_DIRS, assetPath, boundFiles, browserFileClashes, capturePath, fixturePath, isFixtureDocument, isFixtureFilePath, isSectionKey, isStoredPath, isTemplateKey, islandPath, playgroundPath, publishedSectionKey, sectionDir, sectionOfIslandKey, sectionPath, staticPath, templatePath } from "./layout.js";
1
+ import { ASSETS_DIR, FIXTURES_DIR, FIXTURE_DOCUMENT_EXTENSION, MANIFEST_FILE, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, TEMPLATE_DIR, TEMPLATE_FILES, assetPath, boundFiles, browserFileClashes, isFixtureDocument, isFixtureFilePath, isSectionKey, isStoredPath, isTemplateKey, islandPath, publishedSectionKey, sectionDir, sectionOfIslandKey, sectionPath, staticPath, templatePath } from "./layout.js";
2
2
  import { sha256Hex } from "./sha256.js";
3
3
  import { listingDigest, sectionContentHash, sourceDigest, templateContentHash } from "./hash.js";
4
4
  import { ArtifactManifest, ArtifactScope, ArtifactSection, readArtifactSchema } from "./manifest.js";
5
- import { verifyArtifact } from "./verify.js";
5
+ import { verifyBuild } from "./verify.js";
6
6
 
7
- export { ArtifactManifest, CAPTURE_FILES, FIXTURES_DIR, MANIFEST_FILE, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTION_FILES, TEMPLATE_DIR, TEMPLATE_FILES, assetPath, browserFileClashes, capturePath, fixturePath, isFixtureFilePath, isSectionKey, isTemplateKey, islandPath, listingDigest, playgroundPath, publishedSectionKey, sectionDir, sectionPath, sourceDigest, staticPath, templatePath, verifyArtifact };
7
+ export { ArtifactManifest, FIXTURES_DIR, MANIFEST_FILE, SECTION_FILES, TEMPLATE_DIR, TEMPLATE_FILES, assetPath, browserFileClashes, isFixtureFilePath, isSectionKey, isTemplateKey, islandPath, listingDigest, publishedSectionKey, sectionDir, sectionPath, sourceDigest, staticPath, templatePath, verifyBuild };
@@ -5,10 +5,7 @@ const TEMPLATE_DIR = "template";
5
5
  const STATIC_DIR = "static";
6
6
  const ASSETS_DIR = "assets";
7
7
  const SECTION_ISLANDS_DIR = "islands";
8
- const PLAYGROUND_DIR = "playground";
9
- const PLAYGROUND_CLIENT_DIR = "client";
10
8
  const FIXTURES_DIR = "fixtures";
11
- const CAPTURES_DIR = "captures";
12
9
  const BUILD_DIR = ".concrete/build";
13
10
  function builtTreePath(path) {
14
11
  return `${BUILD_DIR}/${path}`;
@@ -19,34 +16,12 @@ function isBuiltTreePath(treePath) {
19
16
  function builtPathOf(treePath) {
20
17
  return treePath.startsWith(`${".concrete/build"}/`) ? treePath.slice(16) : null;
21
18
  }
22
- const UNHASHED_DIRS = [
23
- FIXTURES_DIR,
24
- PLAYGROUND_DIR,
25
- CAPTURES_DIR
26
- ];
27
- const STORED_DIRS = [ASSETS_DIR, CAPTURES_DIR];
28
19
  const FIXTURE_DOCUMENT_EXTENSION = ".json";
29
20
  function isFixtureDocument(path) {
30
21
  return path.endsWith(FIXTURE_DOCUMENT_EXTENSION);
31
22
  }
32
23
  function isStoredPath(path) {
33
- const slash = path.indexOf("/");
34
- const top = slash < 0 ? path : path.slice(0, slash);
35
- if (STORED_DIRS.includes(top)) return true;
36
- return top === "fixtures" && !isFixtureDocument(path);
37
- }
38
- const CAPTURE_FILES = {
39
- bundle: "bundle.zip",
40
- document: "document.pdf"
41
- };
42
- const PLAYGROUND_CANVAS_ISLAND_HOST = "island-canvas-host.mjs";
43
- const PLAYGROUND_FILES = {
44
- host: "host.mjs",
45
- clientShell: `${PLAYGROUND_CLIENT_DIR}/index.html`,
46
- canvasIslandHost: `${PLAYGROUND_CLIENT_DIR}/${PLAYGROUND_CANVAS_ISLAND_HOST}`
47
- };
48
- function playgroundPath(file) {
49
- return `${PLAYGROUND_DIR}/${file}`;
24
+ return path.startsWith(`${ASSETS_DIR}/`);
50
25
  }
51
26
  const SECTION_FILES = {
52
27
  schema: "schema.json",
@@ -72,21 +47,9 @@ function isSectionKey(key) {
72
47
  function publishedSectionKey(templateKey, local) {
73
48
  return `${templateKey}/${local}`;
74
49
  }
75
- function capturePath(fixture, format, file) {
76
- for (const segment of [
77
- fixture,
78
- format,
79
- file
80
- ]) if (!SEGMENT.test(segment)) throw new Error(`"${segment}" cannot name a capture path: one path segment of letters, digits, ".", "_" and "-".`);
81
- return `${CAPTURES_DIR}/${fixture}/${format}/${file}`;
82
- }
83
50
  function isFixtureFilePath(path) {
84
51
  return path !== "" && path.split("/").every((segment) => SEGMENT.test(segment));
85
52
  }
86
- function fixturePath(path) {
87
- if (!isFixtureFilePath(path)) throw new Error(`"${path}" cannot name a fixture file: a relative path of segments of letters, digits, ".", "_" and "-".`);
88
- return `${FIXTURES_DIR}/${path}`;
89
- }
90
53
  function sectionDir(key) {
91
54
  return `${SECTIONS_DIR}/${key}`;
92
55
  }
@@ -160,4 +123,4 @@ function browserFileClashes(binding, paths) {
160
123
  }
161
124
 
162
125
  //#endregion
163
- export { ASSETS_DIR, BUILD_DIR, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_DOCUMENT_EXTENSION, MANIFEST_FILE, PLAYGROUND_CANVAS_ISLAND_HOST, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, STORED_DIRS, TEMPLATE_DIR, TEMPLATE_FILES, UNHASHED_DIRS, assetPath, boundFiles, browserFileClashes, browserFiles, builtPathOf, builtTreePath, capturePath, fixturePath, isBuiltTreePath, isFixtureDocument, isFixtureFilePath, isSectionKey, isStoredPath, isTemplateKey, islandPath, playgroundPath, publishedSectionKey, sectionDir, sectionOfIslandKey, sectionPath, staticPath, templatePath };
126
+ export { ASSETS_DIR, BUILD_DIR, FIXTURES_DIR, FIXTURE_DOCUMENT_EXTENSION, MANIFEST_FILE, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, TEMPLATE_DIR, TEMPLATE_FILES, assetPath, boundFiles, browserFileClashes, browserFiles, builtPathOf, builtTreePath, isBuiltTreePath, isFixtureDocument, isFixtureFilePath, isSectionKey, isStoredPath, isTemplateKey, islandPath, publishedSectionKey, sectionDir, sectionOfIslandKey, sectionPath, staticPath, templatePath };
@@ -11,7 +11,7 @@ const ArtifactSection = z.object({
11
11
  content_hash: Sha256
12
12
  }).strict();
13
13
  const ArtifactManifest = z.object({
14
- artifact_schema: z.literal(5),
14
+ artifact_schema: z.literal(6),
15
15
  framework_version: z.string().min(1),
16
16
  key: z.string().refine(isTemplateKey, "a template key: one path segment"),
17
17
  display_name: z.string().min(1),
@@ -1,4 +1,4 @@
1
- import { ASSETS_DIR, CAPTURES_DIR, FIXTURES_DIR, MANIFEST_FILE, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, TEMPLATE_DIR, TEMPLATE_FILES, UNHASHED_DIRS, boundFiles, browserFileClashes, fixturePath, isFixtureDocument, isFixtureFilePath, isStoredPath, playgroundPath, sectionPath, templatePath } from "./layout.js";
1
+ import { ASSETS_DIR, MANIFEST_FILE, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, TEMPLATE_DIR, TEMPLATE_FILES, boundFiles, browserFileClashes, isStoredPath, sectionPath, templatePath } from "./layout.js";
2
2
  import { sha256Hex } from "./sha256.js";
3
3
  import { sectionContentHash, templateContentHash } from "./hash.js";
4
4
  import { ArtifactManifest, readArtifactSchema } from "./manifest.js";
@@ -9,7 +9,6 @@ const SECTION_FILE_NAMES = new Set(Object.values(SECTION_FILES));
9
9
  const TEMPLATE_FILE_NAMES = new Set(Object.values(TEMPLATE_FILES));
10
10
  const ISLAND_CHUNK = new RegExp(`^${SECTION_ISLANDS_DIR}/[A-Za-z0-9._-]+\\.mjs$`);
11
11
  const FLAT_FILE = /^[A-Za-z0-9._-]+$/;
12
- const CLIENT_SEGMENT = /^(?!\.{1,2}$)[A-Za-z0-9._-]+$/;
13
12
  function readJson(files, path, problems) {
14
13
  const bytes = files.get(path);
15
14
  if (bytes === void 0) {
@@ -44,31 +43,15 @@ function composedSections(composition) {
44
43
  }
45
44
  return keys;
46
45
  }
47
- function verifyArtifact(files, stored = /* @__PURE__ */ new Map()) {
48
- return verify(files, stored, true);
49
- }
50
- const BESIDE_DIRS = /* @__PURE__ */ new Set([
51
- PLAYGROUND_DIR,
52
- FIXTURES_DIR,
53
- CAPTURES_DIR
54
- ]);
55
- function topOf(path) {
56
- const slash = path.indexOf("/");
57
- return slash < 0 ? path : path.slice(0, slash);
58
- }
59
- function verify(files, stored, beside) {
46
+ function verifyBuild(files, stored = /* @__PURE__ */ new Map()) {
60
47
  const problems = [];
61
48
  for (const path of stored.keys()) if (files.has(path)) problems.push({
62
49
  path,
63
50
  message: "is carried both as bytes and as a stored file"
64
51
  });
65
- else if (!beside && topOf(path) !== "assets") problems.push({
66
- path,
67
- message: "is held as a stored file, which only a build's author assets (assets/) may be"
68
- });
69
52
  else if (!isStoredPath(path)) problems.push({
70
53
  path,
71
- message: "is held as a stored file, which only media (assets/, captures/, a fixture's media file) may be"
54
+ message: "is held as a stored file, which only a build's author assets (assets/) may be"
72
55
  });
73
56
  const raw = readJson(files, MANIFEST_FILE, problems);
74
57
  if (raw === null) return {
@@ -76,10 +59,10 @@ function verify(files, stored, beside) {
76
59
  problems
77
60
  };
78
61
  const schema = readArtifactSchema(raw.value);
79
- if (schema !== 5) {
62
+ if (schema !== 6) {
80
63
  problems.push({
81
64
  path: MANIFEST_FILE,
82
- message: schema === null ? `carries no integer artifact_schema; this reader knows ${String(5)}` : `artifact_schema ${String(schema)} is not one this reader knows (it knows ${String(5)})`
65
+ message: schema === null ? `carries no integer artifact_schema; this reader knows ${String(6)}` : `artifact_schema ${String(schema)} is not one this reader knows (it knows ${String(6)})`
83
66
  });
84
67
  return {
85
68
  manifest: null,
@@ -104,30 +87,6 @@ function verify(files, stored, beside) {
104
87
  const slash = path.indexOf("/");
105
88
  const top = slash < 0 ? path : path.slice(0, slash);
106
89
  const rest = slash < 0 ? "" : path.slice(slash + 1);
107
- if (!beside && BESIDE_DIRS.has(top)) {
108
- problems.push({
109
- path,
110
- message: `is not a file of a build folder: ${top}/ rides beside a build, never in it`
111
- });
112
- continue;
113
- }
114
- if (top === "playground") {
115
- const [head, ...inner] = rest.split("/");
116
- if (!(rest === PLAYGROUND_FILES.host || head === "client" && inner.length > 0 && inner.every((part) => CLIENT_SEGMENT.test(part)))) problems.push({
117
- path,
118
- message: `is not the host module or a file under ${PLAYGROUND_DIR}/${PLAYGROUND_CLIENT_DIR}/`
119
- });
120
- continue;
121
- }
122
- if (top === "fixtures") {
123
- if (!isFixtureFilePath(rest)) problems.push({
124
- path,
125
- message: "is not a fixture file's workspace path: relative, of safe segments"
126
- });
127
- else if (isFixtureDocument(rest) && files.has(path)) readJson(files, path, problems);
128
- continue;
129
- }
130
- if (UNHASHED_DIRS.includes(top)) continue;
131
90
  if (top === "sections") {
132
91
  const [template, section, ...inner] = rest.split("/");
133
92
  const key = `${template ?? ""}/${section ?? ""}`;
@@ -155,16 +114,6 @@ function verify(files, stored, beside) {
155
114
  message: "is outside the artifact layout"
156
115
  });
157
116
  }
158
- if (beside) {
159
- for (const file of Object.values(PLAYGROUND_FILES)) if (!files.has(playgroundPath(file))) problems.push({
160
- path: playgroundPath(file),
161
- message: "missing"
162
- });
163
- if (!files.has(fixturePath(manifest.fixture_list))) problems.push({
164
- path: fixturePath(manifest.fixture_list),
165
- message: "the manifest's fixture_list, missing"
166
- });
167
- }
168
117
  const sectionHashes = /* @__PURE__ */ new Map();
169
118
  for (const section of manifest.sections) {
170
119
  for (const file of Object.values(SECTION_FILES)) {
@@ -285,4 +234,4 @@ function verify(files, stored, beside) {
285
234
  }
286
235
 
287
236
  //#endregion
288
- export { verifyArtifact };
237
+ export { verifyBuild };
@@ -29,7 +29,7 @@ type TourValue = {
29
29
  * Responsive descriptor for the POSTER, when `image_ladder` has run over the
30
30
  * same `poster` rendition. Additive and optional, exactly as `VideoValue` carries
31
31
  * it: `<Slot.Image>` over a tour slot renders the poster AS an image
32
- * (`docs/superpowers/specs/2026-08-26-tour-and-video-thumbnails-design.md` D2),
32
+ * (`docs/plans/2026-08-26-tour-and-video-thumbnails-design.md` D2),
33
33
  * and an image the kit renders deserves the `<picture>`/`srcset` treatment a
34
34
  * photo gets. `<Tour>` itself never reads it.
35
35
  */
@@ -31,7 +31,7 @@ type VideoValue = {
31
31
  * ladder rows simply omits this — the renderer falls back to `poster`.
32
32
  *
33
33
  * Exists because `<Slot.Image>` over a video slot renders the poster AS an
34
- * image (`docs/superpowers/specs/2026-08-26-tour-and-video-thumbnails-design.md`
34
+ * image (`docs/plans/2026-08-26-tour-and-video-thumbnails-design.md`
35
35
  * D2), and an image the kit renders deserves the same `<picture>`/`srcset`
36
36
  * treatment a photo gets. `<Video>` itself never reads it.
37
37
  */
@@ -11,7 +11,11 @@ import { build } from "esbuild";
11
11
  const SHIM_NAMESPACE = "concrete-logic-shim";
12
12
  const REACT_NAMESPACE = "concrete-logic-react";
13
13
  const EMPTY_NAMESPACE = "concrete-logic-empty";
14
- const WORKSPACE_RESOLVE = Symbol("concrete-logic-workspace-resolve");
14
+ const PLUGIN_NAMESPACES = [
15
+ SHIM_NAMESPACE,
16
+ REACT_NAMESPACE,
17
+ EMPTY_NAMESPACE
18
+ ];
15
19
  const STYLESHEET_RE = /\.(?:css|scss|sass|less)$/;
16
20
  const ASSET_RE = /\.(?:png|jpe?g|webp|avif|svg|gif|ico|woff2?|ttf|otf|eot|mp4|webm|mov|mp3|wav|pdf|zip)$/;
17
21
  const MODULE_RE = /\.(?:[cm]?[jt]s|[jt]sx)$/;
@@ -68,7 +72,27 @@ function importedNames(source, importer, specifier) {
68
72
  names.delete("default");
69
73
  return names;
70
74
  }
71
- function logicPlugin() {
75
+ function inputPath(key) {
76
+ if (key === "<stdin>") return key;
77
+ if (PLUGIN_NAMESPACES.some((ns) => key.startsWith(`${ns}:`))) return null;
78
+ return nodePath.resolve(process.cwd(), key);
79
+ }
80
+ function resolutionsOf(metafile) {
81
+ const resolutions = /* @__PURE__ */ new Map();
82
+ for (const [key, input] of Object.entries(metafile.inputs)) {
83
+ const importer = inputPath(key);
84
+ if (importer === null) continue;
85
+ const bySpecifier = /* @__PURE__ */ new Map();
86
+ for (const record of input.imports) {
87
+ if (record.external === true || record.original === void 0) continue;
88
+ const target = inputPath(record.path);
89
+ if (target !== null) bySpecifier.set(record.original, target);
90
+ }
91
+ resolutions.set(importer, bySpecifier);
92
+ }
93
+ return resolutions;
94
+ }
95
+ function logicPlugin(resolutions) {
72
96
  return {
73
97
  name: "concrete-logic",
74
98
  setup(api) {
@@ -121,22 +145,12 @@ function logicPlugin() {
121
145
  contents: `export default "";`,
122
146
  loader: "js"
123
147
  }));
124
- api.onResolve({ filter: /.*/ }, async (args) => {
125
- if (args.pluginData === WORKSPACE_RESOLVE) return void 0;
126
- const resolved = await api.resolve(args.path, {
127
- kind: args.kind,
128
- importer: args.importer,
129
- namespace: args.namespace,
130
- resolveDir: args.resolveDir,
131
- with: args.with,
132
- pluginData: WORKSPACE_RESOLVE
133
- });
134
- if (resolved.errors.length > 0 || resolved.external || resolved.namespace !== "file") return void 0;
135
- if (!isLogicWorkspaceModule(resolved.path)) return void 0;
136
- return {
137
- path: resolved.path,
148
+ if (resolutions !== null) api.onResolve({ filter: /.*/ }, (args) => {
149
+ const path = resolutions.get(args.importer)?.get(args.path);
150
+ return path !== void 0 && isLogicWorkspaceModule(path) ? {
151
+ path,
138
152
  sideEffects: false
139
- };
153
+ } : void 0;
140
154
  });
141
155
  api.onLoad({ filter: MODULE_RE }, async (args) => {
142
156
  if (!isLogicWorkspaceModule(args.path)) return void 0;
@@ -168,7 +182,7 @@ function reachedThrough(metafile) {
168
182
  return importers;
169
183
  }
170
184
  async function bundleLogic(what, contents, resolveDir) {
171
- const result = await build({
185
+ const options = (resolutions) => ({
172
186
  stdin: {
173
187
  contents,
174
188
  resolveDir,
@@ -184,12 +198,17 @@ async function bundleLogic(what, contents, resolveDir) {
184
198
  metafile: true,
185
199
  external: [],
186
200
  jsx: "automatic",
187
- plugins: [logicPlugin()],
201
+ plugins: [logicPlugin(resolutions)],
188
202
  logOverride: {
189
203
  "import-is-undefined": "silent",
190
204
  "ignored-bare-import": "silent"
191
205
  }
192
206
  });
207
+ const result = await build(options(resolutionsOf((await build({
208
+ ...options(null),
209
+ minify: false,
210
+ logLevel: "error"
211
+ })).metafile)));
193
212
  const importers = reachedThrough(result.metafile);
194
213
  if (importers.length > 0) throw new Error(`${what}: React reached the logic bundle through ${importers.join(", ")}. A logic bundle carries only declarations and compute closures; take the React call out of whatever these modules keep live (a compute closure, or a top-level call), or hand-list the logic entry. Markup only the render uses is never live.`);
195
214
  const js = result.outputFiles?.[0];
@@ -3,7 +3,7 @@ purpose: Every `concrete` command, with its full flag surface, exit codes and co
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=13.0.0 <14.0.0"
6
+ applies_to: "@homepages/concrete >=14.0.0 <15.0.0"
7
7
  related: [INDEX.md]
8
8
  ---
9
9
  # Command reference
@@ -23,7 +23,8 @@ page. Run `concrete --help` for the same list at the terminal.
23
23
  | [`install`](install.md) | Install the tools the playground runs, at the builds this release pins | `concrete install` |
24
24
  | [`property list`](property-list.md) | List the sample properties a workspace can copy in | `concrete property list [--no-auto-update]` |
25
25
  | [`property add`](property-add.md) | Copy a sample property beside this workspace's fixture list | `concrete property add <slug> [--no-auto-update]` |
26
- | [`publish`](publish.md) | Publish the template to HomePages | `concrete publish [--dry-run] [--json] [--env-file <path>] [--no-auto-update]` |
26
+ | [`publish`](publish.md) | Send the template to the development console | `concrete publish [--json] [--env-file <path>] [--no-auto-update]` |
27
+ | [`release`](release.md) | Hand a version on the development console to HomePages | `concrete release [--version <n>] [--dry-run] [--json] [--env-file <path>] [--no-auto-update]` |
27
28
 
28
29
  ## Global options
29
30
 
@@ -37,7 +38,7 @@ registry, so they work when everything else is broken.
37
38
 
38
39
  ## Staying current
39
40
 
40
- `dev`, `check`, `build`, `property list`, `property add`, `publish` each begin by comparing the workspace's installed
41
+ `dev`, `check`, `build`, `property list`, `property add`, `publish`, `release` each begin by comparing the workspace's installed
41
42
  `@homepages/concrete` with the registry's published release, and then:
42
43
 
43
44
  - **On the published release, or ahead of it** — nothing is said and nothing moves.
@@ -80,7 +81,7 @@ of its flags.
80
81
 
81
82
  ## Versions
82
83
 
83
- These pages describe `@homepages/concrete` **>=13.0.0 <14.0.0**. The range, rather than
84
+ These pages describe `@homepages/concrete` **>=14.0.0 <15.0.0**. The range, rather than
84
85
  the exact version they were generated from: this reference is committed build output,
85
86
  so a page stamped with a patch version would be stale the day it shipped.
86
87
  `concrete --version` prints the installed one.
@@ -3,7 +3,7 @@ purpose: The `concrete build` command — its flags, exit codes and constraints.
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=13.0.0 <14.0.0"
6
+ applies_to: "@homepages/concrete >=14.0.0 <15.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete build
@@ -3,7 +3,7 @@ purpose: The `concrete check` command — its flags, exit codes and constraints.
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=13.0.0 <14.0.0"
6
+ applies_to: "@homepages/concrete >=14.0.0 <15.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete check
@@ -3,7 +3,7 @@ purpose: The `concrete dev` command — its flags, exit codes and constraints.
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=13.0.0 <14.0.0"
6
+ applies_to: "@homepages/concrete >=14.0.0 <15.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete dev
@@ -3,7 +3,7 @@ purpose: The `concrete install` command — its flags, exit codes and constraint
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=13.0.0 <14.0.0"
6
+ applies_to: "@homepages/concrete >=14.0.0 <15.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete install
@@ -3,7 +3,7 @@ purpose: The `concrete property add` command — its flags, exit codes and const
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=13.0.0 <14.0.0"
6
+ applies_to: "@homepages/concrete >=14.0.0 <15.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete property add
@@ -3,7 +3,7 @@ purpose: The `concrete property list` command — its flags, exit codes and cons
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=13.0.0 <14.0.0"
6
+ applies_to: "@homepages/concrete >=14.0.0 <15.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete property list
@@ -3,46 +3,47 @@ purpose: The `concrete publish` command — its flags, exit codes and constraint
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=13.0.0 <14.0.0"
6
+ applies_to: "@homepages/concrete >=14.0.0 <15.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete publish
10
10
 
11
- Publish the template to HomePages.
11
+ Send the template to the development console.
12
12
 
13
13
  ## Synopsis
14
14
 
15
15
  ```bash
16
- concrete publish [--dry-run] [--json] [--env-file <path>] [--no-auto-update]
16
+ concrete publish [--json] [--env-file <path>] [--no-auto-update]
17
17
  ```
18
18
 
19
19
  ## Flags
20
20
 
21
21
  | Flag | Type | Default | What it does |
22
22
  |---|---|---|---|
23
- | `--dry-run` | boolean | `false` | Upload and verify the artifact, report what publishing would change, and write nothing |
24
- | `--json` | boolean | `false` | Print the settled publication record on stdout instead of the summary |
25
- | `--env-file <path>` | string | — | Read `CONCRETE_TOKEN` and `CONCRETE_API_URL` from this dotenv file instead of the workspace's `.env` |
23
+ | `--json` | boolean | `false` | Print the version, its playground link, the merge and the verdict on stdout instead of the summary |
24
+ | `--env-file <path>` | string | — | Read `CONCRETE_CONSOLE_KEY` and `CONCRETE_CONSOLE_URL` from this dotenv file instead of the workspace's `.env` |
26
25
  | `--no-auto-update` | boolean | `false` | Skip the package refresh this command runs first when the workspace is behind the published release |
27
26
 
28
27
  ## Exit codes
29
28
 
30
29
  | Code | When |
31
30
  |---|---|
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, a capture failed, 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 |
31
+ | `0` | the template was sent and the platform loads and renders the version's build |
32
+ | `1` | `check` is not green, the console refuses the send, or the version's build fails verification |
33
+ | `2` | no console key is set, the key is malformed or not accepted, the console cannot be reached or gives no verdict, or it runs outside a workspace |
35
34
 
36
35
  ## Constraints
37
36
 
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.
37
+ - The key is the environment: `CONCRETE_CONSOLE_KEY`, the team's console key, names production, staging or dev in its prefix (`cck_prod_…`), and publish sends to that environment's console. There is no environment flag.
38
+ - Reads `CONCRETE_CONSOLE_KEY` from the environment, then from the workspace's `.env`, and refuses before anything is built or sent when it is missing. `CONCRETE_CONSOLE_URL` replaces the console the key's prefix names.
40
39
  - `--env-file <path>` names the key file instead, relative to the current directory: its values win over the environment and the workspace's `.env` is not read. It is how a library holding one key file per environment picks one, in any shell.
41
- - Builds and checks on every run, then assembles the artifact — the built files, the authored fixtures, the playground and, for an image or document template, the captures — and uploads it. An artifact is never reused.
42
- - An image or document template's captures are every authored fixture at every declared format, taken exactly as `dev`'s *Download* takes it — the enabled pages and their zip, or the PDF. They sit outside the artifact hash, and are taken with the Chromium build the platform renders with: on a machine without it, publish refuses with the one command that installs it.
43
- - Prints one line per stage on stderr as it settles: target, build, upload, verify, write, adopt.
44
- - Publishing a tree the environment already holds as current changes nothing, says so, and exits 0. Rolling back is publishing the older tree.
45
- - Under `--json` the publication record is the only thing written to stdout; every stage line goes to stderr.
40
+ - Builds and checks on every run, then sends the template — the build and the authored fixtures — to the development console, which merges it with the work already there as a new version and serves its playground. Nothing is reused.
41
+ - Then asks the console for the version's verdict: whether the platform loads and renders its build. A failing verdict prints its problems and exits 1; the version stays on the console, and its playground shows the build.
42
+ - Asks nothing of HomePages: a sent version reaches customers only when `concrete release` hands it over. The last line names the `concrete release --version <n>` that does.
43
+ - Prints the version, the playground's link and every fixture where the console's work was replaced or kept, and warns when the build's @homepages/concrete is older than the console's.
44
+ - Prints one line per stage on stderr as it settles: console, build, send, verify.
45
+ - Has no dry run: `concrete release --dry-run` is the run that asks without changing anything.
46
+ - Under `--json` the outcome is the only thing written to stdout; every stage line goes to stderr.
46
47
  - Never prompts, in any environment.
47
48
 
48
49
  ## Before it runs
@@ -0,0 +1,57 @@
1
+ ---
2
+ purpose: The `concrete release` 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 >=14.0.0 <15.0.0"
7
+ related: [reference/cli/INDEX.md]
8
+ ---
9
+ # concrete release
10
+
11
+ Hand a version on the development console to HomePages.
12
+
13
+ ## Synopsis
14
+
15
+ ```bash
16
+ concrete release [--version <n>] [--dry-run] [--json] [--env-file <path>] [--no-auto-update]
17
+ ```
18
+
19
+ ## Flags
20
+
21
+ | Flag | Type | Default | What it does |
22
+ |---|---|---|---|
23
+ | `--version <n>` | string | — | Release this version instead of the template's current one |
24
+ | `--dry-run` | boolean | `false` | Report what releasing would change, and change nothing in HomePages |
25
+ | `--json` | boolean | `false` | Print the release's outcome on stdout instead of the summary |
26
+ | `--env-file <path>` | string | — | Read `CONCRETE_CONSOLE_KEY` and `CONCRETE_CONSOLE_URL` from this dotenv file instead of the workspace's `.env` |
27
+ | `--no-auto-update` | boolean | `false` | Skip the package refresh this command runs first when the workspace is behind the published release |
28
+
29
+ ## Exit codes
30
+
31
+ | Code | When |
32
+ |---|---|
33
+ | `0` | the version was released, HomePages already held its build, or a dry run found it would release |
34
+ | `1` | the console or HomePages refuses the release: the build failed verification, its audience is outside the team's, it drops a format deliverables still hold, or the console holds no such version |
35
+ | `2` | no console key is set, the key is malformed or not accepted, the console cannot be reached, HomePages could not take the release, or it runs outside a workspace |
36
+
37
+ ## Constraints
38
+
39
+ - The key is the environment: `CONCRETE_CONSOLE_KEY`, the team's console key, names production, staging or dev in its prefix (`cck_prod_…`), and release asks that environment's console. There is no environment flag.
40
+ - Reads `CONCRETE_CONSOLE_KEY` from the environment, then from the workspace's `.env`; `--env-file <path>` names the key file instead. `CONCRETE_CONSOLE_URL` replaces the console the key's prefix names.
41
+ - Builds and sends nothing: the console holds every version a send made, its build and its verdict. The template is the one the workspace's `template.ts` declares.
42
+ - Without `--version` the template's current version is released, and the first line names it, with when and with which key its build was sent.
43
+ - Prints the audience, what changed, and how many deliverables are adopting the build. A refusal prints its problems.
44
+ - While the console is still verifying the build or delivering it, release asks again on its own.
45
+ - When HomePages could not take the release it says why and exits 2: nothing says the build is unfit, and the same command can be run again.
46
+ - Under `--json` the outcome is the only thing written to stdout; every other line goes to stderr.
47
+ - Never prompts, in any environment.
48
+
49
+ ## Before it runs
50
+
51
+ This command first checks that the workspace is on the published release of
52
+ `@homepages/concrete` and refreshes it when it is behind inside the same major —
53
+ [Staying current](INDEX.md#staying-current) has the rules. `--no-auto-update` skips that for one run.
54
+
55
+ ## See also
56
+
57
+ - [Every command](INDEX.md) — the rest of the command's surface.
@@ -3,7 +3,7 @@ purpose: The `concrete upgrade` command — its flags, exit codes and constraint
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=13.0.0 <14.0.0"
6
+ applies_to: "@homepages/concrete >=14.0.0 <15.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete upgrade