From b35b111032b1d156a1d2b675d24aa925edacc8c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Tue, 12 Oct 2021 14:32:49 +0200 Subject: [PATCH] fix(nuxi): dx improvements when creating `components/` directory (#749) --- packages/nuxi/src/commands/dev.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/nuxi/src/commands/dev.ts b/packages/nuxi/src/commands/dev.ts index 918479c4da..01d1ad9880 100644 --- a/packages/nuxi/src/commands/dev.ts +++ b/packages/nuxi/src/commands/dev.ts @@ -35,7 +35,7 @@ export default defineNuxtCommand({ const message = `${reason ? reason + '. ' : ''}${isRestart ? 'Restarting' : 'Starting'} nuxt...` server.setApp(createLoadingHandler(message)) if (isRestart) { - console.log(message) + consola.info(message) } if (currentNuxt) { await currentNuxt.close() @@ -68,10 +68,13 @@ export default defineNuxtCommand({ dLoad(true, `${relative(rootDir, file)} updated`) } if (['addDir', 'unlinkDir'].includes(_event) && file.match(/pages$/)) { - dLoad(true, `pages/ ${_event === 'addDir' ? 'created' : 'removed'}`) + dLoad(true, `Directory \`pages/\` ${_event === 'addDir' ? 'created' : 'removed'}`) + } + if (['addDir', 'unlinkDir'].includes(_event) && file.match(/components$/)) { + dLoad(true, `Directory \`components/\` ${_event === 'addDir' ? 'created' : 'removed'}`) } if (['add', 'unlink'].includes(_event) && file.match(/app\.(js|ts|mjs|jsx|tsx|vue)$/)) { - dLoad(true, `${relative(rootDir, file)}/ ${_event === 'add' ? 'created' : 'removed'}`) + dLoad(true, `\`${relative(rootDir, file)}\` ${_event === 'add' ? 'created' : 'removed'}`) } })