To run the codemod:
- Nodejs >= 16
- Install jscodeshift globally
$ npm install -g jscodeshift
- Clone this repo to your machine (in the same level as
logie-fe
if possible)
$ git clone git@github.com:alvin883/logie-codemod.git
- Go there, install the packages
$ cd ./logie-codemod
$ yarn install
- Install ripgrep if you didn't have it yet, ripgrep is needed to do file content search, for other installation please see here: https://github.com/BurntSushi/ripgrep#installation
# Fedora Linux
$ sudo dnf install ripgrep
# MacOS
$ brew install ripgrep
This step assume you cloned the repo in the same level as
logie-fe
- Go back to
logie-fe
repo
cd ../logie-fe
- Run
jscodeshift
$ jscodeshift --extensions=ts,tsx -t ../logie-codemod/transformer.ts --parser tsx src
To save log output into a file
$ jscodeshift --extensions=ts,tsx -t ../logie-codemod/transformer.ts --parser tsx src >> logs.txt
Everthing under src
is just a test case