Skip to content

Commit d5ef67e

Browse files
authored
Added prettier-check to CI/CD + run prettier (#1397)
1 parent 4221cab commit d5ef67e

File tree

251 files changed

+2221
-2319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+2221
-2319
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ labels: bug
1414

1515
<!-- Steps for how we can replicate your experience (numbered lists are best) -->
1616

17-
### Expected Result
17+
### Expected Result
1818

1919
<!-- What did you expect to happen? -->
2020

21-
### Actual Result
21+
### Actual Result
2222

2323
<!-- What actually happened? -->
2424

2525
### Additional Context
2626

27-
<!--
27+
<!--
2828
Anything else that will help us better understand, for example:
2929
* Information about your local environment
3030
* Screenshots
3131
* Code snippets
32-
-->
32+
-->

.github/ISSUE_TEMPLATE/code-changes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ labels: enhancement
2020

2121
### Additional Context
2222

23-
<!-- Anything else that will help us understand your vision -->
23+
<!-- Anything else that will help us understand your vision -->

.github/PULL_REQUEST_TEMPLATE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<!--
2-
Thanks for making a pull request!
3-
2+
Thanks for making a pull request!
3+
44
Before submitting, please read our contributing guidelines:
55
https://github.com/graphql/graphql.github.io/blob/source/CONTRIBUTING.md
66
7-
Have any questions?
7+
Have any questions?
88
Feel free to ask in this PR or you can also find us on the #website channel on the GraphQL Slack (invite link available in CONTRIBUTING.md)
99
-->
1010

1111
Closes #<issue number>
1212

1313
## Description
1414

15-
<!-- Write a brief description of the changes introduced by this PR -->
15+
<!-- Write a brief description of the changes introduced by this PR -->

.github/workflows/prettier.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Prettier Check
2+
3+
on: pull_request
4+
5+
jobs:
6+
prettier-check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Install Dependencies
11+
run: yarn
12+
- name: Run Prettier Check
13+
run: yarn format:check

CONTRIBUTING.md

+32-30
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22

33
> This repository is governed by the [GraphQL Code of Conduct](https://graphql.org/codeofconduct/). By contributing, you agree to abide by its terms.
44
5-
Thanks for taking the time to contribute! The GraphQL community is great because of people like you 🎉
5+
Thanks for taking the time to contribute! The GraphQL community is great because of people like you 🎉
66

77
There are many ways to get involved. Follow this guide and feel free to [reach out if you have questions](#asking-questions).
88

99
## What's in this document
1010

1111
- [Development guide](#development-guide)
12-
- [Running the site locally](#running-the-site-locally)
13-
- [Branching](#branching)
14-
- [Project structure](#project-structure)
15-
- [Publishing the updated site](#publishing-the-updated-site)
12+
- [Running the site locally](#running-the-site-locally)
13+
- [Branching](#branching)
14+
- [Project structure](#project-structure)
15+
- [Publishing the updated site](#publishing-the-updated-site)
1616
- [Updating content](#updating-content)
17-
- [Fix a typo, code sample bug, or formatting](#fix-a-typo-code-sample-bug-or-formatting)
18-
- [Add a library or tool to the Code page](#add-a-library-or-tool-to-the-code-page)
19-
- [Add a resource to the Community page](#add-a-resource-to-the-community-page)
20-
- [Add a question to the FAQ](#add-a-question-to-the-faq)
21-
- [Write a new section or guide](#write-a-new-section-or-guide)
17+
- [Fix a typo, code sample bug, or formatting](#fix-a-typo-code-sample-bug-or-formatting)
18+
- [Add a library or tool to the Code page](#add-a-library-or-tool-to-the-code-page)
19+
- [Add a resource to the Community page](#add-a-resource-to-the-community-page)
20+
- [Add a question to the FAQ](#add-a-question-to-the-faq)
21+
- [Write a new section or guide](#write-a-new-section-or-guide)
2222
- [Making changes to the code](#making-changes-to-the-code)
23-
- [Browser support](#browser-support)
23+
- [Browser support](#browser-support)
2424
- [Contributing something else](#contributing-something-else)
2525
- [Asking questions](#asking-questions)
2626

2727
## Development guide
2828

2929
### Running the site locally
3030

31-
First, clone this repository and move into the directory:
31+
First, clone this repository and move into the directory:
3232

3333
```bash
3434
git clone https://github.com/graphql/graphql.github.io.git
@@ -38,7 +38,7 @@ cd graphql.github.io
3838
Then, use [Yarn](https://yarnpkg.com/getting-started/install) to install and load all the necessary dependencies:
3939

4040
```bash
41-
yarn
41+
yarn
4242
```
4343

4444
> Note: [Yarn is currently the only way to run the site locally](https://github.com/graphql/graphql.github.io/issues/946).
@@ -51,22 +51,22 @@ yarn start
5151

5252
Finally, open [http://localhost:8000](http://localhost:8000) to view it in the browser.
5353

54-
The GraphQL website is built with [Gatsby](https://www.gatsbyjs.com/docs/). This means that a hot-reloading development environment will be accessible by default.
54+
The GraphQL website is built with [Gatsby](https://www.gatsbyjs.com/docs/). This means that a hot-reloading development environment will be accessible by default.
5555

5656
### Branching
5757

58-
Active development for graphql.org happens on the `source` branch. Be sure to create any new branches or direct any pull requests back to `source`.
58+
Active development for graphql.org happens on the `source` branch. Be sure to create any new branches or direct any pull requests back to `source`.
5959

6060
### Project structure
6161

62-
- `static`: Files that will be copied directly to `public`.
62+
- `static`: Files that will be copied directly to `public`.
6363
- `public`: Output files that will be served by a static HTTP server.
6464
- `src`: Markdown and the TypeScript/JavaScript files used to generate the website.
65-
- `assets`: All the [`less`](http://lesscss.org/) files that contain stylesheets.
66-
- `components` and `Containers`: React components used for layouts and pages.
67-
- `content`: Markdown files with the content of pages.
68-
- `templates`: Layout templates.
69-
- `utils`: Helper functions.
65+
- `assets`: All the [`less`](http://lesscss.org/) files that contain stylesheets.
66+
- `components` and `Containers`: React components used for layouts and pages.
67+
- `content`: Markdown files with the content of pages.
68+
- `templates`: Layout templates.
69+
- `utils`: Helper functions.
7070

7171
### Publishing the updated site
7272

@@ -76,7 +76,7 @@ Your changes will be merged into the `source` branch. Then, the CI will automati
7676

7777
### Fix a typo, code sample bug, or formatting
7878

79-
If you notice something wrong in the text or code samples, please follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls) with your fix.
79+
If you notice something wrong in the text or code samples, please follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls) with your fix.
8080

8181
All of the content on graphql.org is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
8282

@@ -87,31 +87,33 @@ The [Code page](https://graphql.org/code/) is a collection of libraries, tools,
8787
#### General guidelines
8888

8989
**Adding a resource:**
90+
9091
- With rare exceptions, any pull request that adds a new library, tool, or service to the Code page will be accepted.
9192
- Any library should include a few paragraphs describing the usage and offering people a chance to grok the project priorities.
92-
- If there isn't a section already for your programming language, please add it.
93+
- If there isn't a section already for your programming language, please add it.
9394

9495
If it isn't a library, tool, or service - then it could go on the [Community page](#add-a-resource-to-the-community-page). If you aren't sure where your resource would fit, you can [open an issue](https://github.com/graphql/graphql.github.io/issues/new) and ask.
9596

9697
**Removing a resource:**
98+
9799
- Services that don't work anymore
98100
- Code repositories that are archived
99101
- Projects declared to be abandoned by their maintainers
100102
- Any link that 404s
101103

102-
We rely on these concrete signals before removing a resource. Even if a project hasn't been released in a few years, that doesn't mean that it's not working.
104+
We rely on these concrete signals before removing a resource. Even if a project hasn't been released in a few years, that doesn't mean that it's not working.
103105

104106
#### Workflow
105107

106-
To add or remove a resource to this page, follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls).
108+
To add or remove a resource to this page, follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls).
107109

108110
The content for this page is located in [various directories under `src/content/code`](./src/). Everything is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
109111

110112
### Add a resource to the Community page
111113

112114
The [Community page](https://graphql.org/community/) highlights resources and groups that help people get more involved with GraphQL.
113115

114-
To add something to this page, follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls).
116+
To add something to this page, follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls).
115117

116118
The content for this page is located in a [directory under `src/content/community`](./src/). Everything is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
117119

@@ -129,7 +131,7 @@ When your answer is ready, [open a pull request](https://github.com/graphql/grap
129131

130132
There are still several [Best Practices guides that no one has written](https://github.com/graphql/graphql.github.io/issues/41) yet. If you want to take one of these, comment on [the original issue](https://github.com/graphql/graphql.github.io/issues/41) and mention which topic you'll work on.
131133

132-
Then, use our [development guide](#development-guide) to determine where your new page best fits. Our documentation is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
134+
Then, use our [development guide](#development-guide) to determine where your new page best fits. Our documentation is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
133135

134136
Once it's ready for review, please [open a pull request](https://github.com/graphql/graphql.github.io/pulls/).
135137

@@ -141,15 +143,15 @@ If you're working off an [existing issue](https://github.com/graphql/graphql.git
141143

142144
### Browser support
143145

144-
We aim to support the latest stable versions of Chrome, Edge, Firefox, Safari, and Safari on mobile.
146+
We aim to support the latest stable versions of Chrome, Edge, Firefox, Safari, and Safari on mobile.
145147

146148
## Contributing something else
147149

148150
Interested in adding something not covered in this guide? Please [open an issue](https://github.com/graphql/graphql.github.io/issues/new) and tell us all about your idea.
149151

150152
## Asking questions
151153

152-
If you run into any problems or have questions while contributing, you're always welcome to [open an issue](https://github.com/graphql/graphql.github.io/issues/new).
154+
If you run into any problems or have questions while contributing, you're always welcome to [open an issue](https://github.com/graphql/graphql.github.io/issues/new).
153155

154156
# Opening a PR to contribute your code
155157

@@ -161,4 +163,4 @@ To initiate the signature process please open a PR against this repo. The EasyCL
161163

162164
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]).
163165

164-
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).
166+
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).

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
This repository contains the source code for the [GraphQL website](https://graphql.org).
44

5-
> You can find more discussions on the [#website channel on the GraphQL Slack](https://graphql.slack.com/messages/website/). [Get your invite here!](https://graphql-slack.herokuapp.com/)
5+
> You can find more discussions on the [#website channel on the GraphQL Slack](https://graphql.slack.com/messages/website/). [Get your invite here!](https://graphql-slack.herokuapp.com/)
66
7-
8-
A brief overview: **GraphQL** is a query language for APIs and a runtime for fulfilling those queries with your existing data. It provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need, and enables powerful developer tools. The [specification](https://spec.graphql.org/) is open source and governed by the [GraphQL Foundation](https://foundation.graphql.org/).
7+
A brief overview: **GraphQL** is a query language for APIs and a runtime for fulfilling those queries with your existing data. It provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need, and enables powerful developer tools. The [specification](https://spec.graphql.org/) is open source and governed by the [GraphQL Foundation](https://foundation.graphql.org/).
98

109
## Documentation
10+
1111
- [Site](https://graphql.org/)
1212
- [Reference documentation](https://graphql.org/learn/)
1313
- [Language support, tools, and services](https://graphql.org/code/)
@@ -19,6 +19,7 @@ A brief overview: **GraphQL** is a query language for APIs and a runtime for ful
1919
The site is deployed via Netlify on merges to the source branch, you can see the [builds here](https://app.netlify.com/teams/graphql-org/builds).
2020

2121
## How to contribute
22+
2223
Check out our [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to make changes to the GraphQL website 🎉
2324

2425
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/).
@@ -27,4 +28,4 @@ To initiate the signature process please open a PR against this repo. The EasyCL
2728

2829
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]).
2930

30-
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).
31+
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).

notes/ContributingToCodePage.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Contributing to the Code Page
22

3-
Hi, thanks for reading the docs!
3+
Hi, thanks for reading the docs!
44

55
Secondly, we want to provide a really strong overview of all the libraries in the GraphQL eco-system. To make this
66
easy for contributors the code page is automatically generated from a series of markdown files in this repo.
@@ -52,27 +52,29 @@ npm install express express-graphql graphql
5252
Then run `node server.js` with this code in `server.js`:
5353

5454
```js
55-
var express = require('express');
56-
var { graphqlHTTP } = require('express-graphql');
57-
var { buildSchema } = require('graphql');
55+
var express = require("express")
56+
var { graphqlHTTP } = require("express-graphql")
57+
var { buildSchema } = require("graphql")
5858

5959
var schema = buildSchema(`
6060
type Query {
6161
hello: String
6262
}
63-
`);
64-
65-
var root = { hello: () => 'Hello world!' };
66-
67-
var app = express();
68-
app.use('/graphql', graphqlHTTP({
69-
schema: schema,
70-
rootValue: root,
71-
graphiql: true,
72-
}));
73-
app.listen(4000, () => console.log('Now browse to localhost:4000/graphql'));
63+
`)
64+
65+
var root = { hello: () => "Hello world!" }
66+
67+
var app = express()
68+
app.use(
69+
"/graphql",
70+
graphqlHTTP({
71+
schema: schema,
72+
rootValue: root,
73+
graphiql: true,
74+
})
75+
)
76+
app.listen(4000, () => console.log("Now browse to localhost:4000/graphql"))
7477
```
75-
7678
````
7779

7880
Any library/tool/service has a maximum height in the site, and then it can be expanded by clicking, so if you need quite a lot of space to explain your project then that's OK.

0 commit comments

Comments
 (0)