Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/two-oranges-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"aws-sdk-js-codemod": patch
---

Add disclaimer in README and process warning
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ You can provide names of the custom transforms instead of a local path or url:
v2-to-v3 Converts AWS SDK for JavaScript APIs in a Javascript/TypeScript
codebase from version 2 (v2) to version 3 (v3).

Please review the code change thoroughly for required functionality before deploying it to production.
If the transformation is not complete or is incorrect, please report the issue on GitHub.

## Prerequisites

To use aws-sdk-js-codemod, please install [Node.js][install-nodejs].
Expand Down
15 changes: 15 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ if (args[2] === "--help" || args[2] === "-h") {
process.stdout.write(getHelpParagraph(transforms));
}

const disclaimerLines = [
`╔════════════════════════════════════════════════════════╗`,
`║ Please review the code change thoroughly for required ║`,
`║ functionality before deploying it to production. ║`,
`║ ║`,
`║ If the transformation is not complete or is incorrect, ║`,
`║ please report the issue on GitHub. ║`,
`╚════════════════════════════════════════════════════════╝`,
``,
];

const parser = getJsCodeshiftParser();

let options, positionalArguments;
Expand All @@ -61,6 +72,10 @@ try {

const { transform } = options;
if (transforms.map(({ name }) => name).includes(transform)) {
const supressDisclaimer = process.env.AWS_SDK_JS_CODEMOD_SUPRESS_WARNING;
if (!supressDisclaimer || !supressDisclaimer === "1") {
console.warn(disclaimerLines.map((line) => `\n${line}`).join(""));
}
options.transform = getUpdatedTransformFile(transform);
}

Expand Down