diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ae6cd2..df64bd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,9 @@ jobs: uses: actions/checkout@v6 with: fetch-depth: 0 + # 校验C#命名空间与源码目录是否符合命名规范 + - name: Validate C# naming + run: bash scripts/validate-csharp-naming.sh # 缓存MegaLinter - name: Cache MegaLinter uses: actions/cache@v5 @@ -173,4 +176,4 @@ jobs: fetch-previous-results: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: always() \ No newline at end of file + if: always() diff --git a/GFramework.Core.Abstractions/Architecture/IArchitectureServices.cs b/GFramework.Core.Abstractions/Architecture/IArchitectureServices.cs index 552b6cc..df36e09 100644 --- a/GFramework.Core.Abstractions/Architecture/IArchitectureServices.cs +++ b/GFramework.Core.Abstractions/Architecture/IArchitectureServices.cs @@ -1,6 +1,6 @@ using GFramework.Core.Abstractions.Command; using GFramework.Core.Abstractions.Events; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Abstractions.Query; using GFramework.Core.Abstractions.Rule; diff --git a/GFramework.Core.Abstractions/Architecture/IServiceModule.cs b/GFramework.Core.Abstractions/Architecture/IServiceModule.cs index 6237560..c606865 100644 --- a/GFramework.Core.Abstractions/Architecture/IServiceModule.cs +++ b/GFramework.Core.Abstractions/Architecture/IServiceModule.cs @@ -1,4 +1,4 @@ -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Abstractions.Lifecycle; namespace GFramework.Core.Abstractions.Architecture; diff --git a/GFramework.Core.Abstractions/Architecture/IServiceModuleManager.cs b/GFramework.Core.Abstractions/Architecture/IServiceModuleManager.cs index 70910b1..ed2145b 100644 --- a/GFramework.Core.Abstractions/Architecture/IServiceModuleManager.cs +++ b/GFramework.Core.Abstractions/Architecture/IServiceModuleManager.cs @@ -1,4 +1,4 @@ -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; namespace GFramework.Core.Abstractions.Architecture; diff --git a/GFramework.Core.Abstractions/CQRS/Command/ICommandInput.cs b/GFramework.Core.Abstractions/Cqrs/Command/ICommandInput.cs similarity index 79% rename from GFramework.Core.Abstractions/CQRS/Command/ICommandInput.cs rename to GFramework.Core.Abstractions/Cqrs/Command/ICommandInput.cs index d924aef..5ec607e 100644 --- a/GFramework.Core.Abstractions/CQRS/Command/ICommandInput.cs +++ b/GFramework.Core.Abstractions/Cqrs/Command/ICommandInput.cs @@ -1,4 +1,4 @@ -namespace GFramework.Core.Abstractions.CQRS.Command; +namespace GFramework.Core.Abstractions.Cqrs.Command; /// /// 命令输入接口,定义命令模式中输入数据的契约 diff --git a/GFramework.Core.Abstractions/CQRS/IInput.cs b/GFramework.Core.Abstractions/Cqrs/IInput.cs similarity index 94% rename from GFramework.Core.Abstractions/CQRS/IInput.cs rename to GFramework.Core.Abstractions/Cqrs/IInput.cs index b17fa0a..dfed501 100644 --- a/GFramework.Core.Abstractions/CQRS/IInput.cs +++ b/GFramework.Core.Abstractions/Cqrs/IInput.cs @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -namespace GFramework.Core.Abstractions.CQRS; +namespace GFramework.Core.Abstractions.Cqrs; /// /// 表示输入数据的标记接口。 diff --git a/GFramework.Core.Abstractions/CQRS/Notification/INotificationInput.cs b/GFramework.Core.Abstractions/Cqrs/Notification/INotificationInput.cs similarity index 93% rename from GFramework.Core.Abstractions/CQRS/Notification/INotificationInput.cs rename to GFramework.Core.Abstractions/Cqrs/Notification/INotificationInput.cs index c06cf13..8b79183 100644 --- a/GFramework.Core.Abstractions/CQRS/Notification/INotificationInput.cs +++ b/GFramework.Core.Abstractions/Cqrs/Notification/INotificationInput.cs @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -namespace GFramework.Core.Abstractions.CQRS.Notification; +namespace GFramework.Core.Abstractions.Cqrs.Notification; /// /// 表示通知输入数据的标记接口。 diff --git a/GFramework.Core.Abstractions/CQRS/Query/IQueryInput.cs b/GFramework.Core.Abstractions/Cqrs/Query/IQueryInput.cs similarity index 71% rename from GFramework.Core.Abstractions/CQRS/Query/IQueryInput.cs rename to GFramework.Core.Abstractions/Cqrs/Query/IQueryInput.cs index b19da8a..c505c4f 100644 --- a/GFramework.Core.Abstractions/CQRS/Query/IQueryInput.cs +++ b/GFramework.Core.Abstractions/Cqrs/Query/IQueryInput.cs @@ -1,4 +1,4 @@ -namespace GFramework.Core.Abstractions.CQRS.Query; +namespace GFramework.Core.Abstractions.Cqrs.Query; /// /// 查询输入接口,定义了查询操作的输入规范 diff --git a/GFramework.Core.Abstractions/CQRS/Request/IRequestInput.cs b/GFramework.Core.Abstractions/Cqrs/Request/IRequestInput.cs similarity index 93% rename from GFramework.Core.Abstractions/CQRS/Request/IRequestInput.cs rename to GFramework.Core.Abstractions/Cqrs/Request/IRequestInput.cs index eb73e4d..0a0b159 100644 --- a/GFramework.Core.Abstractions/CQRS/Request/IRequestInput.cs +++ b/GFramework.Core.Abstractions/Cqrs/Request/IRequestInput.cs @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -namespace GFramework.Core.Abstractions.CQRS.Request; +namespace GFramework.Core.Abstractions.Cqrs.Request; /// /// 表示请求输入数据的标记接口。 diff --git a/GFramework.Core.Abstractions/IoC/IIocContainer.cs b/GFramework.Core.Abstractions/Ioc/IIocContainer.cs similarity index 99% rename from GFramework.Core.Abstractions/IoC/IIocContainer.cs rename to GFramework.Core.Abstractions/Ioc/IIocContainer.cs index 42fcb7d..b61d0f3 100644 --- a/GFramework.Core.Abstractions/IoC/IIocContainer.cs +++ b/GFramework.Core.Abstractions/Ioc/IIocContainer.cs @@ -2,7 +2,7 @@ using GFramework.Core.Abstractions.Systems; using Microsoft.Extensions.DependencyInjection; -namespace GFramework.Core.Abstractions.IoC; +namespace GFramework.Core.Abstractions.Ioc; /// /// 依赖注入容器接口,定义了服务注册、解析和管理的基本操作 diff --git a/GFramework.Core.Tests/Architectures/ArchitectureContextTests.cs b/GFramework.Core.Tests/Architectures/ArchitectureContextTests.cs index a3c2411..ee4af3e 100644 --- a/GFramework.Core.Tests/Architectures/ArchitectureContextTests.cs +++ b/GFramework.Core.Tests/Architectures/ArchitectureContextTests.cs @@ -11,7 +11,7 @@ using GFramework.Core.Architectures; using GFramework.Core.Command; using GFramework.Core.Environment; using GFramework.Core.Events; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Logging; using GFramework.Core.Query; diff --git a/GFramework.Core.Tests/Architectures/ArchitectureServicesTests.cs b/GFramework.Core.Tests/Architectures/ArchitectureServicesTests.cs index a8d92f9..56b08f0 100644 --- a/GFramework.Core.Tests/Architectures/ArchitectureServicesTests.cs +++ b/GFramework.Core.Tests/Architectures/ArchitectureServicesTests.cs @@ -2,7 +2,7 @@ using GFramework.Core.Abstractions.Architecture; using GFramework.Core.Abstractions.Command; using GFramework.Core.Abstractions.Environment; using GFramework.Core.Abstractions.Events; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Abstractions.Model; using GFramework.Core.Abstractions.Query; using GFramework.Core.Abstractions.Systems; @@ -11,7 +11,7 @@ using GFramework.Core.Architectures; using GFramework.Core.Command; using GFramework.Core.Environment; using GFramework.Core.Events; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Query; using Mediator; using ICommand = GFramework.Core.Abstractions.Command.ICommand; diff --git a/GFramework.Core.Tests/Architectures/GameContextTests.cs b/GFramework.Core.Tests/Architectures/GameContextTests.cs index 083d21b..b5ff02f 100644 --- a/GFramework.Core.Tests/Architectures/GameContextTests.cs +++ b/GFramework.Core.Tests/Architectures/GameContextTests.cs @@ -2,7 +2,7 @@ using GFramework.Core.Abstractions.Architecture; using GFramework.Core.Abstractions.Command; using GFramework.Core.Abstractions.Environment; using GFramework.Core.Abstractions.Events; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Abstractions.Model; using GFramework.Core.Abstractions.Query; using GFramework.Core.Abstractions.Systems; @@ -11,7 +11,7 @@ using GFramework.Core.Architectures; using GFramework.Core.Command; using GFramework.Core.Environment; using GFramework.Core.Events; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Query; using Mediator; using ICommand = GFramework.Core.Abstractions.Command.ICommand; diff --git a/GFramework.Core.Tests/Architectures/PriorityServiceTests.cs b/GFramework.Core.Tests/Architectures/PriorityServiceTests.cs index 2242457..24fd268 100644 --- a/GFramework.Core.Tests/Architectures/PriorityServiceTests.cs +++ b/GFramework.Core.Tests/Architectures/PriorityServiceTests.cs @@ -3,7 +3,7 @@ using GFramework.Core.Abstractions.Bases; using GFramework.Core.Abstractions.Model; using GFramework.Core.Abstractions.Systems; using GFramework.Core.Abstractions.Utility; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Logging; using GFramework.Core.Model; diff --git a/GFramework.Core.Tests/Command/AbstractAsyncCommandTests.cs b/GFramework.Core.Tests/Command/AbstractAsyncCommandTests.cs index 5eac1d2..e7a0611 100644 --- a/GFramework.Core.Tests/Command/AbstractAsyncCommandTests.cs +++ b/GFramework.Core.Tests/Command/AbstractAsyncCommandTests.cs @@ -1,11 +1,11 @@ using GFramework.Core.Abstractions.Command; -using GFramework.Core.Abstractions.CQRS.Command; +using GFramework.Core.Abstractions.Cqrs.Command; using GFramework.Core.Abstractions.Rule; using GFramework.Core.Architectures; using GFramework.Core.Command; using GFramework.Core.Environment; using GFramework.Core.Events; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Query; namespace GFramework.Core.Tests.Command; diff --git a/GFramework.Core.Tests/Command/CommandExecutorTests.cs b/GFramework.Core.Tests/Command/CommandExecutorTests.cs index 61c37fc..060da29 100644 --- a/GFramework.Core.Tests/Command/CommandExecutorTests.cs +++ b/GFramework.Core.Tests/Command/CommandExecutorTests.cs @@ -1,6 +1,5 @@ -using GFramework.Core.Abstractions.CQRS.Command; +using GFramework.Core.Abstractions.Cqrs.Command; using GFramework.Core.Command; -using NUnit.Framework; namespace GFramework.Core.Tests.Command; diff --git a/GFramework.Core.Tests/IoC/IocContainerLifetimeTests.cs b/GFramework.Core.Tests/Ioc/IocContainerLifetimeTests.cs similarity index 98% rename from GFramework.Core.Tests/IoC/IocContainerLifetimeTests.cs rename to GFramework.Core.Tests/Ioc/IocContainerLifetimeTests.cs index 42076b2..4cad849 100644 --- a/GFramework.Core.Tests/IoC/IocContainerLifetimeTests.cs +++ b/GFramework.Core.Tests/Ioc/IocContainerLifetimeTests.cs @@ -1,8 +1,7 @@ -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -namespace GFramework.Core.Tests.IoC; +namespace GFramework.Core.Tests.Ioc; /// /// 测试 IoC 容器生命周期功能 @@ -205,4 +204,4 @@ public class IocContainerLifetimeTests scope2.Dispose(); scope3.Dispose(); } -} +} \ No newline at end of file diff --git a/GFramework.Core.Tests/IoC/MicrosoftDiContainerTests.cs b/GFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.cs similarity index 99% rename from GFramework.Core.Tests/IoC/MicrosoftDiContainerTests.cs rename to GFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.cs index c777f87..0621bcf 100644 --- a/GFramework.Core.Tests/IoC/MicrosoftDiContainerTests.cs +++ b/GFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.cs @@ -1,10 +1,10 @@ using System.Reflection; using GFramework.Core.Abstractions.Bases; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Logging; using GFramework.Core.Tests.Systems; -namespace GFramework.Core.Tests.IoC; +namespace GFramework.Core.Tests.Ioc; /// /// 测试 IoC 容器功能的单元测试类 diff --git a/GFramework.Core.Tests/Mediator/MediatorAdvancedFeaturesTests.cs b/GFramework.Core.Tests/Mediator/MediatorAdvancedFeaturesTests.cs index 6a8beaf..bc5cd78 100644 --- a/GFramework.Core.Tests/Mediator/MediatorAdvancedFeaturesTests.cs +++ b/GFramework.Core.Tests/Mediator/MediatorAdvancedFeaturesTests.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Reflection; using GFramework.Core.Architectures; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Logging; using Mediator; using Microsoft.Extensions.DependencyInjection; diff --git a/GFramework.Core.Tests/Mediator/MediatorArchitectureIntegrationTests.cs b/GFramework.Core.Tests/Mediator/MediatorArchitectureIntegrationTests.cs index 818ebb5..6c67a72 100644 --- a/GFramework.Core.Tests/Mediator/MediatorArchitectureIntegrationTests.cs +++ b/GFramework.Core.Tests/Mediator/MediatorArchitectureIntegrationTests.cs @@ -3,7 +3,7 @@ using System.Reflection; using GFramework.Core.Abstractions.Architecture; using GFramework.Core.Architectures; using GFramework.Core.Command; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Logging; using Mediator; using Microsoft.Extensions.DependencyInjection; diff --git a/GFramework.Core.Tests/Mediator/MediatorComprehensiveTests.cs b/GFramework.Core.Tests/Mediator/MediatorComprehensiveTests.cs index f3c4930..daee8e9 100644 --- a/GFramework.Core.Tests/Mediator/MediatorComprehensiveTests.cs +++ b/GFramework.Core.Tests/Mediator/MediatorComprehensiveTests.cs @@ -7,7 +7,7 @@ using GFramework.Core.Architectures; using GFramework.Core.Command; using GFramework.Core.Environment; using GFramework.Core.Events; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Logging; using GFramework.Core.Query; using Mediator; diff --git a/GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs b/GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs index f7e7a9d..7a645ac 100644 --- a/GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs +++ b/GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs @@ -1,11 +1,11 @@ -using GFramework.Core.Abstractions.CQRS.Query; +using GFramework.Core.Abstractions.Cqrs.Query; using GFramework.Core.Abstractions.Query; using GFramework.Core.Abstractions.Rule; using GFramework.Core.Architectures; using GFramework.Core.Command; using GFramework.Core.Environment; using GFramework.Core.Events; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Query; namespace GFramework.Core.Tests.Query; diff --git a/GFramework.Core.Tests/Query/AsyncQueryExecutorTests.cs b/GFramework.Core.Tests/Query/AsyncQueryExecutorTests.cs index fabee92..6491946 100644 --- a/GFramework.Core.Tests/Query/AsyncQueryExecutorTests.cs +++ b/GFramework.Core.Tests/Query/AsyncQueryExecutorTests.cs @@ -1,6 +1,5 @@ -using GFramework.Core.Abstractions.CQRS.Query; +using GFramework.Core.Abstractions.Cqrs.Query; using GFramework.Core.Query; -using NUnit.Framework; namespace GFramework.Core.Tests.Query; diff --git a/GFramework.Core.Tests/Query/QueryExecutorTests.cs b/GFramework.Core.Tests/Query/QueryExecutorTests.cs index ac8fbcf..f0305b4 100644 --- a/GFramework.Core.Tests/Query/QueryExecutorTests.cs +++ b/GFramework.Core.Tests/Query/QueryExecutorTests.cs @@ -1,6 +1,5 @@ -using GFramework.Core.Abstractions.CQRS.Query; +using GFramework.Core.Abstractions.Cqrs.Query; using GFramework.Core.Query; -using NUnit.Framework; namespace GFramework.Core.Tests.Query; diff --git a/GFramework.Core.Tests/Rule/ContextAwareEnvironmentExtensionsTests.cs b/GFramework.Core.Tests/Rule/ContextAwareEnvironmentExtensionsTests.cs index 30ef275..31b8b71 100644 --- a/GFramework.Core.Tests/Rule/ContextAwareEnvironmentExtensionsTests.cs +++ b/GFramework.Core.Tests/Rule/ContextAwareEnvironmentExtensionsTests.cs @@ -2,7 +2,7 @@ using GFramework.Core.Abstractions.Environment; using GFramework.Core.Abstractions.Rule; using GFramework.Core.Architectures; using GFramework.Core.Extensions; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Rule; namespace GFramework.Core.Tests.Rule; diff --git a/GFramework.Core.Tests/Rule/ContextAwareEventExtensionsTests.cs b/GFramework.Core.Tests/Rule/ContextAwareEventExtensionsTests.cs index 3f59cce..0ee563c 100644 --- a/GFramework.Core.Tests/Rule/ContextAwareEventExtensionsTests.cs +++ b/GFramework.Core.Tests/Rule/ContextAwareEventExtensionsTests.cs @@ -3,7 +3,7 @@ using GFramework.Core.Abstractions.Rule; using GFramework.Core.Architectures; using GFramework.Core.Events; using GFramework.Core.Extensions; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Rule; namespace GFramework.Core.Tests.Rule; diff --git a/GFramework.Core.Tests/Rule/ContextAwareServiceExtensionsTests.cs b/GFramework.Core.Tests/Rule/ContextAwareServiceExtensionsTests.cs index 35c035c..d789bf4 100644 --- a/GFramework.Core.Tests/Rule/ContextAwareServiceExtensionsTests.cs +++ b/GFramework.Core.Tests/Rule/ContextAwareServiceExtensionsTests.cs @@ -6,7 +6,7 @@ using GFramework.Core.Abstractions.Systems; using GFramework.Core.Abstractions.Utility; using GFramework.Core.Architectures; using GFramework.Core.Extensions; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Rule; namespace GFramework.Core.Tests.Rule; diff --git a/GFramework.Core.Tests/State/StateMachineSystemTests.cs b/GFramework.Core.Tests/State/StateMachineSystemTests.cs index fab9f93..0ea62de 100644 --- a/GFramework.Core.Tests/State/StateMachineSystemTests.cs +++ b/GFramework.Core.Tests/State/StateMachineSystemTests.cs @@ -6,7 +6,7 @@ using GFramework.Core.Architectures; using GFramework.Core.Command; using GFramework.Core.Environment; using GFramework.Core.Events; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Logging; using GFramework.Core.Query; using GFramework.Core.State; diff --git a/GFramework.Core.Tests/Utility/AbstractContextUtilityTests.cs b/GFramework.Core.Tests/Utility/AbstractContextUtilityTests.cs index d216de4..9fcdc0b 100644 --- a/GFramework.Core.Tests/Utility/AbstractContextUtilityTests.cs +++ b/GFramework.Core.Tests/Utility/AbstractContextUtilityTests.cs @@ -5,7 +5,7 @@ using GFramework.Core.Architectures; using GFramework.Core.Command; using GFramework.Core.Environment; using GFramework.Core.Events; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Query; using GFramework.Core.Utility; diff --git a/GFramework.Core/Architectures/Architecture.cs b/GFramework.Core/Architectures/Architecture.cs index 3b958fb..a20685d 100644 --- a/GFramework.Core/Architectures/Architecture.cs +++ b/GFramework.Core/Architectures/Architecture.cs @@ -1,7 +1,7 @@ using GFramework.Core.Abstractions.Architecture; using GFramework.Core.Abstractions.Enums; using GFramework.Core.Abstractions.Environment; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Abstractions.Lifecycle; using GFramework.Core.Abstractions.Logging; using GFramework.Core.Abstractions.Model; diff --git a/GFramework.Core/Architectures/ArchitectureContext.cs b/GFramework.Core/Architectures/ArchitectureContext.cs index 1464b7b..e18dc06 100644 --- a/GFramework.Core/Architectures/ArchitectureContext.cs +++ b/GFramework.Core/Architectures/ArchitectureContext.cs @@ -3,7 +3,7 @@ using GFramework.Core.Abstractions.Architecture; using GFramework.Core.Abstractions.Command; using GFramework.Core.Abstractions.Environment; using GFramework.Core.Abstractions.Events; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Abstractions.Model; using GFramework.Core.Abstractions.Query; using GFramework.Core.Abstractions.Systems; diff --git a/GFramework.Core/Architectures/ArchitectureServices.cs b/GFramework.Core/Architectures/ArchitectureServices.cs index da811f2..04a1505 100644 --- a/GFramework.Core/Architectures/ArchitectureServices.cs +++ b/GFramework.Core/Architectures/ArchitectureServices.cs @@ -1,9 +1,9 @@ using GFramework.Core.Abstractions.Architecture; using GFramework.Core.Abstractions.Command; using GFramework.Core.Abstractions.Events; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Abstractions.Query; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Core.Services; namespace GFramework.Core.Architectures; diff --git a/GFramework.Core/Command/AbstractAsyncCommandWithInput.cs b/GFramework.Core/Command/AbstractAsyncCommandWithInput.cs index a739e6f..491bbd8 100644 --- a/GFramework.Core/Command/AbstractAsyncCommandWithInput.cs +++ b/GFramework.Core/Command/AbstractAsyncCommandWithInput.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Command; -using GFramework.Core.Abstractions.CQRS.Command; +using GFramework.Core.Abstractions.Cqrs.Command; using GFramework.Core.Rule; namespace GFramework.Core.Command; diff --git a/GFramework.Core/Command/AbstractAsyncCommandWithResult.cs b/GFramework.Core/Command/AbstractAsyncCommandWithResult.cs index d82d307..4739019 100644 --- a/GFramework.Core/Command/AbstractAsyncCommandWithResult.cs +++ b/GFramework.Core/Command/AbstractAsyncCommandWithResult.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Command; -using GFramework.Core.Abstractions.CQRS.Command; +using GFramework.Core.Abstractions.Cqrs.Command; using GFramework.Core.Rule; namespace GFramework.Core.Command; diff --git a/GFramework.Core/Command/AbstractCommandWithInput.cs b/GFramework.Core/Command/AbstractCommandWithInput.cs index 3bd953b..5326fe6 100644 --- a/GFramework.Core/Command/AbstractCommandWithInput.cs +++ b/GFramework.Core/Command/AbstractCommandWithInput.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Command; -using GFramework.Core.Abstractions.CQRS.Command; +using GFramework.Core.Abstractions.Cqrs.Command; using GFramework.Core.Rule; namespace GFramework.Core.Command; diff --git a/GFramework.Core/Command/AbstractCommandWithResult.cs b/GFramework.Core/Command/AbstractCommandWithResult.cs index bed8b8f..6790182 100644 --- a/GFramework.Core/Command/AbstractCommandWithResult.cs +++ b/GFramework.Core/Command/AbstractCommandWithResult.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Command; -using GFramework.Core.Abstractions.CQRS.Command; +using GFramework.Core.Abstractions.Cqrs.Command; using GFramework.Core.Rule; namespace GFramework.Core.Command; diff --git a/GFramework.Core/Command/EmptyCommandInput.cs b/GFramework.Core/Command/EmptyCommandInput.cs index 7242e20..4d08f4e 100644 --- a/GFramework.Core/Command/EmptyCommandInput.cs +++ b/GFramework.Core/Command/EmptyCommandInput.cs @@ -1,4 +1,4 @@ -using GFramework.Core.Abstractions.CQRS.Command; +using GFramework.Core.Abstractions.Cqrs.Command; namespace GFramework.Core.Command; diff --git a/GFramework.Core/CQRS/Behaviors/LoggingBehavior.cs b/GFramework.Core/Cqrs/Behaviors/LoggingBehavior.cs similarity index 98% rename from GFramework.Core/CQRS/Behaviors/LoggingBehavior.cs rename to GFramework.Core/Cqrs/Behaviors/LoggingBehavior.cs index 0abfe5a..4a56c77 100644 --- a/GFramework.Core/CQRS/Behaviors/LoggingBehavior.cs +++ b/GFramework.Core/Cqrs/Behaviors/LoggingBehavior.cs @@ -16,7 +16,7 @@ using GFramework.Core.Abstractions.Logging; using GFramework.Core.Logging; using Mediator; -namespace GFramework.Core.CQRS.Behaviors; +namespace GFramework.Core.Cqrs.Behaviors; /// /// 日志记录行为类,用于在CQRS管道中记录请求处理的日志信息 diff --git a/GFramework.Core/CQRS/Behaviors/PerformanceBehavior.cs b/GFramework.Core/Cqrs/Behaviors/PerformanceBehavior.cs similarity index 98% rename from GFramework.Core/CQRS/Behaviors/PerformanceBehavior.cs rename to GFramework.Core/Cqrs/Behaviors/PerformanceBehavior.cs index abef140..f86669d 100644 --- a/GFramework.Core/CQRS/Behaviors/PerformanceBehavior.cs +++ b/GFramework.Core/Cqrs/Behaviors/PerformanceBehavior.cs @@ -16,7 +16,7 @@ using GFramework.Core.Abstractions.Logging; using GFramework.Core.Logging; using Mediator; -namespace GFramework.Core.CQRS.Behaviors; +namespace GFramework.Core.Cqrs.Behaviors; /// /// 性能监控行为类,用于监控CQRS请求的执行时间 diff --git a/GFramework.Core/CQRS/Command/AbstractCommandHandler.cs b/GFramework.Core/Cqrs/Command/AbstractCommandHandler.cs similarity index 98% rename from GFramework.Core/CQRS/Command/AbstractCommandHandler.cs rename to GFramework.Core/Cqrs/Command/AbstractCommandHandler.cs index ca16877..8f7b611 100644 --- a/GFramework.Core/CQRS/Command/AbstractCommandHandler.cs +++ b/GFramework.Core/Cqrs/Command/AbstractCommandHandler.cs @@ -14,7 +14,7 @@ using GFramework.Core.Rule; using Mediator; -namespace GFramework.Core.CQRS.Command; +namespace GFramework.Core.Cqrs.Command; /// /// 抽象命令处理器基类 diff --git a/GFramework.Core/CQRS/Command/AbstractStreamCommandHandler.cs b/GFramework.Core/Cqrs/Command/AbstractStreamCommandHandler.cs similarity index 97% rename from GFramework.Core/CQRS/Command/AbstractStreamCommandHandler.cs rename to GFramework.Core/Cqrs/Command/AbstractStreamCommandHandler.cs index a0745e7..064cb27 100644 --- a/GFramework.Core/CQRS/Command/AbstractStreamCommandHandler.cs +++ b/GFramework.Core/Cqrs/Command/AbstractStreamCommandHandler.cs @@ -14,7 +14,7 @@ using GFramework.Core.Rule; using Mediator; -namespace GFramework.Core.CQRS.Command; +namespace GFramework.Core.Cqrs.Command; /// /// 抽象流式命令处理器基类 diff --git a/GFramework.Core/CQRS/Command/CommandBase.cs b/GFramework.Core/Cqrs/Command/CommandBase.cs similarity index 93% rename from GFramework.Core/CQRS/Command/CommandBase.cs rename to GFramework.Core/Cqrs/Command/CommandBase.cs index 506bebc..ba0e56a 100644 --- a/GFramework.Core/CQRS/Command/CommandBase.cs +++ b/GFramework.Core/Cqrs/Command/CommandBase.cs @@ -11,10 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -using GFramework.Core.Abstractions.CQRS.Command; +using GFramework.Core.Abstractions.Cqrs.Command; using Mediator; -namespace GFramework.Core.CQRS.Command; +namespace GFramework.Core.Cqrs.Command; /// /// 表示一个基础命令类,用于处理带有输入和响应的命令模式实现。 diff --git a/GFramework.Core/CQRS/Notification/AbstractNotificationHandler.cs b/GFramework.Core/Cqrs/Notification/AbstractNotificationHandler.cs similarity index 97% rename from GFramework.Core/CQRS/Notification/AbstractNotificationHandler.cs rename to GFramework.Core/Cqrs/Notification/AbstractNotificationHandler.cs index 80a8604..de4772f 100644 --- a/GFramework.Core/CQRS/Notification/AbstractNotificationHandler.cs +++ b/GFramework.Core/Cqrs/Notification/AbstractNotificationHandler.cs @@ -14,7 +14,7 @@ using GFramework.Core.Rule; using Mediator; -namespace GFramework.Core.CQRS.Notification; +namespace GFramework.Core.Cqrs.Notification; /// /// 抽象通知处理器基类 diff --git a/GFramework.Core/CQRS/Notification/NotificationBase.cs b/GFramework.Core/Cqrs/Notification/NotificationBase.cs similarity index 92% rename from GFramework.Core/CQRS/Notification/NotificationBase.cs rename to GFramework.Core/Cqrs/Notification/NotificationBase.cs index 4a156bf..96e26ea 100644 --- a/GFramework.Core/CQRS/Notification/NotificationBase.cs +++ b/GFramework.Core/Cqrs/Notification/NotificationBase.cs @@ -11,10 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -using GFramework.Core.Abstractions.CQRS.Notification; +using GFramework.Core.Abstractions.Cqrs.Notification; using Mediator; -namespace GFramework.Core.CQRS.Notification; +namespace GFramework.Core.Cqrs.Notification; /// /// 表示一个基础通知类,用于处理带有输入的通知模式实现。 diff --git a/GFramework.Core/CQRS/Query/AbstractQueryHandler.cs b/GFramework.Core/Cqrs/Query/AbstractQueryHandler.cs similarity index 97% rename from GFramework.Core/CQRS/Query/AbstractQueryHandler.cs rename to GFramework.Core/Cqrs/Query/AbstractQueryHandler.cs index fde1a3f..4ce887c 100644 --- a/GFramework.Core/CQRS/Query/AbstractQueryHandler.cs +++ b/GFramework.Core/Cqrs/Query/AbstractQueryHandler.cs @@ -14,7 +14,7 @@ using GFramework.Core.Rule; using Mediator; -namespace GFramework.Core.CQRS.Query; +namespace GFramework.Core.Cqrs.Query; /// /// 抽象查询处理器基类 diff --git a/GFramework.Core/CQRS/Query/AbstractStreamQueryHandler.cs b/GFramework.Core/Cqrs/Query/AbstractStreamQueryHandler.cs similarity index 97% rename from GFramework.Core/CQRS/Query/AbstractStreamQueryHandler.cs rename to GFramework.Core/Cqrs/Query/AbstractStreamQueryHandler.cs index 9e155ec..50cf181 100644 --- a/GFramework.Core/CQRS/Query/AbstractStreamQueryHandler.cs +++ b/GFramework.Core/Cqrs/Query/AbstractStreamQueryHandler.cs @@ -14,7 +14,7 @@ using GFramework.Core.Rule; using Mediator; -namespace GFramework.Core.CQRS.Query; +namespace GFramework.Core.Cqrs.Query; /// /// 抽象流式查询处理器基类 diff --git a/GFramework.Core/CQRS/Query/QueryBase.cs b/GFramework.Core/Cqrs/Query/QueryBase.cs similarity index 93% rename from GFramework.Core/CQRS/Query/QueryBase.cs rename to GFramework.Core/Cqrs/Query/QueryBase.cs index eadf491..2ef0f34 100644 --- a/GFramework.Core/CQRS/Query/QueryBase.cs +++ b/GFramework.Core/Cqrs/Query/QueryBase.cs @@ -11,10 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -using GFramework.Core.Abstractions.CQRS.Query; +using GFramework.Core.Abstractions.Cqrs.Query; using Mediator; -namespace GFramework.Core.CQRS.Query; +namespace GFramework.Core.Cqrs.Query; /// /// 表示一个基础查询类,用于处理带有输入和响应的查询模式实现。 diff --git a/GFramework.Core/CQRS/Request/AbstractRequestHandler.cs b/GFramework.Core/Cqrs/Request/AbstractRequestHandler.cs similarity index 98% rename from GFramework.Core/CQRS/Request/AbstractRequestHandler.cs rename to GFramework.Core/Cqrs/Request/AbstractRequestHandler.cs index b0fd778..88e9efa 100644 --- a/GFramework.Core/CQRS/Request/AbstractRequestHandler.cs +++ b/GFramework.Core/Cqrs/Request/AbstractRequestHandler.cs @@ -14,7 +14,7 @@ using GFramework.Core.Rule; using Mediator; -namespace GFramework.Core.CQRS.Request; +namespace GFramework.Core.Cqrs.Request; /// /// 抽象请求处理器基类,用于处理不返回具体响应的请求 diff --git a/GFramework.Core/CQRS/Request/AbstractStreamRequestHandler.cs b/GFramework.Core/Cqrs/Request/AbstractStreamRequestHandler.cs similarity index 97% rename from GFramework.Core/CQRS/Request/AbstractStreamRequestHandler.cs rename to GFramework.Core/Cqrs/Request/AbstractStreamRequestHandler.cs index 861f3e7..a6151b4 100644 --- a/GFramework.Core/CQRS/Request/AbstractStreamRequestHandler.cs +++ b/GFramework.Core/Cqrs/Request/AbstractStreamRequestHandler.cs @@ -14,7 +14,7 @@ using GFramework.Core.Rule; using Mediator; -namespace GFramework.Core.CQRS.Request; +namespace GFramework.Core.Cqrs.Request; /// /// 抽象流式请求处理器基类 diff --git a/GFramework.Core/CQRS/Request/RequestBase.cs b/GFramework.Core/Cqrs/Request/RequestBase.cs similarity index 93% rename from GFramework.Core/CQRS/Request/RequestBase.cs rename to GFramework.Core/Cqrs/Request/RequestBase.cs index 876398b..8b87875 100644 --- a/GFramework.Core/CQRS/Request/RequestBase.cs +++ b/GFramework.Core/Cqrs/Request/RequestBase.cs @@ -11,10 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -using GFramework.Core.Abstractions.CQRS.Request; +using GFramework.Core.Abstractions.Cqrs.Request; using Mediator; -namespace GFramework.Core.CQRS.Request; +namespace GFramework.Core.Cqrs.Request; /// /// 表示一个基础请求类,用于处理带有输入和响应的请求模式实现。 diff --git a/GFramework.Core/IoC/MicrosoftDiContainer.cs b/GFramework.Core/Ioc/MicrosoftDiContainer.cs similarity index 99% rename from GFramework.Core/IoC/MicrosoftDiContainer.cs rename to GFramework.Core/Ioc/MicrosoftDiContainer.cs index 2a4bb9f..48373fb 100644 --- a/GFramework.Core/IoC/MicrosoftDiContainer.cs +++ b/GFramework.Core/Ioc/MicrosoftDiContainer.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Bases; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Abstractions.Logging; using GFramework.Core.Abstractions.Systems; using GFramework.Core.Logging; @@ -7,7 +7,7 @@ using GFramework.Core.Rule; using Mediator; using Microsoft.Extensions.DependencyInjection; -namespace GFramework.Core.IoC; +namespace GFramework.Core.Ioc; /// /// Microsoft.Extensions.DependencyInjection 适配器 diff --git a/GFramework.Core/Query/AbstractAsyncQueryWithResult.cs b/GFramework.Core/Query/AbstractAsyncQueryWithResult.cs index 9efaf39..03c3507 100644 --- a/GFramework.Core/Query/AbstractAsyncQueryWithResult.cs +++ b/GFramework.Core/Query/AbstractAsyncQueryWithResult.cs @@ -1,4 +1,4 @@ -using GFramework.Core.Abstractions.CQRS.Query; +using GFramework.Core.Abstractions.Cqrs.Query; using GFramework.Core.Abstractions.Query; using GFramework.Core.Rule; diff --git a/GFramework.Core/Query/AbstractQueryWithResult.cs b/GFramework.Core/Query/AbstractQueryWithResult.cs index ad00b22..cb46071 100644 --- a/GFramework.Core/Query/AbstractQueryWithResult.cs +++ b/GFramework.Core/Query/AbstractQueryWithResult.cs @@ -1,4 +1,4 @@ -using GFramework.Core.Abstractions.CQRS.Query; +using GFramework.Core.Abstractions.Cqrs.Query; using GFramework.Core.Abstractions.Query; using GFramework.Core.Rule; diff --git a/GFramework.Core/Query/EmptyQueryInput.cs b/GFramework.Core/Query/EmptyQueryInput.cs index e2893a5..7d70718 100644 --- a/GFramework.Core/Query/EmptyQueryInput.cs +++ b/GFramework.Core/Query/EmptyQueryInput.cs @@ -1,4 +1,4 @@ -using GFramework.Core.Abstractions.CQRS.Query; +using GFramework.Core.Abstractions.Cqrs.Query; namespace GFramework.Core.Query; diff --git a/GFramework.Core/Services/Modules/AsyncQueryExecutorModule.cs b/GFramework.Core/Services/Modules/AsyncQueryExecutorModule.cs index a3920f8..a29aade 100644 --- a/GFramework.Core/Services/Modules/AsyncQueryExecutorModule.cs +++ b/GFramework.Core/Services/Modules/AsyncQueryExecutorModule.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Architecture; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Query; namespace GFramework.Core.Services.Modules; diff --git a/GFramework.Core/Services/Modules/CommandExecutorModule.cs b/GFramework.Core/Services/Modules/CommandExecutorModule.cs index a4e462e..f94f4d5 100644 --- a/GFramework.Core/Services/Modules/CommandExecutorModule.cs +++ b/GFramework.Core/Services/Modules/CommandExecutorModule.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Architecture; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Command; namespace GFramework.Core.Services.Modules; diff --git a/GFramework.Core/Services/Modules/EventBusModule.cs b/GFramework.Core/Services/Modules/EventBusModule.cs index cb8b75c..32065ba 100644 --- a/GFramework.Core/Services/Modules/EventBusModule.cs +++ b/GFramework.Core/Services/Modules/EventBusModule.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Architecture; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Events; namespace GFramework.Core.Services.Modules; diff --git a/GFramework.Core/Services/Modules/QueryExecutorModule.cs b/GFramework.Core/Services/Modules/QueryExecutorModule.cs index 487d718..5df23bc 100644 --- a/GFramework.Core/Services/Modules/QueryExecutorModule.cs +++ b/GFramework.Core/Services/Modules/QueryExecutorModule.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Architecture; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Query; namespace GFramework.Core.Services.Modules; diff --git a/GFramework.Core/Services/ServiceModuleManager.cs b/GFramework.Core/Services/ServiceModuleManager.cs index 3cf4b1d..1bb07cf 100644 --- a/GFramework.Core/Services/ServiceModuleManager.cs +++ b/GFramework.Core/Services/ServiceModuleManager.cs @@ -1,5 +1,5 @@ using GFramework.Core.Abstractions.Architecture; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; using GFramework.Core.Abstractions.Lifecycle; using GFramework.Core.Abstractions.Logging; using GFramework.Core.Logging; diff --git a/GFramework.Ecs.Arch.Tests/Ecs/EcsAdvancedTests.cs b/GFramework.Ecs.Arch.Tests/Ecs/EcsAdvancedTests.cs index 5d9d808..7bf6e34 100644 --- a/GFramework.Ecs.Arch.Tests/Ecs/EcsAdvancedTests.cs +++ b/GFramework.Ecs.Arch.Tests/Ecs/EcsAdvancedTests.cs @@ -2,11 +2,11 @@ using System.Diagnostics.CodeAnalysis; using Arch.Core; using GFramework.Core.Abstractions.Rule; using GFramework.Core.Architectures; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Ecs.Arch.Components; using GFramework.Ecs.Arch.Systems; -namespace GFramework.Ecs.Arch.Tests.ECS; +namespace GFramework.Ecs.Arch.Tests.Ecs; /// /// ECS 高级功能测试类 - 使用 Arch 原生 API diff --git a/GFramework.Ecs.Arch.Tests/Ecs/EcsBasicTests.cs b/GFramework.Ecs.Arch.Tests/Ecs/EcsBasicTests.cs index e6681d0..deca15f 100644 --- a/GFramework.Ecs.Arch.Tests/Ecs/EcsBasicTests.cs +++ b/GFramework.Ecs.Arch.Tests/Ecs/EcsBasicTests.cs @@ -2,11 +2,11 @@ using System.Diagnostics.CodeAnalysis; using Arch.Core; using GFramework.Core.Abstractions.Rule; using GFramework.Core.Architectures; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Ecs.Arch.Components; using GFramework.Ecs.Arch.Systems; -namespace GFramework.Ecs.Arch.Tests.ECS; +namespace GFramework.Ecs.Arch.Tests.Ecs; /// /// ECS 基础功能测试类 - 使用 Arch 原生 API diff --git a/GFramework.Ecs.Arch.Tests/Ecs/EcsIntegrationTests.cs b/GFramework.Ecs.Arch.Tests/Ecs/EcsIntegrationTests.cs index 79be58e..37ad34b 100644 --- a/GFramework.Ecs.Arch.Tests/Ecs/EcsIntegrationTests.cs +++ b/GFramework.Ecs.Arch.Tests/Ecs/EcsIntegrationTests.cs @@ -2,11 +2,11 @@ using System.Diagnostics.CodeAnalysis; using Arch.Core; using GFramework.Core.Abstractions.Rule; using GFramework.Core.Architectures; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Ecs.Arch.Components; using GFramework.Ecs.Arch.Systems; -namespace GFramework.Ecs.Arch.Tests.ECS; +namespace GFramework.Ecs.Arch.Tests.Ecs; /// /// ECS 集成测试类 - 使用 Arch 原生 API diff --git a/GFramework.Ecs.Arch.Tests/Integration/ExplicitRegistrationTests.cs b/GFramework.Ecs.Arch.Tests/Integration/ExplicitRegistrationTests.cs index 5e13e51..dc27db2 100644 --- a/GFramework.Ecs.Arch.Tests/Integration/ExplicitRegistrationTests.cs +++ b/GFramework.Ecs.Arch.Tests/Integration/ExplicitRegistrationTests.cs @@ -1,7 +1,7 @@ using Arch.Core; using GFramework.Core.Abstractions.Architecture; using GFramework.Core.Architectures; -using GFramework.Core.IoC; +using GFramework.Core.Ioc; using GFramework.Ecs.Arch.Abstractions; using GFramework.Ecs.Arch.Extensions; diff --git a/GFramework.Ecs.Arch/ArchEcsModule.cs b/GFramework.Ecs.Arch/ArchEcsModule.cs index 642c930..9a22c27 100644 --- a/GFramework.Ecs.Arch/ArchEcsModule.cs +++ b/GFramework.Ecs.Arch/ArchEcsModule.cs @@ -1,5 +1,5 @@ using Arch.Core; -using GFramework.Core.Abstractions.IoC; +using GFramework.Core.Abstractions.Ioc; namespace GFramework.Ecs.Arch; diff --git a/GFramework.SourceGenerators/Analyzers/PriorityUsageAnalyzer.cs b/GFramework.SourceGenerators/Analyzers/PriorityUsageAnalyzer.cs index 3267853..6fc3a96 100644 --- a/GFramework.SourceGenerators/Analyzers/PriorityUsageAnalyzer.cs +++ b/GFramework.SourceGenerators/Analyzers/PriorityUsageAnalyzer.cs @@ -36,7 +36,7 @@ public sealed class PriorityUsageAnalyzer : DiagnosticAnalyzer return; var iocContainer = compilationContext.Compilation.GetTypeByMetadataName( - "GFramework.Core.Abstractions.IoC.IIocContainer"); + "GFramework.Core.Abstractions.Ioc.IIocContainer"); var architectureContext = compilationContext.Compilation.GetTypeByMetadataName( "GFramework.Core.Abstractions.Architecture.IArchitectureContext"); diff --git a/folder-mappings.json b/folder-mappings.json deleted file mode 100644 index 5280e6a..0000000 --- a/folder-mappings.json +++ /dev/null @@ -1,618 +0,0 @@ -{ - "projects": [ - { - "name": "GFramework.Core.Abstractions", - "path": "GFramework.Core.Abstractions", - "folders": [ - { - "old": "cqrs/behaviors", - "new": "CQRS/Behaviors" - }, - { - "old": "cqrs/command", - "new": "CQRS/Command" - }, - { - "old": "cqrs/notification", - "new": "CQRS/Notification" - }, - { - "old": "cqrs/query", - "new": "CQRS/Query" - }, - { - "old": "cqrs/request", - "new": "CQRS/Request" - }, - { - "old": "cqrs", - "new": "CQRS" - }, - { - "old": "architecture", - "new": "Architecture" - }, - { - "old": "bases", - "new": "Bases" - }, - { - "old": "command", - "new": "Command" - }, - { - "old": "configuration", - "new": "Configuration" - }, - { - "old": "controller", - "new": "Controller" - }, - { - "old": "coroutine", - "new": "Coroutine" - }, - { - "old": "data", - "new": "Data" - }, - { - "old": "enums", - "new": "Enums" - }, - { - "old": "environment", - "new": "Environment" - }, - { - "old": "events", - "new": "Events" - }, - { - "old": "internals", - "new": "Internals" - }, - { - "old": "ioc", - "new": "IoC" - }, - { - "old": "lifecycle", - "new": "Lifecycle" - }, - { - "old": "logging", - "new": "Logging" - }, - { - "old": "model", - "new": "Model" - }, - { - "old": "pause", - "new": "Pause" - }, - { - "old": "pool", - "new": "Pool" - }, - { - "old": "properties", - "new": "Properties" - }, - { - "old": "property", - "new": "Property" - }, - { - "old": "query", - "new": "Query" - }, - { - "old": "registries", - "new": "Registries" - }, - { - "old": "resource", - "new": "Resource" - }, - { - "old": "rule", - "new": "Rule" - }, - { - "old": "serializer", - "new": "Serializer" - }, - { - "old": "state", - "new": "State" - }, - { - "old": "storage", - "new": "Storage" - }, - { - "old": "system", - "new": "System" - }, - { - "old": "time", - "new": "Time" - }, - { - "old": "utility", - "new": "Utility" - }, - { - "old": "versioning", - "new": "Versioning" - } - ] - }, - { - "name": "GFramework.Core", - "path": "GFramework.Core", - "folders": [ - { - "old": "cqrs/behaviors", - "new": "CQRS/Behaviors" - }, - { - "old": "cqrs/command", - "new": "CQRS/Command" - }, - { - "old": "cqrs/notification", - "new": "CQRS/Notification" - }, - { - "old": "cqrs/query", - "new": "CQRS/Query" - }, - { - "old": "cqrs/request", - "new": "CQRS/Request" - }, - { - "old": "cqrs", - "new": "CQRS" - }, - { - "old": "coroutine/extensions", - "new": "Coroutine/Extensions" - }, - { - "old": "coroutine/instructions", - "new": "Coroutine/Instructions" - }, - { - "old": "coroutine", - "new": "Coroutine" - }, - { - "old": "functional/async", - "new": "Functional/Async" - }, - { - "old": "functional/control", - "new": "Functional/Control" - }, - { - "old": "functional/functions", - "new": "Functional/Functions" - }, - { - "old": "functional/pipe", - "new": "Functional/Pipe" - }, - { - "old": "functional/result", - "new": "Functional/Result" - }, - { - "old": "functional", - "new": "Functional" - }, - { - "old": "logging/appenders", - "new": "Logging/Appenders" - }, - { - "old": "logging/filters", - "new": "Logging/Filters" - }, - { - "old": "log/formatters", - "new": "Logging/Formatters" - }, - { - "old": "logging", - "new": "Logging" - }, - { - "old": "services/modules", - "new": "Services/Modules" - }, - { - "old": "services", - "new": "Services" - }, - { - "old": "architecture", - "new": "Architecture" - }, - { - "old": "command", - "new": "Command" - }, - { - "old": "configuration", - "new": "Configuration" - }, - { - "old": "environment", - "new": "Environment" - }, - { - "old": "events", - "new": "Events" - }, - { - "old": "extensions", - "new": "Extensions" - }, - { - "old": "ioc", - "new": "IoC" - }, - { - "old": "model", - "new": "Model" - }, - { - "old": "pause", - "new": "Pause" - }, - { - "old": "pool", - "new": "Pool" - }, - { - "old": "property", - "new": "Property" - }, - { - "old": "query", - "new": "Query" - }, - { - "old": "resource", - "new": "Resource" - }, - { - "old": "rule", - "new": "Rule" - }, - { - "old": "state", - "new": "State" - }, - { - "old": "system", - "new": "System" - }, - { - "old": "time", - "new": "Time" - }, - { - "old": "utility", - "new": "Utility" - } - ] - }, - { - "name": "GFramework.Core.Tests", - "path": "GFramework.Core.Tests", - "folders": [ - { - "old": "architecture", - "new": "Architecture" - }, - { - "old": "extensions", - "new": "Extensions" - }, - { - "old": "logging", - "new": "Logging" - } - ] - }, - { - "name": "GFramework.Game.Abstractions", - "path": "GFramework.Game.Abstractions", - "folders": [ - { - "old": "data", - "new": "Data" - }, - { - "old": "scene", - "new": "Scene" - }, - { - "old": "serializer", - "new": "Serializer" - }, - { - "old": "setting/events", - "new": "Setting/Events" - }, - { - "old": "setting", - "new": "Setting" - }, - { - "old": "state", - "new": "State" - }, - { - "old": "storage", - "new": "Storage" - }, - { - "old": "ui/handler", - "new": "UI/Handler" - }, - { - "old": "ui", - "new": "UI" - } - ] - }, - { - "name": "GFramework.Game", - "path": "GFramework.Game", - "folders": [ - { - "old": "data", - "new": "Data" - }, - { - "old": "extensions", - "new": "Extensions" - }, - { - "old": "scene/handler", - "new": "Scene/Handler" - }, - { - "old": "scene", - "new": "Scene" - }, - { - "old": "serializer", - "new": "Serializer" - }, - { - "old": "setting/events", - "new": "Setting/Events" - }, - { - "old": "setting", - "new": "Setting" - }, - { - "old": "state", - "new": "State" - }, - { - "old": "storage", - "new": "Storage" - }, - { - "old": "ui/handler", - "new": "UI/Handler" - }, - { - "old": "ui", - "new": "UI" - } - ] - }, - { - "name": "GFramework.Godot", - "path": "GFramework.Godot", - "folders": [ - { - "old": "extensions/signal", - "new": "Extensions/Signal" - }, - { - "old": "extensions", - "new": "Extensions" - }, - { - "old": "setting/data", - "new": "Setting/Data" - }, - { - "old": "setting", - "new": "Setting" - }, - { - "old": "architecture", - "new": "Architecture" - }, - { - "old": "coroutine", - "new": "Coroutine" - }, - { - "old": "data", - "new": "Data" - }, - { - "old": "logging", - "new": "Logging" - }, - { - "old": "pause", - "new": "Pause" - }, - { - "old": "pool", - "new": "Pool" - }, - { - "old": "scene", - "new": "Scene" - }, - { - "old": "storage", - "new": "Storage" - }, - { - "old": "ui", - "new": "UI" - } - ] - }, - { - "name": "GFramework.Ecs.Arch.Abstractions", - "path": "GFramework.Ecs.Arch.Abstractions", - "folders": [ - { - "old": "components", - "new": "Components" - }, - { - "old": "systems", - "new": "Systems" - } - ] - }, - { - "name": "GFramework.Ecs.Arch", - "path": "GFramework.Ecs.Arch", - "folders": [ - { - "old": "components", - "new": "Components" - }, - { - "old": "extensions", - "new": "Extensions" - }, - { - "old": "systems", - "new": "Systems" - } - ] - }, - { - "name": "GFramework.Ecs.Arch.Tests", - "path": "GFramework.Ecs.Arch.Tests", - "folders": [ - { - "old": "integration", - "new": "Integration" - }, - { - "old": "systems", - "new": "Systems" - } - ] - }, - { - "name": "GFramework.SourceGenerators.Abstractions", - "path": "GFramework.SourceGenerators.Abstractions", - "folders": [ - { - "old": "bases", - "new": "Bases" - }, - { - "old": "diagnostics", - "new": "Diagnostics" - }, - { - "old": "enums", - "new": "Enums" - } - ] - }, - { - "name": "GFramework.SourceGenerators", - "path": "GFramework.SourceGenerators", - "folders": [ - { - "old": "analyzers", - "new": "Analyzers" - }, - { - "old": "bases", - "new": "Bases" - }, - { - "old": "diagnostics", - "new": "Diagnostics" - }, - { - "old": "enums", - "new": "Enums" - }, - { - "old": "logging", - "new": "Logging" - }, - { - "old": "rule", - "new": "Rule" - } - ] - }, - { - "name": "GFramework.Godot.SourceGenerators.Abstractions", - "path": "GFramework.Godot.SourceGenerators.Abstractions", - "folders": [ - { - "old": "bases", - "new": "Bases" - }, - { - "old": "diagnostics", - "new": "Diagnostics" - }, - { - "old": "enums", - "new": "Enums" - } - ] - }, - { - "name": "GFramework.Godot.SourceGenerators", - "path": "GFramework.Godot.SourceGenerators", - "folders": [ - { - "old": "analyzers", - "new": "Analyzers" - }, - { - "old": "bases", - "new": "Bases" - }, - { - "old": "diagnostics", - "new": "Diagnostics" - }, - { - "old": "enums", - "new": "Enums" - } - ] - } - ] -} diff --git a/refactor-namespaces.ps1 b/refactor-namespaces.ps1 deleted file mode 100644 index 38190e5..0000000 --- a/refactor-namespaces.ps1 +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env pwsh - -param( - [switch]$DryRun, - [switch]$SkipTests, - [string]$Phase = "all" -) - -$ErrorActionPreference = "Stop" - -function Write-Phase { - param([string]$Message) - Write-Host "`n========================================" -ForegroundColor Cyan - Write-Host $Message -ForegroundColor Cyan - Write-Host "========================================`n" -ForegroundColor Cyan -} - -function Invoke-GitCommand { - param([string]$Command) - if ($DryRun) { - Write-Host "[DRY RUN] git $Command" -ForegroundColor Yellow - } else { - Invoke-Expression "git $Command" - if ($LASTEXITCODE -ne 0) { - throw "Git command failed: git $Command" - } - } -} - -# Phase 0: Preparation -if ($Phase -eq "all" -or $Phase -eq "0") { - Write-Phase "Phase 0: Preparation" - - # Check clean working directory - $status = git status --porcelain - if ($status) { - Write-Error "Working directory is not clean. Please commit or stash changes first." - exit 1 - } - - # Create backup tag - Write-Host "Creating backup tag..." - Invoke-GitCommand "tag backup-before-namespace-refactor-$(Get-Date -Format 'yyyyMMdd-HHmmss')" - - # Run baseline tests - if (-not $SkipTests) { - Write-Host "Running baseline tests..." - dotnet test - if ($LASTEXITCODE -ne 0) { - Write-Error "Baseline tests failed. Please fix before proceeding." - exit 1 - } - } - - Write-Host "✓ Preparation complete" -ForegroundColor Green -} - -# Phase 1: Rename folders -if ($Phase -eq "all" -or $Phase -eq "1") { - Write-Phase "Phase 1: Rename Folders" - - # Load mappings - $mappingsJson = Get-Content "folder-mappings.json" -Raw | ConvertFrom-Json - - foreach ($project in $mappingsJson.projects) { - Write-Host "`nProcessing project: $($project.name)" -ForegroundColor Yellow - - # Sort folders by depth (deepest first) to avoid conflicts - $sortedFolders = $project.folders | Sort-Object { ($_.old -split '/').Count } -Descending - - foreach ($mapping in $sortedFolders) { - $oldPath = Join-Path $project.path $mapping.old - $newPath = Join-Path $project.path $mapping.new - - if (Test-Path $oldPath) { - # Windows case-insensitive workaround - if ($mapping.old.ToLower() -eq $mapping.new.ToLower()) { - $tempPath = "$oldPath`_temp" - Write-Host " Renaming (2-step): $($mapping.old) → $($mapping.new)" - Invoke-GitCommand "mv `"$oldPath`" `"$tempPath`"" - Invoke-GitCommand "mv `"$tempPath`" `"$newPath`"" - } else { - Write-Host " Renaming: $($mapping.old) → $($mapping.new)" - Invoke-GitCommand "mv `"$oldPath`" `"$newPath`"" - } - } else { - Write-Host " Skipping (not found): $($mapping.old)" -ForegroundColor Gray - } - } - } - - if (-not $DryRun) { - Write-Host "`nCommitting folder renames..." - git commit -m "refactor: rename folders to PascalCase (phase 1)" - } - - Write-Host "✓ Phase 1 complete" -ForegroundColor Green -} - -Write-Host "`n✓ Script execution complete!" -ForegroundColor Green -Write-Host "Next steps:" -ForegroundColor Cyan -Write-Host " 1. Run: ./update-namespaces.ps1" -ForegroundColor White -Write-Host " 2. Run: ./update-documentation.ps1" -ForegroundColor White -Write-Host " 3. Run: ./verify-namespaces.ps1" -ForegroundColor White diff --git a/scripts/validate-csharp-naming.sh b/scripts/validate-csharp-naming.sh new file mode 100644 index 0000000..1a38f04 --- /dev/null +++ b/scripts/validate-csharp-naming.sh @@ -0,0 +1,148 @@ +#!/usr/bin/env bash +set -euo pipefail + +if ! command -v git >/dev/null 2>&1; then + echo "git is required to enumerate tracked C# files." >&2 + exit 2 +fi + +if ! command -v grep >/dev/null 2>&1; then + echo "grep is required to validate C# naming conventions." >&2 + exit 2 +fi + +repo_root="$(git rev-parse --show-toplevel)" +cd "$repo_root" + +readonly PASCAL_CASE_REGEX='^(?:[A-Z](?=[A-Z][a-z0-9])|[A-Z]{2}(?=$|[A-Z][a-z0-9])|[A-Z][a-z0-9]+)+$' + +files_checked=0 +declare -a namespace_violations=() +declare -a directory_violations=() +declare -A seen_directories=() +declare -A seen_directory_violations=() + +is_excluded() { + local path="$1" + case "$path" in + Godot/script_templates|Godot/script_templates/*) + return 0 + ;; + *) + return 1 + ;; + esac +} + +validate_segment() { + local segment="$1" + + if [[ ! "$segment" =~ ^[A-Za-z][A-Za-z0-9]*$ ]]; then + printf '%s' "must start with a letter and contain only letters or digits" + return 1 + fi + + if [[ ! "$segment" =~ ^[A-Z] ]]; then + printf '%s' "must start with an uppercase letter" + return 1 + fi + + if [[ "$segment" =~ ^[A-Z]+$ ]]; then + if (( ${#segment} <= 2 )); then + return 0 + fi + + printf '%s' "acronyms longer than 2 letters must use PascalCase" + return 1 + fi + + if ! printf '%s\n' "$segment" | grep -Pq "$PASCAL_CASE_REGEX"; then + printf '%s' "must use PascalCase; only 2-letter acronyms may stay fully uppercase" + return 1 + fi + + return 0 +} + +check_directory_path() { + local relative_dir="$1" + local raw_segment="" + local segment="" + local reason="" + local key="" + + IFS='/' read -r -a raw_segments <<< "$relative_dir" + for raw_segment in "${raw_segments[@]}"; do + IFS='.' read -r -a segments <<< "$raw_segment" + for segment in "${segments[@]}"; do + if ! reason="$(validate_segment "$segment")"; then + key="$relative_dir|$segment|$reason" + if [[ -z "${seen_directory_violations[$key]:-}" ]]; then + seen_directory_violations["$key"]=1 + directory_violations+=("- $relative_dir -> \"$segment\": $reason") + fi + + return + fi + done + done +} + +while IFS= read -r relative_file; do + if [[ -z "$relative_file" ]] || is_excluded "$relative_file"; then + continue + fi + + ((files_checked += 1)) + + while IFS=: read -r line_number namespace; do + [[ -z "$line_number" ]] && continue + + IFS='.' read -r -a segments <<< "$namespace" + errors=() + for segment in "${segments[@]}"; do + if ! reason="$(validate_segment "$segment")"; then + errors+=(" * $segment: $reason") + fi + done + + if (( ${#errors[@]} > 0 )); then + namespace_violations+=("- $relative_file:$line_number -> $namespace") + namespace_violations+=("${errors[@]}") + fi + done < <( + sed '1s/^\xEF\xBB\xBF//' "$relative_file" | + grep -nE '^[[:space:]]*namespace[[:space:]]+[A-Za-z][A-Za-z0-9_.]*[[:space:]]*([;{]|$)' | + sed -E 's/^([0-9]+):[[:space:]]*namespace[[:space:]]+([^[:space:];{]+).*/\1:\2/' + ) + + current_dir="$(dirname "$relative_file")" + while [[ "$current_dir" != "." ]]; do + if [[ -z "${seen_directories[$current_dir]:-}" ]]; then + seen_directories["$current_dir"]=1 + check_directory_path "$current_dir" + fi + + current_dir="$(dirname "$current_dir")" + done +done < <(git ls-files -- '*.cs') + +if (( ${#namespace_violations[@]} > 0 || ${#directory_violations[@]} > 0 )); then + echo "C# naming validation failed." + + if (( ${#namespace_violations[@]} > 0 )); then + echo + echo "Namespace violations:" + printf '%s\n' "${namespace_violations[@]}" + fi + + if (( ${#directory_violations[@]} > 0 )); then + echo + echo "Directory violations:" + printf '%s\n' "${directory_violations[@]}" + fi + + exit 1 +fi + +echo "C# naming validation passed for $files_checked tracked C# files." diff --git a/update-documentation.ps1 b/update-documentation.ps1 deleted file mode 100644 index 990c4e8..0000000 --- a/update-documentation.ps1 +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env pwsh - -param( - [switch]$DryRun -) - -$ErrorActionPreference = "Stop" - -Write-Host "========================================" -ForegroundColor Cyan -Write-Host "Phase 3: Update Documentation" -ForegroundColor Cyan -Write-Host "========================================`n" -ForegroundColor Cyan - -# Namespace mapping (same as update-namespaces.ps1) -$namespaceMap = [ordered]@{ - # Nested namespaces first - "\.cqrs\.behaviors" = ".CQRS.Behaviors" - "\.cqrs\.command" = ".CQRS.Command" - "\.cqrs\.notification" = ".CQRS.Notification" - "\.cqrs\.query" = ".CQRS.Query" - "\.cqrs\.request" = ".CQRS.Request" - "\.coroutine\.extensions" = ".Coroutine.Extensions" - "\.coroutine\.instructions" = ".Coroutine.Instructions" - "\.functional\.async" = ".Functional.Async" - "\.functional\.control" = ".Functional.Control" - "\.functional\.functions" = ".Functional.Functions" - "\.functional\.pipe" = ".Functional.Pipe" - "\.functional\.result" = ".Functional.Result" - "\.logging\.appenders" = ".Logging.Appenders" - "\.logging\.filters" = ".Logging.Filters" - "\.logging\.formatters" = ".Logging.Formatters" - "\.services\.modules" = ".Services.Modules" - "\.setting\.events" = ".Setting.Events" - "\.setting\.data" = ".Setting.Data" - "\.scene\.handler" = ".Scene.Handler" - "\.ui\.handler" = ".UI.Handler" - "\.extensions\.signal" = ".Extensions.Signal" - - # Single-level namespaces - "\.cqrs" = ".CQRS" - "\.ioc" = ".IoC" - "\.ui" = ".UI" - "\.ecs" = ".ECS" - "\.architecture" = ".Architecture" - "\.bases" = ".Bases" - "\.command" = ".Command" - "\.configuration" = ".Configuration" - "\.controller" = ".Controller" - "\.coroutine" = ".Coroutine" - "\.data" = ".Data" - "\.enums" = ".Enums" - "\.environment" = ".Environment" - "\.events" = ".Events" - "\.extensions" = ".Extensions" - "\.functional" = ".Functional" - "\.internals" = ".Internals" - "\.lifecycle" = ".Lifecycle" - "\.logging" = ".Logging" - "\.model" = ".Model" - "\.pause" = ".Pause" - "\.pool" = ".Pool" - "\.properties" = ".Properties" - "\.property" = ".Property" - "\.query" = ".Query" - "\.registries" = ".Registries" - "\.resource" = ".Resource" - "\.rule" = ".Rule" - "\.serializer" = ".Serializer" - "\.services" = ".Services" - "\.state" = ".State" - "\.storage" = ".Storage" - "\.system" = ".System" - "\.time" = ".Time" - "\.utility" = ".Utility" - "\.versioning" = ".Versioning" - "\.scene" = ".Scene" - "\.setting" = ".Setting" - "\.diagnostics" = ".Diagnostics" - "\.components" = ".Components" - "\.systems" = ".Systems" - "\.analyzers" = ".Analyzers" -} - -# Get all Markdown files -Write-Host "Finding Markdown files..." -$mdFiles = @() -$mdFiles += Get-ChildItem -Path "docs" -Filter "*.md" -Recurse -ErrorAction SilentlyContinue -$mdFiles += Get-ChildItem -Path "." -Filter "README.md" -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.FullName -notmatch "node_modules" -and $_.FullName -notmatch "\\bin\\" -and $_.FullName -notmatch "\\obj\\" } -Write-Host "Found $($mdFiles.Count) Markdown files`n" - -$modifiedCount = 0 - -foreach ($file in $mdFiles) { - $content = Get-Content $file.FullName -Raw -Encoding UTF8 - $originalContent = $content - $fileModified = $false - - # Update namespace references - foreach ($mapping in $namespaceMap.GetEnumerator()) { - $oldPattern = $mapping.Key - $newPattern = $mapping.Value - - # Match GFramework namespace references - if ($content -match "GFramework[^\s;,\)]*$oldPattern") { - $content = $content -replace "(GFramework[^\s;,\)]*)$oldPattern", "`$1$newPattern" - $fileModified = $true - } - } - - if ($fileModified) { - $modifiedCount++ - $relativePath = $file.FullName.Replace((Get-Location).Path, "").TrimStart('\', '/') - Write-Host "✓ Updated: $relativePath" -ForegroundColor Green - - if (-not $DryRun) { - Set-Content -Path $file.FullName -Value $content -NoNewline -Encoding UTF8 - } - } -} - -Write-Host "`n========================================" -ForegroundColor Cyan -Write-Host "Summary:" -ForegroundColor Cyan -Write-Host " Total files scanned: $($mdFiles.Count)" -Write-Host " Files modified: $modifiedCount" -Write-Host "========================================`n" -ForegroundColor Cyan - -if (-not $DryRun -and $modifiedCount -gt 0) { - Write-Host "Committing documentation updates..." - git add -A - git commit -m "docs: update namespace references to PascalCase (phase 3)" - Write-Host "✓ Phase 3 complete" -ForegroundColor Green -} elseif ($DryRun) { - Write-Host "[DRY RUN] No changes were made" -ForegroundColor Yellow -} else { - Write-Host "No files needed updating" -ForegroundColor Yellow -} diff --git a/update-namespaces.ps1 b/update-namespaces.ps1 deleted file mode 100644 index f23fb0f..0000000 --- a/update-namespaces.ps1 +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/env pwsh - -param( - [switch]$DryRun -) - -$ErrorActionPreference = "Stop" - -Write-Host "========================================" -ForegroundColor Cyan -Write-Host "Phase 2: Update Namespace Declarations" -ForegroundColor Cyan -Write-Host "========================================`n" -ForegroundColor Cyan - -# Namespace mapping (order matters - process longer patterns first) -$namespaceMap = [ordered]@{ - # Nested namespaces first (to avoid partial replacements) - "\.cqrs\.behaviors" = ".CQRS.Behaviors" - "\.cqrs\.command" = ".CQRS.Command" - "\.cqrs\.notification" = ".CQRS.Notification" - "\.cqrs\.query" = ".CQRS.Query" - "\.cqrs\.request" = ".CQRS.Request" - "\.coroutine\.extensions" = ".Coroutine.Extensions" - "\.coroutine\.instructions" = ".Coroutine.Instructions" - "\.functional\.async" = ".Functional.Async" - "\.functional\.control" = ".Functional.Control" - "\.functional\.functions" = ".Functional.Functions" - "\.functional\.pipe" = ".Functional.Pipe" - "\.functional\.result" = ".Functional.Result" - "\.logging\.appenders" = ".Logging.Appenders" - "\.logging\.filters" = ".Logging.Filters" - "\.logging\.formatters" = ".Logging.Formatters" - "\.services\.modules" = ".Services.Modules" - "\.setting\.events" = ".Setting.Events" - "\.setting\.data" = ".Setting.Data" - "\.scene\.handler" = ".Scene.Handler" - "\.ui\.handler" = ".UI.Handler" - "\.extensions\.signal" = ".Extensions.Signal" - "\.events\.filters" = ".Events.Filters" - "\.data\.events" = ".Data.Events" - - # Single-level namespaces - "\.cqrs" = ".CQRS" - "\.ioc" = ".IoC" - "\.ui" = ".UI" - "\.ecs" = ".ECS" - "\.architecture" = ".Architecture" - "\.bases" = ".Bases" - "\.command" = ".Command" - "\.configuration" = ".Configuration" - "\.constants" = ".Constants" - "\.controller" = ".Controller" - "\.coroutine" = ".Coroutine" - "\.data" = ".Data" - "\.enums" = ".Enums" - "\.environment" = ".Environment" - "\.events" = ".Events" - "\.extensions" = ".Extensions" - "\.functional" = ".Functional" - "\.internals" = ".Internals" - "\.lifecycle" = ".Lifecycle" - "\.logging" = ".Logging" - "\.model" = ".Model" - "\.pause" = ".Pause" - "\.pool" = ".Pool" - "\.properties" = ".Properties" - "\.property" = ".Property" - "\.query" = ".Query" - "\.registries" = ".Registries" - "\.resource" = ".Resource" - "\.rule" = ".Rule" - "\.serializer" = ".Serializer" - "\.services" = ".Services" - "\.state" = ".State" - "\.storage" = ".Storage" - "\.system" = ".System" - "\.time" = ".Time" - "\.utility" = ".Utility" - "\.versioning" = ".Versioning" - "\.scene" = ".Scene" - "\.setting" = ".Setting" - "\.asset" = ".Asset" - "\.registry" = ".Registry" - "\.diagnostics" = ".Diagnostics" - "\.components" = ".Components" - "\.systems" = ".Systems" - "\.integration" = ".Integration" - "\.tests" = ".Tests" - "\.mediator" = ".Mediator" - "\.analyzers" = ".Analyzers" -} - -# Get all C# files -Write-Host "Finding C# files..." -$csFiles = Get-ChildItem -Path . -Filter "*.cs" -Recurse -Exclude "bin","obj" | Where-Object { $_.FullName -notmatch "\\bin\\" -and $_.FullName -notmatch "\\obj\\" } -Write-Host "Found $($csFiles.Count) C# files`n" - -$modifiedCount = 0 - -foreach ($file in $csFiles) { - $content = Get-Content $file.FullName -Raw -Encoding UTF8 - $originalContent = $content - $fileModified = $false - - # Update namespace declarations and using statements - foreach ($mapping in $namespaceMap.GetEnumerator()) { - $oldPattern = $mapping.Key - $newPattern = $mapping.Value - - # Match namespace declarations: namespace GFramework.*\.old - if ($content -match "namespace\s+GFramework[^;\{]*$oldPattern") { - $content = $content -replace "(namespace\s+GFramework[^;\{]*)$oldPattern", "`$1$newPattern" - $fileModified = $true - } - - # Match using statements: using GFramework.*\.old - if ($content -match "using\s+GFramework[^;]*$oldPattern") { - $content = $content -replace "(using\s+GFramework[^;]*)$oldPattern", "`$1$newPattern" - $fileModified = $true - } - - # Match using static: using static GFramework.*\.old - if ($content -match "using\s+static\s+GFramework[^;]*$oldPattern") { - $content = $content -replace "(using\s+static\s+GFramework[^;]*)$oldPattern", "`$1$newPattern" - $fileModified = $true - } - } - - if ($fileModified) { - $modifiedCount++ - $relativePath = $file.FullName.Replace((Get-Location).Path, "").TrimStart('\', '/') - Write-Host "✓ Updated: $relativePath" -ForegroundColor Green - - if (-not $DryRun) { - Set-Content -Path $file.FullName -Value $content -NoNewline -Encoding UTF8 - } - } -} - -Write-Host "`n========================================" -ForegroundColor Cyan -Write-Host "Summary:" -ForegroundColor Cyan -Write-Host " Total files scanned: $($csFiles.Count)" -Write-Host " Files modified: $modifiedCount" -Write-Host "========================================`n" -ForegroundColor Cyan - -if (-not $DryRun -and $modifiedCount -gt 0) { - Write-Host "Committing namespace updates..." - git add -A - git commit -m "refactor: update namespace declarations to PascalCase (phase 2)" - Write-Host "✓ Phase 2 complete" -ForegroundColor Green -} elseif ($DryRun) { - Write-Host "[DRY RUN] No changes were made" -ForegroundColor Yellow -} else { - Write-Host "No files needed updating" -ForegroundColor Yellow -} diff --git a/update-namespaces.sh b/update-namespaces.sh deleted file mode 100644 index a310488..0000000 --- a/update-namespaces.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash - -# Phase 2: Update Namespace Declarations -echo "========================================" -echo "Phase 2: Update Namespace Declarations" -echo "========================================" -echo "" - -# Find all C# files -echo "Finding C# files..." -cs_files=$(find . -name "*.cs" -type f ! -path "*/bin/*" ! -path "*/obj/*" ! -path "*/.git/*") -total_files=$(echo "$cs_files" | wc -l) -echo "Found $total_files C# files" -echo "" - -modified_count=0 - -# Process each file -while IFS= read -r file; do - if [ -f "$file" ]; then - # Create a temporary file - temp_file="${file}.tmp" - - # Apply all namespace replacements - sed -E \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)cqrs\.behaviors/\1 \2CQRS.Behaviors/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)cqrs\.command/\1 \2CQRS.Command/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)cqrs\.notification/\1 \2CQRS.Notification/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)cqrs\.query/\1 \2CQRS.Query/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)cqrs\.request/\1 \2CQRS.Request/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)coroutine\.extensions/\1 \2Coroutine.Extensions/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)coroutine\.instructions/\1 \2Coroutine.Instructions/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)functional\.async/\1 \2Functional.Async/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)functional\.control/\1 \2Functional.Control/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)functional\.functions/\1 \2Functional.Functions/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)functional\.pipe/\1 \2Functional.Pipe/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)functional\.result/\1 \2Functional.Result/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)logging\.appenders/\1 \2Logging.Appenders/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)logging\.filters/\1 \2Logging.Filters/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)logging\.formatters/\1 \2Logging.Formatters/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)services\.modules/\1 \2Services.Modules/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)setting\.events/\1 \2Setting.Events/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)setting\.data/\1 \2Setting.Data/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)scene\.handler/\1 \2Scene.Handler/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)ui\.handler/\1 \2UI.Handler/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)extensions\.signal/\1 \2Extensions.Signal/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)events\.filters/\1 \2Events.Filters/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)data\.events/\1 \2Data.Events/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)cqrs([^a-z])/\1 \2CQRS\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)ioc([^a-z])/\1 \2IoC\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)ui([^a-z])/\1 \2UI\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)ecs([^a-z])/\1 \2ECS\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)architecture([^a-z])/\1 \2Architecture\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)bases([^a-z])/\1 \2Bases\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)command([^a-z])/\1 \2Command\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)configuration([^a-z])/\1 \2Configuration\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)controller([^a-z])/\1 \2Controller\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)coroutine([^a-z])/\1 \2Coroutine\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)data([^a-z])/\1 \2Data\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)enums([^a-z])/\1 \2Enums\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)environment([^a-z])/\1 \2Environment\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)events([^a-z])/\1 \2Events\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)extensions([^a-z])/\1 \2Extensions\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)functional([^a-z])/\1 \2Functional\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)internals([^a-z])/\1 \2Internals\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)lifecycle([^a-z])/\1 \2Lifecycle\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)logging([^a-z])/\1 \2Logging\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)model([^a-z])/\1 \2Model\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)pause([^a-z])/\1 \2Pause\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)pool([^a-z])/\1 \2Pool\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)properties([^a-z])/\1 \2Properties\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)property([^a-z])/\1 \2Property\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)query([^a-z])/\1 \2Query\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)registries([^a-z])/\1 \2Registries\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)resource([^a-z])/\1 \2Resource\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)rule([^a-z])/\1 \2Rule\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)serializer([^a-z])/\1 \2Serializer\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)services([^a-z])/\1 \2Services\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)state([^a-z])/\1 \2State\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)storage([^a-z])/\1 \2Storage\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)system([^a-z])/\1 \2System\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)time([^a-z])/\1 \2Time\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)utility([^a-z])/\1 \2Utility\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)versioning([^a-z])/\1 \2Versioning\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)scene([^a-z])/\1 \2Scene\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)setting([^a-z])/\1 \2Setting\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)diagnostics([^a-z])/\1 \2Diagnostics\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)components([^a-z])/\1 \2Components\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)systems([^a-z])/\1 \2Systems\3/g' \ - -e 's/(namespace|using|using static)\s+(GFramework[^;{]*\.)analyzers([^a-z])/\1 \2Analyzers\3/g' \ - "$file" > "$temp_file" - - # Check if file was modified - if ! cmp -s "$file" "$temp_file"; then - mv "$temp_file" "$file" - echo "✓ Updated: ${file#./}" - ((modified_count++)) - else - rm "$temp_file" - fi - fi -done <<< "$cs_files" - -echo "" -echo "========================================" -echo "Summary:" -echo " Total files scanned: $total_files" -echo " Files modified: $modified_count" -echo "========================================" -echo "" - -if [ $modified_count -gt 0 ]; then - echo "Committing namespace updates..." - git add -A - git commit -m "refactor: update namespace declarations to PascalCase (phase 2)" - echo "✓ Phase 2 complete" -else - echo "No files needed updating" -fi diff --git a/verify-namespaces.ps1 b/verify-namespaces.ps1 deleted file mode 100644 index 4dc034b..0000000 --- a/verify-namespaces.ps1 +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env pwsh - -$ErrorActionPreference = "Stop" - -Write-Host "========================================" -ForegroundColor Cyan -Write-Host "Phase 4: Verify Namespace Consistency" -ForegroundColor Cyan -Write-Host "========================================`n" -ForegroundColor Cyan - -# Patterns to detect lowercase namespaces (should not exist after refactoring) -$lowercasePatterns = @( - "\.architecture\b", - "\.bases\b", - "\.command\b", - "\.configuration\b", - "\.controller\b", - "\.coroutine\b", - "\.cqrs\b", - "\.data\b", - "\.enums\b", - "\.environment\b", - "\.events\b", - "\.extensions\b", - "\.functional\b", - "\.internals\b", - "\.ioc\b", - "\.lifecycle\b", - "\.logging\b", - "\.model\b", - "\.pause\b", - "\.pool\b", - "\.properties\b", - "\.property\b", - "\.query\b", - "\.registries\b", - "\.resource\b", - "\.rule\b", - "\.serializer\b", - "\.services\b", - "\.state\b", - "\.storage\b", - "\.system\b", - "\.time\b", - "\.utility\b", - "\.versioning\b", - "\.ui\b", - "\.ecs\b", - "\.scene\b", - "\.setting\b", - "\.diagnostics\b", - "\.components\b", - "\.systems\b", - "\.analyzers\b" -) - -Write-Host "Searching for lowercase namespaces in C# files..." -$csFiles = Get-ChildItem -Path . -Filter "*.cs" -Recurse -Exclude "bin","obj" | Where-Object { $_.FullName -notmatch "\\bin\\" -and $_.FullName -notmatch "\\obj\\" } - -$issues = @() - -foreach ($file in $csFiles) { - $content = Get-Content $file.FullName -Raw - $lineNumber = 0 - - foreach ($line in (Get-Content $file.FullName)) { - $lineNumber++ - - # Check if line contains namespace or using statement - if ($line -match "^\s*(namespace|using)\s+GFramework") { - foreach ($pattern in $lowercasePatterns) { - if ($line -match $pattern) { - $relativePath = $file.FullName.Replace((Get-Location).Path, "").TrimStart('\', '/') - $issues += [PSCustomObject]@{ - File = $relativePath - Line = $lineNumber - Content = $line.Trim() - } - break - } - } - } - } -} - -if ($issues.Count -gt 0) { - Write-Host "`n❌ Found $($issues.Count) lowercase namespace(s):`n" -ForegroundColor Red - - foreach ($issue in $issues) { - Write-Host " File: $($issue.File):$($issue.Line)" -ForegroundColor Yellow - Write-Host " $($issue.Content)" -ForegroundColor Gray - Write-Host "" - } - - Write-Host "Please review and fix these issues manually.`n" -ForegroundColor Red - exit 1 -} else { - Write-Host "✓ All namespaces are PascalCase!" -ForegroundColor Green -} - -Write-Host "`n========================================" -ForegroundColor Cyan -Write-Host "Verification Summary:" -ForegroundColor Cyan -Write-Host " Files scanned: $($csFiles.Count)" -Write-Host " Issues found: $($issues.Count)" -Write-Host "========================================`n" -ForegroundColor Cyan - -if ($issues.Count -eq 0) { - Write-Host "✓ Namespace verification passed!" -ForegroundColor Green - exit 0 -}