Skip to content

Commit 233a4de

Browse files
committed
Merge branch 'next' into locale/more-hyphenated-names
# Conflicts: # src/locales/zh_TW/person/index.ts
2 parents 3dfbd9a + 4490a9e commit 233a4de

Some content is hidden

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

61 files changed

+3219
-1219
lines changed

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,79 @@
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+
## [8.0.0-alpha.1](https://github.com/faker-js/faker/compare/v8.0.0-alpha.0...v8.0.0-alpha.1) (2023-03-20)
6+
7+
8+
### ⚠ BREAKING CHANGES
9+
10+
* remove dynamic locale switching support (#1735)
11+
* **company:** rename bs to buzz (#1860)
12+
* **location:** countryCode use ISO-3166-1 (#1720)
13+
* **number:** default to high precision float (#1675)
14+
* **locale:** remove unused separator entry (#1731)
15+
16+
### Features
17+
18+
* **airline:** add airline module ([#1699](https://github.com/faker-js/faker/issues/1699)) ([579c9ad](https://github.com/faker-js/faker/commit/579c9adb5affa01ee5ee384942f56d662a21022e))
19+
* **company:** add realistic Hungarian company names ([#1758](https://github.com/faker-js/faker/issues/1758)) ([2e6b136](https://github.com/faker-js/faker/commit/2e6b136c61a7cfc799c72a86a38ca4a505d94e3c))
20+
* **date:** introduce faker.defaultRefDate and setDefaultRefDate ([#1757](https://github.com/faker-js/faker/issues/1757)) ([3a44d5f](https://github.com/faker-js/faker/commit/3a44d5fa48e8b28a7b9422a18262e39af1d1cb91))
21+
* **finance:** currency object ([#1809](https://github.com/faker-js/faker/issues/1809)) ([59157a4](https://github.com/faker-js/faker/commit/59157a429a1bcde3f78bd9009f6de02358365ba2))
22+
* **helpers:** add length range support in `arrayElements` ([#1772](https://github.com/faker-js/faker/issues/1772)) ([b86638d](https://github.com/faker-js/faker/commit/b86638d478fa21fafa9aaa3e247a08b479bf5a9d))
23+
* **helpers:** add new faker.helpers.weightedArrayElement ([#1654](https://github.com/faker-js/faker/issues/1654)) ([59824e6](https://github.com/faker-js/faker/commit/59824e66ad1e14be2d61b8425e8f8e9547863565))
24+
* **helpers:** allow empty string in fake ([#1679](https://github.com/faker-js/faker/issues/1679)) ([f0d2ffb](https://github.com/faker-js/faker/commit/f0d2ffb256e5aefb98d4f38905ef081c8e6af43e))
25+
* **helpers:** new method enumValue ([#1920](https://github.com/faker-js/faker/issues/1920)) ([f2abf8b](https://github.com/faker-js/faker/commit/f2abf8b49439fc3c6197ecc9a16e212c9e64497a))
26+
* **locales:** add mergeLocales utility ([#1707](https://github.com/faker-js/faker/issues/1707)) ([788fce0](https://github.com/faker-js/faker/commit/788fce048f0233552df47f3407c06d8f83c32b0c))
27+
* **number:** add binary and octal random number generation ([#1708](https://github.com/faker-js/faker/issues/1708)) ([d3229fc](https://github.com/faker-js/faker/commit/d3229fcdf28b5a1abdbc44a7bcdde934bd472bf2))
28+
* **number:** default to high precision float ([#1675](https://github.com/faker-js/faker/issues/1675)) ([1ebbead](https://github.com/faker-js/faker/commit/1ebbead194a9583dbd0f21f136c9d2bf8f84a50f))
29+
* **person:** add Portuguese BR Language to western zodiac sign ([#1814](https://github.com/faker-js/faker/issues/1814)) ([fd96094](https://github.com/faker-js/faker/commit/fd960941a5434464736b236e73df9813bc22c86c))
30+
* **person:** add short bio ([#1696](https://github.com/faker-js/faker/issues/1696)) ([2a2e054](https://github.com/faker-js/faker/commit/2a2e054a16a45bc5cd56bdd923b7f5140eb12699))
31+
* **person:** split prefix into gendered versions ([#1665](https://github.com/faker-js/faker/issues/1665)) ([27dff93](https://github.com/faker-js/faker/commit/27dff93aa27d755874aa5022c78f17ff8e9cf7e0))
32+
* provide enums for color values ([#1910](https://github.com/faker-js/faker/issues/1910)) ([a001090](https://github.com/faker-js/faker/commit/a0010900205ed8b1d1ba2adefe222c1cb41c1a70))
33+
* **string:** add binary and octal random string generation ([#1710](https://github.com/faker-js/faker/issues/1710)) ([80e0a96](https://github.com/faker-js/faker/commit/80e0a9688099677a74614ccbedc9231b6382c4eb))
34+
* **string:** generate string from characters ([#1717](https://github.com/faker-js/faker/issues/1717)) ([47b2cfc](https://github.com/faker-js/faker/commit/47b2cfc76b790647e398bf9883368a10b2ff5a68))
35+
* **string:** nanoid ([#1716](https://github.com/faker-js/faker/issues/1716)) ([099e76c](https://github.com/faker-js/faker/commit/099e76ce0fb180beb5fd62d72a07c236e04cdca0))
36+
37+
38+
### Bug Fixes
39+
40+
* consistent locale names ([#1884](https://github.com/faker-js/faker/issues/1884)) ([cf2ce68](https://github.com/faker-js/faker/commit/cf2ce6830d42a1a91c1a2defcc02d86c1a782cf8))
41+
* correct types field ([#1878](https://github.com/faker-js/faker/issues/1878)) ([956a15f](https://github.com/faker-js/faker/commit/956a15fff5c3714485e8e612df62034a5f78c0c5))
42+
* **currency:** modernise currency list for 2023 ([#1880](https://github.com/faker-js/faker/issues/1880)) ([e6f949b](https://github.com/faker-js/faker/commit/e6f949b73e781d7e3f1fb4adf8f87d66b4aa29a1))
43+
* discord link ([#1891](https://github.com/faker-js/faker/issues/1891)) ([8a97cac](https://github.com/faker-js/faker/commit/8a97cac30f94bf7c29bfd6ffbad6ebf9c05fa2b1))
44+
* **git:** commitEntry normalize user ([#1813](https://github.com/faker-js/faker/issues/1813)) ([667599d](https://github.com/faker-js/faker/commit/667599d8fb59c31166b897799f30788edc5f54d7))
45+
* **helpers:** uniform distribution in helpers.arrayElements ([#1770](https://github.com/faker-js/faker/issues/1770)) ([2b84b33](https://github.com/faker-js/faker/commit/2b84b3389a2719e0f365055990a51673acd07ac9))
46+
* **internet:** filter banned dots from email addresses ([#1883](https://github.com/faker-js/faker/issues/1883)) ([f8926c7](https://github.com/faker-js/faker/commit/f8926c7b1311e5c1e617289f9ee3760b522bea3f))
47+
* **internet:** fix invalid emails in some locales ([#1746](https://github.com/faker-js/faker/issues/1746)) ([1e4e869](https://github.com/faker-js/faker/commit/1e4e8699e59f3b5b9c1e1d6ad9b89ee4cc254e95))
48+
* **locale:** az company name_patterns return undefined in name ([#1914](https://github.com/faker-js/faker/issues/1914)) ([bb72a66](https://github.com/faker-js/faker/commit/bb72a6679b7005271e847324a2affbd187f65716))
49+
* **locale:** correct capitalization of last_name in en_AU ([#1912](https://github.com/faker-js/faker/issues/1912)) ([4f14533](https://github.com/faker-js/faker/commit/4f14533418e23496fa463f08e8276cb230dc7643))
50+
* **locale:** filter inappropriate words in the en locale ([#1745](https://github.com/faker-js/faker/issues/1745)) ([dfa647d](https://github.com/faker-js/faker/commit/dfa647dc07ea25f962c4df913bae2de082e8acc4))
51+
* **locale:** fix pt_PT street addresses ([#1911](https://github.com/faker-js/faker/issues/1911)) ([8f0abd3](https://github.com/faker-js/faker/commit/8f0abd3e1018d3c814e9ade5e999457e15fee47f))
52+
* **locale:** remove invalid city patterns from pt_BR ([#1913](https://github.com/faker-js/faker/issues/1913)) ([7ae5cdb](https://github.com/faker-js/faker/commit/7ae5cdb59d4c0e5550ea9f9c2b065360b0d359a5))
53+
* **locale:** replace Ð with Đ in hr and vi ([#1810](https://github.com/faker-js/faker/issues/1810)) ([ff53587](https://github.com/faker-js/faker/commit/ff5358732fdbd224ef8c7e71a9591fa4fd68da3c))
54+
* more discord links ([#1893](https://github.com/faker-js/faker/issues/1893)) ([f948e2e](https://github.com/faker-js/faker/commit/f948e2e8ccc93b31557f8c65f610f52dff28e2e4))
55+
* **person:** avoid repeated last name via new last_name_patterns ([#1819](https://github.com/faker-js/faker/issues/1819)) ([0f98518](https://github.com/faker-js/faker/commit/0f98518f0906a9660dcdb8993b6cb983c5e4c92f))
56+
* **person:** change fullName to use name patterns ([#1637](https://github.com/faker-js/faker/issues/1637)) ([1ae2f6f](https://github.com/faker-js/faker/commit/1ae2f6f489bcf7b317202877af3419ecc01bc1d0))
57+
* **person:** improve to Dutch name generation ([#1778](https://github.com/faker-js/faker/issues/1778)) ([fbd0db5](https://github.com/faker-js/faker/commit/fbd0db533b5a46fe1175c02c65b3e61fca52d40d))
58+
* **random:** prevent infinite do-while ([#1938](https://github.com/faker-js/faker/issues/1938)) ([256631d](https://github.com/faker-js/faker/commit/256631d6be4b2b40ae660a7e9052cde07a3da18c))
59+
* **random:** remove deprecated method usage ([#1865](https://github.com/faker-js/faker/issues/1865)) ([25bd847](https://github.com/faker-js/faker/commit/25bd847545acb13291ac0a3704688793ca9a0933))
60+
61+
62+
### Changed Locales
63+
64+
* **locale:** remove unused separator entry ([#1731](https://github.com/faker-js/faker/issues/1731)) ([0bc6c2f](https://github.com/faker-js/faker/commit/0bc6c2fbe65de9a9f706aa6f78f3b07940038461))
65+
66+
67+
* **company:** rename bs to buzz ([#1860](https://github.com/faker-js/faker/issues/1860)) ([5f95aca](https://github.com/faker-js/faker/commit/5f95aca92158ce749215527c8d3691c19737e3f1))
68+
* **location:** countryCode use ISO-3166-1 ([#1720](https://github.com/faker-js/faker/issues/1720)) ([a05c3e5](https://github.com/faker-js/faker/commit/a05c3e5fed805c5086a22841a81da0d86ab89386))
69+
* remove dynamic locale switching support ([#1735](https://github.com/faker-js/faker/issues/1735)) ([9a35dc9](https://github.com/faker-js/faker/commit/9a35dc92260585683132172f10bcdec701ed661a))
70+
71+
72+
### New Locales
73+
74+
* **locale:** add `state` and `state_abbr` to `cz` ([#1847](https://github.com/faker-js/faker/issues/1847)) ([f6c8ca3](https://github.com/faker-js/faker/commit/f6c8ca36b4e288697ae87a8bbdd027cd34947875))
75+
* **locale:** add Luxembourg (French) locale ([#1693](https://github.com/faker-js/faker/issues/1693)) ([c66f7bd](https://github.com/faker-js/faker/commit/c66f7bd70f930c4a080cc24cc8d09baab260f6d0))
76+
* **locale:** extend english company ([#1701](https://github.com/faker-js/faker/issues/1701)) ([f0e859b](https://github.com/faker-js/faker/commit/f0e859ba3033e54aefd71bf194da574593bc1631))
77+
578
## [8.0.0-alpha.0](https://github.com/faker-js/faker/compare/v7.6.0...v8.0.0-alpha.0) (2022-12-24)
679

780

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function createRandomUser(): User {
7474
};
7575
}
7676

77-
export const USERS: User[] = faker.helpers.multiple(generateRandomUser, {
77+
export const USERS: User[] = faker.helpers.multiple(createRandomUser, {
7878
count: 5,
7979
});
8080
```

cypress/e2e/api.cy.ts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,36 @@ describe('API Test', () => {
2323

2424
it('should include at least 1 element in each module', () => {
2525
cy.get('.api-group').each(($el) => {
26-
cy.wrap($el).get('li a[href]').should('have.length.above', 0);
26+
cy.wrap($el).within(() => {
27+
cy.get('li a[href]').should('have.length.above', 0);
28+
});
2729
});
2830
});
2931

3032
it('should not have dead links', () => {
33+
const checked = new Set<string>();
3134
cy.get('.api-group li').each(($el) => {
32-
const text = $el.find('a').text();
33-
const link = $el.find('a').attr('href');
35+
const anchor = $el.find('a');
36+
const text = anchor.text();
37+
const link = anchor.attr('href').split('#')[0];
38+
if (checked.has(link)) {
39+
return;
40+
}
3441

35-
cy.request(`/api/${link}`).should((response) => {
36-
expect(response.status).to.eq(200);
37-
expect(response.body).to.include(text);
38-
expect(response.body).to.not.include('PAGE NOT FOUND');
39-
});
42+
checked.add(link);
43+
44+
cy.request({
45+
method: 'HEAD',
46+
url: `/api/${link}`,
47+
failOnStatusCode: false,
48+
})
49+
.should(({ status }) => {
50+
expect(
51+
status,
52+
`${text} to have a working link: /api/${link}`
53+
).to.eq(200);
54+
})
55+
.end();
4056
});
4157
});
4258
});

docs/api/ApiIndex.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ function apiSearchFocusHandler(event: KeyboardEvent): void {
5353
} else {
5454
apiFilter.value!.blur();
5555
}
56+
} else if (event.key === 'Enter') {
57+
if (apiFilter.value !== document.activeElement) return;
58+
if (query.value === '') return;
59+
const item = filtered.value[0].items[0];
60+
if (!item) return;
61+
const header = item.headers[0];
62+
if (!header) return;
63+
window.location.href = item.link + '.html#' + slugify(header.anchor);
5664
} else if (
5765
/^[a-z]$/.test(event.key) &&
5866
!event.altKey &&

docs/guide/localization.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export const customFaker = new Faker({
117117
| `ro` | Romanian | `fakerRO` |
118118
| `ru` | Russian | `fakerRU` |
119119
| `sk` | Slovakian | `fakerSK` |
120+
| `sr_RS_latin` | Serbian (Latin) | `fakerSR_RS_latin` |
120121
| `sv` | Swedish | `fakerSV` |
121122
| `tr` | Turkish | `fakerTR` |
122123
| `uk` | Ukrainian | `fakerUK` |

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@faker-js/faker",
3-
"version": "8.0.0-alpha.0",
3+
"version": "8.0.0-alpha.1",
44
"description": "Generate massive amounts of fake contextual data",
55
"keywords": [
66
"faker",
@@ -90,26 +90,26 @@
9090
"@types/node": "~18.15.3",
9191
"@types/prettier": "~2.7.2",
9292
"@types/react": "~18.0.28",
93-
"@types/sanitize-html": "~2.8.1",
93+
"@types/sanitize-html": "~2.9.0",
9494
"@types/semver": "~7.3.13",
9595
"@types/validator": "~13.7.14",
96-
"@typescript-eslint/eslint-plugin": "~5.54.1",
97-
"@typescript-eslint/parser": "~5.54.1",
98-
"@vitest/coverage-c8": "~0.29.2",
99-
"@vitest/ui": "~0.29.2",
96+
"@typescript-eslint/eslint-plugin": "~5.56.0",
97+
"@typescript-eslint/parser": "~5.56.0",
98+
"@vitest/coverage-c8": "~0.29.3",
99+
"@vitest/ui": "~0.29.3",
100100
"@vueuse/core": "~9.13.0",
101101
"c8": "~7.13.0",
102102
"conventional-changelog-cli": "~2.2.2",
103-
"cypress": "~12.7.0",
104-
"esbuild": "~0.17.11",
103+
"cypress": "~12.8.1",
104+
"esbuild": "~0.17.12",
105105
"eslint": "~8.36.0",
106106
"eslint-config-prettier": "~8.7.0",
107-
"eslint-define-config": "~1.16.0",
107+
"eslint-define-config": "~1.17.0",
108108
"eslint-gitignore": "~0.1.0",
109109
"eslint-plugin-deprecation": "~1.3.3",
110-
"eslint-plugin-jsdoc": "~40.0.2",
110+
"eslint-plugin-jsdoc": "~40.1.0",
111111
"eslint-plugin-prettier": "~4.2.1",
112-
"glob": "~9.2.1",
112+
"glob": "~9.3.0",
113113
"npm-run-all": "~4.1.5",
114114
"picocolors": "~1.0.0",
115115
"prettier": "2.8.4",
@@ -121,16 +121,16 @@
121121
"semver": "~7.3.8",
122122
"standard-version": "~9.5.0",
123123
"tsx": "~3.12.5",
124-
"typedoc": "~0.23.26",
124+
"typedoc": "~0.23.28",
125125
"typedoc-plugin-missing-exports": "~1.0.0",
126126
"typescript": "~4.9.5",
127127
"validator": "~13.9.0",
128-
"vite": "~4.1.4",
129-
"vitepress": "1.0.0-alpha.58",
130-
"vitest": "~0.29.2",
128+
"vite": "~4.2.0",
129+
"vitepress": "1.0.0-alpha.60",
130+
"vitest": "~0.29.3",
131131
"vue": "~3.2.47"
132132
},
133-
"packageManager": "pnpm@7.29.1",
133+
"packageManager": "pnpm@7.30.0",
134134
"engines": {
135135
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
136136
"npm": ">=6.14.13"

0 commit comments

Comments
 (0)