Skip to content

Commit 7233be1

Browse files
authored
Create contributing.md
1 parent 7176403 commit 7233be1

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/contributing.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Making your first PR
2+
==============================
3+
4+
### 1. **Fork**
5+
Click the fork button.
6+
7+
![image](https://user-images.githubusercontent.com/5455859/79698757-d5d0c180-823f-11ea-86e7-8edcd1b969be.png)
8+
9+
### 2. **Environment Setup**
10+
Clone your fork and set up your environment for development. I reccommend [iterm](https://www.iterm2.com/), but use whatever you'd like.
11+
12+
**In terminal window 1**
13+
```sh
14+
git clone [email protected]:YOUR_USERNAME/use-http.git
15+
cd ./use-http
16+
yarn
17+
yarn link
18+
```
19+
**In terminal window 2** (your react app to test `use-http` in)
20+
```sh
21+
create-react-app use-http-sandbox
22+
cd ./use-http-sandbox
23+
yarn
24+
yarn link use-http
25+
```
26+
**In terminal window 1** (inside your forked `use-http` directory)
27+
```sh
28+
npm link ../use-http-sandbox/node_modules/react
29+
npm link ../use-http-sandbox/node_modules/react-dom
30+
yarn build:watch
31+
```
32+
**In terminal window 2** (your react app to test `use-http` in)
33+
```sh
34+
yarn start
35+
```
36+
37+
### 3. **Develop**
38+
Now just go into your `use-http-sandbox/src/App.js` and import use-http and now you can develop. When you make changes in `use-http` it should cause `use-http-sandbox` to refresh `localhost:3000`.
39+
40+
### 4. **Test**
41+
Once you're done making your changes be sure to make some tests and run all of them. What I do is open up 3 different panes in the same iTerm2 window by pressing `⌘ + D` on mac 2 times. In the far left I do `yarn build:watch`, in the middle I do `yarn test:browser:watch` (where you'll probably be writing your tests) and in the 3rd window I do `yarn test:server:watch`. It looks like this.
42+
![image](https://user-images.githubusercontent.com/5455859/79790558-bf3e6f00-8300-11ea-89ad-241ce943f1b3.png)
43+
44+
### 4. **Push**
45+
Push your changes to your forked repo.
46+
47+
### 5. **Make PR**
48+
Once you push your changes, you will see a link in your terminal that looks like this.
49+
```sh
50+
remote: Create a pull request for 'master' on GitHub by visiting:
51+
remote: https://github.com/YOUR_USERNAME/use-http/pull/new/master
52+
```
53+
go to that url. From there you should be able to compare your forked master branch to `ava/use-http:master`.

0 commit comments

Comments
 (0)