From a262c450f718f299ec78e30aa99c11afa0f00bcc Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Mon, 13 Nov 2023 15:10:42 +0200 Subject: [PATCH] feat: Rewrite Front End cloud and posthog hooks using TypeScript (no-changelog) (#5491) --- packages/editor-ui/package.json | 2 +- packages/editor-ui/src/App.vue | 25 +- packages/editor-ui/src/Interface.ts | 8 +- .../editor-ui/src/components/MainSidebar.vue | 10 +- .../Node/NodeCreator/Modes/ActionsMode.vue | 5 +- .../Node/NodeCreator/Panel/SearchBar.vue | 9 +- .../NodeCreator/composables/useActions.ts | 3 +- .../src/components/ParameterInput.vue | 2 +- .../src/components/PersonalizationModal.vue | 5 +- .../src/components/RunDataSchema.vue | 4 +- .../editor-ui/src/components/VariablesRow.vue | 3 +- .../components/__tests__/BannersStack.test.ts | 10 +- .../components/__tests__/VariablesRow.spec.ts | 3 +- .../src/components/banners/TrialBanner.vue | 2 +- .../components/banners/TrialOverBanner.vue | 2 +- .../src/components/banners/V1Banner.vue | 2 +- .../src/composables/useExternalHooks.ts | 6 +- packages/editor-ui/src/hooks/cloud.ts | 513 ++++++++++++++++++ packages/editor-ui/src/hooks/index.ts | 4 + packages/editor-ui/src/hooks/init.ts | 1 + .../editor-ui/src/hooks/segment/getters.ts | 351 ++++++++++++ packages/editor-ui/src/hooks/segment/index.ts | 1 + packages/editor-ui/src/hooks/types.ts | 6 + .../src/hooks/utils/hooksAddAdminIcon.ts | 38 ++ .../hooksAddAutoLoginToAdminPanelButton.ts | 15 + .../hooks/utils/hooksAddFakeDoorFeatures.ts | 33 ++ .../src/hooks/utils/hooksNodesPanel.ts | 30 + packages/editor-ui/src/hooks/utils/index.ts | 4 + packages/editor-ui/src/main.ts | 2 + .../editor-ui/src/mixins/externalHooks.ts | 30 +- packages/editor-ui/src/router.ts | 3 +- packages/editor-ui/src/shims.d.ts | 10 +- .../editor-ui/src/stores/posthog.store.ts | 1 + .../editor-ui/src/stores/segment.store.ts | 19 + .../editor-ui/src/stores/settings.store.ts | 5 +- .../editor-ui/src/stores/webhooks.store.ts | 70 +-- packages/editor-ui/src/types/externalHooks.ts | 294 ++++++++++ packages/editor-ui/src/types/index.ts | 1 + packages/editor-ui/src/utils/externalHooks.ts | 27 +- .../__tests__/SettingsExternalSecrets.test.ts | 2 +- .../__tests__/SettingsPersonalView.test.ts | 9 +- 41 files changed, 1439 insertions(+), 131 deletions(-) create mode 100644 packages/editor-ui/src/hooks/cloud.ts create mode 100644 packages/editor-ui/src/hooks/index.ts create mode 100644 packages/editor-ui/src/hooks/init.ts create mode 100644 packages/editor-ui/src/hooks/segment/getters.ts create mode 100644 packages/editor-ui/src/hooks/segment/index.ts create mode 100644 packages/editor-ui/src/hooks/types.ts create mode 100644 packages/editor-ui/src/hooks/utils/hooksAddAdminIcon.ts create mode 100644 packages/editor-ui/src/hooks/utils/hooksAddAutoLoginToAdminPanelButton.ts create mode 100644 packages/editor-ui/src/hooks/utils/hooksAddFakeDoorFeatures.ts create mode 100644 packages/editor-ui/src/hooks/utils/hooksNodesPanel.ts create mode 100644 packages/editor-ui/src/hooks/utils/index.ts create mode 100644 packages/editor-ui/src/types/externalHooks.ts create mode 100644 packages/editor-ui/src/types/index.ts diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 795f1807d4336..eed011ddbb6fc 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -16,7 +16,7 @@ "scripts": { "clean": "rimraf dist .turbo", "build": "cross-env VUE_APP_PUBLIC_PATH=\"/{{BASE_PATH}}/\" NODE_OPTIONS=\"--max-old-space-size=8192\" vite build", - "typecheck": "vue-tsc --emitDeclarationOnly", + "typecheck": "vue-tsc", "dev": "pnpm serve", "lint": "eslint src --ext .js,.ts,.vue --quiet", "lintfix": "eslint src --ext .js,.ts,.vue --fix", diff --git a/packages/editor-ui/src/App.vue b/packages/editor-ui/src/App.vue index d818ab67754fa..ab2943e8ef98f 100644 --- a/packages/editor-ui/src/App.vue +++ b/packages/editor-ui/src/App.vue @@ -35,6 +35,8 @@