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(locale)!: move title to metadata #1978

Merged
merged 17 commits into from
Apr 1, 2023
Merged

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Mar 26, 2023

Removes the special handling of faker.definitions.title by moving it to faker.definitions.metadata.title.
As this makes it way easier to (type) safely implement #893.

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs c: locale Permutes locale definitions labels Mar 26, 2023
@ST-DDT ST-DDT added this to the v8.0 - Module Re-Shuffling milestone Mar 26, 2023
@ST-DDT ST-DDT requested review from a team March 26, 2023 16:47
@ST-DDT ST-DDT self-assigned this Mar 26, 2023
@ST-DDT
Copy link
Member Author

ST-DDT commented Mar 26, 2023

@ST-DDT ST-DDT added the breaking change Cannot be merged when next version is not a major release label Mar 26, 2023
@ST-DDT ST-DDT changed the title refactor(locale): introduce metadata refactor!(locale): introduce metadata Mar 26, 2023
@codecov
Copy link

codecov bot commented Mar 26, 2023

Codecov Report

Merging #1978 (314ec7d) into next (dbbc785) will increase coverage by 0.00%.
The diff coverage is 94.21%.

Additional details and impacted files
@@           Coverage Diff            @@
##             next    #1978    +/-   ##
========================================
  Coverage   99.62%   99.62%            
========================================
  Files        2464     2526    +62     
  Lines      240224   240708   +484     
  Branches     1277     1277            
========================================
+ Hits       239328   239815   +487     
+ Misses        873      869     -4     
- Partials       23       24     +1     
Impacted Files Coverage Δ
src/definitions/definitions.ts 0.00% <0.00%> (ø)
src/definitions/index.ts 0.00% <0.00%> (ø)
src/definitions/metadata.ts 0.00% <0.00%> (ø)
src/index.ts 100.00% <100.00%> (ø)
src/locales/af_ZA/index.ts 100.00% <100.00%> (ø)
src/locales/af_ZA/metadata.ts 100.00% <100.00%> (ø)
src/locales/ar/index.ts 100.00% <100.00%> (ø)
src/locales/ar/metadata.ts 100.00% <100.00%> (ø)
src/locales/az/index.ts 100.00% <100.00%> (ø)
src/locales/az/metadata.ts 100.00% <100.00%> (ø)
... and 117 more

... and 1 file with indirect coverage changes

@ST-DDT ST-DDT changed the title refactor!(locale): introduce metadata refactor(locale)!: introduce metadata Mar 26, 2023
src/locales/af_ZA/metadata/index.ts Outdated Show resolved Hide resolved
src/locales/de_AT/metadata/title.ts Outdated Show resolved Hide resolved
test/faker.spec.ts Outdated Show resolved Hide resolved
src/definitions/definitions.ts Outdated Show resolved Hide resolved
@matthewmayer
Copy link
Contributor

i would like to see more metadata added, for example:

{
title:"German (Austria)",
endonym:"Deutsch (Österreich)",
code:"de_AT",
language:"de",
country:"AT",
ltr:false,
script:"Latin"
}

@Shinigami92
Copy link
Member

Shinigami92 commented Mar 27, 2023

i would like to see more metadata added, for example:

{
title:"German (Austria)",
endonym:"Deutsch (Österreich)",
code:"de_AT",
language:"de",
country:"AT",
ltr:false,
script:"Latin"
}

Yes 🙌
Absolutely, but this PR is just preparation for this

Edit: And this is also why I suggested to not move primitive data into own files
It would just explode in data/files that are all just 1 line long

@matthewmayer
Copy link
Contributor

i would like to see more metadata added, for example:

{
title:"German (Austria)",
endonym:"Deutsch (Österreich)",
code:"de_AT",
language:"de",
country:"AT",
ltr:false,
script:"Latin"
}

Yes 🙌 Absolutely, but this PR is just preparation for this

Edit: And this is also why I suggested to not move primitive data into own files It would just explode in data/files that are all just 1 line long

agreed, if there are ~7 metadata items like this it should be in one file total

@ST-DDT
Copy link
Member Author

ST-DDT commented Mar 27, 2023

Yes 🙌 Absolutely, but this PR is just preparation for this
Edit: And this is also why I suggested to not move primitive data into own files It would just explode in data/files that are all just 1 line long

agreed, if there are ~7 metadata items like this it should be in one file total

I did it like this to avoid having to add special handling for any of these, but I will add that back.

src/locales/af_ZA/metadata.ts Outdated Show resolved Hide resolved
@ST-DDT ST-DDT requested review from Shinigami92 and a team March 27, 2023 17:55
@ST-DDT ST-DDT requested review from Shinigami92, xDivisionByZerox and a team March 28, 2023 21:51
@ST-DDT ST-DDT requested a review from a team March 28, 2023 22:10
Shinigami92
Shinigami92 previously approved these changes Mar 29, 2023
@ST-DDT ST-DDT requested a review from a team March 30, 2023 17:30
@ST-DDT ST-DDT enabled auto-merge (squash) April 1, 2023 12:31
@ST-DDT ST-DDT merged commit c5eb72c into next Apr 1, 2023
@ST-DDT ST-DDT deleted the locale/introduce-metadata branch April 1, 2023 12:37
ST-DDT added a commit to munkeawtoast/faker that referenced this pull request Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Cannot be merged when next version is not a major release c: locale Permutes locale definitions c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs p: 1-normal Nothing urgent
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants