Refactor modules structure to make it more domain-related instead of function-related #1071
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.
Changelog
Context
Change to domain-related modules structure
The present cardano-cli modules structure is as follows:
it's spread across many different modules:
Commands.Governance
,Options.Governance
,Run.Governance
and multipleTypes.Errors.GovernanceXXX
. So right now you have to jump between different places to find code related toCommittee
, which is cumbersome.Any future refactoring related to a single command would also require changes in three different places.
This PR changes the structure by 90 degrees and putting code into separate-ish domains instead, for example changing the above structure into this:
(We could get rid of
EraBased
if there's a more elegant alternative).This way you have everything related to a single command in one place which makes codebase easier to understand.
Aggregation of era independent commands
Additionally, era independent commands like
address
orhash
are placed intoCardano.CLI.EraIndependent
module to reduce clutter inCardano.CLI
module.Use of singular nouns for module names
All module names which had plural nouns are renamed to use singular nouns in their names.
Comparison
Before:

After:

Checklist