From 8c35728968e09da2bc578e518656ee922c74f607 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 05:25:00 +0000 Subject: [PATCH 1/8] Bump @faker-js/faker from 5.1.0 to 8.4.1 in /webapp Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 5.1.0 to 8.4.1. - [Release notes](https://github.com/faker-js/faker/releases) - [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md) - [Commits](https://github.com/faker-js/faker/compare/v5.1.0...v8.4.1) --- updated-dependencies: - dependency-name: "@faker-js/faker" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- webapp/package.json | 2 +- webapp/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/package.json b/webapp/package.json index 3a9ac816d6..ce954cf745 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -71,7 +71,7 @@ "@babel/core": "^7.24.4", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/preset-env": "^7.22.4", - "@faker-js/faker": "5.1.0", + "@faker-js/faker": "8.4.1", "@nuxtjs/composition-api": "0.32.0", "@storybook/addon-a11y": "^8.0.8", "@storybook/addon-actions": "^5.3.21", diff --git a/webapp/yarn.lock b/webapp/yarn.lock index 8bbf2a2855..e67a90f7ba 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -2270,10 +2270,10 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@faker-js/faker@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-5.1.0.tgz#cee1d77ada0d0dbbe77201d18b1ebabf432d9c0f" - integrity sha512-0VonSKh7fBCqvY+V2FLN2ZW4pR4ZtWJalWmwSaiaB7yK7y4qp8vDfuaq9QdLjf/cdZGx3M7Wc4Q+x4fZHxI21Q== +"@faker-js/faker@8.4.1": + version "8.4.1" + resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-8.4.1.tgz#5d5e8aee8fce48f5e189bf730ebd1f758f491451" + integrity sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg== "@hapi/address@2.x.x": version "2.0.0" From d8e47238bb6ad1c857d8efcf7e787dc7ee74a815 Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 29 Apr 2024 07:44:49 +0200 Subject: [PATCH 2/8] adapt faker import in webapp to package update --- webapp/components/CommentList/CommentList.story.js | 2 +- .../components/_new/generic/TabNavigation/TabNavigator.story.js | 2 +- webapp/storybook/helpers.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/components/CommentList/CommentList.story.js b/webapp/components/CommentList/CommentList.story.js index 50a2b1d1b7..0a8ebfd701 100644 --- a/webapp/components/CommentList/CommentList.story.js +++ b/webapp/components/CommentList/CommentList.story.js @@ -1,4 +1,4 @@ -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { storiesOf } from '@storybook/vue' import { withA11y } from '@storybook/addon-a11y' import HcCommentList from './CommentList.vue' diff --git a/webapp/components/_new/generic/TabNavigation/TabNavigator.story.js b/webapp/components/_new/generic/TabNavigation/TabNavigator.story.js index 6da7a57633..ab6ee87f35 100644 --- a/webapp/components/_new/generic/TabNavigation/TabNavigator.story.js +++ b/webapp/components/_new/generic/TabNavigation/TabNavigator.story.js @@ -1,4 +1,4 @@ -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { storiesOf } from '@storybook/vue' import { withA11y } from '@storybook/addon-a11y' import HcEmpty from '~/components/Empty/Empty' diff --git a/webapp/storybook/helpers.js b/webapp/storybook/helpers.js index bc42d5ac70..a6c20743c0 100644 --- a/webapp/storybook/helpers.js +++ b/webapp/storybook/helpers.js @@ -2,7 +2,7 @@ import Vue from 'vue' import Vuex from 'vuex' import vuexI18n from 'vuex-i18n/dist/vuex-i18n.umd.js' import Styleguide from '@human-connection/styleguide' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import Filters from '~/plugins/vue-filters' import Directives from '~/plugins/vue-directives' import IziToast from '~/plugins/izi-toast' From 47d79544c6372572969ea591bca39401309ce6bc Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 29 Apr 2024 08:18:00 +0200 Subject: [PATCH 3/8] adapt name and random faking to updates faker api --- webapp/components/CommentList/CommentList.story.js | 2 +- .../generic/TabNavigation/TabNavigator.story.js | 4 ++-- webapp/storybook/helpers.js | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/webapp/components/CommentList/CommentList.story.js b/webapp/components/CommentList/CommentList.story.js index 0a8ebfd701..d0133ef8db 100644 --- a/webapp/components/CommentList/CommentList.story.js +++ b/webapp/components/CommentList/CommentList.story.js @@ -8,7 +8,7 @@ helpers.init() const commentMock = (fields) => { return { - id: faker.random.uuid(), + id: faker.string.uuid(), title: faker.lorem.sentence(), content: faker.lorem.paragraph(), createdAt: faker.date.past(), diff --git a/webapp/components/_new/generic/TabNavigation/TabNavigator.story.js b/webapp/components/_new/generic/TabNavigation/TabNavigator.story.js index ab6ee87f35..fcd4a067a9 100644 --- a/webapp/components/_new/generic/TabNavigation/TabNavigator.story.js +++ b/webapp/components/_new/generic/TabNavigation/TabNavigator.story.js @@ -17,7 +17,7 @@ helpers.init() const postMock = (fields) => { return { ...post, - id: faker.random.uuid(), + id: faker.string.uuid(), createdAt: faker.date.past(), updatedAt: faker.date.recent(), deleted: false, @@ -30,7 +30,7 @@ const postMock = (fields) => { const userMock = (fields) => { return { ...user, - id: faker.random.uuid(), + id: faker.string.uuid(), createdAt: faker.date.past(), updatedAt: faker.date.recent(), deleted: false, diff --git a/webapp/storybook/helpers.js b/webapp/storybook/helpers.js index a6c20743c0..e52fb03ed7 100644 --- a/webapp/storybook/helpers.js +++ b/webapp/storybook/helpers.js @@ -61,9 +61,9 @@ const helpers = { }, fakeUser(n) { return new Array(n || 1).fill(0).map(() => { - const name = faker.name.findName() + const name = faker.person.person.fullName() return { - id: faker.random.uuid(), + id: faker.string.uuid(), name, slug: faker.helpers.slugify(name), } @@ -74,14 +74,14 @@ const helpers = { const title = faker.lorem.words() const content = faker.lorem.paragraph() return { - id: faker.random.uuid(), + id: faker.string.uuid(), title, content, slug: faker.lorem.slug(title), - shoutedCount: faker.random.number(), - commentsCount: faker.random.number(), - clickedCount: faker.random.number(), - viewedTeaserCount: faker.random.number(), + shoutedCount: faker.number.int(), + commentsCount: faker.number.int(), + clickedCount: faker.number.int(), + viewedTeaserCount: faker.number.int(), postType: ['Article'], } }) From e2654de55d120187cdd184a1941b1f5bc79294ca Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 29 Apr 2024 08:36:34 +0200 Subject: [PATCH 4/8] adapt name and random faking to updates faker api --- backend/src/db/factories.ts | 2 +- webapp/storybook/helpers.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/db/factories.ts b/backend/src/db/factories.ts index 4ec34e2897..6ba0b92bb0 100644 --- a/backend/src/db/factories.ts +++ b/backend/src/db/factories.ts @@ -63,7 +63,7 @@ Factory.define('basicUser') .option('password', '1234') .attrs({ id: uuid, - name: faker.name.fullName, + name: faker.person.fullName, password: '1234', role: 'user', termsAndConditionsAgreedVersion: '0.0.1', diff --git a/webapp/storybook/helpers.js b/webapp/storybook/helpers.js index e52fb03ed7..caa41dd863 100644 --- a/webapp/storybook/helpers.js +++ b/webapp/storybook/helpers.js @@ -61,7 +61,7 @@ const helpers = { }, fakeUser(n) { return new Array(n || 1).fill(0).map(() => { - const name = faker.person.person.fullName() + const name = faker.person.fullName() return { id: faker.string.uuid(), name, From 166094c4652c545f58ba8fe0e4e01cc0705037e3 Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 29 Apr 2024 09:21:33 +0200 Subject: [PATCH 5/8] adapt slug faking to updated faker api --- webapp/storybook/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/storybook/helpers.js b/webapp/storybook/helpers.js index caa41dd863..f389fc3f4d 100644 --- a/webapp/storybook/helpers.js +++ b/webapp/storybook/helpers.js @@ -77,7 +77,7 @@ const helpers = { id: faker.string.uuid(), title, content, - slug: faker.lorem.slug(title), + slug: faker.lorem.slug({ min: 1, max: 3 }, title), shoutedCount: faker.number.int(), commentsCount: faker.number.int(), clickedCount: faker.number.int(), From 01c8c2a57bf961d71c613a78ce2a907327313941 Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 29 Apr 2024 14:50:20 +0200 Subject: [PATCH 6/8] adapt backend avatar faking due to deprecation warning --- backend/src/db/factories.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/db/factories.ts b/backend/src/db/factories.ts index 6ba0b92bb0..049b71f4ab 100644 --- a/backend/src/db/factories.ts +++ b/backend/src/db/factories.ts @@ -107,7 +107,7 @@ Factory.define('user') .option('email', faker.internet.exampleEmail) .option('avatar', () => Factory.build('image', { - url: faker.internet.avatar(), + url: faker.image.avatar(), }), ) .after(async (buildObject, options) => { From 7b3ed63bc91928a6fd6d2800b0f7343a711ef70b Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 29 Apr 2024 15:29:46 +0200 Subject: [PATCH 7/8] adapt backend image faking due to deprecation warning --- backend/src/db/factories.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/db/factories.ts b/backend/src/db/factories.ts index 049b71f4ab..f410e8b295 100644 --- a/backend/src/db/factories.ts +++ b/backend/src/db/factories.ts @@ -2,7 +2,7 @@ import { v4 as uuid } from 'uuid' import slugify from 'slug' import { hashSync } from 'bcryptjs' import { Factory } from 'rosie' -import { faker } from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { getDriver, getNeode } from './neo4j' import CONFIG from '../config/index' import generateInviteCode from '../schema/resolvers/helpers/generateInviteCode' @@ -49,7 +49,7 @@ Factory.define('badge') }) Factory.define('image') - .attr('url', faker.image.unsplash.imageUrl) + .attr('url', faker.image.url) .attr('aspectRatio', 1.3333333333333333) .attr('alt', faker.lorem.sentence) .attr('type', 'image/jpeg') From 6cecd3662f7760f201f6d088e96213f738f6364e Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 29 Apr 2024 17:48:41 +0200 Subject: [PATCH 8/8] adapt backend image faking due to deprecation warning --- backend/src/db/factories.ts | 2 +- backend/src/db/seed.ts | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/backend/src/db/factories.ts b/backend/src/db/factories.ts index f410e8b295..c75c92fdd0 100644 --- a/backend/src/db/factories.ts +++ b/backend/src/db/factories.ts @@ -2,7 +2,7 @@ import { v4 as uuid } from 'uuid' import slugify from 'slug' import { hashSync } from 'bcryptjs' import { Factory } from 'rosie' -import { faker } from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { getDriver, getNeode } from './neo4j' import CONFIG from '../config/index' import generateInviteCode from '../schema/resolvers/helpers/generateInviteCode' diff --git a/backend/src/db/seed.ts b/backend/src/db/seed.ts index 53cd4cea68..bff236f648 100644 --- a/backend/src/db/seed.ts +++ b/backend/src/db/seed.ts @@ -632,7 +632,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat16'], author: peterLustig, image: Factory.build('image', { - url: faker.image.unsplash.food(300, 169), + url: faker.image.urlLoremFlickr({ category: 'food', width: 300, height: 169 }), sensitive: true, aspectRatio: 300 / 169, }), @@ -648,7 +648,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat1'], author: bobDerBaumeister, image: Factory.build('image', { - url: faker.image.unsplash.technology(300, 1500), + url: faker.image.urlLoremFlickr({ category: 'technics', width: 300, height: 1500 }), aspectRatio: 300 / 1500, }), }, @@ -696,7 +696,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat6'], author: peterLustig, image: Factory.build('image', { - url: faker.image.unsplash.buildings(300, 857), + url: faker.image.urlLoremFlickr({ category: 'city', width: 300, height: 857 }), aspectRatio: 300 / 857, }), }, @@ -735,7 +735,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat11'], author: louie, image: Factory.build('image', { - url: faker.image.unsplash.people(300, 901), + url: faker.image.urlLoremFlickr({ category: 'people', width: 300, height: 901 }), aspectRatio: 300 / 901, }), }, @@ -761,7 +761,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat14'], author: jennyRostock, image: Factory.build('image', { - url: faker.image.unsplash.objects(300, 200), + url: faker.image.urlLoremFlickr({ category: 'abstract', width: 300, height: 200 }), aspectRatio: 300 / 450, }), }, @@ -821,7 +821,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] mutation: createPostMutation(), variables: { id: 'p8', - image: faker.image.unsplash.nature(), + image: faker.image.urlLoremFlickr({ category: 'nature' }), title: `Quantum Flow Theory explains Quantum Gravity`, content: hashtagAndMention1, categoryIds: ['cat8'], @@ -1178,7 +1178,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat1'], author: jennyRostock, image: Factory.build('image', { - url: faker.image.unsplash.objects(), + url: faker.image.urlLoremFlickr({ category: 'abstract' }), }), }, ) @@ -1229,7 +1229,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat1'], author: peterLustig, image: Factory.build('image', { - url: faker.image.unsplash.buildings(), + url: faker.image.urlLoremFlickr({ category: 'city' }), }), }, ) @@ -1280,7 +1280,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat1'], author: dewey, image: Factory.build('image', { - url: faker.image.unsplash.food(), + url: faker.image.urlLoremFlickr({ category: 'food' }), }), }, ) @@ -1331,7 +1331,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat1'], author: louie, image: Factory.build('image', { - url: faker.image.unsplash.technology(), + url: faker.image.urlLoremFlickr({ category: 'technics' }), }), }, ) @@ -1382,7 +1382,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat1'], author: bobDerBaumeister, image: Factory.build('image', { - url: faker.image.unsplash.people(), + url: faker.image.urlLoremFlickr({ category: 'people' }), }), }, ) @@ -1433,7 +1433,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] categoryIds: ['cat1'], author: huey, image: Factory.build('image', { - url: faker.image.unsplash.nature(), + url: faker.image.urlLoremFlickr({ category: 'nature' }), }), }, )