-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support named imports from "aws-sdk" (#245)
- Loading branch information
Showing
26 changed files
with
3,653 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"aws-sdk-js-codemod": patch | ||
--- | ||
|
||
Support named imports from "aws-sdk" |
14 changes: 2 additions & 12 deletions
14
scripts/generateNewClientTests/getServiceImportDeepOutput.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/utils/config"; | ||
import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; | ||
import { getV3PackageImportsCode } from "./getV3PackageImportsCode"; | ||
import { getServiceImportOutput } from "./getServiceImportOutput"; | ||
|
||
export const getServiceImportDeepOutput = (codegenComment: string) => { | ||
let serviceImportOutputContent = `${codegenComment}\n`; | ||
|
||
serviceImportOutputContent += getV3PackageImportsCode(CLIENT_NAMES); | ||
serviceImportOutputContent += `\n`; | ||
serviceImportOutputContent += getV3ClientsNewExpressionCode(); | ||
|
||
return serviceImportOutputContent; | ||
}; | ||
export const getServiceImportDeepOutput = getServiceImportOutput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/utils/config"; | ||
import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; | ||
|
||
export const getServiceImportInput = (codegenComment: string) => { | ||
let serviceImportInputContent = `${codegenComment}\n`; | ||
|
||
for (const clientName of CLIENT_NAMES) { | ||
serviceImportInputContent += `import { ${clientName} } from "aws-sdk";\n`; | ||
} | ||
serviceImportInputContent += `\n`; | ||
serviceImportInputContent += getV2ClientsNewExpressionCode(); | ||
|
||
return serviceImportInputContent; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/utils/config"; | ||
import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; | ||
import { getV3PackageImportsCode } from "./getV3PackageImportsCode"; | ||
|
||
export const getServiceImportOutput = (codegenComment: string) => { | ||
let serviceImportOutputContent = `${codegenComment}\n`; | ||
|
||
serviceImportOutputContent += getV3PackageImportsCode(CLIENT_NAMES); | ||
serviceImportOutputContent += `\n`; | ||
serviceImportOutputContent += getV3ClientsNewExpressionCode(); | ||
|
||
return serviceImportOutputContent; | ||
}; |
14 changes: 2 additions & 12 deletions
14
scripts/generateNewClientTests/getServiceRequireDeepOutput.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/utils/config"; | ||
import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; | ||
import { getV3PackageRequireCode } from "./getV3PackageRequireCode"; | ||
import { getServiceRequireOutput } from "./getServiceRequireOutput"; | ||
|
||
export const getServiceRequireDeepOutput = (codegenComment: string) => { | ||
let serviceRequireOutputContent = `${codegenComment}\n`; | ||
|
||
serviceRequireOutputContent += getV3PackageRequireCode(CLIENT_NAMES); | ||
serviceRequireOutputContent += `\n`; | ||
serviceRequireOutputContent += getV3ClientsNewExpressionCode(); | ||
|
||
return serviceRequireOutputContent; | ||
}; | ||
export const getServiceRequireDeepOutput = getServiceRequireOutput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/utils/config"; | ||
import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; | ||
|
||
export const getServiceRequireInput = (codegenComment: string) => { | ||
let serviceRequireInputContent = `${codegenComment}\n`; | ||
|
||
for (const clientName of CLIENT_NAMES) { | ||
serviceRequireInputContent += `const { ${clientName} } = require("aws-sdk");\n`; | ||
} | ||
serviceRequireInputContent += `\n`; | ||
serviceRequireInputContent += getV2ClientsNewExpressionCode(); | ||
|
||
return serviceRequireInputContent; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/utils/config"; | ||
import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; | ||
import { getV3PackageRequireCode } from "./getV3PackageRequireCode"; | ||
|
||
export const getServiceRequireOutput = (codegenComment: string) => { | ||
let serviceRequireOutputContent = `${codegenComment}\n`; | ||
|
||
serviceRequireOutputContent += getV3PackageRequireCode(CLIENT_NAMES); | ||
serviceRequireOutputContent += `\n`; | ||
serviceRequireOutputContent += getV3ClientsNewExpressionCode(); | ||
|
||
return serviceRequireOutputContent; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.