Skip to content

Commit 84c96da

Browse files
committed
rewrite CONTRIBUTING.md, tighten how npm deploy works
1 parent 37e0de9 commit 84c96da

File tree

2 files changed

+84
-25
lines changed

2 files changed

+84
-25
lines changed

CONTRIBUTING.md

Lines changed: 82 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,93 @@
1-
Contributing
2-
============
1+
Contributing to graphql-js
2+
==========================
33

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).
58

6-
```sh
7-
npm install
8-
```
9+
## Getting Started
910

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
1212

13-
```sh
14-
npm run build
15-
```
13+
2. Check out your fork
1614

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+
```
1918

20-
The full test suite can be evaluated by running:
19+
3. Install all dependencies
2120

22-
```sh
23-
npm test
24-
```
21+
```sh
22+
npm install
23+
```
2524

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.
2727

28-
```sh
29-
npm run watch
30-
```
28+
5. Ensure all tests pass
3129

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+
```
3433

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.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"watch": "babel scripts/watch.js | node",
3434
"cover": "babel-node node_modules/.bin/isparta cover --root src --report html node_modules/.bin/_mocha -- $npm_package_options_mocha",
3535
"coveralls": "babel-node node_modules/.bin/isparta cover --root src --report lcovonly node_modules/.bin/_mocha -- $npm_package_options_mocha && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
36-
"prepublish": "babel src --ignore __tests__ --out-dir ./"
36+
"preversion": "npm test",
37+
"prepublish": "if [ '$CI' = true ]; then babel src --ignore __tests__ --out-dir ./; else echo 'Only CI can publish. Read CONTRIBUTING.md' 1>&2; exit 1; fi;"
3738
},
3839
"dependencies": {
3940
"babel-runtime": "5.8.3"

0 commit comments

Comments
 (0)