From ad13a756d7f90541705107c033379db471c17925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Thu, 10 Oct 2024 10:58:18 +0200 Subject: [PATCH] ci: Upgrade frontend dev tooling (no-changelog) (#10786) --- package.json | 3 +- packages/@n8n/chat/package.json | 2 +- packages/@n8n/storybook/package.json | 24 +- .../__tests__/AskAssistantChat.spec.ts | 11 + .../AskAssistantChat.spec.ts.snap | 46 +- .../CodeDiff/__tests__/CodeDiff.spec.ts | 9 + .../__snapshots__/CodeDiff.spec.ts.snap | 22 +- .../src/components/N8nOption/Option.vue | 4 +- .../src/components/N8nSelect/Select.vue | 4 +- packages/editor-ui/package.json | 6 +- .../__snapshots__/RunDataSchema.test.ts.snap | 6 + pnpm-lock.yaml | 1597 ++++++++--------- pnpm-workspace.yaml | 6 +- 13 files changed, 854 insertions(+), 886 deletions(-) diff --git a/package.json b/package.json index 77a80a929b..ee888f53dd 100644 --- a/package.json +++ b/package.json @@ -70,13 +70,14 @@ "overrides": { "@types/node": "^18.16.16", "chokidar": "^4.0.1", - "esbuild": "^0.21.5", + "esbuild": "^0.24.0", "formidable": "3.5.1", "pug": "^3.0.3", "semver": "^7.5.4", "tslib": "^2.6.2", "tsconfig-paths": "^4.2.0", "typescript": "^5.6.2", + "vue-tsc": "^2.1.6", "ws": ">=8.17.1" }, "patchedDependencies": { diff --git a/packages/@n8n/chat/package.json b/packages/@n8n/chat/package.json index b6379b1fe0..24d6cf6f1c 100644 --- a/packages/@n8n/chat/package.json +++ b/packages/@n8n/chat/package.json @@ -50,7 +50,7 @@ "unplugin-icons": "^0.19.0", "vite": "catalog:frontend", "vitest": "catalog:frontend", - "vite-plugin-dts": "^3.9.1", + "vite-plugin-dts": "^4.2.3", "vue-tsc": "catalog:frontend" }, "files": [ diff --git a/packages/@n8n/storybook/package.json b/packages/@n8n/storybook/package.json index 7a08f9ce51..7b2230a36b 100644 --- a/packages/@n8n/storybook/package.json +++ b/packages/@n8n/storybook/package.json @@ -4,18 +4,18 @@ "version": "0.0.1", "devDependencies": { "@chromatic-com/storybook": "^2.0.2", - "@storybook/addon-a11y": "^8.3.1", - "@storybook/addon-actions": "^8.3.1", - "@storybook/addon-docs": "^8.3.1", - "@storybook/addon-essentials": "^8.3.1", - "@storybook/addon-interactions": "^8.3.1", - "@storybook/addon-links": "^8.3.1", - "@storybook/addon-themes": "^8.3.1", - "@storybook/blocks": "^8.3.1", - "@storybook/test": "^8.3.1", - "@storybook/vue3": "^8.3.1", - "@storybook/vue3-vite": "^8.3.1", + "@storybook/addon-a11y": "^8.3.5", + "@storybook/addon-actions": "^8.3.5", + "@storybook/addon-docs": "^8.3.5", + "@storybook/addon-essentials": "^8.3.5", + "@storybook/addon-interactions": "^8.3.5", + "@storybook/addon-links": "^8.3.5", + "@storybook/addon-themes": "^8.3.5", + "@storybook/blocks": "^8.3.5", + "@storybook/test": "^8.3.5", + "@storybook/vue3": "^8.3.5", + "@storybook/vue3-vite": "^8.3.5", "chromatic": "^11.10.2", - "storybook": "^8.3.1" + "storybook": "^8.3.5" } } diff --git a/packages/design-system/src/components/AskAssistantChat/__tests__/AskAssistantChat.spec.ts b/packages/design-system/src/components/AskAssistantChat/__tests__/AskAssistantChat.spec.ts index 8977df997a..b4b7d281a5 100644 --- a/packages/design-system/src/components/AskAssistantChat/__tests__/AskAssistantChat.spec.ts +++ b/packages/design-system/src/components/AskAssistantChat/__tests__/AskAssistantChat.spec.ts @@ -4,21 +4,26 @@ import { n8nHtml } from 'n8n-design-system/directives'; import AskAssistantChat from '../AskAssistantChat.vue'; +const stubs = ['n8n-avatar', 'n8n-button', 'n8n-icon', 'n8n-icon-button']; + describe('AskAssistantChat', () => { it('renders default placeholder chat correctly', () => { const { container } = render(AskAssistantChat, { props: { user: { firstName: 'Kobi', lastName: 'Dog' }, }, + global: { stubs }, }); expect(container).toMatchSnapshot(); }); + it('renders chat with messages correctly', () => { const { container } = render(AskAssistantChat, { global: { directives: { n8nHtml, }, + stubs, }, props: { user: { firstName: 'Kobi', lastName: 'Dog' }, @@ -92,12 +97,14 @@ describe('AskAssistantChat', () => { }); expect(container).toMatchSnapshot(); }); + it('renders streaming chat correctly', () => { const { container } = render(AskAssistantChat, { global: { directives: { n8nHtml, }, + stubs, }, props: { user: { firstName: 'Kobi', lastName: 'Dog' }, @@ -116,12 +123,14 @@ describe('AskAssistantChat', () => { }); expect(container).toMatchSnapshot(); }); + it('renders end of session chat correctly', () => { const { container } = render(AskAssistantChat, { global: { directives: { n8nHtml, }, + stubs, }, props: { user: { firstName: 'Kobi', lastName: 'Dog' }, @@ -146,12 +155,14 @@ describe('AskAssistantChat', () => { }); expect(container).toMatchSnapshot(); }); + it('renders message with code snippet', () => { const { container } = render(AskAssistantChat, { global: { directives: { n8nHtml, }, + stubs, }, props: { user: { firstName: 'Kobi', lastName: 'Dog' }, diff --git a/packages/design-system/src/components/AskAssistantChat/__tests__/__snapshots__/AskAssistantChat.spec.ts.snap b/packages/design-system/src/components/AskAssistantChat/__tests__/__snapshots__/AskAssistantChat.spec.ts.snap index b3cfeff42a..79b57d2d17 100644 --- a/packages/design-system/src/components/AskAssistantChat/__tests__/__snapshots__/AskAssistantChat.spec.ts.snap +++ b/packages/design-system/src/components/AskAssistantChat/__tests__/__snapshots__/AskAssistantChat.spec.ts.snap @@ -64,7 +64,7 @@ exports[`AskAssistantChat > renders chat with messages correctly 1`] = ` class="back" data-test-id="close-chat-button" > - @@ -400,16 +400,14 @@ exports[`AskAssistantChat > renders chat with messages correctly 1`] = `
- - Replace my code - + />
@@ -422,7 +420,7 @@ exports[`AskAssistantChat > renders chat with messages correctly 1`] = `
- - - Replace my code - + />
@@ -708,22 +704,18 @@ Testing more code
- - Give me another solution - + />
- - All good - + />
@@ -742,7 +734,7 @@ Testing more code rows="1" wrap="hard" /> - renders default placeholder chat correctly 1`] = ` class="back" data-test-id="close-chat-button" > - @@ -916,7 +908,7 @@ exports[`AskAssistantChat > renders default placeholder chat correctly 1`] = ` rows="1" wrap="hard" /> - renders end of session chat correctly 1`] = ` class="back" data-test-id="close-chat-button" > - @@ -1161,7 +1153,7 @@ exports[`AskAssistantChat > renders end of session chat correctly 1`] = ` rows="1" wrap="hard" /> - renders message with code snippet 1`] = ` class="back" data-test-id="close-chat-button" > - @@ -1405,7 +1397,7 @@ catch(e) { rows="1" wrap="hard" /> - renders streaming chat correctly 1`] = ` class="back" data-test-id="close-chat-button" > - @@ -1581,7 +1573,7 @@ exports[`AskAssistantChat > renders streaming chat correctly 1`] = ` rows="1" wrap="hard" /> - { it('renders code diff correctly', () => { const { container } = render(CodeDiff, { @@ -10,9 +12,11 @@ describe('CodeDiff', () => { content: "--- original.js\n+++ modified.js\n@@ -1,2 +1,2 @@\n-const SIGNING_SECRET = $input.first().json.slack_secret_signature;\n-const item = $('Webhook to call for Slack command').first();\n+const SIGNING_SECRET = items[0].json.slack_secret_signature;\n+const item = items[0];\n@@ -7,8 +7,6 @@\n}\n\n-const crypto = require('crypto');\n-\n const { binary: { data } } = item;\n\n if (\n@@ -22,7 +20,7 @@\n const rawBody = Buffer.from(data.data, 'base64').toString()\n \n // compute the ", }, + global: { stubs }, }); expect(container).toMatchSnapshot(); }); + it('renders replaced code diff correctly', () => { const { container } = render(CodeDiff, { props: { @@ -21,9 +25,11 @@ describe('CodeDiff', () => { '@@ -1,7 +1,6 @@\n-The Way that can be told of is not the eternal Way;\n-The name that can be named is not the eternal name.\nThe Nameless is the origin of Heaven and Earth;\n-The Named is the mother of all things.\n+The named is the mother of all things.\n+\nTherefore let there always be non-being,\nso we may see their subtlety,\nAnd let there always be being,\n@@ -9,3 +8,6 @@\n The two are the same,\n But after they are produced,\n they have different names.\n+They both may be called deep and profound.\n+Deeper and more profound,\n+The door of all subtleties!', replaced: true, }, + global: { stubs }, }); expect(container).toMatchSnapshot(); }); + it('renders replacing code diff correctly', () => { const { container } = render(CodeDiff, { props: { @@ -32,9 +38,11 @@ describe('CodeDiff', () => { '@@ -1,7 +1,6 @@\n-The Way that can be told of is not the eternal Way;\n-The name that can be named is not the eternal name.\nThe Nameless is the origin of Heaven and Earth;\n-The Named is the mother of all things.\n+The named is the mother of all things.\n+\nTherefore let there always be non-being,\nso we may see their subtlety,\nAnd let there always be being,\n@@ -9,3 +8,6 @@\n The two are the same,\n But after they are produced,\n they have different names.\n+They both may be called deep and profound.\n+Deeper and more profound,\n+The door of all subtleties!', replacing: true, }, + global: { stubs }, }); expect(container).toMatchSnapshot(); }); + it('renders error state correctly', () => { const { container } = render(CodeDiff, { props: { @@ -43,6 +51,7 @@ describe('CodeDiff', () => { '@@ -1,7 +1,6 @@\n-The Way that can be told of is not the eternal Way;\n-The name that can be named is not the eternal name.\nThe Nameless is the origin of Heaven and Earth;\n-The Named is the mother of all things.\n+The named is the mother of all things.\n+\nTherefore let there always be non-being,\nso we may see their subtlety,\nAnd let there always be being,\n@@ -9,3 +8,6 @@\n The two are the same,\n But after they are produced,\n they have different names.\n+They both may be called deep and profound.\n+Deeper and more profound,\n+The door of all subtleties!', error: true, }, + global: { stubs }, }); expect(container).toMatchSnapshot(); }); diff --git a/packages/design-system/src/components/CodeDiff/__tests__/__snapshots__/CodeDiff.spec.ts.snap b/packages/design-system/src/components/CodeDiff/__tests__/__snapshots__/CodeDiff.spec.ts.snap index 97fc21bf5a..0810f24767 100644 --- a/packages/design-system/src/components/CodeDiff/__tests__/__snapshots__/CodeDiff.spec.ts.snap +++ b/packages/design-system/src/components/CodeDiff/__tests__/__snapshots__/CodeDiff.spec.ts.snap @@ -270,16 +270,14 @@ exports[`CodeDiff > renders code diff correctly 1`] = `
- - Replace my code - + />
@@ -535,7 +533,7 @@ exports[`CodeDiff > renders error state correctly 1`] = ` class="actions" >
- renders replaced code diff correctly 1`] = ` class="actions" >
- - Undo - - + renders replacing code diff correctly 1`] = `
- - Replacing... - + />
diff --git a/packages/design-system/src/components/N8nOption/Option.vue b/packages/design-system/src/components/N8nOption/Option.vue index bd56fdab91..e7c44f475c 100644 --- a/packages/design-system/src/components/N8nOption/Option.vue +++ b/packages/design-system/src/components/N8nOption/Option.vue @@ -1,12 +1,12 @@ diff --git a/packages/design-system/src/components/N8nSelect/Select.vue b/packages/design-system/src/components/N8nSelect/Select.vue index 1e2870c5d1..7cb4fafcc9 100644 --- a/packages/design-system/src/components/N8nSelect/Select.vue +++ b/packages/design-system/src/components/N8nSelect/Select.vue @@ -120,9 +120,9 @@ defineExpose({