Skip to content

Commit

Permalink
chore: merge next
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Jan 30, 2023
2 parents 444b9f0 + be77179 commit 5b8408a
Show file tree
Hide file tree
Showing 32 changed files with 1,537 additions and 374 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ jobs:

e2e-test:
runs-on: ubuntu-latest
timeout-minutes: 15
container: cypress/browsers:node18.12.0-chrome107
timeout-minutes: 10
name: 'E2E Doc Test: node-18, ubuntu-latest'
steps:
- name: Checkout
Expand All @@ -121,11 +122,6 @@ jobs:
with:
version: 7

- name: Set node version to 18
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install deps
run: pnpm install

Expand All @@ -134,11 +130,6 @@ jobs:

- id: e2e
name: Run e2e
run: timeout 5m pnpm run docs:test:e2e:run
continue-on-error: true

- name: Run e2e (2nd attempt)
if: ${{ steps.e2e.outcome != 'success' }}
run: pnpm run docs:test:e2e:run

lint:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The API covers the following modules:

| Module | Example | Output |
| -------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| Airline | `faker.airline.airport()` | `{ name: 'Dallas Fort Worth International Airport', iataCode: 'DFW' }` |
| Animal | `faker.animal.cat()` | Norwegian Forest Cat |
| Color | `faker.color.rgb()` | #cdfcdc |
| Commerce | `faker.commerce.product()` | Polo t-shirt |
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 @@ -2,6 +2,7 @@
// Run 'pnpm run generate:api-docs' to update
export const apiPages = [
{ text: 'Overview', link: '/api/' },
{ text: 'Airline', link: '/api/airline.html' },
{ text: 'Animal', link: '/api/animal.html' },
{ text: 'Color', link: '/api/color.html' },
{ text: 'Commerce', link: '/api/commerce.html' },
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/components/api-docs/method.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function seeAlsoToUrl(see: string): string {
:href="seeAlsoToUrl(seeAlso)"
v-html="seeAlso"
/>
<template v-else v-html="seeAlso" />
<div v-else v-html="seeAlso" />
</li>
</ul>
</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { DefaultTheme } from 'vitepress/theme';
import { apiPages } from './api-pages';
import { currentVersion, oldVersions, versionBannerInfix } from './versions';

type SidebarGroup = DefaultTheme.SidebarGroup;
type SidebarItem = DefaultTheme.SidebarItem;

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: SidebarGroup): SidebarGroup[] {
const links: SidebarGroup[] = [
function extendSideNav(current: SidebarItem): SidebarItem[] {
const links: SidebarItem[] = [
{
text: 'Guide',
items: [
Expand Down
19 changes: 14 additions & 5 deletions docs/guide/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,20 @@ The `faker.address.*` methods will continue to work as an alias in v8 and v9, bu
The number-related methods previously found in `faker.datatype` have been moved to a new `faker.number` module.
For the old `faker.datatype.number` method you should replace with `faker.number.int` or `faker.number.float` depending on the precision required.

faker.datatype.number() //35
faker.datatype.int() //35

faker.datatype.number({precision:0.01}) //35.21
faker.datatype.float({precision:0.01}) //35.21
By default, `faker.number.float` no longer defaults to a precision of 0.01

```js
// OLD
faker.datatype.number({ max: 100 }); // 35
faker.datatype.number({ max: 100, precision: 0.01 }); // 35.21
faker.datatype.float({ max: 100 }); // 35.21
faker.datatype.float({ max: 100, precision: 0.001 }); // 35.211

// NEW
faker.number.int({ max: 100 }); // 35
faker.number.float({ max: 100 }); // 35.21092065742612
faker.number.float({ max: 100, precision: 0.01 }); // 35.21
```

| Old method | New method |
| ----------------------- | ------------------------------------------ |
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,21 @@
"@types/react": "~18.0.27",
"@types/sanitize-html": "~2.8.0",
"@types/semver": "~7.3.13",
"@types/validator": "~13.7.10",
"@typescript-eslint/eslint-plugin": "~5.48.2",
"@typescript-eslint/parser": "~5.48.2",
"@vitest/coverage-c8": "~0.27.3",
"@vitest/ui": "~0.27.3",
"@vueuse/core": "~9.11.1",
"@types/validator": "~13.7.11",
"@typescript-eslint/eslint-plugin": "~5.49.0",
"@typescript-eslint/parser": "~5.49.0",
"@vitest/coverage-c8": "~0.28.3",
"@vitest/ui": "~0.28.3",
"@vueuse/core": "~9.12.0",
"c8": "~7.12.0",
"conventional-changelog-cli": "~2.2.2",
"cypress": "~12.3.0",
"esbuild": "~0.17.4",
"eslint": "~8.32.0",
"cypress": "~12.4.1",
"esbuild": "~0.17.5",
"eslint": "~8.33.0",
"eslint-config-prettier": "~8.6.0",
"eslint-define-config": "~1.14.0",
"eslint-gitignore": "~0.1.0",
"eslint-plugin-jsdoc": "~39.6.7",
"eslint-plugin-jsdoc": "~39.7.4",
"eslint-plugin-prettier": "~4.2.1",
"glob": "~8.1.0",
"npm-run-all": "~4.1.5",
Expand All @@ -112,7 +112,7 @@
"prettier-plugin-organize-imports": "~3.2.2",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"rimraf": "~4.1.1",
"rimraf": "~4.1.2",
"sanitize-html": "~2.8.1",
"semver": "~7.3.8",
"standard-version": "~9.5.0",
Expand All @@ -122,11 +122,11 @@
"typescript": "~4.9.4",
"validator": "~13.7.0",
"vite": "~4.0.4",
"vitepress": "1.0.0-alpha.40",
"vitest": "~0.27.3",
"vitepress": "1.0.0-alpha.43",
"vitest": "~0.28.3",
"vue": "~3.2.45"
},
"packageManager": "pnpm@7.25.1",
"packageManager": "pnpm@7.26.2",
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
"npm": ">=6.14.13"
Expand Down
Loading

0 comments on commit 5b8408a

Please sign in to comment.