From a92353857292eb83964588c21557b94c78e9dd28 Mon Sep 17 00:00:00 2001 From: Lars Rickert Date: Wed, 31 Jul 2024 10:19:34 +0200 Subject: [PATCH 1/2] fix: add missing prop controls --- code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts b/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts index bb06a958a771..2696f116ffbd 100644 --- a/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts +++ b/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts @@ -284,7 +284,11 @@ async function getTsConfigReferences(tsConfigPath: string) { * HTMLElement, MouseEvent) are used. */ function removeNestedSchemas(schema: PropertyMetaSchema) { - if (typeof schema !== 'object') { + if (typeof schema !== 'object') return; + if (schema.kind === 'enum') { + // for enum types, we do not want to remove the schemas because otherwise the controls will be missing + // instead we remove the nested schemas for the enum entries to prevent out of memory errors for types like "HTMLElement | MouseEvent" + schema.schema?.forEach((enumSchema) => removeNestedSchemas(enumSchema)); return; } delete schema.schema; From 01d1ef28dcc2e1585eb8a8c65ca1b4f9cc2b4f7a Mon Sep 17 00:00:00 2001 From: Lars Rickert Date: Tue, 10 Sep 2024 10:00:44 +0200 Subject: [PATCH 2/2] fix linter formatting issues --- code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts b/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts index a384ab78700e..aea3d269a1e3 100644 --- a/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts +++ b/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts @@ -284,7 +284,9 @@ async function getTsConfigReferences(tsConfigPath: string) { * HTMLElement, MouseEvent) are used. */ function removeNestedSchemas(schema: PropertyMetaSchema) { - if (typeof schema !== 'object') return; + if (typeof schema !== 'object') { + return; + } if (schema.kind === 'enum') { // for enum types, we do not want to remove the schemas because otherwise the controls will be missing // instead we remove the nested schemas for the enum entries to prevent out of memory errors for types like "HTMLElement | MouseEvent"