Skip to content

Commit

Permalink
making everything explicit to handle various levels of compliance wit…
Browse files Browse the repository at this point in the history
…h Xcode
  • Loading branch information
heckj committed Jul 23, 2024
1 parent bdf1af4 commit 224f76c
Showing 19 changed files with 42 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Sources/AutomergeRepo/DocumentId.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Base58Swift
internal import Base58Swift
public import struct Foundation.Data
public import struct Foundation.UUID

2 changes: 1 addition & 1 deletion Sources/AutomergeRepo/Errors.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Foundation
public import Foundation

/// Describes errors from the repository and providers.
public enum Errors: Sendable {
8 changes: 4 additions & 4 deletions Sources/AutomergeRepo/InternalDocHandle.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import struct Automerge.ChangeHash
import class Automerge.Document
import struct Automerge.SyncState
import struct Foundation.Data
internal import struct Automerge.ChangeHash
internal import class Automerge.Document
internal import struct Automerge.SyncState
internal import struct Foundation.Data

final class InternalDocHandle {
enum DocHandleState {
2 changes: 1 addition & 1 deletion Sources/AutomergeRepo/Networking/Backoff.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Foundation
internal import Foundation

/// A type that provides a computation for a random back-off value based on an integer number of iterations.
enum Backoff {
5 changes: 1 addition & 4 deletions Sources/AutomergeRepo/Networking/NetworkProvider.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// import AsyncAlgorithms

// import protocol Combine.Publisher
import Automerge
internal import Automerge

// https://github.com/automerge/automerge-repo/blob/main/packages/automerge-repo/src/network/NetworkAdapterInterface.ts

8 changes: 4 additions & 4 deletions Sources/AutomergeRepo/Networking/NetworkSubsystem.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// import AsyncAlgorithms
import Automerge
import struct Foundation.Data
import OSLog
import PotentCBOR
internal import Automerge
internal import struct Foundation.Data
internal import OSLog
internal import PotentCBOR

// riff
// https://github.com/automerge/automerge-repo/blob/main/packages/automerge-repo/src/network/NetworkSubsystem.ts
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@
- https://developer.apple.com/videos/play/wwdc2020/10110/
*/

import CryptoKit
import Network
internal import CryptoKit
internal import Network

extension NWParameters {
/// Returns listener and connection network parameters using default TLS for peer to peer connections.
Original file line number Diff line number Diff line change
@@ -19,9 +19,9 @@
*
*/

import Foundation
import Network
import OSLog
internal import Foundation
internal import Network
internal import OSLog

/// The type of sync message for the Automerge network sync protocol.
enum P2PSyncMessageType: UInt32 {
Original file line number Diff line number Diff line change
@@ -12,11 +12,11 @@
- https://developer.apple.com/videos/play/wwdc2020/10110/
*/

import Automerge
@preconcurrency import Combine
import Foundation
import Network
import OSLog
internal import Automerge
@preconcurrency internal import Combine
internal import Foundation
internal import Network
internal import OSLog

/// A peer-to-peer connection to receive and send sync messages.
///
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import AsyncAlgorithms
internal import AsyncAlgorithms
@preconcurrency public import Combine
import Foundation
internal import Foundation
public import Network
import OSLog
internal import OSLog

/// An Automerge-repo network provider that connects to other instances over a peer to peer network.
///
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public import Automerge
import Foundation
internal import Foundation
#if os(iOS) || os(visionOS)
import UIKit // for UIDevice.name access
internal import UIKit // for UIDevice.name access
#endif

/// A type that represents a configuration for a Peer to Peer Network Provider
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Automerge
internal import Automerge
public import Combine
public import Foundation
import Network
import OSLog
internal import Network
internal import OSLog

/// An Automerge-repo network provider that connects to other repositories using WebSocket.
@AutomergeRepo
2 changes: 1 addition & 1 deletion Sources/AutomergeRepo/PeerMetadata.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Foundation
internal import Foundation

// ; Metadata sent in either the join or peer message types
// peer_metadata = {
4 changes: 2 additions & 2 deletions Sources/AutomergeRepo/Repo+LogComponent.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Automerge
import OSLog
internal import Automerge
internal import OSLog

public extension Repo {
/// Represents the primary internal components of a repository
6 changes: 3 additions & 3 deletions Sources/AutomergeRepo/Repo.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
public import Automerge
import AutomergeUtilities
@preconcurrency import Combine
internal import AutomergeUtilities
@preconcurrency internal import Combine
public import Foundation
import OSLog
internal import OSLog

/// A repository for Automerge documents that coordinates storage and synchronization.
@AutomergeRepo
6 changes: 3 additions & 3 deletions Sources/AutomergeRepo/Storage/DocumentStorage.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Automerge
import Combine
import Foundation
internal import Automerge
internal import Combine
internal import Foundation

// inspired from automerge-repo:
// https://github.com/automerge/automerge-repo/blob/main/packages/automerge-repo/src/storage/StorageSubsystem.ts
1 change: 0 additions & 1 deletion Sources/AutomergeRepo/Sync/CBORCoder.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Foundation
public import PotentCBOR

/// A type that provides concurrency-safe access to a CBOR encoder and decoder.
4 changes: 2 additions & 2 deletions Sources/AutomergeRepo/Sync/SyncV1Msg+encode+decode.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public import Foundation // Data
import OSLog
import PotentCBOR
internal import OSLog
internal import PotentCBOR

public extension SyncV1Msg {
/// Attempts to decode the data you provide as a peer message.
2 changes: 1 addition & 1 deletion Sources/AutomergeRepo/Sync/SyncV1Msg.swift
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
//

public import Foundation
import PotentCBOR
internal import PotentCBOR

// Automerge Repo WebSocket sync details:
// https://github.com/automerge/automerge-repo/blob/main/packages/automerge-repo-network-websocket/README.md

0 comments on commit 224f76c

Please # to comment.