Skip to content

Commit

Permalink
Merge branch 'next' into feat/samfn/faker-core
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Oct 16, 2024
2 parents e807a8e + ba4ef9a commit e659674
Show file tree
Hide file tree
Showing 96 changed files with 3,427 additions and 1,214 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:34a8d83d38c96b2b59e42d522f09313b02223185896d52b07d9c3e8ba2b6266f",
"image": "mcr.microsoft.com/devcontainers/typescript-node:22@sha256:79c4181532784148abe5d0dd37505f420674990fd104f8294fd06155003fa442",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
2 changes: 1 addition & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
{
"groupName": "doc-dependencies",
"matchPackageNames": ["@algolia/client-search", "ts-morph", "vitepress"]
"matchPackageNames": ["ts-morph", "vitepress"]
}
],
"stopUpdatingLabel": "s: on hold",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:

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

- name: Checkout playground
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
repository: faker-js/playground
path: playground
Expand All @@ -33,7 +33,7 @@ jobs:
package_json_file: faker/package.json

- name: Set node version to 22
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 22
cache: 'pnpm'
Expand Down
24 changes: 12 additions & 12 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
# Required for docs/versions tests
fetch-depth: 0
Expand All @@ -31,7 +31,7 @@ jobs:
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
run: date

- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
# Required for docs/versions tests
fetch-depth: 0
Expand All @@ -79,7 +79,7 @@ jobs:
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
Expand All @@ -104,7 +104,7 @@ jobs:
name: 'E2E Doc Test: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
Expand All @@ -125,15 +125,15 @@ jobs:
name: 'Lint: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
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@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 22
cache: 'pnpm'
Expand All @@ -155,15 +155,15 @@ jobs:
name: 'TS-Check: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
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@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 22
cache: 'pnpm'
Expand All @@ -185,15 +185,15 @@ jobs:
name: 'Codecov: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
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@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 22
cache: 'pnpm'
Expand All @@ -210,7 +210,7 @@ jobs:
run: pnpm vitest run --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
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@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 22
cache: 'pnpm'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/preflight-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
name: 'Comment Code Generation'
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
ref: 'next'

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

- name: Set node version to 22
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 22
cache: 'pnpm'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prepare-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
Expand All @@ -33,7 +33,7 @@ jobs:
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set node version to 22
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 22
cache: 'pnpm'
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
release:
types: [published]

permissions: {} # we use a personal access token to push the release branch
permissions:
# we use a personal access token to push the release branch
id-token: write # required for provenance/signed releases on npm

jobs:
publish:
Expand All @@ -13,7 +15,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0 # we want to push the release branch later
token: ${{ secrets.GH_TOKEN }}
Expand All @@ -22,7 +24,7 @@ jobs:
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set node version to 22
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 22
cache: 'pnpm'
Expand Down Expand Up @@ -56,6 +58,7 @@ jobs:
pnpm publish --tag next --no-git-checks
env:
CYPRESS_INSTALL_BINARY: 0
NPM_CONFIG_PROVENANCE: true

- name: Set latest/next dist-tag
run: |
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

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.3](https://github.com/faker-js/faker/compare/v9.0.2...v9.0.3) (2024-09-26)


### Changed Locales

* **locale:** update french legal entity types ([#3142](https://github.com/faker-js/faker/issues/3142)) ([d6bceb6](https://github.com/faker-js/faker/commit/d6bceb662de6559446fedb11de53a632a525aba0))


### Bug Fixes

* **image:** fix dataUri with type svg-base64 in browsers ([#3144](https://github.com/faker-js/faker/issues/3144)) ([78b2a3a](https://github.com/faker-js/faker/commit/78b2a3a8b85679eeff27beccebcc404b0a5ff3cf))

## [9.0.2](https://github.com/faker-js/faker/compare/v9.0.1...v9.0.2) (2024-09-23)


### Bug Fixes

* **locale:** improve pt_PT location and person data ([#3020](https://github.com/faker-js/faker/issues/3020)) ([3e47ee7](https://github.com/faker-js/faker/commit/3e47ee7da671296e11ed2b219f85b06c9d05d677))

## [9.0.1](https://github.com/faker-js/faker/compare/v9.0.0...v9.0.1) (2024-09-14)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const { faker } = require('@faker-js/faker');
export function createRandomUser() {
return {
userId: faker.string.uuid(),
username: faker.internet.userName(),
username: faker.internet.username(), // before version 9.1.0, use userName()
email: faker.internet.email(),
avatar: faker.image.avatar(),
password: faker.internet.password(),
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const apiPages = [
items: [
{ text: 'Airline', link: '/api/airline.html' },
{ text: 'Animal', link: '/api/animal.html' },
{ text: 'Book', link: '/api/book.html' },
{ text: 'Color', link: '/api/color.html' },
{ text: 'Commerce', link: '/api/commerce.html' },
{ text: 'Company', link: '/api/company.html' },
Expand Down
30 changes: 27 additions & 3 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import type { DefaultTheme } from 'vitepress/theme';
import { apiPages } from './api-pages';
import {
algoliaIndex,
currentVersion,
version,
versionBannerInfix,
versionLabel,
versionLinks,
} from './versions';

Expand Down Expand Up @@ -149,6 +150,26 @@ const config: UserConfig<DefaultTheme.Config> = {
href: 'https://fosstodon.org/@faker_js',
},
],
[
'script',
{
id: 'browser-console-faker',
},
`
const logStyle = 'background: rgba(16, 183, 127, 0.14); color: rgba(255, 255, 245, 0.86); padding: 0.5rem; display: inline-block;';
console.log(\`%cIf you would like to test Faker in the browser console, you can do so using 'await enableFaker()'.
If you would like to test Faker in a playground, visit https://new.fakerjs.dev.\`, logStyle);
async function enableFaker() {
const imported = await import('https://cdn.jsdelivr.net/npm/@faker-js/faker@${version}/+esm');
Object.assign(globalThis, imported);
console.log(\`%cYou can now start using Faker v${version}:
e.g. 'faker.food.description()' or 'fakerZH_CN.person.firstName()'
For other languages please refer to https://fakerjs.dev/guide/localization.html#available-locales
For a full list of all methods please refer to https://fakerjs.dev/api/\`, logStyle);
return imported;
}
`,
],
],

themeConfig: {
Expand Down Expand Up @@ -197,7 +218,10 @@ const config: UserConfig<DefaultTheme.Config> = {
},
{
text: 'Try it',
items: [{ text: 'StackBlitz ', link: 'https://fakerjs.dev/new' }],
items: [
{ text: 'StackBlitz ', link: 'https://fakerjs.dev/new' },
{ text: 'Browser Console ', link: '/guide/usage.html#browser' },
],
},
{
text: 'About',
Expand All @@ -222,7 +246,7 @@ const config: UserConfig<DefaultTheme.Config> = {
],
},
{
text: currentVersion,
text: versionLabel,
items: [
{
text: 'Release Notes',
Expand Down
Loading

0 comments on commit e659674

Please sign in to comment.