diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 670f506b..c75f3de3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,6 @@ concurrency: jobs: library: - strategy: - matrix: - platform: - - iOS Simulator,name=iPhone 14 Pro - - macOS - - macOS,variant=Mac Catalyst - - tvOS Simulator,name=Apple TV - - watchOS Simulator,name=Apple Watch Series 8 (41mm) runs-on: macos-13 name: Test Library steps: @@ -30,22 +22,4 @@ jobs: - name: Select Xcode 14.3 run: sudo xcode-select -s /Applications/Xcode_14.3.app - name: Run tests - run: env PLATFORM="${{ matrix.platform }}" make test-library - - # example: - # strategy: - # matrix: - # platform: - # - iOS Simulator,name=iPhone 14 Pro - # example: - # - Examples - # runs-on: macos-13 - # name: Build Example - # steps: - # - uses: actions/checkout@v3 - # - name: Select Xcode 14.3 - # run: sudo xcode-select -s /Applications/Xcode_14.3.app - # - name: Run pre-build script - # run: sh Examples/${{ matrix.example }}/.ci/pre_build.sh || exit 0; - # - name: Build example - # run: env PLATFORM="${{ matrix.platform }}" EXAMPLE="${{ matrix.example }}" make build-example + run: make test-library diff --git a/Makefile b/Makefile index bb82c6f3..7119e062 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,44 @@ -PLATFORM ?= iOS Simulator,name=iPhone 15 Pro -EXAMPLE ?= Examples +PLATFORM_IOS = iOS Simulator,name=iPhone 14 Pro +PLATFORM_MACOS = macOS +PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst +PLATFORM_TVOS = tvOS Simulator,name=Apple TV +PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 8 (41mm) +EXAMPLE = Examples test-library: - xcodebuild test \ - -workspace supabase-swift.xcworkspace \ - -scheme Supabase-Package \ - -destination platform="$(PLATFORM)" || exit 1; + for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \ + xcodebuild test \ + -workspace supabase-swift.xcworkspace \ + -scheme Supabase-Package \ + -destination platform="$$platform" || exit 1; \ + done; + +build-for-library-evolution: + swift build \ + -c release \ + --target Supabase \ + -Xswiftc -emit-module-interface \ + -Xswiftc -enable-library-evolution + + +DOC_WARNINGS = $(shell xcodebuild clean docbuild \ + -scheme Supabase \ + -destination platform="$(PLATFORM_MACOS)" \ + -quiet \ + 2>&1 \ + | grep "couldn't be resolved to known documentation" \ + | sed 's|$(PWD)|.|g' \ + | tr '\n' '\1') +test-docs: + @test "$(DOC_WARNINGS)" = "" \ + || (echo "xcodebuild docbuild failed:\n\n$(DOC_WARNINGS)" | tr '\1' '\n' \ + && exit 1) build-example: xcodebuild build \ -workspace supabase-swift.xcworkspace \ -scheme "$(EXAMPLE)" \ - -destination platform="$(PLATFORM)" || exit 1; + -destination platform="$(PLATFORM_IOS)" || exit 1; format: @swiftformat . diff --git a/Sources/GoTrue/GoTrueClient.swift b/Sources/GoTrue/GoTrueClient.swift index ff42ab4c..f2ec2b55 100644 --- a/Sources/GoTrue/GoTrueClient.swift +++ b/Sources/GoTrue/GoTrueClient.swift @@ -1,8 +1,6 @@ import Foundation @_spi(Internal) import _Helpers -public typealias AnyJSON = _Helpers.AnyJSON - #if canImport(FoundationNetworking) import FoundationNetworking #endif @@ -84,7 +82,7 @@ public actor GoTrueClient { /// Returns the session, refreshing it if necessary. /// - /// If no session can be found, a ``GoTrueError.sessionNotFound`` error is thrown. + /// If no session can be found, a ``GoTrueError/sessionNotFound`` error is thrown. public var session: Session { get async throws { try await sessionManager.session() diff --git a/Sources/GoTrue/Types.swift b/Sources/GoTrue/Types.swift index 68d98b52..f0e2fd59 100644 --- a/Sources/GoTrue/Types.swift +++ b/Sources/GoTrue/Types.swift @@ -1,4 +1,7 @@ import Foundation +@_spi(Internal) import _Helpers + +public typealias AnyJSON = _Helpers.AnyJSON public enum AuthChangeEvent: String, Sendable { case initialSession = "INITIAL_SESSION" @@ -424,12 +427,12 @@ public struct AuthMFAEnrollResponse: Decodable, Hashable, Sendable { } public struct MFAChallengeParams: Encodable, Hashable { - /// ID of the factor to be challenged. Returned in ``GoTrueMFA.enroll(params:)``. + /// ID of the factor to be challenged. Returned in ``GoTrueMFA/enroll(params:)``. public let factorId: String } public struct MFAVerifyParams: Encodable, Hashable { - /// ID of the factor being verified. Returned in ``GoTrueMFA.enroll(params:)``. + /// ID of the factor being verified. Returned in ``GoTrueMFA/enroll(params:)``. public let factorId: String /// ID of the challenge being verified. Returned in challenge(). @@ -440,7 +443,7 @@ public struct MFAVerifyParams: Encodable, Hashable { } public struct MFAUnenrollParams: Encodable, Hashable, Sendable { - /// ID of the factor to unenroll. Returned in ``GoTrueMFA.enroll(params:)``. + /// ID of the factor to unenroll. Returned in ``GoTrueMFA/enroll(params:)``. public let factorId: String public init(factorId: String) { @@ -449,7 +452,7 @@ public struct MFAUnenrollParams: Encodable, Hashable, Sendable { } public struct MFAChallengeAndVerifyParams: Encodable, Hashable, Sendable { - /// ID of the factor to be challenged. Returned in ``GoTrueMFA.enroll(params:)``. + /// ID of the factor to be challenged. Returned in ``GoTrueMFA/enroll(params:)``. public let factorId: String /// Verification code provided by the user. diff --git a/Sources/Storage/StorageFileApi.swift b/Sources/Storage/StorageFileApi.swift index 6f5a1e8a..781ae688 100644 --- a/Sources/Storage/StorageFileApi.swift +++ b/Sources/Storage/StorageFileApi.swift @@ -232,7 +232,7 @@ public class StorageFileApi: StorageApi { } /// Downloads a file from a private bucket. For public buckets, make a request to the URL returned - /// from ``getPublicURL`` instead. + /// from ``StorageFileApi/getPublicURL(path:download:fileName:options:)`` instead. /// - Parameters: /// - path: The file path to be downloaded, including the path and file name. For example /// `folder/image.png`.