ardo 2.7.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FileTree-gHRnoz7O.d.ts → FileTree-K0YVFXhg.d.ts} +16 -5
- package/dist/{chunk-WSEWAHW3.js → chunk-DEHRVW7C.js} +209 -179
- package/dist/chunk-DEHRVW7C.js.map +1 -0
- package/dist/{chunk-CYZLI4AU.js → chunk-PGHUPTGL.js} +3 -3
- package/dist/chunk-PGHUPTGL.js.map +1 -0
- package/dist/{chunk-2JWOR7PG.js → chunk-TDBU2FXP.js} +2 -2
- package/dist/{chunk-6MXVILOZ.js → chunk-UWFMFHRD.js} +95 -57
- package/dist/chunk-UWFMFHRD.js.map +1 -0
- package/dist/{chunk-KOYIKUSW.js → chunk-Y46KCHBO.js} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/mdx/provider.js +1 -1
- package/dist/typedoc/index.js +2 -2
- package/dist/ui/index.d.ts +19 -3
- package/dist/ui/index.js +4 -2
- package/dist/ui/styles.css +7 -0
- package/dist/vite/index.d.ts +8 -1
- package/dist/vite/index.js +4 -2
- package/package.json +4 -6
- package/dist/chunk-6MXVILOZ.js.map +0 -1
- package/dist/chunk-CYZLI4AU.js.map +0 -1
- package/dist/chunk-WSEWAHW3.js.map +0 -1
- /package/dist/{chunk-2JWOR7PG.js.map → chunk-TDBU2FXP.js.map} +0 -0
- /package/dist/{chunk-KOYIKUSW.js.map → chunk-Y46KCHBO.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/vite/plugin.ts","../src/markdown/shiki.ts","../src/vite/routes-plugin.ts","../src/vite/codeblock-plugin.ts","../src/runtime/loader.ts","../src/markdown/pipeline.ts","../src/markdown/toc.ts","../src/markdown/links.ts","../src/runtime/sidebar.ts"],"sourcesContent":["import type { Plugin, UserConfig } from \"vite\"\nimport type { ArdoConfig, ProjectMeta, ResolvedConfig } from \"../config/types\"\nimport type { TypeDocConfig } from \"../typedoc/types\"\nimport { resolveConfig, defaultMarkdownConfig } from \"../config/index\"\nimport { generateApiDocs } from \"../typedoc/generator\"\nimport { reactRouter } from \"@react-router/dev/vite\"\nimport mdx from \"@mdx-js/rollup\"\nimport remarkFrontmatter from \"remark-frontmatter\"\nimport remarkMdxFrontmatter from \"remark-mdx-frontmatter\"\nimport remarkGfm from \"remark-gfm\"\nimport rehypeShiki from \"@shikijs/rehype\"\nimport { ardoLineTransformer, remarkCodeMeta } from \"../markdown/shiki\"\nimport fs from \"fs/promises\"\nimport fsSync from \"fs\"\nimport path from \"path\"\nimport { execSync } from \"child_process\"\nimport matter from \"gray-matter\"\nimport { ardoRoutesPlugin, type ArdoRoutesPluginOptions } from \"./routes-plugin\"\nimport { ardoCodeBlockPlugin } from \"./codeblock-plugin\"\n\n/**\n * Finds the package root by looking for package.json in parent directories.\n * Returns the path relative to cwd, or undefined if not found.\n */\nfunction findPackageRoot(cwd: string): string | undefined {\n let dir = path.resolve(cwd)\n const root = path.parse(dir).root\n\n while (dir !== root) {\n const parentDir = path.dirname(dir)\n const packageJsonPath = path.join(parentDir, \"package.json\")\n\n if (fsSync.existsSync(packageJsonPath)) {\n // Return relative path from cwd to parent\n return path.relative(cwd, parentDir) || \".\"\n }\n\n dir = parentDir\n }\n\n return undefined\n}\n\n/**\n * Detects the GitHub repository name from git remote URL.\n * Returns the repo name (e.g., 'ardo' from 'github.com/sebastian-software/ardo')\n * or undefined if not a GitHub repo.\n */\nfunction detectGitHubRepoName(cwd: string): string | undefined {\n try {\n const remoteUrl = execSync(\"git remote get-url origin\", {\n cwd,\n encoding: \"utf-8\",\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n }).trim()\n\n // Parse GitHub URL (supports both HTTPS and SSH)\n // https://github.com/user/repo.git\n // git@github.com:user/repo.git\n const match = remoteUrl.match(/github\\.com[/:][\\w-]+\\/([\\w.-]+?)(?:\\.git)?$/)\n return match?.[1]\n } catch {\n return undefined\n }\n}\n\n/**\n * Detects the current short git commit hash.\n */\nfunction detectGitHash(cwd: string): string | undefined {\n try {\n return execSync(\"git rev-parse --short HEAD\", {\n cwd,\n encoding: \"utf-8\",\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n }).trim()\n } catch {\n return undefined\n }\n}\n\n/**\n * Reads project metadata from the nearest package.json.\n */\nfunction readProjectMeta(root: string): ProjectMeta {\n const pkgPath = path.join(root, \"package.json\")\n try {\n const raw = fsSync.readFileSync(pkgPath, \"utf-8\")\n const pkg = JSON.parse(raw)\n\n let repository: string | undefined\n if (typeof pkg.repository === \"string\") {\n repository = pkg.repository\n } else if (pkg.repository?.url) {\n // Normalize git+https://... or git://... URLs\n repository = pkg.repository.url\n .replace(/^git\\+/, \"\")\n .replace(/^git:\\/\\//, \"https://\")\n .replace(/\\.git$/, \"\")\n }\n\n let author: string | undefined\n if (typeof pkg.author === \"string\") {\n author = pkg.author\n } else if (pkg.author?.name) {\n author = pkg.author.name\n }\n\n return {\n name: pkg.name,\n homepage: pkg.homepage,\n repository,\n version: pkg.version,\n author,\n license: pkg.license,\n }\n } catch {\n return {}\n }\n}\n\n/**\n * Recursively copies files from src to dest, overwriting existing files.\n */\nfunction copyRecursive(src: string, dest: string) {\n const stat = fsSync.statSync(src)\n\n if (stat.isDirectory()) {\n if (!fsSync.existsSync(dest)) {\n fsSync.mkdirSync(dest, { recursive: true })\n }\n for (const item of fsSync.readdirSync(src)) {\n copyRecursive(path.join(src, item), path.join(dest, item))\n }\n } else {\n fsSync.copyFileSync(src, dest)\n }\n}\n\n/**\n * Detects the GitHub Pages basename from the git remote URL.\n * Returns `\"/repo-name/\"` if a GitHub repo is detected, otherwise `undefined`.\n *\n * Use this in `react-router.config.ts` to synchronize client-side routing\n * with the Vite `base` path that Ardo auto-detects:\n *\n * ```ts\n * import { detectGitHubBasename } from \"ardo/vite\"\n *\n * export default {\n * ssr: false,\n * prerender: true,\n * basename: detectGitHubBasename(),\n * } satisfies Config\n * ```\n */\nexport function detectGitHubBasename(cwd?: string): string {\n if (process.env.NODE_ENV !== \"production\") {\n return \"/\"\n }\n const repoName = detectGitHubRepoName(cwd || process.cwd())\n return repoName ? `/${repoName}/` : \"/\"\n}\n\nconst VIRTUAL_MODULE_ID = \"virtual:ardo/config\"\nconst RESOLVED_VIRTUAL_MODULE_ID = \"\\0\" + VIRTUAL_MODULE_ID\n\nconst VIRTUAL_SIDEBAR_ID = \"virtual:ardo/sidebar\"\nconst RESOLVED_VIRTUAL_SIDEBAR_ID = \"\\0\" + VIRTUAL_SIDEBAR_ID\n\nconst VIRTUAL_SEARCH_ID = \"virtual:ardo/search-index\"\nconst RESOLVED_VIRTUAL_SEARCH_ID = \"\\0\" + VIRTUAL_SEARCH_ID\n\n// Module-level flags to prevent duplicate operations across plugin instances\n// This is necessary because React Router creates multiple Vite instances\nlet typedocGenerated = false\nlet flattenExecuted = false\n\nexport interface ArdoPluginOptions extends Partial<ArdoConfig> {\n /** Options for the routes generator plugin */\n routes?: ArdoRoutesPluginOptions | false\n /**\n * Auto-detect GitHub repository and set base path for GitHub Pages.\n * When true, automatically sets `base: '/repo-name/'` if deploying to GitHub Pages.\n * @default true\n */\n githubPages?: boolean\n /**\n * Directory where routes are located.\n * @default \"./app/routes\"\n */\n routesDir?: string\n}\n\nexport function ardoPlugin(options: ArdoPluginOptions = {}): Plugin[] {\n let resolvedConfig: ResolvedConfig\n let routesDir: string\n\n // Extract ardo-specific options from the rest (which is ArdoConfig)\n const {\n routes,\n typedoc,\n githubPages = true,\n routesDir: routesDirOption,\n ...pressConfig\n } = options\n\n const mainPlugin: Plugin = {\n name: \"ardo\",\n enforce: \"pre\",\n\n config(userConfig, env): UserConfig {\n const root = userConfig.root || process.cwd()\n routesDir = routesDirOption || path.join(root, \"app\", \"routes\")\n\n const result: UserConfig = {\n define: {\n __BUILD_TIME__: JSON.stringify(new Date().toISOString()),\n },\n optimizeDeps: {\n exclude: [\"ardo/ui/styles.css\"],\n },\n ssr: {\n noExternal: [\"ardo\"],\n },\n }\n\n // Auto-detect GitHub Pages base path for production builds\n if (githubPages && env.command === \"build\" && !userConfig.base) {\n const repoName = detectGitHubRepoName(root)\n if (repoName) {\n result.base = `/${repoName}/`\n console.log(`[ardo] GitHub Pages detected, using base: ${result.base}`)\n }\n }\n\n return result\n },\n\n async configResolved(config) {\n const root = config.root\n routesDir = routesDirOption || path.join(root, \"app\", \"routes\")\n\n // Auto-detect project metadata from package.json\n const detectedProject = readProjectMeta(root)\n const project: ProjectMeta = { ...detectedProject, ...pressConfig.project }\n\n const defaultConfig: ArdoConfig = {\n title: pressConfig.title ?? \"Ardo\",\n description: pressConfig.description ?? \"Documentation powered by Ardo\",\n }\n\n // For React Router, contentDir is the routes directory\n const configWithRoutes = {\n ...defaultConfig,\n ...pressConfig,\n project,\n srcDir: routesDir,\n }\n\n resolvedConfig = resolveConfig(configWithRoutes, root)\n },\n\n resolveId(id) {\n if (id === VIRTUAL_MODULE_ID) {\n return RESOLVED_VIRTUAL_MODULE_ID\n }\n if (id === VIRTUAL_SIDEBAR_ID) {\n return RESOLVED_VIRTUAL_SIDEBAR_ID\n }\n if (id === VIRTUAL_SEARCH_ID) {\n return RESOLVED_VIRTUAL_SEARCH_ID\n }\n },\n\n async load(id) {\n if (id === RESOLVED_VIRTUAL_MODULE_ID) {\n const clientConfig = {\n title: resolvedConfig.title,\n description: resolvedConfig.description,\n base: resolvedConfig.base,\n lang: resolvedConfig.lang,\n themeConfig: resolvedConfig.themeConfig,\n project: resolvedConfig.project,\n buildTime: new Date().toISOString(),\n buildHash: detectGitHash(resolvedConfig.root),\n }\n return `export default ${JSON.stringify(clientConfig)}`\n }\n\n if (id === RESOLVED_VIRTUAL_SIDEBAR_ID) {\n const sidebar = await generateSidebar(resolvedConfig, routesDir)\n return `export default ${JSON.stringify(sidebar)}`\n }\n\n if (id === RESOLVED_VIRTUAL_SEARCH_ID) {\n const searchIndex = await generateSearchIndex(routesDir)\n return `export default ${JSON.stringify(searchIndex)}`\n }\n },\n\n transform(code, id) {\n // Only process .mdx/.md files inside the routes directory\n if (!/\\.(mdx|md)$/.test(id)) return\n if (!id.startsWith(routesDir)) return\n\n // Skip if the file already exports a meta function\n if (/export\\s+(const|function)\\s+meta\\b/.test(code)) return\n\n // Extract frontmatter values from the compiled MDX export\n const titleMatch = code.match(\n /export\\s+const\\s+frontmatter\\s*=\\s*\\{[^}]*title\\s*:\\s*\"([^\"]*)\"/\n )\n const descMatch = code.match(\n /export\\s+const\\s+frontmatter\\s*=\\s*\\{[^}]*description\\s*:\\s*\"([^\"]*)\"/\n )\n\n const pageTitle = titleMatch?.[1]\n if (!pageTitle) return\n\n const siteTitle = resolvedConfig.title\n const separator = resolvedConfig.titleSeparator\n const fullTitle = `${pageTitle}${separator}${siteTitle}`\n const description = descMatch?.[1]\n\n const metaEntries = [`{ title: ${JSON.stringify(fullTitle)} }`]\n if (description) {\n metaEntries.push(`{ name: \"description\", content: ${JSON.stringify(description)} }`)\n }\n\n return {\n code: `${code}\\nexport const meta = () => [${metaEntries.join(\", \")}];\\n`,\n map: null,\n }\n },\n }\n\n const plugins: Plugin[] = [mainPlugin]\n\n // Add routes plugin unless explicitly disabled\n if (routes !== false) {\n plugins.push(\n ardoRoutesPlugin({\n routesDir: routesDirOption,\n ...routes,\n })\n )\n }\n\n // Add TypeDoc plugin if enabled\n if (typedoc) {\n // Find package root to use as default entry point and tsconfig base\n const packageRoot = findPackageRoot(process.cwd())\n const defaultEntryPoint = packageRoot ? `${packageRoot}/src/index.ts` : \"./src/index.ts\"\n const defaultTsconfig = packageRoot ? `${packageRoot}/tsconfig.json` : \"./tsconfig.json\"\n\n const defaultTypedocConfig: TypeDocConfig = {\n enabled: true,\n entryPoints: [defaultEntryPoint],\n tsconfig: defaultTsconfig,\n out: \"api-reference\",\n excludePrivate: true,\n excludeInternal: true,\n }\n\n const typedocConfig: TypeDocConfig =\n typedoc === true ? defaultTypedocConfig : { ...defaultTypedocConfig, ...typedoc }\n\n const typedocPlugin: Plugin = {\n name: \"ardo:typedoc\",\n\n async buildStart() {\n // Use module-level flag to prevent duplicate generation across plugin instances\n if (typedocGenerated || !typedocConfig.enabled) {\n return\n }\n\n console.log(\"[ardo] Generating API documentation with TypeDoc...\")\n const startTime = Date.now()\n try {\n const outputDir = routesDirOption || \"./app/routes\"\n const docs = await generateApiDocs(typedocConfig, outputDir)\n const duration = Date.now() - startTime\n console.log(`[ardo] Generated ${docs.length} API documentation pages in ${duration}ms`)\n } catch (error) {\n console.warn(\"[ardo] TypeDoc generation failed. API documentation will not be available.\")\n console.warn(\"[ardo] Check your typedoc.entryPoints configuration.\")\n if (error instanceof Error) {\n console.warn(`[ardo] Error: ${error.message}`)\n }\n }\n typedocGenerated = true\n },\n }\n\n plugins.unshift(typedocPlugin)\n }\n\n // Add CodeBlock highlight plugin for .tsx/.jsx files\n plugins.push(ardoCodeBlockPlugin(pressConfig.markdown))\n\n // Add MDX plugin with Ardo's markdown pipeline\n // Apply default theme if user didn't configure one\n const themeConfig = pressConfig.markdown?.theme ?? defaultMarkdownConfig.theme\n const hasThemeObject = themeConfig && typeof themeConfig === \"object\" && \"light\" in themeConfig\n const lineNumbers = pressConfig.markdown?.lineNumbers || false\n\n // Build shiki options with Ardo's custom line transformer\n // Theme defaults are guaranteed by resolveConfig (defaultMarkdownConfig)\n const shikiOptions = hasThemeObject\n ? {\n themes: {\n light: themeConfig.light,\n dark: themeConfig.dark,\n },\n defaultColor: false as const,\n transformers: [ardoLineTransformer({ globalLineNumbers: lineNumbers })],\n }\n : {\n theme: themeConfig as string,\n transformers: [ardoLineTransformer({ globalLineNumbers: lineNumbers })],\n }\n\n const mdxPlugin = mdx({\n include: /\\.(md|mdx)$/,\n remarkPlugins: [\n remarkFrontmatter,\n [remarkMdxFrontmatter, { name: \"frontmatter\" }],\n remarkGfm,\n remarkCodeMeta,\n ],\n rehypePlugins: [[rehypeShiki, shikiOptions]],\n providerImportSource: \"ardo/mdx-provider\",\n })\n plugins.push(mdxPlugin as Plugin)\n\n // Add React Router Framework plugin (includes React plugin internally)\n const reactRouterPlugin = reactRouter()\n const reactRouterPlugins = (\n Array.isArray(reactRouterPlugin) ? reactRouterPlugin : [reactRouterPlugin]\n ).filter((p): p is Plugin => p != null)\n plugins.push(...reactRouterPlugins)\n\n // Add flatten plugin for GitHub Pages (must run after React Router build)\n if (githubPages) {\n let detectedBase: string | undefined\n\n const flattenPlugin: Plugin = {\n name: \"ardo:flatten-github-pages\",\n enforce: \"post\",\n\n configResolved(config) {\n if (config.base && config.base !== \"/\") {\n detectedBase = config.base\n }\n },\n\n closeBundle() {\n if (flattenExecuted || !detectedBase) {\n return\n }\n\n // Strip leading/trailing slashes to get the directory name\n const baseName = detectedBase.replace(/^\\/|\\/$/g, \"\")\n if (!baseName) return\n\n const buildDir = path.join(process.cwd(), \"build\", \"client\")\n const nestedDir = path.join(buildDir, baseName)\n\n if (!fsSync.existsSync(nestedDir)) {\n return\n }\n\n console.log(`[ardo] Flattening build/client/${baseName}/ to build/client/ for GitHub Pages`)\n copyRecursive(nestedDir, buildDir)\n fsSync.rmSync(nestedDir, { recursive: true, force: true })\n console.log(\"[ardo] Build output flattened successfully.\")\n\n flattenExecuted = true\n },\n }\n\n plugins.push(flattenPlugin)\n }\n\n return plugins\n}\n\nasync function generateSidebar(config: ResolvedConfig, routesDir: string) {\n const { themeConfig } = config\n\n if (themeConfig.sidebar && !Array.isArray(themeConfig.sidebar)) {\n return themeConfig.sidebar\n }\n\n if (themeConfig.sidebar && Array.isArray(themeConfig.sidebar) && themeConfig.sidebar.length > 0) {\n return themeConfig.sidebar\n }\n\n try {\n const sidebar = await scanDirectory(routesDir, routesDir)\n return sidebar\n } catch {\n return []\n }\n}\n\nasync function scanDirectory(\n dir: string,\n rootDir: string\n): Promise<Array<{ text: string; link?: string; items?: unknown[] }>> {\n const entries = await fs.readdir(dir, { withFileTypes: true })\n const items: Array<{ text: string; link?: string; items?: unknown[]; order?: number }> = []\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n const relativePath = path.relative(rootDir, fullPath)\n\n if (entry.isDirectory()) {\n const children = await scanDirectory(fullPath, rootDir)\n if (children.length > 0) {\n // Check for index.mdx in the directory\n const indexPath = path.join(fullPath, \"index.mdx\")\n let link: string | undefined\n\n try {\n await fs.access(indexPath)\n link = \"/\" + relativePath.replace(/\\\\/g, \"/\")\n } catch {\n // No index.mdx\n }\n\n items.push({\n text: formatTitle(entry.name),\n link,\n items: children,\n })\n }\n } else if (\n (entry.name.endsWith(\".mdx\") || entry.name.endsWith(\".md\")) &&\n entry.name !== \"index.mdx\" &&\n entry.name !== \"index.md\"\n ) {\n const fileContent = await fs.readFile(fullPath, \"utf-8\")\n const { data: frontmatter } = matter(fileContent)\n\n const ext = entry.name.endsWith(\".mdx\") ? \".mdx\" : \".md\"\n const title = frontmatter.title || formatTitle(entry.name.replace(ext, \"\"))\n const order: number | undefined =\n typeof frontmatter.order === \"number\" ? frontmatter.order : undefined\n\n const link = \"/\" + relativePath.replace(ext, \"\").replace(/\\\\/g, \"/\")\n\n items.push({\n text: title,\n link,\n order,\n })\n }\n }\n\n items.sort((a, b) => {\n if (a.order !== undefined && b.order !== undefined) {\n return a.order - b.order\n }\n if (a.order !== undefined) return -1\n if (b.order !== undefined) return 1\n return a.text.localeCompare(b.text)\n })\n\n return items.map(({ order: _order, ...item }) => item)\n}\n\nfunction formatTitle(name: string): string {\n return name.replace(/[-_]/g, \" \").replace(/\\b\\w/g, (c) => c.toUpperCase())\n}\n\ninterface SearchDoc {\n id: string\n title: string\n content: string\n path: string\n section?: string\n}\n\nasync function generateSearchIndex(routesDir: string): Promise<SearchDoc[]> {\n const docs: SearchDoc[] = []\n\n async function scanForSearch(dir: string, section?: string): Promise<void> {\n try {\n const entries = await fs.readdir(dir, { withFileTypes: true })\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n\n if (entry.isDirectory()) {\n // Use directory name as section for nested content\n const newSection = section\n ? `${section} > ${formatTitle(entry.name)}`\n : formatTitle(entry.name)\n await scanForSearch(fullPath, newSection)\n } else if (entry.name.endsWith(\".mdx\") || entry.name.endsWith(\".md\")) {\n const relativePath = path.relative(routesDir, fullPath)\n const fileContent = await fs.readFile(fullPath, \"utf-8\")\n\n // Extract frontmatter\n const { data: frontmatter, content: rawContent } = matter(fileContent)\n const ext = entry.name.endsWith(\".mdx\") ? \".mdx\" : \".md\"\n const title = frontmatter.title || formatTitle(entry.name.replace(ext, \"\"))\n let content = rawContent\n\n // Clean up content: remove markdown/MDX syntax, keep text\n content = content\n .replace(/```[\\s\\S]*?```/g, \"\") // Remove code blocks\n .replace(/`[^`]+`/g, \"\") // Remove inline code\n .replace(/import\\s+.*?from\\s+['\"].*?['\"]/g, \"\") // Remove imports\n .replace(/<[^>]+>/g, \"\") // Remove JSX tags\n .replace(/\\[([^\\]]+)\\]\\([^)]+\\)/g, \"$1\") // Links to text\n .replace(/[#*_~>]/g, \"\") // Remove markdown symbols\n .replace(/\\n+/g, \" \") // Newlines to spaces\n .replace(/\\s+/g, \" \") // Multiple spaces to single\n .trim()\n .slice(0, 2000) // Limit content size\n\n // Generate path for the route\n const routePath =\n entry.name === \"index.mdx\" || entry.name === \"index.md\"\n ? \"/\" + path.dirname(relativePath).replace(/\\\\/g, \"/\")\n : \"/\" + relativePath.replace(ext, \"\").replace(/\\\\/g, \"/\")\n\n // Skip root index (use \"/\" as path)\n const finalPath = routePath === \"/.\" ? \"/\" : routePath\n\n docs.push({\n id: relativePath,\n title,\n content,\n path: finalPath,\n section,\n })\n }\n }\n } catch (error) {\n console.warn(\n \"[ardo] Failed to scan for search index:\",\n error instanceof Error ? error.message : error\n )\n }\n }\n\n await scanForSearch(routesDir)\n return docs\n}\n\nexport default ardoPlugin\n","import {\n createHighlighter,\n type Highlighter,\n type BundledTheme,\n type ShikiTransformer,\n} from \"shiki\"\nimport type { Root, Element, Text } from \"hast\"\nimport { visit } from \"unist-util-visit\"\nimport type { MarkdownConfig } from \"../config/types\"\n\nexport type ShikiHighlighter = Highlighter\n\n/** Default Ardo themes used when no config is provided */\nconst DEFAULT_THEMES = {\n light: \"github-light-default\" as BundledTheme,\n dark: \"github-dark-default\" as BundledTheme,\n}\n\nlet cachedHighlighter: ShikiHighlighter | undefined\n\n/**\n * Highlights code using Shiki with Ardo's default themes.\n * Creates and caches a highlighter instance for reuse.\n */\nexport async function highlightCode(\n code: string,\n language: string,\n options?: { theme?: MarkdownConfig[\"theme\"] }\n): Promise<string> {\n const themeConfig = options?.theme ?? DEFAULT_THEMES\n\n if (!cachedHighlighter) {\n cachedHighlighter = await createShikiHighlighter({\n theme: themeConfig,\n lineNumbers: false,\n anchor: false,\n toc: { level: [2, 3] },\n })\n }\n\n if (typeof themeConfig === \"string\") {\n return cachedHighlighter.codeToHtml(code, { lang: language, theme: themeConfig })\n }\n\n return cachedHighlighter.codeToHtml(code, {\n lang: language,\n themes: { light: themeConfig.light, dark: themeConfig.dark },\n defaultColor: false,\n })\n}\n\nexport async function createShikiHighlighter(config: MarkdownConfig): Promise<ShikiHighlighter> {\n const themeConfig = config.theme!\n\n const themes: BundledTheme[] =\n typeof themeConfig === \"string\" ? [themeConfig] : [themeConfig.light, themeConfig.dark]\n\n const highlighter = await createHighlighter({\n themes,\n langs: [\n // Web fundamentals\n \"javascript\",\n \"typescript\",\n \"jsx\",\n \"tsx\",\n \"html\",\n \"css\",\n \"scss\",\n\n // Data & config formats\n \"json\",\n \"jsonc\",\n \"yaml\",\n \"toml\",\n \"xml\",\n \"graphql\",\n\n // Markdown & docs\n \"markdown\",\n \"mdx\",\n\n // Shell & DevOps\n \"bash\",\n \"shell\",\n \"dockerfile\",\n\n // General purpose\n \"python\",\n \"rust\",\n \"go\",\n \"sql\",\n \"diff\",\n ],\n })\n\n return highlighter\n}\n\ninterface RehypeShikiOptions {\n highlighter: ShikiHighlighter\n config: MarkdownConfig\n}\n\nexport function rehypeShikiFromHighlighter(options: RehypeShikiOptions) {\n const { highlighter, config } = options\n\n const themeConfig = config.theme!\n\n return function (tree: Root) {\n visit(tree, \"element\", (node: Element, index, parent) => {\n if (\n node.tagName !== \"pre\" ||\n !node.children[0] ||\n (node.children[0] as Element).tagName !== \"code\"\n ) {\n return\n }\n\n const codeNode = node.children[0] as Element\n const className = (codeNode.properties?.className as string[]) || []\n const langClass = className.find((c) => c.startsWith(\"language-\"))\n const lang = langClass ? langClass.replace(\"language-\", \"\") : \"text\"\n\n const codeContent = getTextContent(codeNode)\n\n if (!codeContent.trim()) {\n return\n }\n\n try {\n let html: string\n\n if (typeof themeConfig === \"string\") {\n html = highlighter.codeToHtml(codeContent, {\n lang,\n theme: themeConfig,\n })\n } else {\n html = highlighter.codeToHtml(codeContent, {\n lang,\n themes: {\n light: themeConfig.light,\n dark: themeConfig.dark,\n },\n defaultColor: false,\n })\n }\n\n const metaString = (codeNode.properties?.metastring as string) || \"\"\n const lineNumbers = config.lineNumbers || metaString.includes(\"showLineNumbers\")\n const highlightLines = parseHighlightLines(metaString)\n const title = parseTitle(metaString)\n\n const wrapperHtml = buildCodeBlockHtml(html, {\n lang,\n lineNumbers,\n highlightLines,\n title,\n })\n\n if (parent && typeof index === \"number\") {\n const newNode: Element = {\n type: \"element\",\n tagName: \"div\",\n properties: {\n className: [\"ardo-code-block\"],\n \"data-lang\": lang,\n },\n children: [\n {\n type: \"raw\",\n value: wrapperHtml,\n } as unknown as Element,\n ],\n }\n parent.children[index] = newNode\n }\n } catch {\n // If highlighting fails, leave the node unchanged\n }\n })\n }\n}\n\nfunction getTextContent(node: Element | Text): string {\n if (node.type === \"text\") {\n return node.value\n }\n if (\"children\" in node) {\n return node.children.map((child) => getTextContent(child as Element | Text)).join(\"\")\n }\n return \"\"\n}\n\nfunction parseHighlightLines(meta: string): number[] {\n const match = meta.match(/\\{([\\d,-]+)\\}/)\n if (!match) return []\n\n const ranges = match[1].split(\",\")\n const lines: number[] = []\n\n for (const range of ranges) {\n if (range.includes(\"-\")) {\n const [start, end] = range.split(\"-\").map(Number)\n for (let i = start; i <= end; i++) {\n lines.push(i)\n }\n } else {\n lines.push(Number(range))\n }\n }\n\n return lines\n}\n\nfunction parseTitle(meta: string): string | undefined {\n const match = meta.match(/title=\"([^\"]+)\"/)\n return match ? match[1] : undefined\n}\n\ninterface CodeBlockOptions {\n lang: string\n lineNumbers: boolean\n highlightLines: number[]\n title?: string\n}\n\nfunction buildCodeBlockHtml(shikiHtml: string, options: CodeBlockOptions): string {\n const { lang, lineNumbers, highlightLines, title } = options\n\n let html = \"\"\n\n if (title) {\n html += `<div class=\"ardo-code-title\">${escapeHtml(title)}</div>`\n }\n\n html += `<div class=\"ardo-code-wrapper\" data-lang=\"${lang}\">`\n\n if (lineNumbers || highlightLines.length > 0) {\n const lines = shikiHtml.split(\"\\n\")\n const processedHtml = lines\n .map((line, i) => {\n const lineNum = i + 1\n const isHighlighted = highlightLines.includes(lineNum)\n const classes = [\"ardo-code-line\"]\n if (isHighlighted) classes.push(\"highlighted\")\n\n let prefix = \"\"\n if (lineNumbers) {\n prefix = `<span class=\"ardo-line-number\">${lineNum}</span>`\n }\n\n return `<span class=\"${classes.join(\" \")}\">${prefix}${line}</span>`\n })\n .join(\"\\n\")\n\n html += processedHtml\n } else {\n html += shikiHtml\n }\n\n html += `<button class=\"ardo-copy-button\" data-code=\"${encodeURIComponent(extractCodeFromHtml(shikiHtml))}\">\n <span class=\"ardo-copy-icon\">Copy</span>\n <span class=\"ardo-copied-icon\" style=\"display:none\">Copied!</span>\n </button>`\n\n html += \"</div>\"\n\n return html\n}\n\nfunction extractCodeFromHtml(html: string): string {\n return html\n .replace(/<[^>]+>/g, \"\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/&/g, \"&\")\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n}\n\nfunction escapeHtml(text: string): string {\n return text\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\")\n}\n\n/**\n * Remark plugin that extracts code fence meta info and stores it as HAST\n * data attributes before MDX compilation can corrupt it.\n *\n * MDX treats `{...}` in code fence meta as JSX expressions, which corrupts\n * both the meta and the code content. This plugin strips the meta and\n * stores parsed info as `data-ardo-*` attributes that survive MDX.\n */\nexport function remarkCodeMeta() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (tree: any) {\n visit(tree, \"code\", (node: { meta?: string | null; data?: Record<string, unknown> }) => {\n if (!node.meta) return\n\n const meta = node.meta\n const data = node.data || (node.data = {})\n const hProperties = (data.hProperties as Record<string, unknown>) || {}\n\n // Preserve meta as metastring property on the <code> HAST element.\n // @shikijs/rehype reads head.properties.metastring and passes it\n // to Shiki as meta.__raw, which ardoLineTransformer reads.\n hProperties.metastring = meta\n data.hProperties = hProperties\n\n // Strip meta from the MDAST node to prevent MDX from\n // misinterpreting {expressions} like {2,4-5} as JSX\n node.meta = null\n })\n }\n}\n\n/**\n * Shiki transformer that adds Ardo-specific line classes, highlighting,\n * line numbers, and title attributes to code blocks.\n *\n * Used with @shikijs/rehype in the MDX pipeline where proper HAST nodes\n * are required (raw HTML nodes cause \"Cannot handle unknown node `raw`\" errors).\n */\ninterface ArdoLineTransformerOptions {\n globalLineNumbers?: boolean\n}\n\nexport function ardoLineTransformer(options: ArdoLineTransformerOptions = {}): ShikiTransformer {\n let highlightLines: number[] = []\n let showLineNumbers = false\n let metaRaw = \"\"\n\n return {\n name: \"ardo:lines\",\n // preprocess runs BEFORE line() hooks, so state is ready for line()\n preprocess(_code, shikiOptions) {\n metaRaw = (shikiOptions.meta?.__raw as string) || \"\"\n highlightLines = parseHighlightLines(metaRaw)\n showLineNumbers = options.globalLineNumbers || metaRaw.includes(\"showLineNumbers\")\n },\n // pre runs AFTER line() — used only for node property modifications\n pre(node) {\n node.properties = node.properties || {}\n const title = parseTitle(metaRaw)\n if (title) {\n node.properties[\"data-title\"] = title\n }\n const labelMatch = metaRaw.match(/\\[([^\\]]+)\\]/)\n if (labelMatch) {\n node.properties[\"data-label\"] = labelMatch[1]\n }\n },\n line(node, line) {\n const currentClass = (node.properties?.class as string) || \"\"\n const classes = currentClass ? currentClass.split(\" \") : []\n classes.push(\"ardo-code-line\")\n\n if (highlightLines.includes(line)) {\n classes.push(\"highlighted\")\n }\n\n node.properties = node.properties || {}\n node.properties.class = classes.join(\" \")\n\n if (showLineNumbers) {\n node.children.unshift({\n type: \"element\",\n tagName: \"span\",\n properties: { class: \"ardo-line-number\" },\n children: [{ type: \"text\", value: String(line) }],\n } as Element)\n }\n },\n }\n}\n","import type { Plugin } from \"vite\"\nimport fs from \"fs/promises\"\nimport fsSync from \"fs\"\nimport path from \"path\"\n\nexport interface ArdoRoutesPluginOptions {\n /** Directory where routes are located (default: \"./app/routes\") */\n routesDir?: string\n}\n\ninterface RouteInfo {\n /** URL path (e.g., \"/guide/getting-started\") */\n path: string\n /** File path relative to app directory (e.g., \"routes/guide/getting-started.mdx\") */\n file: string\n /** True if this is an index route */\n isIndex?: boolean\n}\n\n/**\n * Vite plugin that generates routes.ts for React Router Framework Mode.\n * Scans app/routes for .mdx and .tsx files and generates the route configuration.\n */\nexport function ardoRoutesPlugin(options: ArdoRoutesPluginOptions = {}): Plugin {\n let routesDir: string\n let appDir: string\n let routesFilePath: string\n\n function scanRoutesSync(dir: string, rootDir: string): RouteInfo[] {\n const routes: RouteInfo[] = []\n\n try {\n const entries = fsSync.readdirSync(dir, { withFileTypes: true })\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n\n if (entry.isDirectory()) {\n // Recursively scan subdirectories\n const children = scanRoutesSync(fullPath, rootDir)\n routes.push(...children)\n } else if (\n entry.name.endsWith(\".mdx\") ||\n entry.name.endsWith(\".md\") ||\n entry.name.endsWith(\".tsx\")\n ) {\n // Skip special files\n if (entry.name === \"root.tsx\" || entry.name.startsWith(\"_\")) {\n continue\n }\n\n const relativePath = path.relative(rootDir, fullPath)\n const ext = entry.name.endsWith(\".mdx\")\n ? \".mdx\"\n : entry.name.endsWith(\".md\")\n ? \".md\"\n : \".tsx\"\n const baseName = entry.name.replace(ext, \"\")\n\n // Calculate URL path\n let urlPath: string\n if (baseName === \"index\" || baseName === \"home\") {\n // Index route - use parent directory path\n const parentDir = path.dirname(relativePath)\n urlPath = parentDir === \".\" ? \"/\" : \"/\" + parentDir.replace(/\\\\/g, \"/\")\n } else {\n // Regular route\n urlPath = \"/\" + relativePath.replace(ext, \"\").replace(/\\\\/g, \"/\")\n }\n\n // Handle dynamic segments ($param -> :param)\n urlPath = urlPath.replace(/\\$(\\w+)/g, \":$1\")\n\n routes.push({\n path: urlPath,\n file: \"routes/\" + relativePath.replace(/\\\\/g, \"/\"),\n isIndex: baseName === \"index\" || baseName === \"home\",\n })\n }\n }\n } catch {\n // Directory may not exist yet\n }\n\n return routes\n }\n\n function generateRoutesFile(routes: RouteInfo[]): string {\n // Sort routes: index routes first, then alphabetically\n const sortedRoutes = [...routes].sort((a, b) => {\n if (a.path === \"/\" && b.path !== \"/\") return -1\n if (b.path === \"/\" && a.path !== \"/\") return 1\n if (a.isIndex && !b.isIndex) return -1\n if (b.isIndex && !a.isIndex) return 1\n return a.path.localeCompare(b.path)\n })\n\n const entries = sortedRoutes.map((r) => {\n if (r.path === \"/\") {\n return ` index(\"${r.file}\"),`\n }\n // Remove leading slash for route path\n const routePath = r.path.substring(1)\n return ` route(\"${routePath}\", \"${r.file}\"),`\n })\n\n return `// AUTO-GENERATED by Ardo - Do not edit manually\n\nimport { type RouteConfig, route, index } from \"@react-router/dev/routes\"\n\nexport default [\n${entries.join(\"\\n\")}\n] satisfies RouteConfig\n`\n }\n\n function writeRoutesFileSync(): void {\n const routes = scanRoutesSync(routesDir, routesDir)\n\n // Skip if no routes found (directory might not exist yet)\n if (routes.length === 0) {\n return\n }\n\n const content = generateRoutesFile(routes)\n\n // Only write if content changed\n try {\n const existing = fsSync.readFileSync(routesFilePath, \"utf-8\")\n if (existing === content) {\n return\n }\n } catch {\n // File doesn't exist yet\n }\n\n // Ensure app directory exists\n fsSync.mkdirSync(appDir, { recursive: true })\n fsSync.writeFileSync(routesFilePath, content, \"utf-8\")\n console.log(`[ardo] Generated routes.ts with ${routes.length} routes`)\n }\n\n async function writeRoutesFile(): Promise<void> {\n const routes = scanRoutesSync(routesDir, routesDir)\n\n // Skip if no routes found (directory might not exist yet)\n if (routes.length === 0) {\n return\n }\n\n const content = generateRoutesFile(routes)\n\n // Only write if content changed\n try {\n const existing = await fs.readFile(routesFilePath, \"utf-8\")\n if (existing === content) {\n return\n }\n } catch {\n // File doesn't exist yet\n }\n\n // Ensure app directory exists\n await fs.mkdir(appDir, { recursive: true })\n await fs.writeFile(routesFilePath, content, \"utf-8\")\n }\n\n return {\n name: \"ardo:routes\",\n enforce: \"pre\",\n\n config(userConfig) {\n const root = userConfig.root || process.cwd()\n appDir = path.join(root, \"app\")\n routesDir = options.routesDir || path.join(appDir, \"routes\")\n routesFilePath = path.join(appDir, \"routes.ts\")\n\n // Generate routes synchronously during config phase\n // React Router needs routes.ts to exist before it starts\n try {\n writeRoutesFileSync()\n } catch (err) {\n console.warn(\"[ardo] Could not generate routes.ts in config phase:\", err)\n }\n },\n\n configResolved(config) {\n // Update paths if not set in config\n if (!appDir) {\n appDir = path.join(config.root, \"app\")\n routesDir = options.routesDir || path.join(appDir, \"routes\")\n routesFilePath = path.join(appDir, \"routes.ts\")\n }\n },\n\n async buildStart() {\n // Re-generate routes in buildStart for async support\n await writeRoutesFile()\n },\n\n configureServer(server) {\n // Watch for changes in routes directory\n server.watcher.add(routesDir)\n\n const handleChange = async (changedPath: string) => {\n if (\n changedPath.startsWith(routesDir) &&\n (changedPath.endsWith(\".mdx\") ||\n changedPath.endsWith(\".md\") ||\n changedPath.endsWith(\".tsx\"))\n ) {\n await writeRoutesFile()\n }\n }\n\n server.watcher.on(\"add\", handleChange)\n server.watcher.on(\"unlink\", handleChange)\n },\n }\n}\n","import type { Plugin } from \"vite\"\nimport type { MarkdownConfig } from \"../config/types\"\nimport { highlightCode } from \"../markdown/shiki\"\n\n/**\n * Strips leading/trailing blank lines and removes common leading whitespace.\n * Same logic as the runtime outdent in CodeBlock.tsx.\n */\nfunction outdent(text: string): string {\n const trimmed = text.replace(/^\\n+/, \"\").replace(/\\n\\s*$/, \"\")\n const lines = trimmed.split(\"\\n\")\n\n const indent = lines.reduce((min, line) => {\n if (line.trim().length === 0) return min\n const match = line.match(/^(\\s*)/)\n return match ? Math.min(min, match[1].length) : min\n }, Infinity)\n\n if (indent === 0 || indent === Infinity) return trimmed\n return lines.map((line) => line.slice(indent)).join(\"\\n\")\n}\n\n/**\n * Finds self-closing `<CodeBlock ... />` tags by scanning for balanced\n * quotes and braces. A simple `[^>]` regex fails when prop values contain\n * `>` characters (e.g. `code={'<Tip>Hello</Tip>'}`).\n */\nfunction findSelfClosingCodeBlocks(\n source: string\n): Array<{ fullMatch: string; propsStr: string; index: number }> {\n const results: Array<{ fullMatch: string; propsStr: string; index: number }> = []\n const tag = \"<CodeBlock\"\n let searchFrom = 0\n\n while (true) {\n const start = source.indexOf(tag, searchFrom)\n if (start === -1) break\n\n // Char after tag name must be whitespace (not > or /)\n const afterTag = start + tag.length\n if (afterTag >= source.length || !/\\s/.test(source[afterTag])) {\n searchFrom = afterTag\n continue\n }\n\n // Scan forward, skipping quoted strings and balanced braces\n let i = afterTag\n let depth = 0\n let inSingle = false\n let inDouble = false\n let inTemplate = false\n let found = false\n\n while (i < source.length) {\n const ch = source[i]\n\n // Handle escape sequences inside strings\n if ((inSingle || inDouble || inTemplate) && ch === \"\\\\\") {\n i += 2\n continue\n }\n\n if (inSingle) {\n if (ch === \"'\") inSingle = false\n i++\n continue\n }\n if (inDouble) {\n if (ch === '\"') inDouble = false\n i++\n continue\n }\n if (inTemplate) {\n if (ch === \"`\") inTemplate = false\n i++\n continue\n }\n\n if (ch === \"'\") {\n inSingle = true\n i++\n continue\n }\n if (ch === '\"') {\n inDouble = true\n i++\n continue\n }\n if (ch === \"`\") {\n inTemplate = true\n i++\n continue\n }\n if (ch === \"{\") {\n depth++\n i++\n continue\n }\n if (ch === \"}\") {\n depth--\n i++\n continue\n }\n\n // Look for /> at depth 0\n if (depth === 0 && ch === \"/\" && i + 1 < source.length && source[i + 1] === \">\") {\n const fullMatch = source.substring(start, i + 2)\n const propsStr = source.substring(afterTag, i).trim()\n results.push({ fullMatch, propsStr, index: start })\n found = true\n searchFrom = i + 2\n break\n }\n\n // If we hit > without / at depth 0, this is an opening tag, not self-closing\n if (depth === 0 && ch === \">\") {\n searchFrom = i + 1\n found = true\n break\n }\n\n i++\n }\n\n if (!found) break\n }\n\n return results\n}\n\n/**\n * Vite plugin that pre-highlights CodeBlock components at build time.\n *\n * Runs before the JSX parser, so children can contain arbitrary code\n * (including `<`, `{`, etc.) without causing syntax errors.\n *\n * Supports three patterns:\n * 1. `<CodeBlock code=\"...\" language=\"...\" />` — code prop\n * 2. `<CodeBlock language=\"...\">{\\`...\\`}</CodeBlock>` — template literal children\n * 3. `<CodeBlock language=\"...\">raw code here</CodeBlock>` — plain text children\n *\n * All patterns are rewritten to a self-closing tag with pre-rendered\n * Shiki HTML before the JSX parser ever sees them.\n */\nexport function ardoCodeBlockPlugin(markdownConfig?: MarkdownConfig): Plugin {\n return {\n name: \"ardo:codeblock-highlight\",\n enforce: \"pre\",\n\n async transform(code, id) {\n if (!/\\.[jt]sx$/.test(id)) return\n if (!code.includes(\"CodeBlock\")) return\n if (id.includes(\"node_modules\")) return\n\n let result = code\n let offset = 0\n\n // Pattern 1: Self-closing <CodeBlock code=\"...\" language=\"...\" />\n // Use a scanner instead of regex because [^>] fails when prop values\n // contain > characters (e.g. code={'<Tip>Hello</Tip>'}).\n const propMatches = findSelfClosingCodeBlocks(code)\n\n for (const match of propMatches) {\n const { fullMatch, propsStr } = match\n\n const codeMatch =\n propsStr.match(/\\bcode=\"((?:[^\"\\\\]|\\\\.)*)\"/s) ||\n propsStr.match(/\\bcode=\\{\\s*\"((?:[^\"\\\\]|\\\\.)*)\"\\s*\\}/s) ||\n propsStr.match(/\\bcode=\\{\\s*'((?:[^'\\\\]|\\\\.)*)'\\s*\\}/s)\n if (!codeMatch) continue\n\n const langMatch =\n propsStr.match(/\\blanguage=\"([^\"]*)\"/) ||\n propsStr.match(/\\blanguage=\\{\"([^\"]*)\"\\}/) ||\n propsStr.match(/\\blanguage=\\{'([^']*)'\\}/)\n if (!langMatch) continue\n\n if (propsStr.includes(\"__html\")) continue\n\n const codeContent = codeMatch[1]\n .replace(/\\\\n/g, \"\\n\")\n .replace(/\\\\\"/g, '\"')\n .replace(/\\\\\\\\/g, \"\\\\\")\n const language = langMatch[1]\n\n try {\n const html = await highlightCode(codeContent, language, {\n theme: markdownConfig?.theme,\n })\n\n const escapedHtml = JSON.stringify(html)\n const newPropsStr = `__html={${escapedHtml}} ` + propsStr\n const newFullMatch = fullMatch.replace(propsStr, newPropsStr)\n\n result =\n result.slice(0, match.index + offset) +\n newFullMatch +\n result.slice(match.index + offset + fullMatch.length)\n\n offset += newFullMatch.length - fullMatch.length\n } catch {\n // If highlighting fails, leave unchanged\n }\n }\n\n // Pattern 2+3: <CodeBlock language=\"...\">...children...</CodeBlock>\n // Matches both template literal children {`...`} and raw text children.\n // Since this runs before JSX parsing, raw text with <, {, etc. is fine.\n const childrenRegex = /<CodeBlock\\s+([^>]*?)>([\\s\\S]*?)<\\/CodeBlock>/g\n\n offset = result.length - code.length\n let regexMatch: RegExpExecArray | null\n while ((regexMatch = childrenRegex.exec(code)) !== null) {\n const fullMatch = regexMatch[0]\n const propsStr = regexMatch[1]\n let rawChildren = regexMatch[2]\n\n const langMatch =\n propsStr.match(/\\blanguage=\"([^\"]*)\"/) ||\n propsStr.match(/\\blanguage=\\{\"([^\"]*)\"\\}/) ||\n propsStr.match(/\\blanguage=\\{'([^']*)'\\}/)\n if (!langMatch) continue\n\n if (propsStr.includes(\"__html\")) continue\n\n // Unwrap template literal braces if present: {`...`} → ...\n const templateMatch = rawChildren.match(/^\\s*\\{`([\\s\\S]*)`\\}\\s*$/)\n if (templateMatch) {\n rawChildren = templateMatch[1]\n }\n\n const codeContent = outdent(rawChildren)\n const language = langMatch[1]\n\n try {\n const html = await highlightCode(codeContent, language, {\n theme: markdownConfig?.theme,\n })\n\n const escapedHtml = JSON.stringify(html)\n const escapedCode = JSON.stringify(codeContent)\n const newTag = `<CodeBlock __html={${escapedHtml}} code={${escapedCode}} ${propsStr} />`\n\n result =\n result.slice(0, regexMatch.index + offset) +\n newTag +\n result.slice(regexMatch.index + offset + fullMatch.length)\n\n offset += newTag.length - fullMatch.length\n } catch {\n // If highlighting fails, leave unchanged\n }\n }\n\n if (result !== code) {\n return { code: result, map: null }\n }\n },\n }\n}\n","import fs from \"fs/promises\"\nimport path from \"path\"\nimport type { PageData, PageFrontmatter, TOCItem, ResolvedConfig } from \"../config/types\"\nimport { transformMarkdown } from \"../markdown/pipeline\"\n\nexport interface LoadDocOptions {\n slug: string\n contentDir: string\n config: ResolvedConfig\n}\n\nexport interface LoadDocResult {\n content: string\n frontmatter: PageFrontmatter\n toc: TOCItem[]\n filePath: string\n relativePath: string\n lastUpdated?: number\n}\n\nexport async function loadDoc(options: LoadDocOptions): Promise<LoadDocResult | null> {\n const { slug, contentDir, config } = options\n\n const possiblePaths = [\n path.join(contentDir, `${slug}.md`),\n path.join(contentDir, slug, \"index.md\"),\n ]\n\n let filePath: string | null = null\n let fileContent: string | null = null\n\n for (const tryPath of possiblePaths) {\n try {\n fileContent = await fs.readFile(tryPath, \"utf-8\")\n filePath = tryPath\n break\n } catch {\n continue\n }\n }\n\n if (!filePath || !fileContent) {\n return null\n }\n\n const result = await transformMarkdown(fileContent, config.markdown)\n const relativePath = path.relative(contentDir, filePath)\n\n let lastUpdated: number | undefined\n try {\n const stat = await fs.stat(filePath)\n lastUpdated = stat.mtimeMs\n } catch {\n // Ignore stat errors\n }\n\n return {\n content: result.html,\n frontmatter: result.frontmatter,\n toc: result.toc,\n filePath,\n relativePath,\n lastUpdated,\n }\n}\n\nexport async function loadAllDocs(contentDir: string, config: ResolvedConfig): Promise<PageData[]> {\n const docs: PageData[] = []\n\n async function scanDir(dir: string) {\n const entries = await fs.readdir(dir, { withFileTypes: true })\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n\n if (entry.isDirectory()) {\n await scanDir(fullPath)\n } else if (entry.name.endsWith(\".md\")) {\n const fileContent = await fs.readFile(fullPath, \"utf-8\")\n const result = await transformMarkdown(fileContent, config.markdown)\n const relativePath = path.relative(contentDir, fullPath)\n\n let lastUpdated: number | undefined\n try {\n const stat = await fs.stat(fullPath)\n lastUpdated = stat.mtimeMs\n } catch {\n // Ignore stat errors\n }\n\n docs.push({\n title: result.frontmatter.title || formatTitle(entry.name.replace(/\\.md$/, \"\")),\n description: result.frontmatter.description,\n frontmatter: result.frontmatter,\n content: result.html,\n toc: result.toc,\n filePath: fullPath,\n relativePath,\n lastUpdated,\n })\n }\n }\n }\n\n await scanDir(contentDir)\n return docs\n}\n\nfunction formatTitle(name: string): string {\n return name.replace(/[-_]/g, \" \").replace(/\\b\\w/g, (c) => c.toUpperCase())\n}\n\nexport function getSlugFromPath(relativePath: string): string {\n return relativePath\n .replace(/\\.md$/, \"\")\n .replace(/\\/index$/, \"\")\n .replace(/\\\\/g, \"/\")\n}\n\nexport function getPageDataForRoute(docs: PageData[], slug: string): PageData | undefined {\n return docs.find((doc) => {\n const docSlug = getSlugFromPath(doc.relativePath)\n return docSlug === slug || docSlug === `${slug}/index`\n })\n}\n","import { unified } from \"unified\"\nimport remarkParse from \"remark-parse\"\nimport remarkGfm from \"remark-gfm\"\nimport remarkFrontmatter from \"remark-frontmatter\"\nimport remarkRehype from \"remark-rehype\"\nimport rehypeStringify from \"rehype-stringify\"\nimport matter from \"gray-matter\"\nimport type { MarkdownConfig, TOCItem, PageFrontmatter } from \"../config/types\"\nimport { remarkExtractToc, type TocExtraction } from \"./toc\"\nimport { createShikiHighlighter, rehypeShikiFromHighlighter, type ShikiHighlighter } from \"./shiki\"\nimport { rehypeLinks } from \"./links\"\n\nexport interface TransformResult {\n html: string\n frontmatter: PageFrontmatter\n toc: TOCItem[]\n}\n\nexport interface TransformOptions {\n basePath?: string\n highlighter?: ShikiHighlighter\n}\n\nexport async function transformMarkdown(\n content: string,\n config: MarkdownConfig,\n options: TransformOptions = {}\n): Promise<TransformResult> {\n const { data: frontmatter, content: markdownContent } = matter(content)\n const { basePath = \"/\", highlighter: providedHighlighter } = options\n\n const tocExtraction: TocExtraction = { toc: [] }\n const highlighter = providedHighlighter ?? (await createShikiHighlighter(config))\n\n const processor = unified()\n .use(remarkParse)\n .use(remarkFrontmatter, [\"yaml\"])\n .use(remarkGfm)\n .use(remarkExtractToc, { tocExtraction, levels: config.toc?.level ?? [2, 3] })\n .use(remarkRehype, { allowDangerousHtml: true })\n .use(rehypeShikiFromHighlighter, { highlighter, config })\n .use(rehypeLinks, { basePath })\n .use(rehypeStringify, { allowDangerousHtml: true })\n\n if (config.remarkPlugins) {\n for (const plugin of config.remarkPlugins) {\n processor.use(plugin as Parameters<typeof processor.use>[0])\n }\n }\n\n if (config.rehypePlugins) {\n for (const plugin of config.rehypePlugins) {\n processor.use(plugin as Parameters<typeof processor.use>[0])\n }\n }\n\n const result = await processor.process(markdownContent)\n\n return {\n html: String(result),\n frontmatter: frontmatter as PageFrontmatter,\n toc: tocExtraction.toc,\n }\n}\n\nexport async function transformMarkdownToReact(\n content: string,\n config: MarkdownConfig\n): Promise<TransformResult> {\n return transformMarkdown(content, config)\n}\n","import type { Root, Heading } from \"mdast\"\nimport { visit } from \"unist-util-visit\"\nimport type { TOCItem } from \"../config/types\"\n\nexport interface TocExtraction {\n toc: TOCItem[]\n}\n\ninterface TocOptions {\n tocExtraction: TocExtraction\n levels: [number, number]\n}\n\nexport function remarkExtractToc(options: TocOptions) {\n const { tocExtraction, levels } = options\n const [minLevel, maxLevel] = levels\n\n return function (tree: Root) {\n const headings: Array<{ text: string; level: number; id: string }> = []\n let headingIndex = 0\n\n visit(tree, \"heading\", (node: Heading) => {\n if (node.depth < minLevel || node.depth > maxLevel) {\n return\n }\n\n const text = getHeadingText(node)\n const slug = slugify(text)\n const id = slug || `heading-${headingIndex}`\n headingIndex++\n\n headings.push({\n text,\n level: node.depth,\n id,\n })\n\n // Add id to the heading node for anchor links\n const data = node.data || (node.data = {})\n const hProperties = (data.hProperties || (data.hProperties = {})) as Record<string, string>\n hProperties.id = id\n })\n\n tocExtraction.toc = buildTocTree(headings, minLevel)\n }\n}\n\nfunction getHeadingText(node: Heading): string {\n const textParts: string[] = []\n\n function extractText(child: unknown) {\n if (!child || typeof child !== \"object\") return\n\n const typedChild = child as { type?: string; value?: string; children?: unknown[] }\n\n if (typedChild.type === \"text\") {\n textParts.push(typedChild.value || \"\")\n } else if (typedChild.type === \"inlineCode\") {\n textParts.push(typedChild.value || \"\")\n } else if (Array.isArray(typedChild.children)) {\n typedChild.children.forEach(extractText)\n }\n }\n\n node.children.forEach(extractText)\n return textParts.join(\"\")\n}\n\nfunction slugify(text: string): string {\n return text\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n}\n\nfunction buildTocTree(\n headings: Array<{ text: string; level: number; id: string }>,\n _minLevel: number\n): TOCItem[] {\n const result: TOCItem[] = []\n const stack: Array<{ item: TOCItem; level: number }> = []\n\n for (const heading of headings) {\n const item: TOCItem = {\n id: heading.id,\n text: heading.text,\n level: heading.level,\n }\n\n while (stack.length > 0 && stack[stack.length - 1].level >= heading.level) {\n stack.pop()\n }\n\n if (stack.length === 0) {\n result.push(item)\n } else {\n const parent = stack[stack.length - 1].item\n if (!parent.children) {\n parent.children = []\n }\n parent.children.push(item)\n }\n\n stack.push({ item, level: heading.level })\n }\n\n return result\n}\n\nexport function flattenToc(toc: TOCItem[]): TOCItem[] {\n const result: TOCItem[] = []\n\n function flatten(items: TOCItem[]) {\n for (const item of items) {\n result.push(item)\n if (item.children) {\n flatten(item.children)\n }\n }\n }\n\n flatten(toc)\n return result\n}\n","import { visit } from \"unist-util-visit\"\nimport type { Root, Element } from \"hast\"\n\nexport interface RehypeLinkOptions {\n basePath: string\n}\n\n/**\n * Rehype plugin that rewrites internal links to include the basePath.\n * This is needed for static sites deployed to subpaths (e.g., GitHub Pages).\n */\nexport function rehypeLinks(options: RehypeLinkOptions) {\n const { basePath } = options\n\n // Normalize basePath: ensure it starts with / and doesn't end with /\n const normalizedBase = basePath === \"/\" ? \"\" : basePath.replace(/\\/$/, \"\")\n\n return (tree: Root) => {\n if (!normalizedBase) {\n // No basePath to add\n return\n }\n\n visit(tree, \"element\", (node: Element) => {\n if (node.tagName === \"a\") {\n const href = node.properties?.href\n\n if (typeof href === \"string\") {\n // Only rewrite internal links that start with /\n // Don't rewrite: external URLs, anchors, relative paths, or already prefixed paths\n if (href.startsWith(\"/\") && !href.startsWith(\"//\") && !href.startsWith(normalizedBase)) {\n node.properties = node.properties || {}\n node.properties.href = normalizedBase + href\n }\n }\n }\n })\n }\n}\n","import fs from \"fs/promises\"\nimport type { Dirent } from \"fs\"\nimport path from \"path\"\nimport matter from \"gray-matter\"\nimport type { SidebarItem, ResolvedConfig } from \"../config/types\"\n\nexport interface SidebarGenerationOptions {\n contentDir: string\n basePath: string\n config: ResolvedConfig\n}\n\nexport async function generateSidebar(options: SidebarGenerationOptions): Promise<SidebarItem[]> {\n const { contentDir, basePath, config } = options\n\n const configSidebar = config.themeConfig.sidebar\n\n if (configSidebar) {\n if (Array.isArray(configSidebar) && configSidebar.length > 0) {\n return configSidebar\n }\n if (!Array.isArray(configSidebar)) {\n return []\n }\n }\n\n return await scanDirectoryForSidebar(contentDir, contentDir, basePath)\n}\n\nasync function scanDirectoryForSidebar(\n dir: string,\n rootDir: string,\n _basePath: string\n): Promise<SidebarItem[]> {\n let entries: Dirent[]\n\n try {\n entries = (await fs.readdir(dir, { withFileTypes: true })) as Dirent[]\n } catch {\n return []\n }\n\n interface SidebarItemWithOrder extends SidebarItem {\n order?: number\n }\n\n const items: SidebarItemWithOrder[] = []\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n const relativePath = path.relative(rootDir, fullPath)\n\n if (entry.name.startsWith(\".\") || entry.name.startsWith(\"_\")) {\n continue\n }\n\n if (entry.isDirectory()) {\n const children = await scanDirectoryForSidebar(fullPath, rootDir, _basePath)\n\n if (children.length > 0) {\n const indexPath = path.join(fullPath, \"index.md\")\n let link: string | undefined\n let title = formatTitle(entry.name)\n let order: number | undefined\n\n try {\n const indexContent = await fs.readFile(indexPath, \"utf-8\")\n const { data: frontmatter } = matter(indexContent)\n\n if (frontmatter.title) {\n title = frontmatter.title\n }\n if (typeof frontmatter.order === \"number\") {\n order = frontmatter.order\n }\n\n // Don't include basePath - React Router handles it automatically\n link = normalizePath(relativePath)\n } catch {\n // No index.md file\n }\n\n items.push({\n text: title,\n link,\n collapsed: false,\n items: children,\n order,\n })\n }\n } else if (entry.name.endsWith(\".md\") && entry.name !== \"index.md\") {\n const fileContent = await fs.readFile(fullPath, \"utf-8\")\n const { data: frontmatter } = matter(fileContent)\n\n if (frontmatter.sidebar === false) {\n continue\n }\n\n const title = frontmatter.title || formatTitle(entry.name.replace(/\\.md$/, \"\"))\n const order = typeof frontmatter.order === \"number\" ? frontmatter.order : undefined\n\n // Don't include basePath - React Router handles it automatically\n const link = normalizePath(relativePath.replace(/\\.md$/, \"\"))\n\n items.push({\n text: title,\n link,\n order,\n })\n }\n }\n\n items.sort((a, b) => {\n if (a.order !== undefined && b.order !== undefined) {\n return a.order - b.order\n }\n if (a.order !== undefined) return -1\n if (b.order !== undefined) return 1\n return a.text.localeCompare(b.text)\n })\n\n return items.map(({ order: _order, ...item }) => item)\n}\n\nfunction formatTitle(name: string): string {\n return name\n .replace(/^\\d+-/, \"\")\n .replace(/[-_]/g, \" \")\n .replace(/\\b\\w/g, (c) => c.toUpperCase())\n}\n\nfunction normalizePath(p: string): string {\n return \"/\" + p.replace(/\\\\/g, \"/\").replace(/^\\/+/, \"\")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KAAK,SAAS,KAAK,KAAK,MAAM,SAAS,YAAY;AAClE,YAAM,cAAc,MAAMF,IAAG,SAAS,UAAU,OAAO;AACvD,YAAM,EAAE,MAAM,YAAY,IAAIE,QAAO,WAAW;AAEhD,UAAI,YAAY,YAAY,OAAO;AACjC;AAAA,MACF;AAEA,YAAM,QAAQ,YAAY,SAASE,aAAY,MAAM,KAAK,QAAQ,SAAS,EAAE,CAAC;AAC9E,YAAM,QAAQ,OAAO,YAAY,UAAU,WAAW,YAAY,QAAQ;AAG1E,YAAM,OAAO,cAAc,aAAa,QAAQ,SAAS,EAAE,CAAC;AAE5D,YAAM,KAAK;AAAA,QACT,MAAM;AAAA,QACN;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,QAAM,KAAK,CAAC,GAAG,MAAM;AACnB,QAAI,EAAE,UAAU,UAAa,EAAE,UAAU,QAAW;AAClD,aAAO,EAAE,QAAQ,EAAE;AAAA,IACrB;AACA,QAAI,EAAE,UAAU,OAAW,QAAO;AAClC,QAAI,EAAE,UAAU,OAAW,QAAO;AAClC,WAAO,EAAE,KAAK,cAAc,EAAE,IAAI;AAAA,EACpC,CAAC;AAED,SAAO,MAAM,IAAI,CAAC,EAAE,OAAO,QAAQ,GAAG,KAAK,MAAM,IAAI;AACvD;AAEA,SAASA,aAAY,MAAsB;AACzC,SAAO,KACJ,QAAQ,SAAS,EAAE,EACnB,QAAQ,SAAS,GAAG,EACpB,QAAQ,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC;AAC5C;AAEA,SAAS,cAAc,GAAmB;AACxC,SAAO,MAAM,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,QAAQ,EAAE;AACvD;","names":["fs","fsSync","path","path","fsSync","fs","fs","path","remarkGfm","remarkFrontmatter","matter","visit","visit","matter","remarkFrontmatter","remarkGfm","path","fs","formatTitle","fs","path","matter","generateSidebar","formatTitle"]}
|
|
@@ -620,9 +620,9 @@ var TypeDocGenerator = class {
|
|
|
620
620
|
}
|
|
621
621
|
const deprecated = reflection.comment.blockTags.find((t) => t.tag === "@deprecated");
|
|
622
622
|
if (deprecated) {
|
|
623
|
-
content.push("
|
|
623
|
+
content.push('<Warning title="Deprecated">');
|
|
624
624
|
content.push(this.renderComment(deprecated.content));
|
|
625
|
-
content.push("
|
|
625
|
+
content.push("</Warning>");
|
|
626
626
|
content.push("");
|
|
627
627
|
}
|
|
628
628
|
const see = reflection.comment.blockTags.filter((t) => t.tag === "@see");
|
|
@@ -1032,4 +1032,4 @@ export {
|
|
|
1032
1032
|
TypeDocGenerator,
|
|
1033
1033
|
generateApiDocs
|
|
1034
1034
|
};
|
|
1035
|
-
//# sourceMappingURL=chunk-
|
|
1035
|
+
//# sourceMappingURL=chunk-PGHUPTGL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/typedoc/generator.ts"],"sourcesContent":["import {\n Application,\n TSConfigReader,\n TypeDocReader,\n type ProjectReflection,\n ReflectionKind,\n type DeclarationReflection,\n type SignatureReflection,\n type TypeParameterReflection,\n} from \"typedoc\"\nimport path from \"path\"\nimport fs from \"fs/promises\"\nimport { readPackageUp } from \"read-package-up\"\nimport type { TypeDocConfig, GeneratedApiDoc } from \"./types\"\n\nexport class TypeDocGenerator {\n private config: TypeDocConfig\n private app: Application | undefined\n private project: ProjectReflection | undefined\n private basePath: string\n private packageNameCache = new Map<string, string | undefined>()\n\n constructor(config: TypeDocConfig) {\n this.config = {\n out: \"api\",\n excludeExternals: true,\n excludePrivate: true,\n excludeProtected: false,\n excludeInternal: true,\n sort: [\"source-order\"],\n sidebar: {\n title: \"API Reference\",\n position: 100,\n collapsed: false,\n },\n markdown: {\n breadcrumbs: true,\n hierarchy: true,\n sourceLinks: true,\n codeBlocks: true,\n },\n ...config,\n }\n // Use the output directory as the base path for links\n this.basePath = \"/\" + this.config.out!\n }\n\n async generate(outputDir: string): Promise<GeneratedApiDoc[]> {\n // Pre-populate package name cache for all entry points\n await Promise.all(this.config.entryPoints.map((ep) => this.resolvePackageName(ep)))\n\n const typedocOptions: Record<string, unknown> = {\n entryPoints: this.config.entryPoints,\n tsconfig: this.config.tsconfig,\n excludeExternals: this.config.excludeExternals,\n excludePrivate: this.config.excludePrivate,\n excludeProtected: this.config.excludeProtected,\n excludeInternal: this.config.excludeInternal,\n sort: this.config.sort,\n }\n\n // Only pass array/string options when explicitly set to avoid\n // TypeDoc errors like \"option must be set to an array of strings\"\n if (this.config.exclude) typedocOptions.exclude = this.config.exclude\n if (this.config.categoryOrder) typedocOptions.categoryOrder = this.config.categoryOrder\n if (this.config.groupOrder) typedocOptions.groupOrder = this.config.groupOrder\n if (this.config.plugin) typedocOptions.plugin = this.config.plugin\n if (this.config.readme) typedocOptions.readme = this.config.readme\n\n this.app = await Application.bootstrapWithPlugins(typedocOptions, [\n new TSConfigReader(),\n new TypeDocReader(),\n ])\n\n this.project = await this.app.convert()\n\n if (!this.project) {\n throw new Error(\"TypeDoc conversion failed\")\n }\n\n const docs = this.generateMarkdownDocs()\n const apiDir = path.join(outputDir, this.config.out!)\n\n await fs.mkdir(apiDir, { recursive: true })\n\n for (const doc of docs) {\n const filePath = path.join(apiDir, doc.path)\n const dir = path.dirname(filePath)\n await fs.mkdir(dir, { recursive: true })\n\n const frontmatterLines = [\n \"---\",\n `title: ${doc.frontmatter.title}`,\n doc.frontmatter.description ? `description: ${doc.frontmatter.description}` : null,\n doc.frontmatter.sidebar_position !== undefined\n ? `sidebar_position: ${doc.frontmatter.sidebar_position}`\n : null,\n doc.frontmatter.sidebar === false ? `sidebar: false` : null,\n \"---\",\n ].filter((line): line is string => line !== null)\n\n const frontmatter = frontmatterLines.join(\"\\n\") + \"\\n\\n\"\n\n await fs.writeFile(filePath, frontmatter + doc.content)\n }\n\n return docs\n }\n\n private generateMarkdownDocs(): GeneratedApiDoc[] {\n if (!this.project) return []\n\n const docs: GeneratedApiDoc[] = []\n\n // Generate index page\n docs.push(this.generateIndexPage())\n\n const children = this.project.children || []\n\n // Group functions and type aliases by source file\n // React components (PascalCase) get their own pages\n const functionsByFile = new Map<string, DeclarationReflection[]>()\n const typesByFile = new Map<string, DeclarationReflection[]>()\n const componentItems: DeclarationReflection[] = []\n const standaloneItems: DeclarationReflection[] = []\n\n for (const child of children) {\n const sourceFile = child.sources?.[0]?.fileName\n\n if (child.kind === ReflectionKind.Function && sourceFile) {\n // React components are PascalCase and get individual pages\n if (this.isReactComponent(child.name)) {\n componentItems.push(child)\n } else {\n const existing = functionsByFile.get(sourceFile) || []\n existing.push(child)\n functionsByFile.set(sourceFile, existing)\n }\n } else if (child.kind === ReflectionKind.TypeAlias && sourceFile) {\n const existing = typesByFile.get(sourceFile) || []\n existing.push(child)\n typesByFile.set(sourceFile, existing)\n } else {\n standaloneItems.push(child)\n }\n }\n\n // Generate grouped pages for functions (by source file)\n for (const [sourceFile, functions] of functionsByFile) {\n docs.push(this.generateGroupedFunctionsPage(sourceFile, functions))\n }\n\n // Generate grouped pages for types (by source file)\n for (const [sourceFile, types] of typesByFile) {\n docs.push(this.generateGroupedTypesPage(sourceFile, types))\n }\n\n // Generate individual pages for React components\n // Sort alphabetically for consistent prev/next navigation\n const sortedComponents = [...componentItems].sort((a, b) => a.name.localeCompare(b.name))\n for (let i = 0; i < sortedComponents.length; i++) {\n const prev = i > 0 ? sortedComponents[i - 1] : null\n const next = i < sortedComponents.length - 1 ? sortedComponents[i + 1] : null\n docs.push(this.generateComponentPage(sortedComponents[i], prev, next))\n }\n\n // Group standalone items by kind for prev/next navigation within each group\n const itemsByKind = new Map<number, DeclarationReflection[]>()\n for (const child of standaloneItems) {\n const kind = child.kind\n const existing = itemsByKind.get(kind) || []\n existing.push(child)\n itemsByKind.set(kind, existing)\n }\n\n // Generate individual pages for classes, interfaces, enums, etc. with prev/next within group\n for (const [, items] of itemsByKind) {\n const sortedItems = [...items].sort((a, b) => a.name.localeCompare(b.name))\n for (let i = 0; i < sortedItems.length; i++) {\n const prev = i > 0 ? sortedItems[i - 1] : null\n const next = i < sortedItems.length - 1 ? sortedItems[i + 1] : null\n docs.push(...this.generateReflectionDocs(sortedItems[i], \"\", prev, next))\n }\n }\n\n // Generate category index pages for non-empty categories\n docs.push(\n ...this.generateCategoryIndexPages(\n docs,\n componentItems,\n functionsByFile,\n typesByFile,\n standaloneItems\n )\n )\n\n return docs\n }\n\n private generateCategoryIndexPages(\n docs: GeneratedApiDoc[],\n componentItems: DeclarationReflection[],\n functionsByFile: Map<string, DeclarationReflection[]>,\n typesByFile: Map<string, DeclarationReflection[]>,\n standaloneItems: DeclarationReflection[]\n ): GeneratedApiDoc[] {\n const indexPages: GeneratedApiDoc[] = []\n\n // Components index\n if (componentItems.length > 0) {\n const sorted = [...componentItems].sort((a, b) => a.name.localeCompare(b.name))\n const content = [\n `# Components`,\n \"\",\n ...sorted.map((c) => {\n const desc = c.comment?.summary ? ` - ${this.renderCommentShort(c.comment.summary)}` : \"\"\n return `- [${c.name}](${this.buildLink(\"components\", this.getSlug(c.name))})${desc}`\n }),\n \"\",\n ]\n indexPages.push({\n path: \"components/index.md\",\n content: content.join(\"\\n\"),\n frontmatter: { title: \"Components\", sidebar: false },\n })\n }\n\n // Functions index\n if (functionsByFile.size > 0) {\n const sortedModules = [...functionsByFile.entries()].sort((a, b) =>\n this.getModuleNameFromPath(a[0]).localeCompare(this.getModuleNameFromPath(b[0]))\n )\n const content = [\n `# Functions`,\n \"\",\n ...sortedModules.map(([sourceFile, functions]) => {\n const moduleName = this.getModuleNameFromPath(sourceFile)\n const slug = this.getSlug(moduleName)\n const funcNames = functions\n .map((f) => f.name)\n .sort()\n .join(\", \")\n return `- [${moduleName}](${this.buildLink(\"functions\", slug)}) - ${funcNames}`\n }),\n \"\",\n ]\n indexPages.push({\n path: \"functions/index.md\",\n content: content.join(\"\\n\"),\n frontmatter: { title: \"Functions\", sidebar: false },\n })\n }\n\n // Group standalone items by kind for category indexes\n const interfaces = standaloneItems.filter((c) => c.kind === ReflectionKind.Interface)\n const classes = standaloneItems.filter((c) => c.kind === ReflectionKind.Class)\n\n // Interfaces index\n if (interfaces.length > 0) {\n const sorted = [...interfaces].sort((a, b) => a.name.localeCompare(b.name))\n const content = [\n `# Interfaces`,\n \"\",\n ...sorted.map((item) => {\n const desc = item.comment?.summary\n ? ` - ${this.renderCommentShort(item.comment.summary)}`\n : \"\"\n return `- [${item.name}](${this.buildLink(\"interfaces\", this.getSlug(item.name))})${desc}`\n }),\n \"\",\n ]\n indexPages.push({\n path: \"interfaces/index.md\",\n content: content.join(\"\\n\"),\n frontmatter: { title: \"Interfaces\", sidebar: false },\n })\n }\n\n // Types index\n if (typesByFile.size > 0) {\n const sortedModules = [...typesByFile.entries()].sort((a, b) =>\n this.getModuleNameFromPath(a[0]).localeCompare(this.getModuleNameFromPath(b[0]))\n )\n const content = [\n `# Types`,\n \"\",\n ...sortedModules.map(([sourceFile, types]) => {\n const moduleName = this.getModuleNameFromPath(sourceFile)\n const slug = this.getSlug(moduleName)\n const typeNames = types\n .map((t) => t.name)\n .sort()\n .join(\", \")\n return `- [${moduleName}](${this.buildLink(\"types\", slug)}) - ${typeNames}`\n }),\n \"\",\n ]\n indexPages.push({\n path: \"types/index.md\",\n content: content.join(\"\\n\"),\n frontmatter: { title: \"Types\", sidebar: false },\n })\n }\n\n // Classes index\n if (classes.length > 0) {\n const sorted = [...classes].sort((a, b) => a.name.localeCompare(b.name))\n const content = [\n `# Classes`,\n \"\",\n ...sorted.map((item) => {\n const desc = item.comment?.summary\n ? ` - ${this.renderCommentShort(item.comment.summary)}`\n : \"\"\n return `- [${item.name}](${this.buildLink(\"classes\", this.getSlug(item.name))})${desc}`\n }),\n \"\",\n ]\n indexPages.push({\n path: \"classes/index.md\",\n content: content.join(\"\\n\"),\n frontmatter: { title: \"Classes\", sidebar: false },\n })\n }\n\n return indexPages\n }\n\n private generateGroupedFunctionsPage(\n sourceFile: string,\n functions: DeclarationReflection[]\n ): GeneratedApiDoc {\n // Extract module name from source file path (e.g., \"src/utils/string.ts\" -> \"string\")\n const moduleName = this.getModuleNameFromPath(sourceFile)\n const slug = this.getSlug(moduleName)\n const content: string[] = []\n\n content.push(`# ${moduleName} Functions`)\n content.push(\"\")\n content.push(`Functions exported from \\`${sourceFile}\\``)\n content.push(\"\")\n\n // Sort functions alphabetically\n const sortedFunctions = [...functions].sort((a, b) => a.name.localeCompare(b.name))\n\n for (const func of sortedFunctions) {\n content.push(`## ${func.name}`)\n content.push(\"\")\n\n // Description\n if (func.comment?.summary) {\n content.push(this.renderComment(func.comment.summary))\n content.push(\"\")\n }\n\n // Signature\n if (func.signatures) {\n for (const sig of func.signatures) {\n content.push(this.renderSignature(sig))\n content.push(\"\")\n }\n }\n\n // Examples\n if (func.comment?.blockTags) {\n const examples = func.comment.blockTags.filter((t) => t.tag === \"@example\")\n if (examples.length > 0) {\n content.push(\"### Example\")\n content.push(\"\")\n for (const example of examples) {\n content.push(this.renderComment(example.content))\n content.push(\"\")\n }\n }\n }\n\n // Source link\n if (this.config.markdown?.sourceLinks && func.sources?.[0]) {\n const source = func.sources[0]\n const sourceUrl = this.getSourceUrl(source.fileName, source.line)\n if (sourceUrl) {\n content.push(`[Source](${sourceUrl})`)\n content.push(\"\")\n }\n }\n\n content.push(\"---\")\n content.push(\"\")\n }\n\n return {\n path: `functions/${slug}.md`,\n content: content.join(\"\\n\"),\n frontmatter: {\n title: `${moduleName} Functions`,\n description: `Functions from ${sourceFile}`,\n },\n }\n }\n\n private generateGroupedTypesPage(\n sourceFile: string,\n types: DeclarationReflection[]\n ): GeneratedApiDoc {\n const moduleName = this.getModuleNameFromPath(sourceFile)\n const slug = this.getSlug(moduleName)\n const content: string[] = []\n\n content.push(`# ${moduleName} Types`)\n content.push(\"\")\n content.push(`Type definitions from \\`${sourceFile}\\``)\n content.push(\"\")\n\n // Sort types alphabetically\n const sortedTypes = [...types].sort((a, b) => a.name.localeCompare(b.name))\n\n for (const typeAlias of sortedTypes) {\n content.push(`## ${typeAlias.name}`)\n content.push(\"\")\n\n // Description\n if (typeAlias.comment?.summary) {\n content.push(this.renderComment(typeAlias.comment.summary))\n content.push(\"\")\n }\n\n // Type definition\n if (typeAlias.type) {\n content.push(\"```typescript\")\n content.push(`type ${typeAlias.name} = ${typeAlias.type.toString()}`)\n content.push(\"```\")\n content.push(\"\")\n }\n\n // Source link\n if (this.config.markdown?.sourceLinks && typeAlias.sources?.[0]) {\n const source = typeAlias.sources[0]\n const sourceUrl = this.getSourceUrl(source.fileName, source.line)\n if (sourceUrl) {\n content.push(`[Source](${sourceUrl})`)\n content.push(\"\")\n }\n }\n\n content.push(\"---\")\n content.push(\"\")\n }\n\n return {\n path: `types/${slug}.md`,\n content: content.join(\"\\n\"),\n frontmatter: {\n title: `${moduleName} Types`,\n description: `Type definitions from ${sourceFile}`,\n },\n }\n }\n\n private async resolvePackageName(filePath: string): Promise<string | undefined> {\n const dir = path.dirname(path.resolve(filePath))\n if (this.packageNameCache.has(dir)) {\n return this.packageNameCache.get(dir)\n }\n\n const result = await readPackageUp({ cwd: dir })\n const name = result?.packageJson.name\n const resolved = name ? name.replace(/^@[^/]+\\//, \"\") : undefined\n this.packageNameCache.set(dir, resolved)\n return resolved\n }\n\n private getModuleNameFromPath(filePath: string): string {\n // Include parent directory to avoid naming conflicts\n // \"src/utils/string.ts\" -> \"utils/string\"\n // \"src/ui/Sidebar.tsx\" -> \"ui/Sidebar\"\n // \"runtime/sidebar.ts\" -> \"runtime/sidebar\"\n const parts = filePath.split(\"/\")\n const basename = (parts.pop() || filePath).replace(/\\.(ts|tsx|js|jsx)$/, \"\")\n\n // Get parent directory if available\n const parent = parts.pop()\n if (parent && parent !== \"src\") {\n return `${parent}/${basename}`\n }\n if (basename === \"index\") {\n // Find the first cached package name. We cannot use path.resolve() here\n // because TypeDoc reports sourceFile paths relative to the project root,\n // while entry points were resolved relative to a different CWD (e.g. docs/).\n for (const packageName of this.packageNameCache.values()) {\n if (packageName) return packageName\n }\n }\n return basename\n }\n\n private generateIndexPage(): GeneratedApiDoc {\n const content = [\n `# ${this.config.sidebar?.title || \"API Reference\"}`,\n \"\",\n this.project?.comment?.summary\n ? this.renderComment(this.project.comment.summary)\n : \"Auto-generated API documentation.\",\n \"\",\n ]\n\n const children = this.project?.children || []\n\n // Group functions and types by source file for linking\n // Separate React components from regular functions\n const functionsByFile = new Map<string, DeclarationReflection[]>()\n const typesByFile = new Map<string, DeclarationReflection[]>()\n const componentItems: DeclarationReflection[] = []\n const standaloneItems: DeclarationReflection[] = []\n\n for (const child of children) {\n const sourceFile = child.sources?.[0]?.fileName\n\n if (child.kind === ReflectionKind.Function && sourceFile) {\n if (this.isReactComponent(child.name)) {\n componentItems.push(child)\n } else {\n const existing = functionsByFile.get(sourceFile) || []\n existing.push(child)\n functionsByFile.set(sourceFile, existing)\n }\n } else if (child.kind === ReflectionKind.TypeAlias && sourceFile) {\n const existing = typesByFile.get(sourceFile) || []\n existing.push(child)\n typesByFile.set(sourceFile, existing)\n } else {\n standaloneItems.push(child)\n }\n }\n\n // Render components\n if (componentItems.length > 0) {\n content.push(\"## Components\")\n content.push(\"\")\n\n const sortedComponents = [...componentItems].sort((a, b) => a.name.localeCompare(b.name))\n\n for (const component of sortedComponents) {\n const description = component.comment?.summary\n ? this.renderCommentShort(component.comment.summary)\n : \"\"\n const descSuffix = description ? ` - ${description}` : \"\"\n content.push(\n `- [${component.name}](${this.buildLink(\"components\", this.getSlug(component.name))})${descSuffix}`\n )\n }\n\n content.push(\"\")\n }\n\n // Render grouped function modules\n if (functionsByFile.size > 0) {\n content.push(\"## Functions\")\n content.push(\"\")\n\n // Sort modules alphabetically\n const sortedModules = [...functionsByFile.entries()].sort((a, b) =>\n this.getModuleNameFromPath(a[0]).localeCompare(this.getModuleNameFromPath(b[0]))\n )\n\n for (const [sourceFile, functions] of sortedModules) {\n const moduleName = this.getModuleNameFromPath(sourceFile)\n const slug = this.getSlug(moduleName)\n const funcNames = functions\n .map((f) => f.name)\n .sort()\n .join(\", \")\n content.push(`- [${moduleName}](${this.buildLink(\"functions\", slug)}) - ${funcNames}`)\n }\n\n content.push(\"\")\n }\n\n // Render grouped type modules\n if (typesByFile.size > 0) {\n content.push(\"## Type Aliases\")\n content.push(\"\")\n\n const sortedModules = [...typesByFile.entries()].sort((a, b) =>\n this.getModuleNameFromPath(a[0]).localeCompare(this.getModuleNameFromPath(b[0]))\n )\n\n for (const [sourceFile, types] of sortedModules) {\n const moduleName = this.getModuleNameFromPath(sourceFile)\n const slug = this.getSlug(moduleName)\n const typeNames = types\n .map((t) => t.name)\n .sort()\n .join(\", \")\n content.push(`- [${moduleName}](${this.buildLink(\"types\", slug)}) - ${typeNames}`)\n }\n\n content.push(\"\")\n }\n\n // Group remaining items by kind\n const groups: Record<string, DeclarationReflection[]> = {}\n\n for (const child of standaloneItems) {\n const kindName = this.getKindGroupName(child.kind, child.name)\n if (!groups[kindName]) {\n groups[kindName] = []\n }\n groups[kindName].push(child)\n }\n\n // Sort each group alphabetically\n for (const group of Object.values(groups)) {\n group.sort((a, b) => a.name.localeCompare(b.name))\n }\n\n // Define the order of groups (excluding Functions and Types which are handled above)\n const groupOrder = [\"Interfaces\", \"Classes\", \"Variables\", \"Enums\", \"Other\"]\n\n // Render each group\n for (const groupName of groupOrder) {\n const group = groups[groupName]\n if (!group || group.length === 0) continue\n\n content.push(`## ${groupName}`)\n content.push(\"\")\n\n for (const child of group) {\n const description = child.comment?.summary\n ? this.renderCommentShort(child.comment.summary)\n : \"\"\n const descSuffix = description ? ` - ${description}` : \"\"\n const groupUrlPrefix = this.getGroupUrlPrefix(child.kind)\n content.push(\n `- [${child.name}](${this.buildLink(groupUrlPrefix, this.getSlug(child.name))})${descSuffix}`\n )\n }\n\n content.push(\"\")\n }\n\n return {\n path: \"index.md\",\n content: content.join(\"\\n\"),\n frontmatter: {\n title: this.config.sidebar?.title || \"API Reference\",\n description: \"Auto-generated API documentation\",\n sidebar_position: 0,\n },\n }\n }\n\n private getKindGroupName(kind: ReflectionKind, name: string): string {\n // Group hooks and components separately from regular functions\n if (kind === ReflectionKind.Function) {\n // React hooks start with \"use\"\n if (name.startsWith(\"use\")) {\n return \"React Hooks\"\n }\n // React components are PascalCase and typically don't start with lowercase\n if (name[0] === name[0].toUpperCase() && !name.includes(\"_\")) {\n return \"React Components\"\n }\n return \"Functions\"\n }\n\n switch (kind) {\n case ReflectionKind.Interface:\n return \"Interfaces\"\n case ReflectionKind.TypeAlias:\n return \"Types\"\n case ReflectionKind.Class:\n return \"Classes\"\n case ReflectionKind.Variable:\n return \"Variables\"\n case ReflectionKind.Enum:\n return \"Enums\"\n default:\n return \"Other\"\n }\n }\n\n private generateReflectionDocs(\n reflection: DeclarationReflection,\n parentPath: string,\n prev: DeclarationReflection | null = null,\n next: DeclarationReflection | null = null\n ): GeneratedApiDoc[] {\n const docs: GeneratedApiDoc[] = []\n const slug = this.getSlug(reflection.name)\n // Use group prefix (e.g., \"interfaces\", \"classes\") when at top level\n const groupPrefix = parentPath ? \"\" : this.getGroupUrlPrefix(reflection.kind)\n const currentPath = parentPath\n ? `${parentPath}/${slug}`\n : groupPrefix\n ? `${groupPrefix}/${slug}`\n : slug\n\n // Generate main page for this reflection\n docs.push(this.generateReflectionPage(reflection, currentPath, prev, next))\n\n // Generate pages for child classes, interfaces, etc.\n // Functions are grouped by source file, not individual pages\n const children = reflection.children || []\n const hasOwnPage = [\n ReflectionKind.Class,\n ReflectionKind.Interface,\n ReflectionKind.Enum,\n ReflectionKind.Namespace,\n ReflectionKind.Module,\n ]\n\n for (const child of children) {\n if (hasOwnPage.includes(child.kind)) {\n docs.push(...this.generateReflectionDocs(child, currentPath))\n }\n }\n\n return docs\n }\n\n private generateReflectionPage(\n reflection: DeclarationReflection,\n pagePath: string,\n prev: DeclarationReflection | null = null,\n next: DeclarationReflection | null = null\n ): GeneratedApiDoc {\n const kind = this.getKindName(reflection.kind)\n const content: string[] = []\n\n // Breadcrumbs\n if (this.config.markdown?.breadcrumbs) {\n content.push(this.generateBreadcrumbs(pagePath))\n content.push(\"\")\n }\n\n // Title\n content.push(`# ${kind}: ${reflection.name}`)\n content.push(\"\")\n\n // Description\n if (reflection.comment?.summary) {\n content.push(this.renderComment(reflection.comment.summary))\n content.push(\"\")\n }\n\n // Type parameters\n if (reflection.typeParameters && reflection.typeParameters.length > 0) {\n content.push(\"## Type Parameters\")\n content.push(\"\")\n content.push(this.renderTypeParameters(reflection.typeParameters))\n content.push(\"\")\n }\n\n // Hierarchy\n if (this.config.markdown?.hierarchy) {\n const hierarchy = this.renderHierarchy(reflection)\n if (hierarchy) {\n content.push(\"## Hierarchy\")\n content.push(\"\")\n content.push(hierarchy)\n content.push(\"\")\n }\n }\n\n // Signature (for functions)\n if (reflection.signatures) {\n content.push(\"## Signature\")\n content.push(\"\")\n for (const sig of reflection.signatures) {\n content.push(this.renderSignature(sig))\n content.push(\"\")\n }\n }\n\n // Properties\n const properties = (reflection.children || []).filter((c) => c.kind === ReflectionKind.Property)\n if (properties.length > 0) {\n content.push(\"## Properties\")\n content.push(\"\")\n for (const prop of properties) {\n content.push(this.renderProperty(prop))\n content.push(\"\")\n }\n }\n\n // Methods\n const methods = (reflection.children || []).filter((c) => c.kind === ReflectionKind.Method)\n if (methods.length > 0) {\n content.push(\"## Methods\")\n content.push(\"\")\n for (const method of methods) {\n content.push(this.renderMethod(method))\n content.push(\"\")\n }\n }\n\n // Enum members\n const enumMembers = (reflection.children || []).filter(\n (c) => c.kind === ReflectionKind.EnumMember\n )\n if (enumMembers.length > 0) {\n content.push(\"## Members\")\n content.push(\"\")\n content.push(\"| Member | Value | Description |\")\n content.push(\"|--------|-------|-------------|\")\n for (const member of enumMembers) {\n const value = member.defaultValue || \"\"\n const desc = member.comment?.summary ? this.renderCommentShort(member.comment.summary) : \"\"\n content.push(`| \\`${member.name}\\` | \\`${value}\\` | ${desc} |`)\n }\n content.push(\"\")\n }\n\n // Type alias definition\n if (reflection.kind === ReflectionKind.TypeAlias && reflection.type) {\n content.push(\"## Type\")\n content.push(\"\")\n content.push(\"```typescript\")\n content.push(`type ${reflection.name} = ${reflection.type.toString()}`)\n content.push(\"```\")\n content.push(\"\")\n }\n\n // Source link\n if (this.config.markdown?.sourceLinks && reflection.sources?.[0]) {\n const source = reflection.sources[0]\n const sourceUrl = this.getSourceUrl(source.fileName, source.line)\n content.push(\"## Source\")\n content.push(\"\")\n if (sourceUrl) {\n content.push(`[${source.fileName}:${source.line}](${sourceUrl})`)\n } else {\n content.push(`${source.fileName}:${source.line}`)\n }\n content.push(\"\")\n }\n\n // Tags (deprecated, example, etc.)\n if (reflection.comment?.blockTags) {\n const examples = reflection.comment.blockTags.filter((t) => t.tag === \"@example\")\n if (examples.length > 0) {\n content.push(\"## Examples\")\n content.push(\"\")\n for (const example of examples) {\n content.push(this.renderComment(example.content))\n content.push(\"\")\n }\n }\n\n const deprecated = reflection.comment.blockTags.find((t) => t.tag === \"@deprecated\")\n if (deprecated) {\n content.push('<Warning title=\"Deprecated\">')\n content.push(this.renderComment(deprecated.content))\n content.push(\"</Warning>\")\n content.push(\"\")\n }\n\n const see = reflection.comment.blockTags.filter((t) => t.tag === \"@see\")\n if (see.length > 0) {\n content.push(\"## See Also\")\n content.push(\"\")\n for (const s of see) {\n content.push(`- ${this.renderComment(s.content)}`)\n }\n content.push(\"\")\n }\n }\n\n // Prev/Next navigation within group\n if (prev || next) {\n content.push(\"---\")\n content.push(\"\")\n const groupPrefix = this.getGroupUrlPrefix(reflection.kind)\n const prevLink = prev\n ? `[← ${prev.name}](${this.buildLink(groupPrefix, this.getSlug(prev.name))})`\n : \"\"\n const nextLink = next\n ? `[${next.name} →](${this.buildLink(groupPrefix, this.getSlug(next.name))})`\n : \"\"\n if (prev && next) {\n content.push(`${prevLink} | ${nextLink}`)\n } else {\n content.push(prevLink || nextLink)\n }\n content.push(\"\")\n }\n\n return {\n path: `${pagePath}.md`,\n content: content.join(\"\\n\"),\n frontmatter: {\n title: reflection.name,\n description: reflection.comment?.summary\n ? this.renderCommentShort(reflection.comment.summary)\n : `${kind} ${reflection.name}`,\n },\n }\n }\n\n private renderSignature(sig: SignatureReflection): string {\n const lines: string[] = []\n\n if (this.config.markdown?.codeBlocks) {\n lines.push(\"```typescript\")\n }\n\n const typeParams = sig.typeParameters\n ? `<${sig.typeParameters.map((tp) => tp.name).join(\", \")}>`\n : \"\"\n\n const params = (sig.parameters || [])\n .map((p) => {\n const optional = p.flags.isOptional ? \"?\" : \"\"\n const type = p.type ? `: ${p.type.toString()}` : \"\"\n return `${p.name}${optional}${type}`\n })\n .join(\", \")\n\n const returnType = sig.type ? `: ${sig.type.toString()}` : \"\"\n\n lines.push(`function ${sig.name}${typeParams}(${params})${returnType}`)\n\n if (this.config.markdown?.codeBlocks) {\n lines.push(\"```\")\n }\n\n // Parameters table\n if (sig.parameters && sig.parameters.length > 0) {\n lines.push(\"\")\n lines.push(\"### Parameters\")\n lines.push(\"\")\n lines.push(\"| Name | Type | Description |\")\n lines.push(\"|------|------|-------------|\")\n\n for (const param of sig.parameters) {\n const type = param.type ? `\\`${param.type.toString()}\\`` : \"-\"\n const desc = param.comment?.summary ? this.renderCommentShort(param.comment.summary) : \"-\"\n const optional = param.flags.isOptional ? \" (optional)\" : \"\"\n lines.push(`| ${param.name}${optional} | ${type} | ${desc} |`)\n }\n }\n\n // Return value\n if (sig.type && sig.type.toString() !== \"void\") {\n lines.push(\"\")\n lines.push(\"### Returns\")\n lines.push(\"\")\n lines.push(`\\`${sig.type.toString()}\\``)\n\n if (sig.comment?.blockTags) {\n const returns = sig.comment.blockTags.find((t) => t.tag === \"@returns\")\n if (returns) {\n lines.push(\"\")\n lines.push(this.renderComment(returns.content))\n }\n }\n }\n\n return lines.join(\"\\n\")\n }\n\n private renderProperty(prop: DeclarationReflection): string {\n const lines: string[] = []\n\n const flags: string[] = []\n if (prop.flags.isOptional) flags.push(\"optional\")\n if (prop.flags.isReadonly) flags.push(\"readonly\")\n if (prop.flags.isStatic) flags.push(\"static\")\n\n lines.push(`### ${prop.name}`)\n if (flags.length > 0) {\n lines.push(`*${flags.join(\", \")}*`)\n }\n lines.push(\"\")\n\n if (prop.type) {\n lines.push(\"```typescript\")\n lines.push(`${prop.name}: ${prop.type.toString()}`)\n lines.push(\"```\")\n lines.push(\"\")\n }\n\n if (prop.comment?.summary) {\n lines.push(this.renderComment(prop.comment.summary))\n }\n\n if (prop.defaultValue) {\n lines.push(\"\")\n lines.push(`**Default:** \\`${prop.defaultValue}\\``)\n }\n\n return lines.join(\"\\n\")\n }\n\n private renderMethod(method: DeclarationReflection): string {\n const lines: string[] = []\n\n lines.push(`### ${method.name}()`)\n lines.push(\"\")\n\n if (method.signatures) {\n for (const sig of method.signatures) {\n if (sig.comment?.summary) {\n lines.push(this.renderComment(sig.comment.summary))\n lines.push(\"\")\n }\n\n lines.push(this.renderSignature(sig))\n lines.push(\"\")\n }\n }\n\n return lines.join(\"\\n\")\n }\n\n private renderTypeParameters(typeParams: TypeParameterReflection[]): string {\n const lines: string[] = []\n lines.push(\"| Name | Constraint | Default | Description |\")\n lines.push(\"|------|------------|---------|-------------|\")\n\n for (const tp of typeParams) {\n const constraint = tp.type ? `\\`${tp.type.toString()}\\`` : \"-\"\n const defaultVal = tp.default ? `\\`${tp.default.toString()}\\`` : \"-\"\n const desc = tp.comment?.summary ? this.renderCommentShort(tp.comment.summary) : \"-\"\n lines.push(`| ${tp.name} | ${constraint} | ${defaultVal} | ${desc} |`)\n }\n\n return lines.join(\"\\n\")\n }\n\n private renderHierarchy(reflection: DeclarationReflection): string | null {\n const lines: string[] = []\n\n if (reflection.extendedTypes && reflection.extendedTypes.length > 0) {\n lines.push(\"**Extends:**\")\n for (const t of reflection.extendedTypes) {\n lines.push(`- \\`${t.toString()}\\``)\n }\n }\n\n if (reflection.implementedTypes && reflection.implementedTypes.length > 0) {\n lines.push(\"**Implements:**\")\n for (const t of reflection.implementedTypes) {\n lines.push(`- \\`${t.toString()}\\``)\n }\n }\n\n if (reflection.extendedBy && reflection.extendedBy.length > 0) {\n lines.push(\"**Extended by:**\")\n for (const t of reflection.extendedBy) {\n lines.push(`- \\`${t.toString()}\\``)\n }\n }\n\n if (reflection.implementedBy && reflection.implementedBy.length > 0) {\n lines.push(\"**Implemented by:**\")\n for (const t of reflection.implementedBy) {\n lines.push(`- \\`${t.toString()}\\``)\n }\n }\n\n return lines.length > 0 ? lines.join(\"\\n\") : null\n }\n\n private renderComment(parts: { kind: string; text: string }[]): string {\n return parts.map((p) => p.text).join(\"\")\n }\n\n private renderCommentShort(parts: { kind: string; text: string }[]): string {\n const text = this.renderComment(parts)\n const firstSentence = text.split(/[.!?]\\s/)[0]\n return firstSentence.length < text.length ? firstSentence + \".\" : text\n }\n\n private generateBreadcrumbs(pagePath: string): string {\n const parts = pagePath.split(\"/\")\n const breadcrumbs: string[] = [`[API](${this.basePath})`]\n\n let currentPath = \"\"\n for (let i = 0; i < parts.length - 1; i++) {\n currentPath += (currentPath ? \"/\" : \"\") + parts[i]\n breadcrumbs.push(`[${parts[i]}](${this.basePath}/${currentPath})`)\n }\n\n breadcrumbs.push(parts[parts.length - 1])\n\n return breadcrumbs.join(\" / \")\n }\n\n private getKindName(kind: ReflectionKind): string {\n const kindNames: Partial<Record<ReflectionKind, string>> = {\n [ReflectionKind.Class]: \"Class\",\n [ReflectionKind.Interface]: \"Interface\",\n [ReflectionKind.Enum]: \"Enum\",\n [ReflectionKind.TypeAlias]: \"Type\",\n [ReflectionKind.Function]: \"Function\",\n [ReflectionKind.Variable]: \"Variable\",\n [ReflectionKind.Namespace]: \"Namespace\",\n [ReflectionKind.Module]: \"Module\",\n [ReflectionKind.Property]: \"Property\",\n [ReflectionKind.Method]: \"Method\",\n }\n return kindNames[kind] || \"Unknown\"\n }\n\n private getGroupUrlPrefix(kind: ReflectionKind): string {\n const prefixes: Partial<Record<ReflectionKind, string>> = {\n [ReflectionKind.Class]: \"classes\",\n [ReflectionKind.Interface]: \"interfaces\",\n [ReflectionKind.Enum]: \"enums\",\n [ReflectionKind.Variable]: \"variables\",\n [ReflectionKind.Namespace]: \"namespaces\",\n [ReflectionKind.Module]: \"modules\",\n }\n return prefixes[kind] || \"other\"\n }\n\n private getSlug(name: string): string {\n return name\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-|-$/g, \"\")\n }\n\n /**\n * Build a route-compatible link path for a category/slug pair.\n * React Router maps \"category/index.md\" to the \"/category\" route,\n * so links must not include a trailing \"/index\".\n */\n private buildLink(category: string, slug: string): string {\n if (slug === \"index\") {\n return `${this.basePath}/${category}`\n }\n return `${this.basePath}/${category}/${slug}`\n }\n\n private getSourceUrl(fileName: string, line: number): string | null {\n if (!this.config.markdown?.sourceBaseUrl) return null\n const baseUrl = this.config.markdown.sourceBaseUrl.replace(/\\/$/, \"\")\n return `${baseUrl}/${fileName}#L${line}`\n }\n\n /**\n * Check if a function name looks like a React component (PascalCase)\n */\n private isReactComponent(name: string): boolean {\n // React components start with uppercase and don't contain underscores\n // Also check for common component patterns\n if (name[0] !== name[0].toUpperCase()) return false\n if (name.includes(\"_\")) return false\n // Exclude common non-component patterns\n if (name.startsWith(\"use\")) return false // hooks\n if (name.endsWith(\"Props\") || name.endsWith(\"Options\") || name.endsWith(\"Config\")) return false\n return true\n }\n\n /**\n * Generate a page for a React component\n */\n private generateComponentPage(\n component: DeclarationReflection,\n prev: DeclarationReflection | null,\n next: DeclarationReflection | null\n ): GeneratedApiDoc {\n const slug = this.getSlug(component.name)\n const groupPrefix = \"components\"\n const content: string[] = []\n\n content.push(`# ${component.name}`)\n content.push(\"\")\n\n // Description\n if (component.comment?.summary) {\n content.push(this.renderComment(component.comment.summary))\n content.push(\"\")\n }\n\n // Signature\n if (component.signatures) {\n content.push(\"## Usage\")\n content.push(\"\")\n for (const sig of component.signatures) {\n content.push(this.renderComponentSignature(sig, component.name))\n content.push(\"\")\n }\n }\n\n // Examples\n if (component.comment?.blockTags) {\n const examples = component.comment.blockTags.filter((t) => t.tag === \"@example\")\n if (examples.length > 0) {\n content.push(\"## Example\")\n content.push(\"\")\n for (const example of examples) {\n content.push(this.renderComment(example.content))\n content.push(\"\")\n }\n }\n }\n\n // Source link\n if (this.config.markdown?.sourceLinks && component.sources?.[0]) {\n const source = component.sources[0]\n const sourceUrl = this.getSourceUrl(source.fileName, source.line)\n if (sourceUrl) {\n content.push(`[Source](${sourceUrl})`)\n content.push(\"\")\n }\n }\n\n // Prev/Next navigation\n if (prev || next) {\n content.push(\"---\")\n content.push(\"\")\n const prevLink = prev\n ? `[← ${prev.name}](${this.buildLink(groupPrefix, this.getSlug(prev.name))})`\n : \"\"\n const nextLink = next\n ? `[${next.name} →](${this.buildLink(groupPrefix, this.getSlug(next.name))})`\n : \"\"\n if (prev && next) {\n content.push(`${prevLink} | ${nextLink}`)\n } else {\n content.push(prevLink || nextLink)\n }\n content.push(\"\")\n }\n\n return {\n path: `${groupPrefix}/${slug}.md`,\n content: content.join(\"\\n\"),\n frontmatter: {\n title: component.name,\n description: component.comment?.summary\n ? this.renderCommentShort(component.comment.summary)\n : `${component.name} component`,\n },\n }\n }\n\n /**\n * Get the name of a TypeDoc type (handles reference types, etc.)\n */\n private getTypeName(paramType: unknown): string | null {\n if (!paramType || typeof paramType !== \"object\") return null\n\n // Direct name property\n if (\"name\" in paramType && typeof (paramType as { name: unknown }).name === \"string\") {\n return (paramType as { name: string }).name\n }\n\n // Reference type with target\n if (\"type\" in paramType && (paramType as { type: string }).type === \"reference\") {\n const refType = paramType as { name?: string; qualifiedName?: string }\n return refType.name || refType.qualifiedName || null\n }\n\n return null\n }\n\n /**\n * Get props from a component's parameter type\n */\n private getPropsFromType(\n paramType: unknown\n ): Array<{ name: string; type: string; optional: boolean; description: string }> {\n const props: Array<{ name: string; type: string; optional: boolean; description: string }> = []\n\n // Check if it's a reflection type with inline declaration\n if (paramType && typeof paramType === \"object\" && \"declaration\" in paramType) {\n const declaration = (paramType as { declaration: DeclarationReflection }).declaration\n const children = declaration.children || []\n for (const child of children) {\n props.push({\n name: child.name,\n type: child.type ? child.type.toString() : \"unknown\",\n optional: child.flags.isOptional,\n description: child.comment?.summary ? this.renderCommentShort(child.comment.summary) : \"\",\n })\n }\n }\n // Check if it's a reference type - look up the interface in the project\n else {\n const typeName = this.getTypeName(paramType)\n if (typeName) {\n // Find the interface/type alias in the project\n let propsInterface = this.project?.getChildByName(typeName)\n\n // If not found directly, search all children\n if (!propsInterface && this.project?.children) {\n for (const child of this.project.children) {\n if (child.name === typeName) {\n propsInterface = child\n break\n }\n }\n }\n\n if (propsInterface && \"children\" in propsInterface) {\n const children = (propsInterface as DeclarationReflection).children || []\n for (const child of children) {\n props.push({\n name: child.name,\n type: child.type ? child.type.toString() : \"unknown\",\n optional: child.flags.isOptional,\n description: child.comment?.summary\n ? this.renderCommentShort(child.comment.summary)\n : \"\",\n })\n }\n }\n }\n }\n\n return props\n }\n\n /**\n * Render a component signature in a more readable format\n */\n private renderComponentSignature(sig: SignatureReflection, componentName: string): string {\n const lines: string[] = []\n\n // Get props from the first parameter\n const propsParam = sig.parameters?.[0]\n const props = propsParam ? this.getPropsFromType(propsParam.type) : []\n\n // Get the props interface name for linking\n const propsTypeName = propsParam?.type ? this.getTypeName(propsParam.type) : null\n\n // Check if component has children prop\n const hasChildren = props.some((p) => p.name === \"children\")\n // Filter out children from props display (shown in JSX structure instead)\n const displayProps = props.filter((p) => p.name !== \"children\")\n\n lines.push(\"```tsx\")\n lines.push(`<${componentName}`)\n\n if (displayProps.length > 0) {\n for (const prop of displayProps) {\n const optMark = prop.optional ? \"?\" : \"\"\n lines.push(` ${prop.name}${optMark}={${prop.type}}`)\n }\n } else if (!hasChildren) {\n lines.push(` {...props}`)\n }\n\n if (hasChildren) {\n lines.push(`>`)\n lines.push(` {children}`)\n lines.push(`</${componentName}>`)\n } else {\n lines.push(`/>`)\n }\n lines.push(\"```\")\n\n // Props table with link to props interface\n if (props.length > 0) {\n lines.push(\"\")\n if (propsTypeName) {\n lines.push(`## [Props](${this.basePath}/interfaces/${this.getSlug(propsTypeName)})`)\n } else {\n lines.push(\"## Props\")\n }\n lines.push(\"\")\n lines.push(\"| Prop | Type | Required | Description |\")\n lines.push(\"|------|------|----------|-------------|\")\n\n for (const prop of props) {\n const type = `\\`${prop.type}\\``\n const required = prop.optional ? \"No\" : \"Yes\"\n const desc = prop.description || \"-\"\n lines.push(`| ${prop.name} | ${type} | ${required} | ${desc} |`)\n }\n }\n\n // Skip return value for components - it's always Element/JSX.Element\n\n return lines.join(\"\\n\")\n }\n}\n\nexport async function generateApiDocs(\n config: TypeDocConfig,\n outputDir: string\n): Promise<GeneratedApiDoc[]> {\n const generator = new TypeDocGenerator(config)\n return generator.generate(outputDir)\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OAIK;AACP,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,SAAS,qBAAqB;AAGvB,IAAM,mBAAN,MAAuB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB,oBAAI,IAAgC;AAAA,EAE/D,YAAY,QAAuB;AACjC,SAAK,SAAS;AAAA,MACZ,KAAK;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,MAClB,iBAAiB;AAAA,MACjB,MAAM,CAAC,cAAc;AAAA,MACrB,SAAS;AAAA,QACP,OAAO;AAAA,QACP,UAAU;AAAA,QACV,WAAW;AAAA,MACb;AAAA,MACA,UAAU;AAAA,QACR,aAAa;AAAA,QACb,WAAW;AAAA,QACX,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,MACA,GAAG;AAAA,IACL;AAEA,SAAK,WAAW,MAAM,KAAK,OAAO;AAAA,EACpC;AAAA,EAEA,MAAM,SAAS,WAA+C;AAE5D,UAAM,QAAQ,IAAI,KAAK,OAAO,YAAY,IAAI,CAAC,OAAO,KAAK,mBAAmB,EAAE,CAAC,CAAC;AAElF,UAAM,iBAA0C;AAAA,MAC9C,aAAa,KAAK,OAAO;AAAA,MACzB,UAAU,KAAK,O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;AACd,YAAM,KAAK,cAAc;AACzB,YAAM,KAAK,KAAK,aAAa,GAAG;AAAA,IAClC,OAAO;AACL,YAAM,KAAK,IAAI;AAAA,IACjB;AACA,UAAM,KAAK,KAAK;AAGhB,QAAI,MAAM,SAAS,GAAG;AACpB,YAAM,KAAK,EAAE;AACb,UAAI,eAAe;AACjB,cAAM,KAAK,cAAc,KAAK,QAAQ,eAAe,KAAK,QAAQ,aAAa,CAAC,GAAG;AAAA,MACrF,OAAO;AACL,cAAM,KAAK,UAAU;AAAA,MACvB;AACA,YAAM,KAAK,EAAE;AACb,YAAM,KAAK,0CAA0C;AACrD,YAAM,KAAK,0CAA0C;AAErD,iBAAW,QAAQ,OAAO;AACxB,cAAM,OAAO,KAAK,KAAK,IAAI;AAC3B,cAAM,WAAW,KAAK,WAAW,OAAO;AACxC,cAAM,OAAO,KAAK,eAAe;AACjC,cAAM,KAAK,KAAK,KAAK,IAAI,MAAM,IAAI,MAAM,QAAQ,MAAM,IAAI,IAAI;AAAA,MACjE;AAAA,IACF;AAIA,WAAO,MAAM,KAAK,IAAI;AAAA,EACxB;AACF;AAEA,eAAsB,gBACpB,QACA,WAC4B;AAC5B,QAAM,YAAY,IAAI,iBAAiB,MAAM;AAC7C,SAAO,UAAU,SAAS,SAAS;AACrC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Content
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UWFMFHRD.js";
|
|
4
4
|
import {
|
|
5
5
|
ChevronDownIcon,
|
|
6
6
|
GithubIcon,
|
|
@@ -841,4 +841,4 @@ export {
|
|
|
841
841
|
Steps,
|
|
842
842
|
FileTree
|
|
843
843
|
};
|
|
844
|
-
//# sourceMappingURL=chunk-
|
|
844
|
+
//# sourceMappingURL=chunk-TDBU2FXP.js.map
|