Skip to content

Use FoundationEssentials#683

Merged
adam-fowler merged 9 commits intomainfrom
foundation-essentials
Feb 20, 2026
Merged

Use FoundationEssentials#683
adam-fowler merged 9 commits intomainfrom
foundation-essentials

Conversation

@adam-fowler
Copy link
Member

@adam-fowler adam-fowler commented Feb 17, 2026

These changes are all the easy ones where it is basically a swap out of the original import Foundation, plus dropping the iso8601 dateformatter

This is taking on the task @t089 started. This PR will include just the easy conversions first. I'll do others in separate PRs.

@adam-fowler adam-fowler requested a review from 0xTim as a code owner February 17, 2026 17:04
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 64.86486% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.27%. Comparing base (510e4ca) to head (c80b4ac).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Sources/SotoXML/XMLDecoder.swift 55.55% 8 Missing ⚠️
Sources/SotoXML/XMLEncoder.swift 57.14% 3 Missing ⚠️
...s/SotoCore/Credential/Login/TokenFileManager.swift 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #683      +/-   ##
==========================================
- Coverage   80.48%   80.27%   -0.21%     
==========================================
  Files          88       88              
  Lines        6158     6170      +12     
==========================================
- Hits         4956     4953       -3     
- Misses       1202     1217      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

These changes are all the easy ones where it is basically a swap out of the origin import Foundation, plus dropping the iso8601 dateformatter
@adam-fowler adam-fowler force-pushed the foundation-essentials branch from a855c4d to cc334c8 Compare February 18, 2026 10:52
@adam-fowler
Copy link
Member Author

adam-fowler commented Feb 18, 2026

Oh this is going to be fun. Check out the dance that is needed to able to use FormatStyles from FoundationEssentials

#if canImport(FoundationEssentials)
return XML.Element(name: self.currentKey, stringValue: date.formatted(Date.ISO8601FormatStyle(includingFractionalSeconds: true)))
#else
if #available(iOS 15, macOS 12, tvOS 15, watchOS 8, *) {
return XML.Element(name: self.currentKey, stringValue: date.formatted(Date.ISO8601FormatStyle(includingFractionalSeconds: true)))
} else {
let formatterWithSeconds = ISO8601DateFormatter()
formatterWithSeconds.formatOptions = [.withFullDate, .withFullTime, .withFractionalSeconds]
return XML.Element(name: self.currentKey, stringValue: formatterWithSeconds.string(from: date))
}
#endif

Not truly necessary but we can do it
@adam-fowler adam-fowler merged commit da0b8ba into main Feb 20, 2026
8 of 10 checks passed
@adam-fowler adam-fowler deleted the foundation-essentials branch February 20, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants