feat(area): consolidate 5 v1 area modules into feature-area v2#4
Merged
Conversation
…lean) 把 peace/fly/survival 这三个模块合在一起成为 area 模块 —— 按用户 2026-07-21 已批准的决定,将 5 个基于区域的 v1 模块(feature-area-fly / feature-area-creative / feature-area-survival / feature-area-peace / feature-clean)合并为单一 v2 模块 feature-area。 设计(遵循 HANDOFF.md §5 land 模板 + §6 迁移流程): - 单一 ModuleRegistry.register 入口(sapi/src/index.ts),内部委派给五个子生命 周期 peaceLifecycle / flyLifecycle / survivalLifecycle / creativeLifecycle / cleanLifecycle。 - 统一配置 configs/area.json:areas[].features.<name> 布尔位独立开关每个子功能; 某功能在任意区域被开启即视为激活。经 SDK config.get 读取,不再使用 legacy ConfigManager.getAreas()(遵循 HANDOFF.md 的 v2 clean-break 约束)。 - manifest v2:services.provides = area.byName / area.byPoint;permissions = config:read:area;无 routes/migrations/handlers 等 v1 残留字段。 跨模块依赖说明: - creative 与 survival 在同一模块内耦合:survival 依据 creative 的"连锁开关" (isCreativeChainEnabled,等价 v1 CreativeArea.enable)与创造区判定来强制生存, 合并后改为同包内直接引用,消除了原 v1 的 @sfmc/module-creative 跨包依赖。 - clean 与其它子功能语义不同:它扫描全服掉落物并收纳到唯一回收箱阵列,并非 "区域范围"。为纳入统一模块,约定 features.clean 作为总开关;回收箱几何 / kill_list / 阈值改从 configs/area.json 的 clean 配置块读取(原 v1 依赖 ConfigManager.getClean()/getGrid()/getSetting(),现全部走 SDK config)。 peace 的实体定义(peace_skeleton/spider/zombie.json)一并迁入本模块 resource_pack/entities/,避免功能丢失。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
删除 fly/creative/survival/peace/clean 五个 v1 模块目录。功能已全部迁入 feature-area v2。遵循 HANDOFF.md 的 clean-break 约束:v2 落地即删除 v1,不保留兼容 shim。peace 的 resource_pack 实体已在上一提交迁入 feature-area。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
catalog.json:移除 feature-area-fly/creative/survival/peace + feature-clean 五条,新增 feature-area(configKey=area,entry 指向 modules/packages/feature-area/sapi/src/index.ts)。module-lock.json:清理五个已删模块的 enabled 状态,新增 feature-area=enabled。db-server 启动已验证:[manifest v2] enabled 含 feature-area,catalog 端点不再出现 5 个旧 id。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
Tanya7z
marked this pull request as ready for review
July 21, 2026 17:04
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
概要
按用户 2026-07-21 已批准的决定 —— "把 peace/fly/survival 这三个模块合在一起成为 area 模块" —— 将 5 个基于区域的 v1 模块合并为单一 v2 模块
feature-area:feature-area-flymodules/packages/fly/flyLifecyclefeature-area-creativemodules/packages/creative/creativeLifecyclefeature-area-survivalmodules/packages/survival/survivalLifecyclefeature-area-peacemodules/packages/peace/peaceLifecyclefeature-cleanmodules/packages/clean/cleanLifecycle遵循
HANDOFF.md(§5 land 模板 + §6 迁移流程 + clean-break 约束)与docs/dev/manifest-contract.zh.md的 v2 协议。设计
ModuleRegistry.register(modules/packages/feature-area/sapi/src/index.ts),内部委派给 5 个子生命周期,每个可通过统一配置独立启停。configs/area.json:areas[].features.<name>布尔位控制每个区域启用哪些子功能;某功能在任意区域被开启即视为激活。全程经 SDKconfig.get读取,不再使用 legacyConfigManager.getAreas()。services.provides=area.byName/area.byPoint;permissions=config:read:area;无routes/migrations/handlers等 v1 字段。跨模块依赖说明
isCreativeChainEnabled()(等价 v1CreativeArea.enable)与创造区判定强制生存。合并后改为同包内直接引用,消除原 v1 的@sfmc/module-creative跨包依赖。features.clean作为总开关;回收箱几何 /kill_list/ 阈值改从area.json的clean配置块读取(原 v1 依赖ConfigManager.getClean()/getGrid()/getSetting(),现全部走 SDK config)。peace_skeleton/spider/zombie.json)迁入feature-area/resource_pack/entities/,避免功能丢失。验证
cd db-server && npm run build(先npm run build --workspace @sfmc/sdk)后启动 db-server,启动日志:GET /api/sfmc/modules/catalog确认:feature-area存在 = true;5 个旧 id =[](全部消失)。备注
modules/packages/feature-area/sapi/src/index.ts的id: "feature-area"会触发一个已知 typecheck 报错(ModuleId字面量联合类型未含该 id)——这与已合并的afk/land/spawn-protect完全一致,属既有模式,未改动 SDK。modules/_manifests/module-manifests.json是 schemaVersion 1 的历史构建产物,v2 启动不读取,按既有迁移惯例未改动。