mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
Per @tonidero on #6787: developers can transitively `import RulesEngine` from the SDK product even though the module is meant to be an internal implementation detail of the SDK. Naming the module `RulesEngineInternal` makes that intent explicit at the import site so consumers don't reach for it accidentally and don't expect API stability from it. This is a producer-side rename only — the previously-renamed `Rules` namespace inside the module is unchanged, so call sites still write `Rules.something`. Consumers' canonical extension-safe import (gated by the SwiftLint rule in #6788) becomes: #if compiler(>=6) internal import RulesEngineInternal #else @_implementationOnly import RulesEngineInternal #endif Renamed (`git mv`): - `RulesEngine/RulesEngine.swift` → `RulesEngineInternal/RulesEngineInternal.swift` - `Tests/RulesEngineTests/RulesEngineTests.swift` → `Tests/RulesEngineInternalTests/RulesEngineInternalTests.swift` - `Projects/RulesEngine/` → `Projects/RulesEngineInternal/` (Tuist project dir) - `RevenueCat.xcodeproj/xcshareddata/xcschemes/RulesEngine.xcscheme` → `RulesEngineInternal.xcscheme` Updated text references in: - `Package.swift` / `Package@swift-5.8.swift` (target + test target names + paths) - `Workspace.swift` (Tuist project path + comment) - `Projects/RulesEngineInternal/Project.swift` (target / scheme / bundle IDs / source paths) - `RevenueCat.xcodeproj/project.pbxproj` (target names, file refs, group names, build phase entries, bundle IDs `com.revenuecat.RulesEngineInternal[Tests]`) - `RevenueCat.xcodeproj/.../xcschemes/RulesEngineInternal.xcscheme` (BlueprintName / BuildableName) - `Tests/TestPlans/CI-AllTests.xctestplan` (target name) - `.swiftlint.yml` (`xctestcase_superclass` exclude path) - File header comments inside the two Swift sources The substitutions ran as `\bRulesEngine\b → RulesEngineInternal` first (safe because `RulesEngineTests` has no word boundary between `e` and `T`), then `\bRulesEngineTests\b → RulesEngineInternalTests`. The `Rules` namespace token was untouched because it isn't `RulesEngine`. Verified locally: - `swift build --target RulesEngineInternal` ✔ - `swift test --filter RulesEngineInternalTests` ✔ (1 test passed) - `xcodebuild -project RevenueCat.xcodeproj -scheme RulesEngineInternal -destination 'generic/platform=iOS' -configuration Debug build` ✔ - `swiftlint` ✔ (0 violations across 1316 files) - `git ls-files | xargs perl -ne 'if (/\bRulesEngine\b/ && !/RulesEngineInternal/) { ... }'` returns no hits. Co-authored-by: Cursor <cursoragent@cursor.com>