Skip to content

Commit c73b905

Browse files
Merge branch 'next' into refactor/locale/remove-maestro-credit-card-issuer
2 parents 89311b3 + e53dd37 commit c73b905

127 files changed

Lines changed: 4058 additions & 3869 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ module.exports = defineConfig({
5757
'unicorn/prefer-export-from': 'off',
5858
'unicorn/prefer-string-slice': 'off',
5959
'unicorn/prevent-abbreviations': 'off',
60-
'unicorn/require-array-join-separator': 'off',
6160

6261
'@typescript-eslint/array-type': [
6362
'error',

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ jobs:
210210
run: pnpm vitest run --coverage
211211

212212
- name: Upload coverage to Codecov
213-
uses: codecov/codecov-action@7afa10ed9b269c561c2336fd862446844e0cbf71 # v4.2.0
213+
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
214214
with:
215215
token: ${{ secrets.CODECOV_TOKEN }}
216216
fail_ci_if_error: true

CHANGELOG.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,113 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [9.0.0-alpha.0](https://github.com/faker-js/faker/compare/v8.4.1...v9.0.0-alpha.0) (2024-04-12)
6+
7+
8+
### ⚠ BREAKING CHANGES
9+
10+
* **locale:** remove unused global locale faker instance (#2789)
11+
* **locale:** remove deprecated locale aliases (#2787)
12+
* **date:** birthdate improvements (#2756)
13+
* **date:** stricter error handling of between (#2719)
14+
* **date:** fail on invalid dates (#2757)
15+
* **location:** remove v8 deprecated location methods (#2753)
16+
* remove v8 deprecated type aliases (#2754)
17+
* **commerce:** remove v8 deprecated commerce method (#2752)
18+
* **location:** remove default_country definitions (#2740)
19+
* **helpers:** remove v8 deprecated helpers methods (#2729)
20+
* **number:** remove v8 deprecated number parameter (#2738)
21+
* **company:** remove v8 deprecated company methods (#2726)
22+
* **phone:** add new style parameter (#2578)
23+
* **finance:** remove v8 deprecated finance methods (#2727)
24+
* **git:** remove v8 deprecated git method (#2716)
25+
* **phone:** remove v8 deprecated phone format (#2712)
26+
* **date:** remove v8 deprecated date methods (#2704)
27+
* **helpers:** stricter checking for function signature passed to `multiple` (#2563)
28+
* **internet:** remove v8 deprecated internet methods (#2699)
29+
* **random:** remove v8 deprecated image methods (#2697)
30+
* high precision random number generator (#2357)
31+
* **person:** flatten jobs definitions (#2505)
32+
* **datatype:** remove v8 deprecated datatype methods (#2694)
33+
* **helpers:** use const generics where possible (#2685)
34+
* **random:** remove deprecated random module (#2678)
35+
* remove v8 deprecated faker class parts (#2682)
36+
* **helpers:** remove v8 deprecated unique (#2661)
37+
* switch to tsup (#2391)
38+
* **image:** remove v8 deprecated providers (#2634)
39+
* **image:** randomize defaults (#2472)
40+
* **deps:** update dependency typescript to v5 (#1953)
41+
* drop NodeJS v14 and v16 support (#2121)
42+
43+
### Features
44+
45+
* **animal:** add more simple animals to animal.type() ([#2786](https://github.com/faker-js/faker/issues/2786)) ([f47dfe5](https://github.com/faker-js/faker/commit/f47dfe5c58371b468c704cab7a7cd29f9a3e3379))
46+
* **food:** new module ([#2484](https://github.com/faker-js/faker/issues/2484)) ([9aab7c2](https://github.com/faker-js/faker/commit/9aab7c2429b50c0f6e8bd1908344f9ff92912f5d))
47+
* **helpers:** stricter checking for function signature passed to `multiple` ([#2563](https://github.com/faker-js/faker/issues/2563)) ([2b15f2e](https://github.com/faker-js/faker/commit/2b15f2ee7eeba7147c75a24d71042ee996966c92))
48+
* **helpers:** use const generics where possible ([#2685](https://github.com/faker-js/faker/issues/2685)) ([c45537f](https://github.com/faker-js/faker/commit/c45537f6d4f3a28d8be1ebbe03567004c04af145))
49+
* high precision random number generator ([#2357](https://github.com/faker-js/faker/issues/2357)) ([4ab0731](https://github.com/faker-js/faker/commit/4ab073164beab2bf690d7fffc7773e7b76d8e07e))
50+
* **music:** add additional genres ([#2621](https://github.com/faker-js/faker/issues/2621)) ([7dae52b](https://github.com/faker-js/faker/commit/7dae52bfcd93c41ec9d2c4dd4d96a07f31c3dfc1))
51+
* **number:** add multipleOf to faker.number.int ([#2586](https://github.com/faker-js/faker/issues/2586)) ([5ef8ef1](https://github.com/faker-js/faker/commit/5ef8ef1da13e83efc61702e64d8f75b611afb4e5))
52+
* **phone:** add new style parameter ([#2578](https://github.com/faker-js/faker/issues/2578)) ([e130549](https://github.com/faker-js/faker/commit/e130549e82a3d59af46f2d595ed47fa9a39724a3))
53+
54+
55+
### Bug Fixes
56+
57+
* **commerce:** return fractional prices ([#2458](https://github.com/faker-js/faker/issues/2458)) ([9348138](https://github.com/faker-js/faker/commit/9348138893bb95faa5037c653443fbd525ce2939))
58+
* **internet:** add Hebrew username charMapping ([#2781](https://github.com/faker-js/faker/issues/2781)) ([5860783](https://github.com/faker-js/faker/commit/5860783e81d392bc235408b697668ab8ecdd2d7c))
59+
* **person:** add dedicated first names in ko locale ([#2773](https://github.com/faker-js/faker/issues/2773)) ([47f008a](https://github.com/faker-js/faker/commit/47f008aff5aee08057ad5445d5b3dfbd1b196934))
60+
* **person:** delete set of invalid names in en_NG ([#2764](https://github.com/faker-js/faker/issues/2764)) ([2884552](https://github.com/faker-js/faker/commit/2884552c0506f6244eeda56ee6a76067424959ca))
61+
* restore support for moduleResolution Node* ([#2749](https://github.com/faker-js/faker/issues/2749)) ([2f07483](https://github.com/faker-js/faker/commit/2f074835e60240d8ac53e2d42fc7b5dac85d05b8))
62+
* tree-shaking ([#2790](https://github.com/faker-js/faker/issues/2790)) ([fb65976](https://github.com/faker-js/faker/commit/fb65976acb1003f441a35afafbd87204eca0e2d7))
63+
64+
65+
### infra
66+
67+
* drop NodeJS v14 and v16 support ([#2121](https://github.com/faker-js/faker/issues/2121)) ([1e0df8b](https://github.com/faker-js/faker/commit/1e0df8b81445d89b4a65bcab3a156b51ee1d1a38))
68+
69+
70+
* **commerce:** remove v8 deprecated commerce method ([#2752](https://github.com/faker-js/faker/issues/2752)) ([8c80877](https://github.com/faker-js/faker/commit/8c80877f1691886e32c2b1eb799586c0c1b02b8b))
71+
* **company:** remove v8 deprecated company methods ([#2726](https://github.com/faker-js/faker/issues/2726)) ([19bcf88](https://github.com/faker-js/faker/commit/19bcf886e41b13a6b77b92bac4775b18e8aa9418))
72+
* **datatype:** remove v8 deprecated datatype methods ([#2694](https://github.com/faker-js/faker/issues/2694)) ([682a427](https://github.com/faker-js/faker/commit/682a4276f13d7b8f48e1bd8aafcf011c7bd10390))
73+
* **date:** birthdate improvements ([#2756](https://github.com/faker-js/faker/issues/2756)) ([b498d1f](https://github.com/faker-js/faker/commit/b498d1f794e6d682e9d9fedebff194664c2a3f1d))
74+
* **date:** fail on invalid dates ([#2757](https://github.com/faker-js/faker/issues/2757)) ([3485e7e](https://github.com/faker-js/faker/commit/3485e7eece540b63059e97bd8166d1ffd88334de))
75+
* **date:** remove v8 deprecated date methods ([#2704](https://github.com/faker-js/faker/issues/2704)) ([e868060](https://github.com/faker-js/faker/commit/e868060c87cbca3c1bf90465d61fc39a4eea1f9c))
76+
* **date:** stricter error handling of between ([#2719](https://github.com/faker-js/faker/issues/2719)) ([da35c51](https://github.com/faker-js/faker/commit/da35c51d16eccd99a7001a5b055a24806168435d))
77+
* **deps:** update dependency typescript to v5 ([#1953](https://github.com/faker-js/faker/issues/1953)) ([bc3ebb7](https://github.com/faker-js/faker/commit/bc3ebb793666c0d7e58cf428ba12465a7b290cbe))
78+
* **finance:** remove v8 deprecated finance methods ([#2727](https://github.com/faker-js/faker/issues/2727)) ([a536a9d](https://github.com/faker-js/faker/commit/a536a9d79f410986e6bd6dc1bc4a72252a0cc8d9))
79+
* **git:** remove v8 deprecated git method ([#2716](https://github.com/faker-js/faker/issues/2716)) ([b3afc8f](https://github.com/faker-js/faker/commit/b3afc8f351003cf9df9984fb5be6cd46e18f71d8))
80+
* **helpers:** remove v8 deprecated helpers methods ([#2729](https://github.com/faker-js/faker/issues/2729)) ([1169a05](https://github.com/faker-js/faker/commit/1169a0576ba1469d7c05be0b8fd844bde8a1af13))
81+
* **helpers:** remove v8 deprecated unique ([#2661](https://github.com/faker-js/faker/issues/2661)) ([4382fd9](https://github.com/faker-js/faker/commit/4382fd9313821bf542829859e97d4422acc9e284))
82+
* **image:** randomize defaults ([#2472](https://github.com/faker-js/faker/issues/2472)) ([92207b7](https://github.com/faker-js/faker/commit/92207b7df15732a61e613a4376a9ce88bd4f7b0f))
83+
* **image:** remove v8 deprecated providers ([#2634](https://github.com/faker-js/faker/issues/2634)) ([44d698e](https://github.com/faker-js/faker/commit/44d698e14f48a32259fd52a39d1e3028f84f3c06))
84+
* **internet:** remove v8 deprecated internet methods ([#2699](https://github.com/faker-js/faker/issues/2699)) ([3024d9e](https://github.com/faker-js/faker/commit/3024d9e7adeadb1c317aee308c594d3e18090b1a))
85+
* **location:** remove default_country definitions ([#2740](https://github.com/faker-js/faker/issues/2740)) ([a409b46](https://github.com/faker-js/faker/commit/a409b468f942d964ce22ff42b52f8a756e0ca815))
86+
* **location:** remove v8 deprecated location methods ([#2753](https://github.com/faker-js/faker/issues/2753)) ([6dee178](https://github.com/faker-js/faker/commit/6dee178558b87b73bba1395c11d2ffe3d156dad1))
87+
* **number:** remove v8 deprecated number parameter ([#2738](https://github.com/faker-js/faker/issues/2738)) ([a672d27](https://github.com/faker-js/faker/commit/a672d277b883a445a852f9b6db18818104e8de7e))
88+
* **person:** flatten jobs definitions ([#2505](https://github.com/faker-js/faker/issues/2505)) ([0d4cba6](https://github.com/faker-js/faker/commit/0d4cba637cdd38e7757ecca1b7eae75d7a737fa8))
89+
* **phone:** remove v8 deprecated phone format ([#2712](https://github.com/faker-js/faker/issues/2712)) ([660da4c](https://github.com/faker-js/faker/commit/660da4c401b36ebfe0c0f7975c265146d9224921))
90+
* **random:** remove deprecated random module ([#2678](https://github.com/faker-js/faker/issues/2678)) ([64ff107](https://github.com/faker-js/faker/commit/64ff107b8a9cd0965a67f00fd30cded144c02fd6))
91+
* **random:** remove v8 deprecated image methods ([#2697](https://github.com/faker-js/faker/issues/2697)) ([e99fba9](https://github.com/faker-js/faker/commit/e99fba9729729e8a3107a659f5e00b9f18047298))
92+
* remove v8 deprecated faker class parts ([#2682](https://github.com/faker-js/faker/issues/2682)) ([a9dc701](https://github.com/faker-js/faker/commit/a9dc7017b4a2b2bf79c42fe947de6029fae5e937))
93+
* remove v8 deprecated type aliases ([#2754](https://github.com/faker-js/faker/issues/2754)) ([2ec602b](https://github.com/faker-js/faker/commit/2ec602ba1be4e04f261a96717a3d3c90a15a4c01))
94+
* switch to tsup ([#2391](https://github.com/faker-js/faker/issues/2391)) ([db88a15](https://github.com/faker-js/faker/commit/db88a1518e8d0ccfe191bd48a1ae8641a9a25303))
95+
96+
97+
### New Locales
98+
99+
* **locale:** add location for uz_UZ_latin ([#2775](https://github.com/faker-js/faker/issues/2775)) ([80730e9](https://github.com/faker-js/faker/commit/80730e92abe87545e685674cafdcb1bc90f15fb1))
100+
* **locale:** add uzbek locale (uz_UZ_latin) ([#2686](https://github.com/faker-js/faker/issues/2686)) ([f7471a2](https://github.com/faker-js/faker/commit/f7471a225f388c6bc0ec47ebad759ee1051e1106))
101+
* **locale:** extend Uzbek locale for commerce ([#2750](https://github.com/faker-js/faker/issues/2750)) ([b6b18d7](https://github.com/faker-js/faker/commit/b6b18d7f97e232bd133f117172e02df35fa16fec))
102+
* **locale:** extend Uzbek locale for date and color ([#2724](https://github.com/faker-js/faker/issues/2724)) ([776a625](https://github.com/faker-js/faker/commit/776a6258de07108548fb5918bdb8b572a278075a))
103+
* **locale:** support street and street address for ja ([#2193](https://github.com/faker-js/faker/issues/2193)) ([501f4b3](https://github.com/faker-js/faker/commit/501f4b3d3a8056b8b7877f1d78575ade26b361ce))
104+
105+
106+
### Changed Locales
107+
108+
* **locale:** normalize animal data ([#2791](https://github.com/faker-js/faker/issues/2791)) ([03b965a](https://github.com/faker-js/faker/commit/03b965abfde57be617a1ae7ba715604e149a803d))
109+
* **locale:** remove deprecated locale aliases ([#2787](https://github.com/faker-js/faker/issues/2787)) ([03ac471](https://github.com/faker-js/faker/commit/03ac47198313126c3cc8cb3fb9ef184360bb79eb))
110+
* **locale:** remove unused global locale faker instance ([#2789](https://github.com/faker-js/faker/issues/2789)) ([b505a70](https://github.com/faker-js/faker/commit/b505a70c8e52a3f64c6b7cb4e2888cf5d48aeefe))
111+
5112
### [8.4.1](https://github.com/faker-js/faker/compare/v8.4.0...v8.4.1) (2024-02-06)
6113

7114
* JSDocs improvements

docs/.vitepress/config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const config: UserConfig<DefaultTheme.Config> = {
123123
socialLinks: [
124124
{ icon: 'discord', link: 'https://chat.fakerjs.dev' },
125125
{ icon: 'mastodon', link: 'https://fosstodon.org/@faker_js' },
126-
{ icon: 'twitter', link: 'https://twitter.com/faker_js' },
126+
{ icon: 'x', link: 'https://twitter.com/faker_js' },
127127
{ icon: 'github', link: 'https://github.com/faker-js/faker' },
128128
],
129129

@@ -243,6 +243,10 @@ const config: UserConfig<DefaultTheme.Config> = {
243243
text: 'Roadmap',
244244
link: '/about/roadmap/',
245245
items: [
246+
{
247+
text: 'v9 - Tree-Shakeable Module-Functions',
248+
link: '/about/roadmap/v9',
249+
},
246250
{ text: 'v8 - Make Faker Handier', link: '/about/roadmap/v8' },
247251
{
248252
text: 'v7 - Cleanup & Improvements',

docs/about/roadmap/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Click on the specific versions for more details.
99

1010
## Upcoming Versions
1111

12+
- [v9 - Tree Shaking](v9.md)
13+
14+
## Current Versions
15+
1216
- [v8 - Make Faker Handier](v8.html)
1317

1418
## Previous Versions

docs/about/roadmap/v8.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,3 @@ Finish the module shuffling.
2626
Split the Faker class into smaller units so you don't have ship an entire locale if you only generate some strings and numbers.
2727

2828
[v8.1 Tasks](https://github.com/faker-js/faker/milestone/11)
29-
30-
## v8.x - Tree-Shakeable Module-Functions
31-
32-
Refactor modules to be tree shakeable.
33-
Potentially allowing individual Faker methods to be called by themselves.
34-
35-
[v8.x Tasks](https://github.com/faker-js/faker/milestone/12)

docs/about/roadmap/v9.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## v9.0 - Tree-Shakeable Module-Functions
2+
3+
Fix the issue of Faker not being tree shakeable.
4+
Potentially allowing individual Faker methods to be called by themselves.
5+
6+
[v9.0 Tasks](https://github.com/faker-js/faker/milestone/12)

docs/guide/localization.md

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,6 @@ For example, you can import the German locale:
1414
You can also build your own Faker instances, with custom locales/overwrites.
1515
:::
1616

17-
## Individual localized packages
18-
19-
Currently, the imports from the main package have a [bug](https://github.com/faker-js/faker/issues/1791) and always cause the entire Faker lib to be imported.
20-
This might result in loading around 5 MB of data into memory and slow down startup times.
21-
22-
_But we got your back!_
23-
When encountering such a problem in a test or production environment, you can use the individual localized packages.
24-
25-
```ts
26-
import { faker } from '@faker-js/faker/locale/de';
27-
```
28-
29-
This will then just load the German locales with additional English locales as fallback. The fallback is required due to not all locales containing data for all features. If you encounter a missing locale entry in your selected language, feel free to open a Pull Request fixing that issue.
30-
31-
::: info Info
32-
The English locales are around 600 KB in size.
33-
All locales together are around 5 MB in size.
34-
:::
35-
36-
::: tip Note
37-
Some locales have limited coverage and rely more heavily on the English locale as the source for features they currently do not have.
38-
However, in most cases, using a specific locale will be beneficial in the long term as specifying a locale reduces the time necessary for startup, which has a compounding effect on testing frameworks that reload the imports every execution.
39-
:::
40-
4117
## Custom locales and fallbacks
4218

4319
If our built-in faker instances don't satisfy your needs, you can build your own:
@@ -152,6 +128,11 @@ The `Locale` (data) and `Faker` columns refer to the respective `import` names:
152128
import { de, fakerDE } from '@faker-js/faker';
153129
```
154130

131+
::: tip Note
132+
Some locales have limited coverage and rely more heavily on the English locale as the source for features they currently do not have.
133+
However, in most cases, using a specific locale will be beneficial in the long term as specifying a locale reduces the time necessary for startup, which has a compounding effect on testing frameworks that reload the imports every execution.
134+
:::
135+
155136
## Locale codes
156137

157138
Locales are named in a systematic way. The first two characters are a lowercase language code following the [ISO 639-1 standard](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for example `ar` for Arabic or `en` for English.

0 commit comments

Comments
 (0)