mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
Merge pull request #108 from GeWuYou/chore/cleanup-refactor-scripts
chore(build): 删除文件夹映射配置和命名空间更新脚本
This commit is contained in:
commit
94f75bfa03
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -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()
|
||||
if: always()
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using GFramework.Core.Abstractions.IoC;
|
||||
using GFramework.Core.Abstractions.Ioc;
|
||||
using GFramework.Core.Abstractions.Lifecycle;
|
||||
|
||||
namespace GFramework.Core.Abstractions.Architecture;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using GFramework.Core.Abstractions.IoC;
|
||||
using GFramework.Core.Abstractions.Ioc;
|
||||
|
||||
namespace GFramework.Core.Abstractions.Architecture;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace GFramework.Core.Abstractions.CQRS.Command;
|
||||
namespace GFramework.Core.Abstractions.Cqrs.Command;
|
||||
|
||||
/// <summary>
|
||||
/// 命令输入接口,定义命令模式中输入数据的契约
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 表示输入数据的标记接口。
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 表示通知输入数据的标记接口。
|
||||
@ -1,4 +1,4 @@
|
||||
namespace GFramework.Core.Abstractions.CQRS.Query;
|
||||
namespace GFramework.Core.Abstractions.Cqrs.Query;
|
||||
|
||||
/// <summary>
|
||||
/// 查询输入接口,定义了查询操作的输入规范
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 表示请求输入数据的标记接口。
|
||||
@ -2,7 +2,7 @@
|
||||
using GFramework.Core.Abstractions.Systems;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace GFramework.Core.Abstractions.IoC;
|
||||
namespace GFramework.Core.Abstractions.Ioc;
|
||||
|
||||
/// <summary>
|
||||
/// 依赖注入容器接口,定义了服务注册、解析和管理的基本操作
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 测试 IoC 容器生命周期功能
|
||||
@ -205,4 +204,4 @@ public class IocContainerLifetimeTests
|
||||
scope2.Dispose();
|
||||
scope3.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 测试 IoC 容器功能的单元测试类
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using GFramework.Core.Abstractions.CQRS.Command;
|
||||
using GFramework.Core.Abstractions.Cqrs.Command;
|
||||
|
||||
namespace GFramework.Core.Command;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 日志记录行为类,用于在CQRS管道中记录请求处理的日志信息
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 性能监控行为类,用于监控CQRS请求的执行时间
|
||||
@ -14,7 +14,7 @@
|
||||
using GFramework.Core.Rule;
|
||||
using Mediator;
|
||||
|
||||
namespace GFramework.Core.CQRS.Command;
|
||||
namespace GFramework.Core.Cqrs.Command;
|
||||
|
||||
/// <summary>
|
||||
/// 抽象命令处理器基类
|
||||
@ -14,7 +14,7 @@
|
||||
using GFramework.Core.Rule;
|
||||
using Mediator;
|
||||
|
||||
namespace GFramework.Core.CQRS.Command;
|
||||
namespace GFramework.Core.Cqrs.Command;
|
||||
|
||||
/// <summary>
|
||||
/// 抽象流式命令处理器基类
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 表示一个基础命令类,用于处理带有输入和响应的命令模式实现。
|
||||
@ -14,7 +14,7 @@
|
||||
using GFramework.Core.Rule;
|
||||
using Mediator;
|
||||
|
||||
namespace GFramework.Core.CQRS.Notification;
|
||||
namespace GFramework.Core.Cqrs.Notification;
|
||||
|
||||
/// <summary>
|
||||
/// 抽象通知处理器基类
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 表示一个基础通知类,用于处理带有输入的通知模式实现。
|
||||
@ -14,7 +14,7 @@
|
||||
using GFramework.Core.Rule;
|
||||
using Mediator;
|
||||
|
||||
namespace GFramework.Core.CQRS.Query;
|
||||
namespace GFramework.Core.Cqrs.Query;
|
||||
|
||||
/// <summary>
|
||||
/// 抽象查询处理器基类
|
||||
@ -14,7 +14,7 @@
|
||||
using GFramework.Core.Rule;
|
||||
using Mediator;
|
||||
|
||||
namespace GFramework.Core.CQRS.Query;
|
||||
namespace GFramework.Core.Cqrs.Query;
|
||||
|
||||
/// <summary>
|
||||
/// 抽象流式查询处理器基类
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 表示一个基础查询类,用于处理带有输入和响应的查询模式实现。
|
||||
@ -14,7 +14,7 @@
|
||||
using GFramework.Core.Rule;
|
||||
using Mediator;
|
||||
|
||||
namespace GFramework.Core.CQRS.Request;
|
||||
namespace GFramework.Core.Cqrs.Request;
|
||||
|
||||
/// <summary>
|
||||
/// 抽象请求处理器基类,用于处理不返回具体响应的请求
|
||||
@ -14,7 +14,7 @@
|
||||
using GFramework.Core.Rule;
|
||||
using Mediator;
|
||||
|
||||
namespace GFramework.Core.CQRS.Request;
|
||||
namespace GFramework.Core.Cqrs.Request;
|
||||
|
||||
/// <summary>
|
||||
/// 抽象流式请求处理器基类
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 表示一个基础请求类,用于处理带有输入和响应的请求模式实现。
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// Microsoft.Extensions.DependencyInjection 适配器
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using GFramework.Core.Abstractions.CQRS.Query;
|
||||
using GFramework.Core.Abstractions.Cqrs.Query;
|
||||
|
||||
namespace GFramework.Core.Query;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// ECS 高级功能测试类 - 使用 Arch 原生 API
|
||||
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// ECS 基础功能测试类 - 使用 Arch 原生 API
|
||||
|
||||
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// ECS 集成测试类 - 使用 Arch 原生 API
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using Arch.Core;
|
||||
using GFramework.Core.Abstractions.IoC;
|
||||
using GFramework.Core.Abstractions.Ioc;
|
||||
|
||||
namespace GFramework.Ecs.Arch;
|
||||
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -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
|
||||
148
scripts/validate-csharp-naming.sh
Normal file
148
scripts/validate-csharp-naming.sh
Normal file
@ -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."
|
||||
@ -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
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
@ -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
|
||||
@ -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
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user