Skip to content

docs(console): 清掉 objectstack.config.ts 幽灵、重写已死的建应用入口、诚实框定 Routing 表 - #3580

Open
yinlianghui wants to merge 1 commit into
mainfrom
claude/issue-3543-console-arch-residue
Open

docs(console): 清掉 objectstack.config.ts 幽灵、重写已死的建应用入口、诚实框定 Routing 表#3580
yinlianghui wants to merge 1 commit into
mainfrom
claude/issue-3543-console-arch-residue

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #3543

#3544 / #3539 合并后的主干(b785a77b3)上逐条复核了三项前提再动手,复核详情见 issue 上的复核评论一条前提已过期,一条归因需修正,其余成立。

(一)objectstack.config.ts 幽灵 —— 两页一次清

console 没有任何本地元数据/配置文件,但两页都在教一个:数据流图顶框写着 objectstack.config.ts (defineStack → apps, objects, views),console.md 的 ## Configuration 还配了整段 defineStack 示例。该文件 git ls-files 零命中。

关键修正:这个文件名并非全无所指 —— 它是 ObjectStack 服务端项目的配置文件(见 objectos-integration.mdx,以及 i18n 里 manifest 冲突提示「请先从 objectstack.config.ts 中移除」)。所以两页都不写成「此文件不存在」,而是写成「它不属于 console」,并指向服务端。

替换成实测到的真实启动输入(按角色写,不按路径):

输入 实测锚点
VITE_SERVER_URL —— 唯一由 console 自己拥有的设置 apps/console/src/main.tsx:63.env.development;喂给 adapter 的 baseUrl 与 runtime-config 取数
服务端下发的 runtime config(品牌、功能开关、cloud URL) main.tsx 挂载前 initRuntimeConfig(SERVER_BASE)runtime-config.ts:160GET /api/v1/runtime/config
discovery + 元数据(apps/objects/views) AdapterProvider.tsx:62-80ObjectStackAdapter({ baseUrl: VITE_SERVER_URL })connect()(一次 /api/v1/discovery,按 baseUrl 缓存),再由 MetadataProvider 按需拉取

越界一处,请复核:文件面写的是 console.md「仅 Configuration 段」,但实测发现同一页 console.md:24 的 Key Features 表里还有第三处同源幽灵(「Switch between apps defined in objectstack.config.ts」)。只清 Configuration 段会让这一页自相矛盾 —— 正是本单要求「两页一起改」所要避免的失败模式,只是缩到了一页之内。因此一并修正(单行、同缺陷类、同文件),在此显式声明。

apps/console/tsconfig.json 的死 include 条目一并删除。

(二)§4 Entry Points —— 三条入口全部不通

文档原列入口 实测
Sidebar app switcher → Add App / Edit App add-app-btn / edit-app-btn 仍在 AppSidebar.tsx:395,401,但 ConsoleLayout 只挂 UnifiedSidebar —— 组件整体无挂载点
CommandPalette → Create New App createApp / create-app / Create New AppCommandPalette.tsx零命中,该命令从未注册
Empty state CTA → Create Your First App 渲染点是活的(AppContent.tsx:577),但跳转目标断链 —— 另见下文

归因修正:原单引用 AppSidebar.tsx 的「Entry point removed」注释作为 sidebar 入口被撤的依据。实测该注释在 AppSidebar.tsx:326-328,位于系统导航项列表items.push(...) 内,管辖的是那份系统导航,并不管 395/401 行的应用切换器下拉菜单(其代码仍在)。两条事实指向同一结论(入口不可达),但真实原因是组件没被挂载,不是「入口已从组件里删掉」。文档按后者口径写。

改写后按 AppSidebar 注释的产品口径给出真实路径:AI-first builder(/home 的 Build with AI,依服务端是否部署 build agent 而定)、Studio,以及作为 legacy deep link 保留的 wizard 路由。空态 CTA 写进新的入口清单,因为它在 console 里是断的(见下)。

(三)Routing 表 —— 选「诚实框定」,不逐条补全

原单点名的「a simple flat route structure」一句已在 #3544 中消失,这半条前提已过期。剩余的「表不全」成立并已量化:

  • shell packages/app-shell/src/console/AppContent.tsx:47 个 Route(34 个去重路径)
  • apps/console/src/App.tsx:42 个 Route(38 个去重路径)
  • 文档表:7 行

逐条补全等于把 70+ 条路由手抄进 markdown,下次改路由必然立刻过期。按 #3539「删手抄、指真源」先例,明确选择诚实框定:声明该表是 object-facing 的精选子集而非清单,并点名两处真源路由树各自负责什么。表内 7 行已逐条复核,全部存在且路径正确,予以保留(它们是「元数据如何变成页面」的最小可读集)。

验证

预测:三项门禁改动前后都应为绿(纯文档 + 一条惰性 tsconfig 条目);tsconfig 那条的预期方向是「什么都不动」,这与常见的「把删掉的分支放回去看它变红」相反 —— 该条目是 glob-less 且匹配不到文件的字面量,tsc 静默忽略,所以「无变化」本身就是它可安全删除的证据。实测与预测一致:

node scripts/check-doc-links.mjs      → exit 0  (Links are valid across 3 scan roots.)
node scripts/check-control-bytes.mjs  → exit 0  (OK; scanned 3631 tracked text file(s))
pnpm --filter @object-ui/console type-check → exit 0
pnpm exec vitest run scripts/ --maxWorkers=2 → exit 0  (16 files, 275 tests passed)

tsconfig 惰性性质的反向验证(先预测后跑):把幽灵条目放回一个临时 tsconfig,对比 tsc --listFilesOnly 的文件清单 —— 预测「完全相同」,实测 472 行 vs 472 行,diff 为空。该 include 条目确实不影响任何编译输入。

两页改后通读:彼此一致(同一套 VITE_SERVER_URL + 服务端下发配置 + HTTP 取元数据的说法,且都指向 objectos-integration 讲服务端形态),与 #3532 / #3539 / #3544 的既有措辞一致。

无 changeset:纯文档 + dev-only 的 tsconfig include 清理,无用户可见运行时变更(changeset-guard 只由 .changeset/** 触发,ci.yml/lint.yml**/*.md 列入 paths-ignore)。未触碰 content/docs/releases/

越界发现(只报不改)

已另立 #3573:空态「Create Your First App」CTA 在 apps/console 里断链 —— AppContent.tsx:577navigate('/create-app')(绝对路径),而 App.tsx 根路由树没有 /create-app,末尾 path="*" 把它重定向回 /。因此文档原列三个入口实际三个都不通(原单判断为「至少两个」)。属代码侧缺陷,不在本单文件面内。

原单记录的 observation-class「AppSidebar 仍导出但无挂载点」按分诊要求未修、未另立单,继续留在 #3543 里待下轮定去留。


🤖 Generated with Claude Code

https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt


Generated by Claude Code

…ation entries, and the routing-table overreach

The console has no local metadata/config file. Both guide pages taught one:
the data-flow diagram's top box named `objectstack.config.ts` and console.md's
`## Configuration` section carried a `defineStack` example. The file has zero
hits in `git ls-files` — it is an ObjectStack *server* project file, not a
console one — so both pages are rewritten to the measured boot inputs:
VITE_SERVER_URL, the server-pushed runtime config resolved before mount, and
metadata fetched over HTTP via the adapter's discovery + metadata client.
console.md's Key Features row repeated the same ghost and is corrected too, so
the page does not contradict itself.

`apps/console/tsconfig.json` listed the same nonexistent file in `include`.
The entry is inert (a glob-less literal that matches nothing is ignored):
`tsc --listFilesOnly` yields an identical 472-file list with and without it,
so removing it is pure cleanup.

Section 4's Entry Points listed three ways to reach app creation; none are
reachable. The sidebar's "Add App"/"Edit App" items live in AppSidebar, which
ConsoleLayout no longer mounts (it renders UnifiedSidebar); the command
palette never registered a create-app command. Rewritten to the real story —
AI-first builder, Studio, and the wizard routes as legacy deep links.

The routing table stays a curated subset rather than being completed: the real
tree is ~34 shell paths plus ~38 console paths against 7 documented rows, so
per the #3539 precedent the fix is to point at the two declaring route trees
instead of growing a hand-copy that cannot stay current.

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 2:17pm

Request Review

@github-actions github-actions Bot added the apps label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Main entry (gzip) 28.1 KB 350 KB
Entry file index-DpScGiC0.js
Status PASS

📦 Bundle Size Report

Package Size Gzipped
app-shell (index.js) 8.66KB 3.13KB
app-shell (runtime-config.js) 7.42KB 2.32KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 7.57KB 2.97KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 22.10KB 4.37KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.13KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.64KB 2.21KB
auth (SocialSignInButtons.js) 9.60KB 3.89KB
auth (UserMenu.js) 3.40KB 1.22KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 35.76KB 9.11KB
auth (createAuthenticatedFetch.js) 4.37KB 1.69KB
auth (index.js) 2.35KB 1.07KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 4.91KB 0.87KB
auth (useIsWorkspaceAdmin.js) 1.61KB 0.85KB
collaboration (CommentThread.js) 26.07KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.65KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 480.72KB 105.64KB
core (index.js) 2.96KB 1.13KB
create-plugin (index.js) 9.28KB 2.98KB
data-objectstack (index.js) 137.51KB 35.11KB
fields (index.js) 230.87KB 56.83KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (i18n.js) 4.32KB 1.77KB
i18n (index.js) 2.65KB 1.06KB
i18n (pickLocalized.js) 1.70KB 0.83KB
i18n (provider.js) 9.48KB 3.27KB
i18n (useObjectLabel.js) 26.14KB 6.07KB
i18n (useSafeTranslation.js) 4.52KB 1.96KB
layout (index.js) 38.53KB 10.71KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.74KB
mobile (index.js) 1.50KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.71KB 0.42KB
mobile (useResponsiveConfig.js) 1.36KB 0.63KB
mobile (useSpecGesture.js) 4.05KB 1.53KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 8.75KB 3.06KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 3.67KB 1.12KB
permissions (evaluator.js) 4.41KB 1.44KB
permissions (index.js) 0.91KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.52KB
permissions (usePermissions.js) 1.55KB 0.71KB
plugin-ai (index.js) 15.71KB 3.79KB
plugin-calendar (index.js) 44.98KB 12.37KB
plugin-charts (index.js) 61.04KB 17.31KB
plugin-chatbot (index.js) 180.09KB 42.72KB
plugin-dashboard (index.js) 112.03KB 28.88KB
plugin-designer (index.js) 210.51KB 42.51KB
plugin-detail (index.js) 232.79KB 57.42KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 112.10KB 27.10KB
plugin-gantt (index.js) 162.55KB 39.57KB
plugin-grid (index.js) 186.61KB 49.34KB
plugin-kanban (index.js) 48.30KB 13.28KB
plugin-list (index.js) 105.12KB 25.48KB
plugin-map (index.js) 16.81KB 5.24KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 40.58KB 10.58KB
plugin-timeline (index.js) 25.76KB 7.33KB
plugin-tree (index.js) 8.50KB 2.88KB
plugin-view (index.js) 84.03KB 20.55KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.71KB 3.53KB
providers (index.js) 0.44KB 0.22KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.67KB 2.37KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 19.28KB 6.38KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.02KB 0.55KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 4.09KB 1.74KB
sdui-parser (index.js) 4.47KB 2.03KB
sdui-parser (parse.js) 10.04KB 2.82KB
sdui-parser (types.js) 0.29KB 0.24KB
sdui-parser (validate.js) 4.69KB 1.48KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.87KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-retry.js) 4.32KB 2.02KB
types (index.js) 2.46KB 1.21KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console-architecture.md 残留三处过期陈述:objectstack.config.ts(与 console.md 同源)、已死的建应用入口、Routing 表不全

2 participants