From e4bfea642878ae742b1747e3e0d5142470000c39 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 13 Jun 2024 21:00:11 +0100 Subject: [PATCH] fix(nuxt,schema): add types for `_installedModules` --- packages/kit/src/template.ts | 2 +- packages/nuxt/src/core/nitro.ts | 2 +- packages/schema/src/config/internal.ts | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/kit/src/template.ts b/packages/kit/src/template.ts index 194434f69f..1816ccf536 100644 --- a/packages/kit/src/template.ts +++ b/packages/kit/src/template.ts @@ -120,7 +120,7 @@ export async function _generateTypes (nuxt: Nuxt) { const modulePaths = await resolveNuxtModule(rootDirWithSlash, nuxt.options._installedModules .filter(m => m.entryPath) - .map(m => getDirectory(m.entryPath)), + .map(m => getDirectory(m.entryPath!)), ) const isV4 = nuxt.options.future?.compatibilityVersion === 4 diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index 84d6aec7dd..4c96a48666 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -43,7 +43,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) { const modules = await resolveNuxtModule(rootDirWithSlash, nuxt.options._installedModules .filter(m => m.entryPath) - .map(m => m.entryPath), + .map(m => m.entryPath!), ) const nitroConfig: NitroConfig = defu(nuxt.options.nitro, { diff --git a/packages/schema/src/config/internal.ts b/packages/schema/src/config/internal.ts index 5f6545c469..346beff214 100644 --- a/packages/schema/src/config/internal.ts +++ b/packages/schema/src/config/internal.ts @@ -23,7 +23,10 @@ export default defineUntypedSchema({ _nuxtConfigFiles: [], /** @private */ appDir: '', - /** @private */ + /** + * @private + * @type {Array<{ meta: ModuleMeta; timings?: Record; entryPath?: string }>} + */ _installedModules: [], /** @private */ _modules: [],