|
1 |
| -# React documentation site |
2 |
| - |
3 |
| -To get setup: |
4 |
| -``` |
5 |
| -yarn install |
6 |
| -``` |
7 |
| - |
8 |
| -To run the dev server: |
9 |
| -``` |
10 |
| -yarn run dev |
11 |
| -``` |
12 |
| - |
13 |
| -To clear the local cache: |
14 |
| -``` |
15 |
| -yarn run reset |
16 |
| -``` |
| 1 | +# React — documentation site |
| 2 | + |
| 3 | +## Getting started |
| 4 | + |
| 5 | +### Prerequisites |
| 6 | + |
| 7 | +1. Git |
| 8 | +1. Node: install version 7.6 or greater |
| 9 | +1. Yarn: `npm i -g yarn` to install it globally via NPM |
| 10 | +1. A clone of the [React repo](https://github.com/facebook/react) on your local machine |
| 11 | +1. A fork of the repo (for any contributions) |
| 12 | + |
| 13 | +### Installation |
| 14 | + |
| 15 | +1. `cd react` to go into the project root |
| 16 | +1. `yarn` to install the main NPM dependencies |
| 17 | +1. `cd www` to go into the website project |
| 18 | +1. `yarn` to install the website's NPM dependencies |
| 19 | + |
| 20 | +### Running locally |
| 21 | + |
| 22 | +1. `yarn dev` to start the hot-reloading development server powered by Gatsby |
| 23 | +1. `open http://localhost:8000` to open the site in your favourite browser |
| 24 | + |
| 25 | +## Contributing |
| 26 | + |
| 27 | +### Create a branch |
| 28 | + |
| 29 | +1. `git checkout master` from any folder in your local react repository |
| 30 | +1. `git pull origin master` to ensure you have the latest main code |
| 31 | +1. `git checkout -b wwwTheNameOfMyChange` (replacing `TheNameOfMyChange` with a suitable name) to create a branch |
| 32 | + |
| 33 | +### Make the change |
| 34 | + |
| 35 | +1. Follow the "Running locally" instructions |
| 36 | +1. Save the files and check in the browser |
| 37 | + 1. Any React components in `src/components` or `src/templates` will hot-reload |
| 38 | + 1. If working with plugins, you may need to remove the `.cache` directory and restart the server |
| 39 | + |
| 40 | +### Test the change |
| 41 | + |
| 42 | +1. If possible, test any visual changes in all latest versions of common browsers, on both desktop and mobile. |
| 43 | +1. Run `yarn prettier-all && yarn lint` from the project root (outside of `www`) |
| 44 | + |
| 45 | +### Push it |
| 46 | + |
| 47 | +1. `git add -A && git commit -m "My message"` (replacing `My message` with a commit message, such as `Fixed header logo on Android`) to stage and commit your changes |
| 48 | +1. `git push yourname wwwTheNameOfMyChange` |
| 49 | +1. Go to the [React repo](https://github.com/facebook/react) and you should see recently pushed branches. |
| 50 | +1. ... follow GitHub's instructions... |
| 51 | +1. If possible, include any screenshots of visual changes. A Netlify build will also be automatically created once you make your PR, so other people can see your change. |
| 52 | + |
| 53 | +## Troubleshooting |
| 54 | + |
| 55 | +- `yarn reset` to clear the local cache |
0 commit comments