Skip to content

Commit a811401

Browse files
committed
devx(sdui): re-record the manifest per registry package; move the record's readers
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SMJGPXxFBpbgAgXdnsXKVS
1 parent e4f05e0 commit a811401

31 files changed

Lines changed: 67 additions & 53 deletions

‎docs/releases-maintenance.md‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ ships the Console from the same commit as the spec it builds against.
5555
> root `.changeset/` before the first joint Version PR is #25831. New frontend
5656
> changesets go in the root `.changeset/`.
5757
58-
#### After a registry change: regenerate the committed manifest (#12924, #17735, #25712)
58+
#### After a registry change: regenerate the committed manifest (#12924, #17735, #25712, #26051)
5959

6060
The repo-root `sdui.manifest.json` (ADR-0080, the Console's public-tier component
61-
manifest) and its provenance record `scripts/sdui-manifest.record.json` are
62-
generated, and one command writes them:
61+
manifest), its provenance record `scripts/sdui-manifest.record.json` and one record
62+
per registry package under `scripts/sdui-manifest.sources/` are generated, and one
63+
command writes them:
6364

6465
```bash
6566
node scripts/gen-sdui-manifest-node.mjs # no arguments
@@ -68,14 +69,20 @@ node scripts/gen-sdui-manifest-node.mjs # no arguments
6869
It builds the registry packages under `ui/packages/`, enumerates them from
6970
`ui/apps/console` under plain Node, and serializes them through
7071
`@objectstack/sdui-parser` (it needs `packages/sdui-parser/dist`:
71-
`pnpm --filter @objectstack/sdui-parser build`). The record carries an `inTree`
72-
block with a digest of the registry packages' `src/`.
72+
`pnpm --filter @objectstack/sdui-parser build`). Each package record is one line:
73+
a digest of that package's own `src/` and the `sha256` of the artefact it was
74+
verified against. A run rewrites only the records whose line changed, so a PR that
75+
edits one registry package re-records that package alone; the shared record moves
76+
only when the artefact does, and then every package record names the new `sha256`.
7377

74-
A required lint step reads the tracked pair on **every PR**:
78+
A required lint step reads the tracked files on **every PR**:
7579
`node scripts/check-sdui-manifest.mjs` checks the shape, the `sha256` against the
76-
record, and recomputes the source digest from the index. A PR that edits a registry
77-
package's source without regenerating goes red there, and the failure text prints
78-
the regeneration call. ⛔ There is no npm install route to the manifest; that was
80+
record, and recomputes each package's source digest from the index. A PR that edits
81+
a registry package's source without regenerating goes red there, naming the package,
82+
and the failure text prints the regeneration call. Two PRs that edit different
83+
registry packages touch different record files and do not conflict; two that edit
84+
the same package, or a PR that changes the artefact, still conflict once, and the
85+
later one merges `main` and re-runs the command. ⛔ There is no npm install route to the manifest; that was
7986
deleted by ruling 丙 on #17735.
8087

8188
**One producer, one artefact.** `packages/console/build-dist.sh` copies the tracked

‎scripts/check-changeset-no-major.mjs‎

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,9 +1365,10 @@ export function publishedSourceOwners(path, manifestOf) {
13651365
// packed output — one path — and never which files it copies: the day the
13661366
// console build ships a second tracked file, this leg sees it with no edit
13671367
// here, and the day it stops copying the manifest, the leg stops claiming it.
1368-
// `scripts/sdui-manifest.record.json` is measured OUT for that reason rather
1369-
// than by choice: the build reads it for a warning line and does not copy it,
1370-
// so it is not part of the shipped artefact.
1368+
// `scripts/sdui-manifest.record.json` and the per-package records under
1369+
// `scripts/sdui-manifest.sources/` are measured OUT for that reason rather than
1370+
// by choice: the build does not copy them, so they are not part of the shipped
1371+
// artefact.
13711372
//
13721373
// ⚠️ Residual, stated rather than implied: the reader understands the plain
13731374
// shell the script is written in — `NAME="value"` assignments, `$NAME` /
@@ -4875,8 +4876,8 @@ function selfTest() {
48754876
`this repository's ${PACKED_COPY_BUILD_SCRIPTS[0]} copies the repo-root sdui.manifest.json into packages/console/dist/ as read by this leg — got ${JSON.stringify(realPairs)}`,
48764877
);
48774878
assert(
4878-
!realPairs.some((p) => p.source === 'scripts/sdui-manifest.record.json'),
4879-
`measured, not chosen: the real build does not ship the manifest record — got ${JSON.stringify(realPairs)}`,
4879+
!realPairs.some((p) => p.source === 'scripts/sdui-manifest.record.json' || p.source.startsWith('scripts/sdui-manifest.sources/')),
4880+
`measured, not chosen: the real build ships neither the manifest record nor a package record — got ${JSON.stringify(realPairs)}`,
48804881
);
48814882

48824883
// ── The owner of a destination ────────────────────────────────────────
@@ -4956,14 +4957,21 @@ function selfTest() {
49564957
const no = levelOf(copyRepo({ head: { ...PR22812, '.changeset/console-bbbb.md': changeset([[CONSOLE, 'patch']]) } }), declaredNo);
49574958
assert(no.result.verdict === 'none-clean' && no.exitCode === 0, `the manifest moved under \`Clause-②: no\` + \`none\` is unaffected — got ${no.result.verdict} / ${no.exitCode}`);
49584959

4959-
// The record moves with every regeneration but ships nothing.
4960+
// The records move with regeneration but ship nothing: the shared one, and
4961+
// the one-line record of the registry package a ui PR re-recorded.
49604962
const recordOnly = levelOf(
4961-
copyRepo({ head: { 'scripts/sdui-manifest.record.json': '{"objectuiSha":"bbbb"}\n', '.changeset/console-bbbb.md': changeset([[CONSOLE, 'patch']]) } }),
4963+
copyRepo({
4964+
head: {
4965+
'scripts/sdui-manifest.record.json': '{"objectuiSha":"bbbb"}\n',
4966+
'scripts/sdui-manifest.sources/plugin-grid.json': '{"package":"ui/packages/plugin-grid"}\n',
4967+
'.changeset/console-bbbb.md': changeset([[CONSOLE, 'patch']]),
4968+
},
4969+
}),
49624970
yesWidening,
49634971
);
49644972
assert(
49654973
recordOnly.touched.packages.length === 0 && recordOnly.touched.unreadable.length === 0 && recordOnly.result.verdict === 'clean',
4966-
`control: the record alone moves no published file — got ${JSON.stringify(recordOnly.touched)} / ${recordOnly.result.verdict}`,
4974+
`control: the records alone move no published file — got ${JSON.stringify(recordOnly.touched)} / ${recordOnly.result.verdict}`,
49674975
);
49684976

49694977
// #4690 on this leg: a build script that is THERE but yields no copy is

‎scripts/gen-sdui-manifest-node.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ if (pinned) {
460460
console.error(
461461
`✓ ${recordMoved ? 're-recorded' : 'left unchanged'} scripts/sdui-manifest.record.json in-tree — ${SOURCE} ${MODULES_ROOT_REL}, ` +
462462
`@object-ui/core workspace version ${nextRecord.inTree.objectuiWorkspaceVersion}` +
463-
(carried.sha256 ? ` (artefact unchanged since ${nextRecord.generatedAt}, so the record is carried)` : '') +
463+
(carried.sha256 ? ` (artefact unchanged since ${nextRecord.generatedAt}: its date and version are carried)` : '') +
464464
'; ' +
465465
(carried.objectuiSha ? `pin fields kept (artefact unchanged since pin ${carried.objectuiSha.slice(0, 12)})` : 'no pin fields'),
466466
);

‎scripts/sdui-manifest.record.json‎

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
"scripts/gen-sdui-manifest-node.mjs, the one producer (ruling 丙 on #17735): it builds the registry packages under",
66
"ui/packages/, then enumerates them from `inTree.modulesRoot` exactly as ui/apps/console/dev/manifest-dump.tsx",
77
"does: eager-import the 16 registry modules, ComponentRegistry.getPublicConfigs(), manifestFromConfigs from",
8-
"@objectstack/sdui-parser. `inTree.registrySourcesSha256` digests those packages' src/ as the index holds them;",
9-
"`scripts/check-sdui-manifest.mjs` recomputes it, so a registry source edit without regeneration goes RED there.",
10-
"`inTree.objectuiWorkspaceVersion` is provenance, not a verdict (#25712). Pin-keyed fields, where present, say the",
11-
"artefact is byte-identical to the one generated at that pin.",
8+
"@objectstack/sdui-parser. Each registry package has a one-line record under `inTree.registryRecords` (#26051): a",
9+
"digest of that package's own src/ as the index holds them, and the sha256 of the artefact it was verified against.",
10+
"`scripts/check-sdui-manifest.mjs` recomputes every digest, so a registry source edit without regeneration goes RED",
11+
"there naming the package. This record moves only with the artefact; a run where only sources moved re-records only",
12+
"their packages. `inTree.objectuiWorkspaceVersion` is provenance, not a verdict (#25712). Pin-keyed fields, where",
13+
"present, say the artefact is byte-identical to the one generated at that pin.",
1214
"Regenerate + re-record: node scripts/gen-sdui-manifest-node.mjs"
1315
],
1416
"source": "built-tree",
@@ -19,36 +21,6 @@
1921
"inTree": {
2022
"modulesRoot": "ui/apps/console",
2123
"objectuiWorkspaceVersion": "18.1.0",
22-
"registryPackages": [
23-
"ui/packages/components",
24-
"ui/packages/core",
25-
"ui/packages/data-objectstack",
26-
"ui/packages/fields",
27-
"ui/packages/i18n",
28-
"ui/packages/mobile",
29-
"ui/packages/permissions",
30-
"ui/packages/plugin-calendar",
31-
"ui/packages/plugin-charts",
32-
"ui/packages/plugin-dashboard",
33-
"ui/packages/plugin-detail",
34-
"ui/packages/plugin-form",
35-
"ui/packages/plugin-gantt",
36-
"ui/packages/plugin-grid",
37-
"ui/packages/plugin-kanban",
38-
"ui/packages/plugin-list",
39-
"ui/packages/plugin-map",
40-
"ui/packages/plugin-markdown",
41-
"ui/packages/plugin-report",
42-
"ui/packages/plugin-timeline",
43-
"ui/packages/plugin-tree",
44-
"ui/packages/plugin-view",
45-
"ui/packages/providers",
46-
"ui/packages/react",
47-
"ui/packages/react-runtime",
48-
"ui/packages/sdui-parser",
49-
"ui/packages/types"
50-
],
51-
"registrySources": 922,
52-
"registrySourcesSha256": "0e127be18a1104d857822dc5c71a6380e4f00b0db729cd8b8a230a11c120fe78"
24+
"registryRecords": "scripts/sdui-manifest.sources"
5325
}
5426
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"package":"ui/packages/components","sources":226,"sha256":"7c50070c8bc750d5717fce0a081038855777bfb749567757047e672262517886","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"package":"ui/packages/core","sources":110,"sha256":"c4ca58ee32a488b2139abc179f34d5606ba0d89b86fccf8bd5c4d7b69d07f654","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"package":"ui/packages/data-objectstack","sources":10,"sha256":"83f94a01a5e9704df262bda723b1dd58c619d66ec70f9dc22476cc7146e8d97a","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"package":"ui/packages/fields","sources":96,"sha256":"89537e9f86037ddb8d0c6ce1a9fbcfbc8d756fd38b1a990c2c5ccc277a359d1a","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"package":"ui/packages/i18n","sources":31,"sha256":"683731eac82c00f4ffa54852f8ebfd947b5c95ad70847d8e2dc55ff66adbe25a","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"package":"ui/packages/mobile","sources":16,"sha256":"c0a5f99d3fcf9231f398a16b7c62814de505b2de6118ed667da4f93d7cf9ba9a","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}

0 commit comments

Comments
 (0)