mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
deps: update docs to latest @hanzo/docs-* packages
Migrate from deprecated @hanzo/mdx + @hanzo/ui to the new @hanzo/docs (16.4.1), @hanzo/docs-mdx (14.2.8), and @hanzo/docs-ui (16.5.3) package stack. Update all import paths to use correct subpath exports and switch CLI from hanzo-mdx to docs-mdx.
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
// source.config.ts
|
||||
import {
|
||||
defineConfig,
|
||||
defineDocs
|
||||
} from "@hanzo/mdx/config";
|
||||
import rehypePrettyCode from "rehype-pretty-code";
|
||||
var source_config_default = defineConfig({
|
||||
mdxOptions: {
|
||||
rehypePlugins: [
|
||||
[
|
||||
rehypePrettyCode,
|
||||
{
|
||||
theme: {
|
||||
dark: "github-dark-dimmed",
|
||||
light: "github-light"
|
||||
},
|
||||
keepBackground: false,
|
||||
defaultLang: "go"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
});
|
||||
var docs = defineDocs({
|
||||
dir: "content/docs"
|
||||
});
|
||||
export {
|
||||
source_config_default as default,
|
||||
docs
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
import { source } from "@/lib/source"
|
||||
import type { Metadata } from "next"
|
||||
import { DocsPage, DocsBody, DocsTitle, DocsDescription, defaultMdxComponents } from "@hanzo/ui"
|
||||
import { DocsPage, DocsBody, DocsTitle, DocsDescription } from "@hanzo/docs-ui/layouts/docs/page"
|
||||
import defaultMdxComponents from "@hanzo/docs-ui/mdx"
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
export default async function Page(props: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { source } from "@/lib/source"
|
||||
import type { ReactNode } from "react"
|
||||
import { DocsLayout } from "@hanzo/ui"
|
||||
import { DocsLayout } from "@hanzo/docs-ui/layouts/docs"
|
||||
|
||||
export default async function Layout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
@import "tailwindcss";
|
||||
@import "fumadocs-ui/style.css";
|
||||
@import "@hanzo/docs-ui/style.css";
|
||||
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import "./global.css"
|
||||
import { RootProvider } from "@hanzo/ui"
|
||||
import { RootProvider } from "@hanzo/docs-ui/provider/next"
|
||||
import { Inter } from "next/font/google"
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
|
||||
+6
-17
@@ -1,18 +1,7 @@
|
||||
import { docs } from "@/.source"
|
||||
import { loader } from "@hanzo/ui"
|
||||
import { docs } from "@/.source/server"
|
||||
import { loader } from "@hanzo/docs/core/source"
|
||||
|
||||
// Create a single source instance that is reused
|
||||
// This prevents circular references and stack overflow issues
|
||||
let _source: ReturnType<typeof loader> | null = null
|
||||
|
||||
export function getSource() {
|
||||
if (!_source) {
|
||||
_source = loader({
|
||||
baseUrl: "/docs",
|
||||
source: docs.toFumadocsSource(),
|
||||
})
|
||||
}
|
||||
return _source
|
||||
}
|
||||
|
||||
export const source = getSource()
|
||||
export const source = loader({
|
||||
baseUrl: "/docs",
|
||||
source: docs.toSource(),
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { MDXComponents } from "mdx/types"
|
||||
import { defaultMdxComponents } from "@hanzo/ui"
|
||||
import defaultMdxComponents from "@hanzo/docs-ui/mdx"
|
||||
|
||||
export function useMDXComponents(components: MDXComponents): MDXComponents {
|
||||
return {
|
||||
|
||||
+5
-4
@@ -4,15 +4,16 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --port 3002",
|
||||
"build": "hanzo-mdx && TURBOPACK=0 next build",
|
||||
"build": "docs-mdx source.config.ts .source && TURBOPACK=0 next build",
|
||||
"export": "TURBOPACK=0 next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"postinstall": "hanzo-mdx"
|
||||
"postinstall": "docs-mdx source.config.ts .source"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hanzo/mdx": "^14.2.0",
|
||||
"@hanzo/ui": "^5.3.28",
|
||||
"@hanzo/docs": "^16.4.1",
|
||||
"@hanzo/docs-mdx": "^14.2.8",
|
||||
"@hanzo/docs-ui": "^16.5.3",
|
||||
"lucide-react": "^0.468.0",
|
||||
"next": "16.0.1",
|
||||
"next-themes": "^0.4.6",
|
||||
|
||||
Generated
+4203
-41
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
defineConfig,
|
||||
defineDocs,
|
||||
} from "@hanzo/mdx/config"
|
||||
} from "@hanzo/docs/mdx/config"
|
||||
import rehypePrettyCode from "rehype-pretty-code"
|
||||
|
||||
export default defineConfig({
|
||||
|
||||
Reference in New Issue
Block a user