Uh oh!
There was an error while loading. Please reload this page.
docs(components): stop restating the shadcn classification in README_SHADCN_SYNC.md, pin what survives - #4939
Conversation
…survives `README_SHADCN_SYNC.md` published the component classification as prose — a 46-name "can be updated from the registry" census and a 14-name "should NOT be auto-updated" one — while `shadcn-components.json` is what `shadcn-sync.js` actually reads. Nothing held the two together and they had drifted three ways (objectui#3881): - `resizable` was listed as registry-updatable, though the manifest entry records that re-syncing it BREAKS THE BUILD (upstream still ships the react-resizable-panels v3 file, importing two names v4 does not export). A reader following the page performed the breaking action. - `chart` was in the manifest's `components` and absent from the page. - the custom heading said 14 against the manifest's 15. The `(46)` total still matched, because the two membership errors cancelled out — so this pins member SETS and deliberately no counts. The censuses are deleted rather than corrected: correcting them would leave a hand-maintained copy of a machine-readable fact to drift again. The page now states what the two categories mean and points at `pnpm shadcn:list`, which prints both from the manifest with no network. `## Files` now gives repo-relative paths (the sync script has always been at the repo root, not in this directory), and `shadcn:list` is no longer filed under "Requires Internet". One enumeration survives, because getting it wrong breaks the build rather than merely going stale: the diverged set (`customComponents` entries carrying `divergedFrom`). `readme-shadcn-sync-categories.test.ts` holds it to the manifest in both directions, guards that the censuses stay gone, and checks the backticked in-repo paths — no link gate can see this file, since the per-package doc-link scan root matches the exact filename `README.md`. Co-authored-by: Claude <noreply@anthropic.com>
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
commented
Aug 17, 2026
PM 验收:ACCEPT(#3881,批次 18,PM 会话 实施(方向 2+3,以减法执行):两处散文普查(46/14)删除而非修正 —— 修正等于留下会再漂移的手抄副本;README 改述两个 manifest 对象的语义并指向 实物核验(已过):3 文件 +464/−39 对账;manifest 零触碰且经磁盘对证一致(resizable.tsx 自己的文件头独立记载不可重同步 —— 无需第二张卡);标识 0;releases 0。 反向验证(五变异全中):A 加 manifest 外名字 → 预判双面红(该名恰是 components 键,两钉齐红是预判不是撞见);B manifest 侧镜像 #3881 原形 → 三钉红且空集分支正确触发;C 防空绿锚探针(改锚文字使 reader 失配 → 两钉红而非静默 有据克制(接受):卡面可选修法 3(扩 check-doc-links 扫描面)按先例链判为独立门扩张卡,立 #4938(含 15 文件、1 处实测死链的入场测量)而非顺手扩围 —— 划界正确。 CI(亲读终态):20 项全 completed,18 success + 2 skipped,零失败。 → undraft + auto-merge (SQUASH)。 Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#3881
前提复核(
origin/main@25c8007d4,逐条实测)三处矛盾全部现存,premise 成立:
resizablecustomComponents,条目自述「重同步会构建失败」chartcomponents(registry 同步)(14),正文 14 条customComponents实为 15 条机械比对(README 枚举 ↔ manifest 键集)输出:
卡面最关键那句实测成立:两侧计数都是 46,
(46)在整个缺陷期间都对得上,因为两处成员错误刚好互相抵消(多算resizable、漏掉chart)。manifest 与磁盘一致,没有第二处缺陷需要另立卡:
packages/components/src/ui/resizable.tsx的文件头自己写明它不再是 upstream 同步文件、重同步会挂(v4 已把PanelGroup/PanelResizeHandle改名),与 manifest 的分类同向。manifest 是真源,漂的是 README。外加卡面记的路径漂移一处:
## Files称shadcn-sync.js在本目录,实际一直在仓根scripts/shadcn-sync.js。实施(按分诊非绑定方向 2+3)
散文停止枚举成员。 两份点名清单(46 + 14)整段删除,不是逐条校正 —— 校正只会把同一个漂移生成器重新上膛(#3767 / #3724 同族)。改为讲两类的含义(
components会被pnpm shadcn:update拉取覆写;customComponents一律跳过),成员归属指向 manifest 与pnpm shadcn:list。这个指向已实测兑现:
listComponents()只调loadManifest(),不碰网络,两类都打印,并把每条 custom 的原因一并打出来(含 resizable 那句 "re-syncing would break the build")—— 严格强于原散文。顺带把shadcn:list从「Requires Internet」小节下挪出并新增一个 Offline 小节,否则新指向自相矛盾。幸存的唯一枚举 = diverged 集合,且入钉。
customComponents里带divergedFrom的那一类不是「天生 custom」,而是曾是 Shadcn、被手工迁过破坏性升级,upstream 仍在发的版本在本仓编译不过。这一条的误读代价不是「清单陈旧」而是构建挂掉,读者必须不跑命令就看得见 —— 所以名字保留,并由钉子按成员集合双向对住 manifest。⛔ 不钉计数。 如上,
(46)在整个缺陷期间都是绿的;计数钉在这里不是弱守卫,是假守卫。钉子里没有任何总数断言。钉子:
packages/components/src/__tests__/readme-shadcn-sync-categories.test.ts照 #4860 / PR #4893 的 README 键表钉形态(双向 + 非空下限 + 无重复;期望集一律从源头解析,绝不硬编码 —— 硬编码
resizable等于把同一个缺陷搬高一层),共 5 条:divergedFromdivergedFrom的,README 必须都列(packages/components/README_SHADCN_SYNC.md 的组件清单与 shadcn-components.json 相互矛盾:resizable 被标成"可从 registry 更新"(manifest 说重同步会构建失败)、chart 缺席、custom 计数 14≠15 #3881 缺陷本体方向)components/customComponents必须是划分(无交集)+ 空集情形显式处理## Component Categories散文不得点名任何components键 —— 让这次「删除」不被悄悄撤销第 3 条的空集处理值得单说:
resizable在 upstream 为 v4 重新生成后回到components是预期未来,不是缺陷,所以没有用「会在那天变红」的下限,而是写成 iff —— manifest 不标任何 diverged 时,README 的该小节必须一并消失。围栏代码块在判定前被剥掉,所以 Usage 小节里pnpm shadcn:update button这类合法命令示例不受第 4 条约束。钉子落在
packages/components包内测试邻域(README 与 manifest 都是该包的文件),进unitproject(纯 fs 读、node 环境,无需 build 依赖)。反向验证(先书面预判,后跑;变异前已 commit,还原一律
git checkout,⛔ stash)五次变异,预判与实测逐条相符:
chart)2 failed | 3 passed✔resizable从customComponents挪进components3 failed | 2 passed✔,钉 3 命中空集分支的正确文案Currently diverged:(reader 停止匹配)2 failed | 3 passed✔## Component Categories标题4 failed | 1 passed✔1 failed | 4 passed✔A 与 B 各证一面(README 侧 / manifest 侧);A 落在两条钉上而非一条,是因为
chart同时是components的键,钉 4 也会命中 —— 这一点预判时已写明。C 是零命中断言的防空绿正查:锚点一旦失配,两条toEqual([])会双双退化成 no-op,C 证明它们反而变红(钉 2 与钉 3 各报一句可执行的修法)。验证
全部重验证走共享锁
/tmp/os-heavy-verify.lock。changeset 用空 frontmatter(纯文档 + 钉,无发布语义;packages/components/src/**触发门禁,空 frontmatter 是该门禁写明的完整答案)。相邻发现(未扩围)
已另立 finding 卡 #4938:
check-doc-links的包级扫描面是精确文件名匹配,包内非 README markdown(15 个文件)从未被任何门禁解析过,实测 1 条死链(TIMELINE.md指向不存在的 prototype app)。#3881 可选修法 3 提过「顺带把包内 README* 纳入扫描面」,本 PR 刻意未取 —— 那是独立的门禁扩面,有自己的入场价,按 #3536 → #3572 → #3603/#3622 → #4148 的先例链每次都是独立一张卡;本 PR 只在包内测试里把这一个文件的反引号路径局部钉住(钉 5)。未改动
shadcn-components.json(真源,无需改)、content/docs/releases/**、scripts/shadcn-sync.js、任何src/ui/**组件文件。无 force-push。Generated by Claude Code