square / Cleanse

Lightweight Swift Dependency Injection Framework
Other
1.78k stars 90 forks source link

Add Resolver Step to cleansec #141

Closed sebastianv1 closed 4 years ago

sebastianv1 commented 4 years ago

The resolver is ultimately responsible for reporting back if there are any graph errors. Currently, the resolver supports the following validatoins:

For parity with existing Cleanse runtime validations, the last validation needed is to detect cyclical dependencies.

The resolver takes in a LinkedInterface instance emitted from the Linker pipeline step, and outputs a list of ResolvedComponent instances for each root component in the provided interface. This ResolvedComponent type holds the DAG and any diagnostics (errors) found while performing resolution. The ResolvedComponent instance does not necessarily emit a complete graph, as there can be errors.