Skip to content

Commit c042efe

Browse files
benfacedimaMachina0xa3k5
authored
Redesign (v2) (#873)
* all in one * add temporarily missing images to make build pass * use the-guild-org/shared-config/setup@v1 * fix eslint * Update Dockerfile * Update packages/nextra-theme/src/index.tsx Co-authored-by: Benoît Rouleau <[email protected]> * Update packages/nextra-theme/src/index.tsx * Update website/scripts/fetch-remote-docs.ts Co-authored-by: Benoît Rouleau <[email protected]> * Update fetch-remote-docs.ts * Update website/scripts/fetch-remote-docs.ts * 2/4 move `@graphprotocol/nextra-theme` to `@graphprotocol/docs` (#732) * aa * more * lint fix * 3/4 Refactor `_meta.js` to prefer `sidebarTitle` (#733) * move mdxStyles * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * lint * update nextra * 4/4 move `pages` to `src/pages` (#734) * move pages to src * some refactoring * Update Node * Remove unneeded `try…catch` * `pnpm check:fix` --------- Co-authored-by: benface <[email protected]> --------- Co-authored-by: benface <[email protected]> * Update dependencies * Fix tests * Change `@` alias to `src/` and move some files around * Start work on new design * Temp stuff * Try to fix CI * Update dependencies * WIP * style updates (#854) * style updates * remove navbar hiding on small screens (this was a test) * align icons and nav labels to top * lint * remove unnecessary w-full * Make search and locale switcher functional * Add icons + refactor and improve how navigation groups are computed * Add “partially selected” state * Quick fix * Huge refactoring + add a bunch of missing components, still missing breadcrumbs * Fixes and improvements (thanks AK for the feedback!) * Home page content + footer + fixes and tweaks * Fixes and tweaks * Squash some TODOs * Remove console log * style tweaks for home page (#872) * Make 404 page work + improve footer + last couple tweaks and fixes * Missed this in the merge * Use `sidebarTitle` instead of `_meta.js` * Last minute fixes --------- Co-authored-by: Dimitri POSTOLOV <[email protected]> Co-authored-by: AK <[email protected]>
1 parent c06e99e commit c042efe

File tree

3,879 files changed

+102119
-92997
lines changed

Some content is hidden

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

3,879 files changed

+102119
-92997
lines changed

.eslintrc.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// @ts-check
2+
13
const isVSCode = Boolean(process.env.VSCODE_PID)
24

35
/** @type {import('eslint').Linter.Config} */
@@ -21,7 +23,11 @@ module.exports = {
2123
// Only lint the English pages because the Markdown for the other languages is auto-generated from English (via Crowdin).
2224
// But include all languages when running the ESLint extension in VS Code (in case the user has "eslint.validate": ["mdx"]),
2325
// otherwise there will be random errors since the non-English files don't match any ruleset.
24-
files: [`website/pages/${!isVSCode ? 'en/' : ''}**/*.{md,mdx}`],
26+
files: [`website/src/pages/${isVSCode ? '' : 'en/'}**/*.{md,mdx}`],
27+
excludedFiles: [
28+
'website/src/pages/*/subgraphs/developing/creating/graph-ts/*.md',
29+
'website/src/pages/*/subgraphs/querying/graph-client/*.md',
30+
],
2531
parser: 'eslint-mdx',
2632
processor: 'mdx/remark',
2733
plugins: ['mdx'],

.github/workflows/ci-cd-pull-request.yml

+4-16
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ jobs:
1919
uses: actions/checkout@v4
2020

2121
- name: Set up env
22-
uses: the-guild-org/shared-config/setup@main
23-
with:
24-
nodeVersion: 20
25-
packageManager: pnpm
22+
uses: the-guild-org/shared-config/setup@v1
2623

2724
- name: Install dependencies
2825
run: pnpm install
@@ -43,10 +40,7 @@ jobs:
4340
uses: actions/checkout@v4
4441

4542
- name: Set up env
46-
uses: the-guild-org/shared-config/setup@main
47-
with:
48-
nodeVersion: 20
49-
packageManager: pnpm
43+
uses: the-guild-org/shared-config/setup@v1
5044

5145
- name: Install dependencies
5246
run: pnpm install
@@ -67,10 +61,7 @@ jobs:
6761
uses: actions/checkout@v4
6862

6963
- name: Set up env
70-
uses: the-guild-org/shared-config/setup@main
71-
with:
72-
nodeVersion: 20
73-
packageManager: pnpm
64+
uses: the-guild-org/shared-config/setup@v1
7465

7566
- name: Install dependencies
7667
run: pnpm install
@@ -92,10 +83,7 @@ jobs:
9283
uses: actions/checkout@v4
9384

9485
- name: Set up env
95-
uses: the-guild-org/shared-config/setup@main
96-
with:
97-
nodeVersion: 20
98-
packageManager: pnpm
86+
uses: the-guild-org/shared-config/setup@v1
9987

10088
- name: Install dependencies
10189
run: pnpm install

.github/workflows/opengraph.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ jobs:
2424
ref: ${{ env.COMMIT }}
2525

2626
- name: Set up env
27-
uses: the-guild-org/shared-config/setup@main
28-
with:
29-
nodeVersion: 20
30-
packageManager: pnpm
27+
uses: the-guild-org/shared-config/setup@v1
3128

3229
- name: Deploy
3330
working-directory: ./packages/og-image

.github/workflows/website-integrity.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ jobs:
2121
run: git fetch origin main
2222

2323
- name: Set up env
24-
uses: the-guild-org/shared-config/setup@main
25-
with:
26-
nodeVersion: 20
27-
packageManager: pnpm
24+
uses: the-guild-org/shared-config/setup@v1
2825

2926
- name: Build Site
3027
run: pnpm build

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ build/
3737
.eslintcache
3838
dist/
3939
.turbo/
40-
packages/og-image/vender/*.wasm
40+
packages/og-image/vendor/*.wasm
4141
.wrangler/

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22

.prettierignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
out/
44
pnpm-lock.yaml
55
dist/
6-
website/remote-files/*.json
6+
# ignore below md since they are fetched from GitHub
7+
website/src/pages/*/subgraphs/developing/creating/graph-ts/*.md
8+
website/src/pages/*/subgraphs/querying/graph-client/*.md

.remarkrc.mjs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
import remarkFrontmatter from 'remark-frontmatter'
2+
3+
/**
4+
* This config is used by `eslint-plugin-mdx` to lint the MDX files, not by Nextra.
5+
* Nextra uses the remark and rehype plugins registered in `next.config.js`, under `mdxOptions`.
6+
*/
17
export default {
28
plugins: [
3-
'frontmatter', // should be defined
9+
remarkFrontmatter,
410
['remark-lint-first-heading-level', 2],
511
['remark-lint-restrict-elements', { type: 'heading', depth: 1 }],
612
'remark-lint-heading-increment',

Dockerfile

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-alpine as builder
1+
FROM node:22-alpine AS builder
22

33
ARG ENVIRONMENT
44
ARG ORIGIN
@@ -14,14 +14,11 @@ RUN corepack enable pnpm
1414

1515
WORKDIR /app
1616

17-
COPY . .
18-
19-
# install the packages
20-
RUN pnpm install --frozen-lockfile --ignore-scripts
17+
COPY . ./
2118

19+
RUN pnpm install --frozen-lockfile
2220
RUN pnpm build
2321

24-
## production environment
2522
FROM nginx:1.16.0-alpine
2623

2724
COPY --from=builder ./app/nginx.conf /etc/nginx/

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Please read [`CONTRIBUTING.md`](https://github.com/graphprotocol/docs/blob/main/
88

99
## Local Setup
1010

11-
This project is built on [Next.js](https://nextjs.org/). You can run it on your machine, provided you have [Node 20+](https://nodejs.org/en/) and [`pnpm`](https://pnpm.io) installed.
11+
This project is built on [Next.js](https://nextjs.org/). You can run it on your machine, provided you have [Node 22+](https://nodejs.org/en/) and [`pnpm`](https://pnpm.io) installed.
1212

1313
First, clone the repo:
1414

crowdin.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
preserve_hierarchy: 1
22
files:
3-
- source: /website/pages/en/**/*.mdx
4-
ignore:
5-
- '/website/pages/en/**/\[\[...slug\]\].mdx'
6-
translation: /website/pages/%two_letters_code%/**/%original_file_name%
3+
- source: /website/src/pages/en/**/*.mdx
4+
translation: /website/src/pages/%two_letters_code%/**/%original_file_name%
75
dest: /**/%original_file_name%
86
content_segmentation: 0
9-
- source: /website/pages/en/**/*.json
10-
translation: /website/pages/%two_letters_code%/**/%original_file_name%
7+
- source: /website/src/pages/en/**/*.json
8+
translation: /website/src/pages/%two_letters_code%/**/%original_file_name%
119
dest: /**/%original_file_name%
1210
content_segmentation: 0

nginx.conf

+6-4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ http {
3333
root /usr/share/nginx/html;
3434
index index.html index.htm;
3535

36+
# Short cache with revalidation
37+
add_header Cache-Control "no-cache, must-revalidate";
38+
expires 5m;
39+
3640
# Redirect `http` to `https`
3741
if ($http_x_forwarded_proto = "http") {
3842
return 301 https://$host$request_uri;
@@ -150,13 +154,11 @@ http {
150154

151155
location / {
152156
try_files $uri $uri.html $uri/index.html =404;
153-
154-
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
155-
expires -1;
156157
}
157158

159+
# Use localized 404 pages for documentation paths
158160
location ~ ^/docs/([a-zA-Z][a-zA-Z])/(.*) {
159-
error_page 404 /docs/$1/404/index.html;
161+
try_files $uri $uri.html $uri/index.html /docs/$1/404/index.html;
160162
}
161163

162164
error_page 500 502 503 504 /docs/50x/index.html;

package.json

+19-17
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
{
2-
"name": "the-graph-docs-monorepo",
2+
"name": "graph-docs",
33
"private": true,
4-
"packageManager": "[email protected]",
4+
"version": "1.0.0",
5+
"packageManager": "[email protected]",
56
"scripts": {
6-
"dev": "turbo run dev --parallel",
7+
"dev": "turbo run dev",
78
"build": "NODE_OPTIONS='--max_old_space_size=4096' turbo run build",
8-
"docker:build": "source ./website/.env.local && DOCKER_BUILDKIT=1 docker build . -t docs --no-cache --build-arg ENVIRONMENT=$ENVIRONMENT --build-arg ORIGIN=$ORIGIN",
9-
"docker:clean": "docker builder prune",
10-
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs",
119
"check": "pnpm typecheck && pnpm lint && pnpm prettier:check",
1210
"check:fix": "pnpm lint:fix; pnpm prettier",
11+
"lint": "eslint . --ignore-path .gitignore --max-warnings 0",
12+
"lint:fix": "eslint . --ignore-path .gitignore --fix",
13+
"prettier": "prettier . --write --list-different",
14+
"prettier:check": "prettier . --check",
1315
"typecheck": "turbo run typecheck",
14-
"lint": "eslint . --cache --ignore-path .gitignore --max-warnings 0",
15-
"lint:fix": "eslint . --cache --ignore-path .gitignore --fix; pnpm prettier",
16-
"prettier": "pnpm prettier:check --write",
17-
"prettier:check": "prettier --cache --check .",
18-
"test": "turbo run test"
16+
"test": "turbo run test",
17+
"docker:build": "source ./website/.env.local && DOCKER_BUILDKIT=1 docker build . -t docs --no-cache --build-arg ENVIRONMENT=$ENVIRONMENT --build-arg ORIGIN=$ORIGIN",
18+
"docker:clean": "docker builder prune",
19+
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs"
1920
},
2021
"devDependencies": {
2122
"@edgeandnode/eslint-config": "^2.0.3",
23+
"@types/node": "^22.13.4",
2224
"eslint": "^8.57.1",
23-
"eslint-plugin-mdx": "^2.3.4",
24-
"prettier": "^3.4.2",
25+
"eslint-plugin-mdx": "^3.1.5",
26+
"prettier": "^3.5.1",
2527
"prettier-plugin-tailwindcss": "^0.6.11",
2628
"remark-frontmatter": "^5.0.0",
27-
"remark-lint-first-heading-level": "^3.1.2",
28-
"remark-lint-heading-increment": "^3.1.2",
29-
"remark-lint-no-heading-punctuation": "^3.1.2",
29+
"remark-lint-first-heading-level": "^4.0.1",
30+
"remark-lint-heading-increment": "^4.0.1",
31+
"remark-lint-no-heading-punctuation": "^4.0.1",
3032
"remark-lint-restrict-elements": "workspace:*",
31-
"turbo": "^1.13.4",
33+
"turbo": "^2.4.2",
3234
"typescript": "^5.7.3"
3335
},
3436
"resolutions": {

packages/nextra-theme/package.json

-61
This file was deleted.

packages/nextra-theme/src/components/Callout.tsx

-23
This file was deleted.

packages/nextra-theme/src/components/Code.tsx

-49
This file was deleted.

0 commit comments

Comments
 (0)