From 5753a0e46042f8c1bda4ccd3c9753cd983038798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marti=CC=81n?= Date: Wed, 18 Dec 2024 22:58:19 +0100 Subject: [PATCH 1/2] Track link variants property when field is added --- packages/manager/src/managers/telemetry/types.ts | 1 + packages/slice-machine/src/utils/tracking/trackFieldAdded.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/manager/src/managers/telemetry/types.ts b/packages/manager/src/managers/telemetry/types.ts index 9d819501d..b9551e7b9 100644 --- a/packages/manager/src/managers/telemetry/types.ts +++ b/packages/manager/src/managers/telemetry/types.ts @@ -210,6 +210,7 @@ type FieldAddedSegmentEvent = SegmentEvent< contentType: "page type" | "custom type" | "slice"; allowText?: boolean; repeat?: boolean; + variants?: string[]; } >; diff --git a/packages/slice-machine/src/utils/tracking/trackFieldAdded.ts b/packages/slice-machine/src/utils/tracking/trackFieldAdded.ts index c4eb4cf54..063547675 100644 --- a/packages/slice-machine/src/utils/tracking/trackFieldAdded.ts +++ b/packages/slice-machine/src/utils/tracking/trackFieldAdded.ts @@ -28,6 +28,7 @@ export function trackFieldAdded(args: TrackFieldAddedArgs) { ...(field.type === "Link" && { allowText: field.config?.allowText, repeat: field.config?.repeat, + variants: field.config?.variants, }), }); } From 1b45000c268d7a1de4dab92a81ae0d0848b91fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marti=CC=81n?= Date: Thu, 19 Dec 2024 23:46:04 +0100 Subject: [PATCH 2/2] Upgrade prismic mocks --- packages/manager/package.json | 2 +- ...Manager-customTypes-readCustomType.test.ts | 1 - packages/slice-machine/package.json | 2 +- packages/start-slicemachine/package.json | 2 +- yarn.lock | 28 +++++++++---------- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/packages/manager/package.json b/packages/manager/package.json index 46187b622..6bde88d56 100644 --- a/packages/manager/package.json +++ b/packages/manager/package.json @@ -67,7 +67,7 @@ "@antfu/ni": "^0.20.0", "@prismicio/client": "^7.11.0", "@prismicio/custom-types-client": "2.1.0", - "@prismicio/mocks": "2.5.0", + "@prismicio/mocks": "2.7.0-alpha.0", "@prismicio/types-internal": "3.3.0", "@segment/analytics-node": "^2.1.2", "@slicemachine/plugin-kit": "workspace:*", diff --git a/packages/manager/test/SliceMachineManager-customTypes-readCustomType.test.ts b/packages/manager/test/SliceMachineManager-customTypes-readCustomType.test.ts index abdf0077c..9d760ac2b 100644 --- a/packages/manager/test/SliceMachineManager-customTypes-readCustomType.test.ts +++ b/packages/manager/test/SliceMachineManager-customTypes-readCustomType.test.ts @@ -92,7 +92,6 @@ it("ignores plugins that implement `custom-type-library:read`", async (ctx) => { const res = await manager.customTypes.readCustomType({ id: model.id }); expect(res).toStrictEqual({ - // TODO: update prismic/mocks model: { ...model, format: "custom" }, errors: [], }); diff --git a/packages/slice-machine/package.json b/packages/slice-machine/package.json index 65d72308f..ce73dbe6c 100644 --- a/packages/slice-machine/package.json +++ b/packages/slice-machine/package.json @@ -47,7 +47,7 @@ "@prismicio/editor-support": "0.4.58", "@prismicio/editor-ui": "0.4.58", "@prismicio/mock": "0.3.3", - "@prismicio/mocks": "2.5.0", + "@prismicio/mocks": "2.7.0-alpha.0", "@prismicio/simulator": "0.1.4", "@prismicio/types-internal": "3.3.0", "@radix-ui/react-hover-card": "1.0.6", diff --git a/packages/start-slicemachine/package.json b/packages/start-slicemachine/package.json index 466d5b123..4188e5d25 100644 --- a/packages/start-slicemachine/package.json +++ b/packages/start-slicemachine/package.json @@ -55,7 +55,7 @@ }, "bin": "./bin/start-slicemachine.js", "dependencies": { - "@prismicio/mocks": "2.5.0", + "@prismicio/mocks": "2.7.0-alpha.0", "@prismicio/types-internal": "3.3.0", "@slicemachine/manager": "workspace:*", "body-parser": "^1.20.3", diff --git a/yarn.lock b/yarn.lock index 2b9ce97a5..02473ad18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5930,18 +5930,18 @@ __metadata: languageName: node linkType: hard -"@prismicio/api-renderer@npm:6.0.0": - version: 6.0.0 - resolution: "@prismicio/api-renderer@npm:6.0.0" +"@prismicio/api-renderer@npm:6.1.0": + version: 6.1.0 + resolution: "@prismicio/api-renderer@npm:6.1.0" dependencies: - "@prismicio/types-internal": 3.1.0 + "@prismicio/types-internal": 3.3.0 tslib: ^2.5.0 uuid: ^9.0.0 peerDependencies: fp-ts: ^2.11.8 io-ts: ^2.2.16 io-ts-types: ^0.5.16 - checksum: a206f1b5bef538e964d1580bfdaf6c5e021c89aab3f37a94148e826bdd8055957b26f35a5d49e41f6815e7ea1836f1bbe974df2d4f578fe3450c0456d8f1e9d5 + checksum: e65fdf72d54d376eb36a329fc75cd9a4ef3114b2f3d4002b536dec6a8074ad1fe0b58b4a0006d308d09dc7a7eac1566cfd51d645d32c9e03729b21fbc191a9a6 languageName: node linkType: hard @@ -6145,12 +6145,12 @@ __metadata: languageName: node linkType: hard -"@prismicio/mocks@npm:2.5.0": - version: 2.5.0 - resolution: "@prismicio/mocks@npm:2.5.0" +"@prismicio/mocks@npm:2.7.0-alpha.0": + version: 2.7.0-alpha.0 + resolution: "@prismicio/mocks@npm:2.7.0-alpha.0" dependencies: - "@prismicio/api-renderer": 6.0.0 - "@prismicio/types-internal": 3.1.0 + "@prismicio/api-renderer": 6.1.0 + "@prismicio/types-internal": 3.3.0 fp-ts: ^2.11.8 io-ts: ^2.2.16 io-ts-types: ^0.5.16 @@ -6159,7 +6159,7 @@ __metadata: newtype-ts: ^0.3.5 tslib: ^2.3.1 uuid: ^9.0.1 - checksum: e18240377a29561d2937dbad3d1bbe98557c669ec5fb7aadfbee12284fed950b8a4aaeefd7294d40aa2f033341493615d156a5be68b44899e19b1fc605fc885c + checksum: 2c844b3b986623eacbb810429d64e43306a004140dfc82ec908aca77cf49241af64fbd7e242e8d820d64fa36fcd8128e334cc8c4f023f4939e30870eec6e2dac languageName: node linkType: hard @@ -9230,7 +9230,7 @@ __metadata: "@prismicio/client": ^7.11.0 "@prismicio/custom-types-client": 2.1.0 "@prismicio/mock": 0.2.0 - "@prismicio/mocks": 2.5.0 + "@prismicio/mocks": 2.7.0-alpha.0 "@prismicio/types-internal": 3.3.0 "@segment/analytics-node": ^2.1.2 "@size-limit/preset-small-lib": 8.2.4 @@ -31225,7 +31225,7 @@ __metadata: "@prismicio/editor-support": 0.4.58 "@prismicio/editor-ui": 0.4.58 "@prismicio/mock": 0.3.3 - "@prismicio/mocks": 2.5.0 + "@prismicio/mocks": 2.7.0-alpha.0 "@prismicio/simulator": 0.1.4 "@prismicio/types-internal": 3.3.0 "@radix-ui/react-hover-card": 1.0.6 @@ -31704,7 +31704,7 @@ __metadata: version: 0.0.0-use.local resolution: "start-slicemachine@workspace:packages/start-slicemachine" dependencies: - "@prismicio/mocks": 2.5.0 + "@prismicio/mocks": 2.7.0-alpha.0 "@prismicio/types-internal": 3.3.0 "@size-limit/preset-small-lib": 8.2.4 "@slicemachine/manager": "workspace:*"