faker
faker copied to clipboard
refactor: rename module class names
closes #778
Codecov Report
Merging #932 (4b88870) into main (1fe2877) will decrease coverage by
0.00%. The diff coverage is100.00%.
@@ Coverage Diff @@
## main #932 +/- ##
==========================================
- Coverage 99.62% 99.62% -0.01%
==========================================
Files 2163 2163
Lines 241242 241264 +22
Branches 1014 1011 -3
==========================================
+ Hits 240335 240354 +19
- Misses 886 889 +3
Partials 21 21
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/faker.ts | 100.00% <100.00%> (ø) |
|
| src/index.ts | 100.00% <100.00%> (ø) |
|
| src/modules/address/index.ts | 99.82% <100.00%> (ø) |
|
| src/modules/animal/index.ts | 100.00% <100.00%> (ø) |
|
| src/modules/color/index.ts | 99.73% <100.00%> (ø) |
|
| src/modules/commerce/index.ts | 100.00% <100.00%> (ø) |
|
| src/modules/company/index.ts | 100.00% <100.00%> (ø) |
|
| src/modules/database/index.ts | 100.00% <100.00%> (ø) |
|
| src/modules/datatype/index.ts | 96.24% <100.00%> (ø) |
|
| src/modules/date/index.ts | 99.10% <100.00%> (-0.01%) |
:arrow_down: |
| ... and 19 more |
https://github.com/faker-js/faker/discussions/805#discussioncomment-2599628
@pkuczynski Could you go through this PR/code and reevaluate if you REALLY want to have the modules renamed not to suffixed with Module? I still don't think your initial thought that it could conflict with node's modules is valid in any case.
Beside that, I personally find it confusing to name modules everywhere modules but then the module itself is not named module but faker were it actually is not e.g. a sub-instance of Faker.
It can be even more confusing if we have later a MinimalFaker, BaseFaker, Faker. (See https://github.com/faker-js/faker/discussions/805#discussioncomment-2690233)
And then we would even have a FakeFaker 👀 confusing like hell 🤷
not to suffixed with Module?
I think so too, it should be named like what it does and not what generically is.
Also in the long run, a module will never be independent, a xxxFaker might.
And then we would even have a
FakeFaker👀 confusing like hell 🤷
No, because fake -> helpers.fake
Would it be possible to integrate this change as a non-breaking change? Maybe with some proxy magic and deprecation of the current classes (in the constructor)?
Would it be possible to integrate this change as a non-breaking change? Maybe with some proxy magic and deprecation of the current classes (in the constructor)?
The classes have never been part of the API, so not sure if that is worth it.
Team decision
We will use XyzModule.