-
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.
Use package name as suffix in import equals default declaration (#620)
- Loading branch information
Showing
30 changed files
with
103 additions
and
109 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 | ||
--- | ||
|
||
Use package name as suffix in import equals default declaration |
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
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import-equals.output.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,4 +1,4 @@ | ||
import AWS_S3 = require("@aws-sdk/client-s3"); | ||
import Tag = AWS_S3.Tag; | ||
import AWS_client_s3 = require("@aws-sdk/client-s3"); | ||
import Tag = AWS_client_s3.Tag; | ||
|
||
const testTags: Tag[] = [{ Key: "key", Value: "value" }]; |
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/api-basic-type/service-import-equals.output.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,4 +1,4 @@ | ||
import AWS_S3 = require("@aws-sdk/client-s3"); | ||
import Tag = AWS_S3.Tag; | ||
import AWS_client_s3 = require("@aws-sdk/client-s3"); | ||
import Tag = AWS_client_s3.Tag; | ||
|
||
const testTags: Tag[] = [{ Key: "key", Value: "value" }]; |
24 changes: 12 additions & 12 deletions
24
src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.output.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
24 changes: 12 additions & 12 deletions
24
src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.output.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
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/api-promise/global-import-equals.output.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,5 +1,5 @@ | ||
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDB = AWS_DynamoDB.DynamoDB; | ||
import AWS_client_dynamodb = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDB = AWS_client_dynamodb.DynamoDB; | ||
|
||
const client = new DynamoDB(); | ||
const data = await client.listTables(); |
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/api-promise/service-import-equals.output.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,5 +1,5 @@ | ||
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDB = AWS_DynamoDB.DynamoDB; | ||
import AWS_client_dynamodb = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDB = AWS_client_dynamodb.DynamoDB; | ||
|
||
const client = new DynamoDB(); | ||
const data = await client.listTables(); |
14 changes: 7 additions & 7 deletions
14
src/transforms/v2-to-v3/__fixtures__/api-redundant-type/global-import-equals.output.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
14 changes: 7 additions & 7 deletions
14
src/transforms/v2-to-v3/__fixtures__/api-redundant-type/service-import-equals.output.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
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
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
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/ddb-doc-client/global-import-equals.output.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,7 +1,7 @@ | ||
import AWS_lib_dynamodb = require("@aws-sdk/lib-dynamodb"); | ||
import DynamoDBDocument = AWS_lib_dynamodb.DynamoDBDocument; | ||
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDB = AWS_DynamoDB.DynamoDB; | ||
import AWS_client_dynamodb = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDB = AWS_client_dynamodb.DynamoDB; | ||
|
||
const documentClient = DynamoDBDocument.from(new DynamoDB({ region: "us-west-2" })); | ||
const response = await documentClient.scan({ TableName: "TABLE_NAME" }); |
4 changes: 2 additions & 2 deletions
4
...transforms/v2-to-v3/__fixtures__/ddb-doc-client/service-import-equals-with-name.output.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,7 +1,7 @@ | ||
import AWS_lib_dynamodb = require("@aws-sdk/lib-dynamodb"); | ||
import DynamoDBDocument = AWS_lib_dynamodb.DynamoDBDocument; | ||
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDBClient = AWS_DynamoDB.DynamoDB; | ||
import AWS_client_dynamodb = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDBClient = AWS_client_dynamodb.DynamoDB; | ||
|
||
const documentClient = DynamoDBDocument.from(new DynamoDBClient({ region: "us-west-2" })); | ||
const response = await documentClient.scan({ TableName: "TABLE_NAME" }); |
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/ddb-doc-client/service-import-equals.output.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,7 +1,7 @@ | ||
import AWS_lib_dynamodb = require("@aws-sdk/lib-dynamodb"); | ||
import DynamoDBDocument = AWS_lib_dynamodb.DynamoDBDocument; | ||
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDB = AWS_DynamoDB.DynamoDB; | ||
import AWS_client_dynamodb = require("@aws-sdk/client-dynamodb"); | ||
import DynamoDB = AWS_client_dynamodb.DynamoDB; | ||
|
||
const documentClient = DynamoDBDocument.from(new DynamoDB({ region: "us-west-2" })); | ||
const response = await documentClient.scan({ TableName: "TABLE_NAME" }); |
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
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
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
6 changes: 3 additions & 3 deletions
6
src/transforms/v2-to-v3/__fixtures__/s3-get-signed-url/getObject.import-equals.output.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
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import-equals.output.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
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-equals.output.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
6 changes: 3 additions & 3 deletions
6
src/transforms/v2-to-v3/__fixtures__/waiters/global-import-equals.output.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
6 changes: 3 additions & 3 deletions
6
src/transforms/v2-to-v3/__fixtures__/waiters/service-import-equals.output.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
7 changes: 0 additions & 7 deletions
7
src/transforms/v2-to-v3/modules/getImportEqualsLocalNameSuffix.ts
This file was deleted.
Oops, something went wrong.
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
8 changes: 3 additions & 5 deletions
8
src/transforms/v2-to-v3/modules/importEqualsModule/addClientNamedModule.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
2 changes: 2 additions & 0 deletions
2
src/transforms/v2-to-v3/modules/importEqualsModule/getImportEqualsDefaultName.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const getImportEqualsDefaultName = (packageName: string) => | ||
["AWS", ...packageName.split("/").pop()!.split("-")].join("_"); |
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
This file was deleted.
Oops, something went wrong.
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,4 +1,3 @@ | ||
export * from "./getClientDeepImportPath"; | ||
export * from "./getClientNewExpression"; | ||
export * from "./getDefaultLocalName"; | ||
export * from "./isTypeScriptFile"; |