Skip to content

Commit

Permalink
Merge branch 'next' into unify-date-signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
ejcheng authored Nov 29, 2022
2 parents 72e3841 + c78cc37 commit 8018653
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 187 deletions.
38 changes: 32 additions & 6 deletions docs/guide/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ Not the version you are looking for?

:::

## `faker.mersenne` and `faker.helpers.repeatString` removed
## Breaking changes

### `faker.mersenne` and `faker.helpers.repeatString` removed

`faker.mersenne` and `faker.helpers.repeatString` were only ever intended for internal use, and are no longer available.

## Other deprecated methods replaced
### Other deprecated methods removed/replaced

| Old method | New method |
| ------------------------------- | ----------------------------------------------------------------- |
Expand All @@ -27,8 +29,19 @@ Not the version you are looking for?
| `faker.phone.phoneNumber` | `faker.phone.number` |
| `faker.phone.phoneNumberFormat` | No direct replacement, see documentation for `faker.phone.number` |
| `faker.phone.phoneFormats` | No direct replacement, see documentation for `faker.phone.number` |
| `faker.name.findName` | _Removed, replace with `faker.person.fullName`_ |
| `faker.address.cityPrefix` | _Removed_ |
| `faker.address.citySuffix` | _Removed_ |
| `faker.address.streetPrefix` | _Removed_ |
| `faker.address.streetSuffix` | _Removed_ |

### Locale renamed

The `en_IND` (English, India) locale was renamed to `en_IN` for consistency with other locales.

## Deprecations and other changes

## `faker.name` changed to `faker.person`
### `faker.name` changed to `faker.person`

The whole `faker.name` module is now located at `faker.person`, as it contains more information than just names.
The `faker.name.*` methods will continue to work as an alias in v8 and v9, but it is recommended to change to `faker.person.*`
Expand All @@ -50,7 +63,7 @@ The `faker.name.*` methods will continue to work as an alias in v8 and v9, but i
| `faker.name.jobType` | `faker.person.jobType` |
| `faker.name.findName` | _Removed, replace with `faker.person.fullName`_ |

## `faker.address` changed to `faker.location`
### `faker.address` changed to `faker.location`

The whole `faker.address` module is now located at `faker.location`, as it contains more information than just addresses.
The `faker.address.*` methods will continue to work as an alias in v8 and v9, but it is recommended to change to `faker.location.*`
Expand Down Expand Up @@ -84,6 +97,19 @@ The `faker.address.*` methods will continue to work as an alias in v8 and v9, bu
| `faker.address.streetPrefix` | _Removed_ |
| `faker.address.streetSuffix` | _Removed_ |

## Locale renamed
### Number methods of `faker.datatype` moved to new `faker.number` module

The `en_IND` (English, India) locale was renamed to `en_IN` for consistency with other locales.
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

| Old method | New method |
| ----------------------- | ------------------------------------------ |
| `faker.datatype.number` | `faker.number.int` or `faker.number.float` |
| `faker.datatype.float` | `faker.number.float` |
| `faker.datatype.bigInt` | `faker.number.bigInt` |
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,28 +103,28 @@
"@types/sanitize-html": "~2.6.2",
"@types/semver": "~7.3.13",
"@types/validator": "~13.7.10",
"@typescript-eslint/eslint-plugin": "~5.43.0",
"@typescript-eslint/parser": "~5.43.0",
"@vitest/coverage-c8": "~0.25.2",
"@vitest/ui": "~0.25.2",
"@vueuse/core": "~9.5.0",
"@typescript-eslint/eslint-plugin": "~5.44.0",
"@typescript-eslint/parser": "~5.44.0",
"@vitest/coverage-c8": "~0.25.3",
"@vitest/ui": "~0.25.3",
"@vueuse/core": "~9.6.0",
"c8": "~7.12.0",
"conventional-changelog-cli": "~2.2.2",
"cypress": "~11.1.0",
"esbuild": "~0.15.15",
"cypress": "~11.2.0",
"esbuild": "~0.15.16",
"eslint": "~8.28.0",
"eslint-config-prettier": "~8.5.0",
"eslint-define-config": "~1.12.0",
"eslint-gitignore": "~0.1.0",
"eslint-plugin-jsdoc": "~39.6.2",
"eslint-plugin-jsdoc": "~39.6.4",
"eslint-plugin-prettier": "~4.2.1",
"glob": "~8.0.3",
"lint-staged": "~13.0.3",
"lint-staged": "~13.0.4",
"mime-db": "~1.52.0",
"npm-run-all": "~4.1.5",
"picocolors": "~1.0.0",
"prettier": "2.7.1",
"prettier-plugin-organize-imports": "~3.2.0",
"prettier": "2.8.0",
"prettier-plugin-organize-imports": "~3.2.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"rimraf": "~3.0.2",
Expand All @@ -139,10 +139,10 @@
"validator": "~13.7.0",
"vite": "~3.2.4",
"vitepress": "1.0.0-alpha.29",
"vitest": "~0.25.2",
"vitest": "~0.25.3",
"vue": "~3.2.45"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].1",
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
"npm": ">=6.14.13"
Expand Down
Loading

0 comments on commit 8018653

Please sign in to comment.