Skip to content

Commit 93e9a5e

Browse files
Dimitri POSTOLOVdimaMachinabenface
authored
The Graph Docs x Nextra (#301)
Co-authored-by: Dimitri POSTOLOV <[email protected]> Co-authored-by: Benoît Rouleau <[email protected]>
1 parent 10390e1 commit 93e9a5e

26 files changed

+1103
-854
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ jobs:
1818
- name: Checkout the repo
1919
uses: actions/checkout@v3
2020

21+
- name: Set up pnpm
22+
uses: pnpm/action-setup@v2
23+
with:
24+
version: 7.28.0
25+
26+
- name: Install dependencies
27+
run: pnpm install
28+
29+
- name: Lint
30+
run: pnpm lint
31+
2132
- name: Build Docker image
2233
uses: docker/build-push-action@v4
2334
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ yarn-error.log*
4040
.idea/
4141

4242
*/public/sitemap*.xml
43+
.eslintcache

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"build": "pnpm -r build",
88
"start": "pnpm --filter @graphprotocol/docs start",
99
"export": "pnpm --filter @graphprotocol/docs export",
10-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.mjs && pnpm prettier:check && pnpm typecheck",
10+
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx,.mjs --max-warnings 0 . && pnpm prettier:check && pnpm typecheck",
1111
"lint:fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx,.mjs && pnpm prettier && pnpm typecheck",
1212
"prettier": "prettier . --write",
1313
"prettier:check": "prettier . --check",
14-
"typecheck": "tsc --noEmit",
14+
"typecheck": "pnpm --filter @graphprotocol/docs typecheck",
1515
"docker:build": "DOCKER_BUILDKIT=1 docker build . -t docs --no-cache",
1616
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs",
1717
"docker:clean": "docker builder prune",
@@ -21,19 +21,19 @@
2121
},
2222
"devDependencies": {
2323
"@edgeandnode/eslint-config": "^1.3.0",
24-
"eslint": "^8.34.0",
24+
"eslint": "^8.35.0",
2525
"husky": "^8.0.3",
2626
"lint-staged": "^13.1.2",
2727
"prettier": "^2.8.4",
2828
"typescript": "4.9.5"
2929
},
30-
"pnpm": {
31-
"overrides": {
32-
"@types/react": "^17.0.52"
33-
}
34-
},
3530
"lint-staged": {
3631
"**/*.{js,jsx,ts,tsx,mjs}": "eslint --fix",
3732
"**/*.{js,jsx,ts,tsx,mjs,mdx,json}": "prettier --write"
33+
},
34+
"pnpm": {
35+
"patchedDependencies": {
36+
37+
}
3838
}
3939
}

patches/[email protected]

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# For some reasons I get build error for the following pages
2+
#
3+
# Error: Export encountered errors on following paths:
4+
# /ar/cookbook/cosmos
5+
# /es/cookbook/cosmos
6+
# /ja/cookbook/cosmos
7+
# /ko/cookbook/cosmos
8+
# /vi/cookbook/cosmos
9+
# /zh/cookbook/cosmos
10+
#
11+
# While visiting locally /ar/cookbook/cosmos
12+
# useRouter() returs route which is /en/cookbook/cosmos
13+
14+
diff --git a/dist/use-internals.mjs b/dist/use-internals.mjs
15+
index 43482104268d7086e219a0704497f2b3bbe8ddb2..ce08afb3cd60c99ddd3fc7b165faf8d32ebf0033 100644
16+
--- a/dist/use-internals.mjs
17+
+++ b/dist/use-internals.mjs
18+
@@ -17,7 +17,7 @@ function useInternals() {
19+
};
20+
}, [route, __nextra_internal__.refreshListeners, rerender]);
21+
}
22+
- const context = __nextra_internal__.context[route];
23+
+ const context = __nextra_internal__.context[__nextra_internal__.route]
24+
if (!context) {
25+
throw new Error(
26+
`No content found for the current route. This is a Nextra bug.`

0 commit comments

Comments
 (0)