From 2b7724aacace233926aa5dada7a297332c97a0ad Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Mon, 23 May 2022 19:07:10 +0200 Subject: [PATCH] CLI: improve texts for automigration --- lib/cli/src/automigrate/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/cli/src/automigrate/index.ts b/lib/cli/src/automigrate/index.ts index 3913eab12dda..26e9e23b0415 100644 --- a/lib/cli/src/automigrate/index.ts +++ b/lib/cli/src/automigrate/index.ts @@ -18,11 +18,14 @@ export const automigrate = async ({ fixId, dryRun, yes }: FixOptions = {}) => { const packageManager = JsPackageManagerFactory.getPackageManager(); const filtered = fixId ? fixes.filter((f) => f.id === fixId) : fixes; + logger.info('🔎 checking possible migrations..'); + for (let i = 0; i < filtered.length; i += 1) { const f = fixes[i] as Fix; - logger.info(`🔎 checking '${chalk.cyan(f.id)}'`); const result = await f.check({ packageManager }); if (result) { + logger.info(`🔎 found a '${chalk.cyan(f.id)}' migration:`); + logger.info(); const message = f.prompt(result); logger.info( @@ -39,7 +42,7 @@ export const automigrate = async ({ fixId, dryRun, yes }: FixOptions = {}) => { runAnswer = await prompts({ type: 'confirm', name: 'fix', - message: `Do you want to run the '${chalk.cyan(f.id)}' fix on your project?`, + message: `Do you want to run the '${chalk.cyan(f.id)}' migration on your project?`, }); } @@ -61,4 +64,8 @@ export const automigrate = async ({ fixId, dryRun, yes }: FixOptions = {}) => { } } } + + logger.info(); + logger.info('✅ migration check successfully ran'); + logger.info(); };