Skip to content

NEXA 架构

NEXA — Digital World Engineering Platform(空天智能数字化基础技术平台)。 架构总纲见 NEXA_CONSTITUTION.md(仓库根,VitePress 站点外);能力归属的机器可读真相源见 architecture/*.yaml

顶层规则

  • 宪法优先:冲突优先级 NEXA_CONSTITUTION.md > 根 AGENTS.md > 子目录 AGENTS.md > docs/specs/
  • 逻辑映射先行:物理目录保持不变(packages/apps/products/projects),资产归属由 architecture/*.yaml 表达——能力域是逻辑归属,不是代码目录。
  • 依赖单向Foundation → Domain Packages → Engines/Services → Modules → Apps → Products → Solutions,禁止向上依赖与循环依赖(pnpm check:architecture 自动拦截)。
  • 零臆造:没有真实资产不迁、没有明确需求不建、没有复用证据不抽。
  • 品牌统一:npm scope @nexa/*,禁止旧品牌残留(pnpm check:architecture 自动拦截)。

工程结构(物理目录)

text
nexa/
├── packages/                  # 共享基础库
│   ├── gis-cesium/            # @nexa/gis-cesium  CesiumJS 地理空间扩展引擎(Engine / Spatial)
│   └── common-data/           # @nexa/scenario-data  V2 Scenario 数据模型(Package / Data)
├── apps/                      # 功能组件库(7 个 @nexa/* Module,见 apps.yaml)
├── products/                  # 产品应用
│   ├── tactics-sim-engine/    # @nexa/tactics-sim-engine  战术仿真引擎(Product / Simulation,旗舰)
│   └── situation-dashboard/   # 态势仪表盘(Product / Simulation,stub 待开发)
├── projects/                  # 示例与演示
│   └── demo/                  # CesiumJS 快速演示(Solution / Spatial)
├── architecture/              # 机器可读架构地图(真相源,CI 可查)
│   ├── domains.yaml           # 八大一级能力域
│   ├── capabilities.yaml      # Capability Registry(资产登记 + 归属 + 依赖 + 提取性)
│   ├── dependencies.yaml      # 包级依赖方向(真实 workspace:* 引用)
│   └── apps.yaml              # 资产 → 物理路径 / 包名映射
├── scripts/                   # 治理工具(architecture-check / rebrand)
└── docs/                      # VitePress 文档站

资产逻辑归属

资产逻辑层能力域
@nexa/scenario-dataPackageData
@nexa/gis-cesiumEngineSpatial
7 个 @nexa/* 组件库(schema-form / camera-panel / earth-viewer / base-map-manager / terrain-manager / entity-props / cesium-timeline-tracks)ModuleExperience
@nexa/tactics-sim-engineProductSimulation
@nexa/situation-dashboardProduct(stub)Simulation
@nexa/demoSolutionSpatial

完整字段(provides / requires / maintainer_mode / extractable / overlap)见 architecture/capabilities.yaml;物理路径见 architecture/apps.yaml

依赖方向

text
scenario-data (Package/Data) ─────┐
gis-cesium (Engine/Spatial) ──────┼──→ 7 个 Module ──→ tactics-sim-engine (Product)
Foundation(tactics 内 event-bus / ServiceRegistry / stores)┘
  • 全部包级依赖边以 architecture/dependencies.yaml 为准。
  • Foundation 能力(event-bus.ts / ServiceRegistry.ts / 6 个 Pinia store)当前为单实现 + 单消费方,已登记 extractable: false不抽取为独立包;多消费方出现后再建。
  • gis-cesiumscenario-types.ts@nexa/scenario-data 存在类型重叠,登记为 follow-up SCENARIO-01,本阶段不拆改成熟代码。

治理与门禁

门禁命令拦截内容
架构检查pnpm check:architectureyaml↔package.json 一致性 / 依赖方向符合宪法 / 品牌残留防回潮
导出面治理pnpm --filter @nexa/gis-cesium run check:governance公共导出 manifest、d.ts 完整性、版本一致性、弃用审查
体积门禁pnpm --filter @nexa/gis-cesium run check:bundleES/UMD/CSS 体积上限
类型安全CI grep 门禁私有 API 强转计数 ≤ 24

CI 质量门禁顺序:lint → typecheck → test → architecture-check → build → governance → bundle → bench → e2e

相关文档