Skip to content

Commit

Permalink
Migrate to @_spi instead of @testable
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Mar 8, 2024
1 parent 0ced3ef commit 48410c6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Sources/Spezi/Module/ModuleCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
///
/// You can not create a ``ModuleCollection`` yourself. Please use the ``ModuleBuilder`` to create a ``ModuleCollection``.
public class ModuleCollection {
let elements: [any Module]

@_spi(Spezi)
public let elements: [any Module]

Check failure on line 15 in Sources/Spezi/Module/ModuleCollection.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

Missing Docs Violation: public declarations should be documented (missing_docs)


init(elements: [any Module]) {
self.elements = elements
Expand Down
14 changes: 7 additions & 7 deletions Sources/Spezi/Spezi/KnowledgeSources/LaunchOptionsKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
import SpeziFoundation
import SwiftUI


struct LaunchOptionsKey: DefaultProvidingKnowledgeSource {
typealias Anchor = SpeziAnchor
@_spi(Spezi)
public struct LaunchOptionsKey: DefaultProvidingKnowledgeSource {
public typealias Anchor = SpeziAnchor

#if os(iOS) || os(visionOS) || os(tvOS)
typealias Value = [UIApplication.LaunchOptionsKey: Any]
public typealias Value = [UIApplication.LaunchOptionsKey: Any]
#elseif os(macOS)
/// Currently not supported as ``SpeziAppDelegate/applicationWillFinishLaunching(_:)`` on macOS
/// is executed after the initialization of ``Spezi`` via `View/spezi(_:)` is done, breaking our initialization assumption in ``SpeziAppDelegate/applicationWillFinishLaunching(_:)``.
typealias Value = [Never: Any]
public typealias Value = [Never: Any]
#else // os(watchOS)
typealias Value = [Never: Any]
public typealias Value = [Never: Any]
#endif

static let defaultValue: Value = [:]
public static let defaultValue: Value = [:]
}


Expand Down
6 changes: 4 additions & 2 deletions Sources/Spezi/Spezi/Spezi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public class Spezi {
)


var lifecycleHandler: [LifecycleHandler] {
@_spi(Spezi)
public var lifecycleHandler: [LifecycleHandler] {
storage.collect(allOf: LifecycleHandler.self)
}

Expand All @@ -108,7 +109,8 @@ public class Spezi {
self.init(standard: configuration.standard, modules: configuration.modules.elements, storage: storage)
}

init(
@_spi(Spezi)
public init(

Check failure on line 113 in Sources/Spezi/Spezi/Spezi.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

Missing Docs Violation: public declarations should be documented (missing_docs)
standard: any Standard,
modules: [any Module],
storage: consuming SpeziStorage = SpeziStorage()
Expand Down
5 changes: 4 additions & 1 deletion Sources/Spezi/Standard/DefaultStandard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
//


actor DefaultStandard: Standard {}
@_spi(Spezi)
public actor DefaultStandard: Standard {
public init() {}
}
4 changes: 2 additions & 2 deletions Sources/XCTSpezi/DependencyResolution.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-License-Identifier: MIT
//

@testable import Spezi
@_implementationOnly import SwiftUI
@_spi(Spezi) import Spezi
import SwiftUI


/// Configure and resolve the dependency tree for a collection of [`Module`](https://swiftpackageindex.com/stanfordspezi/spezi/documentation/spezi/module)s.
Expand Down

0 comments on commit 48410c6

Please sign in to comment.