Browse Source

chore(dev-hub) Move source to lib

Aditya Arora 2 tháng trước cách đây
mục cha
commit
08c69cb58b

+ 0 - 2
apps/developer-hub/content/docs/express-relay/contract-addresses.mdx

@@ -4,8 +4,6 @@ description: >-
   Express Relay is currently deployed on the following SVM environments:
 ---
 
-import CopyAddress from "../../../src/components/CopyAddress";
-
 <Tabs items={['Production', 'Testing']}>
 <Tab value="production">
 

+ 0 - 2
apps/developer-hub/content/docs/price-feeds/v1/contract-addresses/aptos.mdx

@@ -7,8 +7,6 @@ full: false
 index: false
 ---
 
-import CopyAddress from "../../../../src/components/CopyAddress";
-
 # Price Feed Contract Addresses on Aptos
 
 Pyth is currently deployed on Aptos Mainnet, Aptos Testnet, and Movement devnet.

+ 0 - 2
apps/developer-hub/content/docs/price-feeds/v1/contract-addresses/fuel.mdx

@@ -7,8 +7,6 @@ full: false
 index: false
 ---
 
-import CopyAddress from "../../../../src/components/CopyAddress";
-
 # Price Feed Contract Addresses on Fuel
 
 Pyth is currently deployed on Fuel Mainnet and Fuel Testnet.

+ 0 - 2
apps/developer-hub/content/docs/price-feeds/v1/contract-addresses/movement.mdx

@@ -8,8 +8,6 @@ full: false
 index: false
 ---
 
-import CopyAddress from "../../../../src/components/CopyAddress";
-
 # Price Feed Contract Addresses on Movement
 
 Pyth is currently deployed on the following Movement networks.

+ 0 - 2
apps/developer-hub/content/docs/price-feeds/v1/contract-addresses/solana.mdx

@@ -7,8 +7,6 @@ full: false
 index: false
 ---
 
-import CopyAddress from "../../../../src/components/CopyAddress";
-
 # Program Addresses on Solana and other SVM chains
 
 The Pyth Oracle consists of two different programs.

+ 0 - 2
apps/developer-hub/content/docs/price-feeds/v1/contract-addresses/starknet.mdx

@@ -7,8 +7,6 @@ full: false
 index: false
 ---
 
-import CopyAddress from "../../../../src/components/CopyAddress";
-
 # Price Feed Contract Addresses on Starknet
 
 Pyth is deployed on both Starknet Mainnet and Testnet.

+ 0 - 2
apps/developer-hub/content/docs/price-feeds/v1/contract-addresses/ton.mdx

@@ -7,8 +7,6 @@ full: false
 index: false
 ---
 
-import CopyAddress from "../../../../src/components/CopyAddress";
-
 # Price Feed Contract Addresses on TON
 
 Pyth is currently deployed on TON Mainnet and TON Testnet.

+ 3 - 0
apps/developer-hub/package.json

@@ -37,7 +37,10 @@
     "react-aria": "catalog:",
     "react-dom": "catalog:",
     "rehype-katex": "^7.0.1",
+    "remark": "^15.0.1",
+    "remark-gfm": "^4.0.1",
     "remark-math": "^6.0.0",
+    "remark-mdx": "^3.1.1",
     "viem": "catalog:",
     "zod": "catalog:",
     "zod-validation-error": "catalog:"

+ 1 - 1
apps/developer-hub/src/app/(docs)/[section]/[...slug]/page.tsx

@@ -2,7 +2,7 @@ export { DocumentationPage as default } from "../../../../components/Pages/Docum
 import type { Metadata } from "next";
 import { notFound } from "next/navigation";
 
-import { source } from "../../../../source";
+import { source } from "../../../../lib/source";
 
 export function generateStaticParams() {
   return source.generateParams();

+ 1 - 1
apps/developer-hub/src/app/(docs)/[section]/page.tsx

@@ -2,7 +2,7 @@ export { LandingPage as default } from "../../../components/Pages/LandingPage";
 import type { Metadata } from "next";
 import { notFound } from "next/navigation";
 
-import { source } from "../../../source";
+import { source } from "../../../lib/source";
 
 export function generateStaticParams() {
   return source.generateParams();

+ 1 - 1
apps/developer-hub/src/app/api/search/route.ts

@@ -1,5 +1,5 @@
 import { createFromSource } from "fumadocs-core/search/server";
 
-import { source } from "../../../source";
+import { source } from "../../../lib/source";
 
 export const { GET } = createFromSource(source);

+ 1 - 1
apps/developer-hub/src/app/layout.tsx

@@ -2,7 +2,7 @@ import type { ReactNode } from "react";
 
 import { Root } from "../components/Root";
 
-export { metadata, viewport } from "../metadata";
+export { metadata, viewport } from "../lib/metadata";
 
 import "katex/dist/katex.css";
 

+ 2 - 1
apps/developer-hub/src/components/Pages/BasePage/index.tsx

@@ -6,8 +6,9 @@ import {
 } from "fumadocs-ui/page";
 import { notFound } from "next/navigation";
 
+import { source } from "../../../lib/source";
 import { getMDXComponents } from "../../../mdx-components";
-import { source } from "../../../source";
+
 
 export function BasePage(props: { params: { slug: string[] } }) {
   const page = source.getPage(props.params.slug);

+ 1 - 1
apps/developer-hub/src/config/layout.config.tsx

@@ -1,7 +1,7 @@
 import type { DocsLayoutProps } from "fumadocs-ui/layouts/docs";
 import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
 
-import { source } from "../source";
+import { source } from "../lib/source";
 
 export const baseOptions: BaseLayoutProps = {
   nav: {

+ 27 - 0
apps/developer-hub/src/lib/get-llm-text.ts

@@ -0,0 +1,27 @@
+// import fs from 'node:fs/promises';
+
+// import type { InferPageType } from 'fumadocs-core/source';
+// import { remarkInclude } from 'fumadocs-mdx/config';
+// import { remark } from 'remark';
+// import remarkGfm from 'remark-gfm';
+// import remarkMdx from 'remark-mdx';
+
+// import { source } from './source';
+
+// const processor = remark()
+//   .use(remarkMdx)
+//   .use(remarkInclude)
+//   .use(remarkGfm)
+
+// export async function getLLMText(page: InferPageType<typeof source>) {
+//   const processed = await processor.process({
+//     path: page.absolutePath,
+//     value: await fs.readFile(page.absolutePath, 'utf8'),
+//   });
+
+//   // note: it doesn't escape frontmatter, it's up to you.
+//   return `# ${page.data.title}
+// URL: ${page.url}
+
+// ${processed.value}`;
+// }

+ 0 - 0
apps/developer-hub/src/metadata.ts → apps/developer-hub/src/lib/metadata.ts


+ 1 - 1
apps/developer-hub/src/source.ts → apps/developer-hub/src/lib/source.ts

@@ -24,7 +24,7 @@ import type { InferMetaType, InferPageType } from "fumadocs-core/source";
 import { loader } from "fumadocs-core/source";
 import { createElement } from "react";
 
-import { docs } from "../.source";
+import { docs } from "../../.source";
 
 const icons: Record<string, React.ComponentType> = {
   CardsThree,

+ 1 - 1
lazer/contracts/solana/Cargo.lock

@@ -3293,7 +3293,7 @@ dependencies = [
 
 [[package]]
 name = "pyth-lazer-protocol"
-version = "0.12.0"
+version = "0.14.0"
 dependencies = [
  "anyhow",
  "byteorder",