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 authored May 14, 2024
2 parents 790e645 + 7fb9bb5 commit e4da2f5
Show file tree
Hide file tree
Showing 266 changed files with 7,753 additions and 4,907 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:0-18",
"image": "mcr.microsoft.com/devcontainers/typescript-node:20@sha256:173debabac3a927225aac3fa451dfd1baa780d5fb8f8e513b1efc615e3221225",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ module.exports = defineConfig({

'vitest/expect-expect': 'off',
'vitest/prefer-each': 'error',
'vitest/prefer-to-have-length': 'error',
'vitest/valid-expect': ['error', { maxArgs: 2 }],
},
},
Expand Down
1 change: 1 addition & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"matchPackageNames": ["@algolia/client-search", "ts-morph", "vitepress"]
}
],
"stopUpdatingLabel": "s: on hold",
"vulnerabilityAlerts": {
"labels": ["c: security", "p: 2-high"],
"assignees": ["team:maintainers"]
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
# Required for docs/versions tests
fetch-depth: 0

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

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
Expand Down Expand Up @@ -70,13 +70,13 @@ jobs:
run: date

- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
# Required for docs/versions tests
fetch-depth: 0

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

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
Expand Down Expand Up @@ -104,10 +104,10 @@ jobs:
name: 'E2E Doc Test: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

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

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

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

- name: Set node version to 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
Expand All @@ -155,12 +155,12 @@ jobs:
name: 'TS-Check: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0

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

- name: Set node version to 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
Expand All @@ -185,12 +185,12 @@ jobs:
name: 'Codecov: node-20, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0

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

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

- name: Upload coverage to Codecov
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0

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

- name: Set node version to 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
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@e9fabac35e210fea40ca5b14c0da95a099eff26f # v5.4.0
uses: amannn/action-semantic-pull-request@cfb60706e18bc85e8aec535e3c577abe8f70378e # v5.5.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
3 changes: 3 additions & 0 deletions .versionrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"skip": {
"tag": true
},
"types": [
{ "type": "feat", "scope": "locale", "section": "New Locales" },
{ "type": "feat", "section": "Features" },
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

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.
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.0](https://github.com/faker-js/faker/compare/v8.4.1...v9.0.0-alpha.0) (2024-04-12)

Expand Down
137 changes: 51 additions & 86 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { apiPages } from './api-pages';
import {
algoliaIndex,
currentVersion,
oldVersions,
versionBannerInfix,
versionLinks,
} from './versions';

type SidebarItem = DefaultTheme.SidebarItem;
Expand All @@ -14,36 +14,71 @@ const description =
'Generate massive amounts of fake (but reasonable) data for testing and development.';
const image = 'https://fakerjs.dev/social-image.png';

function extendSideNav(current: SidebarItem): SidebarItem[] {
function getSideBarWithExpandedEntry(entryToExpand: string): SidebarItem[] {
const links: SidebarItem[] = [
{
text: 'Guide',
items: [
{
text: 'Usage Guide',
text: 'Getting Started',
link: '/guide/',
},
{
text: 'Usage',
link: '/guide/usage',
},
{
text: 'Localization',
link: '/guide/localization',
},
{
text: 'Frameworks',
link: '/guide/frameworks',
},
{
text: 'Randomizer',
link: '/guide/randomizer',
},
{
text: 'Unique Values',
link: '/guide/unique',
},
{
text: 'Upgrading to v9',
link: '/guide/upgrading',
},
],
},
{
text: 'API',
items: [
{
text: 'API Reference',
link: '/api/',
},
],
items: apiPages,
},
{
text: 'About',
items: [
{
text: 'Announcements',
link: '/about/announcements',
items: [
{ text: '2022-09-08', link: '/about/announcements/2022-09-08' },
{ text: '2022-01-14', link: '/about/announcements/2022-01-14' },
],
},
{
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',
link: '/about/roadmap/v7',
},
{ text: 'v6 - Continue Faker', link: '/about/roadmap/v6' },
],
},
{
text: 'Team',
Expand All @@ -56,7 +91,9 @@ function extendSideNav(current: SidebarItem): SidebarItem[] {
],
},
];
links[links.findIndex((group) => group.text === current.text)] = current;
for (const entry of links) {
entry.collapsed = entry.text !== entryToExpand;
}
return links;
}

Expand Down Expand Up @@ -188,7 +225,7 @@ const config: UserConfig<DefaultTheme.Config> = {
text: 'Release Notes',
link: 'https://github.com/faker-js/faker/releases',
},
...oldVersions.map(({ version, link }) => ({
...versionLinks.map(({ version, link }) => ({
text: version,
link,
})),
Expand All @@ -197,81 +234,9 @@ const config: UserConfig<DefaultTheme.Config> = {
],

sidebar: {
'/guide/': extendSideNav({
text: 'Guide',
items: [
{
text: 'Getting Started',
link: '/guide/',
},
{
text: 'Usage',
link: '/guide/usage',
},
{
text: 'Localization',
link: '/guide/localization',
},
{
text: 'Frameworks',
link: '/guide/frameworks',
},
{
text: 'Randomizer',
link: '/guide/randomizer',
},
{
text: 'Unique Values',
link: '/guide/unique',
},
{
text: 'Upgrading to v9',
link: '/guide/upgrading',
},
],
}),
'/api/': extendSideNav({
text: 'API',
items: apiPages,
}),

'/about/': extendSideNav({
text: 'About',
items: [
{
text: 'Announcements',
link: '/about/announcements',
items: [
{ text: '2022-09-08', link: '/about/announcements/2022-09-08' },
{ text: '2022-01-14', link: '/about/announcements/2022-01-14' },
],
},
{
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',
link: '/about/roadmap/v7',
},
{ text: 'v6 - Continue Faker', link: '/about/roadmap/v6' },
],
},
{
text: 'Team',
link: '/about/team',
},
{
text: 'Contributing',
link: '/about/contributing',
},
],
}),
'/guide/': getSideBarWithExpandedEntry('Guide'),
'/api/': getSideBarWithExpandedEntry('API'),
'/about/': getSideBarWithExpandedEntry('About'),
},
},

Expand Down
Loading

0 comments on commit e4da2f5

Please sign in to comment.