Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: inject io only (#391) Currently we inject all sorts of functions into all sorts of functions. After reading a few articles about dependency injection, I have come to the conclusion that it would be better if we only inject IO function and build all other services in-place or just inline them. We now have four layers in the app (which I will also document in a dev guide soon) - Domain: Pure logic related to the problem domain - IO: Functions for interacting with external systems, like the network or the fs. - App: Utility functions which combine IO functions into reusable compositions. - CLI: CLI specific code. Sources for this decision were the great articles by Mark Seemann: - https://blog.ploeh.dk/2017/02/02/dependency-rejection/ - https://blog.ploeh.dk/2017/01/30/partial-application-is-dependency-injection/ - https://blog.ploeh.dk/2017/01/27/dependency-injection-is-passing-an-argument/ - https://blog.ploeh.dk/2017/01/27/from-dependency-injection-to-dependency-rejection/ - https://blog.ploeh.dk/2017/01/03/decoupling-application-errors-from-domain-models/ - https://blog.ploeh.dk/2023/10/02/dependency-whac-a-mole/ * refactor: dependency add logic Extract imperative non-cli logic to own function. This way it can be tested in integration tests without the cli. Actual functionality was only changed minimally. * refactor: rename files Rename files to better be in line with other file names * fix: missing log * fix: incorrect log level * fix: incorrect log message * conf: eslint Specify project tsconfig * conf: eslint Unawaited promises are errors * refactor: debug-loggin Make debug loggin async. This will make it easier to write to a file if we want to and also makes it clear that logging is an IO operation. * conf: jsdoc eslint require jsdoc for public constants and variables * docs: add missing jsdoc * refactor: simplify project structure Fewer directories and files. Move things closer together and delete unused things * deps: bump typescript Hopefully get some performance and refactor improvements without any breaking changes * refactor: cleanup io Make io modules only contain abstractions of external io logic. Move all other code either into domain (if it is pure) or app (if it is impure)
- Loading branch information