From 1a982d51b366264b1b6aaf46a793bc3e6f1d2aa5 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Mon, 3 Jun 2024 16:04:21 +0300 Subject: [PATCH] refactor(editor): Fix typecheck for design-system and chat packages (no-changelog) (#9599) --- packages/design-system/src/__tests__/setup.ts | 2 +- .../src/components/N8nActionBox/ActionBox.vue | 2 +- .../N8nActionDropdown/ActionDropdown.vue | 2 +- .../N8nActionToggle/ActionToggle.vue | 4 ++-- .../src/components/N8nBadge/Badge.vue | 2 +- .../src/components/N8nButton/Button.vue | 2 +- .../src/components/N8nCallout/Callout.vue | 4 ++-- .../src/components/N8nCheckbox/Checkbox.vue | 7 +++++-- .../components/N8nColorPicker/ColorPicker.vue | 12 ++++++------ .../src/components/N8nFormBox/FormBox.vue | 2 +- .../components/N8nFormInputs/FormInputs.vue | 2 +- .../src/components/N8nIcon/Icon.vue | 2 +- .../components/N8nIconButton/IconButton.vue | 2 +- .../N8nInfoAccordion/InfoAccordion.vue | 2 +- .../src/components/N8nInput/Input.vue | 4 ++-- .../components/N8nInputLabel/InputLabel.vue | 2 +- .../components/N8nInputNumber/InputNumber.vue | 2 +- .../src/components/N8nLink/Link.vue | 2 +- .../src/components/N8nMarkdown/Markdown.vue | 5 ++++- .../src/components/N8nMenu/Menu.vue | 4 ++-- .../src/components/N8nMenuItem/routerUtil.ts | 2 +- .../N8nNotice/__tests__/Notice.spec.ts | 2 +- .../N8nResizeWrapper/ResizeWrapper.vue | 6 +++--- .../src/components/N8nSelect/Select.vue | 2 +- .../src/components/N8nSpinner/Spinner.vue | 2 +- .../src/components/N8nSticky/Sticky.vue | 12 ++++++------ .../src/components/N8nTabs/Tabs.vue | 2 +- .../src/components/N8nText/Text.vue | 2 +- .../src/components/N8nTooltip/Tooltip.vue | 2 +- .../src/components/N8nTree/Tree.vue | 18 +++++++++++++++--- .../src/components/N8nUserStack/UserStack.vue | 2 +- .../N8nUserStack/__tests__/UserStack.spec.ts | 2 +- .../N8nUsersList/UsersList.stories.ts | 2 +- .../src/composables/useDeviceSupport.test.ts | 2 +- packages/design-system/src/locale/index.ts | 2 +- packages/design-system/src/locale/lang/en.ts | 2 +- .../design-system/src/types/action-dropdown.ts | 2 +- .../src/utils/__tests__/valueByPath.spec.ts | 2 +- packages/design-system/tsconfig.json | 2 +- packages/editor-ui/tsconfig.json | 7 +++++-- 40 files changed, 81 insertions(+), 60 deletions(-) diff --git a/packages/design-system/src/__tests__/setup.ts b/packages/design-system/src/__tests__/setup.ts index 1734bac34f..9ebe505648 100644 --- a/packages/design-system/src/__tests__/setup.ts +++ b/packages/design-system/src/__tests__/setup.ts @@ -1,5 +1,5 @@ import '@testing-library/jest-dom'; import { config } from '@vue/test-utils'; -import { N8nPlugin } from '@/plugin'; +import { N8nPlugin } from 'n8n-design-system/plugin'; config.global.plugins = [N8nPlugin]; diff --git a/packages/design-system/src/components/N8nActionBox/ActionBox.vue b/packages/design-system/src/components/N8nActionBox/ActionBox.vue index 575e35ffe4..916e888860 100644 --- a/packages/design-system/src/components/N8nActionBox/ActionBox.vue +++ b/packages/design-system/src/components/N8nActionBox/ActionBox.vue @@ -40,7 +40,7 @@ import N8nButton from '../N8nButton'; import N8nHeading from '../N8nHeading'; import N8nText from '../N8nText'; import N8nCallout, { type CalloutTheme } from '../N8nCallout'; -import type { ButtonType } from '@/types/button'; +import type { ButtonType } from 'n8n-design-system/types/button'; interface ActionBoxProps { emoji: string; diff --git a/packages/design-system/src/components/N8nActionDropdown/ActionDropdown.vue b/packages/design-system/src/components/N8nActionDropdown/ActionDropdown.vue index 2ec50e72bc..1159ba52b9 100644 --- a/packages/design-system/src/components/N8nActionDropdown/ActionDropdown.vue +++ b/packages/design-system/src/components/N8nActionDropdown/ActionDropdown.vue @@ -62,7 +62,7 @@ import { ElDropdown, ElDropdownMenu, ElDropdownItem, type Placement } from 'elem import N8nIcon from '../N8nIcon'; import { N8nKeyboardShortcut } from '../N8nKeyboardShortcut'; import type { ActionDropdownItem } from '../../types'; -import type { IconSize } from '@/types/icon'; +import type { IconSize } from 'n8n-design-system/types/icon'; const TRIGGER = ['click', 'hover'] as const; diff --git a/packages/design-system/src/components/N8nActionToggle/ActionToggle.vue b/packages/design-system/src/components/N8nActionToggle/ActionToggle.vue index b1e5fb215b..331ee25947 100644 --- a/packages/design-system/src/components/N8nActionToggle/ActionToggle.vue +++ b/packages/design-system/src/components/N8nActionToggle/ActionToggle.vue @@ -43,9 +43,9 @@ diff --git a/packages/design-system/src/components/N8nFormBox/FormBox.vue b/packages/design-system/src/components/N8nFormBox/FormBox.vue index 33ecb2d7a7..2c9d875dd1 100644 --- a/packages/design-system/src/components/N8nFormBox/FormBox.vue +++ b/packages/design-system/src/components/N8nFormBox/FormBox.vue @@ -43,7 +43,7 @@ import N8nFormInputs from '../N8nFormInputs'; import N8nHeading from '../N8nHeading'; import N8nLink from '../N8nLink'; import N8nButton from '../N8nButton'; -import type { IFormInput } from '@/types'; +import type { IFormInput } from 'n8n-design-system/types'; import { createEventBus } from '../../utils'; interface FormBoxProps { diff --git a/packages/design-system/src/components/N8nFormInputs/FormInputs.vue b/packages/design-system/src/components/N8nFormInputs/FormInputs.vue index 293b78e854..b49103493e 100644 --- a/packages/design-system/src/components/N8nFormInputs/FormInputs.vue +++ b/packages/design-system/src/components/N8nFormInputs/FormInputs.vue @@ -126,7 +126,7 @@ export default defineComponent({ onUpdateModelValue(name: string, value: unknown) { this.values = { ...this.values, - [name]: value, + [name]: value as Validatable, }; this.$emit('update', { name, value }); this.$emit('update:modelValue', this.values); diff --git a/packages/design-system/src/components/N8nIcon/Icon.vue b/packages/design-system/src/components/N8nIcon/Icon.vue index 0caa880ba9..e4b431d4dc 100644 --- a/packages/design-system/src/components/N8nIcon/Icon.vue +++ b/packages/design-system/src/components/N8nIcon/Icon.vue @@ -7,7 +7,7 @@