@vcp-dev/site-edit-engine 0.10.6 → 0.10.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -84,6 +84,32 @@ Next.js 插件平台,也不承诺覆盖 preview instrumentation 之外的构
84
84
  `site-edit-instrumentation-loader` 的兼容别名,不维护第二套转换逻辑;新接入建议优先使用
85
85
  bundler-neutral 子路径。
86
86
 
87
+ ## 内部职责边界
88
+
89
+ 内部组织遵循 [Site Edit 核心复杂度合同 #71](https://github.com/trojanbox/project-documents/issues/71),不改变公开入口、Bridge 协议、operation 或 History/Recovery 语义。
90
+
91
+ | 职责 | 内部 owner |
92
+ | ------------------------------------------------------------------- | -------------------------------------------- |
93
+ | Component identity、alias、namespace、re-export 与引用事实 | `planner/component-reference-analysis.ts` |
94
+ | 项目源码/route 可见性与跨文件唯一使用证明 | `planner/cross-file-component-analysis.ts` |
95
+ | Repeat callback、collection 与 template-root 结构 | `planner/repeat-template-analysis.ts` |
96
+ | Repeat hoist 的 callback/collection 特殊安全规则 | `planner/repeat-hoist-safety.ts` |
97
+ | 保留 Repeat 语义的 wrapper 构造 | `planner/repeat-template-construction.ts` |
98
+ | Conditional branch/range 与 boundary 识别 | `planner/conditional-structure-analysis.ts` |
99
+ | 共享 lexical binding visibility 与 component call-site render scope | `planner/scope-safety-analysis.ts` |
100
+ | 静态表达式 normalize、evaluate、follow path | `provenance/static-expression-evaluator.ts` |
101
+ | Repeat collection、filter/slice/sort 与实例来源映射 | `provenance/repeat-collection-provenance.ts` |
102
+ | Local/imported binding、component prop 与 hook state 来源 | `provenance/binding-provenance.ts` |
103
+ | Repeat 实例 document/detail/context/write-target 纯投影 | `runtime/repeat-runtime-projection.ts` |
104
+
105
+ 以上路径相对于 `src/internal/`。`OperationPlanner` 保留 operation 路线和 RewritePlan 组合;prop-backed collection 映射、cross-file collection import 收集及条件源码构造继续由它负责。Cross-file analysis 依赖 Component analysis;Repeat hoist 依赖共享 Scope Safety;analysis/construction 不反向依赖 Planner。
106
+
107
+ `resolve-text-provenance.ts` 保留唯一 facade、顶层 resolver 编排、pure/safe-derived helper 与 write-target projection。内部 resolver 通过无请求状态的 factory 和窄回调维持递归,原 `visited`、file cache 与参数转发保持不变;source helper 只负责解析、AST 查询和原有缓存,下层不反向导入 facade。既有 external/CMS/i18n/API resolver 职责不复制。
108
+
109
+ `createInternalEditEngine()` 继续持有 route、mutation、transaction、history/recovery 和事件编排状态。Repeat 投影仅接收 document、graph 和所需 target 的只读视图,不持有 Engine 或生命周期状态。内部 TypeScript 文件与对应测试使用 kebab-case,类和函数符号名保持不变。
110
+
111
+ 每个职责迁移分别运行受影响测试和 Engine typecheck 后提交;最终手动运行 `corepack pnpm test:site-edit:coverage`。文件长度不作为治理指标。
112
+
87
113
  ## 非目标
88
114
 
89
115
  `@vcp-dev/site-edit-engine` 不负责: