diff --git a/e2e-projects/next-upgrade/package.json b/e2e-projects/next-upgrade/package.json index a9f66cfae4..72b18fb223 100644 --- a/e2e-projects/next-upgrade/package.json +++ b/e2e-projects/next-upgrade/package.json @@ -1,6 +1,6 @@ { "name": "next-upgrade", - "version": "1.21.0", + "version": "1.21.1-dev-next-release.2", "private": true, "scripts": { "dev": "next dev", diff --git a/e2e-projects/next/package.json b/e2e-projects/next/package.json index daec503af0..4d9db1c514 100644 --- a/e2e-projects/next/package.json +++ b/e2e-projects/next/package.json @@ -1,6 +1,6 @@ { "name": "cimsirp", - "version": "1.21.0", + "version": "1.21.1-dev-next-release.2", "private": true, "scripts": { "dev": "next dev", diff --git a/e2e-projects/sveltekit/package.json b/e2e-projects/sveltekit/package.json index 6d1895f6ce..646b86abad 100644 --- a/e2e-projects/sveltekit/package.json +++ b/e2e-projects/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "sveltekit", - "version": "1.21.0", + "version": "1.21.1-dev-next-release.2", "private": true, "scripts": { "dev": "vite dev", diff --git a/packages/adapter-next/package.json b/packages/adapter-next/package.json index 0e023c0e07..dffdb0afe1 100644 --- a/packages/adapter-next/package.json +++ b/packages/adapter-next/package.json @@ -1,6 +1,6 @@ { "name": "@slicemachine/adapter-next", - "version": "0.3.26", + "version": "0.3.27-dev-next-release.2", "description": "Slice Machine adapter for Next.js.", "keywords": [ "typescript", diff --git a/packages/adapter-next/src/hooks/project-init.ts b/packages/adapter-next/src/hooks/project-init.ts index 0f13ab1b97..b659bce310 100644 --- a/packages/adapter-next/src/hooks/project-init.ts +++ b/packages/adapter-next/src/hooks/project-init.ts @@ -179,8 +179,7 @@ const createPrismicIOFile = async ({ * The project's Prismic repository name. */ export const repositoryName = - process.env.${PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME} || - config.repositoryName; + process.env.${PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME} || config.repositoryName; /** * A list of Route Resolver objects that define how a document's \`url\` field is resolved. @@ -211,7 +210,8 @@ const createPrismicIOFile = async ({ /** * The project's Prismic repository name. */ - export const repositoryName = config.repositoryName; + export const repositoryName = + process.env.${PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME} || config.repositoryName; /** * A list of Route Resolver objects that define how a document's \`url\` field is resolved. diff --git a/packages/adapter-next/test/plugin-project-init.test.ts b/packages/adapter-next/test/plugin-project-init.test.ts index ff9b4120cc..54b809d741 100644 --- a/packages/adapter-next/test/plugin-project-init.test.ts +++ b/packages/adapter-next/test/plugin-project-init.test.ts @@ -257,7 +257,8 @@ describe("prismicio.js file", () => { /** * The project's Prismic repository name. */ - export const repositoryName = config.repositoryName; + export const repositoryName = + process.env.NEXT_PUBLIC_PRISMIC_ENVIRONMENT || config.repositoryName; /** * A list of Route Resolver objects that define how a document's \`url\` field is resolved. @@ -331,7 +332,8 @@ describe("prismicio.js file", () => { /** * The project's Prismic repository name. */ - export const repositoryName = config.repositoryName; + export const repositoryName = + process.env.NEXT_PUBLIC_PRISMIC_ENVIRONMENT || config.repositoryName; /** * A list of Route Resolver objects that define how a document's \`url\` field is resolved. @@ -554,7 +556,8 @@ describe("prismicio.js file", () => { /** * The project's Prismic repository name. */ - export const repositoryName = config.repositoryName; + export const repositoryName = + process.env.NEXT_PUBLIC_PRISMIC_ENVIRONMENT || config.repositoryName; /** * A list of Route Resolver objects that define how a document's \`url\` field is resolved. @@ -624,7 +627,8 @@ describe("prismicio.js file", () => { /** * The project's Prismic repository name. */ - export const repositoryName = config.repositoryName; + export const repositoryName = + process.env.NEXT_PUBLIC_PRISMIC_ENVIRONMENT || config.repositoryName; /** * A list of Route Resolver objects that define how a document's \`url\` field is resolved. diff --git a/packages/adapter-nuxt/package.json b/packages/adapter-nuxt/package.json index ed412c7ef8..928b61251a 100644 --- a/packages/adapter-nuxt/package.json +++ b/packages/adapter-nuxt/package.json @@ -1,6 +1,6 @@ { "name": "@slicemachine/adapter-nuxt", - "version": "0.3.26", + "version": "0.3.27-dev-next-release.2", "description": "Slice Machine adapter for Nuxt 3.", "keywords": [ "typescript", diff --git a/packages/adapter-nuxt2/package.json b/packages/adapter-nuxt2/package.json index 869d753e7d..e16970792f 100644 --- a/packages/adapter-nuxt2/package.json +++ b/packages/adapter-nuxt2/package.json @@ -1,6 +1,6 @@ { "name": "@slicemachine/adapter-nuxt2", - "version": "0.3.26", + "version": "0.3.27-dev-next-release.2", "description": "Slice Machine adapter for Nuxt 2.", "keywords": [ "typescript", diff --git a/packages/adapter-sveltekit/package.json b/packages/adapter-sveltekit/package.json index 47a6c91e0b..febc94e5ff 100644 --- a/packages/adapter-sveltekit/package.json +++ b/packages/adapter-sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@slicemachine/adapter-sveltekit", - "version": "0.3.26", + "version": "0.3.27-dev-next-release.2", "description": "Slice Machine adapter for SvelteKit.", "keywords": [ "typescript", diff --git a/packages/adapter-sveltekit/src/hooks/project-init.ts b/packages/adapter-sveltekit/src/hooks/project-init.ts index 224f9493ec..f79d5a3938 100644 --- a/packages/adapter-sveltekit/src/hooks/project-init.ts +++ b/packages/adapter-sveltekit/src/hooks/project-init.ts @@ -62,8 +62,7 @@ const createPrismicIOFile = async ({ * The project's Prismic repository name. */ export const repositoryName = - import.meta.env.${PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME} || - config.repositoryName; + import${"."}meta${"."}env.${PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME} || config.repositoryName; /** * A list of Route Resolver objects that define how a document's \`url\` field is resolved. @@ -109,7 +108,8 @@ const createPrismicIOFile = async ({ /** * The project's Prismic repository name. */ - export const repositoryName = config.repositoryName; + export const repositoryName = + import${"."}meta${"."}env.${PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME} || config.repositoryName; /** * A list of Route Resolver objects that define how a document's \`url\` field is resolved. diff --git a/packages/adapter-sveltekit/test/plugin-project-init.test.ts b/packages/adapter-sveltekit/test/plugin-project-init.test.ts index b8d9a6f7d1..13c234656c 100644 --- a/packages/adapter-sveltekit/test/plugin-project-init.test.ts +++ b/packages/adapter-sveltekit/test/plugin-project-init.test.ts @@ -264,7 +264,8 @@ describe("prismicio.js file", () => { /** * The project's Prismic repository name. */ - export const repositoryName = config.repositoryName; + export const repositoryName = + import.meta.env.VITE_PRISMIC_ENVIRONMENT || config.repositoryName; /** * A list of Route Resolver objects that define how a document's \`url\` field is resolved. diff --git a/packages/init/package.json b/packages/init/package.json index 7fdaf633ba..f5e40b4136 100644 --- a/packages/init/package.json +++ b/packages/init/package.json @@ -1,6 +1,6 @@ { "name": "@slicemachine/init", - "version": "2.9.4", + "version": "2.9.5-dev-next-release.2", "description": "Init Prismic Slice Machine in your project", "keywords": [ "typescript", diff --git a/packages/init/test/__setup__.ts b/packages/init/test/__setup__.ts index 353078d70a..40f2de5cc2 100644 --- a/packages/init/test/__setup__.ts +++ b/packages/init/test/__setup__.ts @@ -55,11 +55,11 @@ vi.mock("fs/promises", async () => { }; }); -vi.mock("analytics-node", () => { +vi.mock("@segment/analytics-node", () => { const MockSegmentClient = vi.fn(); MockSegmentClient.prototype.identify = vi.fn( - (_message: unknown, callback?: (error?: Error) => void) => { + (_message: unknown, callback?: (error?: unknown) => void) => { if (callback) { callback(); } @@ -67,15 +67,17 @@ vi.mock("analytics-node", () => { ); MockSegmentClient.prototype.track = vi.fn( - (_message: unknown, callback?: (error?: Error) => void) => { + (_message: unknown, callback?: (error?: unknown) => void) => { if (callback) { callback(); } }, ); + MockSegmentClient.prototype.on = vi.fn(); + return { - default: MockSegmentClient, + Analytics: MockSegmentClient, }; }); diff --git a/packages/manager/package.json b/packages/manager/package.json index ac23328216..387f987c0f 100644 --- a/packages/manager/package.json +++ b/packages/manager/package.json @@ -1,6 +1,6 @@ { "name": "@slicemachine/manager", - "version": "0.17.0", + "version": "0.17.1-dev-next-release.2", "description": "Manage all aspects of a Slice Machine project.", "repository": { "type": "git", @@ -68,9 +68,9 @@ "@prismicio/custom-types-client": "1.2.0-alpha.0", "@prismicio/mocks": "2.0.0", "@prismicio/types-internal": "^2.2.0", + "@segment/analytics-node": "1.1.3", "@slicemachine/plugin-kit": "workspace:^", "@wooorm/starry-night": "^1.6.0", - "analytics-node": "^6.2.0", "cookie": "^0.5.0", "cors": "^2.8.5", "execa": "^7.1.1", @@ -99,7 +99,6 @@ "devDependencies": { "@prismicio/mock": "0.2.0", "@size-limit/preset-small-lib": "8.2.4", - "@types/analytics-node": "3.1.11", "@types/cookie": "0.5.1", "@types/express": "4.17.17", "@types/semver": "7.3.13", diff --git a/packages/manager/src/managers/telemetry/TelemetryManager.ts b/packages/manager/src/managers/telemetry/TelemetryManager.ts index ec2449cd9e..b0ba9729b7 100644 --- a/packages/manager/src/managers/telemetry/TelemetryManager.ts +++ b/packages/manager/src/managers/telemetry/TelemetryManager.ts @@ -1,6 +1,6 @@ import { randomUUID } from "node:crypto"; -import SegmentClient from "analytics-node"; +import { Analytics, GroupParams, TrackParams } from "@segment/analytics-node"; import { readPrismicrc } from "../../lib/prismicrc"; @@ -41,9 +41,9 @@ type TelemetryManagerContext = { }; function assertTelemetryInitialized( - segmentClient: SegmentClient | undefined, + segmentClient: (() => Analytics) | undefined, ): asserts segmentClient is NonNullable { - if (segmentClient == undefined) { + if (segmentClient === undefined) { throw new Error( "Telemetry has not been initialized. Run `SliceMachineManager.telemetry.prototype.initTelemetry()` before re-calling this method.", ); @@ -51,29 +51,34 @@ function assertTelemetryInitialized( } export class TelemetryManager extends BaseManager { - private _segmentClient: SegmentClient | undefined = undefined; + private _segmentClient: (() => Analytics) | undefined = undefined; private _anonymousID: string | undefined = undefined; private _userID: string | undefined = undefined; private _context: TelemetryManagerContext | undefined = undefined; async initTelemetry(args: TelemetryManagerInitTelemetryArgs): Promise { - if (this._segmentClient) { - // Prevent subsequent initializations. - return; - } + const isTelemetryEnabled = await this.checkIsTelemetryEnabled(); + + this._segmentClient = () => { + const analytics = new Analytics({ + writeKey: API_TOKENS.SegmentKey, + // Since it's a local app, we do not benefit from event batching the way a server would normally do, all tracking event will be awaited. + maxEventsInBatch: 1, + // TODO: Verify that this actually does not send data to Segment when false. + disable: !isTelemetryEnabled, + }); - this._segmentClient = new SegmentClient(API_TOKENS.SegmentKey, { - // Since it's a local app, we do not benefit from event batching the way a server would normally do, all tracking event will be awaited. - flushAt: 1, - // TODO: Verify that this actually does not send data to Segment when false. - enable: await this.checkIsTelemetryEnabled(), - errorHandler: () => { + analytics.on("error", (error) => { // noop - We don't care if the tracking event // failed. Some users or networks intentionally // block Segment, so we can't block the app if // a tracking event is unsuccessful. - }, - }); + console.error(`An error occurred with Segment`, error); + }); + + return analytics; + }; + this._anonymousID = randomUUID(); this._context = { app: { name: args.appName, version: args.appVersion } }; } @@ -127,9 +132,9 @@ export class TelemetryManager extends BaseManager { assertTelemetryInitialized(this._segmentClient); // TODO: Make sure client fails gracefully when no internet connection - this._segmentClient.track( - payload as Parameters[0], - (maybeError?: Error) => { + this._segmentClient().track( + payload as TrackParams, + (maybeError?: unknown) => { if (maybeError && import.meta.env.DEV) { // TODO: Not sure how we want to deal with that console.warn( @@ -165,7 +170,7 @@ export class TelemetryManager extends BaseManager { assertTelemetryInitialized(this._segmentClient); // TODO: Make sure client fails gracefully when no internet connection - this._segmentClient.identify(payload, (maybeError?: Error) => { + this._segmentClient().identify(payload, (maybeError?: unknown) => { if (maybeError && import.meta.env.DEV) { // TODO: Not sure how we want to deal with that console.warn(`An error occurred during Segment identify`, maybeError); @@ -216,9 +221,9 @@ export class TelemetryManager extends BaseManager { return new Promise((resolve) => { assertTelemetryInitialized(this._segmentClient); - this._segmentClient.group( - payload as Parameters[0], - (maybeError?: Error) => { + this._segmentClient().group( + payload as GroupParams, + (maybeError?: unknown) => { if (maybeError && import.meta.env.DEV) { // TODO: Not sure how we want to deal with that console.warn(`An error occurred during Segment group`, maybeError); diff --git a/packages/manager/src/managers/telemetry/types.ts b/packages/manager/src/managers/telemetry/types.ts index 4a89077903..144f95ec77 100644 --- a/packages/manager/src/managers/telemetry/types.ts +++ b/packages/manager/src/managers/telemetry/types.ts @@ -25,6 +25,7 @@ export const SegmentEventType = { editor_widgetUsed: "editor:widget-used", open_page_snippet: "page-type:open-snippet", copy_page_snippet: "page-type:copy-snippet", + switch_environment: "environment:switch", } as const; type SegmentEventTypes = (typeof SegmentEventType)[keyof typeof SegmentEventType]; @@ -61,6 +62,7 @@ export const HumanSegmentEventType = { "SliceMachine Opens Page Type Snippet Dialog", [SegmentEventType.copy_page_snippet]: "Slice Machine page code snippet copied", + [SegmentEventType.switch_environment]: "SliceMachine environment switch", } as const; export type HumanSegmentEventTypes = (typeof HumanSegmentEventType)[keyof typeof HumanSegmentEventType]; @@ -122,6 +124,18 @@ type PageViewSegmentEvent = SegmentEvent< title: string; referrer: string; adapter: string; + /* + * We are tracking outer sizes instead of inner sizes as with the latter, we + * can't differentiate between users with a high-density screen and those + * zooming in/out with ⌘ + / ⌘ -. Indeed, when users zoom in/out, some + * browsers (like Google Chrome) will update `window.devicePixelRatio` while + * others (like Safari) will keep it unchanged so that it always reflects + * the ratio of physical pixels to CSS pixels. + */ + outerWidth: number; + outerHeight: number; + screenWidth: number; + screenHeight: number; } >; @@ -135,6 +149,11 @@ type CopyPageSnippetSegmentEvent = SegmentEvent< { framework: string } >; +type SwitchEnvironmentSegmentEvent = SegmentEvent< + typeof SegmentEventType.switch_environment, + { domain: string } +>; + type UsersInviteButtonClickedSegmentEvent = SegmentEvent< typeof SegmentEventType.users_invite_button_clicked >; @@ -260,4 +279,5 @@ export type SegmentEvents = | EditorWidgetUsedSegmentEvent | OpenPageSnippetSegmentEvent | CopyPageSnippetSegmentEvent - | UsersInviteButtonClickedSegmentEvent; + | UsersInviteButtonClickedSegmentEvent + | SwitchEnvironmentSegmentEvent; diff --git a/packages/manager/test/SliceMachineManager-telemetry-group.test.ts b/packages/manager/test/SliceMachineManager-telemetry-group.test.ts index 6f7202fa05..074176aa94 100644 --- a/packages/manager/test/SliceMachineManager-telemetry-group.test.ts +++ b/packages/manager/test/SliceMachineManager-telemetry-group.test.ts @@ -1,24 +1,26 @@ import { expect, it, vi } from "vitest"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import { createTestPlugin } from "./__testutils__/createTestPlugin"; import { createTestProject } from "./__testutils__/createTestProject"; import { createSliceMachineManager } from "../src"; -vi.mock("analytics-node", () => { +vi.mock("@segment/analytics-node", () => { const MockSegmentClient = vi.fn(); MockSegmentClient.prototype.group = vi.fn( - (_message: unknown, callback?: (error?: Error) => void) => { + (_message: unknown, callback?: (error?: unknown) => void) => { if (callback) { callback(); } }, ); + MockSegmentClient.prototype.on = vi.fn(); + return { - default: MockSegmentClient, + Analytics: MockSegmentClient, }; }); @@ -42,7 +44,7 @@ it("sends a group payload to Segment", async () => { npmLibsCount: 0, }); - expect(SegmentClient.prototype.group).toHaveBeenCalledWith( + expect(Analytics.prototype.group).toHaveBeenCalledWith( { anonymousId: expect.any(String), groupId: await manager.project.getRepositoryName(), @@ -76,13 +78,13 @@ it("logs a warning to the console if Segment returns an error", async () => { appVersion: "0.0.1-test", }); - vi.mocked(SegmentClient.prototype.group).mockImplementationOnce( + vi.mocked(Analytics.prototype.group).mockImplementationOnce( (_message, callback) => { if (callback) { callback(new Error()); } - return this as unknown as SegmentClient; + return this as unknown as Analytics; }, ); diff --git a/packages/manager/test/SliceMachineManager-telemetry-identify.test.ts b/packages/manager/test/SliceMachineManager-telemetry-identify.test.ts index 0930b8a332..e15879a2fc 100644 --- a/packages/manager/test/SliceMachineManager-telemetry-identify.test.ts +++ b/packages/manager/test/SliceMachineManager-telemetry-identify.test.ts @@ -1,24 +1,26 @@ import { expect, it, vi } from "vitest"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import { createTestPlugin } from "./__testutils__/createTestPlugin"; import { createTestProject } from "./__testutils__/createTestProject"; import { createSliceMachineManager } from "../src"; -vi.mock("analytics-node", () => { +vi.mock("@segment/analytics-node", () => { const MockSegmentClient = vi.fn(); MockSegmentClient.prototype.identify = vi.fn( - (_message: unknown, callback?: (error?: Error) => void) => { + (_message: unknown, callback?: (error?: unknown) => void) => { if (callback) { callback(); } }, ); + MockSegmentClient.prototype.on = vi.fn(); + return { - default: MockSegmentClient, + Analytics: MockSegmentClient, }; }); @@ -40,7 +42,7 @@ it("sends an identification payload to Segment", async () => { intercomHash: "bar", }); - expect(SegmentClient.prototype.identify).toHaveBeenCalledWith( + expect(Analytics.prototype.identify).toHaveBeenCalledWith( { userId: "foo", anonymousId: expect.any(String), @@ -68,13 +70,13 @@ it("logs a warning to the console if Segment returns an error", async () => { appVersion: "0.0.1-test", }); - vi.mocked(SegmentClient.prototype.identify).mockImplementationOnce( + vi.mocked(Analytics.prototype.identify).mockImplementationOnce( (_message, callback) => { if (callback) { callback(new Error()); } - return this as unknown as SegmentClient; + return this as unknown as Analytics; }, ); diff --git a/packages/manager/test/SliceMachineManager-telemetry-initTelemetry.test.ts b/packages/manager/test/SliceMachineManager-telemetry-initTelemetry.test.ts index 46f7f7f394..5013902c9a 100644 --- a/packages/manager/test/SliceMachineManager-telemetry-initTelemetry.test.ts +++ b/packages/manager/test/SliceMachineManager-telemetry-initTelemetry.test.ts @@ -1,5 +1,5 @@ import { beforeAll, expect, it } from "vitest"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import * as fs from "node:fs/promises"; import * as path from "node:path"; import * as os from "node:os"; @@ -37,7 +37,10 @@ it("creates a reusable Segment client", async () => { }); // @ts-expect-error - Accessing an internal private property - expect(manager.telemetry._segmentClient).toBeInstanceOf(SegmentClient); + expect(manager.telemetry._segmentClient()).toBeInstanceOf(Analytics); + + // @ts-expect-error - Accessing an internal private property + expect(manager.telemetry._segmentClient()._publisher._disable).toBe(false); }); it("disables the Segment client if .prismicrc is configured to disable telemery", async () => { @@ -56,5 +59,5 @@ it("disables the Segment client if .prismicrc is configured to disable telemery" }); // @ts-expect-error - Accessing an internal private property - expect(manager.telemetry._segmentClient.enable).toBe(false); + expect(manager.telemetry._segmentClient()._publisher._disable).toBe(true); }); diff --git a/packages/manager/test/SliceMachineManager-telemetry-track.test.ts b/packages/manager/test/SliceMachineManager-telemetry-track.test.ts index 95da46bac5..18d98f779f 100644 --- a/packages/manager/test/SliceMachineManager-telemetry-track.test.ts +++ b/packages/manager/test/SliceMachineManager-telemetry-track.test.ts @@ -1,24 +1,26 @@ import { expect, it, vi } from "vitest"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import { createTestPlugin } from "./__testutils__/createTestPlugin"; import { createTestProject } from "./__testutils__/createTestProject"; import { createSliceMachineManager } from "../src"; -vi.mock("analytics-node", () => { +vi.mock("@segment/analytics-node", () => { const MockSegmentClient = vi.fn(); MockSegmentClient.prototype.track = vi.fn( - (_message: unknown, callback?: (error?: Error) => void) => { + (_message: unknown, callback?: (error?: unknown) => void) => { if (callback) { callback(); } }, ); + MockSegmentClient.prototype.on = vi.fn(); + return { - default: MockSegmentClient, + Analytics: MockSegmentClient, }; }); @@ -39,7 +41,7 @@ it("sends a given event to Segment", async () => { event: "command:init:start", }); - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledWith( { anonymousId: expect.any(String), event: "SliceMachine Init Start", @@ -82,8 +84,8 @@ it("maps event payloads correctly to expected Segment tracking payloads", async ...commandInitEndProperties, }); - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Init End", properties: { @@ -112,8 +114,8 @@ it("maps event payloads correctly to expected Segment tracking payloads", async ...customTypeCreatedProperties, }); - expect(SegmentClient.prototype.track).toHaveBeenCalledTimes(2); - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledTimes(2); + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Custom Type Created", properties: { @@ -142,13 +144,13 @@ it("logs a warning to the console if Segment returns an error", async () => { appVersion: "0.0.1-test", }); - vi.mocked(SegmentClient.prototype.track).mockImplementationOnce( + vi.mocked(Analytics.prototype.track).mockImplementationOnce( (_message, callback) => { if (callback) { callback(new Error()); } - return this as unknown as SegmentClient; + return this as unknown as Analytics; }, ); diff --git a/packages/plugin-kit/package.json b/packages/plugin-kit/package.json index 7047a25a55..211ecb1174 100644 --- a/packages/plugin-kit/package.json +++ b/packages/plugin-kit/package.json @@ -1,6 +1,6 @@ { "name": "@slicemachine/plugin-kit", - "version": "0.4.26", + "version": "0.4.27-dev-next-release.2", "description": "A set of helpers to develop and run Slice Machine plugins", "keywords": [ "typescript", diff --git a/packages/slice-machine/components/AppLayout/index.tsx b/packages/slice-machine/components/AppLayout/index.tsx index 1e82740c0d..32f902e3f7 100644 --- a/packages/slice-machine/components/AppLayout/index.tsx +++ b/packages/slice-machine/components/AppLayout/index.tsx @@ -31,17 +31,24 @@ export const AppLayout: FC = ({ ); }; +const environmentTopBorderColorMap = { + prod: "purple", + stage: "indigo", + dev: "amber", +} as const; + const PageLayoutWithActiveEnvironment: FC = ({ children, ...otherProps }) => { const { activeEnvironment } = useActiveEnvironment(); + const maybeBorderColor = activeEnvironment + ? environmentTopBorderColorMap[activeEnvironment.kind] + : undefined; + return ( - + {children} ); diff --git a/packages/slice-machine/components/Navigation/Environment.tsx b/packages/slice-machine/components/Navigation/Environment.tsx index eacb9ffa10..da4cf7c30e 100644 --- a/packages/slice-machine/components/Navigation/Environment.tsx +++ b/packages/slice-machine/components/Navigation/Environment.tsx @@ -1,5 +1,7 @@ import { Environment as EnvironmentType } from "@slicemachine/manager/client"; +import { telemetry } from "@src/apiClient"; + import { useEnvironments } from "@src/features/environments/useEnvironments"; import { setEnvironment } from "@src/features/environments/actions/setEnvironment"; import { useActiveEnvironment } from "@src/features/environments/useActiveEnvironment"; @@ -14,6 +16,11 @@ export function Environment() { const { refreshState, openLoginModal } = useSliceMachineActions(); async function onSelect(environment: EnvironmentType) { + void telemetry.track({ + event: "environment:switch", + domain: environment.domain, + }); + await setEnvironment(environment); const legacySliceMachineState = await getLegacySliceMachineState(); diff --git a/packages/slice-machine/package.json b/packages/slice-machine/package.json index 959b50be8b..34551714b4 100644 --- a/packages/slice-machine/package.json +++ b/packages/slice-machine/package.json @@ -1,6 +1,6 @@ { "name": "slice-machine-ui", - "version": "1.21.0", + "version": "1.21.1-dev-next-release.2", "license": "MIT", "description": "A visual builder for your Slice Models with all the tools you need to generate data models and mock CMS content locally.", "repository": { diff --git a/packages/slice-machine/src/components/PageLayout/PageLayout.css.ts b/packages/slice-machine/src/components/PageLayout/PageLayout.css.ts index f28ce39775..837665e3c9 100644 --- a/packages/slice-machine/src/components/PageLayout/PageLayout.css.ts +++ b/packages/slice-machine/src/components/PageLayout/PageLayout.css.ts @@ -34,10 +34,10 @@ const borderTopBase = style([ { width: "inherit" }, ]); -export const borderTop = styleVariants({ - prod: [borderTopBase, sprinkles({ backgroundColor: colors.purple9 })], - stage: [borderTopBase, sprinkles({ backgroundColor: colors.indigo10 })], - dev: [borderTopBase, sprinkles({ backgroundColor: colors.amber10 })], +export const borderTopColor = styleVariants({ + purple: [borderTopBase, sprinkles({ backgroundColor: colors.purple9 })], + indigo: [borderTopBase, sprinkles({ backgroundColor: colors.indigo10 })], + amber: [borderTopBase, sprinkles({ backgroundColor: colors.amber10 })], }); export const pane = style([ diff --git a/packages/slice-machine/src/components/PageLayout/PageLayout.stories.tsx b/packages/slice-machine/src/components/PageLayout/PageLayout.stories.tsx index 63375a7da0..8edba65555 100644 --- a/packages/slice-machine/src/components/PageLayout/PageLayout.stories.tsx +++ b/packages/slice-machine/src/components/PageLayout/PageLayout.stories.tsx @@ -6,7 +6,7 @@ import { PageLayoutHeader, PageLayoutPane, } from "./PageLayout"; -import { borderTop } from "./PageLayout.css"; +import { borderTopColor } from "./PageLayout.css"; type Story = StoryObj; @@ -16,9 +16,9 @@ const meta = { children: { control: { disable: true }, }, - activeEnvironmentKind: { + borderTopColor: { control: { type: "select" }, - options: Object.keys(borderTop), + options: [...Object.keys(borderTopColor), undefined], }, }, parameters: { diff --git a/packages/slice-machine/src/components/PageLayout/PageLayout.tsx b/packages/slice-machine/src/components/PageLayout/PageLayout.tsx index 5b4d526bc2..0ff6a120e7 100644 --- a/packages/slice-machine/src/components/PageLayout/PageLayout.tsx +++ b/packages/slice-machine/src/components/PageLayout/PageLayout.tsx @@ -3,17 +3,21 @@ import type { FC, PropsWithChildren } from "react"; import * as styles from "./PageLayout.css"; type PageLayoutProps = PropsWithChildren<{ - activeEnvironmentKind?: "prod" | "stage" | "dev"; + borderTopColor?: keyof typeof styles.borderTopColor; }>; export const PageLayout: FC = ({ - activeEnvironmentKind = "prod", + borderTopColor, children, ...otherProps }) => (
{children} -
+
); diff --git a/packages/slice-machine/src/components/SideNav/SideNavEnvironmentSelector.tsx b/packages/slice-machine/src/components/SideNav/SideNavEnvironmentSelector.tsx index f3a2a4e489..78bd5fcede 100644 --- a/packages/slice-machine/src/components/SideNav/SideNavEnvironmentSelector.tsx +++ b/packages/slice-machine/src/components/SideNav/SideNavEnvironmentSelector.tsx @@ -42,7 +42,7 @@ export const SideNavEnvironmentSelector: FC = ( - {activeEnvironment !== undefined && ( + {activeEnvironment !== undefined && environments.length > 1 && ( = (props) => { - Regular Environments + {/* + TODO: Add this line when Dev envs are supported + Regular Environments + */} {environments.map((environment) => environment.kind !== "dev" ? ( { title: document.title, referrer: document.referrer, adapter, + outerWidth: window.outerWidth, + outerHeight: window.outerHeight, + screenWidth: window.screen.width, + screenHeight: window.screen.height, }); } diff --git a/packages/slice-machine/test/__setup__.ts b/packages/slice-machine/test/__setup__.ts index 53e4c46d63..f83d98f029 100644 --- a/packages/slice-machine/test/__setup__.ts +++ b/packages/slice-machine/test/__setup__.ts @@ -95,12 +95,12 @@ vi.mock("url", async () => { return actual; }); -vi.mock("analytics-node", () => { +vi.mock("@segment/analytics-node", () => { const MockSegmentClient = vi.fn(); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access MockSegmentClient.prototype.group = vi.fn( - (_message: unknown, callback?: (error?: Error) => void) => { + (_message: unknown, callback?: (error?: unknown) => void) => { if (callback) { callback(); } @@ -109,7 +109,7 @@ vi.mock("analytics-node", () => { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access MockSegmentClient.prototype.identify = vi.fn( - (_message: unknown, callback?: (error?: Error) => void) => { + (_message: unknown, callback?: (error?: unknown) => void) => { if (callback) { callback(); } @@ -118,15 +118,18 @@ vi.mock("analytics-node", () => { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access MockSegmentClient.prototype.track = vi.fn( - (_message: unknown, callback?: (error?: Error) => void) => { + (_message: unknown, callback?: (error?: unknown) => void) => { if (callback) { callback(); } }, ); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + MockSegmentClient.prototype.on = vi.fn(); + return { - default: MockSegmentClient, + Analytics: MockSegmentClient, }; }); diff --git a/packages/slice-machine/test/components/CreateCustomTypeModal.test.tsx b/packages/slice-machine/test/components/CreateCustomTypeModal.test.tsx index e4120a20e5..e13daf41ea 100644 --- a/packages/slice-machine/test/components/CreateCustomTypeModal.test.tsx +++ b/packages/slice-machine/test/components/CreateCustomTypeModal.test.tsx @@ -1,7 +1,7 @@ // @vitest-environment jsdom import { describe, test, afterEach, expect, vi } from "vitest"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import { render, fireEvent, act } from "../__testutils__"; import { CreateCustomTypeModal } from "../../components/Forms/CreateCustomTypeModal"; @@ -54,8 +54,8 @@ describe("CreateCustomTypeModal", () => { } }); - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Custom Type Created", properties: { diff --git a/packages/slice-machine/test/pages/custom-types.test.tsx b/packages/slice-machine/test/pages/custom-types.test.tsx index 14a951bdc0..776edfd8a7 100644 --- a/packages/slice-machine/test/pages/custom-types.test.tsx +++ b/packages/slice-machine/test/pages/custom-types.test.tsx @@ -3,7 +3,7 @@ import { describe, test, afterEach, beforeEach, expect, vi } from "vitest"; import Router from "next/router"; import mockRouter from "next-router-mock"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import userEvent from "@testing-library/user-event"; import { createSliceMachineManager } from "@slicemachine/manager"; @@ -208,9 +208,9 @@ describe("Custom Type Builder", () => { }); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Custom Type Field Added", properties: { @@ -319,9 +319,9 @@ describe("Custom Type Builder", () => { }); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Slicezone Updated", properties: { customTypeId, nodeVersion: process.versions.node }, @@ -435,9 +435,9 @@ describe("Custom Type Builder", () => { }); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Custom Type Field Added", properties: { @@ -459,9 +459,9 @@ describe("Custom Type Builder", () => { await waitFor(() => { // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledTimes(2); + expect(Analytics.prototype.track).toHaveBeenCalledTimes(2); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Custom Type Saved", properties: { @@ -595,9 +595,9 @@ describe("Custom Type Builder", () => { }); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Custom Type Field Added", properties: { @@ -620,6 +620,6 @@ describe("Custom Type Builder", () => { await new Promise((r) => setTimeout(r, 500)); // eslint-disable-next-line @typescript-eslint/unbound-method - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); }); }); diff --git a/packages/slice-machine/test/pages/simulator.test.tsx b/packages/slice-machine/test/pages/simulator.test.tsx index 9ac2375b69..b34e832c71 100644 --- a/packages/slice-machine/test/pages/simulator.test.tsx +++ b/packages/slice-machine/test/pages/simulator.test.tsx @@ -5,7 +5,7 @@ import { render, fireEvent, act, waitFor } from "../__testutils__"; import mockRouter from "next-router-mock"; import router from "next/router"; import { createDynamicRouteParser } from "next-router-mock/dynamic-routes"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import pkg from "../../package.json"; import Simulator from "../../pages/slices/[lib]/[sliceName]/[variation]/simulator"; @@ -281,12 +281,10 @@ describe.skip("simulator", () => { preloadedState: state as unknown as Partial, }); - await waitFor(() => - expect(SegmentClient.prototype.track).toHaveBeenCalled(), - ); + await waitFor(() => expect(Analytics.prototype.track).toHaveBeenCalled()); - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Slice Simulator Open", properties: { @@ -321,8 +319,8 @@ describe.skip("simulator", () => { // @ts-expect-error - Ignoring wrong type expectedMock[0].primary.title.value[0].direction = "ltr"; - expect(SegmentClient.prototype.track).toHaveBeenCalledTimes(2); - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledTimes(2); + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ sliceName: "MySlice", libraryName: "slices", diff --git a/packages/slice-machine/test/pages/slices.test.tsx b/packages/slice-machine/test/pages/slices.test.tsx index 0a503048fb..e93d022f73 100644 --- a/packages/slice-machine/test/pages/slices.test.tsx +++ b/packages/slice-machine/test/pages/slices.test.tsx @@ -2,7 +2,7 @@ import { describe, test, afterEach, beforeEach, expect, vi } from "vitest"; import mockRouter from "next-router-mock"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import pkg from "../../package.json"; import SlicesIndex from "../../pages/slices"; @@ -183,12 +183,10 @@ describe("slices", () => { fireEvent.click(submitButton); }); - await waitFor(() => - expect(SegmentClient.prototype.track).toHaveBeenCalled(), - ); + await waitFor(() => expect(Analytics.prototype.track).toHaveBeenCalled()); - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); - expect(SegmentClient.prototype.track).toHaveBeenCalledWith( + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledWith( expect.objectContaining({ event: "SliceMachine Slice Created", properties: { @@ -359,6 +357,6 @@ describe("slices", () => { await new Promise((r) => setTimeout(r, 500)); - expect(SegmentClient.prototype.track).not.toBeCalled(); + expect(Analytics.prototype.track).not.toBeCalled(); }); }); diff --git a/packages/slice-machine/test/src/modules/pushChangesSaga.test.ts b/packages/slice-machine/test/src/modules/pushChangesSaga.test.ts index 8c965a852b..fc0deb89b6 100644 --- a/packages/slice-machine/test/src/modules/pushChangesSaga.test.ts +++ b/packages/slice-machine/test/src/modules/pushChangesSaga.test.ts @@ -1,5 +1,5 @@ import { describe, test } from "vitest"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import "@testing-library/jest-dom"; import { TestApi, testSaga } from "redux-saga-test-plan"; import { @@ -122,7 +122,7 @@ describe("[pushChanges module]", () => { // Wait for network request to be performed await new Promise((resolve) => setTimeout(resolve, 100)); - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); }); test.each([ @@ -182,7 +182,7 @@ describe("[pushChanges module]", () => { // Wait for network request to be performed await new Promise((resolve) => setTimeout(resolve, 100)); - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); }, ); diff --git a/packages/slice-machine/test/src/modules/selectedCustomType/sagas.test.ts b/packages/slice-machine/test/src/modules/selectedCustomType/sagas.test.ts index afd4422bf0..c6174e311f 100644 --- a/packages/slice-machine/test/src/modules/selectedCustomType/sagas.test.ts +++ b/packages/slice-machine/test/src/modules/selectedCustomType/sagas.test.ts @@ -1,6 +1,6 @@ import { describe, it } from "vitest"; import { testSaga } from "redux-saga-test-plan"; -import SegmentClient from "analytics-node"; +import { Analytics } from "@segment/analytics-node"; import { saveCustomType } from "@src/apiClient"; import { saveCustomTypeSaga } from "@src/modules/selectedCustomType/sagas"; @@ -72,7 +72,7 @@ describe("[Selected Custom type sagas]", () => { // Wait for network request to be performed await new Promise((resolve) => setTimeout(resolve, 100)); - expect(SegmentClient.prototype.track).toHaveBeenCalledOnce(); + expect(Analytics.prototype.track).toHaveBeenCalledOnce(); }); it("should open a error toaster on internal error", () => { const saga = testSaga(saveCustomTypeSaga).next(); diff --git a/packages/start-slicemachine/package.json b/packages/start-slicemachine/package.json index 6729865e57..9e8c712e07 100644 --- a/packages/start-slicemachine/package.json +++ b/packages/start-slicemachine/package.json @@ -1,6 +1,6 @@ { "name": "start-slicemachine", - "version": "0.12.6", + "version": "0.12.7-dev-next-release.2", "description": "Start Slice Machine from within a project.", "repository": { "type": "git", diff --git a/yarn.lock b/yarn.lock index afb7220612..b9ad20fc71 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3685,6 +3685,22 @@ __metadata: languageName: node linkType: hard +"@lukeed/csprng@npm:^1.1.0": + version: 1.1.0 + resolution: "@lukeed/csprng@npm:1.1.0" + checksum: 926f5f7fc629470ca9a8af355bfcd0271d34535f7be3890f69902432bddc3262029bb5dbe9025542cf6c9883d878692eef2815fc2f3ba5b92e9da1f9eba2e51b + languageName: node + linkType: hard + +"@lukeed/uuid@npm:^2.0.0": + version: 2.0.1 + resolution: "@lukeed/uuid@npm:2.0.1" + dependencies: + "@lukeed/csprng": ^1.1.0 + checksum: f5e71e4da852dbff49b93cad27d5a2f61c2241e307bbe89b3b54b889ecb7927f2487246467f90ebb6cbdb7e0ac2a213e2e58b1182cb7990cef6e049aa7c39e7b + languageName: node + linkType: hard + "@mapbox/node-pre-gyp@npm:^1.0.5": version: 1.0.10 resolution: "@mapbox/node-pre-gyp@npm:1.0.10" @@ -7991,13 +8007,35 @@ __metadata: languageName: node linkType: hard -"@segment/loosely-validate-event@npm:^2.0.0": - version: 2.0.0 - resolution: "@segment/loosely-validate-event@npm:2.0.0" +"@segment/analytics-core@npm:1.3.2": + version: 1.3.2 + resolution: "@segment/analytics-core@npm:1.3.2" + dependencies: + "@lukeed/uuid": ^2.0.0 + dset: ^3.1.2 + tslib: ^2.4.1 + checksum: d3402a0de749eb94253feb45961f12483660fc8ee170f226be3c26b1d5b94df035a99f1f189e375c44f2b6b9b824b7485c47d35806ab0bad362989699521caca + languageName: node + linkType: hard + +"@segment/analytics-generic-utils@npm:1.0.0": + version: 1.0.0 + resolution: "@segment/analytics-generic-utils@npm:1.0.0" + checksum: b1a371269565179833f2c61a556d2a89a53eb4eb633188a7637b37b2f75020811065c8211bc70c2ac6eccd228c233c9e069fed047c9dcbc1880f50526b86a21d + languageName: node + linkType: hard + +"@segment/analytics-node@npm:1.1.3": + version: 1.1.3 + resolution: "@segment/analytics-node@npm:1.1.3" dependencies: - component-type: ^1.2.1 - join-component: ^1.1.0 - checksum: 8c4aacc903fb717619b69ca7eecf8d4a7b928661b0e835c9cd98f1b858a85ce62c348369ad9a52cb2df8df02578c0525a73fce4c69a42ac414d9554cc6be7117 + "@lukeed/uuid": ^2.0.0 + "@segment/analytics-core": 1.3.2 + "@segment/analytics-generic-utils": 1.0.0 + buffer: ^6.0.3 + node-fetch: ^2.6.7 + tslib: ^2.4.1 + checksum: 0c907fa2252c0f49484d2de7fc4430a0a20247b5f0a43c93fef0c93860957c32a8744a307ded1cf3bca89a7ddca792ea289596ad211c4dbca19b53760f66e794 languageName: node linkType: hard @@ -8548,9 +8586,9 @@ __metadata: "@prismicio/mock": 0.2.0 "@prismicio/mocks": 2.0.0 "@prismicio/types-internal": ^2.2.0 + "@segment/analytics-node": 1.1.3 "@size-limit/preset-small-lib": 8.2.4 "@slicemachine/plugin-kit": "workspace:^" - "@types/analytics-node": 3.1.11 "@types/cookie": 0.5.1 "@types/express": 4.17.17 "@types/semver": 7.3.13 @@ -8558,7 +8596,6 @@ __metadata: "@typescript-eslint/parser": 5.55.0 "@vitest/coverage-v8": 0.32.0 "@wooorm/starry-night": ^1.6.0 - analytics-node: ^6.2.0 cookie: ^0.5.0 cors: ^2.8.5 depcheck: 1.4.3 @@ -10183,13 +10220,6 @@ __metadata: languageName: node linkType: hard -"@types/analytics-node@npm:3.1.11": - version: 3.1.11 - resolution: "@types/analytics-node@npm:3.1.11" - checksum: 2ecef24dfefd4945092a6e06bd7f691d4f16f00fb54ba8da7172ab3d023af78a5cc3a075c784c8ab2f5b0346deee9184d9c1e44ae64073036e60905bd0426bea - languageName: node - linkType: hard - "@types/aria-query@npm:^5.0.1": version: 5.0.1 resolution: "@types/aria-query@npm:5.0.1" @@ -12681,22 +12711,6 @@ __metadata: languageName: node linkType: hard -"analytics-node@npm:^6.2.0": - version: 6.2.0 - resolution: "analytics-node@npm:6.2.0" - dependencies: - "@segment/loosely-validate-event": ^2.0.0 - axios: ^0.27.2 - axios-retry: 3.2.0 - lodash.isstring: ^4.0.1 - md5: ^2.2.1 - ms: ^2.0.0 - remove-trailing-slash: ^0.1.0 - uuid: ^8.3.2 - checksum: d682f99742255b0e00a5f7a9a6245736eb04917cb0eb4cb196c3f7f1f889632f2fef62e64d471df24fd35d4da7e6581db08b43fe770cc67c5f277158acef5267 - languageName: node - linkType: hard - "ansi-align@npm:^3.0.0": version: 3.0.1 resolution: "ansi-align@npm:3.0.1" @@ -13326,15 +13340,6 @@ __metadata: languageName: node linkType: hard -"axios-retry@npm:3.2.0": - version: 3.2.0 - resolution: "axios-retry@npm:3.2.0" - dependencies: - is-retry-allowed: ^1.1.0 - checksum: 411bedb3d2254bd05f9eaf8c9c7a7e14a985ad424f3448d6ec15e2a3584079c3bb99950c07465bdbab1138a5329ccb3e9d22c58db58c83253df4ca3f41e315e6 - languageName: node - linkType: hard - "axios@npm:^0.27.2": version: 0.27.2 resolution: "axios@npm:0.27.2" @@ -13934,6 +13939,16 @@ __metadata: languageName: node linkType: hard +"buffer@npm:^6.0.3": + version: 6.0.3 + resolution: "buffer@npm:6.0.3" + dependencies: + base64-js: ^1.3.1 + ieee754: ^1.2.1 + checksum: 5ad23293d9a731e4318e420025800b42bf0d264004c0286c8cc010af7a270c7a0f6522e84f54b9ad65cbd6db20b8badbfd8d2ebf4f80fa03dab093b89e68c3f9 + languageName: node + linkType: hard + "builtin-modules@npm:^3.3.0": version: 3.3.0 resolution: "builtin-modules@npm:3.3.0" @@ -14461,13 +14476,6 @@ __metadata: languageName: node linkType: hard -"charenc@npm:0.0.2": - version: 0.0.2 - resolution: "charenc@npm:0.0.2" - checksum: 81dcadbe57e861d527faf6dd3855dc857395a1c4d6781f4847288ab23cffb7b3ee80d57c15bba7252ffe3e5e8019db767757ee7975663ad2ca0939bb8fcaf2e5 - languageName: node - linkType: hard - "check-error@npm:^1.0.2": version: 1.0.2 resolution: "check-error@npm:1.0.2" @@ -15046,13 +15054,6 @@ __metadata: languageName: node linkType: hard -"component-type@npm:^1.2.1": - version: 1.2.1 - resolution: "component-type@npm:1.2.1" - checksum: 41a81f87425088c072dc99b7bd06d8c81057047a599955572bfa7f320e1f4d0b38422b2eee922e0ac6e4132376c572673dbf5eb02717898173ec11512bc06b34 - languageName: node - linkType: hard - "compress-commons@npm:^4.1.0": version: 4.1.1 resolution: "compress-commons@npm:4.1.1" @@ -15620,13 +15621,6 @@ __metadata: languageName: node linkType: hard -"crypt@npm:0.0.2": - version: 0.0.2 - resolution: "crypt@npm:0.0.2" - checksum: baf4c7bbe05df656ec230018af8cf7dbe8c14b36b98726939cef008d473f6fe7a4fad906cfea4062c93af516f1550a3f43ceb4d6615329612c6511378ed9fe34 - languageName: node - linkType: hard - "crypto-browserify@npm:^3.11.0": version: 3.12.0 resolution: "crypto-browserify@npm:3.12.0" @@ -16972,6 +16966,13 @@ __metadata: languageName: node linkType: hard +"dset@npm:^3.1.2": + version: 3.1.3 + resolution: "dset@npm:3.1.3" + checksum: 5db964a36c60c51aa3f7088bfe1dc5c0eedd9a6ef3b216935bb70ef4a7b8fc40fd2f9bb16b9a4692c9c9772cea60cfefb108d2d09fbd53c85ea8f6cd54502d6a + languageName: node + linkType: hard + "duplexer@npm:^0.1.1, duplexer@npm:^0.1.2, duplexer@npm:~0.1.1": version: 0.1.2 resolution: "duplexer@npm:0.1.2" @@ -21121,7 +21122,7 @@ __metadata: languageName: node linkType: hard -"is-buffer@npm:^1.1.5, is-buffer@npm:~1.1.6": +"is-buffer@npm:^1.1.5": version: 1.1.6 resolution: "is-buffer@npm:1.1.6" checksum: 4a186d995d8bbf9153b4bd9ff9fd04ae75068fe695d29025d25e592d9488911eeece84eefbd8fa41b8ddcc0711058a71d4c466dcf6f1f6e1d83830052d8ca707 @@ -21560,13 +21561,6 @@ __metadata: languageName: node linkType: hard -"is-retry-allowed@npm:^1.1.0": - version: 1.2.0 - resolution: "is-retry-allowed@npm:1.2.0" - checksum: 50d700a89ae31926b1c91b3eb0104dbceeac8790d8b80d02f5c76d9a75c2056f1bb24b5268a8a018dead606bddf116b2262e5ac07401eb8b8783b266ed22558d - languageName: node - linkType: hard - "is-shared-array-buffer@npm:^1.0.2": version: 1.0.2 resolution: "is-shared-array-buffer@npm:1.0.2" @@ -22009,13 +22003,6 @@ __metadata: languageName: node linkType: hard -"join-component@npm:^1.1.0": - version: 1.1.0 - resolution: "join-component@npm:1.1.0" - checksum: b904c2f98549e4195022caca3a7dc837f9706c670ff333f3d617f2aed23bce2841322a999734683b6ab8e202568ad810c11ff79b58a64df66888153f04750239 - languageName: node - linkType: hard - "js-levenshtein@npm:^1.1.6": version: 1.1.6 resolution: "js-levenshtein@npm:1.1.6" @@ -22957,13 +22944,6 @@ __metadata: languageName: node linkType: hard -"lodash.isstring@npm:^4.0.1": - version: 4.0.1 - resolution: "lodash.isstring@npm:4.0.1" - checksum: eaac87ae9636848af08021083d796e2eea3d02e80082ab8a9955309569cb3a463ce97fd281d7dc119e402b2e7d8c54a23914b15d2fc7fff56461511dc8937ba0 - languageName: node - linkType: hard - "lodash.kebabcase@npm:^4.1.1": version: 4.1.1 resolution: "lodash.kebabcase@npm:4.1.1" @@ -23430,17 +23410,6 @@ __metadata: languageName: node linkType: hard -"md5@npm:^2.2.1": - version: 2.3.0 - resolution: "md5@npm:2.3.0" - dependencies: - charenc: 0.0.2 - crypt: 0.0.2 - is-buffer: ~1.1.6 - checksum: a63cacf4018dc9dee08c36e6f924a64ced735b37826116c905717c41cebeb41a522f7a526ba6ad578f9c80f02cb365033ccd67fe186ffbcc1a1faeb75daa9b6e - languageName: node - linkType: hard - "mdast-util-definitions@npm:^4.0.0": version: 4.0.0 resolution: "mdast-util-definitions@npm:4.0.0" @@ -30253,13 +30222,6 @@ __metadata: languageName: node linkType: hard -"remove-trailing-slash@npm:^0.1.0": - version: 0.1.1 - resolution: "remove-trailing-slash@npm:0.1.1" - checksum: dd200c6b7d6f2b49d12b3eff3abc7089917e8a268cefcd5bf67ff23f8c2ad9f866fbe2f3566e1a8dbdc4f4b1171e2941f7dd00852f8de549bb73c3df53b09d96 - languageName: node - linkType: hard - "renderkid@npm:^2.0.4": version: 2.0.7 resolution: "renderkid@npm:2.0.7"