aws / aws/aws-sdk-js-codemod

[Feature]: The v2-to-v3 transform should convert to v3 style of making API calls

Open
#497 6 comments 4 reactions 0 assignees View on GitHub
enhancement p3
Dominant language
TypeScript
Stars
89
Forks
13
Avg merge
9h 59m
Merged PRs (30d)
1

Description

### Self-service

- [ ] I'd be willing to implement this feature

### Template name

v2-to-v3

### Input code

```js
import AWS from "aws-sdk";

const region = "us-west-2";
const client = new AWS.DynamoDB({ region });
const response = await client.listTables().promise();
```

### Expected Output

Existing output

```js
import { DynamoDB } from "@aws-sdk/client-dynamodb";

const region = "us-west-2";
const client = new DynamoDB({ region });
const response = await client.listTables();
```

Recommended output

```js
import { DynamoDB, ListTablesCommand } from "@aws-sdk/client-dynamodb";

const region = "us-west-2";
const client = new DynamoDB({ region });
const response = await client.send(new ListTablesCommand({}));
```

### Additional context

Reference blog post: https://www.10printiamcool.com/updating-to-nodejs-18-and-aws-javascript-sdk-v3-part-1

Contributor guide

Open the contributing guide

Research direction

Start with the v2-to-v3 transform entry point and its existing fixtures or tests, then trace how the input API call is converted to v3 code. Update the transformation so the expected output imports the operation command and sends a new command instance; add or adjust coverage for the provided DynamoDB listTables example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.