jsoncrack.com icon indicating copy to clipboard operation
jsoncrack.com copied to clipboard

refactor: File organization for easier component discovery

Open michyaraque opened this issue 2 years ago • 1 comments

Overview

I found that it became increasingly difficult to locate components in the project as the code base grew. To fix this problem, I have updated the folder structure to better reflect the organization of the components.

The main change has been to change from [Component]/index.tsx to [Components]/[Component.tsx and in turn include an index.ts file that serves as an entry point so that it can be imported in a consistent manner. This should make it easier to find and reuse these components in the future.

I have also taken the opportunity to change the format in which the files are imported into the ModelController by unifying all the modals is the index.ts so they can all be imported from Modals/~.

I think this refactoring will make the development process smoother and more efficient for everyone.

This PR is related to: #292

Discoverability example

Old way

Code_YX6RDZCzTz

New way

Code_IL5I8dIx1A

michyaraque avatar Jan 07 '23 14:01 michyaraque

It's easier through IDE navigation, however it creates extra effort and file to be maintained.

AykutSarac avatar Jan 12 '23 14:01 AykutSarac

Thanks for the PR, however I believe current architecture fits better for the project overall.

AykutSarac avatar May 18 '23 09:05 AykutSarac