Skip to content

Commit 003ac00

Browse files
authored
Migrate to swift-tools-version:6.2 (#531)
1 parent c136cde commit 003ac00

File tree

77 files changed

+235
-279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+235
-279
lines changed

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
root = true
22

33
[*.swift]
4-
indent_style = space
4+
charset = utf-8
5+
indent_style = tab
56
indent_size = 2
67
tab_width = 2
78
end_of_line = crlf

CriticalMapsKit/Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:6.2
22

33
import PackageDescription
44

@@ -209,7 +209,8 @@ let package = Package(
209209
.swiftUIHelpers
210210
],
211211
exclude: ["README.md"],
212-
resources: [.process("Resources")]
212+
resources: [.process("Resources")],
213+
swiftSettings: [.swiftLanguageMode(.v5)]
213214
),
214215
.target(
215216
name: "SwiftUIHelpers",
@@ -334,8 +335,7 @@ package.targets.append(contentsOf: [
334335
.testHelper,
335336
.tca,
336337
.product(name: "MastodonKit", package: "MastodonKit")
337-
],
338-
resources: [.process("_Resources/")]
338+
]
339339
)
340340
])
341341

CriticalMapsKit/Sources/ApiClient/APIClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33

44
/// A Client to dispatch network calls
55
@DependencyClient
6-
public struct APIClient {
6+
public struct APIClient: Sendable {
77
/// Dispatches a Request and returns its data
88
/// - Parameter request: Request to Dispatch
99
/// - Returns: The response data of the request
@@ -25,7 +25,7 @@ extension APIClient: DependencyKey {
2525
}
2626

2727
extension APIClient: TestDependencyKey {
28-
public static var testValue: APIClient = Self()
28+
public static let testValue: APIClient = Self()
2929
public static let previewValue: APIClient = Self(
3030
send: { _ in (Data(), HTTPURLResponse()) }
3131
)

CriticalMapsKit/Sources/ApiClient/APIService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import SharedModels
66

77
/// A Service to send and fetch locations and chat messages from the Critical Maps API
88
@DependencyClient
9-
public struct APIService {
9+
public struct APIService: Sendable {
1010
public var getRiders: @Sendable () async throws -> [Rider]
1111
public var postRiderLocation: @Sendable (SendLocationPostBody) async throws -> ApiResponse
1212
public var getChatMessages: @Sendable () async throws -> [ChatMessage]

CriticalMapsKit/Sources/ApiClient/NetworkDispatcher.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33

44
/// A client to dispatch network request to URLSession
55
@DependencyClient
6-
public struct NetworkDispatcher {
6+
public struct NetworkDispatcher: Sendable {
77
var dispatch: @Sendable (URLRequest) async throws -> (Data, URLResponse)
88
}
99

CriticalMapsKit/Sources/ApiClient/Requests/SendLocationPostBody.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import SharedModels
33

4-
public struct SendLocationPostBody: Encodable {
4+
public struct SendLocationPostBody: Encodable, Sendable {
55
public init(
66
device: String,
77
location: Location? = nil

CriticalMapsKit/Sources/AppFeature/AppFeature.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import UIApplicationClient
1818
import UserDefaultsClient
1919

2020
@Reducer
21-
public struct AppFeature { // swiftlint:disable:this type_body_length
21+
public struct AppFeature: Sendable { // swiftlint:disable:this type_body_length
2222
public init() {}
2323

2424
@Reducer
25-
public enum Destination {
25+
public enum Destination: Sendable {
2626
case social(SocialFeature)
2727
case settings(SettingsFeature)
2828
case alert(AlertState<Alert>)
@@ -481,7 +481,7 @@ public struct AppFeature { // swiftlint:disable:this type_body_length
481481

482482
// MARK: - Helper
483483

484-
extension AppFeature.Destination.State: Equatable {}
484+
extension AppFeature.Destination.State: Equatable, Sendable {}
485485

486486
extension SharedModels.Location {
487487
/// Creates a Location object from an optional ComposableCoreLocation.Location
@@ -514,7 +514,7 @@ extension SharedModels.Coordinate {
514514

515515
private extension Logger {
516516
/// Using your bundle identifier is a great way to ensure a unique identifier.
517-
private static var subsystem = "AppFeature"
517+
private static let subsystem = "AppFeature"
518518

519519
/// Logs the view cycles like a view that appeared.
520520
static let reducer = Logger(

CriticalMapsKit/Sources/AppFeature/RequestTimerFeature.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ import ComposableArchitecture
22
import Foundation
33

44
@Reducer
5-
public struct RequestTimer {
6-
public init(timerInterval: Int = 60) {
7-
self.timerInterval = .seconds(timerInterval)
8-
}
9-
10-
let timerInterval: RunLoop.SchedulerTimeType.Stride
5+
public struct RequestTimer: Sendable {
6+
public init() {}
117

128
// MARK: State
139

CriticalMapsKit/Sources/AppIntentFeature/ObservationModeIntent.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import SharedModels
44
import Sharing
55

66
public struct ObservationModeIntent: AppIntent {
7-
public static var title = LocalizedStringResource(
7+
public static let title = LocalizedStringResource(
88
"appIntent.observationMode.title",
99
defaultValue: "Toggle Observation Mode",
1010
bundle: .module
1111
)
12-
public static var description = IntentDescription(
12+
public static let description = IntentDescription(
1313
LocalizedStringResource(
1414
"appIntent.observationMode.description",
1515
defaultValue: "Enable or disable observation mode in CriticalMaps",

CriticalMapsKit/Sources/ChatFeature/ChatFeature.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import SharedModels
1010
import UserDefaultsClient
1111

1212
@Reducer
13-
public struct ChatFeature {
13+
public struct ChatFeature: Sendable {
1414
public init() {}
1515

1616
var md5Uuid: String {
@@ -22,7 +22,7 @@ public struct ChatFeature {
2222
// MARK: State
2323

2424
@ObservableState
25-
public struct State: Equatable {
25+
public struct State: Equatable, Sendable {
2626
public var chatMessages: ContentState<[ChatMessage]>
2727
public var chatInputState: ChatInput.State
2828
@Presents public var alert: AlertState<Action.Alert>?
@@ -53,7 +53,7 @@ public struct ChatFeature {
5353
case chatInput(ChatInput.Action)
5454
case alert(PresentationAction<Alert>)
5555

56-
public enum Alert {
56+
public enum Alert: Sendable {
5757
case chat
5858
}
5959
}
@@ -159,7 +159,7 @@ public struct ChatFeature {
159159

160160
private extension Logger {
161161
/// Using your bundle identifier is a great way to ensure a unique identifier.
162-
private static var subsystem = "ChatFeature"
162+
private static let subsystem = "ChatFeature"
163163

164164
/// Logs the view cycles like a view that appeared.
165165
static let reducer = Logger(

0 commit comments

Comments
 (0)