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

refactor!: reorganize src folder #909

Merged
merged 10 commits into from
May 3, 2022

Conversation

Shinigami92
Copy link
Member

No description provided.

@Shinigami92 Shinigami92 self-assigned this May 3, 2022
@Shinigami92 Shinigami92 linked an issue May 3, 2022 that may be closed by this pull request
@Shinigami92 Shinigami92 added p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs labels May 3, 2022
@Shinigami92 Shinigami92 changed the title refactor: reorganize src folder refactor!: reorganize src folder May 3, 2022
@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #909 (e493433) into main (cc46a0c) will decrease coverage by 0.00%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main     #909      +/-   ##
==========================================
- Coverage   99.13%   99.13%   -0.01%     
==========================================
  Files        1958     1958              
  Lines      210788   210793       +5     
  Branches      907      906       -1     
==========================================
- Hits       208971   208964       -7     
- Misses       1741     1753      +12     
  Partials       76       76              
Impacted Files Coverage Δ
src/definitions/internet.ts 0.00% <0.00%> (ø)
src/modules/finance/iban.ts 100.00% <ø> (ø)
src/modules/mersenne/twister.ts 95.93% <ø> (ø)
src/utils/types.ts 0.00% <0.00%> (ø)
src/index.ts 97.50% <50.00%> (ø)
src/faker.ts 92.96% <100.00%> (-0.11%) ⬇️
src/modules/address/index.ts 99.79% <100.00%> (ø)
src/modules/animal/index.ts 100.00% <100.00%> (ø)
src/modules/commerce/index.ts 100.00% <100.00%> (ø)
src/modules/company/index.ts 100.00% <100.00%> (ø)
... and 28 more

@Shinigami92 Shinigami92 marked this pull request as ready for review May 3, 2022 07:54
@Shinigami92 Shinigami92 requested a review from a team as a code owner May 3, 2022 07:54
ST-DDT
ST-DDT previously approved these changes May 3, 2022
@Shinigami92 Shinigami92 requested review from a team May 3, 2022 08:51
ST-DDT
ST-DDT previously approved these changes May 3, 2022
@ST-DDT ST-DDT requested a review from a team May 3, 2022 09:20
@xDivisionByZerox
Copy link
Member

xDivisionByZerox commented May 3, 2022

While we at it: Should we provide a directory for each module? Like address.ts would be located in src/modules/address/address.ts (or index.ts). That would allow us to scope additional requirements for this module in this directory, for example image-providers in the modules/image directory.

@xDivisionByZerox
Copy link
Member

xDivisionByZerox commented May 3, 2022

While we at it: Should we provide a directory for each module? Like address.ts would be located in src/modules/address/address.ts (or index.ts). That would allow us to scope additional requirements for this module in this directory, for example image-providers in the modules/image directory.

This could be a bit overkill for most modules for now, but should give more reliability in the future (perhaps, IDK TBH) since files can be added more easily.

@ST-DDT
Copy link
Member

ST-DDT commented May 3, 2022

I don't think we should do it for all modules, but maybe for all that would benefit from it?
AFAICT there isn't much difference between import from address.ts and address/index.ts so it should be save to update/change later on.

@xDivisionByZerox
Copy link
Member

The difference would be that we would not lose file history again if we need to reorganize since all files are already in their own module directory.

@Shinigami92
Copy link
Member Author

To be fair, I had the same idea as @xDivisionByZerox 🤔
Also maybe we would e.g. split every function into it's own file but let them in their "scopes" (in a far far away future)
It's just more future proof

@Shinigami92 Shinigami92 marked this pull request as draft May 3, 2022 10:05
@ST-DDT ST-DDT added s: needs decision Needs team/maintainer decision s: accepted Accepted feature / Confirmed bug and removed s: needs decision Needs team/maintainer decision labels May 3, 2022
Copy link
Member

@ST-DDT ST-DDT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename src/modules/mersenne/mersenne.ts to something like src/modules/mersenne/twister.ts to reduce some confusion.

@pkuczynski
Copy link
Member

I use this pattern also at my work for a NestJS application. But if we want that, let's do it in a separate PR as it is not that important as the src files itself.

Sure! It should be done in a separate PR. I was just giving a rationale why its worth to have subfolders.

pkuczynski
pkuczynski previously approved these changes May 3, 2022
pkuczynski
pkuczynski previously approved these changes May 3, 2022
ST-DDT
ST-DDT previously approved these changes May 3, 2022
Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to change the test directory at all? Otherwise, the PR title could be confusing. So either revert the test changes from the current PR or change the title, please.

@ST-DDT
Copy link
Member

ST-DDT commented May 3, 2022

Yeah, moving the tests twice is kind of redundant.
It is also kind of consistent to have a similar structure for both src and test, even though the tests will be moved again shortly.

@Shinigami92 Shinigami92 dismissed stale reviews from ST-DDT and pkuczynski via e493433 May 3, 2022 13:38
@Shinigami92
Copy link
Member Author

I extracted the test restructure into its own issue: #911

@Shinigami92 Shinigami92 merged commit a2da7c4 into main May 3, 2022
@Shinigami92 Shinigami92 deleted the 751-reorganize-src-folder-structure branch May 3, 2022 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Reorganize src folder structure
4 participants