Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to @_spi instead of @testable #101

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
)


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

Expand All @@ -108,7 +109,8 @@
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
Loading