Skip to content

Update dependencies + clean up #922

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

Merged
merged 5 commits into from
May 3, 2025
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
10 changes: 2 additions & 8 deletions .github/workflows/website-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ jobs:
- name: Set up env
uses: the-guild-org/shared-config/setup@v1

- name: Fetch remote docs
run: cd website && pnpm fetch-remote-docs

- name: Fetch API reference
run: cd website && pnpm fetch-api-reference

- name: Fix pages structure
run: cd website && pnpm fix-pages-structure
- name: Run pre-build scripts
run: pnpm prebuild:ci

- name: Build
run: pnpm build
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ WORKDIR /app
COPY . ./

RUN pnpm install --frozen-lockfile
RUN cd website && pnpm fetch-remote-docs
RUN cd website && pnpm fetch-api-reference
RUN cd website && pnpm fix-pages-structure
RUN pnpm prebuild:ci
RUN pnpm build

FROM nginx:1.16.0-alpine
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "turbo run dev",
"build": "NODE_OPTIONS='--max_old_space_size=8192' turbo run build",
"prebuild:ci": "turbo run prebuild:ci",
"check": "pnpm typecheck && pnpm lint && pnpm prettier:check",
"check:fix": "pnpm lint:fix; pnpm prettier",
"lint": "eslint . --ignore-path .gitignore --max-warnings 0",
Expand Down
2 changes: 1 addition & 1 deletion packages/og-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"yoga-wasm-web": "^0.3.3"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20250430.0",
"@cloudflare/workers-types": "^4.20250502.0",
"@types/react": "^18.3.20",
"jest-image-snapshot": "^6.4.0",
"tsx": "^4.19.4",
Expand Down
46 changes: 24 additions & 22 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"outputs": ["dist/**"],
"dependsOn": ["^build"]
},
"prebuild:ci": {
"cache": false
},
"typecheck": {
"dependsOn": ["^build"]
},
Expand Down
3 changes: 2 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"predev": "tsup ./src/i18n.ts --format esm",
"build": "rm -rf .next && rm -rf out && next build",
"prebuild": "pnpm predev",
"prebuild:ci": "pnpm fetch-remote-docs && pnpm fetch-api-reference && pnpm fix-pages-structure",
"postbuild": "next-sitemap --config next-sitemap.config.mjs && node scripts/sitemap-ci.js",
"typecheck": "tsc",
"fetch-remote-docs": "tsx scripts/fetch-remote-docs.ts",
Expand All @@ -19,7 +20,7 @@
"@docsearch/react": "^3.9.0",
"@edgeandnode/common": "^7.0.4",
"@edgeandnode/gds": "^6.5.14",
"@edgeandnode/go": "^9.4.14",
"@edgeandnode/go": "^10.0.2",
"@emotion/react": "^11.14.0",
"@graphprotocol/contracts": "6.2.1",
"@pinax/graph-networks-registry": "^0.6.7",
Expand Down
74 changes: 35 additions & 39 deletions website/src/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { NetworkType } from '@pinax/graph-networks-registry'
import { useData } from 'nextra/hooks'
import type { ComponentPropsWithoutRef } from 'react'

import { classNames, ExperimentalLink, Tooltip } from '@edgeandnode/gds'
import { ButtonOrLink, ExperimentalLink, Tooltip } from '@edgeandnode/gds'
import {
Clock,
Firehose,
GraphExplorer,
GraphNode,
Expand All @@ -17,9 +14,9 @@ import { NetworkIcon } from '@edgeandnode/go'

import { Card, Heading, TimeIcon } from '@/components'
import { useI18n } from '@/i18n'
import { getSupportedNetworks } from '@/supportedNetworks'
import { type SupportedNetwork } from '@/supportedNetworks'

export default function HomePage() {
export default function HomePage({ supportedNetworks }: { supportedNetworks: SupportedNetwork[] }) {
const { t } = useI18n()

return (
Expand Down Expand Up @@ -141,7 +138,38 @@ export default function HomePage() {
</ExperimentalLink>,
])}
</p>
<SupportedNetworks className="mt-8" />
<div className="graph-docs-not-markdown mt-8 overflow-clip rounded-8 border border-space-1500">
<ul className="grid grid-cols-auto-fill-16 gap-px text-space-500">
{supportedNetworks
// TODO: Don't filter out testnets that don't have a mainnet
.filter((network) => network.networkType === NetworkType.Mainnet)
// Filter out networks that are either duplicates (same logo, same or similar short name) or irrelevant in this view
.filter(
(network) =>
!network.caip2Id.startsWith('beacon:') &&
!['boba-bnb', 'eos-evm', 'polygon-zkevm', 'solana-accounts'].includes(network.id),
)
// Filter out networks that don't have a proper monochrome logo
.filter((network) => {
return network.id !== 'zora'
})
.map((network) => (
<li key={network.id} className="-mb-px -mr-px">
<Tooltip content={network.shortName}>
<ButtonOrLink
href={`/supported-networks/${network.id}`}
className={`
flex aspect-square items-center justify-center border-b border-r border-space-1500 -outline-offset-1 transition
hover:bg-space-1600
`}
>
<NetworkIcon network={network} size={6} />
</ButtonOrLink>
</Tooltip>
</li>
))}
</ul>
</div>
</section>

<hr />
Expand Down Expand Up @@ -247,35 +275,3 @@ export default function HomePage() {
</>
)
}

function SupportedNetworks({ className, ...props }: ComponentPropsWithoutRef<'div'>) {
const { supportedNetworks } = useData() as { supportedNetworks: Awaited<ReturnType<typeof getSupportedNetworks>> }

return (
<div
className={classNames(['graph-docs-not-markdown overflow-clip rounded-8 border border-space-1500', className])}
{...props}
>
<ul className="grid grid-cols-auto-fill-16 gap-px text-space-500">
{supportedNetworks
// TODO: Don't filter out testnets that don't have a mainnet
.filter((network) => network.networkType === NetworkType.Mainnet)
// Filter out networks that are either duplicates (same logo, same or similar short name) or irrelevant in this view
.filter(
(network) =>
!network.caip2Id.startsWith('beacon:') &&
!['boba-bnb', 'eos-evm', 'polygon-zkevm', 'solana-accounts'].includes(network.id),
)
// TODO: Fix Zora mono logo in web3icons
.filter((network) => network.id !== 'zora')
.map((network) => (
<Tooltip key={network.id} content={network.shortName}>
<li className="-mb-px -mr-px flex aspect-square items-center justify-center border-b border-r border-space-1500 transition hover:bg-space-1600">
<NetworkIcon caip2Id={network.caip2Id as any} size={6} />
</li>
</Tooltip>
))}
</ul>
</div>
)
}
6 changes: 3 additions & 3 deletions website/src/components/Callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ export const Callout = ({
className={classNames([
`flex gap-2 rounded-8 border p-4 ps-3
data-[variant=important]:border-solar-500/50
data-[variant=info]:border-astro-500/50
data-[variant=info]:border-galactic-500/50
data-[variant=important]:bg-solar-500/10
data-[variant=info]:bg-astro-500/10
data-[variant=info]:bg-galactic-500/10
--:my-8 --:last:mb-0 -:is-[li>*]:my-4`,
className,
])}
{...(props as ComponentPropsWithoutRef<'div'>)}
>
<div className="flex size-6 shrink-0 items-center justify-center">
{variant === 'info' ? (
<Lightbulb size={4} color="astro-500" alt={!title ? t('global.content.callout.note') : ''} />
<Lightbulb size={4} color="galactic-500" alt={!title ? t('global.content.callout.note') : ''} />
) : (
<ExclamationMark size={4} color="solar-500" alt={!title ? t('global.content.callout.important') : ''} />
)}
Expand Down
6 changes: 2 additions & 4 deletions website/src/pages/[locale]/[...404].mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { translate } from '@edgeandnode/gds'
import { RemoteContent } from 'nextra/components'
import { buildDynamicMDX } from 'nextra/remote'

import { supportedLocales, translations } from '@/i18n'
Expand All @@ -22,8 +21,7 @@ hideTableOfContents: true
hideContentHeader: true
hideContentFooter: true
unwrapContent: true
---
<PageNotFound />`
---`
const mdx = await buildDynamicMDX(rawMdx, { codeHighlight: false })
const { pageMap } = await import(`.next/static/chunks/nextra-page-map-${locale}.mjs`)
return {
Expand All @@ -34,4 +32,4 @@ unwrapContent: true
}
}

<RemoteContent components={{ PageNotFound }} />
<PageNotFound />
Loading