docs(ui): apps 页停止教 17.0.0 已退役的 version / mobileNavigation,两个 os:check 块改用 defineApp() (#5313) - #5466
Merged
Merged
Conversation
…check 块改用 `defineApp()` (#5313) `content/docs/ui/apps.mdx` 有四处仍把 17.0.0(2026-06 liveness audit / ADR-0049)已退役的键当作可作者化面在教:「Basic Structure」示例的 `version: '1.0.0'`、App Properties 表的 `version` 行、整节 `## Mobile Navigation`(含 `mobileNavigation: { mode, bottomNavItems }` 示例与 `mode` 取值说明),以及「Complete Example」的 `version: '2.0.0'`。 墓碑是 `retiredKey()`(`z.never().optional()`),照抄不是「多写个没用的 键」,是整条 save 硬失败。把「Basic Structure」块原样喂 `getMetadataTypeSchema('app')` 实测 `parses: false`,报 「`App.version` was removed in @objectstack/spec 17.0.0 … Delete the key.」 处置按墓碑自己的处方:`version` 删键(应用版本 = 所属包的 `manifest.version`);`mobileNavigation` 无替代能力(完全未实现,连 packages/mobile 都没读过),整节删除。App Properties 表后新增 Callout 点名这两个键并给出处方,指回正文已交代的 `homePageId`(#4667/#4709)。 同时给两个 `{/* os:check */}` 块加 `defineApp()` 标注。此前两块都是无 类型标注的对象字面量,没有任何东西把它们和 `AppSchema` 关联起来, `retiredKey()` 赖以在编译期开火的 `never` 入参永远不参与推断—— `check:skill-examples` 只做 tsc,于是对退役键这一类恒绿。加标注后同一个 门在旧示例上会红(apps.mdx:19:3 / :239:3,TS2322 Type 'string' is not assignable to type 'undefined'),改后绿(204 prose examples type-check)。 门本体不动:issue 的 B 方案(块级 safeParse)需先解决块→schema 归属推断, 是独立的一次设计。不碰 packages/spec/**、content/docs/references/** 与 content/docs/releases/。Docs-only。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GX3sL71LFq8m2usg6VqTSE
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
os-zhuang
marked this pull request as ready for review
August 5, 2026 13:16
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 #5313
前提复核(origin/main @ 61fde5e)
单子的四处现场逐一核过,全部仍然成立:
apps.mdx:17(第 12 行 os:check 块内)version: '1.0.0'app.zod.ts:1116apps.mdx:45(App Properties 表)version/string/ optionalapps.mdx:217-227(整节 Mobile Navigation)mobileNavigation: { mode, bottomNavItems }+mode取值说明app.zod.ts:1262apps.mdx:235(第 230 行 os:check 块内)version: '2.0.0'version把两个 os:check 块原样喂
getMetadataTypeSchema('app')(一次性 harness,已删):墓碑是
retiredKey()(z.never().optional()),所以照抄本页示例不是「多写一个没用的键」,是整条 save 硬失败。改法(PM 已裁定走 A:修示例 + 加类型标注,不动门本体)
处置一律以 origin/main 上墓碑自己的处方为准:
version—— 墓碑写「An app is versioned by its owning package: usemanifest.version. Delete the key.」→ 两个示例里的version行删除,App Properties 表的version行删除。mobileNavigation—— 墓碑写「fully unimplemented; no renderer, including packages/mobile, ever read it. Delete the key; the block returns if/when a real mobile navigation ships.」→ 无替代能力可指向,故整节## Mobile Navigation删除(而不是改写成指路)。homePageId(清空剩余 6 条 authorWarn 死键 —— book ×2 / job.id / translation.validationMessages / app.homePageId / app.areas[].order(ADR-0049,v17 限时) #4667 /app.homePageId退役的前提写错了 —— objectui 的resolveLandingRoute()一直在读它,现在成了永远走不到的死分支 #4709)。形制照刚合并的 docs(protocol): widget-contract 的 Theme 段停止教 #3494 已删除的density,token 词表按 #5021 重写 (#5291) #5454(widget-contract)那一版。类型标注用
defineApp({ … }):它是app.zod.ts:482自称的「documented authoring entry point」,签名defineApp(config: z.input< typeof AppSchema >),且该页变量名(const crmApp = …)与defineApp的 JSDoc 示例完全同形;邻近页的惯例也是这一类(views.mdx用defineView,ui/index.mdx用App.create)。AppInput确实是真类型而不是unknown——app.nav-type-assertions.ts的探针把这件事钉住了(#4171/#4221/#4227),所以never入参这次真的会参与推断。双向证明
改前方向(先只加标注、不删
version) —— 同一个门当场红:这一步正是本单要害的证据:加标注之前,同样两个块喂给同一个门是
✅绿的 —— 门只做 tsc,而无标注的对象字面量与AppSchema之间没有任何关联,retiredKey()的never永不参与推断,所以「os:check 覆盖的是示例能否编译,不是示例是否合规」。标注本身就是本次修复的护栏。改后:
其余门:
check:doc-authoring✓ 362 files clean;check:nul-bytesOK(5447 files);MDX 用@mdx-js/mdx实编过一遍(Callout 与其中的 markdown 列表都正常渲染,没有被当成缩进代码块)。范围
content/docs/ui/apps.mdx+ 一个 docs-only changeset(空 frontmatter)。packages/spec/scripts/check-skill-examples.ts(单子里的 B 方案:块级safeParse。覆盖更广,但要先解决「哪个块对应哪个 schema」的归属推断,是独立的一次设计,留给维护者决定是否另立项)。packages/spec/**、content/docs/references/**、content/docs/releases/。references/生成物与releases/)再无第二处教mobileNavigation;本页也没有指向被删章节的锚点链接。本页 App Properties 表其余各行与AppSchema的活键逐一对过,无第二个退役键。🤖 Generated with Claude Code
https://claude.ai/code/session_01GX3sL71LFq8m2usg6VqTSE
Generated by Claude Code