From 61f01726c9278c15fc0c41a600f7b49d2b8ad0d2 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 22 Oct 2024 13:56:42 +0100 Subject: [PATCH] feat(module): rerun prepare command after installing module resolves https://github.com/nuxt/cli/issues/520 --- src/commands/module/add.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/module/add.ts b/src/commands/module/add.ts index c3c6b773..c139f2ef 100644 --- a/src/commands/module/add.ts +++ b/src/commands/module/add.ts @@ -12,6 +12,7 @@ import { satisfies } from 'semver' import { updateConfig } from 'c12/update' import { colors } from 'consola/utils' import { sharedArgs } from '../_shared' +import { runCommand } from '../../run' import { checkNuxtCompatibility, fetchModules, @@ -116,6 +117,10 @@ export default defineCommand({ return null }) } + + // update the types for new module + const args = Object.entries(ctx.args).filter(([k]) => k in sharedArgs).map(([k, v]) => `--${k}=${v}`) + await runCommand('prepare', args) }, })