refactor: Utility/Helper 组织方式重构 + 全量兼容转发层(整合 #13 #14) - #16
AlianBlank wants to merge 2 commits into
Conversation
- Utility 嵌套门面与 XxxHelper 重组为扁平 XxxUtility / GameFrameworkXxx / Extension - 嵌套算法类命名规范化:MD5→Md5、XXHash→XxHash、HMACSha256→HmacSha256 - 合入 main 上 e89eb8c 的 PathHelper.Combine 修复(应用至 PathUtility.Combine) - 找回 7 个 Combine 回归测试并改写为 PathUtility 名下 - package.json 版本保持 2.5.3(避免倒退) 整合自 #13(d89d978)与其 review 修复 #14(c0af2d8)。
整合 #13 #14 的重构保持接口兼容: - Runtime/Compatibility/ 自动生成 + 手写校对的转发层(359 个公共成员) - 旧 Utility 门面(Text/Hash/Converter/Json/Encryption/Verifier 等 17 个嵌套类) 与 14 个 XxxHelper 全部转发至新扁平 API,标记 [Obsolete](3.0.0 移除) - ITextHelper/IJsonHelper/ICompressionHelper 以接口继承方式兼容 - shim 不保留 this 扩展修饰,避免与新扩展类同名方法 CS0121 歧义; 旧静态调用语法(XxxHelper.Member(x))不受影响 - 恢复 UnityEngineGameObjectExtension.SetLayerRecursively(下游 7+ 处使用, 标记过期并指向 SetLayer 默认递归行为) - 验证:Unity 2022.3.62 全工程 batchmode 编译 0 error, 产生 898 个 CS0618 迁移警告(预期迁移信号) 不兼容项(下游零使用,PR 描述注明): - Verifier.Crc64/Dsa/Rsa 等 sealed 实例类(无法继承转发) - ShellUtility Runtime->Editor 程序集迁移 - string Print/WithColor/WithSize 调试扩展(#14 已删)
|
Important Review skippedToo many files! This PR contains 227 files, which is 127 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (227)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
方向调整,此 PR 撤回。整合工作稍后以新方案重新提出。 |
变更
整合 #13(Utility/Helper 重构)与 #14(review 修复与边界测试)为单一 PR,并补齐兼容层,对下游 40+ 包与业务代码零破坏。
1. Git 整合(两个提交)
420c34c— fix: #13 review 修复与边界测试补充(裁剪保根/命名规范/程序集归属/43 个测试) #14 最终树 squash 合入,同时修复两个遗留问题:PathUtility.Combine(删除 StartsWith 跳过分支),7 个 Combine 回归测试改写为PathUtility名下补回UtilityPathTests.cs5d6d85b— 新增Runtime/Compatibility/兼容转发层2. 兼容层(核心:非破坏性变更)
Utility.Text/Utility.Json/Utility.CompressionGameFrameworkText/GameFrameworkJson/GameFrameworkCompressionUtility.Converter/Hash/Encryption/Verifier/Path/File/Marshal/Net/Object/Assembly/IdGenerator/RandomUtility/Asset.PathXxxUtilityMD5/XXHash/HMACSha256Md5/XxHash/HmacSha256Utility.Const.FileNameSuffixFileNameSuffixPathHelper/MathHelper/ZipHelper/...14 个XxxUtility/ 扩展类RandomHelper.Next/NextInt64/NextUInt64RandomUtility.GetRandom*ITextHelper/IJsonHelper/ICompressionHelperGameObjectHelper.CreateCreateChildDoTweenHelperDoTweenUtility#if ENABLE_GAME_FRAME_X_DO_TWEEN)SetLayerRecursively(被删,下游 7+ 处使用)[Obsolete]指向SetLayer[Obsolete("...计划于 3.0.0 移除")]+[Preserve]防裁剪,warning 不 errorthis修饰(避免与新扩展类 CS0121 歧义);旧静态调用语法XxxHelper.Member(x)全部可用3. 明确不兼容项(下游零使用,已逐一核实)
Utility.Verifier.Crc64/Encryption.Dsa/Encryption.Rsa等 sealed 实例类(无法继承转发)ShellUtilityRuntime→Editor 程序集迁移Print/WithColor/WithSize调试扩展(fix: #13 review 修复与边界测试补充(裁剪保根/命名规范/程序集归属/43 个测试) #14 删除;51 处疑似匹配均为第三方 SDK 同名方法)验证
PathUtility.Combine含 main 上已修复的绝对路径拼接行为发布策略
关联
Supersedes #13, #14
Closes #13
Closes #14