diff --git a/Package.resolved b/Package.resolved index f09e5d6f1e2c..fad60e924955 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "cdf009b7134aa63351df1103b1952fd57ee265ea5843d3d40e9ff20ff9b918d9", + "originHash" : "e448aeb25b94d92b65914a847781e984ae565ada637ca2870d3a1d4f058a081b", "pins" : [ { "identity" : "combine-schedulers", @@ -91,6 +91,15 @@ "version" : "1.1.1" } }, + { + "identity" : "swift-issue-reporting", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-issue-reporting", + "state" : { + "revision" : "71c7c9a761d1ca6ed4ccb6ced040fe1c1a39e8e7", + "version" : "2.1.0" + } + }, { "identity" : "swift-macro-testing", "kind" : "remoteSourceControl", @@ -150,8 +159,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", "state" : { - "revision" : "dfd70507def84cb5fb821278448a262c6ff2bbad", - "version" : "1.9.0" + "revision" : "7bbd97af585672a3dcdf6575ad37b339ad41b579", + "version" : "1.13.0" } } ], diff --git a/Package.swift b/Package.swift index 732dcf586b7a..4805223574d4 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.1 +// swift-tools-version: 6.4 import CompilerPluginSupport import PackageDescription @@ -43,11 +43,11 @@ let package = Package( .package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.2"), .package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.4.0"), .package(url: "https://github.com/pointfreeco/swift-identified-collections", from: "1.1.0"), + .package(url: "https://github.com/pointfreeco/swift-issue-reporting", from: "2.1.0"), .package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"), .package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.7.0"), .package(url: "https://github.com/pointfreeco/swift-perception", "1.3.4"..<"3.0.0"), .package(url: "https://github.com/pointfreeco/swift-sharing", "1.0.0"..<"3.0.0"), - .package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.3.0"), .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"), .package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"605.0.0"), ], @@ -64,7 +64,7 @@ let package = Package( .product(name: "Dependencies", package: "swift-dependencies"), .product(name: "DependenciesMacros", package: "swift-dependencies"), .product(name: "IdentifiedCollections", package: "swift-identified-collections"), - .product(name: "IssueReporting", package: "xctest-dynamic-overlay"), + .product(name: "IssueReporting", package: "swift-issue-reporting"), .product(name: "OrderedCollections", package: "swift-collections"), .product(name: "Perception", package: "swift-perception"), .product(name: "Sharing", package: "swift-sharing"), @@ -79,7 +79,7 @@ let package = Package( name: "ComposableArchitectureTests", dependencies: [ "ComposableArchitecture", - .product(name: "IssueReportingTestSupport", package: "xctest-dynamic-overlay"), + .product(name: "IssueReportingTestSupport", package: "swift-issue-reporting"), ] ), .macro( diff --git a/Package@swift-6.1.swift b/Package@swift-6.1.swift new file mode 100644 index 000000000000..608fcc24bd27 --- /dev/null +++ b/Package@swift-6.1.swift @@ -0,0 +1,116 @@ +// swift-tools-version:6.1 + +import CompilerPluginSupport +import PackageDescription + +let package = Package( + name: "swift-composable-architecture", + platforms: [ + .iOS(.v16), + .macOS(.v13), + .tvOS(.v16), + .watchOS(.v9), + ], + products: [ + .library( + name: "ComposableArchitecture", + targets: ["ComposableArchitecture"] + ) + ], + traits: [ + .trait( + name: "ComposableArchitecture2Deprecations", + description: """ + Prepare for the next major release by enabling some of the more viral deprecations. Enable \ + this trait to remain ready for Composable Architecture 2.0. + """ + ), + .trait( + name: "ComposableArchitecture2DeprecationOverloads", + description: """ + Prepare for the next major release by enabling some of the more viral deprecations. These \ + deprecations rely on overloads that can tax the compiler and prevent existing applications \ + from compiling. Temporarily enable this trait to perform these specific migrations. + """ + ), + ], + dependencies: [ + .package(url: "https://github.com/apple/swift-collections", from: "1.1.0"), + .package(url: "https://github.com/pointfreeco/combine-schedulers", from: "1.0.2"), + .package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.4"), + .package(url: "https://github.com/pointfreeco/swift-clocks", from: "1.0.4"), + .package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.2.0"), + .package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.2"), + .package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.4.0"), + .package(url: "https://github.com/pointfreeco/swift-identified-collections", from: "1.1.0"), + .package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"), + .package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.7.0"), + .package(url: "https://github.com/pointfreeco/swift-perception", "1.3.4"..<"3.0.0"), + .package(url: "https://github.com/pointfreeco/swift-sharing", "1.0.0"..<"3.0.0"), + .package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.13.0"), + .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"), + .package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"605.0.0"), + ], + targets: [ + .target( + name: "ComposableArchitecture", + dependencies: [ + "ComposableArchitectureMacros", + .product(name: "CasePaths", package: "swift-case-paths"), + .product(name: "Clocks", package: "swift-clocks"), + .product(name: "CombineSchedulers", package: "combine-schedulers"), + .product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"), + .product(name: "CustomDump", package: "swift-custom-dump"), + .product(name: "Dependencies", package: "swift-dependencies"), + .product(name: "DependenciesMacros", package: "swift-dependencies"), + .product(name: "IdentifiedCollections", package: "swift-identified-collections"), + .product(name: "IssueReporting", package: "xctest-dynamic-overlay"), + .product(name: "OrderedCollections", package: "swift-collections"), + .product(name: "Perception", package: "swift-perception"), + .product(name: "Sharing", package: "swift-sharing"), + .product(name: "SwiftUINavigation", package: "swift-navigation"), + .product(name: "UIKitNavigation", package: "swift-navigation"), + ], + resources: [ + .process("Resources/PrivacyInfo.xcprivacy") + ] + ), + .testTarget( + name: "ComposableArchitectureTests", + dependencies: [ + "ComposableArchitecture", + .product(name: "IssueReportingTestSupport", package: "xctest-dynamic-overlay"), + ] + ), + .macro( + name: "ComposableArchitectureMacros", + dependencies: [ + .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), + .product(name: "SwiftCompilerPlugin", package: "swift-syntax"), + ] + ), + .testTarget( + name: "ComposableArchitectureMacrosTests", + dependencies: [ + "ComposableArchitectureMacros", + .product(name: "MacroTesting", package: "swift-macro-testing"), + ] + ), + ], + swiftLanguageModes: [.v6] +) + +for target in package.targets { + target.swiftSettings = target.swiftSettings ?? [] + target.swiftSettings?.append(contentsOf: [ + .enableUpcomingFeature("ExistentialAny") + ]) +} + +for target in package.targets where target.type == .system || target.type == .test { + target.swiftSettings?.append(contentsOf: [ + .swiftLanguageMode(.v5), + .enableExperimentalFeature("StrictConcurrency"), + .enableUpcomingFeature("InferSendableFromCaptures"), + ]) +} diff --git a/Tests/ComposableArchitectureTests/RuntimeWarningTests.swift b/Tests/ComposableArchitectureTests/RuntimeWarningTests.swift index 082ec71c5904..cd168472bbd5 100644 --- a/Tests/ComposableArchitectureTests/RuntimeWarningTests.swift +++ b/Tests/ComposableArchitectureTests/RuntimeWarningTests.swift @@ -114,16 +114,16 @@ XCTExpectFailure { store.scope(\.path, action: \.path)[ - fileID: "file.swift", - filePath: "/file.swift", + fileID: "Unknown/file.swift", + filePath: "/Unknown/file.swift", line: 1, column: 1 ] = .init() } issueMatcher: { $0.compactDescription.hasSuffix( """ - A navigation stack binding at "file.swift:1" was written to with a path that has the \ - same number of elements that already exist in the store. A view should only write to \ + A navigation stack binding at "Unknown/file.swift:1" was written to with a path that has \ + the same number of elements that already exist in the store. A view should only write to \ this binding with a path that has pushed a new element onto the stack, or popped one or \ more elements from the stack. @@ -172,15 +172,16 @@ state: \.destination, action: \.destination, isInViewBody: false, - fileID: "file.swift", - filePath: "/file.swift", + fileID: "Unknown/file.swift", + filePath: "/Unknown/file.swift", line: 1, column: 1 ] = nil } issueMatcher: { $0.compactDescription.hasSuffix( """ - A binding at "file.swift:1" was set to "nil", but the store destination wasn't nil'd out. + A binding at "Unknown/file.swift:1" was set to "nil", but the store destination wasn't \ + nil'd out. This usually means an "ifLet" has not been integrated with the reducer powering the \ store, and this reducer is responsible for handling presentation actions.