Skip to content

Commit 6da09a6

Browse files
authored
Merge pull request #1 from qizh/fix/warnings-cleanup
- [x] fix: resolve compiler warnings - [x] merge: from `upstream/main`
2 parents 44558a5 + 0b3f7dc commit 6da09a6

26 files changed

Lines changed: 1100 additions & 150 deletions

.github/workflows/main.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Checkout repository
51-
uses: actions/checkout@v5
51+
uses: actions/checkout@v6
5252
- name: Spellcheck Action
53-
uses: rojopolis/spellcheck-github-actions@0.51.0
53+
uses: rojopolis/spellcheck-github-actions@0.57.0
5454
with:
5555
config_path: .github/config/spellcheck.yaml
5656

@@ -176,14 +176,22 @@ jobs:
176176
},
177177
{
178178
"os": "ubuntu-latest",
179-
"swift": "latest"
179+
"swift": "6.2",
180+
"dependencies": {
181+
"swift-syntax": "602.0.0"
182+
}
180183
},
181184
{
182185
"os": "macos-15",
183186
"swift": "6.1.2"
184187
}
185188
]
186189
}
190+
# disable until prebuilt macro issues are fixed
191+
# {
192+
# "os": "ubuntu-latest",
193+
# "swift": "latest"
194+
# },
187195

188196
cocoapods-test:
189197
name: CocoaPods

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Package.resolved
5959
*.o
6060
*.d
6161
*.swiftdeps*
62+
*.dia
6263

6364
# CocoaPods
6465
#

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## [1.6.0](https://github.com/SwiftyLab/MetaCodable/compare/v1.5.0...v1.6.0) (2026-01-20)
2+
3+
4+
### 🚀 Features
5+
6+
* added support for `RawRepresentable` enum conformance generation ([#147](https://github.com/SwiftyLab/MetaCodable/issues/147)) ([46cb009](https://github.com/SwiftyLab/MetaCodable/commit/46cb009664047db495f92c30bd9b988832f51806))
7+
* added support for specifying arbitrary primitive enum case values ([#144](https://github.com/SwiftyLab/MetaCodable/issues/144)) ([8e3a24f](https://github.com/SwiftyLab/MetaCodable/commit/8e3a24f6c3ed20fa21ca89322e2317389061e71a))
8+
9+
10+
### 🐛 Fixes
11+
12+
* fixed optional types not detected with `valueCoder` strategy ([#141](https://github.com/SwiftyLab/MetaCodable/issues/141)) ([5873c3e](https://github.com/SwiftyLab/MetaCodable/commit/5873c3e33ab98e61c06304bfc2a2c93ab199d65d))
13+
* removed unreachable `default` case warnings for `Bool` type switches in macro-generated code
14+
115
## [1.5.0](https://github.com/SwiftyLab/MetaCodable/compare/v1.4.0...v1.5.0) (2025-07-08)
216

317

MetaCodableHelperCoders.podspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ Pod::Spec.new do |s|
44
s.module_name = "HelperCoders"
55
s.define
66
s.dependency 'MetaCodableMacro', "= #{s.version}"
7+
8+
s.pod_target_xcconfig = {
9+
'OTHER_SWIFT_FLAGS' => "-Xfrontend -package-name -Xfrontend MetaCodable",
10+
}
711
end

MetaCodableMacro.podspec

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ Pod::Spec.new do |s|
2828
:execution_position => :before_compile
2929
}
3030

31-
xcconfig = {
31+
s.user_target_xcconfig = {
3232
'OTHER_SWIFT_FLAGS' => "-Xfrontend -load-plugin-executable -Xfrontend #{plugin_path}",
3333
'METACODABLE_PLUGIN_BUILD_ENVIRONMENT' => 'METACODABLE_BEING_USED_FROM_COCOAPODS=true'
3434
}
35-
s.user_target_xcconfig = xcconfig
36-
s.pod_target_xcconfig = xcconfig
35+
s.pod_target_xcconfig = {
36+
'OTHER_SWIFT_FLAGS' => "-Xfrontend -load-plugin-executable -Xfrontend #{plugin_path} -Xfrontend -package-name -Xfrontend MetaCodable",
37+
'METACODABLE_PLUGIN_BUILD_ENVIRONMENT' => 'METACODABLE_BEING_USED_FROM_COCOAPODS=true'
38+
}
3739
end

Package.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ let package = Package(
3535
.product(name: "SwiftDiagnostics", package: "swift-syntax"),
3636
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
3737
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
38+
.product(name: "SwiftSyntaxMacroExpansion", package: "swift-syntax"),
3839
.product(name: "OrderedCollections", package: "swift-collections"),
3940
]
4041
),
@@ -47,6 +48,7 @@ let package = Package(
4748
.product(name: "SwiftSyntax", package: "swift-syntax"),
4849
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
4950
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
51+
.product(name: "SwiftSyntaxMacroExpansion", package: "swift-syntax"),
5052
]
5153
),
5254
.target(name: "MetaCodable", dependencies: ["MacroPlugin"]),

Package@swift-5.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let package = Package(
2020
.plugin(name: "MetaProtocolCodable", targets: ["MetaProtocolCodable"]),
2121
],
2222
dependencies: [
23-
.package(url: "https://github.com/swiftlang/swift-syntax.git", "509.1.0"..<"602.0.0"),
23+
.package(url: "https://github.com/swiftlang/swift-syntax.git", "509.1.0"..<"603.0.0"),
2424
.package(url: "https://github.com/apple/swift-collections.git", from: "1.0.4"),
2525
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.2"),
2626
],
@@ -34,6 +34,7 @@ let package = Package(
3434
.product(name: "SwiftDiagnostics", package: "swift-syntax"),
3535
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
3636
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
37+
.product(name: "SwiftSyntaxMacroExpansion", package: "swift-syntax"),
3738
.product(name: "OrderedCollections", package: "swift-collections"),
3839
]
3940
),
@@ -46,6 +47,7 @@ let package = Package(
4647
.product(name: "SwiftSyntax", package: "swift-syntax"),
4748
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
4849
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
50+
.product(name: "SwiftSyntaxMacroExpansion", package: "swift-syntax"),
4951
]
5052
),
5153
.target(name: "MetaCodable", dependencies: ["MacroPlugin"]),

Sources/MacroPlugin/Definitions.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ struct UnTagged: PeerMacro {
707707
/// implementation depending on the type of attached declaration:
708708
/// * `struct`/`class`/`enum`/`actor` types: Expansion of `Decodable`
709709
/// protocol conformance members.
710-
public struct ConformDecodable: MemberMacro, ExtensionMacro {
710+
struct ConformDecodable: MemberMacro, ExtensionMacro {
711711
/// Expand to produce members for `Decodable`.
712712
///
713713
/// Membership macro expansion for `ConformDecodable` macro
@@ -719,7 +719,7 @@ public struct ConformDecodable: MemberMacro, ExtensionMacro {
719719
/// - context: The context in which to perform the macro expansion.
720720
///
721721
/// - Returns: Delegated member expansion from `PluginCore.ConformDecodable`.
722-
public static func expansion(
722+
static func expansion(
723723
of node: AttributeSyntax,
724724
providingMembersOf declaration: some DeclGroupSyntax,
725725
in context: some MacroExpansionContext
@@ -743,7 +743,7 @@ public struct ConformDecodable: MemberMacro, ExtensionMacro {
743743
/// - context: The context in which to perform the macro expansion.
744744
///
745745
/// - Returns: Delegated member expansion from `PluginCore.ConformDecodable`.
746-
public static func expansion(
746+
static func expansion(
747747
of node: AttributeSyntax,
748748
providingMembersOf declaration: some DeclGroupSyntax,
749749
conformingTo protocols: [TypeSyntax],
@@ -769,7 +769,7 @@ public struct ConformDecodable: MemberMacro, ExtensionMacro {
769769
/// - context: The context in which to perform the macro expansion.
770770
///
771771
/// - Returns: Delegated extension expansion from `PluginCore.ConformDecodable`.
772-
public static func expansion(
772+
static func expansion(
773773
of node: AttributeSyntax,
774774
attachedTo declaration: some DeclGroupSyntax,
775775
providingExtensionsOf type: some TypeSyntaxProtocol,
@@ -791,7 +791,7 @@ public struct ConformDecodable: MemberMacro, ExtensionMacro {
791791
/// implementation depending on the type of attached declaration:
792792
/// * `struct`/`class`/`enum`/`actor` types: Expansion of `Encodable`
793793
/// protocol conformance members.
794-
public struct ConformEncodable: MemberMacro, ExtensionMacro {
794+
struct ConformEncodable: MemberMacro, ExtensionMacro {
795795
/// Expand to produce members for `Encodable`.
796796
///
797797
/// Membership macro expansion for `ConformEncodable` macro
@@ -803,7 +803,7 @@ public struct ConformEncodable: MemberMacro, ExtensionMacro {
803803
/// - context: The context in which to perform the macro expansion.
804804
///
805805
/// - Returns: Delegated member expansion from `PluginCore.ConformEncodable`.
806-
public static func expansion(
806+
static func expansion(
807807
of node: AttributeSyntax,
808808
providingMembersOf declaration: some DeclGroupSyntax,
809809
in context: some MacroExpansionContext
@@ -827,7 +827,7 @@ public struct ConformEncodable: MemberMacro, ExtensionMacro {
827827
/// - context: The context in which to perform the macro expansion.
828828
///
829829
/// - Returns: Delegated member expansion from `PluginCore.ConformEncodable`.
830-
public static func expansion(
830+
static func expansion(
831831
of node: AttributeSyntax,
832832
providingMembersOf declaration: some DeclGroupSyntax,
833833
conformingTo protocols: [TypeSyntax],
@@ -853,7 +853,7 @@ public struct ConformEncodable: MemberMacro, ExtensionMacro {
853853
/// - context: The context in which to perform the macro expansion.
854854
///
855855
/// - Returns: Delegated extension expansion from `PluginCore.ConformEncodable`.
856-
public static func expansion(
856+
static func expansion(
857857
of node: AttributeSyntax,
858858
attachedTo declaration: some DeclGroupSyntax,
859859
providingExtensionsOf type: some TypeSyntaxProtocol,

Sources/MetaCodable/MetaCodable.docc/Limitations.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,13 @@ enum SomeEnum {
6161
}
6262
```
6363

64-
### Why enums with raw value aren't supported?
65-
66-
`Swift` compiler by default generates `Codable` conformance for `enum`s with raw value and `MetaCodable` has nothing extra to add for these type of `enum`s. Hence, in this case the default compiler generated implementation can be used.
67-
6864
### Why actor conformance to Encodable not generated?
6965

7066
For `actor`s ``Codable(commonStrategies:)`` generates `Decodable` conformance, while `Encodable` conformance isn't generated, only `encode(to:)` method implementation is generated which is isolated to `actor`.
7167

7268
To generate `Encodable` conformance, the `encode(to:)` method must be `nonisolated` to `actor`, and since `encode(to:)` method must be synchronous making it `nonisolated` will prevent accessing mutable properties.
7369

74-
Due to these limitations, `Encodable` conformance isn't generated, users has to implement the conformance manually.
70+
Due to these limitations, `Encodable` conformance isn't generated, users have to implement the conformance manually.
7571

7672
### Why MetaProtocolCodable plugin can't scan Xcode target dependencies?
7773

Sources/MetaCodable/MetaCodable.docc/MetaCodable.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Supercharge `Swift`'s `Codable` implementations with macros.
1010

1111
`MetaCodable` framework exposes custom macros which can be used to generate dynamic `Codable` implementations. The core of the framework is ``Codable(commonStrategies:)`` macro which generates the implementation aided by data provided with using other macros.
1212

13-
1413
`MetaCodable` aims to supercharge your `Codable` implementations by providing these inbox features:
1514

1615
- Allows custom `CodingKey` value declaration per variable with ``CodedAt(_:)`` passing single argument, instead of requiring you to write all the `CodingKey` values.

0 commit comments

Comments
 (0)