Skip to content

Commit

Permalink
Merge branch 'next' into pr/pomali/2563
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Mar 1, 2024
2 parents 1d53c6a + 9348138 commit 4ea171c
Show file tree
Hide file tree
Showing 246 changed files with 8,376 additions and 10,711 deletions.
11 changes: 2 additions & 9 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { readGitignoreFiles } = require('eslint-gitignore');
module.exports = defineConfig({
ignorePatterns: [
...readGitignoreFiles(),
'.eslintrc.js', // Skip self linting
'.eslintrc.cjs', // Skip self linting
],
root: true,
env: {
Expand All @@ -35,6 +35,7 @@ module.exports = defineConfig({
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-else-return': 'error',
'no-restricted-globals': ['error', 'Intl'],
'prefer-exponentiation-operator': 'error',
'prefer-template': 'error',

'unicorn/no-nested-ternary': 'off', // incompatible with prettier
Expand All @@ -43,13 +44,6 @@ module.exports = defineConfig({
'unicorn/number-literal-case': 'off', // incompatible with prettier
'unicorn/prefer-ternary': 'off', // ternaries aren't always better

// TODO @Shinigami92 2023-09-23: prefer-at should be turned on when we drop support for Node 14.
'unicorn/prefer-at': 'off',
// TODO @Shinigami92 2023-09-23: prefer-string-replace-all should be turned on when we drop support for Node 14.
'unicorn/prefer-string-replace-all': 'off',
// TODO @ST-DDT 2023-10-28: The following rule should be turned on when we switch to esm.
'unicorn/prefer-top-level-await': 'off',

// TODO @Shinigami92 2023-09-23: The following rules currently conflict with our code.
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
'unicorn/better-regex': 'off',
Expand All @@ -58,7 +52,6 @@ module.exports = defineConfig({
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-object-as-default-parameter': 'off',
'unicorn/no-useless-switch-case': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-export-from': 'off',
'unicorn/prefer-string-slice': 'off',
Expand Down
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* -crlf
* text eol=lf
*.png binary
18 changes: 1 addition & 17 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
# These owners will be the default owners for everything in the repo.
# Unless a later match takes precedence, @faker-js/maintainers will
# be requested for review when someone opens a pull request.

* @faker-js/maintainers

# ================================================
# Docs owners ...
# ================================================

/docs/ @faker-js/maintainers-docs @faker-js/maintainers
netlify.toml @faker-js/maintainers-docs @faker-js/maintainers
README.md @faker-js/maintainers-docs @faker-js/maintainers
CONTRIBUTING.md @faker-js/maintainers-docs @faker-js/maintainers

# ================================================
# CODEOWNERS owners ...
# ================================================

/.github/CODEOWNERS @faker-js/maintainers
* @faker-js/maintainers
3 changes: 3 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"helpers:pinGitHubActionDigests"
],
"labels": ["c: dependencies"],
"lockFileMaintenance": {
"enabled": true
},
"reviewersFromCodeOwners": true,
"rangeStrategy": "bump",
"packageRules": [
Expand Down
63 changes: 23 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,24 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node_version: [14, 16, 18, 20]
include:
- os: macos-latest
node_version: 16
- os: macos-latest
node_version: 18
- os: macos-latest
node_version: 20
- os: windows-latest
node_version: 16
- os: windows-latest
node_version: 18
- os: windows-latest
node_version: 20
os: [ubuntu-latest, macos-latest, windows-latest]
node_version: [18, 20]
fail-fast: false
timeout-minutes: 10

name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
steps:
- name: Checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Required for docs/versions tests
fetch-depth: 0

- name: Install pnpm (node 14, pnpm 7)
if: matrix.node_version == 14
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
with:
version: 7

- name: Install pnpm
if: matrix.node_version != 14
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
Expand Down Expand Up @@ -90,16 +70,16 @@ jobs:
run: date

- name: Checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Required for docs/versions tests
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
Expand All @@ -124,10 +104,10 @@ jobs:
name: 'E2E Doc Test: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

- name: Install deps
run: pnpm install
Expand All @@ -145,15 +125,15 @@ jobs:
name: 'Lint: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

- name: Set node version to 20
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'pnpm'
Expand All @@ -175,15 +155,15 @@ jobs:
name: 'TS-Check: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

- name: Set node version to 20
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'pnpm'
Expand All @@ -193,6 +173,9 @@ jobs:
env:
CYPRESS_INSTALL_BINARY: 0

- name: Build types
run: pnpm run build:types

- name: Check scripts
run: pnpm run ts-check

Expand All @@ -202,15 +185,15 @@ jobs:
name: 'Codecov: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

- name: Set node version to 20
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'pnpm'
Expand All @@ -227,7 +210,7 @@ jobs:
run: pnpm vitest run --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
uses: codecov/codecov-action@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 # v4.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
6 changes: 3 additions & 3 deletions .github/workflows/commentCodeGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import type { context as ctx, GitHub } from '@actions/github/lib/utils';
* @param context An object containing the context of the workflow run
* @param isSuccess A boolean indicating whether the workflow was successful
*/
module.exports = async (
export async function script(
github: InstanceType<typeof GitHub>,
context: typeof ctx,
isSuccess: boolean
) => {
): Promise<void> {
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down Expand Up @@ -45,4 +45,4 @@ module.exports = async (
body,
});
}
};
}
15 changes: 9 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

- name: Set node version to 20
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'pnpm'
Expand All @@ -41,22 +41,25 @@ jobs:
pnpm run build
pnpm run test -u
continue-on-error: true
env:
CI_PREFLIGHT: true

- name: Check diff
id: diff
run: |
git add .
git diff --cached --exit-code
git diff --cached --name-only | sed -E 's/^(.*)$/::error file=\1,title=Diff detected::Please run `pnpm run preflight` and commit the changes./'
git diff --cached --name-only --exit-code
continue-on-error: true

- name: Transpile ts
run: pnpm exec tsc .github/workflows/commentCodeGeneration.ts --outDir .github/workflows
run: pnpm tsup-node .github/workflows/commentCodeGeneration.ts --format cjs --clean false --out-dir .github/workflows

- name: Comment
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const script = require('${{ github.workspace }}/.github/workflows/commentCodeGeneration.js')
const { script } = require('${{ github.workspace }}/.github/workflows/commentCodeGeneration.cjs')
await script(github, context, ${{ steps.generate.outcome == 'success' && steps.diff.outcome == 'success' }})
- name: Status
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Semantic Pull Request
steps:
- name: Validate PR title
uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 # v5.2.0
uses: amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f # v5.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
4 changes: 4 additions & 0 deletions .prettierrc.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { Options } from 'prettier';

declare const options: Options;
export = options;
5 changes: 3 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @ts-check

/**
* @type {import('prettier').Options}
* @type {import('prettier').Config}
*/
module.exports = {
export default {
plugins: ['prettier-plugin-organize-imports'],
singleQuote: true,
trailingComma: 'es5',
Expand All @@ -20,6 +20,7 @@ module.exports = {
{
files: '*.md',
options: {
// @ts-expect-error: known property
organizeImportsSkipDestructiveCodeActions: true,
},
},
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

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.

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

* JSDocs improvements

## [8.4.0](https://github.com/faker-js/faker/compare/v8.3.1...v8.4.0) (2024-01-24)


### Features

* **helpers:** add support for complex intermediate types ([#2550](https://github.com/faker-js/faker/issues/2550)) ([24482a3](https://github.com/faker-js/faker/commit/24482a30042eec5b553b30d60985e89fd69a8660))
* **number:** add parameter `fractionDigits` in float ([#1855](https://github.com/faker-js/faker/issues/1855)) ([41d8778](https://github.com/faker-js/faker/commit/41d87789c7ff353acfd0f5ca88a99c0d1fd3b500))
* **person:** add job titles for fr ([#2531](https://github.com/faker-js/faker/issues/2531)) ([ba28ab6](https://github.com/faker-js/faker/commit/ba28ab6e59009cceb5b691ddd212e09df22b586e))


### Bug Fixes

* **finance:** correct VG IBAN format ([#2552](https://github.com/faker-js/faker/issues/2552)) ([b8049d1](https://github.com/faker-js/faker/commit/b8049d171086bce7b46eb617c88f44cfdd019e00))
* **internet:** username method to return value that always includes… ([#2506](https://github.com/faker-js/faker/issues/2506)) ([0ee1c67](https://github.com/faker-js/faker/commit/0ee1c6751ec97e10ca1436d2b100b4acb1ac90ec))
* **locale:** incomplete airline names in zh_CN ([#2558](https://github.com/faker-js/faker/issues/2558)) ([5525b55](https://github.com/faker-js/faker/commit/5525b55cc47fa97b55de52fccff7ab51633e639a))
* **number:** improve float generation for precisions of form 10^-n ([#2581](https://github.com/faker-js/faker/issues/2581)) ([39c715d](https://github.com/faker-js/faker/commit/39c715d916d69e83795932260f1681df3241db91))

### [8.3.1](https://github.com/faker-js/faker/compare/v8.3.0...v8.3.1) (2023-11-14)


Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This is a shorthand for running the following scripts in order:

## Good to know

- The project is being built by [esbuild](https://esbuild.github.io) (see [bundle.ts](scripts/bundle.ts))
- The project is being built by [tsup](https://tsup.egoist.dev) (see [tsup.config.ts](tsup.config.ts))
- The documentation is running via VitePress.
Make sure you **build** the project before running the docs, cause some files depend on `dist`.
Use `pnpm run docs:dev` to edit them in live mode.
Expand Down Expand Up @@ -49,7 +49,7 @@ Please only change files related to one module (e.g. person, location) whenever

## Building Faker

The project is being built by [esbuild](https://esbuild.github.io) (see [bundle.ts](scripts/bundle.ts))
The project is being built by [tsup](https://tsup.egoist.dev) (see [tsup.config.ts](tsup.config.ts))

```shell
pnpm install
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Faker - Copyright (c) 2022-2023
Faker - Copyright (c) 2022-2024

This software consists of voluntary contributions made by many individuals.
For exact contribution history, see the revision history
Expand Down
Loading

0 comments on commit 4ea171c

Please sign in to comment.