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)!: use singular locale definition keys #2932

Conversation

SaurabhXRT
Copy link
Contributor

@SaurabhXRT SaurabhXRT commented Jun 1, 2024

Overview

This PR addresses issue #2911 by standardizing the locale definition keys to use singular naming. This change improves consistency across the codebase and aligns with the team decision discussed in the issue.

Changes Made

  • Updated LoremDefinition to use the singular key word instead of words.
  • Modified the automatically generated lorem definition file to use word:
    • Changed the key from words to word.
    • Updated the import statement to match the current file structure.
  • Updated SystemDefinition to use singular keys:
    • Changed directory_paths to directory_path.
    • Changed mime_types to mime_type.
    • Updated the import statements to match the current file structure.

Testing

  • Ran all existing tests to ensure no breakage.
  • Updated tests where necessary to match the new naming convention.

Additional Notes

Please review the changes and let me know if any further updates are needed. This change includes a breaking change label as it modifies the locale definition keys, which might affect backward compatibility.

@SaurabhXRT SaurabhXRT requested a review from a team as a code owner June 1, 2024 09:41
Copy link

netlify bot commented Jun 1, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit ca753dc
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/666ac5d7bd3e13000862b42b
😎 Deploy Preview https://deploy-preview-2932.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

src/locales/ar/lorem/index.ts Outdated Show resolved Hide resolved
@SaurabhXRT SaurabhXRT changed the title used singular local keys for issue #2911 refactor(locale): use singular keys for locale definitions Jun 1, 2024
@ST-DDT ST-DDT changed the title refactor(locale): use singular keys for locale definitions refactor(locale)!: used singular local keys Jun 1, 2024
@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 breaking change Cannot be merged when next version is not a major release m: lorem Something is referring to the lorem module m: system Something is referring to the system module labels Jun 1, 2024
@ST-DDT ST-DDT linked an issue Jun 1, 2024 that may be closed by this pull request
@ST-DDT ST-DDT added the c: locale Permutes locale definitions label Jun 1, 2024
@ST-DDT ST-DDT added this to the v9.0 milestone Jun 1, 2024
@ST-DDT
Copy link
Member

ST-DDT commented Jun 1, 2024

@ST-DDT ST-DDT changed the title refactor(locale)!: used singular local keys refactor(locale)!: use singular locale definition keys Jun 1, 2024
@ST-DDT
Copy link
Member

ST-DDT commented Jun 1, 2024

Please make sure to run pnpm run preflight

docs/guide/upgrading.md Outdated Show resolved Hide resolved
@SaurabhXRT
Copy link
Contributor Author

SaurabhXRT commented Jun 5, 2024

hey @matthewmayer i have some doubt i am facing error how can i connect with you ?
can you please check test/modules/lorem.spec.ts file what is wrong?

docs/guide/upgrading.md Outdated Show resolved Hide resolved
pnpm-lock.yaml Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.95%. Comparing base (2a2a132) to head (ca753dc).

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #2932   +/-   ##
=======================================
  Coverage   99.94%   99.95%           
=======================================
  Files        2987     2987           
  Lines      216037   216037           
  Branches      946      951    +5     
=======================================
+ Hits       215927   215942   +15     
+ Misses        110       95   -15     
Files Coverage Δ
src/locales/ar/lorem/index.ts 100.00% <100.00%> (ø)
src/locales/ar/lorem/word.ts 100.00% <ø> (ø)
src/locales/base/system/directory_path.ts 100.00% <ø> (ø)
src/locales/base/system/index.ts 100.00% <100.00%> (ø)
src/locales/base/system/mime_type.ts 100.00% <ø> (ø)
src/locales/cs_CZ/lorem/index.ts 100.00% <100.00%> (ø)
src/locales/cs_CZ/lorem/word.ts 100.00% <ø> (ø)
src/locales/de/lorem/index.ts 100.00% <100.00%> (ø)
src/locales/de/lorem/word.ts 100.00% <ø> (ø)
src/locales/dv/lorem/index.ts 100.00% <100.00%> (ø)
... and 45 more

... and 1 file with indirect coverage changes

@ST-DDT
Copy link
Member

ST-DDT commented Jun 7, 2024

Two more small changes and then this is good to go.

matthewmayer
matthewmayer previously approved these changes Jun 10, 2024
@ST-DDT ST-DDT requested review from matthewmayer, xDivisionByZerox and a team June 10, 2024 21:22
@xDivisionByZerox xDivisionByZerox enabled auto-merge (squash) June 13, 2024 10:11
@xDivisionByZerox xDivisionByZerox merged commit a5ffca1 into faker-js:next Jun 13, 2024
23 checks passed
@xDivisionByZerox
Copy link
Member

@SaurabhXRT Thank you for your contribution ❤️

eLoyyyyy pushed a commit to eLoyyyyy/faker that referenced this pull request Oct 14, 2024
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 m: lorem Something is referring to the lorem module m: system Something is referring to the system module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use singular locale definition keys
4 participants