Skip to content
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

The Graph Docs x Nextra #301

Merged
merged 11 commits into from
Mar 17, 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
11 changes: 11 additions & 0 deletions .github/workflows/ci-cd-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 7.28.0

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint

- name: Build Docker image
uses: docker/build-push-action@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ yarn-error.log*
.idea/

*/public/sitemap*.xml
.eslintcache
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"build": "pnpm -r build",
"start": "pnpm --filter @graphprotocol/docs start",
"export": "pnpm --filter @graphprotocol/docs export",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.mjs && pnpm prettier:check && pnpm typecheck",
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx,.mjs --max-warnings 0 . && pnpm prettier:check && pnpm typecheck",
"lint:fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx,.mjs && pnpm prettier && pnpm typecheck",
"prettier": "prettier . --write",
"prettier:check": "prettier . --check",
"typecheck": "tsc --noEmit",
"typecheck": "pnpm --filter @graphprotocol/docs typecheck",
"docker:build": "DOCKER_BUILDKIT=1 docker build . -t docs --no-cache",
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs",
"docker:clean": "docker builder prune",
Expand All @@ -21,19 +21,19 @@
},
"devDependencies": {
"@edgeandnode/eslint-config": "^1.3.0",
"eslint": "^8.34.0",
"eslint": "^8.35.0",
"husky": "^8.0.3",
"lint-staged": "^13.1.2",
"prettier": "^2.8.4",
"typescript": "4.9.5"
},
"pnpm": {
"overrides": {
"@types/react": "^17.0.52"
}
},
Comment on lines -30 to -34
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use react 18

"lint-staged": {
"**/*.{js,jsx,ts,tsx,mjs}": "eslint --fix",
"**/*.{js,jsx,ts,tsx,mjs,mdx,json}": "prettier --write"
},
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
26 changes: 26 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# For some reasons I get build error for the following pages
#
# Error: Export encountered errors on following paths:
# /ar/cookbook/cosmos
# /es/cookbook/cosmos
# /ja/cookbook/cosmos
# /ko/cookbook/cosmos
# /vi/cookbook/cosmos
# /zh/cookbook/cosmos
#
# While visiting locally /ar/cookbook/cosmos
# useRouter() returs route which is /en/cookbook/cosmos

diff --git a/dist/use-internals.mjs b/dist/use-internals.mjs
index 43482104268d7086e219a0704497f2b3bbe8ddb2..ce08afb3cd60c99ddd3fc7b165faf8d32ebf0033 100644
--- a/dist/use-internals.mjs
+++ b/dist/use-internals.mjs
@@ -17,7 +17,7 @@ function useInternals() {
};
}, [route, __nextra_internal__.refreshListeners, rerender]);
}
- const context = __nextra_internal__.context[route];
+ const context = __nextra_internal__.context[__nextra_internal__.route]
if (!context) {
throw new Error(
`No content found for the current route. This is a Nextra bug.`
Loading