docs(runner): 按实测闭合 §Features 插件断言,三处 main.tsx 订正为 App.tsx (#3619) (#3652) - #3676
Merged
Merged
Conversation
…3652) #3619:§Features 的「All official plugins included」与同页 §Pre-installed Plugins 自相矛盾 —— runner 的 dependencies 里只有 plugin-kanban 与 plugin-charts 两个 plugin-*,而仓库里有 19 个 packages/plugin-*。措辞与 PR #3644 在 README 侧落地的 口径对齐,不留开放集合暗示。 #3652:三处把 src/main.tsx 指认为插件 import 所在地(§Adding Custom Plugins 第 2 步、 §Use Cases 代码注释、§Troubleshooting 排查步骤),但真实 main.tsx 共 18 行、零个 @object-ui/plugin-* import;side-effect import 在 App.tsx:13-15。Troubleshooting 那处危害最大 —— 排查步骤指向一个永远看不到 import 的文件,既不能证实也不能证伪, 线索到此断掉;改写为可执行的排查动作,并点明 main.tsx 看不到的原因。 §Adding Custom Plugins 的 npm link 建议按 pnpm workspace 实况改写:仅换掉 npm link 仍会留下一份跑不通的步骤 —— 缺 vite.config.ts 别名条目即复现 #3575 的 HTTP 500。 补齐两个预装插件实际具备的四个接线点(package.json 的 workspace:* 依赖、App.tsx 注册 import、vite.config.ts 别名、index.css 的 @source),与 README(#3644)一致。 无 changeset:站点文档单文件改动,同页前三次改动(#3633/#3646/#3651)均无。 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. |
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 free
to 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 #3619
Fixes #3652
content/docs/utilities/runner.mdx单文件。两单同为该页的插件相关虚构,按 PM 并卡派发,一 PR 双 Fixes。前提复核(该页被 #3616/#3633/#3646/#3651 连改四轮,按内容锚定而非行号)
两单前提均仍成立,对
origin/main切点2ce5c31f0复核:packages/runner/package.json的dependencies里只有@object-ui/plugin-charts与@object-ui/plugin-kanban两个plugin-*;而ls -d packages/plugin-*有 19 个。packages/runner/src/main.tsx共 18 行,除 license 头外只有react/react-dom/client/./App.tsx/./index.css四个 import 加一个createRoot().render(),零个@object-ui/plugin-*。packages/runner/src/App.tsx:13-15(@object-ui/components、plugin-kanban、plugin-charts),与单里写的行号完全一致。各处前后对照
1. §Features(#3619)
原文与同页 §Pre-installed Plugins 自相矛盾:
- 📦 **Pre-configured** - All official plugins included- 📦 **Pre-configured** - The Kanban and Charts plugins, wired up out of the box措辞与 PR #3644 在
packages/runner/README.md侧落地的口径对齐(该文件写「Pre-configured with the Kanban and Charts plugins」),不写 popular、不留开放集合暗示。2. §Use Cases → 1. Plugin Development(#3652,第三处)
// src/main.tsx// src/App.tsx单正文写「两处」,分诊评论另点出了这条代码注释(共三处)。同一句错误断言的第三次出现,属 #3652 的完成范围,一并订正 —— 留着它这页仍然自相矛盾。
3. §Troubleshooting → Plugin Not Loading(#3652,危害最重的一处)
前:
读者打开
main.tsx,那里永远不会有插件 import(连两个预装的都不在),这一步既不能证实也不能证伪,排查线索到此断掉。后:改成真能证实/证伪的排查动作 —— 指向
src/App.tsx,并明说main.tsx只挂载根组件、看不到任何插件 import(把「为什么别去那儿看」写出来,而不是默默删掉);给出两个已知可用的 import 作对照锚点;再按两种可观察症状分叉:packages/react/src/SchemaRenderer.tsx:381实际渲染的文案)→ schema 的type与插件注册的 key 不一致;vite.config.ts缺别名条目。4. §Adding Custom Plugins 的
npm link(#3652 附注,按实测处置)分诊评论说「若超出一行改动则应另开卡」。实测下来这里的最小正确改动就不是一行:仅把
npm link换成 pnpm 写法,仍会留下一份跑不通的步骤 —— 同页正上方 §vite.config.ts已经写明,任何@object-ui/*说明符缺别名条目就会让 dev server 对整条 import 链返 HTTP 500,即 #3575。所以按两个预装插件实际具备的四个接线点补齐(逐条在仓库里验证过):package.json的workspace:*依赖packages/runner/package.jsonsrc/App.tsx注册 importApp.tsx:14-15vite.config.ts别名条目src/index.css的@sourceindex.css:13-14并点明
npm link不是本仓该用的工具(严格 pnpm workspace,AGENTS.md §3)。这四点与 PR #3644 已在 README 侧落地的说法一字不差地一致 —— 属口径对齐,非发明。验证(先预测后运行)
预测与实测一致:
grep -c "All official plugins":1 → 0 ✅npm link代码块:2 处 → 0;仅余一处显式否定建议(「npm linkis not the tool here」)。main.tsx提及:4 处 → 2 处。此处如实报告偏差:预测写的是「只剩事实正确处」,实测不是「只剩 1 处」——:77§Where the Code Lives 的「main.tsxmounts the root」本就正确保留,另一处是我新增的(Troubleshooting 里点明「main.tsx 只挂载根组件、不 import 插件」)。删掉三处错误断言的同时新增一处正确断言,是有意选择:该节的失效模式恰恰是读者会跑去main.tsx,与其沉默不如指名并说明。门禁:
修前修后均绿(7 roots,如实报)。另按控制字节纪律自扫超出门禁扫描面:
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]'对该文件 0 命中,file判定仍为Unicode text, UTF-8 text。未跑
pnpm test/type-check:纯站点文档单文件改动,不触碰任何 TS/构建产物。无 changeset
站点文档改动,同页前三次改动(#3633 / #3646 / #3651)均为单文件无 changeset,本 PR 沿用同一先例。
邻接通读结果
按要求通读四节邻接找同类新虚构,未发现新的,以下三项经核实均非虚构,故不另开卡:
kanban/bar-chart/data-table三个 type 都真实注册且在 Runner 里可用(前两者来自两个预装插件,data-table来自@object-ui/components,而它正是App.tsx:13那行 import)。ComponentRegistry.register(...)属实:packages/core/src/index.ts:10经export * from './registry/Registry.js'导出,register()在Registry.ts:138。pnpm test属实:runner 的scripts.test为vitest run。另:
content/docs/utilities/create-plugin.mdx:235-238也有npm link,但那页面向的是用@object-ui/create-plugin脚手架在自己 app 里做插件的外部作者,整页npm run build/npm publish口径自洽,不构成同类错误,故不开卡(已按关键词 + 文件路径搜过 open issue,无重复;#3665 是create-plugin包files声明的另一回事)。#3619 提到 §Dependencies 是插件清单的第三处重复 —— 内容本身正确,只是重复,属可选收敛建议;按范围纪律未动。
🤖 Generated with Claude Code
https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
Generated by Claude Code