Skip to content

Commit 6b084b9

Browse files
authored
chore(smithy-client): emit unsupported version warning for Node.js <14.x (#3636)
1 parent edf0a65 commit 6b084b9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/smithy-client/src/emitWarningIfUnsupportedVersion.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe("emitWarningIfUnsupportedVersion", () => {
22
let emitWarningIfUnsupportedVersion;
33
const emitWarning = process.emitWarning;
4-
const supportedVersion = "12.0.0";
4+
const supportedVersion = "14.0.0";
55

66
beforeEach(() => {
77
const module = require("./emitWarningIfUnsupportedVersion");
@@ -38,10 +38,10 @@ describe("emitWarningIfUnsupportedVersion", () => {
3838
expect(process.emitWarning).toHaveBeenCalledTimes(1);
3939
expect(process.emitWarning).toHaveBeenCalledWith(
4040
`The AWS SDK for JavaScript (v3) will\n` +
41-
`no longer support Node.js ${unsupportedVersion} as of January 1, 2022.\n` +
41+
`no longer support Node.js ${unsupportedVersion} on November 1, 2022.\n\n` +
4242
`To continue receiving updates to AWS services, bug fixes, and security\n` +
43-
`updates please upgrade to Node.js 12.x or later.\n\n` +
44-
`More information can be found at: https://a.co/1l6FLnu`,
43+
`updates please upgrade to Node.js 14.x or later.\n\n` +
44+
`For details, please refer our blog post: https://a.co/48dbdYz`,
4545
`NodeDeprecationWarning`
4646
);
4747

packages/smithy-client/src/emitWarningIfUnsupportedVersion.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ let warningEmitted = false;
77
* @param {string} version - The Node.js version string.
88
*/
99
export const emitWarningIfUnsupportedVersion = (version: string) => {
10-
if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 12) {
10+
if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 14) {
1111
warningEmitted = true;
1212
process.emitWarning(
1313
`The AWS SDK for JavaScript (v3) will\n` +
14-
`no longer support Node.js ${version} as of January 1, 2022.\n` +
14+
`no longer support Node.js ${version} on November 1, 2022.\n\n` +
1515
`To continue receiving updates to AWS services, bug fixes, and security\n` +
16-
`updates please upgrade to Node.js 12.x or later.\n\n` +
17-
`More information can be found at: https://a.co/1l6FLnu`,
16+
`updates please upgrade to Node.js 14.x or later.\n\n` +
17+
`For details, please refer our blog post: https://a.co/48dbdYz`,
1818
`NodeDeprecationWarning`
1919
);
2020
}

0 commit comments

Comments
 (0)