Skip to content

docs(guide): 删掉 console-architecture 里不存在的 MSW Mock Mode,并按包归属校正组件 - #3544

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-3540-console-arch-msw
Aug 7, 2026
Merged

docs(guide): 删掉 console-architecture 里不存在的 MSW Mock Mode,并按包归属校正组件#3544
yinlianghui merged 1 commit into
mainfrom
claude/issue-3540-console-arch-msw

Conversation

@yinlianghui

@yinlianghui yinlianghui commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Fixes #3540

只动一个文件:content/docs/guide/console-architecture.md

一、MSW Mock Mode 整节删除(前提已在 origin/main a2c8f2a29 上重新实测)

实测项 结果
git grep -niE "mswplugin|msw" -- apps/console/ 源码与 package.json 零命中(只剩 .gitignore 的一行注释、CHANGELOG.md 的历史条目,以及不在本单面内的 apps/console/docs/deployment.md)
apps/console/src/mocks/ 目录不存在
2b7435b76 refactor: remove MSW mock server setup and related configurations —— 确系那次删除

即整节属于「文档描述不存在的能力」,且与 #3532 刚改写的 console.md:18("There is no bundled mock backend")当场矛盾 —— 而 console.md 的 See Also 正把读者往这一页送。与 #3532 同口径:整节删除。

顺带澄清一个容易误判的信号:msw 仍是 packages/plugin-form / packages/plugin-grid 的 devDependency(单测里拦请求用),与「console 自带 mock 后端」无关,所以 pnpm install 输出里出现的 msw@2.15.0 不构成反证。

替代内容(按单里的要求,一句话 + 指路,不重复 console.md):新开一节 ## Development Mode,说明没有内置 mock 后端、dev 与生产一样由 ObjectStackAdapterVITE_SERVER_URL 连活服务器、服务器不在则 discovery 失败因而侧边栏空,然后链到 console.md 的 Quick Start。

数据流图里同源的边标注 MSW / Real Server 一并改成真实的 ObjectStack server (HTTP, VITE_SERVER_URL)

二、组件归属按 role/package 口径校正(逐项在 origin/main 上重新 git grep -l,未继承 #3539 的表)

组件 实测导出方
ExpressionProvider @object-ui/app-shell
ConsoleLayout / AppSidebar / AppHeader @object-ui/app-shell
ObjectView / RecordDetailView / ObjectDataPage @object-ui/app-shell
CreateAppPage / EditAppPage / AppCreationWizard @object-ui/plugin-designer
AppShell / useAppShellBranding @object-ui/layout —— 图里原本的标注是对的,保留未动

⛔ 按单里的禁令,没有把任何文件路径写进正文。具体改法:

  • 开篇加一段总述,一次性说清 apps/console 只是薄壳(拥有 Vite 构建、最外层路由树、插件注册),其余点名的东西都是包导出的组件而非 apps/console 下的文件 —— 后文因而不必逐句重复归属。
  • 数据流图:App.tsx 那格改成 Console shell (@object-ui/app-shell);Routes 一行注明由 apps/console 挂在 /apps/:appName(实测 App.tsx:348path="/apps/:appName/*",内层路由在 app-shell 的 AppContent 里声明)。
  • Routing 节:点明表内组件除 CreateAppPage / EditAppPage 由 plugin-designer 懒加载外,其余均由 app-shell 导出。
  • §3:The console's ObjectView is a thin wrapper... 的主语改成 shell 导出的那个 ObjectView(该 wrapper 在 app-shell,不在 console;其文件头注释原文就是 "Thin wrapper around the plugin-view ObjectView",claim 本身成立,错的只是归属)。
  • §4:改成 plugin-designer 端到端拥有(路由页与 AppCreationWizard 都由它导出),console shell 只负责懒加载挂路由。

一处有意的偏离:AppSidebar 改用角色措辞

图里原 AppSidebar (navigation tree) 没有改成「AppSidebar,来自 app-shell」,而是改成角色措辞 sidebar nav (app switcher + nav tree)。理由:AppSidebar 确实在 app-shell,但 ConsoleLayout 已经改挂 UnifiedSidebar(ConsoleLayout.tsx 只 import 后者),在描述活组合的图里直接点名 AppSidebar 等于写下一句可证伪的话。单里给的口径本就是 role/package,角色措辞两头都不吃亏。该组件的挂载漂移已并入 #3543 报告。

附带

修了 SchemaRendererProvider 那格的一格错位(纯空格,零内容变更)—— 那一格宽 60、上下框线宽 59,渲染出来是歪的,而这张图本 PR 正在编辑。

越界发现:只报不改,已立 #3543

同页另有三处过期陈述,均不属于本单的两类缺陷面,按 越界即停 没有在本 PR 里改:

  1. 数据流图顶格的 objectstack.config.ts —— 全仓 git ls-files 零命中。特别注意:console.md## Configuration 节同源,只改这一页会让两页当场矛盾,而「两页一致」正是本单的验收条件,所以必须两页同修 → 出面。
  2. §4 的 Entry Points 三条已死/存疑(AppSidebar 的 Add App 菜单已不可达,且其注释写明 "Manual Create App is deprecated in favour of the AI-first builder ... Entry point removed";CommandPalette 里 create-app 零命中)。
  3. Routing 表不全(shell 另有 :objectName/newrecord/:recordId/editmetadata/*;console 另有整棵 auth 路由)。本 PR 只加了一句兜底说明这些是 object-facing 路由,未逐条补全。

验证(预测先写,再跑)

命令 预测 实际
node scripts/check-doc-links.mjs exit 0(改前基线即 0;新增链接 /docs/guide/console#quick-start 的目标页与锚点都在) Docs links are valid. exit 0
pnpm exec vitest run scripts/ --maxWorkers=2 保持绿(scripts/ 下对本页零引用,没有任何测试 pin 这页内容) Test Files 14 passed (14) / Tests 216 passed (216)
node scripts/check-control-bytes.mjs OK OK (scanned 3695 tracked text file(s))
grep -rn "MSW|msw" content/docs/guide/console-architecture.md 零命中 ✅ 零命中
grep -naP 自扫控制字节(超出 gate 扫描面) 干净 ✅ 干净

重活按纪律走了 flock /tmp/os-heavy-verify.lock + NODE_OPTIONS=--max-old-space-size=4096

内容文档,无用户可见的代码变更 → 不加 changeset;content/docs/releases/ 未触碰。

🤖 Generated with Claude Code

https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt

`MSW Mock Mode` 整节描述的能力不存在,且与 #3532 刚改写的 console.md:18
("There is no bundled mock backend")直接矛盾 —— 而 console.md 的 See Also
正把读者往这一页送。实测 origin/main a2c8f2a:`MSWPlugin`/`msw` 在
apps/console 源码与 package.json 零命中,`apps/console/src/mocks/` 随
2b7435b(refactor: remove MSW mock server setup)删除。整节删除,换成一段
「没有内置 mock 后端、dev 与生产一样要连活服务器」的说明 + 指向 console.md
Quick Start 的链接(不重复其内容);数据流图上的 `MSW / Real Server` 边标注
一并改成真实的 `ObjectStack server (HTTP, VITE_SERVER_URL)`。

第二类是组件归属漂移:页面按 `apps/console` 的口径点名的
ExpressionProvider / ConsoleLayout / AppHeader / ObjectView /
RecordDetailView / ObjectDataPage 现均由 `@object-ui/app-shell` 导出,
CreateAppPage / EditAppPage 由 `@object-ui/plugin-designer` 导出(逐项
`git grep -l` 复核)。按 role/package 口径校正,**不写死文件路径**
(#3534 已证明路径树必漂移):开篇加一段总述说明 apps/console 只是薄壳,
Routing 节点明表内组件的导出方,§3 把 "The console's ObjectView" 的主语
改成 shell 的 ObjectView,§4 改成 plugin-designer 端到端拥有。

图里 `AppSidebar` 改用角色措辞「sidebar nav」:它虽在 app-shell,但
ConsoleLayout 已改挂 `UnifiedSidebar`,直接点名会写下一句可证伪的话。
顺手修了 SchemaRendererProvider 那格的一格错位(纯空格,无内容变更)。

同页另发现三处过期陈述(objectstack.config.ts 顶层 box 与 console.md 同源、
已死的建应用入口、Routing 表不全),按文件面纪律只报不改,已立 #3543Fixes #3540

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Aug 7, 2026 3:34am

Request Review

@yinlianghui
yinlianghui marked this pull request as ready for review August 7, 2026 04:06
@yinlianghui
yinlianghui added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit 949de3b Aug 7, 2026
6 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-3540-console-arch-msw branch August 7, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console-architecture.md 教了一套不存在的 MSW Mock Mode,且与 #3532 刚修正的 console.md 直接矛盾

2 participants