From 57c95e208c3f3ecbeafe0ec3a86b763f5cb01312 Mon Sep 17 00:00:00 2001 From: chetansinghchoudhary-wk Date: Wed, 27 Mar 2024 17:48:29 +0530 Subject: [PATCH 1/4] Added deprecated message --- .../executables/intl_message_migration.dart | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/src/executables/intl_message_migration.dart b/lib/src/executables/intl_message_migration.dart index 6f292c84..bdfdc99d 100644 --- a/lib/src/executables/intl_message_migration.dart +++ b/lib/src/executables/intl_message_migration.dart @@ -123,6 +123,7 @@ final parser = ArgParser() late ArgResults parsedArgs; void main(List args) async { + printDeprecationNotice(); parsedArgs = parser.parse(args); if (parsedArgs['help'] as bool) { printUsage(); @@ -154,6 +155,7 @@ void main(List args) async { args: codemodArgs, additionalHelpOutput: parser.usage, ); + if (exitCode != 0) return; logWarning('^ Ignore the "codemod found no files" warning above for now.'); @@ -210,14 +212,32 @@ void main(List args) async { } } +void printDeprecationNotice() { + printInRed( + '***** Attention Users of over_react_codemod:intl_message_migration *****'); + printInBlue( + '# This version of intl_migration is deprecated and will no longer receive updates.'); + stderr.writeln( + '# We recommend switching to the dart_dev / dart_dev_workiva versions for intl_codemod, which provide improved functionality and support.'); + + /// TODO: The link to the wiki will be updated here once INTL-1792 done. + stderr.writeln( + '# Refer to the documentation https://wiki.atl.workiva.net/display/FEF/Internationalization of dart_dev / dart_dev_workiva for more information on using intl_codemod with dart_dev.'); +} + void printInBlue(String text) { print(ansi.blue.wrap(text)); } +void printInRed(String text) { + print(ansi.red.wrap(text)); +} + void printUsage() { stderr.writeln( 'Migrates literal strings that seem user-visible in the package by wrapping them in Intl.message calls.'); - stderr.writeln(); + + printDeprecationNotice(); stderr.writeln('Usage:'); stderr.writeln(' intl_message_migration [arguments]'); stderr.writeln(); From 6dba108427329b2becd07c902f4304fbd0d10cb8 Mon Sep 17 00:00:00 2001 From: chetansinghchoudhary-wk Date: Wed, 27 Mar 2024 20:49:35 +0530 Subject: [PATCH 2/4] PR comment resolved --- lib/src/executables/intl_message_migration.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/src/executables/intl_message_migration.dart b/lib/src/executables/intl_message_migration.dart index bdfdc99d..11d4b686 100644 --- a/lib/src/executables/intl_message_migration.dart +++ b/lib/src/executables/intl_message_migration.dart @@ -213,12 +213,11 @@ void main(List args) async { } void printDeprecationNotice() { - printInRed( - '***** Attention Users of over_react_codemod:intl_message_migration *****'); + printInRed('***** Deprecation Notice *****'); printInBlue( - '# This version of intl_migration is deprecated and will no longer receive updates.'); - stderr.writeln( - '# We recommend switching to the dart_dev / dart_dev_workiva versions for intl_codemod, which provide improved functionality and support.'); + '# over_react_codemod:intl_message_migration is deprecated and will no longer receive updates.'); + stderr.writeln('# Instead, use the dart_dev or intl_tools commands:'); + stderr.writeln('# dart_dev intl ...'); /// TODO: The link to the wiki will be updated here once INTL-1792 done. stderr.writeln( From 8c8f66da2954e6ae8292ea9d8871ba1c8f186190 Mon Sep 17 00:00:00 2001 From: chetansinghchoudhary-wk Date: Thu, 4 Apr 2024 11:52:20 +0530 Subject: [PATCH 3/4] Updated the latest wiki link --- lib/src/executables/intl_message_migration.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/src/executables/intl_message_migration.dart b/lib/src/executables/intl_message_migration.dart index 11d4b686..5d0b5940 100644 --- a/lib/src/executables/intl_message_migration.dart +++ b/lib/src/executables/intl_message_migration.dart @@ -217,11 +217,11 @@ void printDeprecationNotice() { printInBlue( '# over_react_codemod:intl_message_migration is deprecated and will no longer receive updates.'); stderr.writeln('# Instead, use the dart_dev or intl_tools commands:'); - stderr.writeln('# dart_dev intl ...'); - - /// TODO: The link to the wiki will be updated here once INTL-1792 done. + stderr.writeln('# dart_dev intl '); + stderr.writeln('# For example: ' + 'dart_dev intl check'); stderr.writeln( - '# Refer to the documentation https://wiki.atl.workiva.net/display/FEF/Internationalization of dart_dev / dart_dev_workiva for more information on using intl_codemod with dart_dev.'); + '# Refer to the documentation https://wiki.atl.workiva.net/display/FEF/Intl+Quick+Reference+Guide of dart_dev / dart_dev_workiva for more information on using intl_codemod with dart_dev.'); } void printInBlue(String text) { @@ -236,7 +236,6 @@ void printUsage() { stderr.writeln( 'Migrates literal strings that seem user-visible in the package by wrapping them in Intl.message calls.'); - printDeprecationNotice(); stderr.writeln('Usage:'); stderr.writeln(' intl_message_migration [arguments]'); stderr.writeln(); From 3c6aa7a61a8ae2a30c19128f33fe260801327119 Mon Sep 17 00:00:00 2001 From: chetansinghchoudhary-wk Date: Wed, 24 Apr 2024 14:48:24 +0530 Subject: [PATCH 4/4] Updated the additional subcommands --- lib/src/executables/intl_message_migration.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/executables/intl_message_migration.dart b/lib/src/executables/intl_message_migration.dart index 5d0b5940..9633e4c4 100644 --- a/lib/src/executables/intl_message_migration.dart +++ b/lib/src/executables/intl_message_migration.dart @@ -217,9 +217,9 @@ void printDeprecationNotice() { printInBlue( '# over_react_codemod:intl_message_migration is deprecated and will no longer receive updates.'); stderr.writeln('# Instead, use the dart_dev or intl_tools commands:'); - stderr.writeln('# dart_dev intl '); + stderr.writeln('# dart_dev intl '); stderr.writeln('# For example: ' - 'dart_dev intl check'); + 'dart_dev intl {check|migrate|sort}'); stderr.writeln( '# Refer to the documentation https://wiki.atl.workiva.net/display/FEF/Intl+Quick+Reference+Guide of dart_dev / dart_dev_workiva for more information on using intl_codemod with dart_dev.'); }