Skip to content

Commit

Permalink
add additional platforms to package.swift (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepitre authored Apr 10, 2024
1 parent 136e287 commit 146374a
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 7 deletions.
12 changes: 10 additions & 2 deletions ClerkDemo/ClerkDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,13 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.clerk.ClerkDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,3,7";
};
name = Debug;
};
Expand Down Expand Up @@ -357,9 +361,13 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.clerk.ClerkDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,3,7";
};
name = Release;
};
Expand Down
5 changes: 1 addition & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import PackageDescription

let package = Package(
name: "Clerk",
platforms: [
.iOS(.v16),
.macOS(.v13)
],
platforms: [.iOS(.v16), .macCatalyst(.v13), .macOS(.v13), .watchOS(.v9), .tvOS(.v16), .visionOS(.v1)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
Expand Down
3 changes: 3 additions & 0 deletions Sources/API/Models/PhoneNumber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ extension PhoneNumber {
let phoneNumberKit = Container.shared.phoneNumberKit()
guard let phoneNumber = try? phoneNumberKit.parse(phoneNumber) else { return phoneNumber }

#if canImport(UIKit)

if
let region = phoneNumber.regionID,
let country = CountryCodePickerViewController.Country(for: region, with: phoneNumberKit)
{
return country.flag
}
#endif

return nil
}
Expand Down
1 change: 0 additions & 1 deletion Sources/API/Utils/UserAgentHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import Foundation
import UIKit

struct UserAgentHelpers {

Expand Down
4 changes: 4 additions & 0 deletions Sources/UI/Common/AuthProviderIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 3/6/24.
//

#if canImport(UIKit)

import SwiftUI
import NukeUI

Expand All @@ -31,3 +33,5 @@ struct AuthProviderIcon: View {
#Preview {
AuthProviderIcon(provider: .apple)
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/Common/CheckBoxView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 12/19/23.
//

#if canImport(UIKit)

import SwiftUI

struct CheckBoxView: View {
Expand Down Expand Up @@ -58,3 +60,5 @@ struct CheckBoxView: View {
CheckBoxView(isSelected: .constant(true))
.frame(width: 40, height: 40)
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/Common/ErrorPresentation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 12/11/23.
//

#if canImport(UIKit)

import SwiftUI

struct ErrorWrapper: Identifiable {
Expand Down Expand Up @@ -77,3 +79,5 @@ extension View {
.presentationDragIndicator(.visible)
}
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/Common/GetHelpView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 1/17/24.
//

#if canImport(UIKit)

import SwiftUI

struct GetHelpView: View {
Expand Down Expand Up @@ -68,3 +70,5 @@ struct GetHelpView: View {
primaryButtonConfig: .init(label: "Email support", action: {}),
secondaryButtonConfig: .init(label: "Back to sign in", action: {}))
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/Common/MoreActionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 1/11/24.
//

#if canImport(UIKit)

import SwiftUI

struct MoreActionsView: View {
Expand All @@ -23,3 +25,5 @@ struct MoreActionsView: View {
#Preview {
MoreActionsView()
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/Common/OrgLogoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 12/18/23.
//

#if canImport(UIKit)

import SwiftUI
import NukeUI

Expand All @@ -29,3 +31,5 @@ public struct OrgLogoView: View {
OrgLogoView()
.frame(width: 32, height: 32)
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/Common/RemoveResourceView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 11/8/23.
//

#if canImport(UIKit)

import SwiftUI

struct RemoveResourceView: View {
Expand Down Expand Up @@ -69,3 +71,5 @@ struct RemoveResourceView: View {
print("DELETED")
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 1/25/24.
//

#if canImport(UIKit)

import SwiftUI

struct UserProfileMfaAddSmsView: View {
Expand Down Expand Up @@ -142,3 +144,5 @@ struct UserProfileMfaAddSmsView: View {
#Preview {
UserProfileMfaAddSmsView()
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 2/13/24.
//

#if canImport(UIKit)

import SwiftUI

extension UserProfileMfaAddTotpView {
Expand Down Expand Up @@ -270,3 +272,5 @@ private struct TOTPBackupCodesView: View {
"flwmkdcp"
])
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 1/29/24.
//

#if canImport(UIKit)

import SwiftUI

struct UserProfileMfaBackupCodeListView: View {
Expand Down Expand Up @@ -94,3 +96,5 @@ struct UserProfileMfaBackupCodeListView: View {
])
.padding()
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 1/24/24.
//

#if canImport(UIKit)

import SwiftUI

struct UserProfileMfaSection: View {
Expand Down Expand Up @@ -196,3 +198,5 @@ struct UserProfileMfaSection: View {
UserProfileMfaSection()
.padding()
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/Styles/ClerkDangerButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 12/15/23.
//

#if canImport(UIKit)

import SwiftUI

struct ClerkDangerButtonStyle: ButtonStyle {
Expand Down Expand Up @@ -44,3 +46,5 @@ struct ClerkDangerButtonStyle: ButtonStyle {
}
.buttonStyle(ClerkDangerButtonStyle())
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/Styles/ClerkPrimaryButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 12/15/23.
//

#if canImport(UIKit)

import SwiftUI

struct ClerkPrimaryButtonStyle: ButtonStyle {
Expand Down Expand Up @@ -44,3 +46,5 @@ struct ClerkPrimaryButtonStyle: ButtonStyle {
}
.buttonStyle(ClerkPrimaryButtonStyle())
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/Styles/ClerkSecondaryButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 12/15/23.
//

#if canImport(UIKit)

import SwiftUI

struct ClerkSecondaryButtonStyle: ButtonStyle {
Expand Down Expand Up @@ -36,3 +38,5 @@ struct ClerkSecondaryButtonStyle: ButtonStyle {
}
.buttonStyle(ClerkSecondaryButtonStyle())
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/ViewModifiers/ClerkBottomBrandingModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 12/20/23.
//

#if canImport(UIKit)

import SwiftUI

struct ClerkBottomBrandingModifier: ViewModifier {
Expand Down Expand Up @@ -40,3 +42,5 @@ extension View {
AuthView()
.environmentObject(ClerkUIState())
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 1/17/24.
//

#if canImport(UIKit)

import SwiftUI

struct ClerkStandardButtonPaddingModifier: ViewModifier {
Expand All @@ -30,3 +32,5 @@ extension View {
}
.buttonStyle(ClerkPrimaryButtonStyle())
}

#endif
4 changes: 4 additions & 0 deletions Sources/UI/ViewModifiers/DismissButtonOverlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 11/22/23.
//

#if canImport(UIKit)

import Foundation
import SwiftUI

Expand Down Expand Up @@ -38,3 +40,5 @@ extension View {
Color(.systemBackground)
.dismissButtonOverlay()
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Mike Pitre on 12/20/23.
//

#if canImport(UIKit)

import SwiftUI

struct KeyboardIgnoringBottomViewModifier<BottomView: View>: ViewModifier, KeyboardReadable {
Expand Down Expand Up @@ -57,3 +59,5 @@ extension View {
SecuredByClerkView()
}
}

#endif

0 comments on commit 146374a

Please sign in to comment.