Skip to content

Commit a4e292b

Browse files
authored
Merge branch 'main' into jsdocs/fix-missing
2 parents f7f73a3 + 9b55940 commit a4e292b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+217
-149
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
version: 6
3232

3333
- name: Set node version to ${{ matrix.node_version }}
34-
uses: actions/setup-node@v2
34+
uses: actions/setup-node@v3
3535
with:
3636
node-version: ${{ matrix.node_version }}
3737
cache: 'pnpm'
@@ -80,7 +80,7 @@ jobs:
8080
version: 6
8181

8282
- name: Set node version to 16
83-
uses: actions/setup-node@v2
83+
uses: actions/setup-node@v3
8484
with:
8585
node-version: 16
8686
cache: 'pnpm'
@@ -111,7 +111,7 @@ jobs:
111111
version: 6
112112

113113
- name: Set node version to 16
114-
uses: actions/setup-node@v2
114+
uses: actions/setup-node@v3
115115
with:
116116
node-version: 16
117117
cache: 'pnpm'

.prettierrc.cjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
* @type {import('prettier').Options}
55
*/
66
module.exports = {
7-
plugins: [
8-
/* require.resolve("prettier-plugin-organize-imports") */
9-
],
7+
plugins: [require.resolve('prettier-plugin-organize-imports')],
108
singleQuote: true,
119
overrides: [
1210
{

docs/.vitepress/theme/components/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Playground from './Playground.vue';
21
import Badge from './Badge.vue';
2+
import Playground from './Playground.vue';
33

44
export default {
55
Playground,

docs/.vitepress/theme/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import './index.css';
2-
import GlobalComponents from './components';
31
import DefaultTheme from 'vitepress/theme';
2+
import GlobalComponents from './components';
3+
import './index.css';
44

55
export default {
66
...DefaultTheme,

docs/migration-guide-v5/index.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,49 @@ Faker now ships with its own types! Remove `@types/faker` from your `package.jso
3636

3737
### Tree-shaking
3838

39-
Faker now supports tree-shaking! We highly recommend that you take advantage of your bundler's tree-shaking capabilities and change how you import Faker. This is especially true if you're importing Faker in the browser.
39+
:::warning
40+
Tree shaking is not yet fully supported due to some structural issues. But we plan to make Faker fully tree-shakable in the future.
41+
:::
4042

41-
Faker is a giant package made up of many megabytes of strings. Only import what you need.
43+
For now Faker supports tree-shaking for some parts, and we highly recommend that you take advantage of your bundler's tree-shaking capabilities and change how you import Faker right now.
4244

43-
:::tip
44-
Migrating to the new tree-shakeable syntax should be quick and painless.
45-
:::
45+
Instead of using:
4646

47-
For JS:
47+
```ts
48+
// js
49+
const faker = require('@faker-js/faker');
4850

49-
```js
51+
// ts
52+
import faker from '@faker-js/faker';
53+
```
54+
55+
You should switch to:
56+
57+
```ts
58+
// js
5059
const { faker } = require('@faker-js/faker');
5160

52-
// Or specific locale
53-
const fakerDe = require('@faker-js/faker/locale/de');
61+
// ts
62+
import { faker } from '@faker-js/faker';
5463
```
5564

56-
For TS:
65+
If you only need one specific language, we highly recommend to make use of the locale specific imports like:
5766

5867
```ts
59-
import { faker } from '@faker-js/faker';
68+
// js
69+
const fakerDe = require('@faker-js/faker/locale/de');
6070

61-
// Or specific locale
71+
// ts
6272
import fakerDe from '@faker-js/faker/locale/de';
6373
```
6474

65-
Please [open an issue on GitHub](https://github.com/faker-js/faker/issues/new?assignees=&labels=pending+triage&template=freestyle.md) if we've missed any steps.
75+
This is especially true if you're importing Faker in the browser.
76+
77+
Faker is a giant package made up of many megabytes of strings. Only import what you need.
78+
79+
_We plan to load the locales in another way in a future major release._
80+
81+
---
6682

6783
Happy Faking!
6884

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"conventional-changelog-cli": "~2.2.2",
102102
"cypress": "~9.5.0",
103103
"esbuild": "~0.14.23",
104-
"eslint": "~8.9.0",
104+
"eslint": "~8.10.0",
105105
"eslint-config-prettier": "~8.4.0",
106106
"eslint-define-config": "~1.2.5",
107107
"eslint-gitignore": "~0.1.0",
@@ -112,6 +112,7 @@
112112
"npm-run-all": "~4.1.5",
113113
"picocolors": "~1.0.0",
114114
"prettier": "2.5.1",
115+
"prettier-plugin-organize-imports": "~2.3.4",
115116
"rimraf": "~3.0.2",
116117
"sanitize-html": "~2.7.0",
117118
"simple-git-hooks": "~2.7.0",
@@ -124,7 +125,7 @@
124125
"vitepress": "~0.22.3",
125126
"vitest": "~0.5.4"
126127
},
127-
"packageManager": "[email protected].1",
128+
"packageManager": "[email protected].2",
128129
"engines": {
129130
"node": ">=14.0.0",
130131
"npm": ">=7.0.0"

0 commit comments

Comments
 (0)