Skip to content

Commit 4bcdda6

Browse files
authored
Update dependencies + improve ESLint/TS configs + delete orphan pages (#486)
* Update dependencies (except Next and Nextra due to weird issues) * Improve ESLint and TS configs * Tweak `package.json` scripts * Don’t consider a link on thegraph.com domain to be external * Delete orphan pages (translated pages that no longer have a matching English page)
1 parent 0e7758b commit 4bcdda6

Some content is hidden

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

51 files changed

+1284
-7077
lines changed

.eslintrc.cjs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const isVSCode = Boolean(process.env.VSCODE_PID)
2+
13
/** @type {import('eslint').Linter.Config} */
24
module.exports = {
35
root: true,
@@ -12,15 +14,14 @@ module.exports = {
1214
{
1315
files: ['*.{ts,tsx}'],
1416
parserOptions: {
15-
project: 'tsconfig.json',
16-
},
17-
rules: {
18-
'@typescript-eslint/no-unsafe-argument': 'off', // lots of false positives for some reason
17+
project: true,
1918
},
2019
},
2120
{
22-
// We lint only english pages because other languages will be translated from english
23-
files: ['website/pages/en/**/*.{md,mdx}'],
21+
// Only lint the English pages because the Markdown for the other languages is auto-generated from English (via Crowdin).
22+
// But include all languages when running the ESLint extension in VS Code (in case the user has "eslint.validate": ["mdx"]),
23+
// otherwise there will be random errors since the non-English files don't match any ruleset.
24+
files: [`website/pages/${!isVSCode ? 'en/' : ''}**/*.{md,mdx}`],
2425
parser: 'eslint-mdx',
2526
processor: 'mdx/remark',
2627
plugins: ['mdx'],

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
"scripts": {
66
"build": "NODE_OPTIONS='--max_old_space_size=4096' turbo run build",
77
"check": "pnpm typecheck && pnpm lint && pnpm prettier:check",
8-
"check:fix": "pnpm typecheck && pnpm lint:fix",
8+
"check:fix": "pnpm typecheck; pnpm lint:fix",
99
"dev": "turbo run dev --parallel",
1010
"docker:build": "DOCKER_BUILDKIT=1 docker build . -t docs --no-cache",
1111
"docker:clean": "docker builder prune",
1212
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs",
1313
"export": "pnpm --filter @graphprotocol/docs export",
1414
"lint": "eslint . --cache --ignore-path .gitignore --max-warnings 0",
15-
"lint:fix": "eslint . --cache --ignore-path .gitignore --fix && pnpm prettier",
15+
"lint:fix": "eslint . --cache --ignore-path .gitignore --fix; pnpm prettier",
1616
"pre-commit": "lint-staged --concurrent false",
1717
"pre-push": "pnpm build",
1818
"prepare": "husky install && chmod +x .husky/*",
19-
"prettier": "prettier . --log-level warn --write",
20-
"prettier:check": "prettier . --log-level warn --check",
19+
"prettier": "prettier . --write --list-different",
20+
"prettier:check": "prettier . --check",
2121
"start": "pnpm --filter @graphprotocol/docs start",
2222
"typecheck": "turbo run typecheck"
2323
},
@@ -26,15 +26,15 @@
2626
"eslint": "^8.47.0",
2727
"eslint-plugin-mdx": "^2.2.0",
2828
"husky": "^8.0.3",
29-
"lint-staged": "^13.2.3",
30-
"prettier": "^3.0.1",
29+
"lint-staged": "^14.0.1",
30+
"prettier": "^3.0.2",
3131
"prettier-plugin-pkg": "^0.18.0",
3232
"remark-frontmatter": "^4.0.1",
3333
"remark-lint-first-heading-level": "^3.1.2",
3434
"remark-lint-heading-increment": "^3.1.2",
3535
"remark-lint-no-heading-punctuation": "^3.1.2",
3636
"remark-lint-restrict-elements": "workspace:*",
37-
"turbo": "^1.10.12",
37+
"turbo": "^1.10.13",
3838
"typescript": "^5.1.6"
3939
},
4040
"lint-staged": {

packages/nextra-theme/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,36 @@
2525
"typecheck": "tsc --noEmit"
2626
},
2727
"peerDependencies": {
28-
"@edgeandnode/gds": "^2.8.0",
29-
"@edgeandnode/organisms": "^2.9.0",
30-
"@emotion/react": "^11.10.6",
31-
"next": "^13.4.5",
32-
"next-seo": "^5.15.0",
33-
"nextra": "^2.7.1",
34-
"react-dom": "^18.2.0",
35-
"theme-ui": "^0.15.5"
28+
"@edgeandnode/gds": "^2.9.3",
29+
"@edgeandnode/go": "^3.0.3",
30+
"@emotion/react": "^11.11",
31+
"next": "^13",
32+
"next-seo": "^6",
33+
"nextra": "^2.7",
34+
"react-dom": "^18.2",
35+
"theme-ui": "^0.16"
3636
},
3737
"dependencies": {
38-
"@docsearch/react": "^3.5.1",
38+
"@docsearch/react": "^3.5.2",
3939
"@radix-ui/react-collapsible": "^1.0.3",
4040
"@radix-ui/react-visually-hidden": "^1.0.3",
4141
"lodash": "^4.17.21",
4242
"react-intersection-observer": "^9.5.2",
4343
"react-use": "^17.4.0"
4444
},
4545
"devDependencies": {
46-
"@edgeandnode/gds": "^2.9.0",
47-
"@edgeandnode/organisms": "^2.10.0",
46+
"@edgeandnode/gds": "^2.9.3",
47+
"@edgeandnode/go": "^3.0.3",
4848
"@emotion/react": "^11.11.1",
4949
"@types/lodash": "^4.14.197",
50-
"@types/react": "^18.2.20",
50+
"@types/react": "^18.2.21",
5151
"@types/react-dom": "^18.2.7",
5252
"next": "13.4.12",
5353
"next-seo": "^6.1.0",
5454
"nextra": "2.7.1",
5555
"react": "^18.2.0",
5656
"react-dom": "^18.2.0",
57-
"theme-ui": "^0.16.0",
57+
"theme-ui": "^0.16.1",
5858
"tsup": "^7.2.0"
5959
},
6060
"sideEffects": false

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const EditPageLink = ({ mobile = false, ...props }: EditPageLinkProps) =>
2727
const path = filePath.startsWith('https')
2828
? filePath
2929
: `https://github.com/graphprotocol/docs/blob/main/website/pages/${
30-
['en', '[locale]'].includes(fileLocale) ? fileLocale : 'en'
30+
fileLocale && ['en', '[locale]'].includes(fileLocale) ? fileLocale : 'en'
3131
}/${filePathSegments.join('/')}`
3232
return (
3333
<ButtonOrLink

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const BaseHeading = ({ level, id, children, ...props }: HeadingProps) => {
4545
transition: buildTransition('OPACITY'),
4646
}}
4747
>
48-
{/* Non-breaking invisible space, to prevent a line break between the `#` and the previous word */}
48+
{/* Zero-width non-breaking space, to prevent a line break between the `#` and the previous word */}
4949
&#8288;
5050
<LinkInline href={`#${id}`}>
5151
<span aria-hidden="true">#</span>

packages/nextra-theme/src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { MDXProvider } from 'nextra/mdx'
66
import { Item, normalizePages } from 'nextra/normalize-pages'
77
import { ReactElement, useCallback, useMemo } from 'react'
88
import { useSet } from 'react-use'
9-
import { ThemeUIStyleObject } from 'theme-ui'
9+
import { ThemeUICSSObject } from 'theme-ui'
1010

1111
import { Divider, DividerProps, Flex, Icon, Spacing, useI18n } from '@edgeandnode/gds'
12-
import { NPSForm } from '@edgeandnode/organisms'
12+
import { NPSForm } from '@edgeandnode/go'
1313

1414
import {
1515
Callout,
@@ -54,7 +54,7 @@ const mdxComponents = {
5454
VideoEmbed,
5555
}
5656

57-
const mdxStyles: ThemeUIStyleObject = {
57+
const mdxStyles: ThemeUICSSObject = {
5858
overflowWrap: 'break-word',
5959
'img + em': {
6060
mt: Spacing['16px'],

packages/nextra-theme/tsconfig.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
{
2+
"extends": "../../tsconfig.json",
23
"compilerOptions": {
3-
"target": "es2016",
4-
"module": "ESNext",
4+
"target": "es2017",
55
"declaration": false,
6-
"noEmit": true,
7-
"esModuleInterop": true,
8-
"strict": true,
9-
"skipLibCheck": true,
10-
"allowJs": true,
6+
"incremental": false,
117
"jsx": "react-jsx",
128
"jsxImportSource": "theme-ui",
13-
"moduleResolution": "node",
14-
"lib": ["ESNext", "DOM", "DOM.Iterable"],
15-
"resolveJsonModule": true,
9+
"baseUrl": ".",
1610
"paths": {
1711
"@/*": ["./src/*"]
1812
}

0 commit comments

Comments
 (0)