Skip to content

refactor(locale)!: move title to metadata#1978

Merged
ST-DDT merged 17 commits intonextfrom
locale/introduce-metadata
Apr 1, 2023
Merged

refactor(locale)!: move title to metadata#1978
ST-DDT merged 17 commits intonextfrom
locale/introduce-metadata

Conversation

@ST-DDT
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Comment thread src/locales/af_ZA/metadata/index.ts Outdated
Comment thread src/locales/de_AT/metadata/title.ts Outdated
Comment thread test/faker.spec.ts Outdated
Comment thread src/definitions/definitions.ts Outdated
@matthewmayer
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread src/locales/af_ZA/metadata.ts Outdated
@ST-DDT ST-DDT requested review from a team and Shinigami92 March 27, 2023 17:55
@ST-DDT ST-DDT requested review from a team, Shinigami92 and xDivisionByZerox 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 dismissed stale reviews from Shinigami92 and xDivisionByZerox via 35d1306 March 29, 2023 18:23
@ST-DDT ST-DDT requested review from a team, Shinigami92 and xDivisionByZerox March 29, 2023 18:24
@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