Skip to content

Commit 2347833

Browse files
pshrmntimdorr
authored andcommitted
Update CONTRIBUTING.md (#6061)
1 parent ad53bc8 commit 2347833

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

CONTRIBUTING.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Please read https://reactjs.org/ and the Code of Conduct before opening an issue
88
- [Proposing New or Changed API?](#api)
99
- [Issue Not Getting Attention?](#attention)
1010
- [Making a Pull Request?](#pr)
11+
- [Setup](#setup)
1112
- [Development](#development)
1213
- [Hacking](#hacking)
1314

@@ -45,10 +46,48 @@ All commits that change or add to the API must be done in a pull request that al
4546
- Updates examples
4647
- Updates the docs
4748

49+
## Setup
50+
51+
The following steps will get you setup to contribute changes to this repo:
52+
53+
1. Fork the repo (click the <kbd>Fork</kbd> button at the top right of this page).
54+
2. Clone your fork locally.
55+
```bash
56+
# in a terminal, cd to parent directory where you want your clone to be, then
57+
git clone https://github.com/<your_github_username>/react-router.git
58+
cd react-router
59+
```
60+
3. Install dependencies and build. React Router uses `npm`, so you should too. If you install using `yarn`, unnecessary yarn lock files will be generated.
61+
```bash
62+
npm install
63+
npm run build
64+
```
65+
4866
## Development
4967

50-
- `npm test` starts a karma test runner and watch for changes
51-
- `npm start` starts a webpack dev server that will watch for changes and build the examples
68+
### Packages
69+
70+
React Router uses a monorepo to host code for multiple packages. These packages live in the `packages` directory.
71+
72+
### Testing
73+
74+
Calling `npm test` from the root directory will run **every** package's tests. If you want to run tests for a specific package, you should `cd` into that directory.
75+
```bash
76+
# all tests
77+
npm test
78+
# react-router-dom tests
79+
cd packages/react-router-dom
80+
npm test
81+
```
82+
React Router uses Jest to run its tests, so you can provide the `--watch` flag to automatically re-run tests when files change.
83+
84+
### Website
85+
86+
The code for the documentation website lives in the `website` directory. `cd` into there and call `npm start` to start a webpack dev server on `localhost:8080` that will watch for changes.
87+
```bash
88+
cd website
89+
npm start
90+
```
5291

5392
## Hacking
5493

0 commit comments

Comments
 (0)