-
Notifications
You must be signed in to change notification settings - Fork 308
Add Developer Hub to monorepo #2672
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
Changes from 1 commit
60f0863
1da438c
b01e0a3
a6e9c64
a63891f
6adee5d
8ad2a70
3d94928
68c4312
9352934
67f61d1
3e14458
ee48c8c
f330b3d
3914dcc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| .env*.local | ||
| .source |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .next/ | ||
| coverage/ | ||
| node_modules/ | ||
| *.tsbuildinfo | ||
| .env*.local | ||
| .env | ||
| .DS_Store |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| title: Entropy How-To Guide | ||
| description: A placeholder docs page | ||
| --- | ||
|
|
||
| # How To | ||
|
|
||
| Build secure smart contracts with provably random numbers from Pyth Entropy. Launch NFTs, games, and other unique experiences that your users trust with seamless UX. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| title: Overview | ||
| description: A placeholder landing page | ||
| icon: CardsThree | ||
| full: true | ||
| --- | ||
|
|
||
| # Secure On-Chain Randomness | ||
|
|
||
| Build secure smart contracts with provably random numbers from Pyth Entropy. Launch NFTs, games, and other unique experiences that your users trust with seamless UX. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "root": true, | ||
| "title": "Entropy", | ||
| "description": "Random numbers for smart contracts", | ||
| "icon": "Shuffle", | ||
| "pages": ["index", "---Guides---", "how-to-guides"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| title: Express Relay How-To Guide | ||
| description: A placeholder docs page | ||
| --- | ||
|
|
||
| # How To | ||
|
|
||
| Integrate directly with searchers to recapture MEV. Go to market faster. Accelerate your protocol's growth. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| title: Overview | ||
| description: A placeholder landing page | ||
| icon: CardsThree | ||
| full: true | ||
| --- | ||
|
|
||
| # Take Back Control with Express Relay | ||
|
|
||
| Integrate directly with searchers to recapture MEV. Go to market faster. Accelerate your protocol's growth. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "root": true, | ||
| "title": "Express Relay", | ||
| "description": "Eliminate MEV", | ||
| "icon": "Gavel", | ||
| "pages": ["index", "---Guides---", "how-to-guides"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| title: Lazer How-To Guide | ||
| description: A placeholder docs page | ||
| --- | ||
|
|
||
| # How To | ||
|
|
||
| Pyth Lazer is a low latency, highly customizable price oracle. It offers a customizable set of price feeds, target chains (EVM or Solana) and channels (real time or fixed rate) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| title: Overview | ||
| description: A placeholder landing page | ||
| icon: CardsThree | ||
| full: true | ||
| --- | ||
|
|
||
| # Low latency, highly customizable price oracle | ||
|
|
||
| Pyth Lazer is a low latency, highly customizable price oracle. It offers a customizable set of price feeds, target chains (EVM or Solana) and channels (real time or fixed rate) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "root": true, | ||
| "title": "Lazer", | ||
| "description": "Low latency, highly customizable price oracle", | ||
| "icon": "Lightning", | ||
| "pages": ["index", "---Guides---", "how-to-guides"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "pages": ["pyth-core", "lazer", "express-relay", "entropy"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| title: Pyth Core How-To Guide | ||
| description: A placeholder docs page | ||
| --- | ||
|
|
||
| # Heading One | ||
|
|
||
| The fastest and most reliable data powering more transactions than any other oracle. Permissionless integration on every blockchain. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| title: Overview | ||
| description: A placeholder landing page | ||
| icon: CardsThree | ||
| full: true | ||
| --- | ||
|
|
||
| # Real-time data from financial institutions | ||
|
|
||
| The fastest and most reliable data powering more transactions than any other oracle. Permissionless integration on every blockchain. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "root": true, | ||
| "title": "Pyth Core", | ||
| "description": "Real-time data from financial institutions", | ||
| "icon": "ChartLine", | ||
| "pages": ["index", "---Guides---", "how-to-guides"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { nextjs as default } from "@cprussin/eslint-config"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { nextjs as default } from "@cprussin/jest-config/next"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import createBundleAnalyzer from "@next/bundle-analyzer"; | ||
| import { createMDX } from "fumadocs-mdx/next"; | ||
|
|
||
| const withAnalyzer = createBundleAnalyzer({ | ||
| enabled: process.env.ANALYZE === "true", | ||
| }); | ||
|
|
||
| const config = { | ||
| reactStrictMode: true, | ||
| turbopack: { | ||
| resolveExtensions: [".mdx", ".tsx", ".ts", ".jsx", ".js", ".mjs", ".json"], | ||
| rules: { | ||
| "*.svg": { | ||
| loaders: ["@svgr/webpack"], | ||
| as: "*.js", | ||
| }, | ||
| }, | ||
| }, | ||
aaronbassett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| pageExtensions: ["ts", "tsx", "mdx"], | ||
|
|
||
| experimental: { | ||
| useCache: true, | ||
aaronbassett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
|
|
||
| logging: { | ||
| fetches: { | ||
| fullUrl: true, | ||
| }, | ||
| }, | ||
|
|
||
| webpack(config) { | ||
| config.module.rules.push({ | ||
| test: /\.svg$/i, | ||
| use: ["@svgr/webpack"], | ||
| }); | ||
|
|
||
| config.resolve.extensionAlias = { | ||
| ".js": [".js", ".ts", ".tsx"], | ||
| }; | ||
aaronbassett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| return config; | ||
| }, | ||
|
|
||
| headers: async () => [ | ||
| { | ||
| source: "/:path*", | ||
| headers: [ | ||
| { | ||
| key: "X-XSS-Protection", | ||
| value: "1; mode=block", | ||
| }, | ||
| { | ||
| key: "Referrer-Policy", | ||
| value: "strict-origin-when-cross-origin", | ||
| }, | ||
| { | ||
| key: "Strict-Transport-Security", | ||
| value: "max-age=2592000", | ||
| }, | ||
| { | ||
| key: "X-Content-Type-Options", | ||
| value: "nosniff", | ||
| }, | ||
| { | ||
| key: "Permissions-Policy", | ||
| value: | ||
| "vibrate=(), geolocation=(), midi=(), notifications=(), push=(), sync-xhr=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=(), vibrate=(), fullscreen=self", | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }; | ||
|
|
||
| const withMDX = createMDX(); | ||
|
|
||
| export default withAnalyzer(withMDX(config)); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| { | ||
| "name": "@pythnetwork/developer-hub", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "engines": { | ||
| "node": "22" | ||
| }, | ||
| "scripts": { | ||
| "build:vercel": "next build", | ||
| "build:analyze": "ANALYZE=true next build", | ||
| "fix:format": "prettier --write .", | ||
| "fix:lint:eslint": "eslint --fix .", | ||
| "fix:lint:stylelint": "stylelint --fix 'src/**/*.scss'", | ||
| "pull:env": "[ $CI ] || VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_TBkf9EyQjQF37gs4Vk0sQKJj97kE vercel env pull", | ||
| "start:dev": "next dev --port 3003", | ||
| "start:prod": "next start --port 3003", | ||
aaronbassett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "test:format": "prettier --check .", | ||
| "test:lint:eslint": "eslint . --max-warnings 0", | ||
| "test:lint:stylelint": "stylelint 'src/**/*.scss' --max-warnings 0", | ||
| "test:types": "tsc" | ||
| }, | ||
| "dependencies": { | ||
| "@phosphor-icons/react": "catalog:", | ||
| "@pythnetwork/component-library": "workspace:*", | ||
| "@react-hookz/web": "catalog:", | ||
| "clsx": "catalog:", | ||
| "fumadocs-core": "catalog:", | ||
| "fumadocs-mdx": "catalog:", | ||
| "fumadocs-ui": "catalog:", | ||
| "next": "catalog:", | ||
| "next-themes": "catalog:", | ||
| "nuqs": "catalog:", | ||
| "react": "catalog:", | ||
| "react-aria": "catalog:", | ||
| "react-dom": "catalog:", | ||
| "zod": "catalog:", | ||
| "zod-validation-error": "catalog:" | ||
aaronbassett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| "devDependencies": { | ||
| "@cprussin/eslint-config": "catalog:", | ||
| "@cprussin/jest-config": "catalog:", | ||
| "@cprussin/prettier-config": "catalog:", | ||
| "@cprussin/tsconfig": "catalog:", | ||
| "@next/bundle-analyzer": "catalog:", | ||
| "@svgr/webpack": "catalog:", | ||
| "@tailwindcss/postcss": "catalog:", | ||
| "@types/jest": "catalog:", | ||
| "@types/mdx": "catalog:", | ||
| "@types/node": "catalog:", | ||
| "@types/react": "catalog:", | ||
| "@types/react-dom": "catalog:", | ||
| "autoprefixer": "catalog:", | ||
| "eslint": "catalog:", | ||
| "jest": "catalog:", | ||
| "postcss": "catalog:", | ||
| "prettier": "catalog:", | ||
| "sass": "catalog:", | ||
| "stylelint": "catalog:", | ||
| "stylelint-config-standard-scss": "catalog:", | ||
| "tailwindcss": "^4.1.6", | ||
| "typescript": "catalog:", | ||
| "vercel": "catalog:" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export default { | ||
| plugins: { | ||
| "@tailwindcss/postcss": {}, | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { base as default } from "@cprussin/prettier-config"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { | ||
| defineConfig, | ||
| defineDocs, | ||
| frontmatterSchema, | ||
| metaSchema, | ||
| } from "fumadocs-mdx/config"; | ||
| import { z } from "zod"; | ||
|
|
||
| export const docs = defineDocs({ | ||
| docs: { | ||
| schema: frontmatterSchema.extend({ | ||
| index: z.boolean().default(false), | ||
| }), | ||
| }, | ||
| meta: { | ||
| schema: metaSchema.extend({ | ||
| description: z.string().optional(), | ||
| }), | ||
| }, | ||
| }); | ||
|
|
||
| export default defineConfig({ | ||
| mdxOptions: { | ||
| // MDX options | ||
| }, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { DocumentationPage } from "@/src/components/Pages/DocumentationPage"; | ||
|
||
| import { source } from "@/src/source"; | ||
| import type { Metadata } from "next"; | ||
| import { notFound } from "next/navigation"; | ||
|
|
||
| export async function generateStaticParams() { | ||
| return source.generateParams(); | ||
| } | ||
|
|
||
| export async function generateMetadata(props: { | ||
| params: Promise<{ section: string; slug: string[] }>; | ||
| }) { | ||
| const params = await props.params; | ||
|
|
||
| const page = source.getPage([params.section, ...params.slug]); | ||
|
|
||
| if (!page) notFound(); | ||
|
|
||
| return { | ||
| title: page.data.title, | ||
| description: page.data.description, | ||
| } satisfies Metadata; | ||
| } | ||
|
|
||
| export default DocumentationPage; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { LandingPage } from "@/src/components/Pages/LandingPage"; | ||
| import { source } from "@/src/source"; | ||
| import type { Metadata } from "next"; | ||
| import { notFound } from "next/navigation"; | ||
|
|
||
| export async function generateStaticParams() { | ||
| return source.generateParams(); | ||
| } | ||
|
|
||
| export async function generateMetadata(props: { | ||
| params: Promise<{ section: string }>; | ||
| }) { | ||
| const params = await props.params; | ||
| const page = source.getPage([params.section]); | ||
|
|
||
| if (!page) notFound(); | ||
|
|
||
| return { | ||
| title: page.data.title, | ||
| description: page.data.description, | ||
| } satisfies Metadata; | ||
| } | ||
|
|
||
| export default LandingPage; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { docsOptions } from "@/src/config/layout.config"; | ||
| import { DocsLayout } from "fumadocs-ui/layouts/docs"; | ||
| import type { ReactNode } from "react"; | ||
|
|
||
| export default function Layout({ children }: { children: ReactNode }) { | ||
| return <DocsLayout {...docsOptions}>{children}</DocsLayout>; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { baseOptions } from "@/src/config/layout.config"; | ||
| import { HomeLayout } from "fumadocs-ui/layouts/home"; | ||
| import type { ReactNode } from "react"; | ||
|
|
||
| export default function Layout({ children }: { children: ReactNode }) { | ||
| return <HomeLayout {...baseOptions}>{children}</HomeLayout>; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import { Homepage } from "@/src/components/Pages/Homepage"; | ||
aaronbassett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| export default Homepage; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import { source } from "@/src/source"; | ||
| import { createFromSource } from "fumadocs-core/search/server"; | ||
|
|
||
| export const { GET } = createFromSource(source); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { Root as default } from "../components/Root"; | ||
| export { metadata, viewport } from "../metadata"; |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Note that I'm working on moving other apps to using turbopack; I'm not sure how well this will work with turbopack, but in the meantime I think it would be great to roll it out across all our apps (obviously no need to do it in this PR but I'll be curious to see how you use the bundle analyzer and see if we want to leverage it elsewhere, so please let me know your thoughts when you get some more usage)