Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Update faker-js/faker to v6 #2231

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ module.exports = {
name: '@faker-js/faker',
message: "Please use '@faker-js/faker/locale/en' instead",
},
{
name: 'faker',
message: "Please use 'faker/locale/en' instead",
},
],
},
],
Expand Down Expand Up @@ -78,7 +74,13 @@ module.exports = {
},
},
{
files: ['**/tests/**/*.ts', '**/tests/**/*.tsx', '**/loom.config.ts', '**/*.test-d.ts', '**/*.test-d.tsx'],
files: [
'**/tests/**/*.ts',
'**/tests/**/*.tsx',
'**/loom.config.ts',
'**/*.test-d.ts',
'**/*.test-d.tsx',
],
rules: {
// We disable `import/no-extraneous-dependencies` for test files because it
// would force releases of `@shopify/react-testing` (and similar devDependencies)
Expand All @@ -87,7 +89,7 @@ module.exports = {
'import/no-extraneous-dependencies': 'off',
'react/jsx-no-constructed-context-values': 'off',
'react/jsx-key': 'off',
'@shopify/react-require-autocomplete': 'off'
'@shopify/react-require-autocomplete': 'off',
},
},
{
Expand Down
9 changes: 0 additions & 9 deletions config/typescript/modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,3 @@ declare module 'browserslist-useragent' {

export function matchesUA(ua: string, options?: Options): boolean;
}

// Necessary for @faker-js/faker v5.x
// Once we upgrade to faker 6, this can likely be removed
// because the library will be rewritten into TypeScript.
declare module '@faker-js/faker/locale/en' {
import faker from 'faker/locale/en';

export default faker;
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@apollo/react-common": "^3.1.3",
"@apollo/react-hooks": "^3.1.3",
"@babel/core": "^7.14.6",
"@faker-js/faker": "^5.5.3",
"@faker-js/faker": "^6.3.1",
"@shopify/app-bridge": "^2.0.3",
"@shopify/babel-preset": "^24.1.4",
"@shopify/browserslist-config": "^3.0.0",
Expand All @@ -48,7 +48,6 @@
"@shopify/loom-plugin-eslint": "^2.0.0",
"@shopify/loom-plugin-prettier": "^2.0.0",
"@shopify/typescript-configs": "^5.0.0",
"@types/faker": "^5.5.9",
"@types/react": "^17.0.13",
"@types/react-dom": "^17.0.8",
"apollo-cache-inmemory": "^1.3.6",
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-fixtures/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Breaking Change

- Drop support for node 12 and Safari 10, 11 and 12. Remove wildcard export in exports field. [[#2277](https://github.com/Shopify/quilt/pull/2277)]
- Updated faker dependency to v6.3.1. [[#2231](https://github.com/Shopify/quilt/pull/2231)]

## 1.4.6 - 2022-04-25

Expand Down
3 changes: 1 addition & 2 deletions packages/graphql-fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
"node": "^14.17.0 || >=16.0.0"
},
"dependencies": {
"@faker-js/faker": "^5.5.3",
"@faker-js/faker": "^6.3.1",
"@shopify/useful-types": "^4.0.3",
"@types/faker": "^5.5.9",
"graphql": ">=14.5.0 <16.0.0",
"graphql-tool-utilities": "^2.1.7"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/react-performance/src/tests/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function randomLifecycleEventType() {
EventType.Load,
];

return faker.random.arrayElement(types) as LifecycleEvent['type'];
return faker.helpers.arrayElement(types) as LifecycleEvent['type'];
}

export function mockNavigation() {
Expand All @@ -120,7 +120,7 @@ export function randomNavigationResult() {
NavigationResult.TimedOut,
];

return faker.random.arrayElement(resultTypes);
return faker.helpers.arrayElement(resultTypes);
}

export function noop() {}
Expand All @@ -130,7 +130,7 @@ export function randomConnection() {

return {
downlink: faker.datatype.number(),
effectiveType: faker.random.arrayElement(effectiveTypes),
effectiveType: faker.helpers.arrayElement(effectiveTypes),
onchange: null,
rtt: faker.datatype.number(),
saveData: faker.datatype.boolean(),
Expand Down
13 changes: 4 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1514,10 +1514,10 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"

"@faker-js/faker@^5.5.3":
version "5.5.3"
resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-5.5.3.tgz#18e3af6b8eae7984072bbeb0c0858474d7c4cefe"
integrity sha512-R11tGE6yIFwqpaIqcfkcg7AICXzFg14+5h5v0TfF/9+RMDL6jhzCy/pxHVOfbALGdtVYdt6JdR21tuxEgl34dw==
"@faker-js/faker@^6.3.1":
version "6.3.1"
resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-6.3.1.tgz#1ae963dd40405450a2945408cba553e1afa3e0fb"
integrity sha512-8YXBE2ZcU/pImVOHX7MWrSR/X5up7t6rPWZlk34RwZEcdr3ua6X+32pSd6XuOQRN+vbuvYNfA6iey8NbrjuMFQ==

"@graphql-tools/batch-execute@^7.1.0":
version "7.1.0"
Expand Down Expand Up @@ -3901,11 +3901,6 @@
"@types/express-serve-static-core" "*"
"@types/serve-static" "*"

"@types/faker@^5.5.9":
version "5.5.9"
resolved "https://registry.yarnpkg.com/@types/faker/-/faker-5.5.9.tgz#588ede92186dc557bff8341d294335d50d255f0c"
integrity sha512-uCx6mP3UY5SIO14XlspxsGjgaemrxpssJI0Ol+GfhxtcKpv9pgRZYsS4eeKeHVLje6Qtc8lGszuBI461+gVZBA==

"@types/fetch-mock@^7.3.3":
version "7.3.3"
resolved "https://registry.yarnpkg.com/@types/fetch-mock/-/fetch-mock-7.3.3.tgz#255511d70087b9ae8866704c782c88cc96a0b45b"
Expand Down