Skip to content

Commit a4aca6e

Browse files
spawniaenisdenjo
andauthored
docs: contributing (#64)
Co-authored-by: Denis Badurina <[email protected]>
1 parent e750bc0 commit a4aca6e

File tree

3 files changed

+52
-10
lines changed

3 files changed

+52
-10
lines changed

CONTRIBUTING.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# How to contribute to graphql-http
2+
3+
## Contributors license agreement
4+
5+
This repository is managed by EasyCLA.
6+
Project participants must sign the free [GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution.
7+
You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/).
8+
9+
To initiate the signature process please open a PR against this repo.
10+
The EasyCLA bot will block the merge if we still need a membership agreement from you.
11+
You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership).
12+
If you have issues, please email [[email protected]](mailto:[email protected]).
13+
14+
## Adding implementations
15+
16+
[The implementations folder](implementations) contains setup for server implementations that allows checking their compliance with the [GraphQL over HTTP spec](https://graphql.github.io/graphql-over-http).
17+
18+
Every implementation is expected to contain a `package.json` file with at least the following fields:
19+
20+
```json
21+
{
22+
"private": true, // prevents warnings
23+
"name": "implementation-name", // should be equivalent to the directory name
24+
"url": "https://implementation-name.example", // the official project URL
25+
"scripts": {
26+
"start": "node ." | "docker-compose up -d" // depending if the server can be run through node or Docker
27+
}
28+
}
29+
```
30+
31+
Depending on how your server is run, add it to the appropriate section of [.github/workflows/audits.yml](.github/workflows/audits.yml):
32+
33+
- `node .`: `jobs.javascript.strategy.matrix.workspace`
34+
- `docker-compose up -d`: `jobs.docker.strategy.matrix.workspace`
35+
36+
The script run in `start` is expected to bring up an HTTP server that listens to the port defined in the environment variable `$PORT`.
37+
38+
After adding your directory and `package.json`, run `yarn install` to include the workspace.
39+
40+
## Code formatting
41+
42+
Run the following script to ensure the automatic code formatting is applied:
43+
44+
yarn run lint:fix

README.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,9 @@ Having said this, graphql-http is mostly aimed for library authors and simple se
774774

775775
## [Servers](/implementations)
776776

777-
If you want a feature-full server with bleeding edge technologies, you're recommended to use one of the following.
777+
If you want a feature-full server with bleeding edge technologies, you're recommended to use one of the following servers.
778+
779+
Their compliance with the [GraphQL over HTTP spec](https://graphql.github.io/graphql-over-http) is checked automatically and updated regularly.
778780

779781
<!-- <ServersTable> -->
780782
<!-- prettier-ignore-start -->
@@ -798,16 +800,11 @@ Check the [docs folder](docs/) out for [TypeDoc](https://typedoc.org) generated
798800

799801
## [Audits](implementations/)
800802

801-
Inspect audits of other implementations in the [implementations folder](implementations/). Adding your implementation is very welcome!
803+
Inspect audits of other implementations in the [implementations folder](implementations).
804+
Adding your implementation is very welcome, [see how](CONTRIBUTING.md#adding-implementations)!
802805

803806
## Want to help?
804807

805-
File a bug, contribute with code, or improve documentation? Read up on our guidelines below and drive development with `yarn test --watch` away!
806-
807-
This repository is managed by EasyCLA. Project participants must sign the free [GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution. You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/).
808-
809-
To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you.
810-
811-
You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). If you have issues, please email [[email protected]](mailto:[email protected]).
808+
File a bug, contribute with code, or improve documentation? [Read more in CONTRIBUTING.md](CONTRIBUTING.md).
812809

813810
If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the [GraphQL Foundation](https://foundation.graphql.org/join).

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
"scripts": {
8989
"gendocs": "typedoc --options typedoc.js src/",
9090
"lint:eslint": "eslint 'src'",
91-
"lint:prettier": "prettier -c .",
91+
"lint:prettier": "prettier --check .",
92+
"lint:fix": "yarn lint:eslint --fix && yarn lint:prettier --write",
9293
"lint": "yarn lint:eslint && yarn lint:prettier",
9394
"type-check": "tsc --noEmit",
9495
"test": "NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 jest",

0 commit comments

Comments
 (0)