Skip to content

Commit

Permalink
Merge branch 'next' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
xDivisionByZerox authored Apr 25, 2024
2 parents f2b7202 + 16ba43a commit 88128dd
Show file tree
Hide file tree
Showing 273 changed files with 15,466 additions and 14,107 deletions.
12 changes: 10 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ module.exports = defineConfig({
'unicorn/better-regex': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/import-style': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-object-as-default-parameter': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-export-from': 'off',
'unicorn/prefer-string-slice': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/require-array-join-separator': 'off',

'@typescript-eslint/array-type': [
'error',
Expand Down Expand Up @@ -95,6 +93,16 @@ module.exports = defineConfig({
{ blankLine: 'always', prev: 'block-like', next: '*' },
],
'@typescript-eslint/prefer-regexp-exec': 'error',
'@typescript-eslint/restrict-plus-operands': [
'error',
{
allowAny: false,
allowBoolean: false,
allowNullish: false,
allowNumberAndString: true,
allowRegExp: false,
},
],
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true, allowBoolean: true },
Expand Down
7 changes: 1 addition & 6 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@
},
{
"groupName": "doc-dependencies",
"matchPackageNames": [
"@algolia/client-search",
"typedoc",
"typedoc-plugin-missing-exports",
"vitepress"
]
"matchPackageNames": ["@algolia/client-search", "ts-morph", "vitepress"]
}
],
"vulnerabilityAlerts": {
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
# Required for docs/versions tests
fetch-depth: 0
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
run: date

- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
# Required for docs/versions tests
fetch-depth: 0
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
name: 'E2E Doc Test: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3

- name: Install pnpm
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
Expand All @@ -125,7 +125,7 @@ jobs:
name: 'Lint: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
fetch-depth: 0

Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
name: 'TS-Check: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
fetch-depth: 0

Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
name: 'Codecov: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
fetch-depth: 0

Expand All @@ -210,7 +210,7 @@ jobs:
run: pnpm vitest run --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
fetch-depth: 0

Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-manager-strict=false
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.pnpm-store/
coverage/
dist/
test/scripts/apidoc/temp/
test/scripts/apidocs/temp/
CHANGELOG.md
CHANGELOG_old.md
pnpm-lock.yaml
107 changes: 107 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,113 @@

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.

## [9.0.0-alpha.0](https://github.com/faker-js/faker/compare/v8.4.1...v9.0.0-alpha.0) (2024-04-12)


### ⚠ BREAKING CHANGES

* **locale:** remove unused global locale faker instance (#2789)
* **locale:** remove deprecated locale aliases (#2787)
* **date:** birthdate improvements (#2756)
* **date:** stricter error handling of between (#2719)
* **date:** fail on invalid dates (#2757)
* **location:** remove v8 deprecated location methods (#2753)
* remove v8 deprecated type aliases (#2754)
* **commerce:** remove v8 deprecated commerce method (#2752)
* **location:** remove default_country definitions (#2740)
* **helpers:** remove v8 deprecated helpers methods (#2729)
* **number:** remove v8 deprecated number parameter (#2738)
* **company:** remove v8 deprecated company methods (#2726)
* **phone:** add new style parameter (#2578)
* **finance:** remove v8 deprecated finance methods (#2727)
* **git:** remove v8 deprecated git method (#2716)
* **phone:** remove v8 deprecated phone format (#2712)
* **date:** remove v8 deprecated date methods (#2704)
* **helpers:** stricter checking for function signature passed to `multiple` (#2563)
* **internet:** remove v8 deprecated internet methods (#2699)
* **random:** remove v8 deprecated image methods (#2697)
* high precision random number generator (#2357)
* **person:** flatten jobs definitions (#2505)
* **datatype:** remove v8 deprecated datatype methods (#2694)
* **helpers:** use const generics where possible (#2685)
* **random:** remove deprecated random module (#2678)
* remove v8 deprecated faker class parts (#2682)
* **helpers:** remove v8 deprecated unique (#2661)
* switch to tsup (#2391)
* **image:** remove v8 deprecated providers (#2634)
* **image:** randomize defaults (#2472)
* **deps:** update dependency typescript to v5 (#1953)
* drop NodeJS v14 and v16 support (#2121)

### Features

* **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))
* **food:** new module ([#2484](https://github.com/faker-js/faker/issues/2484)) ([9aab7c2](https://github.com/faker-js/faker/commit/9aab7c2429b50c0f6e8bd1908344f9ff92912f5d))
* **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))
* **helpers:** use const generics where possible ([#2685](https://github.com/faker-js/faker/issues/2685)) ([c45537f](https://github.com/faker-js/faker/commit/c45537f6d4f3a28d8be1ebbe03567004c04af145))
* high precision random number generator ([#2357](https://github.com/faker-js/faker/issues/2357)) ([4ab0731](https://github.com/faker-js/faker/commit/4ab073164beab2bf690d7fffc7773e7b76d8e07e))
* **music:** add additional genres ([#2621](https://github.com/faker-js/faker/issues/2621)) ([7dae52b](https://github.com/faker-js/faker/commit/7dae52bfcd93c41ec9d2c4dd4d96a07f31c3dfc1))
* **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))
* **phone:** add new style parameter ([#2578](https://github.com/faker-js/faker/issues/2578)) ([e130549](https://github.com/faker-js/faker/commit/e130549e82a3d59af46f2d595ed47fa9a39724a3))


### Bug Fixes

* **commerce:** return fractional prices ([#2458](https://github.com/faker-js/faker/issues/2458)) ([9348138](https://github.com/faker-js/faker/commit/9348138893bb95faa5037c653443fbd525ce2939))
* **internet:** add Hebrew username charMapping ([#2781](https://github.com/faker-js/faker/issues/2781)) ([5860783](https://github.com/faker-js/faker/commit/5860783e81d392bc235408b697668ab8ecdd2d7c))
* **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))
* **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))
* restore support for moduleResolution Node* ([#2749](https://github.com/faker-js/faker/issues/2749)) ([2f07483](https://github.com/faker-js/faker/commit/2f074835e60240d8ac53e2d42fc7b5dac85d05b8))
* tree-shaking ([#2790](https://github.com/faker-js/faker/issues/2790)) ([fb65976](https://github.com/faker-js/faker/commit/fb65976acb1003f441a35afafbd87204eca0e2d7))


### infra

* drop NodeJS v14 and v16 support ([#2121](https://github.com/faker-js/faker/issues/2121)) ([1e0df8b](https://github.com/faker-js/faker/commit/1e0df8b81445d89b4a65bcab3a156b51ee1d1a38))


* **commerce:** remove v8 deprecated commerce method ([#2752](https://github.com/faker-js/faker/issues/2752)) ([8c80877](https://github.com/faker-js/faker/commit/8c80877f1691886e32c2b1eb799586c0c1b02b8b))
* **company:** remove v8 deprecated company methods ([#2726](https://github.com/faker-js/faker/issues/2726)) ([19bcf88](https://github.com/faker-js/faker/commit/19bcf886e41b13a6b77b92bac4775b18e8aa9418))
* **datatype:** remove v8 deprecated datatype methods ([#2694](https://github.com/faker-js/faker/issues/2694)) ([682a427](https://github.com/faker-js/faker/commit/682a4276f13d7b8f48e1bd8aafcf011c7bd10390))
* **date:** birthdate improvements ([#2756](https://github.com/faker-js/faker/issues/2756)) ([b498d1f](https://github.com/faker-js/faker/commit/b498d1f794e6d682e9d9fedebff194664c2a3f1d))
* **date:** fail on invalid dates ([#2757](https://github.com/faker-js/faker/issues/2757)) ([3485e7e](https://github.com/faker-js/faker/commit/3485e7eece540b63059e97bd8166d1ffd88334de))
* **date:** remove v8 deprecated date methods ([#2704](https://github.com/faker-js/faker/issues/2704)) ([e868060](https://github.com/faker-js/faker/commit/e868060c87cbca3c1bf90465d61fc39a4eea1f9c))
* **date:** stricter error handling of between ([#2719](https://github.com/faker-js/faker/issues/2719)) ([da35c51](https://github.com/faker-js/faker/commit/da35c51d16eccd99a7001a5b055a24806168435d))
* **deps:** update dependency typescript to v5 ([#1953](https://github.com/faker-js/faker/issues/1953)) ([bc3ebb7](https://github.com/faker-js/faker/commit/bc3ebb793666c0d7e58cf428ba12465a7b290cbe))
* **finance:** remove v8 deprecated finance methods ([#2727](https://github.com/faker-js/faker/issues/2727)) ([a536a9d](https://github.com/faker-js/faker/commit/a536a9d79f410986e6bd6dc1bc4a72252a0cc8d9))
* **git:** remove v8 deprecated git method ([#2716](https://github.com/faker-js/faker/issues/2716)) ([b3afc8f](https://github.com/faker-js/faker/commit/b3afc8f351003cf9df9984fb5be6cd46e18f71d8))
* **helpers:** remove v8 deprecated helpers methods ([#2729](https://github.com/faker-js/faker/issues/2729)) ([1169a05](https://github.com/faker-js/faker/commit/1169a0576ba1469d7c05be0b8fd844bde8a1af13))
* **helpers:** remove v8 deprecated unique ([#2661](https://github.com/faker-js/faker/issues/2661)) ([4382fd9](https://github.com/faker-js/faker/commit/4382fd9313821bf542829859e97d4422acc9e284))
* **image:** randomize defaults ([#2472](https://github.com/faker-js/faker/issues/2472)) ([92207b7](https://github.com/faker-js/faker/commit/92207b7df15732a61e613a4376a9ce88bd4f7b0f))
* **image:** remove v8 deprecated providers ([#2634](https://github.com/faker-js/faker/issues/2634)) ([44d698e](https://github.com/faker-js/faker/commit/44d698e14f48a32259fd52a39d1e3028f84f3c06))
* **internet:** remove v8 deprecated internet methods ([#2699](https://github.com/faker-js/faker/issues/2699)) ([3024d9e](https://github.com/faker-js/faker/commit/3024d9e7adeadb1c317aee308c594d3e18090b1a))
* **location:** remove default_country definitions ([#2740](https://github.com/faker-js/faker/issues/2740)) ([a409b46](https://github.com/faker-js/faker/commit/a409b468f942d964ce22ff42b52f8a756e0ca815))
* **location:** remove v8 deprecated location methods ([#2753](https://github.com/faker-js/faker/issues/2753)) ([6dee178](https://github.com/faker-js/faker/commit/6dee178558b87b73bba1395c11d2ffe3d156dad1))
* **number:** remove v8 deprecated number parameter ([#2738](https://github.com/faker-js/faker/issues/2738)) ([a672d27](https://github.com/faker-js/faker/commit/a672d277b883a445a852f9b6db18818104e8de7e))
* **person:** flatten jobs definitions ([#2505](https://github.com/faker-js/faker/issues/2505)) ([0d4cba6](https://github.com/faker-js/faker/commit/0d4cba637cdd38e7757ecca1b7eae75d7a737fa8))
* **phone:** remove v8 deprecated phone format ([#2712](https://github.com/faker-js/faker/issues/2712)) ([660da4c](https://github.com/faker-js/faker/commit/660da4c401b36ebfe0c0f7975c265146d9224921))
* **random:** remove deprecated random module ([#2678](https://github.com/faker-js/faker/issues/2678)) ([64ff107](https://github.com/faker-js/faker/commit/64ff107b8a9cd0965a67f00fd30cded144c02fd6))
* **random:** remove v8 deprecated image methods ([#2697](https://github.com/faker-js/faker/issues/2697)) ([e99fba9](https://github.com/faker-js/faker/commit/e99fba9729729e8a3107a659f5e00b9f18047298))
* remove v8 deprecated faker class parts ([#2682](https://github.com/faker-js/faker/issues/2682)) ([a9dc701](https://github.com/faker-js/faker/commit/a9dc7017b4a2b2bf79c42fe947de6029fae5e937))
* remove v8 deprecated type aliases ([#2754](https://github.com/faker-js/faker/issues/2754)) ([2ec602b](https://github.com/faker-js/faker/commit/2ec602ba1be4e04f261a96717a3d3c90a15a4c01))
* switch to tsup ([#2391](https://github.com/faker-js/faker/issues/2391)) ([db88a15](https://github.com/faker-js/faker/commit/db88a1518e8d0ccfe191bd48a1ae8641a9a25303))


### New Locales

* **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))
* **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))
* **locale:** extend Uzbek locale for commerce ([#2750](https://github.com/faker-js/faker/issues/2750)) ([b6b18d7](https://github.com/faker-js/faker/commit/b6b18d7f97e232bd133f117172e02df35fa16fec))
* **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))
* **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))


### Changed Locales

* **locale:** normalize animal data ([#2791](https://github.com/faker-js/faker/issues/2791)) ([03b965a](https://github.com/faker-js/faker/commit/03b965abfde57be617a1ae7ba715604e149a803d))
* **locale:** remove deprecated locale aliases ([#2787](https://github.com/faker-js/faker/issues/2787)) ([03ac471](https://github.com/faker-js/faker/commit/03ac47198313126c3cc8cb3fb9ef184360bb79eb))
* **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))

### [8.4.1](https://github.com/faker-js/faker/compare/v8.4.0...v8.4.1) (2024-02-06)

* JSDocs improvements
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { faker } from '@faker-js/faker';
// CJS
const { faker } = require('@faker-js/faker');

export function createRandomUser(): User {
export function createRandomUser() {
return {
userId: faker.string.uuid(),
username: faker.internet.userName(),
Expand All @@ -74,7 +74,7 @@ export function createRandomUser(): User {
};
}

export const USERS: User[] = faker.helpers.multiple(createRandomUser, {
export const users = faker.helpers.multiple(createRandomUser, {
count: 5,
});
```
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/components/api-docs/method-parameters.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { MethodParameter } from './method';
import type { ApiDocsMethodParameter } from './method';
const props = defineProps<{ parameters: MethodParameter[] }>();
const props = defineProps<{ parameters: ApiDocsMethodParameter[] }>();
</script>

<template>
Expand Down
18 changes: 9 additions & 9 deletions docs/.vitepress/components/api-docs/method.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
export interface Method {
export interface ApiDocsMethod {
readonly name: string;
readonly deprecated: string | undefined; // HTML
readonly description: string; // HTML
readonly parameters: MethodParameter[];
readonly since: string;
readonly parameters: ApiDocsMethodParameter[];
readonly returns: string;
readonly throws: string | undefined; // HTML
readonly examples: string; // HTML
readonly deprecated?: string; // HTML
readonly since: string;
readonly sourcePath: string; // URL-Suffix
readonly seeAlsos: string[];
readonly throws?: string; // HTML
readonly sourcePath: string; // URL-Suffix
}

export interface MethodParameter {
export interface ApiDocsMethodParameter {
readonly name: string;
readonly type?: string;
readonly default?: string;
readonly type: string | undefined;
readonly default: string | undefined;
readonly description: string; // HTML
}
4 changes: 2 additions & 2 deletions docs/.vitepress/components/api-docs/method.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import type { Method } from './method';
import type { ApiDocsMethod } from './method';
import MethodParameters from './method-parameters.vue';
import { slugify } from '../../shared/utils/slugify';
import { sourceBaseUrl } from '../../../api/source-base-url';
const props = defineProps<{ method: Method }>();
const props = defineProps<{ method: ApiDocsMethod }>();
function seeAlsoToUrl(see: string): string {
const [, module, method] = see.replace(/\(.*/, '').split('\.');
Expand Down
13 changes: 12 additions & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,15 @@ const config: UserConfig<DefaultTheme.Config> = {
socialLinks: [
{ icon: 'discord', link: 'https://chat.fakerjs.dev' },
{ icon: 'mastodon', link: 'https://fosstodon.org/@faker_js' },
{ icon: 'twitter', link: 'https://twitter.com/faker_js' },
{ icon: 'x', link: 'https://twitter.com/faker_js' },
{ icon: 'github', link: 'https://github.com/faker-js/faker' },
{
icon: {
svg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Open Collective</title><path d="M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12c2.54 0 4.894-.79 6.834-2.135l-3.107-3.109a7.715 7.715 0 1 1 0-13.512l3.107-3.109A11.943 11.943 0 0 0 12 0zm9.865 5.166l-3.109 3.107A7.67 7.67 0 0 1 19.715 12a7.682 7.682 0 0 1-.959 3.727l3.109 3.107A11.943 11.943 0 0 0 24 12c0-2.54-.79-4.894-2.135-6.834z"/></svg>',
},
link: 'https://opencollective.com/fakerjs',
ariaLabel: 'Open Collective',
},
],

algolia:
Expand Down Expand Up @@ -243,6 +250,10 @@ const config: UserConfig<DefaultTheme.Config> = {
text: 'Roadmap',
link: '/about/roadmap/',
items: [
{
text: 'v9 - Tree-Shakeable Module-Functions',
link: '/about/roadmap/v9',
},
{ text: 'v8 - Make Faker Handier', link: '/about/roadmap/v8' },
{
text: 'v7 - Cleanup & Improvements',
Expand Down
Loading

0 comments on commit 88128dd

Please sign in to comment.