|
| 1 | +# Contributing |
| 2 | +We are open to, and grateful for, any contributions made by the community. By contributing to Redux, you agree to abide by the [code of conduct](https://github.com/rackt/redux/blob/master/CODE_OF_CONDUCT.md). |
| 3 | + |
| 4 | +## Reporting Issues and Asking Questions |
| 5 | +Before opening an issue, please search the [issue tracker](https://github.com/rackt/redux/issues) to make sure your issue hasn't already been reported. |
| 6 | + |
| 7 | +Please ask any general and implementation specific questions on [Stack Overflow with a Redux tag](http://stackoverflow.com/questions/tagged/redux?sort=votes&pageSize=50) for support. |
| 8 | + |
| 9 | +## Development |
| 10 | + |
| 11 | +Visit the [Issue tracker](https://github.com/rackt/redux/issues) to find a list of open issues that need attention. |
| 12 | + |
| 13 | +Fork, then clone the repo: |
| 14 | +``` |
| 15 | +git clone https://github.com/your-username/redux.git |
| 16 | +``` |
| 17 | + |
| 18 | +### Building |
| 19 | + |
| 20 | +#### Build Redux |
| 21 | + |
| 22 | +Running the `build` task will create both a CommonJS module-per-module build and a UMD build. |
| 23 | +``` |
| 24 | +npm run build |
| 25 | +``` |
| 26 | + |
| 27 | +To create just a CommonJS module-per-module build: |
| 28 | +``` |
| 29 | +npm run build:lib |
| 30 | +``` |
| 31 | + |
| 32 | +To create just a UMD build: |
| 33 | +``` |
| 34 | +npm run build:umd |
| 35 | +npm run build:umd:min |
| 36 | +``` |
| 37 | + |
| 38 | +### Testing and Linting |
| 39 | +To run both linting and testing at once, run the following: |
| 40 | +``` |
| 41 | +npm run check |
| 42 | +``` |
| 43 | + |
| 44 | +To only run tests: |
| 45 | +``` |
| 46 | +npm run test |
| 47 | +``` |
| 48 | + |
| 49 | +To continuously watch and run tests, run the following: |
| 50 | +``` |
| 51 | +npm run test:watch |
| 52 | +``` |
| 53 | + |
| 54 | +To perform linting with `eslint`, run the following: |
| 55 | +``` |
| 56 | +npm run lint |
| 57 | +``` |
| 58 | + |
| 59 | +### Docs |
| 60 | + |
| 61 | +Improvements to the documentation are always welcome. In the docs we abide by typographic rules, so |
| 62 | +instead of ' you should use ’, same for “ ” and dashes (—) where appropriate. These rules only apply to the text, not to code blocks. |
| 63 | + |
| 64 | +#### Preparing to build the documentation |
| 65 | +To install the latest version of `gitbook` and prepare to build the documentation, run the following: |
| 66 | +``` |
| 67 | +npm run docs:prepare |
| 68 | +``` |
| 69 | +#### Building the documentation |
| 70 | +To build the documentation, run the following: |
| 71 | +``` |
| 72 | +npm run docs:build |
| 73 | +``` |
| 74 | + |
| 75 | +To watch and re-build documentation when changes occur, run the following: |
| 76 | +``` |
| 77 | +npm run docs:watch |
| 78 | +``` |
| 79 | + |
| 80 | +#### Publishing the documentation |
| 81 | +To publish the documentation, run the following: |
| 82 | +``` |
| 83 | +npm run docs:publish |
| 84 | +``` |
| 85 | + |
| 86 | +#### Cleaning up built documentation |
| 87 | +To remove previously built documentation, run the following: |
| 88 | +``` |
| 89 | +npm run docs:clean |
| 90 | +``` |
| 91 | + |
| 92 | +### Examples |
| 93 | +Redux comes with [official examples](http://rackt.github.io/redux/docs/introduction/Examples.html) to demonstrate various concepts and best practices. |
| 94 | + |
| 95 | +When adding a new example, please adhere to the style and format of the existing examples, and try to reuse as much code as possible. For example, `index.html`, `server.js`, and `webpack.config.js` can typically be reused. |
| 96 | + |
| 97 | +>For ease of development, the webpack configs for the examples are set up so that the `redux` module is aliased to the project `src` folder when inside of the Redux folder. If an example is moved out of the Redux folder, they will instead use the version of Redux from `node_modules`. |
| 98 | +
|
| 99 | +#### Building and testing the examples |
| 100 | +To build and test the official Redux examples, run the following: |
| 101 | +``` |
| 102 | +npm run build:examples |
| 103 | +npm run test:examples |
| 104 | +``` |
| 105 | + |
| 106 | +Please visit the [Examples page](http://rackt.github.io/redux/docs/introduction/Examples.html) for information on running an individual example. |
| 107 | + |
| 108 | +###New Features |
| 109 | +Please open an issue with a proposal for a new feature or refactoring before starting on the work. We don't want you to waste your efforts on a pull request that we won't want to accept. |
| 110 | + |
| 111 | +###Style |
| 112 | +[rackt](https://github.com/rackt) is trying to keep a standard style across its various projects, which can be found over in [eslint-config-rackt](https://github.com/rackt/eslint-config-rackt). If you have a style change proposal, it should first be proposed there. If accepted, we will be happy to accept a PR to implement it here. |
| 113 | + |
| 114 | +## Submitting Changes |
| 115 | +* Open a new issue in the [Issue tracker](https://github.com/rackt/redux/issues). |
| 116 | +* Fork the repo. |
| 117 | +* Create a new feature branch based off the `master` branch. |
| 118 | +* Make sure all tests pass and there are no linting errors. |
| 119 | +* Submit a pull request, referencing any issues it addresses. |
| 120 | + |
| 121 | +Please try to keep your pull request focused in scope and avoid including unrelated commits. |
| 122 | + |
| 123 | +After you have submitted your pull request, we'll try to get back to you as soon as possible. We may suggest some changes or improvements. |
| 124 | + |
| 125 | +Thank you for contributing! |
0 commit comments