From 6db0559b8193e1da090dc844e3084a1ca2dc7b8a Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Thu, 20 Jan 2022 07:54:39 +0000 Subject: [PATCH] fix: replace faker with community fork faker-js/faker (#1408) Co-authored-by: Dominik Pschenitschni Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1408 Reviewed-by: konrad Co-authored-by: Dominik Pschenitschni Co-committed-by: Dominik Pschenitschni --- cypress/factories/bucket.js | 2 +- cypress/factories/labels.js | 2 +- cypress/factories/link_sharing.js | 2 +- cypress/factories/list.js | 2 +- cypress/factories/namespace.js | 2 +- cypress/factories/task.js | 2 +- cypress/factories/task_comment.js | 2 +- cypress/factories/team.js | 2 +- cypress/factories/user.js | 2 +- package.json | 2 +- src/types/faker.d.ts | 4 ++++ yarn.lock | 10 +++++----- 12 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 src/types/faker.d.ts diff --git a/cypress/factories/bucket.js b/cypress/factories/bucket.js index be90cca9..8001899b 100644 --- a/cypress/factories/bucket.js +++ b/cypress/factories/bucket.js @@ -1,4 +1,4 @@ -import faker from 'faker' +import faker from '@faker-js/faker' import {Factory} from '../support/factory' import {formatISO} from 'date-fns' diff --git a/cypress/factories/labels.js b/cypress/factories/labels.js index b3f9ab30..7aac5eb0 100644 --- a/cypress/factories/labels.js +++ b/cypress/factories/labels.js @@ -1,4 +1,4 @@ -import faker from 'faker' +import faker from '@faker-js/faker' import {Factory} from '../support/factory' import {formatISO} from 'date-fns' diff --git a/cypress/factories/link_sharing.js b/cypress/factories/link_sharing.js index e2c01dd0..3a406ea2 100644 --- a/cypress/factories/link_sharing.js +++ b/cypress/factories/link_sharing.js @@ -1,6 +1,6 @@ import {Factory} from '../support/factory' import {formatISO} from "date-fns" -import faker from 'faker' +import faker from '@faker-js/faker' export class LinkShareFactory extends Factory { static table = 'link_shares' diff --git a/cypress/factories/list.js b/cypress/factories/list.js index f93cdba4..2ffc3125 100644 --- a/cypress/factories/list.js +++ b/cypress/factories/list.js @@ -1,6 +1,6 @@ import {Factory} from '../support/factory' import {formatISO} from "date-fns" -import faker from 'faker' +import faker from '@faker-js/faker' export class ListFactory extends Factory { static table = 'lists' diff --git a/cypress/factories/namespace.js b/cypress/factories/namespace.js index 89096d2d..203f7159 100644 --- a/cypress/factories/namespace.js +++ b/cypress/factories/namespace.js @@ -1,4 +1,4 @@ -import faker from 'faker' +import faker from '@faker-js/faker' import {Factory} from '../support/factory' import {formatISO} from 'date-fns' diff --git a/cypress/factories/task.js b/cypress/factories/task.js index 6fa8d5b6..5410a25e 100644 --- a/cypress/factories/task.js +++ b/cypress/factories/task.js @@ -1,4 +1,4 @@ -import faker from 'faker' +import faker from '@faker-js/faker' import {Factory} from '../support/factory' import {formatISO} from 'date-fns' diff --git a/cypress/factories/task_comment.js b/cypress/factories/task_comment.js index 74e043f9..7800c009 100644 --- a/cypress/factories/task_comment.js +++ b/cypress/factories/task_comment.js @@ -1,4 +1,4 @@ -import faker from 'faker' +import faker from '@faker-js/faker' import {Factory} from '../support/factory' import {formatISO} from "date-fns" diff --git a/cypress/factories/team.js b/cypress/factories/team.js index 928b8ce4..33cc3794 100644 --- a/cypress/factories/team.js +++ b/cypress/factories/team.js @@ -1,4 +1,4 @@ -import faker from 'faker' +import faker from '@faker-js/faker' import {Factory} from '../support/factory' import {formatISO} from 'date-fns' diff --git a/cypress/factories/user.js b/cypress/factories/user.js index 9e133b55..93971efe 100644 --- a/cypress/factories/user.js +++ b/cypress/factories/user.js @@ -1,4 +1,4 @@ -import faker from 'faker' +import faker from '@faker-js/faker' import {Factory} from '../support/factory' import {formatISO} from "date-fns" diff --git a/package.json b/package.json index 1693e597..7563f462 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ }, "devDependencies": { "@4tw/cypress-drag-drop": "2.1.0", + "@faker-js/faker": "6.0.0-alpha.3", "@fortawesome/fontawesome-svg-core": "1.2.36", "@fortawesome/free-regular-svg-icons": "5.15.4", "@fortawesome/free-solid-svg-icons": "5.15.4", @@ -76,7 +77,6 @@ "eslint": "8.7.0", "eslint-plugin-vue": "8.3.0", "express": "4.17.2", - "faker": "5.5.3", "netlify-cli": "8.8.2", "happy-dom": "2.27.2", "postcss": "8.4.5", diff --git a/src/types/faker.d.ts b/src/types/faker.d.ts new file mode 100644 index 00000000..de01ac25 --- /dev/null +++ b/src/types/faker.d.ts @@ -0,0 +1,4 @@ +declare module '@faker-js/faker' { + import faker from 'faker' + export default faker +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 34608bcd..4a3178d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1796,6 +1796,11 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@faker-js/faker@6.0.0-alpha.3": + version "6.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-6.0.0-alpha.3.tgz#c6f85a44d7996c131ec16ce41d6be0f344b6ad15" + integrity sha512-8B+7Jlwb9ogcoluzxB6AaSRZn2gnoewTA/WygAYhWNxkrFKjQL0TDXK6AW6uJlASMKl7qG/qbEVtpjLByuL0ZQ== + "@fortawesome/fontawesome-common-types@^0.2.36": version "0.2.36" resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.36.tgz#b44e52db3b6b20523e0c57ef8c42d315532cb903" @@ -6574,11 +6579,6 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -faker@5.5.3: - version "5.5.3" - resolved "https://registry.yarnpkg.com/faker/-/faker-5.5.3.tgz#c57974ee484431b25205c2c8dc09fda861e51e0e" - integrity sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g== - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"