Skip to content
This repository was archived by the owner on Sep 21, 2019. It is now read-only.

Commit 5af6c5b

Browse files
authored
Update Readme with docs on setting up and running locally (#6)
1 parent 5c90e18 commit 5af6c5b

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

README.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
Transforms React code written in JavaScript to TypeScript.
66

7-
[**🖥 Download the VSCode Extension**](https://marketplace.visualstudio.com/items?itemName=mohsen1.react-javascript-to-typescript-transform-vscode)
8-
97
## Features:
108

119
- Proxies `PropTypes` to `React.Component` generic type and removes PropTypes
@@ -74,21 +72,29 @@ class MyComponent extends React.Component<MyComponentProps, MyComponentState> {
7472

7573
## Usage
7674

77-
### CLI
75+
### Install and configure
7876

79-
```
80-
npm install -g react-js-to-ts
81-
```
77+
This repo currently needs to be cloned and built directly[\*](#original-project)
78+
79+
1. [Install yarn](https://yarnpkg.com/en/docs/install#mac-stable): `brew install yarn`
80+
2. `git clone git@github.com:CrisisTextLine/react-javascript-to-typescript-transform.git`
81+
3. Install dependencies: `yarn install`
82+
4. Build the package `yarn build`
83+
5. Set up an alias by adding this to your .bash_profile (or equivalent for a different shell)
84+
```sh
85+
react-js-to-ts="node <PATH_TO_CLONED_REPO>/dist/cli.js"
86+
```
87+
For `.bash_profile` you should be able to use do this with the following command:
88+
```sh
89+
echo "\nalias react-js-to-ts=\"node `pwd`/dist/cli.js\"" >> $HOME/.bash_profile
90+
```
91+
92+
### CLI
8293

8394
```
8495
react-js-to-ts my-react-js-file.js
8596
```
8697
87-
### VSCode plugin
88-
89-
details
90-
[Download from VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=mohsen1.react-javascript-to-typescript-transform-vscode#overview)
91-
9298
## Development
9399
94100
### Tests
@@ -114,3 +120,9 @@ Pass `-t` with transform name and case name space separated to `npm test`
114120
```
115121
npm test -- -t "react-js-make-props-and-state-transform propless-stateless"
116122
```
123+
124+
### Original Project
125+
126+
NOTE: The original version of this project had a package installable from npm (`npm install -g react-js-to-ts`). This could then be used like `react-js-to-ts my-react-js-file.js`. Additionally it had a nifty [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=mohsen1.react-javascript-to-typescript-transform-vscode#overview).
127+
128+
Since the original maintainers archived the original fork, we had to fork it to make updates. If we end up making a bunch of valuable updates, maybe we should publish our version somewhere.

0 commit comments

Comments
 (0)