20 curated breaking changes across major versions of Peek-Travel/swift-currency. Use this as a migration checklist before bumping dependencies.
The minimum Swift version is now 5.7
The package has been renamed to `swift-currency`
`CurrencyProcotol` and `AnyCurrency` have been removed and replaced with an almost drop-in replacement of `CurrencyValue`
The biggest change is from `minorUnits` being the stored property to `exactAmount`
`CurrencyMetadata` has been renamed to `CurrencyDescriptor`
Currency localization is now easier to use with `localizedString` methods on `AnyCurrency` that reflect the String interpolation API (#34)
The String interpolation methods `(localize:forLocale:nilDescription:)` and `(localize:withFormatter:nilDescription:)` have had their 2nd parameters renamed to `for:` and `with:` respectively.
CurrencyMint has been refactored to be more flexible for 3rd party currencies (#21)
The protocol hierarchy implementation of `AnyCurrency` and `CurrencyProtocol` has been reimplemented to resolve incorrect Swift semantics (#25)
The most notable breaking changes are to initializers:
`init(minorUnits)` is now generic on `BinaryInteger`
`init(_:)` is now failable and requires the `amount:` label
The `inverseAmount` computed property is now a method named `negated()`
`AnyCurrency` storage is now "minorUnits" https://github.com/peek-travel/swift-currency/commit/44425d8fee78044797419525cf25b19860e7b7d8
`AnyCurrency` now uses `Int64` "minorUnits" as the underlying storage instead of `Foundation.Decimal` "exactAmount"
`AnyCurrency.roundedAmount` is now `amount`
`AnyCurrency.init(minorUnits:)` is now `.init(exactly:)`
This is now required by the `AnyCurrency` protocol
`Money` was renamed to `AnyCurrency`
The `currency` property was renamed to `metadata`
Get this data programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/breaking/swift/Peek-Travel/swift-currency