|
1 |
| -Contributing |
2 |
| -============ |
| 1 | +Contributing to graphql-js |
| 2 | +========================== |
3 | 3 |
|
4 |
| -After cloning this repo, ensure dependencies are installed by running: |
| 4 | +We want to make contributing to this project as easy and transparent as |
| 5 | +possible. Hopefully this document makes the process for contributing clear and |
| 6 | +answers any questions you may have. If not, feel free to open an |
| 7 | +[Issue](https://github.com/facebook/graphql/issues). |
5 | 8 |
|
6 |
| -```sh |
7 |
| -npm install |
8 |
| -``` |
| 9 | +## Getting Started |
9 | 10 |
|
10 |
| -GraphQL is written in ES6 using [Babel](http://babeljs.io/), widely consumable |
11 |
| -JavaScript can be produced by running: |
| 11 | +1. Fork this repo by using the "Fork" button in the upper-right |
12 | 12 |
|
13 |
| -```sh |
14 |
| -npm run build |
15 |
| -``` |
| 13 | +2. Check out your fork |
16 | 14 |
|
17 |
| -Once `npm run build` has run, you may `import` or `require()` directly from |
18 |
| -node. |
| 15 | + ```sh |
| 16 | + git clone [email protected]:yournamehere/graphql-js.git |
| 17 | + ``` |
19 | 18 |
|
20 |
| -The full test suite can be evaluated by running: |
| 19 | +3. Install all dependencies |
21 | 20 |
|
22 |
| -```sh |
23 |
| -npm test |
24 |
| -``` |
| 21 | + ```sh |
| 22 | + npm install |
| 23 | + ``` |
25 | 24 |
|
26 |
| -While actively developing, we recommend running |
| 25 | +4. Get coding! If you've added code, add tests. If you've changed APIs, update |
| 26 | + any relevant documentation or tests. |
27 | 27 |
|
28 |
| -```sh |
29 |
| -npm run watch |
30 |
| -``` |
| 28 | +5. Ensure all tests pass |
31 | 29 |
|
32 |
| -in a terminal. This will watch the file system run lint, tests, and type |
33 |
| -checking automatically whenever you save a js file. |
| 30 | + ```sh |
| 31 | + npm test |
| 32 | + ``` |
34 | 33 |
|
35 |
| -To lint the JS files and type interface checks run `npm run lint`. |
| 34 | +### Live Feedback |
| 35 | + |
| 36 | +While actively developing, we recommend running `npm run watch` in a terminal. |
| 37 | +This will watch the file system run any relevant lint, tests, and type checks automatically whenever you save a `.js` file. |
| 38 | + |
| 39 | +### Release on NPM |
| 40 | + |
| 41 | +*Only core contributors may release to NPM.* |
| 42 | + |
| 43 | +To release a new version on NPM, use `npm version patch|minor|major` in order |
| 44 | +to increment the version in package.json and tag and commit a release. Then |
| 45 | +`git push --tags` this change so Travis CI can deploy to NPM. *Do not run |
| 46 | +`npm publish` directly.* Once published, add |
| 47 | +[release notes](https://github.com/graphql/graphql-js/tags). Use [semver](http://semver.org/) to determine which version to increment. |
| 48 | + |
| 49 | +## Pull Requests |
| 50 | + |
| 51 | +All active development of graphql-js happens on GitHub. We actively welcome |
| 52 | +your [pull requests](https://help.github.com/articles/creating-a-pull-request). |
| 53 | + |
| 54 | +### Considered Changes |
| 55 | + |
| 56 | +Since graphql-js is a reference implementation of the |
| 57 | +[GraphQL spec](https://facebook.github.io/graphql/), only changes which comply |
| 58 | +with this spec will be considered. If you have a change in mind which requires a |
| 59 | +change to the spec, please first open an |
| 60 | +[issue](https://github.com/facebook/graphql/issues/) against the spec. |
| 61 | + |
| 62 | +### Contributor License Agreement ("CLA") |
| 63 | + |
| 64 | +In order to accept your pull request, we need you to submit a CLA. You only need |
| 65 | +to do this once to work on any of Facebook's open source projects. |
| 66 | + |
| 67 | +Complete your CLA here: <https://code.facebook.com/cla> |
| 68 | + |
| 69 | +## Issues |
| 70 | + |
| 71 | +We use GitHub issues to track public bugs and requests. Please ensure your bug |
| 72 | +description is clear and has sufficient instructions to be able to reproduce the |
| 73 | +issue. The best way is to provide a reduced test case on jsFiddle or jsBin. |
| 74 | + |
| 75 | +Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe |
| 76 | +disclosure of security bugs. In those cases, please go through the process |
| 77 | +outlined on that page and do not file a public issue. |
| 78 | + |
| 79 | +## Coding Style |
| 80 | + |
| 81 | +* 2 spaces for indentation (no tabs) |
| 82 | +* 80 character line length strongly preferred. |
| 83 | +* Prefer `'` over `"` |
| 84 | +* ES6 syntax when possible. |
| 85 | +* Use [Flow types](http://flowtype.org/). |
| 86 | +* Use semicolons; |
| 87 | +* Trailing commas, |
| 88 | +* Avd abbr wrds. |
| 89 | + |
| 90 | +## License |
| 91 | + |
| 92 | +By contributing to graphql-js, you agree that your contributions will be |
| 93 | +licensed under its BSD license. |
0 commit comments