docs(examples): 给 console-starter 补 README - #3524
Merged
Merged
Conversation
examples/console-starter was the only example directory without a README, and PR #3506 retargets a docs link at its GitHub tree page. Content is measured from src/ and the configs: the app-shell building blocks App.tsx composes, the workspace packages that make `pnpm -w build` a hard prerequisite, the VITE_SERVER_URL backend requirement, and what the app actually does with no backend listening. Fixes #3520 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. |
…e-starter README "This directory holds ten files" stops being true the moment this README lands in it. State the fact that matters instead: no schema JSON here at all. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
Collaborator
Author
|
越界发现已按仓库惯例另立单,本 PR 未触碰任何相关文件:
另一条只报不改、未单独立单的事实: 立单时 Generated by Claude Code Generated by Claude Code |
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 #3520
背景
examples/下四个目录里,console-starter是唯一没有 README 的那个(git ls-tree只有 10 个文件,全是配置与src/)。而 PR #3506 刚把content/docs/guide/objectos-integration.mdx的 "Example: CRM Application" 死链改指https://github.com/objectstack-ai/objectui/tree/main/examples/console-starter—— 读者点过去落到一个没有任何说明的裸目录。本 PR 只新增
examples/console-starter/README.md一个文件。内容全部来自实测(读src/与配置、真起 dev server、真用无头浏览器打开),不写推断。README 回答的四问
1. 它是什么 —— 连真实 ObjectStack 后端的 console 脚手架。逐条对着源码点名:
src/App.tsx用@object-ui/app-shell的ConsoleShell/AuthenticatedRoute/ConnectedShell/RootRedirect/SystemRedirect/Default*页 /DefaultAppContent拼出整棵路由树;鉴权是@object-ui/auth的AuthProvider指向${VITE_SERVER_URL}/api/v1/auth;src/main.tsx以 side-effect import 注册十个视图插件,并从/api/v1/i18n/translations/:lang取翻译。每个描述都能在packages/app-shell/src/console/ConsoleShell.tsx的对应导出上核对。2. 它不是什么 —— 这一节是 #3509 那条边界的落地。#3509 明确因为 console-starter 不演示关系建模,才没有把 "Build multi-object apps with relationships" 的链接指过来。README 直说:本目录十个文件里没有任何一处声明对象、字段或关系,它们全在服务端;要看建模去
schema-catalog和content/docs/fields/lookup.mdx。另外两条边界同样点明:数据层硬绑ObjectStackAdapter(自带后端请看byo-backend-console),以及没有 mock/离线模式。3. 怎么跑 —— 实测结论,不是从
package.json抄命令:pnpm -w build是硬前置,不是套话。vite.config.ts把 24 个@object-ui/*别名指到packages/*/src,但这些源码又 import 了 5 个不在别名表、也不在本 examplepackage.json里的工作区包(mobile、providers、sdui-parser、plugin-editor、react-runtime)。它们只能走 node 解析落到packages/*/dist,而dist只有构建后才存在。vite.config.ts没有设server.port(对比byo-backend-console设了 5174),所以是 Vite 默认 5173。VITE_SERVER_URL是唯一要紧的开关(adapter / auth / i18n / action 端点都挂在它上面),.env.development=http://localhost:3000,.env.production=https://demo.objectstack.ai,留空即同源。需要本地后端时指向仓库自带的e2e/live/ci/start-backend.sh(它起真的objectstack dev,4010 端口,seeded admin),并如实注明那是 CI lane 的脚本、会先拉 showcase 元数据并 npm install。VITE_USE_MOCK_SERVER在两个.env里都有,但全仓没有任何源码读它(仅apps/console/vercel.json的构建命令里出现)。README 用一句话说清"它是从 apps/console 抄过来的、没有 mock 模式",免得读者去翻它。另见下方"越界发现"。4. 与另外三个 example 的分工 —— 照
examples/README.md的口径给四行短版并链回总目录,不重复它的表格。验证(先预测,后执行)
预测:测试不动。 README-only 的 diff,没有任何测试引用
examples/console-starter(grep -rln在scripts/、packages/、apps/的*.test.ts*里零命中);check-doc-links的扫描面只有content/docs/,本文件不在其中。结果与预测一致:
204 与 #3509 记录的基线逐个相同 —— 没有 verdict 移动,也没有新增覆盖。
(3690 → 3691,证明新文件确实进了扫描面。另对该文件单独
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]',无命中。)链接自查 —— 这一条要说清证据来源。
check-doc-links.mjs只走content/docs/,不会校验本文件里的任何链接,所以门禁绿不代表链接对。逐条按存在性自己验:脚本抽出 README 里 14 条相对链接、fs.existsSync逐个解析,14 relative links checked, 0 missing。这就是本文件链接正确性的全部证据。真跑过 —— 而且第一次是红的。 跑法与结果:
pnpm install就pnpm dev(自选空闲端口 5197,--strictPort):Vite 350ms 起来,但 dep scan 报 5 个@object-ui/*无法解析;无头 Chromium 打开后#root完全为空,body 无文字,多个 500。pnpm --filter ... build把那 5 个包(及其依赖)构建出来后重启:#root渲染出品牌加载屏,body 文字为ObjectOS / Initializing application... / Connecting to data source / Loading configuration / Preparing workspace。:3000上没有后端,控制台是一片ERR_CONNECTION_REFUSED,页面停在该加载屏(adapter 永远连不上,底下的路由不会挂载);同一状态下/login反而完整渲染(登录页不在ConnectedShell之下),只是登不进去。README 的"Without a backend"一节写的就是第 3 步的观察。第 1 步的红不是缺陷,是我漏了
examples/README.md与根README.md早已写明的pnpm -w build—— 它反过来成了 README 里"根构建不是可选项"那一段的实据。服务已拆。 自起的 dev server 按记下的 PID 关闭(
lsof -tiTCP:5197确认端口已释放),临时 probe 脚本已删,工作树只剩这一个新文件。越界发现(只报不改,文件面严格限于新增的 README)
见下方 issue 评论/新单:
content/docs/guide/deployment.md记的VITE_USE_MOCK_SERVER、VITE_API_URL两个变量在全仓无任何源码读取(真实变量是VITE_SERVER_URL);以及本 example 的 vite 别名表与package.json覆盖不全,按vite.config.ts注释"发布后可以删掉别名"去 fork 会直接坏掉。均按仓库惯例另立 issue,不在本 PR 顺手改。范围
content/docs/releases/。examples/README.md(它写着"Each exposes its own dev server port (see its README)",而 console-starter 并未声明端口 —— 只报不改)。🤖 Generated with Claude Code
https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
Generated by Claude Code