aws / aws/aws-sdk-js-codemod

[Feature]: Codemod does not transform tsx files in project tagspaces

Open
#692 0 comments 0 reactions 0 assignees View on GitHub
enhancement p2
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

Codemod does not transform tsx files in project tagspaces

```console
$ npx aws-sdk-js-codemod@0.26.1 -t v2-to-v3 app/containers/MainPage.tsx
...
ERR app/containers/MainPage.tsx Transformation error (Unexpected token, expected "," (213:10))
SyntaxError: Unexpected token, expected "," (213:10)
at constructor (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:356:19)
at TypeScriptParserMixin.raise (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:3223:19)
at TypeScriptParserMixin.unexpected (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:3253:16)
at TypeScriptParserMixin.expect (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:3590:28)
at TypeScriptParserMixin.tsParseDelimitedListWorker (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:7819:14)
at TypeScriptParserMixin.tsParseDelimitedList (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:7796:25)
at TypeScriptParserMixin.tsParseBracketedList (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:7836:25)
at TypeScriptParserMixin.tsParseTypeParameters (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:7930:24)
at /local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:9654:29
at TypeScriptParserMixin.tryParse (/local/home/trivikr/.npm/_npx/7c563efbb7515419/node_modules/@babel/parser/lib/index.js:3597:20)
```

From the error, it appears that the issue is with parser, and not source code.

### Solution

Add ability to transform TSX files in codemod

### Alternatives

N/A

### Additional context

https://github.com/tagspaces/tagspaces/blob/c4a6f1694c6ef9b50c70f7231f3dbbf28e3d18eb/app/containers/MainPage.tsx#L27

Contributor guide

Open the contributing guide

Research direction

Reproduce the npx aws-sdk-js-codemod@0.26.1 command against tagspaces' app/containers/MainPage.tsx, then inspect the codemod's parser configuration and transformation entry points. Done means TSX input parses and transforms without the reported error; add coverage if the repository's existing test structure identifies a suitable location.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.