Uh oh!
There was an error while loading. Please reload this page.
feat(scripts): check-doc-links 扫描面第四扩 packages/*/README.md,并付清入场价的 11 条死链 (#3622) - #3649
Merged
Merged
Conversation
… 条死链 (#3622) 先量后付的第四次:红账先清零,再加扫描行,门禁首跑对真仓即绿。 11 条死链逐条查证后处置(全部改指实测存在的真实页,零删除): - 三条 /api/PKG(components/core/react)——站点从来没有这个路由段 (apps/site/app/api 下只有 search/route.ts)。components 改指 /docs/components(Component Gallery,#3629 给 vscode-extension 用过 的同一页),core 改指 /docs/api(站点自称的 API Reference 总页), react 改指 /docs/core/schema-renderer(它主导出的参考页)。 - 四条指向 content/docs 下无 index 页的目录(core/fields/layout x2)—— fumadocs 不为裸目录生成路由,#3603 正文的复核脚本把裸目录也算作候选 才误判为绿。core 改指 /docs/guide/architecture(Package Structure 一节 逐包说明 @object-ui/core),fields 改指 /docs/guide/fields(Field Registry, 正是该包的文档),layout 的 API Reference 改指 /docs/layout/app-shell、 Links 改指 /docs/guide/layout。 - /docs/types 完全不存在 → 改指 /docs/api/schema-reference,该页开头写着 「All types are available from @object-ui/types」。 - /examples 不是站点路由(#3490 已确认)→ 改指 github.com/objectstack-ai/objectui/tree/main/examples,与 content/docs/utilities/vscode-extension.mdx 里同一条链接的写法一致。 - 两条磁盘路径:docs/SHADCN_SYNC.md 从未存在,真正的完整指南是同包的 README_SHADCN_SYNC.md(278 行);vscode-extension 没有 LICENSE 文件 (39 个包里 4 个没有),按该 README 已有的仓根文件写法改指 blob/main/LICENSE。 扫描行沿用 disk 规则:包 README 在 npm 与 GitHub 上被阅读,相对链接是 磁盘路径语义,与 examples/README/CONTRIBUTING/ROADMAP/docs 同类,无需新 规则类。同一条理由也决定了上面修好的站内链接必须保留 origin——GitHub 与 npm 都把开头的 / 解析到它们自己的域名。 该行是表里唯一带通配符的一条,故 collectFiles 增加 expandWildcard():只 认整段的 *,再复杂的写法直接抛错而不是静默匹配零个路径——扫描面被悄悄 丢掉是这个门禁唯一不能有的失效模式。 测试:SCAN_ROOTS 的 toEqual 与逐根 count 扩写;新根另加「可判定 href 数」 下限(200 条,其中 47 条站内绝对 URL),因为文件数只能证明通配符展开了, 证明不了这批文件里有东西可判;新增 7 条用例覆盖四种死链形状、通配符展开、 只收 README 的边界、packages/node_modules 排除、disk 与 docs 规则的对照对, 以及非整段通配符抛错。 逆向验证(方向先定后跑):植入两条死链(相对磁盘路径 + 站内绝对 URL 各一) → 门禁红,正是那 2 条;仅撤掉扫描行、死链留在原地 → 绿,证明是该行在干活; 还原后 7 根全绿。测试层同样验证:撤行后恰好 7 条用例红,唯二直接调 collectFiles 的两条保持绿——与预测一致。 不加 changeset:改的是包 README 的链接与 CI 脚本,不触发任何包的版本 发布,与 #3589/#3629 仓例一致。 Fixes#3622Fixes#3603 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
The latest updates on your projects. Learn more about Vercel for GitHub. |
原句写成「Each was resolved to a real page, or dropped where none exists」, 但本次 11 条逐条都找到了实测存在的对位页面,零删除。措辞改准,并点明与 #3603 那 9 条的差别:那 6 条删掉是因为它们假设了一整个从未写过的 /docs/packages/... 命名空间,本单这 11 条各自都有真实归属。 顺带把「七个包,其中五个 #3603 从未打开」一句的中英夹缠语序理顺。纯注释, 零行为改动。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 7, 2026 17:06
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 7, 2026
Merged
akarma-synetal pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 10, 2026
…d READMEs carry (objectstack-ai#3664) (objectstack-ai#3695) `packages/plugin-tree/README.md` was the only one of the 38 published packages that had a README but no `## License` section. Census over origin/main: - 38 published (non-private) packages - 37 have a README (`sdui-parser` has none — out of scope, see objectstack-ai#3647) - 36 of those 37 carry `## License`; plugin-tree was the sole omission The section is copied verbatim from the dominant form, 32 of the 36: ## License MIT — see [LICENSE](./LICENSE). The four minority spellings are `MIT` (types, react-runtime) and `MIT © ObjectStack Inc.` (plugin-timeline, plugin-chatbot). The issue suggested plugin-timeline as the exemplar, but that form is 1-of-36 and carries no `./LICENSE` link at all — the majority form is both the convention and the one that gives the link gate something to check. Position matches too: final section, as in 34 of the 36 (plugin-view and types continue past it). This also closes the gap objectstack-ai#3664 identified: `check-doc-links.mjs` scan root 7 (`packages/*/README.md`, `disk` rule) resolves relative hrefs as repository paths, so the new `./LICENSE` link is now mechanically checked against the file PR objectstack-ai#3662 landed. Previously the README linked nothing, which is exactly why the objectstack-ai#3622/objectstack-ai#3649 dead-link sweep could not detect the missing LICENSE — no link, no dead link. Verified the new link is load-bearing rather than vacuously green: temporarily removing `packages/plugin-tree/LICENSE` turns the gate red with `packages/plugin-tree/README.md:50 -> ./LICENSE` (exit 1); restoring it returns `Links are valid across 7 scan roots` (exit 0). No changeset: documentation-only, matching the precedent of PR objectstack-ai#3662 (which added this same package's LICENSE, likewise shipped in the tarball) and PR objectstack-ai#3688 (36 package READMEs), neither of which carried one. Fixesobjectstack-ai#3664 Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt Co-authored-by: Claude <noreply@anthropic.com>
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#3622
Fixes#3603
先量后付的第四次。红账先清零,再加扫描行——门禁首跑对真仓即绿,而这 11 条正是它的验收语料。父单 #3603 的门禁第 1 层至此落地,两半合齐。
一、11 条红账处置表(逐条独立查证,全部改指,零删除)
packages/components/README.md:30../../docs/SHADCN_SYNC.md./README_SHADCN_SYNC.mdfind . -name SHADCN_SYNC.md全仓零命中,该文件从未存在;真正的完整指南是同包的README_SHADCN_SYNC.md(278 行,pnpm shadcn:check/shadcn:update全在其中),且shadcn-components.json也在同目录packages/components/README.md:212https://objectui.org/api/componentshttps://objectui.org/docs/componentsapps/site/app/api下只有search/route.ts,/api/components无路由;content/docs/components/index.md是 Component Gallery,正是该包的组件参考。#3629 给 vscode-extension 的「Component Library」用的就是这一页packages/core/README.md:144https://objectui.org/api/corehttps://objectui.org/docs/apicontent/docs/api/index.md标题即 "API Reference",自述 "Comprehensive reference documentation for all ObjectUI types, schemas, and APIs",与该节标题## API Reference对位packages/core/README.md:158https://www.objectui.org/docs/corehttps://www.objectui.org/docs/guide/architecturecontent/docs/core/只有 5 个.mdx,无 index 页,fumadocs 不生成路由;guide/architecture.md的 §Package Structure 有#### @object-ui/core一节逐包说明角色与边界packages/fields/README.md:131https://www.objectui.org/docs/fieldshttps://www.objectui.org/docs/guide/fieldscontent/docs/fields/26 个字段页,无 index;guide/fields.md标题 "Field Registry",正文首句即 "The@object-ui/fieldspackage serves as the Universal Language for rendering values"packages/layout/README.md:122https://www.objectui.org/docs/layouthttps://www.objectui.org/docs/layout/app-shellcontent/docs/layout/无 index;该行在## API Reference下、紧跟一段AppShell示例,layout/app-shell.mdx就是这个组件的 API 页packages/layout/README.md:137https://www.objectui.org/docs/layouthttps://www.objectui.org/docs/guide/layout## Links的「Documentation」位,guide/layout.md标题 "Layout System",逐个介绍 AppShell / Page / PageHeader / SidebarNav——是包总览而非单组件页,故与第 6 条取不同目标packages/react/README.md:228https://objectui.org/api/reacthttps://objectui.org/docs/core/schema-renderer/api/react路由(#3490 已扫过同款);core/schema-renderer.mdx是该包主导出 SchemaRenderer 的参考页。与 #3629 给同包:243选的目标相同——这一处重复是有意留下的:站点没有按包组织的 API 页(#3490 的结论),这就是 react 最贴近的真实参考页packages/types/README.md:329https://objectui.org/docs/typeshttps://objectui.org/docs/api/schema-referencecontent/docs/types整个目录不存在;api/schema-reference.md开篇写着 "Import: All types are available from@object-ui/types",就是这个包的内容packages/vscode-extension/README.md:190https://www.objectui.org/exampleshttps://github.com/objectstack-ai/objectui/tree/main/examples/examples不是站点路由(#3490 已确认);examples/目录真实存在,且content/docs/utilities/vscode-extension.mdx:489这条同名链接用的正是这个 URL,仓内另有 3 处同款写法packages/vscode-extension/README.md:242./LICENSEhttps://github.com/objectstack-ai/objectui/blob/main/LICENSEblob/main/形态,与之统一。没有删除任何一行。#3603/#3629 的口径是「查不到真实页才删」;这 11 条逐条都找到了实测存在的对位页面,所以全部改指。这也是它与 #3629(9 条里删 6 改 3)的差别:那 6 条假设的是一整个不存在的
/docs/packages/PKG命名空间,本单这 11 条各自都有真实归属。改指后全部保留
https://[www.]objectui.org/...的 origin,不写成 origin-less 的/docs/...:包 README 在 GitHub 与 npm 上被读,那里开头的/会被解析到它们自己的域名。这一点已写进头注释与ci-cd-pipeline.md,避免下一个人按content/docs的偏好「顺手改正」。二、扫描行
disk规则,不新增规则类:包 README 在 npm 与 GitHub 被阅读,相对链接是磁盘路径语义(./CHANGELOG.md是身边的文件而非路由),与examples/**、README.md、CONTRIBUTING.md、ROADMAP.md、docs/**完全同类。理由与「必须保留 origin」的推论一并写进头注释。这是表里唯一带通配符的一行,所以
collectFiles()增加了expandWildcard():只认整段的*,再复杂的写法直接抛错,而不是静默匹配零个路径——扫描面被悄悄丢掉是这个门禁唯一不能有的失效模式(与routeExists()缺路由表时抛错同一立场)。头注释的 "Measured and NOT bought" 一节改写为已购入,并把 #3572 那份过期的 "Still not bought" 清单挪到当前位置(那四个文件仍在单上,另加包内非 README 的 markdown)。⚠️ 注释里仍未原样写出 glob——星号加斜杠会提前闭合块注释(#3629 踩过),只用散文描述,真正的 glob 只出现在下方的数据表里(那是代码)。
顺带更新了两处随扫描面漂移的实测数字:「把 docs 规则套到 disk 面会误杀多少条」由 111 改为 186。111 是用本次同一套方法独立复算出来的(examples 21 + README 40 + CONTRIBUTING 0 + ROADMAP 3 + docs 47 = 111,与文件里记的数字一致),包 README 贡献新增的 75 条。
三、逆向验证(方向先定后跑)
这是「扩扫描面」类改动,方向是常规的加行则多报,不是 #5018/#5046 那种反转或计数下降的情形——先写下预测再跑:
Links are valid across 7 scan roots.(exit 0)packages/core/README.md植入两条死链(相对磁盘路径 + 站内绝对 URL 各一)Found 2 broken links,[example-relative] ./NO_SUCH_FILE.md+[site-absolute-url] .../docs/no-such-page,exit 1Links are valid across 6 scan roots.(exit 0)Links are valid across 7 scan roots.测试层做了同一件事(撤掉扫描行跑测试):
really scans every surface、pairs each scan root,以及 #3622 describe 里的 4 条(四种死链形状 / 只收 README / 排除 node_modules / disk 与 docs 对照对)+ 「floor under the green」collectFiles()、不经 SCAN_ROOTS 的用例保持绿「floor under the green」原本也直接写死路径、撤行后不会红,已改成从
SCAN_ROOTS里取那一行——现在删行会连它一起带红,而不是留下一条对着门禁已不再扫描的目录做测量的绿测试。四、测试
SCAN_ROOTS的toEqualpin 与逐根 count 表按新行扩写(新根文件数下限 35,今日 38——39 个包里sdui-parser没有 README)。CHANGELOG.md/TESTING.md/docs/不扫,用 README 自己的死链作控制项防止空绿)、packages/node_modules排除、disk 与 docs 规则的双向对照对、非整段通配符抛错。另按仓规自查了控制字节(
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]'扫本 PR 全部改动文件,零命中)。五、不加 changeset
改的是包 README 的链接与 CI 脚本,不触发任何包的版本发布,与 #3589 / #3629 仓例一致(#3629 的部分验收评论第 5 条已确认接受)。
六、范围外发现(已另开,未在本 PR 修)
@object-ui/plugin-tree的package.jsonfiles点名要打包LICENSE,但该文件不存在;npm 对files里缺失的条目静默跳过,所以已发布的 tarball 都没有它自己声明要带的许可证文本。发现于逐包核对第 11 条时。finding标签,观察类) —judgeHref()里有一段 4 行注释被逐字复制了两遍(PR fix(docs,scripts): 清掉 9 条包 README 死链,并让链接门禁认站内绝对 URL (#3603) #3629 引入),纯注释、零行为影响,按围栏未顺手改。七、未做,且是有意的
content/docs/下core/fields/layout/rfcs四个目录缺 index 页(侧边栏这四个分组标题本身不可点)。给它们补 index 页会让第 4/5/6/7 条链接原地复活,但那是内容创作,#3622 正文与 PM 认领评论都判在本卡之外,留给分诊池。本 PR 按「链接侧处置」的裁决,把这四条改指到实测存在的真实页。🤖 Generated with Claude Code
https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
Generated by Claude Code