-
Notifications
You must be signed in to change notification settings - Fork 8
Add CodableKitCore Shared Options Target #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the CodableKit package architecture by extracting shared option set definitions into a new CodableKitCore target, eliminating code duplication between runtime and macro implementations. The refactoring ensures consistency of option definitions across both contexts while maintaining backward compatibility through typealiases.
Key changes:
- Created new
CodableKitCoretarget containing canonical definitions ofCodableKeyOptionsandCodableOptions - Updated package dependencies to establish proper target relationships
- Replaced local implementations in both runtime and macro code with imports and typealiases
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Package.swift |
Adds CodableKitCore target and wires up dependencies for CodableKit and CodableKitMacros |
Sources/CodableKitCore/CodableOptions.swift |
New file containing canonical public definition of CodableOptions with documentation |
Sources/CodableKitCore/CodableKeyOptions.swift |
New file containing canonical public definition of CodableKeyOptions with documentation |
Sources/CodableKit/CodableOptions.swift |
Replaced struct definition with typealias to CodableKitCore.CodableOptions |
Sources/CodableKit/CodableKeyOptions.swift |
Replaced struct definition with typealias to CodableKitCore.CodableKeyOptions |
Sources/CodableKit/CodableKit.swift |
Added import for CodableKitCore |
Sources/CodableKitMacros/CodableOptions.swift |
Removed local struct definition, added import of CodableKitCore |
Sources/CodableKitMacros/CodableKeyOptions.swift |
Removed local struct definition, added import of CodableKitCore |
Sources/CodableKitMacros/CodeGenCore.swift |
Added import for CodableKitCore |
Sources/CodableKitMacros/CodableMacro.swift |
Added import for CodableKitCore |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public static let skipProtocolConformance = Self(rawValue: 1 << 1) | ||
| } | ||
|
|
||
|
|
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary trailing blank line at the end of the file. This should be removed to maintain consistency with code style conventions.
|
|
||
|
|
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary trailing blank line at the end of the file. This should be removed to maintain consistency with code style conventions.
This pull request refactors the option set types used by the
CodableKitpackage, centralizing their definitions in a newCodableKitCoretarget. It replaces local implementations and compatibility shims in both runtime and macro code with imports and typealiases pointing to the canonical definitions inCodableKitCore. The package manifest is updated to add the new core target and wire up dependencies.Core library refactor and centralization:
CodableKitCoreto the package manifest, and updatedCodableKitandCodableKitMacrostargets to depend on it. (Package.swift) [1] [2]CodableKeyOptionsandCodableOptionstoSources/CodableKitCore/CodableKeyOptions.swiftandSources/CodableKitCore/CodableOptions.swift, respectively. [1] [2]Runtime code changes:
CodableKeyOptionsandCodableOptionsinSources/CodableKitwith typealiases to their core equivalents, and importedCodableKitCorewhere needed. [1] [2] [3]Macro implementation changes:
CodableKeyOptionsandCodableOptionsinSources/CodableKitMacros, replacing them with imports fromCodableKitCore. (Sources/CodableKitMacros/CodableKeyOptions.swift,Sources/CodableKitMacros/CodableOptions.swift) [1] [2]CodableKitCorefor option set usage. (Sources/CodableKitMacros/CodableMacro.swift,Sources/CodableKitMacros/CodeGenCore.swift) [1] [2]This refactor ensures that option set definitions are consistent and shared between runtime and macro code, improving maintainability and reducing duplication.