Skip to content

Commit d7ca0e1

Browse files
authored
Merge branch 'main' into fix/mersenne-rand-invalid-input-argument
2 parents 34d277c + 2d68da1 commit d7ca0e1

Some content is hidden

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

126 files changed

+1963
-1142
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = defineConfig({
2828
rules: {
2929
// We may want to use this in the future
3030
'no-useless-escape': 'off',
31+
eqeqeq: ['error', 'always', { null: 'ignore' }],
3132

3233
'@typescript-eslint/ban-ts-comment': 'warn',
3334
'@typescript-eslint/consistent-type-imports': 'error',

.github/renovate.json5

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,51 @@
55
"reviewersFromCodeOwners": true,
66
"rangeStrategy": "bump",
77
"packageRules": [
8+
{
9+
"groupName": "devDependencies",
10+
"matchDepTypes": ["devDependencies"],
11+
"rangeStrategy": "bump"
12+
},
13+
{
14+
"groupName": "dependencies",
15+
"matchDepTypes": ["dependencies"],
16+
"rangeStrategy": "replace"
17+
},
18+
{
19+
"groupName": "peerDependencies",
20+
"matchDepTypes": ["peerDependencies"],
21+
"rangeStrategy": "widen"
22+
},
23+
{
24+
"groupName": "engines",
25+
"matchDepTypes": ["engines"],
26+
"rangeStrategy": "replace"
27+
},
828
{
929
"groupName": "typescript-eslint",
1030
"matchPackagePrefixes": ["@typescript-eslint/"]
1131
},
32+
{
33+
"groupName": "vitest",
34+
"matchPackageNames": ["@vitest/ui", "vitest"]
35+
},
36+
{
37+
"groupName": "prettier",
38+
"matchPackageNames": ["@types/prettier", "prettier"]
39+
},
40+
{
41+
"groupName": "typescript",
42+
"matchPackageNames": ["typescript"]
43+
},
1244
{
1345
"groupName": "doc-dependencies",
14-
"matchPackagePrefixes": [
46+
"matchPackageNames": [
1547
"typedoc",
1648
"typedoc-plugin-missing-exports",
1749
"vitepress"
1850
]
19-
},
20-
{
21-
"groupName": "vitest",
22-
"matchPackagePrefixes": ["@vitest/ui", "vitest"]
2351
}
2452
],
25-
"ignoreDeps": [
26-
// manually bumping
27-
"@types/node",
28-
"node",
29-
"npm",
30-
"prettier",
31-
"typescript"
32-
],
3353
"vulnerabilityAlerts": {
3454
"labels": ["security"],
3555
"assignees": ["team:maintainers"]

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ jobs:
2323
name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727

2828
- name: Install pnpm
2929
uses: pnpm/action-setup@v2
3030
with:
3131
version: 6
3232

3333
- name: Set node version to ${{ matrix.node_version }}
34-
uses: actions/setup-node@v2
34+
uses: actions/setup-node@v3
3535
with:
3636
node-version: ${{ matrix.node_version }}
3737
cache: 'pnpm'
@@ -52,7 +52,7 @@ jobs:
5252
name: 'E2E Doc Test: node-16, ubuntu-latest'
5353
steps:
5454
- name: Checkout
55-
uses: actions/checkout@v2
55+
uses: actions/checkout@v3
5656

5757
- name: Install pnpm
5858
uses: pnpm/action-setup@v2
@@ -70,7 +70,7 @@ jobs:
7070
name: 'Lint: node-16, ubuntu-latest'
7171
steps:
7272
- name: Checkout
73-
uses: actions/checkout@v2
73+
uses: actions/checkout@v3
7474
with:
7575
fetch-depth: 0
7676

@@ -80,7 +80,7 @@ jobs:
8080
version: 6
8181

8282
- name: Set node version to 16
83-
uses: actions/setup-node@v2
83+
uses: actions/setup-node@v3
8484
with:
8585
node-version: 16
8686
cache: 'pnpm'
@@ -101,7 +101,7 @@ jobs:
101101
name: 'Codecov: node-16, ubuntu-latest'
102102
steps:
103103
- name: Checkout
104-
uses: actions/checkout@v2
104+
uses: actions/checkout@v3
105105
with:
106106
fetch-depth: 0
107107

@@ -111,7 +111,7 @@ jobs:
111111
version: 6
112112

113113
- name: Set node version to 16
114-
uses: actions/setup-node@v2
114+
uses: actions/setup-node@v3
115115
with:
116116
node-version: 16
117117
cache: 'pnpm'

.github/workflows/issue-labeling.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: contribution welcome
1212
# If the issue is labeled with 'help wanted', a comment will be posted
1313
if: github.event.label.name == 'help wanted'
14-
uses: actions-cool/issues-helper@v2
14+
uses: actions-cool/issues-helper@v3
1515
with:
1616
actions: 'welcome, remove-labels'
1717
token: ${{ secrets.GITHUB_TOKEN }}
@@ -24,7 +24,7 @@ jobs:
2424
# If the issue is given either the 'enhancement' or 'bug' label, the 'pending triage' label will be removed
2525
# Issues without the label 'pending triage' are filtered with the third part of the condition, since the label does not have to be removed
2626
if: github.event.label.name == 'enhancement' || github.event.label.name == 'bug' || (contains(github.event.label.name, 'pending triage') == false)
27-
uses: actions-cool/issues-helper@v2
27+
uses: actions-cool/issues-helper@v3
2828
with:
2929
actions: 'remove-labels'
3030
token: ${{ secrets.GITHUB_TOKEN }}

.prettierrc.cjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
* @type {import('prettier').Options}
55
*/
66
module.exports = {
7-
plugins: [
8-
/* require.resolve("prettier-plugin-organize-imports") */
9-
],
7+
plugins: [require.resolve('prettier-plugin-organize-imports')],
108
singleQuote: true,
119
overrides: [
1210
{

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
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+
## [6.0.0-beta.0](https://github.com/faker-js/faker/compare/v6.0.0-alpha.6...v6.0.0-beta.0) (2022-03-07)
6+
7+
8+
### Features
9+
10+
* **types:** generate all locales index files with non-any types ([#494](https://github.com/faker-js/faker/issues/494)) ([b611ca1](https://github.com/faker-js/faker/commit/b611ca1c6f7d756f224a1a7b641e36b531d169be))
11+
* **types:** provide strong typing for locales 2 ([#398](https://github.com/faker-js/faker/issues/398)) ([419e9e2](https://github.com/faker-js/faker/commit/419e9e20a570b44909faf24c9019bf7f232ee7a9))
12+
13+
14+
### Bug Fixes
15+
16+
* correcting the readme file ([#529](https://github.com/faker-js/faker/issues/529)) ([6c9dcdd](https://github.com/faker-js/faker/commit/6c9dcdd03050ef70554fc2bb6ccc0c883fd1edc9))
17+
* fix bicycle_types files being named incorrectly ([#477](https://github.com/faker-js/faker/issues/477)) ([7a2a522](https://github.com/faker-js/faker/commit/7a2a522c181dc696f6e9b4767ca18d39bad4476d))
18+
* fix time.recent method signature ([#586](https://github.com/faker-js/faker/issues/586)) ([60d3cc5](https://github.com/faker-js/faker/commit/60d3cc519cd2cab061a23fbe09164d8b59e177ff))
19+
* fix unique method types ([#457](https://github.com/faker-js/faker/issues/457)) ([14df7d3](https://github.com/faker-js/faker/commit/14df7d3f70b54c4a153f5dcf111ef90575bbbe9e))
20+
* handle missing or broken locales main index files ([#478](https://github.com/faker-js/faker/issues/478)) ([ff97431](https://github.com/faker-js/faker/commit/ff974319a63acbcbbb96cf1a67a48616de9fd9da))
21+
* move el credit card information to the expected location ([#484](https://github.com/faker-js/faker/issues/484)) ([dcbd18e](https://github.com/faker-js/faker/commit/dcbd18e13ab53e837de17cec7b3f8e51ba479d0e))
22+
* remove invalid aliases ([#488](https://github.com/faker-js/faker/issues/488)) ([58fbfe3](https://github.com/faker-js/faker/commit/58fbfe3835b0f27949e7eb262d246eb9d84bb870))
23+
* test random.alphaNumeric ([#517](https://github.com/faker-js/faker/issues/517)) ([41ec6f0](https://github.com/faker-js/faker/commit/41ec6f08784afc2a674568328a0ea2bfb033a411))
24+
525
## [6.0.0-alpha.7](https://github.com/faker-js/faker/compare/v6.0.0-alpha.6...v6.0.0-alpha.7) (2022-02-20)
626

727

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const randomEmail = faker.internet.email(); // [email protected]
5959
const randomCard = faker.helpers.createCard(); // random contact card containing many properties
6060
```
6161

62-
### Deno
62+
### CDN/Deno
6363

6464
```js
6565
import { faker } from 'https://cdn.skypack.dev/@faker-js/faker';

docs/.vitepress/config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export default defineConfig({
9696
editLinkText: 'Suggest changes to this page',
9797
nav,
9898
sidebar,
99-
algolia,
99+
// TODO 2022-03-06: https://github.com/faker-js/faker/issues/222
100+
// algolia,
100101
},
101102
});

docs/.vitepress/theme/components/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Playground from './Playground.vue';
21
import Badge from './Badge.vue';
2+
import Playground from './Playground.vue';
33

44
export default {
55
Playground,

docs/.vitepress/theme/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import './index.css';
2-
import GlobalComponents from './components';
31
import DefaultTheme from 'vitepress/theme';
2+
import GlobalComponents from './components';
3+
import './index.css';
44

55
export default {
66
...DefaultTheme,

docs/api/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
*.md
2-
!fake.md
32
!localization.md
43
*.ts

docs/api/fake.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/migration-guide-v5/index.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,49 @@ Faker now ships with its own types! Remove `@types/faker` from your `package.jso
3636

3737
### Tree-shaking
3838

39-
Faker now supports tree-shaking! We highly recommend that you take advantage of your bundler's tree-shaking capabilities and change how you import Faker. This is especially true if you're importing Faker in the browser.
39+
:::warning
40+
Tree shaking is not yet fully supported due to some structural issues. But we plan to make Faker fully tree-shakable in the future.
41+
:::
4042

41-
Faker is a giant package made up of many megabytes of strings. Only import what you need.
43+
For now Faker supports tree-shaking for some parts, and we highly recommend that you take advantage of your bundler's tree-shaking capabilities and change how you import Faker right now.
4244

43-
:::tip
44-
Migrating to the new tree-shakeable syntax should be quick and painless.
45-
:::
45+
Instead of using:
4646

47-
For JS:
47+
```ts
48+
// js
49+
const faker = require('@faker-js/faker');
4850

49-
```js
51+
// ts
52+
import faker from '@faker-js/faker';
53+
```
54+
55+
You should switch to:
56+
57+
```ts
58+
// js
5059
const { faker } = require('@faker-js/faker');
5160

52-
// Or specific locale
53-
const fakerDe = require('@faker-js/faker/locale/de');
61+
// ts
62+
import { faker } from '@faker-js/faker';
5463
```
5564

56-
For TS:
65+
If you only need one specific language, we highly recommend to make use of the locale specific imports like:
5766

5867
```ts
59-
import { faker } from '@faker-js/faker';
68+
// js
69+
const fakerDe = require('@faker-js/faker/locale/de');
6070

61-
// Or specific locale
71+
// ts
6272
import fakerDe from '@faker-js/faker/locale/de';
6373
```
6474

65-
Please [open an issue on GitHub](https://github.com/faker-js/faker/issues/new?assignees=&labels=pending+triage&template=freestyle.md) if we've missed any steps.
75+
This is especially true if you're importing Faker in the browser.
76+
77+
Faker is a giant package made up of many megabytes of strings. Only import what you need.
78+
79+
_We plan to load the locales in another way in a future major release._
80+
81+
---
6682

6783
Happy Faking!
6884

docs/update.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ We have eight maintainers currently.
4646
- griest - [GitLab](https://gitlab.com/griest)
4747
- Mateus Dadalto - [GitHub](https://github.com/MateusDadalto), [Twitter](https://twitter.com/MateusD)
4848
- Jessica Sachs - [GitHub](https://github.com/JessicaSachs), [Twitter](https://twitter.com/_JessicaSachs)
49+
- Daniel Theuke - [GitHub](https://github.com/ST-DDT)
4950

5051
## What has the team done so far?
5152

package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@faker-js/faker",
3-
"version": "6.0.0-alpha.7",
3+
"version": "6.0.0-beta.0",
44
"description": "Generate massive amounts of fake contextual data",
55
"keywords": [
66
"faker",
@@ -90,41 +90,42 @@
9090
},
9191
"devDependencies": {
9292
"@types/markdown-it": "~12.2.3",
93-
"@types/node": "~16.11.25",
93+
"@types/node": "~16.11.26",
9494
"@types/prettier": "~2.4.4",
9595
"@types/sanitize-html": "~2.6.2",
9696
"@types/validator": "~13.7.1",
97-
"@typescript-eslint/eslint-plugin": "~5.12.1",
98-
"@typescript-eslint/parser": "~5.12.1",
99-
"@vitest/ui": "~0.5.1",
97+
"@typescript-eslint/eslint-plugin": "~5.14.0",
98+
"@typescript-eslint/parser": "~5.14.0",
99+
"@vitest/ui": "~0.6.0",
100100
"c8": "~7.11.0",
101101
"conventional-changelog-cli": "~2.2.2",
102-
"cypress": "~9.5.0",
103-
"esbuild": "~0.14.23",
104-
"eslint": "~8.9.0",
105-
"eslint-config-prettier": "~8.4.0",
102+
"cypress": "~9.5.1",
103+
"esbuild": "~0.14.25",
104+
"eslint": "~8.10.0",
105+
"eslint-config-prettier": "~8.5.0",
106106
"eslint-define-config": "~1.2.5",
107107
"eslint-gitignore": "~0.1.0",
108-
"eslint-plugin-jsdoc": "~37.9.4",
108+
"eslint-plugin-jsdoc": "~37.9.7",
109109
"eslint-plugin-prettier": "~4.0.0",
110110
"esno": "~0.14.1",
111-
"lint-staged": "~12.3.4",
111+
"lint-staged": "~12.3.5",
112112
"npm-run-all": "~4.1.5",
113113
"picocolors": "~1.0.0",
114114
"prettier": "2.5.1",
115+
"prettier-plugin-organize-imports": "~2.3.4",
115116
"rimraf": "~3.0.2",
116117
"sanitize-html": "~2.7.0",
117118
"simple-git-hooks": "~2.7.0",
118119
"standard-version": "~9.3.2",
119-
"typedoc": "~0.22.12",
120+
"typedoc": "~0.22.13",
120121
"typedoc-plugin-missing-exports": "~0.22.6",
121-
"typescript": "~4.5.5",
122+
"typescript": "~4.6.2",
122123
"validator": "~13.7.0",
123-
"vite": "~2.8.4",
124-
"vitepress": "~0.22.2",
125-
"vitest": "~0.5.1"
124+
"vite": "~2.8.6",
125+
"vitepress": "~0.22.3",
126+
"vitest": "~0.6.0"
126127
},
127-
"packageManager": "pnpm@6.31.0",
128+
"packageManager": "pnpm@6.32.3",
128129
"engines": {
129130
"node": ">=14.0.0",
130131
"npm": ">=7.0.0"

0 commit comments

Comments
 (0)