From 35aff374c6a9dde832a7af59afd41470b756b865 Mon Sep 17 00:00:00 2001 From: Noah Durell Date: Thu, 7 Nov 2024 16:28:24 -0500 Subject: [PATCH] lots of fixes after testing --- Package.resolved | 1 - Package.swift | 18 ++++---- Package@swift-6.0.swift | 18 ++++---- .../Internal/AreOrderedSetsDuplicates.swift | 2 +- .../Observation/ObservableState.swift | 2 +- .../IdentifiedArray+Codable.swift | 2 +- .../IdentifiedArray+Collection.swift | 2 +- ...IdentifiedArray+IdentifiedCollection.swift | 2 +- .../IdentifiedArray+Initializers.swift | 2 +- .../IdentifiedArray+Insertions.swift | 2 +- .../IdentifiedArray+MutableCollection.swift | 2 +- ...fiedArray+RangeReplaceableCollection.swift | 2 +- .../IdentifiedArray/IdentifiedArray.swift | 2 +- Sources/KlaviyoCore/AppLifeCycleEvents.swift | 2 + Sources/KlaviyoCore/KlaviyoEnvironment.swift | 15 ++++--- Sources/KlaviyoSwift/Klaviyo.swift | 3 +- .../KlaviyoSwiftEnvironment.swift | 33 ++------------ .../StateChangePublisher.swift | 44 +++++++++++-------- .../StateManagement/StateManagement.swift | 12 ++--- .../HashTable/_HashTable+UnsafeHandle.swift | 2 +- .../OrderedDictionary+Descriptions.swift | 2 +- ...deredDictionary+Elements.SubSequence.swift | 2 +- .../OrderedDictionary+Elements.swift | 2 +- .../OrderedDictionary+Initializers.swift | 2 +- .../OrderedDictionary+Invariants.swift | 2 +- .../OrderedDictionary+Values.swift | 2 +- .../OrderedSet/OrderedSet+Descriptions.swift | 2 +- .../OrderedSet/OrderedSet+Initializers.swift | 2 +- .../OrderedSet/OrderedSet+Invariants.swift | 2 +- ...OrderedSet+Partial MutableCollection.swift | 2 +- ...dSet+Partial SetAlgebra intersection.swift | 2 +- ...redSet+Partial SetAlgebra isDisjoint.swift | 2 +- ...redSet+Partial SetAlgebra isEqualSet.swift | 2 +- ...et+Partial SetAlgebra isStrictSubset.swift | 2 +- ...+Partial SetAlgebra isStrictSuperset.swift | 2 +- ...deredSet+Partial SetAlgebra isSubset.swift | 2 +- ...redSet+Partial SetAlgebra isSuperset.swift | 2 +- ...edSet+Partial SetAlgebra subtracting.swift | 2 +- ...rtial SetAlgebra symmetricDifference.swift | 2 +- .../OrderedSet+RandomAccessCollection.swift | 2 +- .../OrderedSet/OrderedSet+SubSequence.swift | 2 +- .../OrderedSet/OrderedSet+Testing.swift | 2 +- .../OrderedSet/OrderedSet+UnorderedView.swift | 2 +- .../OrderedSet/OrderedSet.swift | 2 +- .../Utilities/_UnsafeBitset.swift | 4 +- Tests/KlaviyoSwiftTests/KlaviyoSDKTests.swift | 2 +- .../KlaviyoSwiftTests/KlaviyoTestUtils.swift | 4 +- Tests/KlaviyoSwiftTests/TestData.swift | 2 +- .../SharedChangeTracker.swift | 2 +- .../ComposableArchitecture/TaskResult.swift | 2 +- .../ComposableArchitecture/TestStore.swift | 2 +- 51 files changed, 111 insertions(+), 123 deletions(-) diff --git a/Package.resolved b/Package.resolved index 55b307f1..c7b579e8 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,4 @@ { - "originHash" : "8ef972f340bf89ccd4a56e634f9243c952510d9d3b7f8a894414454b4618f0ec", "pins" : [ { "identity" : "combine-schedulers", diff --git a/Package.swift b/Package.swift index f5fda9a6..f787a21e 100644 --- a/Package.swift +++ b/Package.swift @@ -39,7 +39,7 @@ let package = Package( name: "KlaviyoSwift", dependencies: [ "KlaviyoCore", - "ComposableArchitecture", + "KComposableArchitecture", "AnyCodable" ], path: "Sources/KlaviyoSwift", @@ -52,7 +52,7 @@ let package = Package( "KCustomDump", .product(name: "CombineSchedulers", package: "combine-schedulers"), "KlaviyoCore", - "ComposableArchitecture", + "KComposableArchitecture", "KIssueReporting", "KCasePaths", .product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay") @@ -80,26 +80,26 @@ let package = Package( // Vendorized Things .target( - name: "ComposableArchitecture", + name: "KComposableArchitecture", dependencies: [ "KCustomDump", - "IdentifiedCollections", + "KIdentifiedCollections", "KConcurrencyExtras", "KPerception", "KCasePaths" ], path: "Sources/ComposableArchitecture"), .target( - name: "OrderedCollections", - dependencies: ["InternalCollectionsUtilities"], + name: "KOrderedCollections", + dependencies: ["KInternalCollectionsUtilities"], path: "Sources/OrderedCollections"), .target( - name: "InternalCollectionsUtilities", + name: "KInternalCollectionsUtilities", dependencies: [], path: "Sources/InternalCollectionsUtilities"), .target( - name: "IdentifiedCollections", - dependencies: ["OrderedCollections"], + name: "KIdentifiedCollections", + dependencies: ["KOrderedCollections"], path: "Sources/IdentifiedCollections"), .target( name: "AnyCodable", diff --git a/Package@swift-6.0.swift b/Package@swift-6.0.swift index a1a4436e..dceca2ef 100644 --- a/Package@swift-6.0.swift +++ b/Package@swift-6.0.swift @@ -39,7 +39,7 @@ let package = Package( dependencies: [ "AnyCodable", "KlaviyoCore", - "ComposableArchitecture" + "KComposableArchitecture" ], path: "Sources/KlaviyoSwift", resources: [.copy("PrivacyInfo.xcprivacy")]), @@ -51,7 +51,7 @@ let package = Package( "KCustomDump", .product(name: "CombineSchedulers", package: "combine-schedulers"), "KlaviyoCore", - "ComposableArchitecture", + "KComposableArchitecture", "KIssueReporting", "KCasePaths", .product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay") @@ -79,26 +79,26 @@ let package = Package( // Vendorized Things .target( - name: "ComposableArchitecture", + name: "KComposableArchitecture", dependencies: [ "KCustomDump", - "IdentifiedCollections", + "KIdentifiedCollections", "KConcurrencyExtras", "KPerception", "KCasePaths" ], path: "Sources/ComposableArchitecture"), .target( - name: "OrderedCollections", - dependencies: ["InternalCollectionsUtilities"], + name: "KOrderedCollections", + dependencies: ["KInternalCollectionsUtilities"], path: "Sources/OrderedCollections"), .target( - name: "InternalCollectionsUtilities", + name: "KInternalCollectionsUtilities", dependencies: [], path: "Sources/InternalCollectionsUtilities"), .target( - name: "IdentifiedCollections", - dependencies: ["OrderedCollections"], + name: "KIdentifiedCollections", + dependencies: ["KOrderedCollections"], path: "Sources/IdentifiedCollections"), .target( name: "AnyCodable", diff --git a/Sources/ComposableArchitecture/Internal/AreOrderedSetsDuplicates.swift b/Sources/ComposableArchitecture/Internal/AreOrderedSetsDuplicates.swift index b8ebd2f0..7d02f47a 100644 --- a/Sources/ComposableArchitecture/Internal/AreOrderedSetsDuplicates.swift +++ b/Sources/ComposableArchitecture/Internal/AreOrderedSetsDuplicates.swift @@ -1,5 +1,5 @@ import Foundation -import OrderedCollections +import KOrderedCollections @inlinable func areOrderedSetsDuplicates(_ lhs: OrderedSet, _ rhs: OrderedSet) -> Bool { diff --git a/Sources/ComposableArchitecture/Observation/ObservableState.swift b/Sources/ComposableArchitecture/Observation/ObservableState.swift index 322c5384..655aa140 100644 --- a/Sources/ComposableArchitecture/Observation/ObservableState.swift +++ b/Sources/ComposableArchitecture/Observation/ObservableState.swift @@ -1,5 +1,5 @@ import Foundation -import IdentifiedCollections +import KIdentifiedCollections import KPerception /// A type that emits notifications to observers when underlying data changes. diff --git a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Codable.swift b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Codable.swift index 61396749..1f2693f1 100644 --- a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Codable.swift +++ b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Codable.swift @@ -1,4 +1,4 @@ -import OrderedCollections +import KOrderedCollections extension IdentifiedArray: Encodable where Element: Encodable { @inlinable diff --git a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Collection.swift b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Collection.swift index 6ea99c6c..f2487f89 100644 --- a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Collection.swift +++ b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Collection.swift @@ -1,4 +1,4 @@ -import OrderedCollections +import KOrderedCollections extension IdentifiedArray: Collection { @inlinable diff --git a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+IdentifiedCollection.swift b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+IdentifiedCollection.swift index f73c0b9d..01a478e9 100644 --- a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+IdentifiedCollection.swift +++ b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+IdentifiedCollection.swift @@ -1,4 +1,4 @@ -import OrderedCollections +import KOrderedCollections extension IdentifiedArray: _IdentifiedCollection { /// A read-only collection view for the ids contained in this array, as an `OrderedSet`. diff --git a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Initializers.swift b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Initializers.swift index cc9e8013..11ddd2ec 100644 --- a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Initializers.swift +++ b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Initializers.swift @@ -1,4 +1,4 @@ -import OrderedCollections +import KOrderedCollections extension IdentifiedArray { /// Creates a new array from the elements in the given sequence, which must not contain duplicate diff --git a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Insertions.swift b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Insertions.swift index 573256cf..1ee8f206 100644 --- a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Insertions.swift +++ b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+Insertions.swift @@ -1,4 +1,4 @@ -import OrderedCollections +import KOrderedCollections extension IdentifiedArray { /// Append a new member to the end of the array, if the array doesn't already contain it. diff --git a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+MutableCollection.swift b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+MutableCollection.swift index eee05786..e126e010 100644 --- a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+MutableCollection.swift +++ b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+MutableCollection.swift @@ -1,4 +1,4 @@ -import OrderedCollections +import KOrderedCollections extension IdentifiedArray: MutableCollection { @inlinable diff --git a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+RangeReplaceableCollection.swift b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+RangeReplaceableCollection.swift index 78a2dfe2..4db506cf 100644 --- a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+RangeReplaceableCollection.swift +++ b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray+RangeReplaceableCollection.swift @@ -1,4 +1,4 @@ -import OrderedCollections +import KOrderedCollections @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) extension IdentifiedArray: RangeReplaceableCollection diff --git a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray.swift b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray.swift index a9ec3275..95d655fb 100644 --- a/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray.swift +++ b/Sources/IdentifiedCollections/IdentifiedArray/IdentifiedArray.swift @@ -1,4 +1,4 @@ -import OrderedCollections +import KOrderedCollections /// An ordered collection of identifiable elements. /// diff --git a/Sources/KlaviyoCore/AppLifeCycleEvents.swift b/Sources/KlaviyoCore/AppLifeCycleEvents.swift index ce6d7c85..2496aa09 100644 --- a/Sources/KlaviyoCore/AppLifeCycleEvents.swift +++ b/Sources/KlaviyoCore/AppLifeCycleEvents.swift @@ -7,6 +7,7 @@ import Combine import Foundation +import KComposableArchitecture import UIKit public enum LifeCycleErrors: Error { @@ -54,6 +55,7 @@ public struct AppLifeCycleEvents { .map { _ in LifeCycleEvents.backgrounded } // The below is a bit convoluted since network status can be nil. let reachability = notificationPublisher(ReachabilityChangedNotification) + .receive(on: UIScheduler.shared) .compactMap { _ in let status = reachabilityStatus() ?? .reachableViaWWAN return LifeCycleEvents.reachabilityChanged(status: status) diff --git a/Sources/KlaviyoCore/KlaviyoEnvironment.swift b/Sources/KlaviyoCore/KlaviyoEnvironment.swift index 380dc8ce..98d3e743 100644 --- a/Sources/KlaviyoCore/KlaviyoEnvironment.swift +++ b/Sources/KlaviyoCore/KlaviyoEnvironment.swift @@ -142,8 +142,8 @@ public struct KlaviyoEnvironment: Sendable { timeZone: { TimeZone.autoupdatingCurrent.identifier }, klaviyoAPI: KlaviyoAPI(), timer: { interval in - let timerActor = TimerActor() - return AsyncStream { continuation in + AsyncStream { continuation in + let timerActor = TimerActor() Task { // Start the timer via the TimerActor #if swift(>=6) @@ -201,21 +201,26 @@ public struct DataDecoder: Sendable { } actor TimerActor { - private var timer: Timer? + private var timer: DispatchSourceTimer? func startTimer(interval: TimeInterval, continuation: AsyncStream.Continuation) { // Ensure any previous timer is invalidated stopTimer() // Create a new Timer and fire it - timer = Timer.scheduledTimer(withTimeInterval: interval, repeats: true) { _ in + // Create a new DispatchSourceTimer and start it + let newTimer = DispatchSource.makeTimerSource(queue: .global()) + newTimer.schedule(deadline: .now(), repeating: interval) + newTimer.setEventHandler { continuation.yield(Date()) } + newTimer.resume() + timer = newTimer } func stopTimer() { // Invalidate the existing timer if there is one - timer?.invalidate() + timer?.cancel() timer = nil } } diff --git a/Sources/KlaviyoSwift/Klaviyo.swift b/Sources/KlaviyoSwift/Klaviyo.swift index 01d8d0fc..2af6d903 100644 --- a/Sources/KlaviyoSwift/Klaviyo.swift +++ b/Sources/KlaviyoSwift/Klaviyo.swift @@ -25,7 +25,8 @@ func dispatchStoreAction(action: KlaviyoAction) async { /// /// From there you can you can call the additional methods below to track events and profile. @MainActor -public final class KlaviyoSDK { +public struct KlaviyoSDK { + public init() {} private var state: KlaviyoState { klaviyoSwiftEnvironment.state() } diff --git a/Sources/KlaviyoSwift/KlaviyoSwiftEnvironment.swift b/Sources/KlaviyoSwift/KlaviyoSwiftEnvironment.swift index 3a8c800a..7a852501 100644 --- a/Sources/KlaviyoSwift/KlaviyoSwiftEnvironment.swift +++ b/Sources/KlaviyoSwift/KlaviyoSwiftEnvironment.swift @@ -7,7 +7,7 @@ import Combine import Foundation -@_spi(Internals) import ComposableArchitecture // to access internal state +@_spi(Internals) import KComposableArchitecture // to access internal state import KlaviyoCore import UIKit @@ -19,7 +19,7 @@ struct KlaviyoSwiftEnvironment: Sendable { var send: @MainActor (KlaviyoAction) async -> StoreTask var state: @MainActor () -> KlaviyoState var statePublisher: @MainActor () -> AnyPublisher - var stateChangePublisher: @MainActor () -> AsyncStream + var stateChangePublisher: @MainActor () -> AsyncStream var lifeCyclePublisher: @MainActor () -> AsyncStream var getBackgroundSetting: @MainActor () -> PushBackground var networkSession: @MainActor () -> NetworkSession @@ -37,34 +37,7 @@ struct KlaviyoSwiftEnvironment: Sendable { store.publisher.eraseToAnyPublisher() }, stateChangePublisher: { - let publisher = StateChangePublisher().publisher() - return AsyncStream { continuation in - - Task { - let cancellableStore = CancellableStore() - let cancellable = publisher.sink { value in - continuation.yield(value) - } - Task { - #if swift(>=6) - cancellableStore.store(cancellable) - #else - await cancellableStore.store(cancellable) - #endif - } - - // Handle cancellation - continuation.onTermination = { @Sendable _ in - Task { - #if swift(>=6) - cancellableStore.cancel() - #else - await cancellableStore.cancel() - #endif - } - } - } - } + StateChangePublisher().publisher() }, lifeCyclePublisher: { let publisher = AppLifeCycleEvents.production.lifeCycleEvents(environment.notificationCenterPublisher, environment.startReachability, environment.stopReachability, environment.reachabilityStatus).map(\.transformToKlaviyoAction).eraseToAnyPublisher() return AsyncStream { continuation in diff --git a/Sources/KlaviyoSwift/StateManagement/StateChangePublisher.swift b/Sources/KlaviyoSwift/StateManagement/StateChangePublisher.swift index 81b3efeb..5f3c9515 100644 --- a/Sources/KlaviyoSwift/StateManagement/StateChangePublisher.swift +++ b/Sources/KlaviyoSwift/StateManagement/StateChangePublisher.swift @@ -11,7 +11,7 @@ import UIKit @_spi(KlaviyoPrivate) @MainActor -public struct StateChangePublisher { +public struct StateChangePublisher: Sendable { static var debouncedPublisher: (AnyPublisher) -> AnyPublisher = { publisher in publisher .debounce(for: .seconds(1), scheduler: DispatchQueue.global()) @@ -26,18 +26,19 @@ public struct StateChangePublisher { } // publisher to listen for state and persist them on an interval. - // does not emit action but mapped that way so it can be used in the store. - var publisher: @MainActor () -> AnyPublisher = { - debouncedPublisher(createStatePublisher()) - .flatMap { state -> Empty in - saveKlaviyoState(state: state) - return Empty() + // does not emit anything + var publisher: @MainActor () -> AsyncStream = { + AsyncStream { _ in + Task { + for await state in debouncedPublisher(createStatePublisher()).values { + saveKlaviyoState(state: state) + } } - .eraseToAnyPublisher() + } } @_spi(KlaviyoPrivate) - public struct PrivateState { + public struct PrivateState: Sendable { public var email: String? public var anonymousId: String? public var phoneNumber: String? @@ -46,16 +47,21 @@ public struct StateChangePublisher { } @_spi(KlaviyoPrivate) - public static func internalStatePublisher() -> AnyPublisher { - createStatePublisher() - .map { state in - PrivateState( - email: state.email, - anonymousId: state.anonymousId, - phoneNumber: state.phoneNumber, - externalId: state.externalId, - pushToken: state.pushTokenData?.pushToken) + @MainActor + public static func internalStatePublisher() -> AsyncStream { + let publisher = StateChangePublisher.createStatePublisher() + return AsyncStream { continuation in + Task { + for await state in publisher + .subscribe(on: DispatchQueue.main).values { + continuation.yield(PrivateState( + email: state.email, + anonymousId: state.anonymousId, + phoneNumber: state.phoneNumber, + externalId: state.externalId, + pushToken: state.pushTokenData?.pushToken)) + } } - .eraseToAnyPublisher() + } } } diff --git a/Sources/KlaviyoSwift/StateManagement/StateManagement.swift b/Sources/KlaviyoSwift/StateManagement/StateManagement.swift index 4f480cb7..bdb4623f 100644 --- a/Sources/KlaviyoSwift/StateManagement/StateManagement.swift +++ b/Sources/KlaviyoSwift/StateManagement/StateManagement.swift @@ -12,8 +12,8 @@ // import AnyCodable -import ComposableArchitecture import Foundation +import KComposableArchitecture import KlaviyoCore enum StateManagementConstants { @@ -201,14 +201,16 @@ struct KlaviyoReducer: Reducer { await send(.start) } .merge(with: .run { send in - for await action in await klaviyoSwiftEnvironment.lifeCyclePublisher() { + let lifeCyclePublisher = await MainActor.run { klaviyoSwiftEnvironment.lifeCyclePublisher() + } + for await action in lifeCyclePublisher { await send(action) } }) - .merge(with: .run { send in - for await action in await klaviyoSwiftEnvironment.stateChangePublisher() { - await send(action) + .merge(with: .run { _ in + let publisher = await MainActor.run { klaviyoSwiftEnvironment.stateChangePublisher() } + for await _ in publisher {} }) case let .setEmail(email, appContextInfo): diff --git a/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift b/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift index 9e1d3976..9a81a218 100644 --- a/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift +++ b/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif @usableFromInline diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Descriptions.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Descriptions.swift index 339bfbcd..2c2d1b8c 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Descriptions.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Descriptions.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedDictionary: CustomStringConvertible { diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift index 2e2cdce6..9e6b2799 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedDictionary.Elements { diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift index f013df28..6c0fa53d 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedDictionary { diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Initializers.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Initializers.swift index 5734e646..ab9ed1ee 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Initializers.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Initializers.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedDictionary { diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Invariants.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Invariants.swift index 3ed2c25a..9a60a559 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Invariants.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Invariants.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedDictionary { diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift index 71bff5b9..11d5fef0 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedDictionary { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Descriptions.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Descriptions.swift index b4af837c..610cc6e8 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Descriptions.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Descriptions.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedSet: CustomStringConvertible { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Initializers.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Initializers.swift index b8bee27c..d2018215 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Initializers.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Initializers.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedSet { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Invariants.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Invariants.swift index 62fbb051..cfa4c629 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Invariants.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Invariants.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedSet { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial MutableCollection.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial MutableCollection.swift index ab453b58..96864e2d 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial MutableCollection.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial MutableCollection.swift @@ -12,7 +12,7 @@ // The parts of MutableCollection that OrderedSet is able to implement. #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedSet { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra intersection.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra intersection.swift index da03ee5c..52c3abe3 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra intersection.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra intersection.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isDisjoint.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isDisjoint.swift index 8b9b6a3f..da933db1 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isDisjoint.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isDisjoint.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isEqualSet.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isEqualSet.swift index eca7f737..6d89f1cc 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isEqualSet.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isEqualSet.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedSet { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSubset.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSubset.swift index 8f2ff914..fcbb33ba 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSubset.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSubset.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSuperset.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSuperset.swift index 902e5240..5fb692f5 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSuperset.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSuperset.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSubset.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSubset.swift index 3ec05330..30004e52 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSubset.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSubset.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSuperset.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSuperset.swift index 99d199a6..cb28276a 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSuperset.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSuperset.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra subtracting.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra subtracting.swift index 4ccb520a..a9c36955 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra subtracting.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra subtracting.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra symmetricDifference.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra symmetricDifference.swift index 7615e21c..c1352525 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra symmetricDifference.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra symmetricDifference.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+RandomAccessCollection.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+RandomAccessCollection.swift index 65437655..83a3f99d 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+RandomAccessCollection.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+RandomAccessCollection.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedSet: Sequence { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift index f828c616..e1f2bf6e 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedSet { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Testing.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Testing.swift index 818fe594..3903ce47 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Testing.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Testing.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedSet._UnstableInternals { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift index d5595f23..4f5f5154 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif extension OrderedSet { diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet.swift index f5b7e6df..1f136eb8 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet.swift @@ -10,7 +10,7 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities #endif /// An ordered collection of unique elements. diff --git a/Sources/OrderedCollections/Utilities/_UnsafeBitset.swift b/Sources/OrderedCollections/Utilities/_UnsafeBitset.swift index f01f5773..df2c1637 100755 --- a/Sources/OrderedCollections/Utilities/_UnsafeBitset.swift +++ b/Sources/OrderedCollections/Utilities/_UnsafeBitset.swift @@ -10,8 +10,8 @@ // ===----------------------------------------------------------------------===// #if !COLLECTIONS_SINGLE_MODULE -import InternalCollectionsUtilities +import KInternalCollectionsUtilities @usableFromInline -internal typealias _UnsafeBitSet = InternalCollectionsUtilities._UnsafeBitSet +internal typealias _UnsafeBitSet = KInternalCollectionsUtilities._UnsafeBitSet #endif diff --git a/Tests/KlaviyoSwiftTests/KlaviyoSDKTests.swift b/Tests/KlaviyoSwiftTests/KlaviyoSDKTests.swift index 733151f3..024eff62 100644 --- a/Tests/KlaviyoSwiftTests/KlaviyoSDKTests.swift +++ b/Tests/KlaviyoSwiftTests/KlaviyoSDKTests.swift @@ -5,7 +5,7 @@ // Created by Noah Durell on 2/21/23. // -@testable import ComposableArchitecture +@testable import KComposableArchitecture @testable import KlaviyoSwift import Foundation import KlaviyoCore diff --git a/Tests/KlaviyoSwiftTests/KlaviyoTestUtils.swift b/Tests/KlaviyoSwiftTests/KlaviyoTestUtils.swift index 1d74bb5d..e6b82af4 100644 --- a/Tests/KlaviyoSwiftTests/KlaviyoTestUtils.swift +++ b/Tests/KlaviyoSwiftTests/KlaviyoTestUtils.swift @@ -9,7 +9,7 @@ import Combine import XCTest @_spi(KlaviyoPrivate) @testable import KlaviyoSwift import CombineSchedulers -import ComposableArchitecture +import KComposableArchitecture import KlaviyoCore let ARCHIVED_RETURNED_DATA = Data() @@ -71,7 +71,7 @@ class InvalidJSONDecoder: JSONDecoder, @unchecked Sendable { } struct KlaviyoTestReducer: Reducer { - func reduce(into state: inout KlaviyoSwift.KlaviyoState, action: KlaviyoSwift.KlaviyoAction) -> ComposableArchitecture.Effect { + func reduce(into state: inout KlaviyoSwift.KlaviyoState, action: KlaviyoSwift.KlaviyoAction) -> KComposableArchitecture.Effect { reducer(&state, action) } diff --git a/Tests/KlaviyoSwiftTests/TestData.swift b/Tests/KlaviyoSwiftTests/TestData.swift index 8e37b2b1..f00bd2b4 100644 --- a/Tests/KlaviyoSwiftTests/TestData.swift +++ b/Tests/KlaviyoSwiftTests/TestData.swift @@ -8,7 +8,7 @@ import Foundation @_spi(KlaviyoPrivate) @testable import KlaviyoSwift import Combine -@_spi(Internals) import ComposableArchitecture +@_spi(Internals) import KComposableArchitecture import KlaviyoCore let TEST_API_KEY = "fake-key" diff --git a/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/SharedChangeTracker.swift b/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/SharedChangeTracker.swift index 63436f18..dfc1caf4 100644 --- a/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/SharedChangeTracker.swift +++ b/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/SharedChangeTracker.swift @@ -2,7 +2,7 @@ import KCustomDump import KIssueReporting import KConcurrencyExtras @testable import KlaviyoSwift -@testable import ComposableArchitecture +@testable import KComposableArchitecture @_spi(Internals) public func withSharedChangeTracking( diff --git a/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/TaskResult.swift b/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/TaskResult.swift index a19af5b7..92fbefc2 100644 --- a/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/TaskResult.swift +++ b/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/TaskResult.swift @@ -1,6 +1,6 @@ import KCasePaths import KIssueReporting -@testable import ComposableArchitecture +@testable import KComposableArchitecture /// A value that represents either a success or a failure. This type differs from Swift's `Result` /// type in that it uses only one generic for the success case, leaving the failure case as an diff --git a/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/TestStore.swift b/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/TestStore.swift index 4a8d2bd0..5e5d61fe 100644 --- a/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/TestStore.swift +++ b/Tests/KlaviyoSwiftTests/Vendor/ComposableArchitecture/TestStore.swift @@ -5,7 +5,7 @@ import KCustomDump import Foundation import KIssueReporting @_spi(Internals) @testable import KlaviyoSwift -@_spi(Internals) @testable import ComposableArchitecture +@_spi(Internals) @testable import KComposableArchitecture /// A testable runtime for a reducer. ///