Skip to content

Commit

Permalink
Update CONTRIBUTING.md (#6061)
Browse files Browse the repository at this point in the history
  • Loading branch information
pshrmn authored and timdorr committed Apr 3, 2018
1 parent ad53bc8 commit 2347833
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Please read https://reactjs.org/ and the Code of Conduct before opening an issue
- [Proposing New or Changed API?](#api)
- [Issue Not Getting Attention?](#attention)
- [Making a Pull Request?](#pr)
- [Setup](#setup)
- [Development](#development)
- [Hacking](#hacking)

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

## Setup

The following steps will get you setup to contribute changes to this repo:

1. Fork the repo (click the <kbd>Fork</kbd> button at the top right of this page).
2. Clone your fork locally.
```bash
# in a terminal, cd to parent directory where you want your clone to be, then
git clone https://github.com/<your_github_username>/react-router.git
cd react-router
```
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.
```bash
npm install
npm run build
```

## Development

- `npm test` starts a karma test runner and watch for changes
- `npm start` starts a webpack dev server that will watch for changes and build the examples
### Packages

React Router uses a monorepo to host code for multiple packages. These packages live in the `packages` directory.

### Testing

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.
```bash
# all tests
npm test
# react-router-dom tests
cd packages/react-router-dom
npm test
```
React Router uses Jest to run its tests, so you can provide the `--watch` flag to automatically re-run tests when files change.

### Website

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.
```bash
cd website
npm start
```

## Hacking

Expand Down

0 comments on commit 2347833

Please sign in to comment.