Skip to content

Added prettier-check to CI/CD + run prettier #1397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ labels: bug

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

### Expected Result
### Expected Result

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

### Actual Result
### Actual Result

<!-- What actually happened? -->

### Additional Context

<!--
<!--
Anything else that will help us better understand, for example:
* Information about your local environment
* Screenshots
* Code snippets
-->
-->
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/code-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ labels: enhancement

### Additional Context

<!-- Anything else that will help us understand your vision -->
<!-- Anything else that will help us understand your vision -->
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!--
Thanks for making a pull request!
Thanks for making a pull request!

Before submitting, please read our contributing guidelines:
https://github.com/graphql/graphql.github.io/blob/source/CONTRIBUTING.md

Have any questions?
Have any questions?
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)
-->

Closes #<issue number>

## Description

<!-- Write a brief description of the changes introduced by this PR -->
<!-- Write a brief description of the changes introduced by this PR -->
13 changes: 13 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Prettier Check

on: pull_request

jobs:
prettier-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: yarn
- name: Run Prettier Check
run: yarn format:check
62 changes: 32 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

> This repository is governed by the [GraphQL Code of Conduct](https://graphql.org/codeofconduct/). By contributing, you agree to abide by its terms.

Thanks for taking the time to contribute! The GraphQL community is great because of people like you 🎉
Thanks for taking the time to contribute! The GraphQL community is great because of people like you 🎉

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

## What's in this document

- [Development guide](#development-guide)
- [Running the site locally](#running-the-site-locally)
- [Branching](#branching)
- [Project structure](#project-structure)
- [Publishing the updated site](#publishing-the-updated-site)
- [Running the site locally](#running-the-site-locally)
- [Branching](#branching)
- [Project structure](#project-structure)
- [Publishing the updated site](#publishing-the-updated-site)
- [Updating content](#updating-content)
- [Fix a typo, code sample bug, or formatting](#fix-a-typo-code-sample-bug-or-formatting)
- [Add a library or tool to the Code page](#add-a-library-or-tool-to-the-code-page)
- [Add a resource to the Community page](#add-a-resource-to-the-community-page)
- [Add a question to the FAQ](#add-a-question-to-the-faq)
- [Write a new section or guide](#write-a-new-section-or-guide)
- [Fix a typo, code sample bug, or formatting](#fix-a-typo-code-sample-bug-or-formatting)
- [Add a library or tool to the Code page](#add-a-library-or-tool-to-the-code-page)
- [Add a resource to the Community page](#add-a-resource-to-the-community-page)
- [Add a question to the FAQ](#add-a-question-to-the-faq)
- [Write a new section or guide](#write-a-new-section-or-guide)
- [Making changes to the code](#making-changes-to-the-code)
- [Browser support](#browser-support)
- [Browser support](#browser-support)
- [Contributing something else](#contributing-something-else)
- [Asking questions](#asking-questions)

## Development guide

### Running the site locally

First, clone this repository and move into the directory:
First, clone this repository and move into the directory:

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

```bash
yarn
yarn
```

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

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

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

### Branching

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

### Project structure

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

### Publishing the updated site

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

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

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

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

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

**Adding a resource:**

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

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.

**Removing a resource:**

- Services that don't work anymore
- Code repositories that are archived
- Projects declared to be abandoned by their maintainers
- Any link that 404s

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

#### Workflow

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

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

### Add a resource to the Community page

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

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

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

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

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.

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

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

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

### Browser support

We aim to support the latest stable versions of Chrome, Edge, Firefox, Safari, and Safari on mobile.
We aim to support the latest stable versions of Chrome, Edge, Firefox, Safari, and Safari on mobile.

## Contributing something else

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.

## Asking questions

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

# Opening a PR to contribute your code

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

You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). If you have issues, please email [operations@graphql.org](mailto:operations@graphql.org).

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).
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).
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

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

> 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/)
> 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/)


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

## Documentation

- [Site](https://graphql.org/)
- [Reference documentation](https://graphql.org/learn/)
- [Language support, tools, and services](https://graphql.org/code/)
Expand All @@ -19,6 +19,7 @@ A brief overview: **GraphQL** is a query language for APIs and a runtime for ful
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).

## How to contribute

Check out our [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to make changes to the GraphQL website 🎉

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

You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). If you have issues, please email [operations@graphql.org](mailto:operations@graphql.org).

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).
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).
34 changes: 18 additions & 16 deletions notes/ContributingToCodePage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Contributing to the Code Page

Hi, thanks for reading the docs!
Hi, thanks for reading the docs!

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

```js
var express = require('express');
var { graphqlHTTP } = require('express-graphql');
var { buildSchema } = require('graphql');
var express = require("express")
var { graphqlHTTP } = require("express-graphql")
var { buildSchema } = require("graphql")

var schema = buildSchema(`
type Query {
hello: String
}
`);

var root = { hello: () => 'Hello world!' };

var app = express();
app.use('/graphql', graphqlHTTP({
schema: schema,
rootValue: root,
graphiql: true,
}));
app.listen(4000, () => console.log('Now browse to localhost:4000/graphql'));
`)

var root = { hello: () => "Hello world!" }

var app = express()
app.use(
"/graphql",
graphqlHTTP({
schema: schema,
rootValue: root,
graphiql: true,
})
)
app.listen(4000, () => console.log("Now browse to localhost:4000/graphql"))
```

````

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