Skip to content

Convert to a Swift Package Manager package and modernize the codebase - #1

Open
EmadBeyrami wants to merge 3 commits into
mainfrom
claude/spm-migration-framework-updates-91wowy
Open

Convert to a Swift Package Manager package and modernize the codebase#1
EmadBeyrami wants to merge 3 commits into
mainfrom
claude/spm-migration-framework-updates-91wowy

Conversation

@EmadBeyrami

Copy link
Copy Markdown
Owner
  • Add Package.swift with two library products (Timerable, RxTimerable)
    and move sources into the standard Sources/ layout.
  • Bump the RxSwift dependency to 6.10.2 and use the current RxSwift/
    RxCocoa APIs.
  • Mark the public API surface public (protocols, models, TimeCounter,
    TimeBuilder) — previously everything was internal, so the library
    couldn't actually be consumed from another module.
  • Fix a crash-on-deinit when a TimeCounter is deallocated before
    setTimer(time:) is called.
  • Replace the Foundation %@ String(format:) formatting with plain
    string interpolation, replace the Sequence where Self == [T]
    constraint with Array where Element == T, and clean up naming
    (backgroundForegroundTimelapse, matching file headers).
  • Add TimerType: Equatable and basic unit tests for both targets.
  • Add a Swift/Xcode .gitignore and rewrite the README with SPM
    installation instructions and updated version badges.

claude added 3 commits July 30, 2026 11:23
- Add Package.swift with two library products (Timerable, RxTimerable)
  and move sources into the standard Sources/<target> layout.
- Bump the RxSwift dependency to 6.10.2 and use the current RxSwift/
  RxCocoa APIs.
- Mark the public API surface `public` (protocols, models, TimeCounter,
  TimeBuilder) — previously everything was internal, so the library
  couldn't actually be consumed from another module.
- Fix a crash-on-deinit when a TimeCounter is deallocated before
  setTimer(time:) is called.
- Replace the Foundation `%@` String(format:) formatting with plain
  string interpolation, replace the `Sequence where Self == [T]`
  constraint with `Array where Element == T`, and clean up naming
  (backgroundForegroundTimelapse, matching file headers).
- Add TimerType: Equatable and basic unit tests for both targets.
- Add a Swift/Xcode .gitignore and rewrite the README with SPM
  installation instructions and updated version badges.
…w AsyncTimerable target

- Sources/Timerable/TimeCounter+Async.swift: adds
  TimeCounter.start(with:) -> AsyncStream<TimeModel> on top of the
  existing closure-based API, so `bind`/`timerDidEnd` and `for await`
  can be used interchangeably.
- New AsyncTimerable target: a from-scratch Concurrency-native
  implementation (Task-based ticking, AsyncStream<TimeModel>,
  NotificationCenter.notifications(named:) for background/foreground
  correction instead of the observer pattern) — no closures, no
  RxSwift. Same Timerable/TimeDecreasing/TimeIncreasing shape as the
  other targets.
- Wire the new target into Package.swift as a third library product
  with its own test target, and bump the package's platform floor to
  iOS 15/tvOS 15 (required by NotificationCenter's async sequence API).
- Document both async paths in the README.
Example/TimerableExample.xcodeproj is a SwiftUI app with one tab per
API: closures (Timerable), the AsyncStream wrapper on Timerable,
RxTimerable, and the Concurrency-native AsyncTimerable. It links to
this repo as a local Swift Package (path: ..), so it always builds
against the current source, not a tagged release.

The example app targets iOS 16 (for NavigationStack) even though the
package itself only requires iOS 15 — a consumer's deployment target
can be higher than the library's floor.

Document the example in the README.
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