What was observed
PR #6403 (for #4929) added scripts/build-plugin-stylesheet.mjs — the components-sheet subtraction, its normalisation of Tailwind's inlined var() fallbacks, its at-rule context keys and its four write-time assertions — as shared code, so @object-ui/plugin-grid and @object-ui/plugin-kanban each need only a wrapper naming their sentinels and ceiling.
packages/fields/scripts/build-css.mjs still carries its own copy of that logic. It came first and is where the reasoning was worked out (objectui#4059); the shared module is that file generalised over packageRoot. There are now two implementations of one subtraction, and a fix to either can silently not reach the other.
Why it was not done in PR #6403
@object-ui/fields is a published package and its stylesheet is a published artifact. Rewriting its build belongs in a change that verifies the output byte for byte against the current one, which is a different piece of work from adding two new sheets — and the 2026-08-17 ruling scoped that card to plugin-grid + plugin-kanban.
What a fix looks like
- Point
packages/fields/scripts/build-css.mjs at createPluginStylesheetBuilder from scripts/build-plugin-stylesheet.mjs, keeping its own MUST_SURVIVE, its CLASS_CEILING of 600 and its header rationale.
- Prove the emitted
packages/fields/dist/index.css is byte-identical before and after (the current build prints 22.22 kB, 167 rules kept (163 classes) on this tree, which is the reading to reproduce).
- Keep whatever fields does that the shared module does not model — if anything survives that check, it belongs in the shared module or in a documented per-package hook, not in a second copy.
Filed unassigned, as an observation from the #4929 implementation.
Generated by Claude Code
Generated by Claude Code
What was observed
PR #6403 (for #4929) added
scripts/build-plugin-stylesheet.mjs— the components-sheet subtraction, its normalisation of Tailwind's inlinedvar()fallbacks, its at-rule context keys and its four write-time assertions — as shared code, so@object-ui/plugin-gridand@object-ui/plugin-kanbaneach need only a wrapper naming their sentinels and ceiling.packages/fields/scripts/build-css.mjsstill carries its own copy of that logic. It came first and is where the reasoning was worked out (objectui#4059); the shared module is that file generalised overpackageRoot. There are now two implementations of one subtraction, and a fix to either can silently not reach the other.Why it was not done in PR #6403
@object-ui/fieldsis a published package and its stylesheet is a published artifact. Rewriting its build belongs in a change that verifies the output byte for byte against the current one, which is a different piece of work from adding two new sheets — and the 2026-08-17 ruling scoped that card toplugin-grid+plugin-kanban.What a fix looks like
packages/fields/scripts/build-css.mjsatcreatePluginStylesheetBuilderfromscripts/build-plugin-stylesheet.mjs, keeping its ownMUST_SURVIVE, itsCLASS_CEILINGof 600 and its header rationale.packages/fields/dist/index.cssis byte-identical before and after (the current build prints22.22 kB, 167 rules kept (163 classes)on this tree, which is the reading to reproduce).Filed unassigned, as an observation from the #4929 implementation.
Generated by Claude Code
Generated by Claude Code