aws / aws/aws-sdk-js-codemod

[Feature]: Transform deep import of DocumentClient

Open
#799 1 comment 0 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

### Problem

Transformation is not done for the following code:
```js
import { DocumentClient } from 'aws-sdk/lib/dynamodb/document_client';

const client = new DocumentClient();
```

### Solution

Transformed code
```js
import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';
import { DynamoDB } from '@aws-sdk/client-dynamodb';

const client = DynamoDBDocument.from(new DynamoDB());
```

### Alternatives

Skip the transformation, as deep import from `aws-sdk/lib/*` is not documented in public.
The official documented deep import is `aws-sdk/clients/*`

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

No file or test is named in the issue. Start by locating the import-transformation logic and its tests for aws-sdk/lib/* or DocumentClient, then reproduce the deep-import example. Done means the input produces the shown DynamoDBDocument and DynamoDB imports, while existing documented aws-sdk/clients/* behavior remains intact.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.