Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions GFramework.Core.SourceGenerators.Abstractions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# GFramework.Core.SourceGenerators.Abstractions

`GFramework.Core.SourceGenerators.Abstractions` 存放 `Core` 侧源码生成器公开使用的 attribute 和最小契约定义。
它不是单独推广的生成器包,而是 `GFramework.Core.SourceGenerators` 的支撑层。

## 目录定位

这里当前主要提供:

- 架构注册相关特性
- `AutoRegisterModuleAttribute`
- `RegisterModelAttribute`
- `RegisterSystemAttribute`
- `RegisterUtilityAttribute`
- 规则与上下文注入特性
- `ContextAwareAttribute`
- `GetModelAttribute`
- `GetModelsAttribute`
- `GetSystemAttribute`
- `GetSystemsAttribute`
- `GetUtilityAttribute`
- `GetUtilitiesAttribute`
- `GetServiceAttribute`
- `GetServicesAttribute`
- `GetAllAttribute`
- 其他通用生成器特性
- `LogAttribute`
- `PriorityAttribute`
- `GenerateEnumExtensionsAttribute`

这些类型定义“消费端代码可以写什么 attribute”,而实际生成逻辑和 diagnostics 仍在
`GFramework.Core.SourceGenerators` 中。

## 与相邻模块的关系

- `GFramework.Core.SourceGenerators`
- 实际读取这里定义的 attribute,并生成代码或 diagnostics。
- `GFramework.SourceGenerators.Common`
- 为 `Core` 侧生成器提供共享基类和公共约束。

当前目录本身 `IsPackable=false`。对 NuGet 使用者来说,更实际的入口仍然是
`GeWuYou.GFramework.Core.SourceGenerators`;这个 abstractions DLL 会跟随对应 analyzer 包一起交付。

## 什么时候需要读这里

- 你在确认某个 `Core` 侧 attribute 的可用参数和命名
- 你在排查“文档写法”和 attribute 实际公开面是否一致
- 你在扩展 `Core.SourceGenerators`,需要先确认契约层边界

如果你的目标只是开始使用生成器,优先回到 `Core.SourceGenerators` README 和 `source-generators` 栏目。

## 继续阅读

- [Core 源码生成器说明](../GFramework.Core.SourceGenerators/README.md)
- [源码生成器总览](../docs/zh-CN/source-generators/index.md)
- [Context Get 注入生成器](../docs/zh-CN/source-generators/context-get-generator.md)
- [枚举扩展生成器](../docs/zh-CN/source-generators/enum-generator.md)
51 changes: 51 additions & 0 deletions GFramework.Godot.SourceGenerators.Abstractions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# GFramework.Godot.SourceGenerators.Abstractions

`GFramework.Godot.SourceGenerators.Abstractions` 存放 Godot 侧源码生成器公开使用的 attribute 和最小辅助类型。
它不是单独推广的消费包,而是 `GFramework.Godot.SourceGenerators` 的支撑层。

## 目录定位

这里当前主要提供:

- 节点与信号相关特性
- `GetNodeAttribute`
- `BindNodeSignalAttribute`
- 场景 / UI / 集合注册相关特性
- `AutoSceneAttribute`
- `AutoUiPageAttribute`
- `AutoRegisterExportedCollectionsAttribute`
- `RegisterExportedCollectionAttribute`
- Godot 项目级辅助类型
- `AutoLoadAttribute`
- `GodotModuleMarker`
- `NodeLookupMode`

这些类型负责定义“消费端项目可以声明哪些特性与参数”,而具体的生成逻辑、diagnostics 和生命周期约束仍在
`GFramework.Godot.SourceGenerators` 中。

## 与相邻模块的关系

- `GFramework.Godot.SourceGenerators`
- 实际消费这里定义的 attribute,并生成节点注入、信号绑定、Scene / UI 包装与项目元数据辅助代码。
- `GFramework.SourceGenerators.Common`
- 为 Godot 侧生成器提供共享基础设施和通用约束。
- `GFramework.Godot`
- 提供运行时宿主与集成层;生成器只负责编译期辅助。

当前目录本身 `IsPackable=false`。对 NuGet 使用者来说,更实际的入口仍然是
`GeWuYou.GFramework.Godot.SourceGenerators`;这个 abstractions DLL 会跟随对应 analyzer 包一起交付。

## 什么时候需要读这里

- 你在确认 `[GetNode]`、`[BindNodeSignal]`、`[AutoScene]` 等特性的公开参数语义
- 你在排查生成器文档是否和 attribute 契约一致
- 你在扩展 Godot 侧生成器,想先看清契约层边界

如果你的目标只是把生成器接进项目,优先回到 `Godot.SourceGenerators` README 和专题页。

## 继续阅读

- [Godot 源码生成器说明](../GFramework.Godot.SourceGenerators/README.md)
- [源码生成器总览](../docs/zh-CN/source-generators/index.md)
- [GetNode 生成器](../docs/zh-CN/source-generators/get-node-generator.md)
- [BindNodeSignal 生成器](../docs/zh-CN/source-generators/bind-node-signal-generator.md)
44 changes: 44 additions & 0 deletions GFramework.SourceGenerators.Common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# GFramework.SourceGenerators.Common

`GFramework.SourceGenerators.Common` 是 `GFramework` 多个源码生成器共享的公共支撑目录。它不是独立推广的运行时或
生成器采用入口,而是跟随各个 `*.SourceGenerators` 模块一起演化的内部基础设施。

## 目录定位

这个目录当前主要承载三类公共能力:

- 生成器基类
- 例如 `AttributeClassGeneratorBase`、`AttributeEnumGeneratorBase`、`MetadataAttributeClassGeneratorBase`
- 共享诊断
- 例如 `Diagnostics/CommonDiagnostics.cs`
- 共享符号与冲突处理
- 例如 `Extensions/GeneratedMethodConflictExtensions.cs`

如果你在 `Core`、`CQRS`、`Game`、`Godot` 侧生成器里看到相似的诊断或生成冲突语义,通常就是这里在统一约束。

## 与相邻模块的关系

- `GFramework.Core.SourceGenerators`
- 复用这里的生成器基类和部分通用 diagnostics。
- `GFramework.Cqrs.SourceGenerators`
- 以这里作为编译期公共依赖,并把公共 DLL 一起打进 analyzer 包。
- `GFramework.Godot.SourceGenerators`
- 同样复用这里的公共实现和共享约束。

这个目录当前 `IsPackable=false`,不作为独立安装包推广。对 NuGet 使用者来说,更实际的入口仍然是具体的
`GeWuYou.GFramework.*.SourceGenerators` 包。

## 什么时候需要读这里

- 你在排查多个生成器共有的 diagnostics
- 你想确认“为什么不同生成器对命名冲突采用同一套规则”
- 你在扩展或维护生成器,而不是只消费它们

如果你的目标只是“选包并开始使用”,优先回到对应生成器模块 README 和文档专题页。

## 继续阅读

- [源码生成器总览](../docs/zh-CN/source-generators/index.md)
- [Core 源码生成器说明](../GFramework.Core.SourceGenerators/README.md)
- [CQRS 源码生成器说明](../GFramework.Cqrs.SourceGenerators/README.md)
- [Godot 源码生成器说明](../GFramework.Godot.SourceGenerators/README.md)
2 changes: 1 addition & 1 deletion GFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageId>GeWuYou.GFramework</PackageId>
<Authors>gewuyou</Authors>
<Product>GeWuYou.GFramework</Product>
<Description>404 not found</Description>
<Description>Meta-package that aggregates GFramework.Core and GFramework.Game for a minimal runtime adoption path.</Description>
<Copyright>Copyright © 2025</Copyright>
<RepositoryUrl>https://github.com/GeWuYou/GFramework</RepositoryUrl>
<PackageProjectUrl>https://github.com/GeWuYou/GFramework</PackageProjectUrl>
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

- 第一次接触框架:[入门指南](docs/zh-CN/getting-started/index.md)
- 想先跑一个最小例子:[快速开始](docs/zh-CN/getting-started/quick-start.md)
- 想先确认该装哪些包:[安装配置](docs/zh-CN/getting-started/installation.md)
- 想接入 AI-First 配置工作流:[配置系统](docs/zh-CN/game/config-system.md) / [VS Code 配置工具](docs/zh-CN/game/config-tool.md)
- 已经知道要用哪个模块:直接进入对应模块的说明页

## 模块地图
Expand All @@ -39,9 +41,9 @@

| 目录 | 定位 | 跟随入口 |
| --- | --- | --- |
| `GFramework.Core.SourceGenerators.Abstractions` | `Core.SourceGenerators` 的内部契约层 | [Core.SourceGenerators 模块说明](GFramework.Core.SourceGenerators/README.md) |
| `GFramework.Godot.SourceGenerators.Abstractions` | `Godot.SourceGenerators` 的内部契约层 | [Godot.SourceGenerators 模块说明](GFramework.Godot.SourceGenerators/README.md) |
| `GFramework.SourceGenerators.Common` | 生成器家族共享的公共支撑代码 | [源码生成器总览](docs/zh-CN/source-generators/index.md) |
| `GFramework.Core.SourceGenerators.Abstractions` | `Core.SourceGenerators` 的内部契约层 | [目录说明](GFramework.Core.SourceGenerators.Abstractions/README.md) |
| `GFramework.Godot.SourceGenerators.Abstractions` | `Godot.SourceGenerators` 的内部契约层 | [目录说明](GFramework.Godot.SourceGenerators.Abstractions/README.md) |
| `GFramework.SourceGenerators.Common` | 生成器家族共享的公共支撑代码 | [目录说明](GFramework.SourceGenerators.Common/README.md) |

## 文档导航

Expand All @@ -64,7 +66,7 @@
## 包选择

- `GeWuYou.GFramework`
当前是聚合元包,只聚合 `GFramework.Core` 与 `GFramework.Game` 这两层运行时,适合快速试用
当前是聚合元包,只聚合 `GFramework.Core` 与 `GFramework.Game` 这两层运行时;不会自动带上 `Cqrs`、`Godot` 或任何 Source Generator,适合快速试用或先起一个最小运行时骨架
- `GeWuYou.GFramework.Core`
推荐的最小起步包。先从核心运行时开始,再按需叠加 `Cqrs`、`Game`、`Godot` 和 Source Generators。
- `GeWuYou.GFramework.*.Abstractions`
Expand Down
Loading
Loading