Swift Package + WorkspaceClient module #14
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR would introduce a modularization to CodeEdit. I've created a local Swift Package (inside the
CodeEditModules
folder) which would contain all our module targets. As an example I've built aWorkspaceClient
which is mockable client that gives the ability to retrieve the list of files in a given directory. This target has a testTarget too.Architecturing the app in this way it would help us building the app in a more dynamic and easy way. Each target can be built independently.
Building clients in a composable way would give us the ability to mock each module easily.
For example a simple mock I've created is the
.empty
one, let's say we want to test an empty workspace we can simply replace the.default
initialization on our main app with the empty one!Note: The logic for retrieving the list of files is a re-implementation of the already-built
Workspace
, I haven't changed the actual logic. The test introduced is just a simple test we might/should add more tests.