Skip to content

Commit

Permalink
Merge branch 'feat/helpers/issue-1850/add_support_for_complex_interme…
Browse files Browse the repository at this point in the history
…diate_return_types_in_fake_method' of github.com:inkedtree/faker into feat/helpers/issue-1850/add_support_for_complex_intermediate_return_types_in_fake_method
  • Loading branch information
Alexander committed Sep 10, 2023
2 parents bc9e533 + 9da6bbb commit acccce2
Show file tree
Hide file tree
Showing 167 changed files with 7,096 additions and 677 deletions.
2 changes: 1 addition & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
{
"groupName": "vitest",
"matchPackageNames": ["@vitest/coverage-c8", "@vitest/ui", "vitest"]
"matchPackageNames": ["@vitest/coverage-v8", "@vitest/ui", "vitest"]
},
{
"groupName": "prettier",
Expand Down
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ If adding new data definitions to Faker, you'll often need to find source data.
- But if you are compiling a list of, for example, popular personal names or cities, don't copy directly from a single source (Wikipedia, 'most popular' articles, government data sites etc). A compilation of facts [can be copyrighted](https://en.wikipedia.org/wiki/Copyright_in_compilation).
- It's best to refer to multiple sources and use your own judgement/knowledge to make a sample list of data.

## Adding new locale or updating existing one

After adding new or updating existing locale data, you need to run `pnpm run generate:locales` to generate/update the related files.
If you change more than 20 locale files, please consider splitting your PR into one per category (e.g. person, location).

## Building Faker

The project is being built by [esbuild](https://esbuild.github.io) (see [bundle.ts](scripts/bundle.ts))
Expand Down Expand Up @@ -163,10 +168,6 @@ describe('someModule', () => {
});
```

## Adding new locale or updating existing one

After adding new or updating existing locale data, you need to run `pnpm run generate:locales` to generate/update the related files.

## Deprecation workflow

If you ever find yourself deprecating something in the source code, you can follow these steps to save yourself (and the reviewers) some trouble.
Expand Down
5 changes: 4 additions & 1 deletion docs/about/team/members.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@
"name": "Matt Mayer",
"title": "Contributor",
"desc": "",
"links": [{ "icon": "github", "link": "https://github.com/matthewmayer" }]
"links": [
{ "icon": "github", "link": "https://github.com/matthewmayer" }
],
"sponsor": "https://github.com/sponsors/matthewmayer"
},
{
"avatar": "https://github.com/pkuczynski.png",
Expand Down
10 changes: 5 additions & 5 deletions docs/guide/frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { faker } from '@faker-js/faker/locale/en';

describe('reverse array', () => {
it('should reverse the array', () => {
const title = faker.name.jobTitle();
const name = faker.name.fullName();
const title = faker.person.jobTitle();
const name = faker.person.fullName();
const animal = faker.animal.bear();

const array = [title, name, animal];
Expand All @@ -36,7 +36,7 @@ These are especially useful in tests that are meant to be deterministic, such as
- [Snapshots in Jest](https://jestjs.io/docs/snapshot-testing)

```ts
import { describe, it, expect } from 'vitest';
import { afterEach, describe, it, expect } from 'vitest';
import { faker } from '@faker-js/faker/locale/en';

// We might want other tests to *not* be seeded. This will re-seed our faker instance after each test.
Expand All @@ -48,8 +48,8 @@ describe('reverse array', () => {
it('should reverse the array', () => {
// Seed our faker instance with some static number.
faker.seed(1234);
const title = faker.name.jobTitle();
const name = faker.name.fullName();
const title = faker.person.jobTitle();
const name = faker.person.fullName();
const animal = faker.animal.bear();

const array = [title, name, animal];
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Faker is a popular library that generates fake (but reasonable) data that can be
- Building Demos
- Working without a completed backend

Faker was originally written in [Perl](https://metacpan.org/dist/Data-Faker) and this is the JavaScript port. Language bindings also exist for [Ruby](https://github.com/faker-ruby/faker), [Java](https://github.com/DiUS/java-faker), and [Python](https://github.com/joke2k/faker).
Faker was originally written in [Perl](https://metacpan.org/dist/Data-Faker) and this is the JavaScript port. Faker is also available as a library for [Ruby](https://github.com/faker-ruby/faker), [Java](https://github.com/DiUS/java-faker), and [Python](https://github.com/joke2k/faker).

This documentation only covers the JavaScript implementation of Faker.

## Environments

You can run Faker in the Browser, within Node, or the many other languages supported by Faker. ([Perl](https://metacpan.org/dist/Data-Faker), [Ruby](https://github.com/faker-ruby/faker), [Java](https://github.com/DiUS/java-faker), and [Python](https://github.com/joke2k/faker))
You can run Faker in the browser, or in Node.js. Faker v8.0 requires Node.js version 14 or above. Both ESM and CommonJS imports are available.

## Installation

Expand Down
8 changes: 5 additions & 3 deletions docs/guide/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

Did you know Faker supports many different locales?
When using our default instance `import { faker } from '@faker-js/faker'` you get English data.
However, we also provide pre-built instances for more than 50 other locales.
However, we also provide pre-built instances for [more than 60 available locales](#available-locales).

`import { fakerDE as faker } from '@faker-js/faker'`
For example, you can import the German locale:

See below for a list of available locales.
`import { fakerDE as faker } from '@faker-js/faker'`

::: tip Note
You can also build your own Faker instances, with custom locales/overwrites.
Expand Down Expand Up @@ -98,6 +98,7 @@ In this example there are 5 locales. Each of these is checked in order, and the
| `en_NG` | English (Nigeria) | `fakerEN_NG` |
| `en_US` | English (United States) | `fakerEN_US` |
| `en_ZA` | English (South Africa) | `fakerEN_ZA` |
| `eo` | Esperanto | `fakerEO` |
| `es` | Spanish | `fakerES` |
| `es_MX` | Spanish (Mexico) | `fakerES_MX` |
| `fa` | Farsi/Persian | `fakerFA` |
Expand Down Expand Up @@ -136,6 +137,7 @@ In this example there are 5 locales. Each of these is checked in order, and the
| `uk` | Ukrainian | `fakerUK` |
| `ur` | Urdu | `fakerUR` |
| `vi` | Vietnamese | `fakerVI` |
| `yo_NG` | Yoruba (Nigeria) | `fakerYO_NG` |
| `zh_CN` | Chinese (China) | `fakerZH_CN` |
| `zh_TW` | Chinese (Taiwan) | `fakerZH_TW` |
| `zu_ZA` | Zulu (South Africa) | `fakerZU_ZA` |
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,42 +89,42 @@
"devDependencies": {
"@actions/github": "~5.1.1",
"@algolia/client-search": "~4.19.1",
"@types/markdown-it": "~13.0.0",
"@types/node": "~20.5.0",
"@types/markdown-it": "~13.0.1",
"@types/node": "~20.5.9",
"@types/sanitize-html": "~2.9.0",
"@types/semver": "~7.5.0",
"@types/semver": "~7.5.1",
"@types/validator": "~13.11.1",
"@typescript-eslint/eslint-plugin": "~6.4.0",
"@typescript-eslint/parser": "~6.4.0",
"@vitest/coverage-v8": "~0.34.1",
"@vitest/ui": "~0.34.1",
"@vueuse/core": "~10.3.0",
"conventional-changelog-cli": "~3.0.0",
"cypress": "~12.17.4",
"@typescript-eslint/eslint-plugin": "~6.5.0",
"@typescript-eslint/parser": "~6.5.0",
"@vitest/coverage-v8": "~0.34.3",
"@vitest/ui": "~0.34.3",
"@vueuse/core": "~10.4.1",
"conventional-changelog-cli": "~4.0.0",
"cypress": "~13.1.0",
"esbuild": "~0.19.2",
"eslint": "~8.47.0",
"eslint": "~8.48.0",
"eslint-config-prettier": "~9.0.0",
"eslint-define-config": "~1.23.0",
"eslint-gitignore": "~0.1.0",
"eslint-plugin-deprecation": "~1.5.0",
"eslint-plugin-jsdoc": "~46.4.6",
"eslint-plugin-jsdoc": "~46.5.1",
"eslint-plugin-prettier": "~5.0.0",
"eslint-plugin-vitest": "~0.2.8",
"glob": "~10.3.3",
"eslint-plugin-vitest": "~0.3.1",
"glob": "~10.3.4",
"npm-run-all": "~4.1.5",
"prettier": "3.0.1",
"prettier": "3.0.2",
"prettier-plugin-organize-imports": "~3.2.3",
"rimraf": "~5.0.1",
"sanitize-html": "~2.11.0",
"semver": "~7.5.4",
"standard-version": "~9.5.0",
"tsx": "~3.12.7",
"tsx": "~3.12.8",
"typedoc": "~0.24.8",
"typescript": "~4.9.5",
"validator": "~13.11.0",
"vite": "~4.4.9",
"vitepress": "1.0.0-beta.7",
"vitest": "~0.34.1",
"vitest": "~0.34.3",
"vue": "~3.3.4"
},
"packageManager": "pnpm@8.5.1",
Expand Down
Loading

0 comments on commit acccce2

Please sign in to comment.