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:
13
13
v2-to-v3 Converts AWS SDK for JavaScript APIs in a Javascript/TypeScript
14
14
codebase from version 2 (v2) to version 3 (v3).
15
15
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
+
16
19
## Prerequisites
17
20
18
21
To 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") {
40
40
process . stdout . write ( getHelpParagraph ( transforms ) ) ;
41
41
}
42
42
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
+
43
54
const parser = getJsCodeshiftParser ( ) ;
44
55
45
56
let options , positionalArguments ;
61
72
62
73
const { transform } = options ;
63
74
if ( 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
+ }
64
79
options . transform = getUpdatedTransformFile ( transform ) ;
65
80
}
66
81
You can’t perform that action at this time.
0 commit comments