Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize codebase #230

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Reorganize codebase #230

merged 1 commit into from
Mar 1, 2024

Conversation

mcmire
Copy link
Collaborator

@mcmire mcmire commented Feb 24, 2024

In attempting to detail the architecture of this codebase, I realized that it would be easier if the parts of SuperDiff that implemented differs, inspection tree builders, operation tree builders, operation tree flatteners, and operation trees for Ruby objects were split off into their own directory. To that end, alongside RSpec, ActiveRecord, and ActiveSupport, there is now a "Basic" feature module. In addition, to make the file structure a little flatter, I've also renamed InspectionTreeBuilders in various feature modules up one level (so, ObjectInspection::InspectionTreeBuilders is now simply InspectionTreeBuilders).

Following this change, SuperDiff can now be divided into 4 layers (here I'm putting CSI in brackets because it's not a public module):

          ----------------- [SuperDiff::CSI]
        /                     /     |
       /           SuperDiff::Core ----------------------
      |              /    |     \   |                    \
      |       /^^^^^^     |  SuperDiff::Basic             \
      |      /            |   /     |     \                \
      |     | /^^^^^^^^^^^|^^^^     |      ^^^^^^^^^^^^^\   \
SuperDiff::RSpec         SuperDiff::ActiveRecord     SuperDiff::ActiveSupport

Here is a full list of renames:

  • The following constants that were previously available under SuperDiff are now located under SuperDiff::Core:
    • ColorizedDocumentExtensions
    • Configuration
    • GemVersion
    • Helpers
    • ImplementationChecks
    • Line
    • RecursionGuard
    • TieredLines
    • TieredLinesElider
    • TieredLinesFormatter
  • Everything under SuperDiff::Differs is now under SuperDiff::Basic::Differs
  • All error classes under SuperDiff::Errors have been moved out and are now directly under SuperDiff::Core
  • SuperDiff::ObjectInspection::InspectionTree is now SuperDiff::Core::InspectionTree
  • Everything under SuperDiff::ObjectInspection::InspectionTreeBuilders is now under SuperDiff::Core::InspectionTreeBuilders
  • Everything under SuperDiff::ObjectInspection::Nodes is now under SuperDiff::Core::InspectionTreeNodes
  • Everything under SuperDiff::OperationTreeBuilders is now under SuperDiff::Basic::OperationTreeBuilders
  • Everything under SuperDiff::OperationTreeFlatteners is now under SuperDiff::Basic::OperationTreeFlatteners
  • Everything under SuperDiff::OperationTrees is now under SuperDiff::Basic::OperationTrees
  • Everything under SuperDiff::Operations has been moved out and is now directly under SuperDiff::Core
  • Everything under SuperDiff::ActiveRecord::ObjectInspection::InspectionTreeBuilders is now under SuperDiff::ActiveRecord::InspectionTreeBuilders
  • Everything under SuperDiff::ActiveSupport::ObjectInspection::InspectionTreeBuilders is now under SuperDiff::ActiveSupport::InspectionTreeBuilders
  • Everything under SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders is now under SuperDiff::RSpec::InspectionTreeBuilders

To maintain backward compatibility, I've left all of the original constants in place, but they will now print deprecation warnings when used. I will remove them in 1.0.0.

In attempting to detail the architecture of this codebase, I realized
that it would be easier if the parts of SuperDiff that implemented
differs, inspection tree builders, operation tree builders, operation
tree flatteners, and operation trees for Ruby objects were split
off into their own directory. To that end, alongside RSpec,
ActiveRecord, and ActiveSupport, there is now a "Basic" feature module.
In addition, to make the file structure a little flatter, I've also
renamed `InspectionTreeBuilders` in various feature modules up one level
(so, `ObjectInspection::InspectionTreeBuilders` is now simply
`InspectionTreeBuilders`).

Following this change, SuperDiff can now be divided into 4 layers (here
I'm putting CSI in brackets because it's not a public module):

```
          ----------------- [SuperDiff::CSI]
        /                     /     |
       /           SuperDiff::Core ----------------------
      |              /    |     \   |                    \
      |       /^^^^^^     |  SuperDiff::Basic             \
      |      /            |   /     |     \                \
      |     | /^^^^^^^^^^^|^^^^     |      ^^^^^^^^^^^^^\   \
SuperDiff::RSpec         SuperDiff::ActiveRecord     SuperDiff::ActiveSupport
```

Here is a full list of renames:

- The following constants that were previously available under
  `SuperDiff` are now located under `SuperDiff::Core`:
  - `ColorizedDocumentExtensions`
  - `Configuration`
  - `GemVersion`
  - `Helpers`
  - `ImplementationChecks`
  - `Line`
  - `RecursionGuard`
  - `TieredLines`
  - `TieredLinesElider`
  - `TieredLinesFormatter`
- Everything under `SuperDiff::Differs` is now under
  `SuperDiff::Basic::Differs`
- All error classes under `SuperDiff::Errors` have been moved out
  and are now directly under `SuperDiff::Core`
- `SuperDiff::ObjectInspection::InspectionTree` is now
  `SuperDiff::Core::InspectionTree`
- Everything under `SuperDiff::ObjectInspection::InspectionTreeBuilders`
  is now under `SuperDiff::Core::InspectionTreeBuilders`
- Everything under `SuperDiff::ObjectInspection::Nodes` is now under
  `SuperDiff::Core::InspectionTreeNodes`
- Everything under `SuperDiff::OperationTreeBuilders` is now under
  `SuperDiff::Basic::OperationTreeBuilders`
- Everything under `SuperDiff::OperationTreeFlatteners` is now under
  `SuperDiff::Basic::OperationTreeFlatteners`
- Everything under `SuperDiff::OperationTrees` is now under
  `SuperDiff::Basic::OperationTrees`
- Everything under `SuperDiff::Operations` has been moved out
  and is now directly under `SuperDiff::Core`
- Everything under `SuperDiff::ActiveRecord::ObjectInspection::InspectionTreeBuilders`
  is now under `SuperDiff::ActiveRecord::InspectionTreeBuilders`
- Everything under `SuperDiff::ActiveSupport::ObjectInspection::InspectionTreeBuilders`
  is now under `SuperDiff::ActiveSupport::InspectionTreeBuilders`
- Everything under `SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders`
  is now under `SuperDiff::RSpec::InspectionTreeBuilders`

To maintain backward compatibility, I've left all of the original
constants in place, but they will now print deprecation warnings when
used. I will remove them in 1.0.0.
@mcmire mcmire merged commit fc418c1 into main Mar 1, 2024
33 checks passed
@mcmire mcmire deleted the reorganize branch March 1, 2024 07:08
@mcmire mcmire changed the title WIP - Reorganize Reorganize codebase Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant