File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " aws-sdk-js-codemod " : patch
3+ ---
4+
5+ Add disclaimer in README and process warning
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ You can provide names of the custom transforms instead of a local path or url:
1313 v2-to-v3 Converts AWS SDK for JavaScript APIs in a Javascript/TypeScript
1414 codebase from version 2 (v2) to version 3 (v3).
1515
16+ Please review the code change thoroughly for required functionality before deploying it to production.
17+ If the transformation is not complete or is incorrect, please report the issue on GitHub.
18+
1619## Prerequisites
1720
1821To use aws-sdk-js-codemod, please install [ Node.js] [ install-nodejs ] .
Original file line number Diff line number Diff line change @@ -40,6 +40,17 @@ if (args[2] === "--help" || args[2] === "-h") {
4040 process . stdout . write ( getHelpParagraph ( transforms ) ) ;
4141}
4242
43+ const disclaimerLines = [
44+ `╔════════════════════════════════════════════════════════╗` ,
45+ `║ Please review the code change thoroughly for required ║` ,
46+ `║ functionality before deploying it to production. ║` ,
47+ `║ ║` ,
48+ `║ If the transformation is not complete or is incorrect, ║` ,
49+ `║ please report the issue on GitHub. ║` ,
50+ `╚════════════════════════════════════════════════════════╝` ,
51+ `` ,
52+ ] ;
53+
4354const parser = getJsCodeshiftParser ( ) ;
4455
4556let options , positionalArguments ;
6172
6273const { transform } = options ;
6374if ( transforms . map ( ( { name } ) => name ) . includes ( transform ) ) {
75+ const supressDisclaimer = process . env . AWS_SDK_JS_CODEMOD_SUPRESS_WARNING ;
76+ if ( ! supressDisclaimer || ! supressDisclaimer === "1" ) {
77+ console . warn ( disclaimerLines . map ( ( line ) => `\n${ line } ` ) . join ( "" ) ) ;
78+ }
6479 options . transform = getUpdatedTransformFile ( transform ) ;
6580}
6681
You can’t perform that action at this time.
0 commit comments