Skip to content

Commit

Permalink
Merge branch 'next' into renovate/major-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Jul 8, 2024
2 parents 0a1079b + c8eff9e commit 7e524ae
Show file tree
Hide file tree
Showing 815 changed files with 105,329 additions and 81,888 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "FakerJs",
"image": "mcr.microsoft.com/devcontainers/typescript-node:22@sha256:52f2401bd5937985be000f34bb33bb3a3a47bd20249d91bc787d8f00eba220e9",
"image": "mcr.microsoft.com/devcontainers/typescript-node:22@sha256:2c54a060aadfb853e8d57377eb093b1593fca93864f67a32e7e977e4df0e4329",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/check-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Check Release PR

on:
pull_request:
paths:
- 'CHANGELOG.md'

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
check_release_pr:
name: Check Release PR
if: startsWith(github.head_ref, 'chore/release/')
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout faker
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: faker

- name: Checkout playground
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: faker-js/playground
path: playground

- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
package_json_file: faker/package.json

- name: Set node version to 22
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: |
faker/pnpm-lock.yaml
playground/pnpm-lock.yaml
- name: Install deps - faker
run: |
cd faker
pnpm install
env:
CYPRESS_INSTALL_BINARY: 0

- name: Build - faker
run: |
cd faker
pnpm run build
- name: Install deps - playground
run: |
cd playground
sed -i 's/overrides-for-release/overrides/' package.json
pnpm install --no-frozen-lockfile
- name: Build - playground
run: |
cd playground
pnpm run build
- name: Test - playground
run: |
cd playground
pnpm run test
18 changes: 9 additions & 9 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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
# Required for docs/versions tests
fetch-depth: 0
Expand Down Expand Up @@ -98,13 +98,13 @@ jobs:
e2e-test:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.6.1-chrome-116.0.5845.187-1-ff-117.0-edge-116.0.1938.76-1@sha256:cd909915e1a0aa24dbd3eaf95feb2a7be6cf9961fa425ffa06cd5a44d211451c
image: cypress/browsers:node-22.0.0-chrome-124.0.6367.60-1-ff-125.0.2-edge-124.0.2478.51-1@sha256:02eaae11b7d3dc9f408a5f64c3990faea75943d612ea86b8b218d95b48f22ce8
options: --user 1001
timeout-minutes: 10
name: 'E2E Doc Test: node-20, ubuntu-latest'
name: 'E2E Doc Test: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
Expand All @@ -125,7 +125,7 @@ jobs:
name: 'Lint: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
name: 'TS-Check: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
name: 'Codecov: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
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@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
52 changes: 52 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Draft Release

on:
pull_request_target:
types:
- closed
paths:
- 'CHANGELOG.md'

permissions:
contents: write # to create releases

jobs:
draft_release:
name: Draft Release
if: >
startsWith(github.event.pull_request.title, 'chore(release):')
&& github.event.pull_request.merged
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0 # we need the tags and the commit history for the gh release create command
ref: ${{ github.event.pull_request.base.ref }}

- name: Gather release information
run: |
RELEASE_VERSION=$(jq -r '.version' package.json)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
PREVIOUS_VERSION=$(git describe --tags --abbrev=0)
echo "PREVIOUS_VERSION=$PREVIOUS_VERSION" >> $GITHUB_ENV
if [[ "$RELEASE_VERSION" == *"-"* ]]; then
RELEASE_ARGS="--prerelease"
else
RELEASE_ARGS="--latest"
fi
echo "RELEASE_ARGS=$RELEASE_ARGS" >> $GITHUB_ENV
- name: Create draft release
run: |
gh release create \
v$RELEASE_VERSION \
--draft \
$RELEASE_ARGS \
--generate-notes \
--notes-start-tag $PREVIOUS_VERSION \
--title v$RELEASE_VERSION
env:
GH_TOKEN: ${{ github.token }}
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/prepare-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Prepare Release PR

on:
workflow_dispatch:
inputs:
releaseType:
description: 'The type of release to prepare a PR for.'
required: true
type: choice
default: 'stable'
options:
- stable
- alpha
- beta
- rc

permissions:
contents: write
pull-requests: write

jobs:
prepare_release_pr:
name: Prepare Release PR
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set node version to 22
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 22
cache: 'pnpm'

- name: Install deps
run: pnpm install
env:
CYPRESS_INSTALL_BINARY: 0

- name: Run release
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if [ $RELEASE_TYPE = 'stable' ]; then
pnpm run release
else
pnpm run release --prerelease $RELEASE_TYPE
fi
RELEASE_VERSION=$(jq -r '.version' package.json)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
env:
RELEASE_TYPE: ${{ github.event.inputs.releaseType }}

- name: Switch to and push release branch
run: |
RELEASE_BRANCH="chore/release/$RELEASE_VERSION"
echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV
git switch -c $RELEASE_BRANCH
git push origin $RELEASE_BRANCH -f
- name: Create draft PR
run: |
gh pr create \
--base $GITHUB_REF_NAME \
--head $RELEASE_BRANCH \
--draft \
--title "chore(release): $RELEASE_VERSION" \
--body "
Release for $RELEASE_VERSION
- [ ] Completed manual changes/tasks for this release
---
- Checklist: TODO add link to issue
"
env:
GH_TOKEN: ${{ github.token }}
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@cfb60706e18bc85e8aec535e3c577abe8f70378e # v5.5.2
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ dist
# Docs
docs/.vitepress/cache
docs/.vitepress/dist
docs/api/typedoc.json
docs/public/api-diff-index.json

# Faker
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,59 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [9.0.0-alpha.1](https://github.com/faker-js/faker/compare/v9.0.0-alpha.0...v9.0.0-alpha.1) (2024-06-22)


### ⚠ BREAKING CHANGES

* **date:** separate timeZone method (#2947)
* **locale:** use singular locale definition keys (#2932)
* **locale:** use snake case for all locale data (#2910)
* **locale:** remove location data index-value-binding (#2476)

### New Locales

* **locale:** add lorem for uz_UZ_latin ([#2824](https://github.com/faker-js/faker/issues/2824)) ([6e6fa4c](https://github.com/faker-js/faker/commit/6e6fa4cd090e5d7dc60d2c0eed3a01013ab4a111))
* **locale:** extend Hebrew (he) for company ([#2921](https://github.com/faker-js/faker/issues/2921)) ([29df384](https://github.com/faker-js/faker/commit/29df38468fc90efaaf749a5c39a1b2c1f2e6bf46))


### Features

* **bitcoinAddress:** multiple bitcoin address types and testnet ([#2922](https://github.com/faker-js/faker/issues/2922)) ([3ae9393](https://github.com/faker-js/faker/commit/3ae93934bc4cf5f6414acfa28ea727f758d18756))
* **date:** separate timeZone method ([#2947](https://github.com/faker-js/faker/issues/2947)) ([d6924f7](https://github.com/faker-js/faker/commit/d6924f7fbb9403d106022f58a1bda3b159e88ae6))
* **music:** add album and artist methods ([#2620](https://github.com/faker-js/faker/issues/2620)) ([f682750](https://github.com/faker-js/faker/commit/f6827505712f48e448d4d4ef2dc3198e6967bbad))


### Changed Locales

* **locale:** activate data normalization for airline ([#2828](https://github.com/faker-js/faker/issues/2828)) ([d71662e](https://github.com/faker-js/faker/commit/d71662e153f6915e95af750419e0042e5c2c49d4))
* **locale:** activate data normalization for color ([#2837](https://github.com/faker-js/faker/issues/2837)) ([b754dc6](https://github.com/faker-js/faker/commit/b754dc6ac8be86a2b5c550d743899390997362a6))
* **locale:** normalize commerce data ([#2868](https://github.com/faker-js/faker/issues/2868)) ([425997f](https://github.com/faker-js/faker/commit/425997fdb2c9f7d746c688b0a0c5ba1f884550d0))
* **locale:** normalize company data ([#2889](https://github.com/faker-js/faker/issues/2889)) ([5ba44bc](https://github.com/faker-js/faker/commit/5ba44bc4a62b708b86cd50cda74977bc3b697240))
* **locale:** normalize database data ([#2873](https://github.com/faker-js/faker/issues/2873)) ([1eea7fe](https://github.com/faker-js/faker/commit/1eea7fe7caa3a41d5651ead3c4604a0fc99f0aba))
* **locale:** normalize date data ([#2902](https://github.com/faker-js/faker/issues/2902)) ([9226945](https://github.com/faker-js/faker/commit/922694553874beb312821c62c1c1fd3afc63a315))
* **locale:** normalize finance data ([#2915](https://github.com/faker-js/faker/issues/2915)) ([353e85c](https://github.com/faker-js/faker/commit/353e85cda53919c97fe9d190633b4c9c1401f213))
* **locale:** normalize hacker data ([#2866](https://github.com/faker-js/faker/issues/2866)) ([2d5fbe5](https://github.com/faker-js/faker/commit/2d5fbe5c559bbb086fb35f87209c3cebf9be89a2))
* **locale:** normalize music data ([#2857](https://github.com/faker-js/faker/issues/2857)) ([425e10f](https://github.com/faker-js/faker/commit/425e10fe1cfeff74b04a7ed931241625e951f33c))
* **locale:** normalize science data ([#2886](https://github.com/faker-js/faker/issues/2886)) ([bbdd998](https://github.com/faker-js/faker/commit/bbdd998787e40a96630d436f82aa86c67f76fb64))
* **locale:** normalize vehicle data ([#2874](https://github.com/faker-js/faker/issues/2874)) ([737de3a](https://github.com/faker-js/faker/commit/737de3ab7cefe6d66ac1465807a2fa9a5017f930))
* **locale:** remove discontinued credit card issuer "maestro" ([#2803](https://github.com/faker-js/faker/issues/2803)) ([cd5577c](https://github.com/faker-js/faker/commit/cd5577c546f17f6468b35c0c6164a666584ba67c))
* **locale:** remove location data index-value-binding ([#2476](https://github.com/faker-js/faker/issues/2476)) ([453ea97](https://github.com/faker-js/faker/commit/453ea970a4c7ed19e9d41fd026923f42dbd4e768))
* **locale:** unfreeze arrays ([#2928](https://github.com/faker-js/faker/issues/2928)) ([badaa6d](https://github.com/faker-js/faker/commit/badaa6d60593fe41a1afa0e9a8bef6ae5bb8a352))
* **locale:** use singular locale definition keys ([#2932](https://github.com/faker-js/faker/issues/2932)) ([a5ffca1](https://github.com/faker-js/faker/commit/a5ffca1c7863531d459f67cbab7bd9ba34d16904))
* **locale:** use snake case for all locale data ([#2910](https://github.com/faker-js/faker/issues/2910)) ([558b959](https://github.com/faker-js/faker/commit/558b959e0e2f791dab0ba2f500493ba7ddbd25e2))


### Bug Fixes

* **date:** fix birthdate ([#2829](https://github.com/faker-js/faker/issues/2829)) ([462c80e](https://github.com/faker-js/faker/commit/462c80e09703010709a52531b85d0d9c0bbd3448))
* **locale:** clean up Hungarian words ([#2816](https://github.com/faker-js/faker/issues/2816)) ([16ba43a](https://github.com/faker-js/faker/commit/16ba43a6a4d1c93ac588c6b4c20b8c2a40213bdb))
* **locale:** fix typo in Persian date data ([#2888](https://github.com/faker-js/faker/issues/2888)) ([042c871](https://github.com/faker-js/faker/commit/042c87162d85570ac722590c1f0c65f75421dbaf))
* **locale:** misc spelling errors in commerce & food ([#2809](https://github.com/faker-js/faker/issues/2809)) ([734a7f3](https://github.com/faker-js/faker/commit/734a7f3d55d1233d8182585bb79d2013f0ce289e))
* **locale:** remove Pizza from Greek words ([#2908](https://github.com/faker-js/faker/issues/2908)) ([80b4a23](https://github.com/faker-js/faker/commit/80b4a23b904db1abe1408480bbf56704d048b165))
* **person:** workaround for inherited first- and lastNames ([#2834](https://github.com/faker-js/faker/issues/2834)) ([016a5b6](https://github.com/faker-js/faker/commit/016a5b62f678013a4f9a50bda10dcf20405a6e55))
* **vehicle:** Make VIN number generation more accurate ([#2765](https://github.com/faker-js/faker/issues/2765)) ([1f7568a](https://github.com/faker-js/faker/commit/1f7568ab1a7010c7f9c713f4ac4c2d5e0cfb350b))

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


Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This is a shorthand for running the following scripts in order:
- `pnpm run build:clean` - removes artifacts from previous builds
- `pnpm run build:code` - builds the code, both CommonJS and ESM versions
- `pnpm run build:types` - builds the TypeScript type definitions
- `pnpm run test:update-snapshots ` - runs all tests, and updates any snapshots if needed
- `pnpm run test:update-snapshots` - runs all tests, and updates any snapshots if needed
- `pnpm run ts-check` - checks that there are no TypeScript errors in any files

## Good to know
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const users = faker.helpers.multiple(createRandomUser, {

## 💎 Modules

An in-depth overview of the API methods is available in the documentation for [v8 (stable)](https://fakerjs.dev/api/) and [v8.\* (next)](https://next.fakerjs.dev/api/).
An in-depth overview of the API methods is available in the documentation for [v8 (stable)](https://fakerjs.dev/api/) and [v9.\* (next)](https://next.fakerjs.dev/api/).

### Templates

Expand Down
Loading

0 comments on commit 7e524ae

Please sign in to comment.