refactor: split GenUI schema runtime modules - #108
Merged
wang-kaopu merged 1 commit intoSep 6, 2026
Conversation
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.
改动
src/client/component-schema.ts拆分为:src/client/genui-runtime/schema.tssrc/client/genui-runtime/normalize.tssrc/client/genui-runtime/diagnostics.tscomponent-schema.ts,不保留兼容 facadeguard.ts改为直接依赖对应 runtime 模块,不再 re-export schema / normalize / diagnostics 符号tests/genui-schema.spec.ts改为直接从职责所属模块导入模块边界
schema.ts不依赖 normalize / diagnostics / guardnormalize.ts运行时仅依赖schema.ts,diagnostic 类型使用import typediagnostics.ts运行时仅依赖schema.tsguard.ts消费三个模块,不再作为它们的 facade范围
这是一次纯结构重构,不修改:
源码内部的模块路径会随职责拆分发生变化,但不影响当前 package exports。
验证
重构过程中使用旧
component-schema.ts与拆分后的新模块进行 differential characterization tests:COMPONENT_SCHEMAS/GENUI_SPEC_SCHEMAdeepEqualGENUI_NATIVE_TYPES内容与顺序一致临时 legacy 文件和 differential test 未进入最终提交。
同时已通过:
tests/genui-schema.spec.tspnpm run check本 PR 基于已合并的 #107,当前只有 1 个 commit。