Add `CasePaths` and `Tagged` traits (#479) · structuredpath/sqlite-data@f58622e · GitHub
Skip to content

Commit f58622e

Browse files
authored
Add CasePaths and Tagged traits (pointfreeco#479)
* Add `CasePaths` and `Tagged` traits The existing `SQLiteDataTagged` trait will serve as a deprecated alias to `Tagged`, while `CasePaths` will allow SQLiteData users to enable enum tables without an explicit dependency on `swift-structured-queries`. * wip * wip
1 parent 0c79d7a commit f58622e

5 files changed

Lines changed: 30 additions & 14 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 1 deletion

‎Examples/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Package.resolved‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Package.swift‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// swift-tools-version: 6.1
22

3+
import Foundation
34
import PackageDescription
45

56
let package = Package(
@@ -22,9 +23,18 @@ let package = Package(
2223
],
2324
traits: [
2425
.trait(
25-
name: "SQLiteDataTagged",
26+
name: "CasePaths",
27+
description: "Introduce support for enum tables."
28+
),
29+
.trait(
30+
name: "Tagged",
2631
description: "Introduce SQLiteData conformances to the swift-tagged package."
27-
)
32+
),
33+
.trait(
34+
name: "SQLiteDataTagged",
35+
description: "A deprecated alias for the 'Tagged' trait.",
36+
enabledTraits: ["Tagged"]
37+
),
2838
],
2939
dependencies: [
3040
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0"),
@@ -37,9 +47,10 @@ let package = Package(
3747
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.18.4"),
3848
.package(
3949
url: "https://github.com/pointfreeco/swift-structured-queries",
40-
from: "0.31.0",
50+
from: "0.32.0",
4151
traits: [
42-
.trait(name: "StructuredQueriesTagged", condition: .when(traits: ["SQLiteDataTagged"]))
52+
.trait(name: "CasePaths", condition: .when(traits: ["CasePaths"])),
53+
.trait(name: "Tagged", condition: .when(traits: ["Tagged"])),
4354
]
4455
),
4556
.package(url: "https://github.com/pointfreeco/swift-tagged", from: "0.10.0"),
@@ -60,7 +71,7 @@ let package = Package(
6071
.product(
6172
name: "Tagged",
6273
package: "swift-tagged",
63-
condition: .when(traits: ["SQLiteDataTagged"])
74+
condition: .when(traits: ["Tagged"])
6475
),
6576
]
6677
),
@@ -108,6 +119,9 @@ for target in package.targets {
108119
.enableUpcomingFeature("InternalImportsByDefault"),
109120
.enableUpcomingFeature("MemberImportVisibility"),
110121
])
122+
if ProcessInfo.processInfo.environment.keys.contains("EXCLUDE_EXPORTS") {
123+
target.swiftSettings?.append(.define("EXCLUDE_EXPORTS"))
124+
}
111125
}
112126
}
113127

‎Sources/SQLiteData/Traits/Tagged.swift‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)