Uh oh!
There was an error while loading. Please reload this page.
fix(cli): anchor the objectui init scaffold's manifest and drop its dead tailwind.config.js - #4063
Merged
Merged
Conversation
… dead tailwind.config.js (#3892) `commands/init.ts` is the CLI's third package.json generator, and the only one an external user ever sees. It sat outside both gates the other two have: objectui#3711's version-claims scan does not read `.ts` source, and `app-generator.test.ts`'s `DEPENDENCY_ANCHORS` covered only the two temp-app generators. So it asked for `@object-ui/*` at `^2.0.0` against packages publishing at 17.x — objectui#3827's defect, one generator over — while its nine toolchain ranges drifted, two of them by a major. Not one range is written in `init.ts` now. A new `utils/scaffold-dependencies.ts` owns the values all three generators read: the derived platform range, React's root pin, and the shared devDependency map. The anchor table judges the union of the three manifests, and judges every manifest that declares a name rather than the first one found — one generator anchored while another fossilises is exactly the state this fixes, and a first-match read would have reported it green. The `tailwind.config.js` the scaffold wrote is deleted for the reason objectui#3852 deleted the temp app's: the pipeline is v4 end to end, and v4 reads a JS config only when a stylesheet points `@config` at one. None does. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 10, 2026 03:01
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#3892
Route taken: the durable gate
The card left one cell open — anchor the init manifest back to the repo item by item (generalising
DEPENDENCY_ANCHORSto a third generator), or just derive the@object-ui/*ranges and bump the rest. Taken: the durable gate, and one step further than the card sketched.The reasoning is the one
platformPackageRange's own doc comment already makes for its case: a literal here is not merely a fossil risk, it is a fossil generator. Anchoringinit.ts's literals to the repo would leave thirteen literals that a test tells you are stale — better than today, but it re-pays the drift every time the repo moves. Soinit.tsnow writes no range at all. A newpackages/cli/src/utils/scaffold-dependencies.tsowns the values, all three generators read them, and a repo-side bump reaches all three in one edit.That module is where
platformPackageRange(),cliVersion(),REACT_RANGEand the shared devDependency map now live;utils/app-generator.tsreads them from there instead of declaring them. A note on the dispatch's mechanism assumption, which did not hold:platformPackageRange()was not exported and could not simply be reused — it was a module-privatefunctionatapp-generator.ts:200, as werecliVersion(),REACT_RANGEandAPP_DEV_DEPENDENCIES. Extracting rather than exporting-in-place is what makes "one table, three generators" true of the source and not only of the test.What changed
utils/scaffold-dependencies.ts(new) — the single source for every generated range. Carries the objectui#3827 / objectui#3852 rationale that came with the moved code.commands/init.ts— the manifest is extracted into an exportedbuildInitPackageJson(name)so it can be judged without running the command, and every value in it now comes from the shared module. Thetailwind.config.jswrite is gone, with a comment where it was saying why.utils/app-generator.ts— reads the shared module;APP_DEV_DEPENDENCIESbecomesSCAFFOLD_DEV_DEPENDENCIESthere. No behaviour change: the two temp-app manifests are byte-identical to before.__tests__/app-generator.test.ts—DEPENDENCY_ANCHORSnow judges three manifests. Two changes worth naming, not one:routed ?? plain ?? initwould have reported the exact state this PR fixes as green — the app generators were anchored while init fossilised, and a first-match read never looks at init.__tests__/cli-bin.test.ts— the absence oftailwind.config.jsand the derived@object-ui/*range are asserted through the real bin, becauseinit()writes withfsdirectly: an absence is only meaningful where the writes happen, and only an end-to-end read provesinit()writes the manifest the anchor gate judges. Theinitdescribe now scaffolds inbeforeAll, so three assertions do not silently depend on test ordering.Reverse verification
Direction predicted before running: plain red. This rule compares a generated string against a repo fact, with no schema underneath it to re-judge the same input differently, so none of objectui#5009's inversion applies.
Restoring the pre-fix literals and the
tailwind.config.jswrite:The failure message naming
init manifest'sis itself the evidence that the per-generator loop, rather than a first-match read, is what caught it.A fourth test —
names every range the pre-fix init manifest had drifted on— stays green under that revert by design: it feeds the anchor rule the literal map that shipped and asserts all 13 ranges are judged wrong. Thirteen, not the two the title reports, is the measured size of the drift.Verification
Run from the repo root without a
--separator, per this repo's vitest guard (objectui#3288 / objectui#3378).One interaction to flag, deliberately not fixed here
Removing
tailwind.config.jsmeansobjectui doctorin a freshly scaffolded project now prints⚠️ tailwind.config.js not foundand counts an issue. That is #3891's defect, not one this PR introduces:doctor.ts:52-74treats the absence of a v4-unread file as a problem, which is why runningobjectui doctorat this repo's own root already misreports today (the repo carries zerotailwind.config.*files). This PR makes the scaffold behave like the repo itself rather than creating a new case. #3891 is held to a later round anddoctor.tsis untouched here.Out-of-scope findings
Measured while verifying this card's premise, filed unassigned, not fixed here:
objectui initscaffolds an app whose component registry is empty: generatedsrc/App.tsxnever imports@object-ui/components, so every node renders "Unknown component type" #4061 — the scaffold's generatedsrc/App.tsximports only@object-ui/react, never@object-ui/components, and registration is a side effect of that import (packages/components/src/index.ts:100-105).@object-ui/reactdoes not depend on it, so the registry is empty andSchemaRenderer.tsx:430rendersUnknown component typefor every node of all three templates. The manifest declares the package it never imports — objectui#3755's direction.objectui initwrites ansrc/index.csswith no@import "@object-ui/components/style.css", so the scaffolded app gets none of the library's styles — the one import quick-start and #3884's measurement both call load-bearing #4062 — the scaffold'ssrc/index.cssis@import 'tailwindcss';and nothing else, missing@import "@object-ui/components/style.css"(a real export:"./style.css": "./dist/index.css"). quick-start 教的两条 @source node_modules 行是冗余的:实测多产 100 kB CSS、14 条没人用的选择器,且补不回它看似要补的主题 utility #3884's measurements are what make this precise: theme utilities exist only where the unpublished@themeblock compiles, so the prebuilt sheet is the only source, and it is a strict superset of what scanning yields. My first hypothesis — missing@sourcelines — is the one quick-start 教的两条 @source node_modules 行是冗余的:实测多产 100 kB CSS、14 条没人用的选择器,且补不回它看似要补的主题 utility #3884 falsifies, and is recorded there as wrong.Both are changes to the generated sources, outside this card's completion scope, so they are standalone rather than sub-issues.
Generated by Claude Code