ittybittyapps / appstoreconnect-cli

An easy to use command-line tool for interacting with the Apple AppStore Connect API
MIT License
173 stars 17 forks source link

Separate concerns into targets/modules #177

Open adamjcampbell opened 4 years ago

adamjcampbell commented 4 years ago

❕ Problem Statement

Currently the main target/module AppStoreConnectCLI imports all other dependencies. As we move past simple commands into more complex synchronisation it'll be more important to separate our concerns.

💬 Task Description

Separate different concepts into their own modules, namely models and their encodings moving to Model and network calls and transformations moving to Network. This leaves the main target to deal with command line input and translating intent to the correct services to call down to. This also alleviates name collisions

👩‍🔧 Technical Design Notes

Model

Houses our concept of stored and rendered data for the CLI tool

As such model will import Yams, SwiftyTextTable and CodableCSV

Network

Takes in input options and translates these to API calls. Translates API models returned from the AppStoreConnectSDK into CLI Models to return to the caller.

Network would import Model, Combine and AppStoreConnect-Swift-SDK As this is where a lot of the logic is housed there is potential for it to be broken up further. But that could stay internal to the Network module... It's definitely the spot that would need the highest test coverage

Filesystem

Exposes functions to retrieve CLI models or write CLI models from disk

Filesystem would depend on Model and Files

AppStoreConnectSDK

Takes command line input, validates it and calls the appropriate functions on Network or Filesystem

The entrypoint to the CLI tool would import ArgumentParser, Model, Network and Filesystem

🤝 Relationships

Supersedes the domain layer concept described in #41

adamjcampbell commented 4 years ago

This is just a draft, feedback on the design is welcomed