Skip to content

Commit 8b43742

Browse files
robertjdominguezhasura-bot
authored andcommitted
docs: add docs devcontainer
PR-URL: hasura/graphql-engine-mono#7296 GitOrigin-RevId: 68d9ac0bc8697aad0661480b33f65949ffdc8a80
1 parent 47eeace commit 8b43742

File tree

5 files changed

+73
-1
lines changed

5 files changed

+73
-1
lines changed

.devcontainer/docs/devcontainer.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "Node.js",
3+
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-18",
4+
"features": {
5+
"ghcr.io/devcontainers/features/git:1": {}
6+
},
7+
"forwardPorts": [3000],
8+
"postCreateCommand": "cd docs && yarn install",
9+
"customizations": {
10+
"codespaces": {
11+
"vscode": {
12+
"extensions": ["esbenp.prettier-vscode", "streetsidesoftware.code-spell-checker"]
13+
},
14+
"openFiles": ["docs/CODESPACES.md"]
15+
}
16+
}
17+
18+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
19+
// "remoteUser": "root"
20+
}

docs/CODESPACES.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# You're Using Codespaces
2+
3+
Look at you go! Since this is running in a devcontainer, we've installed dependencies automatically for you 🔥
4+
5+
## The deets
6+
7+
We've installed a few useful extensions for you, too:
8+
9+
- **Prettier** because who formats their own code in this day and age?
10+
- **code-spell-checker** because words are hard.
11+
12+
We hope these additions make contributing a breeze.
13+
14+
## Next steps
15+
16+
In the terminal below, you should see a `postCreateCommand` script running. When it's done, you'll need to run the following command to fire up the dev server:
17+
18+
```bash
19+
cd docs && yarn start --host 0.0.0.0
20+
```
21+
22+
Happy contributing!
23+
24+
❤️ Docs Team

docs/static/img/wiki/codespaces-1.gif

154 KB
Loading

docs/static/img/wiki/codespaces-2.gif

240 KB
Loading

docs/wiki/contributions.mdx

+29-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Assets are stored in `static/img/<feature-folder>`. Just like the file-based rou
300300
file paths are important for images as well. However, instead of any output to the console, the page will simply crash
301301
and present a message indicating which image's path cannot be resolved.
302302

303-
<Thumbnail src="/img/wiki/broken-image.png" alt="Add check constraint" width="1000px" />
303+
<Thumbnail src='/img/wiki/broken-image.png' alt='Add check constraint' width='1000px' />
304304

305305
Use the erroneous image path to identify the error, facepalm, and then fix your typo.
306306

@@ -325,3 +325,31 @@ Perhaps the biggest pitfall we've encountered with Docusaurus is how delicate `.
325325
placement of code blocks and other text. If you've included a code block using common markdown syntax, and things aren't
326326
rendering as you think they should, try giving the block a bit of breathing room with a single empty line above and
327327
below it.
328+
329+
## Codespaces
330+
331+
:::info Note
332+
333+
For Hasurians, we've recently introduced a new way to contribute to the docs:
334+
[Codespaces](https://docs.github.com/en/codespaces). This is a new feature from GitHub that allows you to spin up a
335+
fully-configured docs dev environment in the cloud. This means you can get started contributing to the docs without
336+
having to install any dependencies on your local machine.
337+
338+
:::
339+
340+
### Step 1: Create a Codespace
341+
342+
Head to the `hasura/graphql-engine-mono` repo and click the `Code` button. You should see a `Open with Codespaces`
343+
button. Click it and choose `...` and then `+ New with options...` as in the example below:
344+
345+
<Thumbnail src='/img/wiki/codespaces-1.gif' alt='Create Codespace' width='1000px' />
346+
347+
### Step 2: Configure your Codespace
348+
349+
You'll be presented with a few options. Select the `docs` devcontainer, the region nearest to you, and a machine type
350+
before clicking `Create codespace`:
351+
352+
<Thumbnail src='/img/wiki/codespaces-2.gif' alt='Create Codespace' width='1000px' />
353+
354+
The Codespace will spin up and you'll be presented with a fully-configured dev environment. We automatically open you to
355+
the `CODESPACES.md` file where you can follow the instructions to get started quickly.

0 commit comments

Comments
 (0)