Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Improve texts for automigration #18303

Merged
merged 1 commit into from
May 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/cli/src/automigrate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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?`,
});
}

Expand All @@ -61,4 +64,8 @@ export const automigrate = async ({ fixId, dryRun, yes }: FixOptions = {}) => {
}
}
}

logger.info();
logger.info('✅ migration check successfully ran');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to suggest better texts for these.

Looks like this (this was before I added extra logs for spaces around)
image

logger.info();
};