Skip to content

Commit

Permalink
Merge branch 'main' into replace-HTTPRequest
Browse files Browse the repository at this point in the history
# Conflicts:
#	Sources/Auth/AuthError.swift
#	Sources/Auth/Internal/APIClient.swift
#	Sources/Auth/Internal/Contants.swift
#	Sources/Auth/Internal/SessionManager.swift
#	Sources/Helpers/URLSession+AsyncAwait.swift
#	Sources/Helpers/Version.swift
#	Sources/Storage/MultipartFormData.swift
#	Sources/Storage/StorageFileApi.swift
#	Tests/AuthTests/SessionManagerTests.swift
#	Tests/IntegrationTests/StorageFileIntegrationTests.swift
#	Tests/StorageTests/SupabaseStorageTests.swift
  • Loading branch information
zunda-pixel committed Oct 23, 2024
2 parents 8a624e0 + 8f5b94f commit c583270
Show file tree
Hide file tree
Showing 62 changed files with 1,249 additions and 762 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
pull_request:
branches:
- '*'
- "*"
workflow_dispatch:

concurrency:
Expand All @@ -19,9 +19,13 @@ jobs:
runs-on: macos-14
strategy:
matrix:
command: [test, '']
platform: [iOS, macOS, tvOS, watchOS, visionOS, macCatalyst]
xcode: [15.4, '16.0']
command: [test, ""]
platform: [IOS, MAC_CATALYST, MACOS, TVOS, VISIONOS, WATCHOS]
xcode: [15.4, "16.0"]
exclude:
- { platform: VISIONOS }
include:
- { command: test, skip_release: 1 }
steps:
- uses: actions/checkout@v4
- name: Select Xcode ${{ matrix.xcode }}
Expand All @@ -35,15 +39,16 @@ jobs:
deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift') }}
restore-keys: |
deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-
- name: Set IgnoreFileSystemDeviceInodeChanges flag
- name: Set IgnoreFileSystemDeviceInodeChanges flag
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
- name: Update mtime for incremental builds
- name: Update mtime for incremental builds
uses: chetan/git-restore-mtime-action@v2
- run: make dot-env
- name: Debug
run: make COMMAND="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild
run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild
- name: Release
if: matrix.skip_release != '1'
run: make COMMAND="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild
run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild

linux:
name: linux
Expand All @@ -69,7 +74,6 @@ jobs:
- name: Run tests
run: swift test --skip IntegrationTests


# library-evolution:
# name: Library (evolution)
# runs-on: macos-14
Expand Down Expand Up @@ -100,9 +104,8 @@ jobs:
- name: Update mtime for incremental builds
uses: chetan/git-restore-mtime-action@v2
- name: Examples
run: make SCHEME="Examples" build-example
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="Examples" XCODEBUILD_ARGUMENT=build xcodebuild
- name: SlackClone
run: make SCHEME="SlackClone" build-example
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="SlackClone" XCODEBUILD_ARGUMENT=build xcodebuild
- name: UserManagement
run: make SCHEME="UserManagement" build-example

run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="UserManagement" XCODEBUILD_ARGUMENT=build xcodebuild
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.20.1"
".": "2.20.4"
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"Supabase",
"whitespaces",
"xctest"
]
],
"makefile.configureOnOpen": false
}
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## [2.20.4](https://github.com/supabase/supabase-swift/compare/v2.20.3...v2.20.4) (2024-10-23)


### Bug Fixes

* **storage:** cache control ([#551](https://github.com/supabase/supabase-swift/issues/551)) ([8a2b196](https://github.com/supabase/supabase-swift/commit/8a2b19690cf165c80454ff6388cb9a202b04172c))

## [2.20.3](https://github.com/supabase/supabase-swift/compare/v2.20.2...v2.20.3) (2024-10-22)


### Bug Fixes

* remove kSecUseDataProtectionKeychain ([#574](https://github.com/supabase/supabase-swift/issues/574)) ([554f916](https://github.com/supabase/supabase-swift/commit/554f91689eb13c1a923a53bddb5d194e6b80328a))

## [2.20.2](https://github.com/supabase/supabase-swift/compare/v2.20.1...v2.20.2) (2024-10-17)


### Bug Fixes

* general auth improvements ([#561](https://github.com/supabase/supabase-swift/issues/561)) ([5f4c0f2](https://github.com/supabase/supabase-swift/commit/5f4c0f256c74beb47ce2a42951014504ba798dd6))
* replace to HTTPTypes Components from Helpers Components ([#564](https://github.com/supabase/supabase-swift/issues/564)) ([71dee2a](https://github.com/supabase/supabase-swift/commit/71dee2ac35204c40e11d7aa3c3c6f5def95520f9))
* Swift 6 now has URLSession async method ([#565](https://github.com/supabase/supabase-swift/issues/565)) ([5786dd6](https://github.com/supabase/supabase-swift/commit/5786dd6c06ceead5851fb6527a48d0cee48654af))

## [2.20.1](https://github.com/supabase/supabase-swift/compare/v2.20.0...v2.20.1) (2024-10-09)


Expand Down
24 changes: 20 additions & 4 deletions Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
794C61D62BAD1E12000E6B0F /* UserIdentityList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794C61D52BAD1E12000E6B0F /* UserIdentityList.swift */; };
794EF1222955F26A008C9526 /* AddTodoListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794EF1212955F26A008C9526 /* AddTodoListView.swift */; };
794EF1242955F3DE008C9526 /* TodoListRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794EF1232955F3DE008C9526 /* TodoListRow.swift */; };
7956405E2954ADE00088A06F /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7956405D2954ADE00088A06F /* Secrets.swift */; };
7956405E2954ADE00088A06F /* SupabaseConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7956405D2954ADE00088A06F /* SupabaseConfig.swift */; };
795640602954AE140088A06F /* AuthController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7956405F2954AE140088A06F /* AuthController.swift */; };
795640622955AD2B0088A06F /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 795640612955AD2B0088A06F /* HomeView.swift */; };
795640662955AE9C0088A06F /* TodoListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 795640652955AE9C0088A06F /* TodoListView.swift */; };
Expand Down Expand Up @@ -75,6 +75,7 @@
79FEFFC52B078D7900D36347 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FEFFC42B078D7900D36347 /* Models.swift */; };
79FEFFC72B078FB000D36347 /* SwiftUIHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FEFFC62B078FB000D36347 /* SwiftUIHelpers.swift */; };
79FEFFC92B0797F600D36347 /* AvatarImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FEFFC82B0797F600D36347 /* AvatarImage.swift */; };
79FFA5B32CC04F8B00F8A807 /* Supabase.plist in Resources */ = {isa = PBXBuildFile; fileRef = 79FFA5B22CC04F8B00F8A807 /* Supabase.plist */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -93,7 +94,7 @@
794C61D52BAD1E12000E6B0F /* UserIdentityList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIdentityList.swift; sourceTree = "<group>"; };
794EF1212955F26A008C9526 /* AddTodoListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTodoListView.swift; sourceTree = "<group>"; };
794EF1232955F3DE008C9526 /* TodoListRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodoListRow.swift; sourceTree = "<group>"; };
7956405D2954ADE00088A06F /* Secrets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Secrets.swift; sourceTree = "<group>"; };
7956405D2954ADE00088A06F /* SupabaseConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupabaseConfig.swift; sourceTree = "<group>"; };
7956405F2954AE140088A06F /* AuthController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthController.swift; sourceTree = "<group>"; };
795640612955AD2B0088A06F /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
795640652955AE9C0088A06F /* TodoListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodoListView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -146,6 +147,7 @@
79FEFFC42B078D7900D36347 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = "<group>"; };
79FEFFC62B078FB000D36347 /* SwiftUIHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIHelpers.swift; sourceTree = "<group>"; };
79FEFFC82B0797F600D36347 /* AvatarImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvatarImage.swift; sourceTree = "<group>"; };
79FFA5B22CC04F8B00F8A807 /* Supabase.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Supabase.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -215,7 +217,7 @@
793895C92954ABFF0044F2B8 /* ExamplesApp.swift */,
793895D02954AC000044F2B8 /* Preview Content */,
793895CB2954ABFF0044F2B8 /* RootView.swift */,
7956405D2954ADE00088A06F /* Secrets.swift */,
7956405D2954ADE00088A06F /* SupabaseConfig.swift */,
795640612955AD2B0088A06F /* HomeView.swift */,
795640652955AE9C0088A06F /* TodoListView.swift */,
795640672955AEB30088A06F /* Models.swift */,
Expand All @@ -230,6 +232,7 @@
797EFB672BABD90500098D6B /* Stringfy.swift */,
79B1C80D2BAC017C00D991AA /* AnyJSONView.swift */,
79401F342BC708C8004C9C0F /* UIViewControllerWrapper.swift */,
79FFA5B22CC04F8B00F8A807 /* Supabase.plist */,
);
path = Examples;
sourceTree = "<group>";
Expand Down Expand Up @@ -465,6 +468,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
79FFA5B32CC04F8B00F8A807 /* Supabase.plist in Resources */,
793895D22954AC000044F2B8 /* Preview Assets.xcassets in Resources */,
793895CE2954AC000044F2B8 /* Assets.xcassets in Resources */,
);
Expand Down Expand Up @@ -514,7 +518,7 @@
79E2B55C2B97A2310042CD21 /* UIApplicationExtensions.swift in Sources */,
794EF1222955F26A008C9526 /* AddTodoListView.swift in Sources */,
7928145D2CAB2CE2000B4ADB /* ResetPasswordView.swift in Sources */,
7956405E2954ADE00088A06F /* Secrets.swift in Sources */,
7956405E2954ADE00088A06F /* SupabaseConfig.swift in Sources */,
795640682955AEB30088A06F /* Models.swift in Sources */,
79B1C80C2BABFF8000D991AA /* ProfileView.swift in Sources */,
795640662955AE9C0088A06F /* TodoListView.swift in Sources */,
Expand Down Expand Up @@ -723,7 +727,13 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.supabase.swift-examples";
PRODUCT_NAME = "$(TARGET_NAME)";
REGISTER_APP_GROUPS = NO;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
Expand All @@ -743,7 +753,13 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.supabase.swift-examples";
PRODUCT_NAME = "$(TARGET_NAME)";
REGISTER_APP_GROUPS = NO;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
Expand Down
16 changes: 12 additions & 4 deletions Examples/Examples/Auth/AuthView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ struct AuthView: View {
case signInWithPhone
case signInWithApple
case signInWithOAuth
case signInWithOAuthUsingUIKit
#if canImport(UIKit)
case signInWithOAuthUsingUIKit
#endif
case googleSignInSDKFlow
case signInAnonymously

Expand All @@ -25,7 +27,9 @@ struct AuthView: View {
case .signInWithPhone: "Sign in with Phone"
case .signInWithApple: "Sign in with Apple"
case .signInWithOAuth: "Sign in with OAuth flow"
case .signInWithOAuthUsingUIKit: "Sign in with OAuth flow (UIKit)"
#if canImport(UIKit)
case .signInWithOAuthUsingUIKit: "Sign in with OAuth flow (UIKit)"
#endif
case .googleSignInSDKFlow: "Google Sign in (GIDSignIn SDK Flow)"
case .signInAnonymously: "Sign in Anonymously"
}
Expand All @@ -43,7 +47,9 @@ struct AuthView: View {
options
.navigationTitle(options.title)
}
#if !os(macOS)
.navigationBarTitleDisplayMode(.inline)
#endif
}
}
}
Expand All @@ -56,8 +62,10 @@ extension AuthView.Option: View {
case .signInWithPhone: SignInWithPhone()
case .signInWithApple: SignInWithApple()
case .signInWithOAuth: SignInWithOAuth()
case .signInWithOAuthUsingUIKit: UIViewControllerWrapper(SignInWithOAuthViewController())
.edgesIgnoringSafeArea(.all)
#if canImport(UIKit)
case .signInWithOAuthUsingUIKit: UIViewControllerWrapper(SignInWithOAuthViewController())
.edgesIgnoringSafeArea(.all)
#endif
case .googleSignInSDKFlow: GoogleSignInSDKFlow()
case .signInAnonymously: SignInAnonymously()
}
Expand Down
6 changes: 5 additions & 1 deletion Examples/Examples/Auth/AuthWithEmailAndPassword.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ struct AuthWithEmailAndPassword: View {
Form {
Section {
TextField("Email", text: $email)
.keyboardType(.emailAddress)
.textContentType(.emailAddress)
.autocorrectionDisabled()
#if !os(macOS)
.keyboardType(.emailAddress)
.textInputAutocapitalization(.never)
#endif

SecureField("Password", text: $password)
.textContentType(.password)
.autocorrectionDisabled()
#if !os(macOS)
.textInputAutocapitalization(.never)
#endif
}

Section {
Expand Down
4 changes: 3 additions & 1 deletion Examples/Examples/Auth/AuthWithMagicLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ struct AuthWithMagicLink: View {
Form {
Section {
TextField("Email", text: $email)
.keyboardType(.emailAddress)
.textContentType(.emailAddress)
.autocorrectionDisabled()
#if !os(macOS)
.keyboardType(.emailAddress)
.textInputAutocapitalization(.never)
#endif
}

Section {
Expand Down
14 changes: 10 additions & 4 deletions Examples/Examples/Auth/GoogleSignInSDKFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct GoogleSignInSDKFlow: View {
func handleSignIn() {
Task {
do {
let result = try await GIDSignIn.sharedInstance.signIn(withPresenting: rootViewController)
let result = try await GIDSignIn.sharedInstance.signIn(withPresenting: root)

guard let idToken = result.user.idToken?.tokenString else {
debug("No 'idToken' returned by GIDSignIn call.")
Expand All @@ -38,9 +38,15 @@ struct GoogleSignInSDKFlow: View {
}
}

var rootViewController: UIViewController {
UIApplication.shared.firstKeyWindow?.rootViewController ?? UIViewController()
}
#if canImport(UIKit)
var root: UIViewController {
UIApplication.shared.firstKeyWindow?.rootViewController ?? UIViewController()
}
#else
var root: NSWindow {
NSApplication.shared.keyWindow ?? NSWindow()
}
#endif
}

#Preview {
Expand Down
Loading

0 comments on commit c583270

Please sign in to comment.