From 8ced37bc8bde635b2c10ec162fbd584304dbea58 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 4 Sep 2023 16:44:23 +0100 Subject: [PATCH] fix(nuxt): improve types within plugin templates (#22998) --- packages/nuxt/src/components/module.ts | 6 +++--- packages/nuxt/src/components/templates.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/nuxt/src/components/module.ts b/packages/nuxt/src/components/module.ts index b0c858692e..b7db1018b8 100644 --- a/packages/nuxt/src/components/module.ts +++ b/packages/nuxt/src/components/module.ts @@ -114,11 +114,11 @@ export default defineNuxtModule({ }) // components.d.ts - addTemplate({ ...componentsTypeTemplate }) + addTemplate(componentsTypeTemplate) // components.plugin.mjs - addPluginTemplate({ ...componentsPluginTemplate } as any) + addPluginTemplate(componentsPluginTemplate) // component-names.mjs - addTemplate({ ...componentNamesTemplate, options: { mode: 'all' } }) + addTemplate(componentNamesTemplate) // components.islands.mjs if (nuxt.options.experimental.componentIslands) { addTemplate({ ...componentsIslandsTemplate, filename: 'components.islands.mjs' }) diff --git a/packages/nuxt/src/components/templates.ts b/packages/nuxt/src/components/templates.ts index 6bb86c50fb..2847270a33 100644 --- a/packages/nuxt/src/components/templates.ts +++ b/packages/nuxt/src/components/templates.ts @@ -33,7 +33,7 @@ export default defineNuxtPlugin({ }) ` -export const componentsPluginTemplate: NuxtPluginTemplate = { +export const componentsPluginTemplate: NuxtPluginTemplate = { filename: 'components.plugin.mjs', getContents ({ app }) { const lazyGlobalComponents = new Set() @@ -70,7 +70,7 @@ export default defineNuxtPlugin({ } } -export const componentNamesTemplate: NuxtPluginTemplate = { +export const componentNamesTemplate: NuxtTemplate = { filename: 'component-names.mjs', getContents ({ app }) { return `export const componentNames = ${JSON.stringify(app.components.filter(c => !c.island).map(c => c.pascalName))}`