Skip to content

Commit

Permalink
Support TypeScript in codemods (#601)
Browse files Browse the repository at this point in the history
The codemod would previously only work with JavaScript files. This change allows us to support both with a single command.
  • Loading branch information
danoc authored Dec 18, 2019
1 parent fe2947e commit cff2e82
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
8 changes: 8 additions & 0 deletions packages/thumbprint-codemods/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

### Added

- [Minor] Support TypeScript (`.ts`, `.tsx`) files.

### Changed

- [Patch] Upgrade jscodeshift from `0.6.4` to `0.7.0`.

## 0.4.0 - 2019-12-05

### Added
Expand Down
4 changes: 3 additions & 1 deletion packages/thumbprint-codemods/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ if (!cli.flags.codemod || !codemods[cli.flags.codemod]) {
const commandArgs = [
'jscodeshift',
...cli.input,
'--parser',
'tsx',
'--extensions',
'js,jsx',
'js,jsx,ts,tsx',
'-t',
codemods[cli.flags.codemod],
];
Expand Down
2 changes: 1 addition & 1 deletion packages/thumbprint-codemods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"execa": "^2.0.4",
"globby": "^10.0.1",
"jscodeshift": "^0.6.4",
"jscodeshift": "^0.7.0",
"lodash": "^4.17.11",
"meow": "^5.0.0"
}
Expand Down
32 changes: 16 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3452,10 +3452,10 @@ ast-types@0.11.5:
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.5.tgz#9890825d660c03c28339f315e9fa0a360e31ec28"
integrity sha512-oJjo+5e7/vEc2FBK8gUalV0pba4L3VdBIs2EKhOLHLcOd2FgQIVQN9xb0eZ9IjEWyAL7vq6fGJxOvVvdCHNyMw==

ast-types@0.11.7:
version "0.11.7"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.7.tgz#f318bf44e339db6a320be0009ded64ec1471f46c"
integrity sha512-2mP3TwtkY/aTv5X3ZsMpNAbOnyoC/aMJwJSoaELPkHId0nSQgFcnU4dRW3isxiz7+zBexk0ym3WNVjMiQBnJSw==
ast-types@0.13.2:
version "0.13.2"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.2.tgz#df39b677a911a83f3a049644fb74fdded23cea48"
integrity sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA==

ast-types@^0.12.4:
version "0.12.4"
Expand Down Expand Up @@ -11125,10 +11125,10 @@ jsbn@~0.1.0:
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=

jscodeshift@^0.6.4:
version "0.6.4"
resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.6.4.tgz#e19ab86214edac86a75c4557fc88b3937d558a8e"
integrity sha512-+NF/tlNbc2WEhXUuc4WEJLsJumF84tnaMUZW2hyJw3jThKKRvsPX4sPJVgO1lPE28z0gNL+gwniLG9d8mYvQCQ==
jscodeshift@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.7.0.tgz#4eee7506fd4fdacbd80340287d61575af991fdab"
integrity sha512-Kt6rpTa1HVhAWagD6J0y6qxxqRmDgkFvczerLgOsDNSGoUZSmq2CO1vFRcda9OV1BaZKSHCIh+VREPts5tB/Ig==
dependencies:
"@babel/core" "^7.1.6"
"@babel/parser" "^7.1.6"
Expand All @@ -11145,7 +11145,7 @@ jscodeshift@^0.6.4:
micromatch "^3.1.10"
neo-async "^2.5.0"
node-dir "^0.1.17"
recast "^0.16.1"
recast "^0.18.1"
temp "^0.8.1"
write-file-atomic "^2.3.0"

Expand Down Expand Up @@ -14758,7 +14758,7 @@ prism-react-renderer@0.1.7, prism-react-renderer@^0.1.0:
resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-0.1.7.tgz#dc273d0cb6e4a498ba0775094e9a8b01a3ad2eaa"
integrity sha512-EhnM0sYfLK103ASK0ViSv0rta//ZGB0dBA9TiFyOvA+zOj5peLmGEG01sLEDwl9sMe+gSqncInafBe1VFTCMvA==

private@^0.1.6, private@~0.1.5:
private@^0.1.6, private@^0.1.8:
version "0.1.8"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"

Expand Down Expand Up @@ -15766,14 +15766,14 @@ realpath-native@^1.1.0:
dependencies:
util.promisify "^1.0.0"

recast@^0.16.1:
version "0.16.2"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.16.2.tgz#3796ebad5fe49ed85473b479cd6df554ad725dc2"
integrity sha512-O/7qXi51DPjRVdbrpNzoBQH5dnAPQNbfoOFyRiUwreTMJfIHYOEBzwuH+c0+/BTSJ3CQyKs6ILSWXhESH6Op3A==
recast@^0.18.1:
version "0.18.5"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.18.5.tgz#9d5adbc07983a3c8145f3034812374a493e0fe4d"
integrity sha512-sD1WJrpLQAkXGyQZyGzTM75WJvyAd98II5CHdK3IYbt/cZlU0UzCRVU11nUFNXX9fBVEt4E9ajkMjBlUlG+Oog==
dependencies:
ast-types "0.11.7"
ast-types "0.13.2"
esprima "~4.0.0"
private "~0.1.5"
private "^0.1.8"
source-map "~0.6.1"

recursive-readdir@2.2.1:
Expand Down

0 comments on commit cff2e82

Please sign in to comment.