Skip to content

Commit e0176fb

Browse files
authored
Add disclaimer in README and process warning (#679)
1 parent 68341cc commit e0176fb

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.changeset/two-oranges-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": patch
3+
---
4+
5+
Add disclaimer in README and process warning

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

1821
To use aws-sdk-js-codemod, please install [Node.js][install-nodejs].

src/cli.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
4354
const parser = getJsCodeshiftParser();
4455

4556
let options, positionalArguments;
@@ -61,6 +72,10 @@ try {
6172

6273
const { transform } = options;
6374
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+
}
6479
options.transform = getUpdatedTransformFile(transform);
6580
}
6681

0 commit comments

Comments
 (0)