StanfordSpezi / SpeziAccount

The Spezi Account module to enable login and signup functionality
https://swiftpackageindex.com/StanfordSpezi/SpeziAccount/documentation/
MIT License
5 stars 5 forks source link

Refactor package structure #19

Open Supereg opened 12 months ago

Supereg commented 12 months ago

Problem

Currently, SpeziAccount houses a lot of components that are not specific to SpeziAccount and might be reused across other Spezi packages. Further, all API surfaces are currently exposed within a single target.

Solution

There might be Views or Infrastructure that either can

  1. ... be exposed as a separate target or ...
  2. ... be move to more general Spezi Packages (like Spezi or SpeziViews).

The following is a non-exhaustive list of components that can be moved out of SpeziAccount:

Further, one could split up SpeziAccount into multiple targets. A potential distribution could look as follows:

Particularly one could structure it as follows:

  1. AccountService (everything you need to build an account service)
  2. Mock Account Service (depends on Account Service)
  3. Account Module (only @_implementationOnly imports Mock Account for the previews, and imports AccountService while only exposing (not sure if @_implementationOnly would work there, otherwise we just normally import it which only results into a few types being exposed)

Additional context

No response

Code of Conduct