docs(runner): §vite.config.ts 改写为指路真实文件 + 点名两个承重不变量 (#3643) - #3651
Merged
Conversation
原展示块给出的 `server: { port: 5173, open: true }` 在
`packages/runner/vite.config.ts` 里根本不存在 —— 5173 是 Vite 的默认端口
(`"dev": "vite"`,无 `--port`/`--open`),自动开浏览器纯属无中生有。与此同时,
真实文件里唯二承重的两块被完全隐去:`resolve.alias` 传递闭包表(objectui#3575
的硬不变量,漏一个 specifier 会让 dev server 对整条 import 链返回 HTTP 500)
与 `build.modulePreload: false`(1776 个 asset / ~1761 个图标微 chunk 的防预载)。
照抄该块去替换真实文件会直接复现 #3575 的故障形态,所以这里不换一份"更准的
代码块"——按 §Where the Code Lives(#3539)的先例改为说明形态:链接到真实
文件(该 blob/main URL 受 check-doc-links 机械校验,文件挪走即红),点名两个
不许删的面及其原因,并明确写出真实文件"没有 server 块"这一否定事实。
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. |
yinlianghui
marked this pull request as ready for review
August 7, 2026 17:18
This was referenced Aug 7, 2026
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 10, 2026
…ck-ai#3619) (objectstack-ai#3652) (objectstack-ai#3676) objectstack-ai#3619:§Features 的「All official plugins included」与同页 §Pre-installed Plugins 自相矛盾 —— runner 的 dependencies 里只有 plugin-kanban 与 plugin-charts 两个 plugin-*,而仓库里有 19 个 packages/plugin-*。措辞与 PR objectstack-ai#3644 在 README 侧落地的 口径对齐,不留开放集合暗示。 objectstack-ai#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 别名条目即复现 objectstack-ai#3575 的 HTTP 500。 补齐两个预装插件实际具备的四个接线点(package.json 的 workspace:* 依赖、App.tsx 注册 import、vite.config.ts 别名、index.css 的 @source),与 README(objectstack-ai#3644)一致。 无 changeset:站点文档单文件改动,同页前三次改动(objectstack-ai#3633/objectstack-ai#3646/objectstack-ai#3651)均无。 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 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 #3643
content/docs/utilities/runner.mdx单文件。前提复核(先复核后动手)
issue 的两条断言都对
origin/main(切点0d5da5394,含 #3646 的54dd7ec1f)按内容锚定复核过,全部成立:server块packages/runner/vite.config.ts顶层只有plugins/resolve/build三个键port: 5173不是配出来的packages/runner/package.json的 dev 脚本就是裸vite,没有--port—— 配置层与脚本层双重确认,5173 纯属 Vite 默认端口open: true无中生有--open,runner 不会自动开浏览器resolve.alias闭包表被隐去build.modulePreload: false被隐去取舍:为什么是「说明形态」而不是「换一份更准的代码块」
PM 给的两个选项里取 (a) 改写为说明形态,并且不保留任何配置代码块。理由三条:
export default defineConfig({...})的块,读者的默认动作是复制粘贴过去。这一节的危险恰恰是「照抄替换真实文件」——那会丢掉别名表,直接复现 packages/runner 按 runner.mdx 的「From Source」步骤起不来:vite 别名表漏了 5 个源码实际 import 的工作区包 #3575。把块换成一份「更准的」节选并不消除这个动作,只是让它下次错得更隐蔽。packages/*的 import 边增长(packages/runner 按 runner.mdx 的「From Source」步骤起不来:vite 别名表漏了 5 个源码实际 import 的工作区包 #3575 就是它增长时漏了fields/plugin-detail)。节选首尾 + 省略号,今天准,下一个包进来就不准了 —— 这正是 finding: live-e2e allowlist 的 spec 名单被手抄在两处文档里,每次晋级都会失同步 #3488/docs(guide): 删掉 console.md 已整体过期的 Folder Structure 目录树 #3539 记下的教训,所以不再造一份拷贝。附带买到的一个机械保险:指向真实文件用的是
https://github.com/objectstack-ai/objectui/blob/main/packages/runner/vite.config.ts这个形状 ——scripts/check-doc-links.mjs会把它当仓内引用校验路径是否存在(#3536 那条规则),所以文件哪天被挪走或改名,这条链接会机械变红,而不是静默烂掉。裸 backtick 路径没有这个保险。前后对照
修前(:161-176)—— 一个真实文件里不存在的配置:
承重的
resolve.alias与build.modulePreload一个字没提。修后 —— 说明形态,四段:
server块,5173 是 Vite 默认端口,pnpm dev不会开浏览器 —— 这条同时给同页 §Port Already in Use(教你自己加server.port)接上了正确前提;resolve.alias—— 它就是 runner 能免pnpm -w build直接从源码启动的机制,必须是传递闭包;漏一个 specifier 会退回 Node 解析、落到不存在的packages/*/dist,dev server 对整条 import 链返回 HTTP 500(packages/runner 按 runner.mdx 的「From Source」步骤起不来:vite 别名表漏了 5 个源码实际 import 的工作区包 #3575:plugin-kanban被别名了,它 import 的fields/plugin-detail没有);build.modulePreload: false—— 别名表不按serve收窄,pnpm build同样从源码打包,图标微 chunk 不再内联(packages/runner 按 runner.mdx 的「From Source」步骤起不来:vite 别名表漏了 5 个源码实际 import 的工作区包 #3575 实测 10 → 1776 个 asset),Vite 默认modulePreload: true会给每个发 preload(index.html实测 546 B → 145 KB),懒加载反成劣化;数字全部取自真实文件注释里 #3575 的实测值,并在正文里写明「实测于补全别名表时」——按测量时点表述,不会随包数增长而变假。
验证(先预测后跑)
open: true/port: 5173有命中port: 5173、:173open: true)hits=0resolve.alias:176、build.modulePreload:187、modulePreload: true:192check-doc-links修前修后均绿Links are valid across 7 scan roots.(exit 0);新增的 blob/main 链接被该 gate 实际校验通过check-control-bytes绿 + 自扫干净OK (scanned 3661 tracked text file(s));另跑grep -naP扫\x00-\x08\x0b\x0c\x0e-\x1f无命中,file报UTF-8 textMDX 可解析性:新增文本里唯一的尖括号是一个代码跨度内的路径占位符(尖括号包住
pkg,位于packages/与/dist之间)。同一文件已在线上使用完全相同的形状 —— :65、:104、:113-115 以及 :106 的小节标题里,都有尖括号包base的?api=占位符与GET请求行。形状已被生产渲染验证,无需另跑 MDX 解析。无 changeset:站点文档改动,不进 39 包固定组的发布物,依 #3633/#3646 先例。
文件面纪律
单文件
content/docs/utilities/runner.mdx,逐路径git add,未用git add -A。未碰packages/runner/vite.config.ts本体(issue 里也明确写了「不建议反向操作」——往真实文件里加server块是产品决定,不归 docs 卡),未碰 #3619 的 Features bullet。越界发现(只报不改)
通读该节邻接后新发现一处同类断言,已另开 #3652,不在本 PR 修:
src/main.tsx找/加插件 import,但真实main.tsx只有 18 行纯 React 挂载、零插件 import;两个预装插件的 side-effect import 在App.tsx:13-15。这与同页 §Where the Code Lives 自己写的「App.tsx… imports the pre-installed plugins」直接打架,且让「插件没加载」的排查步骤指向一个永远看不到 import 的文件。去重已做:content/docs/utilities/runner.mdx §Best Practices 的 Error Boundaries 从 @object-ui/components 导入 ErrorBoundary,但该符号在 app-shell,且 runner 不依赖 app-shell #3635 / content/docs/utilities/runner.mdx Features 写「All official plugins included」,实际只预装 kanban + charts 两个,与同页下方清单打架 #3619 / packages/runner/README.md 的插件清单两处写成开放集合(§Features 的「etc.」、§Pre-installed Plugins 的非插件条目),实际只预装 kanban + charts 两个 #3632 / packages/runner/vite.config.ts 的 @object-ui/data-objectql 别名指向不存在的包目录(全仓唯一引用) #3593 均不覆盖。Generated by Claude Code