@forge-ts/gen 0.2.0 → 0.2.1

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/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @forge-ts/gen
2
+
3
+ Documentation output generator for the [forge-ts](https://github.com/kryptobaseddev/forge-ts) toolchain. Produces Markdown, MDX, llms.txt, and README sync.
4
+
5
+ ## When to use this package
6
+
7
+ **Most users should install `@forge-ts/cli` instead** and use `npx forge-ts build`. This package is for programmatic use.
8
+
9
+ ```bash
10
+ npm install @forge-ts/gen
11
+ ```
12
+
13
+ ## What it generates
14
+
15
+ - **Markdown/MDX** - Grouped by symbol kind, with TOC, source links, and deprecation notices
16
+ - **SSG targeting** - Frontmatter for Docusaurus, Mintlify, Nextra, or VitePress
17
+ - **llms.txt** - Routing manifest for AI agents
18
+ - **llms-full.txt** - Dense context with full params, returns, and examples
19
+ - **README sync** - Injects API summaries between `<!-- forge-ts:start/end -->` markers
20
+
21
+ ## Example
22
+
23
+ ```typescript
24
+ import { loadConfig, createWalker } from "@forge-ts/core";
25
+ import { generateMarkdown, generateLlmsTxt } from "@forge-ts/gen";
26
+
27
+ const config = await loadConfig();
28
+ const walker = createWalker(config);
29
+ const symbols = walker.walk();
30
+
31
+ const markdown = generateMarkdown(symbols, config, { mdx: false });
32
+ const llms = generateLlmsTxt(symbols, config);
33
+ ```
34
+
35
+ ## Part of forge-ts
36
+
37
+ See the [main repo](https://github.com/kryptobaseddev/forge-ts) for full documentation.
38
+
39
+ ## License
40
+
41
+ MIT
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ForgeSymbol, ForgeConfig, ForgeResult } from '@codluv/forge-core';
1
+ import { ForgeSymbol, ForgeConfig, ForgeResult } from '@forge-ts/core';
2
2
 
3
3
  /**
4
4
  * Generates an `llms.txt` routing manifest from the extracted symbols.
@@ -67,7 +67,7 @@ interface ReadmeSyncOptions {
67
67
  declare function syncReadme(readmePath: string, symbols: ForgeSymbol[], options?: ReadmeSyncOptions): Promise<boolean>;
68
68
 
69
69
  /**
70
- * @codluv/forge-gen — Markdown/MDX documentation and llms.txt generator.
70
+ * @forge-ts/gen — Markdown/MDX documentation and llms.txt generator.
71
71
  *
72
72
  * Generates human- and machine-readable documentation from the forge-ts
73
73
  * symbol graph, with optional README injection.
package/dist/index.js CHANGED
@@ -410,7 +410,7 @@ ${injection}
410
410
  // src/index.ts
411
411
  import { mkdir, writeFile as writeFile2 } from "fs/promises";
412
412
  import { join } from "path";
413
- import { createWalker } from "@codluv/forge-core";
413
+ import { createWalker } from "@forge-ts/core";
414
414
  async function generate(config) {
415
415
  const start = Date.now();
416
416
  const walker = createWalker(config);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/llms.ts","../src/markdown.ts","../src/readme-sync.ts","../src/index.ts"],"sourcesContent":["import type { ForgeConfig, ForgeSymbol } from \"@codluv/forge-core\";\n\n/**\n * Derives a compact one-line signature for routing manifest entries.\n * @internal\n */\nfunction compactEntry(symbol: ForgeSymbol): string {\n\tif (symbol.signature) {\n\t\treturn symbol.signature;\n\t}\n\tconst ext = symbol.kind === \"function\" ? \"()\" : \"\";\n\treturn `${symbol.kind} ${symbol.name}${ext}`;\n}\n\n/**\n * Generates an `llms.txt` routing manifest from the extracted symbols.\n *\n * The file follows the llms.txt specification: a compact, structured overview\n * designed to help large language models navigate a project's documentation.\n *\n * @param symbols - The symbols to include.\n * @param config - The resolved {@link ForgeConfig}.\n * @returns The generated `llms.txt` content as a string.\n * @public\n */\nexport function generateLlmsTxt(symbols: ForgeSymbol[], config: ForgeConfig): string {\n\tconst exported = symbols.filter((s) => s.exported);\n\tconst projectName = config.rootDir.split(\"/\").pop() ?? \"Project\";\n\n\tconst lines: string[] = [];\n\n\tlines.push(`# ${projectName}`);\n\tlines.push(`> Auto-generated API documentation`);\n\tlines.push(\"\");\n\n\t// Sections block — link to generated files\n\tlines.push(\"## Sections\");\n\tlines.push(\"\");\n\tif (config.gen.formats.includes(\"markdown\")) {\n\t\tlines.push(\"- [API Reference](./api-reference.md): Full API documentation\");\n\t}\n\tif (config.gen.formats.includes(\"mdx\")) {\n\t\tlines.push(\"- [API Reference](./api-reference.mdx): Full API documentation (MDX)\");\n\t}\n\tif (config.gen.llmsTxt) {\n\t\tlines.push(\"- [Full Context](./llms-full.txt): Dense context for LLM consumption\");\n\t}\n\tlines.push(\"\");\n\n\t// Quick Reference block\n\tif (exported.length > 0) {\n\t\tlines.push(\"## Quick Reference\");\n\t\tlines.push(\"\");\n\t\tfor (const symbol of exported) {\n\t\t\tconst summary = symbol.documentation?.summary ?? \"\";\n\t\t\tconst entry = compactEntry(symbol);\n\t\t\tlines.push(summary ? `${entry} - ${summary}` : entry);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Renders a full parameter list section.\n * @internal\n */\nfunction renderParams(params: NonNullable<ForgeSymbol[\"documentation\"]>[\"params\"]): string {\n\tif (!params || params.length === 0) return \"\";\n\tconst lines: string[] = [\"\", \"Parameters:\"];\n\tfor (const p of params) {\n\t\tconst typeStr = p.type ? ` (${p.type})` : \"\";\n\t\tlines.push(`- ${p.name}${typeStr}: ${p.description}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Renders a single symbol section for llms-full.txt.\n * @internal\n */\nfunction renderFullSymbol(symbol: ForgeSymbol, depth: number): string {\n\tconst hashes = \"#\".repeat(depth);\n\tconst ext = symbol.kind === \"function\" || symbol.kind === \"method\" ? \"()\" : \"\";\n\tconst lines: string[] = [];\n\n\tlines.push(`${hashes} ${symbol.name}${ext}`);\n\n\tif (symbol.signature) {\n\t\tlines.push(\"\");\n\t\tlines.push(symbol.signature);\n\t}\n\n\tif (symbol.documentation?.deprecated) {\n\t\tlines.push(\"\");\n\t\tlines.push(`DEPRECATED: ${symbol.documentation.deprecated}`);\n\t}\n\n\tif (symbol.documentation?.summary) {\n\t\tlines.push(\"\");\n\t\tlines.push(symbol.documentation.summary);\n\t}\n\n\tconst params = symbol.documentation?.params ?? [];\n\tconst paramBlock = renderParams(params);\n\tif (paramBlock) {\n\t\tlines.push(paramBlock);\n\t}\n\n\tif (symbol.documentation?.returns) {\n\t\tconst retType = symbol.documentation.returns.type\n\t\t\t? ` (${symbol.documentation.returns.type})`\n\t\t\t: \"\";\n\t\tlines.push(\"\");\n\t\tlines.push(`Returns${retType}: ${symbol.documentation.returns.description}`);\n\t}\n\n\tconst examples = symbol.documentation?.examples ?? [];\n\tif (examples.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Example:\");\n\t\tfor (const ex of examples) {\n\t\t\tconst exLines = ex.code.trim().split(\"\\n\");\n\t\t\tfor (const l of exLines) {\n\t\t\t\tlines.push(` ${l}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Render children inline\n\tconst children = symbol.children ?? [];\n\tif (children.length > 0 && depth < 5) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Members:\");\n\t\tfor (const child of children) {\n\t\t\tlines.push(\"\");\n\t\t\tconst childSection = renderFullSymbol(child, depth + 1);\n\t\t\t// indent child one level\n\t\t\tfor (const cl of childSection.split(\"\\n\")) {\n\t\t\t\tlines.push(cl);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Generates an `llms-full.txt` dense context file from the extracted symbols.\n *\n * Unlike `llms.txt`, this file contains complete documentation for every\n * exported symbol, intended for LLM ingestion that requires full context.\n *\n * @param symbols - The symbols to include.\n * @param config - The resolved {@link ForgeConfig}.\n * @returns The generated `llms-full.txt` content as a string.\n * @public\n */\nexport function generateLlmsFullTxt(symbols: ForgeSymbol[], config: ForgeConfig): string {\n\tconst exported = symbols.filter(\n\t\t(s) => s.exported && s.kind !== \"method\" && s.kind !== \"property\",\n\t);\n\tconst projectName = config.rootDir.split(\"/\").pop() ?? \"Project\";\n\n\tconst lines: string[] = [];\n\n\tlines.push(`# ${projectName} - Full Context`);\n\tlines.push(\"\");\n\tlines.push(`Root: ${config.rootDir}`);\n\tlines.push(`Generated: ${new Date().toISOString()}`);\n\tlines.push(\"\");\n\n\t// Group by kind\n\tconst kindGroups: Record<string, ForgeSymbol[]> = {};\n\tfor (const symbol of exported) {\n\t\tconst list = kindGroups[symbol.kind] ?? [];\n\t\tlist.push(symbol);\n\t\tkindGroups[symbol.kind] = list;\n\t}\n\n\tconst kindOrder: Array<ForgeSymbol[\"kind\"]> = [\n\t\t\"function\",\n\t\t\"class\",\n\t\t\"interface\",\n\t\t\"type\",\n\t\t\"enum\",\n\t\t\"variable\",\n\t];\n\n\tconst kindLabels: Record<string, string> = {\n\t\tfunction: \"Functions\",\n\t\tclass: \"Classes\",\n\t\tinterface: \"Interfaces\",\n\t\ttype: \"Types\",\n\t\tenum: \"Enums\",\n\t\tvariable: \"Variables\",\n\t};\n\n\tfor (const kind of kindOrder) {\n\t\tconst group = kindGroups[kind];\n\t\tif (!group || group.length === 0) continue;\n\n\t\tlines.push(`## ${kindLabels[kind]}`);\n\t\tlines.push(\"\");\n\n\t\tfor (const symbol of group) {\n\t\t\tlines.push(renderFullSymbol(symbol, 3));\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\treturn `${lines\n\t\t.join(\"\\n\")\n\t\t.replace(/\\n{3,}/g, \"\\n\\n\")\n\t\t.trimEnd()}\\n`;\n}\n","import { relative } from \"node:path\";\nimport type { ForgeConfig, ForgeSymbol } from \"@codluv/forge-core\";\n\n/**\n * Options controlling Markdown output.\n * @public\n */\nexport interface MarkdownOptions {\n\t/** Whether to use MDX syntax (default: Markdown). */\n\tmdx?: boolean;\n}\n\n/** Display labels for each symbol kind. */\nconst KIND_LABELS: Record<ForgeSymbol[\"kind\"], string> = {\n\tfunction: \"Functions\",\n\tclass: \"Classes\",\n\tinterface: \"Interfaces\",\n\ttype: \"Types\",\n\tenum: \"Enums\",\n\tvariable: \"Variables\",\n\tmethod: \"Methods\",\n\tproperty: \"Properties\",\n};\n\n/** Canonical ordering for top-level kind groups. */\nconst KIND_ORDER: Array<ForgeSymbol[\"kind\"]> = [\n\t\"function\",\n\t\"class\",\n\t\"interface\",\n\t\"type\",\n\t\"enum\",\n\t\"variable\",\n];\n\n/** Convert a label to a GitHub-compatible anchor slug. */\nfunction toAnchor(text: string): string {\n\treturn text\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9\\s-]/g, \"\")\n\t\t.trim()\n\t\t.replace(/\\s+/g, \"-\");\n}\n\n/** Build the frontmatter block for the configured SSG target. */\nfunction buildFrontmatter(config: ForgeConfig, mdx: boolean): string {\n\tconst target = config.gen.ssgTarget;\n\tif (!target) return \"\";\n\n\tconst lines: string[] = [\"---\"];\n\n\tswitch (target) {\n\t\tcase \"docusaurus\":\n\t\t\tlines.push(\"sidebar_position: 1\");\n\t\t\tlines.push(\"title: API Reference\");\n\t\t\tbreak;\n\t\tcase \"mintlify\":\n\t\t\tlines.push(\"title: API Reference\");\n\t\t\tbreak;\n\t\tcase \"nextra\":\n\t\t\tlines.push(\"title: API Reference\");\n\t\t\tlines.push(\"description: Auto-generated API reference\");\n\t\t\tbreak;\n\t\tcase \"vitepress\":\n\t\t\tlines.push(\"title: API Reference\");\n\t\t\tlines.push(\"outline: deep\");\n\t\t\tbreak;\n\t}\n\n\tlines.push(\"---\");\n\tif (mdx) {\n\t\tlines.push(\"\");\n\t}\n\treturn `${lines.join(\"\\n\")}\\n`;\n}\n\n/** Build MDX import block for custom components. */\nfunction buildMdxImports(): string {\n\treturn 'import { Callout } from \"@components/Callout\";\\n\\n';\n}\n\n/**\n * Render a deprecation notice banner.\n * @internal\n */\nfunction renderDeprecation(deprecated: string): string {\n\treturn `> **Deprecated**: ${deprecated}\\n`;\n}\n\n/**\n * Render source location line.\n * @internal\n */\nfunction renderSourceLink(symbol: ForgeSymbol, rootDir: string): string {\n\tconst rel = relative(rootDir, symbol.filePath);\n\treturn `_Defined in \\`${rel}:${symbol.line}\\`_\\n`;\n}\n\n/**\n * Renders a symbol at H3 level (used for both top-level and children).\n * @internal\n */\nfunction renderSymbolSection(\n\tsymbol: ForgeSymbol,\n\trootDir: string,\n\tmdx: boolean,\n\tdepth: number,\n): string {\n\tconst lines: string[] = [];\n\tconst hashes = \"#\".repeat(depth);\n\tconst ext = symbol.kind === \"function\" || symbol.kind === \"method\" ? \"()\" : \"\";\n\tlines.push(`${hashes} \\`${symbol.name}${ext}\\``);\n\tlines.push(\"\");\n\n\tif (symbol.documentation?.deprecated) {\n\t\tlines.push(renderDeprecation(symbol.documentation.deprecated));\n\t}\n\n\tlines.push(renderSourceLink(symbol, rootDir));\n\n\tif (symbol.signature) {\n\t\tlines.push(\"```typescript\");\n\t\tlines.push(symbol.signature);\n\t\tlines.push(\"```\");\n\t\tlines.push(\"\");\n\t}\n\n\tif (symbol.documentation?.summary) {\n\t\tlines.push(symbol.documentation.summary);\n\t\tlines.push(\"\");\n\t}\n\n\tconst params = symbol.documentation?.params ?? [];\n\tif (params.length > 0) {\n\t\tlines.push(\"**Parameters**\");\n\t\tlines.push(\"\");\n\t\tfor (const p of params) {\n\t\t\tconst typeStr = p.type ? ` (\\`${p.type}\\`)` : \"\";\n\t\t\tlines.push(`- \\`${p.name}\\`${typeStr} — ${p.description}`);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tif (symbol.documentation?.returns) {\n\t\tconst retType = symbol.documentation.returns.type\n\t\t\t? ` (\\`${symbol.documentation.returns.type}\\`)`\n\t\t\t: \"\";\n\t\tlines.push(`**Returns**${retType}: ${symbol.documentation.returns.description}`);\n\t\tlines.push(\"\");\n\t}\n\n\tconst throws = symbol.documentation?.throws ?? [];\n\tif (throws.length > 0) {\n\t\tlines.push(\"**Throws**\");\n\t\tlines.push(\"\");\n\t\tfor (const t of throws) {\n\t\t\tconst typeStr = t.type ? `\\`${t.type}\\` — ` : \"\";\n\t\t\tlines.push(`- ${typeStr}${t.description}`);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tconst examples = symbol.documentation?.examples ?? [];\n\tif (examples.length > 0) {\n\t\tlines.push(\"**Examples**\");\n\t\tlines.push(\"\");\n\t\tfor (const ex of examples) {\n\t\t\tlines.push(`\\`\\`\\`${ex.language}`);\n\t\t\tlines.push(ex.code.trim());\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\t// Render children (class members, enum values, interface properties)\n\tconst children = symbol.children ?? [];\n\tif (children.length > 0 && depth < 5) {\n\t\tconst childDepth = depth + 1;\n\t\tfor (const child of children) {\n\t\t\tlines.push(renderSymbolSection(child, rootDir, mdx, childDepth));\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Build a Table of Contents from grouped symbols.\n * @internal\n */\nfunction buildToc(groups: Map<ForgeSymbol[\"kind\"], ForgeSymbol[]>): string {\n\tconst lines: string[] = [];\n\tlines.push(\"## Table of Contents\");\n\tlines.push(\"\");\n\n\tfor (const kind of KIND_ORDER) {\n\t\tconst group = groups.get(kind);\n\t\tif (!group || group.length === 0) continue;\n\n\t\tconst label = KIND_LABELS[kind];\n\t\tconst anchor = toAnchor(label);\n\t\tlines.push(`- [${label}](#${anchor})`);\n\n\t\tfor (const symbol of group) {\n\t\t\tconst ext = kind === \"function\" ? \"()\" : \"\";\n\t\t\tconst displayName = `${symbol.name}${ext}`;\n\t\t\tconst symAnchor = toAnchor(displayName);\n\t\t\tlines.push(` - [\\`${displayName}\\`](#${symAnchor})`);\n\t\t}\n\t}\n\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Generates a Markdown (or MDX) string from a list of symbols.\n *\n * @param symbols - The symbols to document.\n * @param config - The resolved {@link ForgeConfig}.\n * @param options - Rendering options.\n * @returns The generated Markdown string.\n * @public\n */\nexport function generateMarkdown(\n\tsymbols: ForgeSymbol[],\n\tconfig: ForgeConfig,\n\toptions: MarkdownOptions = {},\n): string {\n\tconst mdx = options.mdx ?? false;\n\tconst exported = symbols.filter((s) => s.exported);\n\n\t// Group by kind (top-level only — children are nested under their parent)\n\tconst topLevel = exported.filter((s) => s.kind !== \"method\" && s.kind !== \"property\");\n\n\tconst groups = new Map<ForgeSymbol[\"kind\"], ForgeSymbol[]>();\n\tfor (const symbol of topLevel) {\n\t\tconst list = groups.get(symbol.kind) ?? [];\n\t\tlist.push(symbol);\n\t\tgroups.set(symbol.kind, list);\n\t}\n\n\tconst parts: string[] = [];\n\n\t// Frontmatter\n\tconst frontmatter = buildFrontmatter(config, mdx);\n\tif (frontmatter) {\n\t\tparts.push(frontmatter);\n\t}\n\n\t// MDX imports\n\tif (mdx) {\n\t\tparts.push(buildMdxImports());\n\t}\n\n\t// Page title + preamble\n\tparts.push(\"# API Reference\\n\");\n\tparts.push(\n\t\t`Generated by [forge-ts](https://github.com/forge-ts/forge-ts) from \\`${config.rootDir}\\`.\\n`,\n\t);\n\n\t// Table of Contents\n\tif (topLevel.length > 0) {\n\t\tparts.push(buildToc(groups));\n\t}\n\n\t// Symbol groups\n\tfor (const kind of KIND_ORDER) {\n\t\tconst group = groups.get(kind);\n\t\tif (!group || group.length === 0) continue;\n\n\t\tconst label = KIND_LABELS[kind];\n\t\tparts.push(`## ${label}\\n`);\n\n\t\tfor (const symbol of group) {\n\t\t\tparts.push(renderSymbolSection(symbol, config.rootDir, mdx, 3));\n\t\t\tparts.push(\"\");\n\t\t}\n\t}\n\n\treturn `${parts\n\t\t.join(\"\\n\")\n\t\t.replace(/\\n{3,}/g, \"\\n\\n\")\n\t\t.trimEnd()}\\n`;\n}\n","import { existsSync } from \"node:fs\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport type { ForgeSymbol } from \"@codluv/forge-core\";\n\nconst SECTION_START = \"<!-- forge-ts:start -->\";\nconst SECTION_END = \"<!-- forge-ts:end -->\";\n\n/** Options controlling README sync behaviour. */\nexport interface ReadmeSyncOptions {\n\t/** Include a \"Documented with forge-ts\" badge above the API table. */\n\tbadge?: boolean;\n\t/** Include first @example from each top-level symbol. */\n\tincludeExamples?: boolean;\n}\n\n/**\n * Derives a compact type signature string for the table.\n * @internal\n */\nfunction tableSignature(symbol: ForgeSymbol): string {\n\tif (!symbol.signature) {\n\t\tconst ext = symbol.kind === \"function\" ? \"()\" : \"\";\n\t\treturn `\\`${symbol.name}${ext}\\``;\n\t}\n\t// Keep it short: show at most 60 characters of the signature\n\tconst sig =\n\t\tsymbol.signature.length > 60 ? `${symbol.signature.slice(0, 57)}...` : symbol.signature;\n\treturn `\\`${sig}\\``;\n}\n\n/**\n * Renders the first @example block as a fenced code snippet.\n * @internal\n */\nfunction renderFirstExample(symbol: ForgeSymbol): string {\n\tconst examples = symbol.documentation?.examples ?? [];\n\tif (examples.length === 0) return \"\";\n\tconst ex = examples[0];\n\treturn [\"\", `\\`\\`\\`${ex.language}`, ex.code.trim(), \"```\"].join(\"\\n\");\n}\n\n/**\n * Builds the markdown table rows for the API overview.\n * @internal\n */\nfunction buildApiTable(symbols: ForgeSymbol[], includeExamples: boolean): string[] {\n\tconst lines: string[] = [\"| Symbol | Kind | Description |\", \"|--------|------|-------------|\"];\n\n\tfor (const s of symbols) {\n\t\tconst sig = tableSignature(s);\n\t\tconst summary = s.documentation?.summary ?? \"\";\n\t\tlines.push(`| ${sig} | ${s.kind} | ${summary} |`);\n\t}\n\n\tif (includeExamples) {\n\t\tconst withExamples = symbols.filter((s) => (s.documentation?.examples ?? []).length > 0);\n\t\tif (withExamples.length > 0) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"### Examples\");\n\t\t\tfor (const s of withExamples) {\n\t\t\t\tlines.push(\"\");\n\t\t\t\tconst ext = s.kind === \"function\" ? \"()\" : \"\";\n\t\t\t\tlines.push(`#### \\`${s.name}${ext}\\``);\n\t\t\t\tlines.push(renderFirstExample(s));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn lines;\n}\n\n/**\n * Injects a summary of exported symbols into a `README.md` file.\n *\n * The content is placed between `<!-- forge-ts:start -->` and\n * `<!-- forge-ts:end -->` comment markers. If neither marker exists, the\n * summary is appended to the end of the file.\n *\n * @param readmePath - Absolute path to the `README.md` to update.\n * @param symbols - Symbols to summarise in the README.\n * @param options - Options controlling sync behaviour.\n * @returns `true` if the file was modified, `false` otherwise.\n * @public\n */\nexport async function syncReadme(\n\treadmePath: string,\n\tsymbols: ForgeSymbol[],\n\toptions: ReadmeSyncOptions = {},\n): Promise<boolean> {\n\tconst exported = symbols.filter((s) => s.exported);\n\tif (exported.length === 0) return false;\n\n\tconst badge = options.badge ?? false;\n\tconst includeExamples = options.includeExamples ?? false;\n\n\tconst innerLines: string[] = [];\n\tinnerLines.push(\"## API Overview\");\n\tinnerLines.push(\"\");\n\n\tif (badge) {\n\t\tinnerLines.push(\n\t\t\t\"[![Documented with forge-ts](https://img.shields.io/badge/docs-forge--ts-blue)](https://github.com/forge-ts/forge-ts)\",\n\t\t);\n\t\tinnerLines.push(\"\");\n\t}\n\n\tinnerLines.push(...buildApiTable(exported, includeExamples));\n\n\tconst summaryLines = [SECTION_START, \"\", ...innerLines, \"\", SECTION_END];\n\tconst injection = summaryLines.join(\"\\n\");\n\n\tlet existing = existsSync(readmePath) ? await readFile(readmePath, \"utf8\") : \"\";\n\n\tconst startIdx = existing.indexOf(SECTION_START);\n\tconst endIdx = existing.indexOf(SECTION_END);\n\n\tif (startIdx !== -1 && endIdx !== -1) {\n\t\texisting =\n\t\t\texisting.slice(0, startIdx) + injection + existing.slice(endIdx + SECTION_END.length);\n\t} else {\n\t\texisting = `${existing.trimEnd()}\\n\\n${injection}\\n`;\n\t}\n\n\tawait writeFile(readmePath, existing, \"utf8\");\n\treturn true;\n}\n","/**\n * @codluv/forge-gen — Markdown/MDX documentation and llms.txt generator.\n *\n * Generates human- and machine-readable documentation from the forge-ts\n * symbol graph, with optional README injection.\n *\n * @packageDocumentation\n * @public\n */\n\nexport { generateLlmsFullTxt, generateLlmsTxt } from \"./llms.js\";\nexport {\n\tgenerateMarkdown,\n\ttype MarkdownOptions,\n} from \"./markdown.js\";\nexport { type ReadmeSyncOptions, syncReadme } from \"./readme-sync.js\";\n\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { createWalker, type ForgeConfig, type ForgeResult } from \"@codluv/forge-core\";\nimport { generateLlmsFullTxt, generateLlmsTxt } from \"./llms.js\";\nimport { generateMarkdown } from \"./markdown.js\";\nimport { syncReadme } from \"./readme-sync.js\";\n\n/**\n * Runs the full generation pipeline: walk → render → write.\n *\n * @param config - The resolved {@link ForgeConfig} for the project.\n * @returns A {@link ForgeResult} describing the outcome.\n * @public\n */\nexport async function generate(config: ForgeConfig): Promise<ForgeResult> {\n\tconst start = Date.now();\n\n\tconst walker = createWalker(config);\n\tconst symbols = walker.walk();\n\n\tawait mkdir(config.outDir, { recursive: true });\n\n\tfor (const format of config.gen.formats) {\n\t\tconst content = generateMarkdown(symbols, config, {\n\t\t\tmdx: format === \"mdx\",\n\t\t});\n\t\tconst ext = format === \"mdx\" ? \"mdx\" : \"md\";\n\t\tawait writeFile(join(config.outDir, `api-reference.${ext}`), content, \"utf8\");\n\t}\n\n\tif (config.gen.llmsTxt) {\n\t\tconst llms = generateLlmsTxt(symbols, config);\n\t\tawait writeFile(join(config.outDir, \"llms.txt\"), llms, \"utf8\");\n\n\t\tconst llmsFull = generateLlmsFullTxt(symbols, config);\n\t\tawait writeFile(join(config.outDir, \"llms-full.txt\"), llmsFull, \"utf8\");\n\t}\n\n\tif (config.gen.readmeSync) {\n\t\tawait syncReadme(join(config.rootDir, \"README.md\"), symbols);\n\t}\n\n\treturn {\n\t\tsuccess: true,\n\t\tsymbols,\n\t\terrors: [],\n\t\twarnings: [],\n\t\tduration: Date.now() - start,\n\t};\n}\n"],"mappings":";AAMA,SAAS,aAAa,QAA6B;AAClD,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO;AAAA,EACf;AACA,QAAM,MAAM,OAAO,SAAS,aAAa,OAAO;AAChD,SAAO,GAAG,OAAO,IAAI,IAAI,OAAO,IAAI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QAAM,UAAU,YAAY,UAAU,MAAM;AAC5C,SAAO;AACR;;;AC5GA,SAAS,OAAO,aAAAA,kBAAiB;AACjC,SAAS,YAAY;AACrB,SAAS,oBAAwD;AAYjE,eAAsB,SAAS,QAA2C;AACzE,QAAM,QAAQ,KAAK,IAAI;AAEvB,QAAM,SAAS,aAAa,MAAM;AAClC,QAAM,UAAU,OAAO,KAAK;AAE5B,QAAM,MAAM,OAAO,QAAQ,EAAE,WAAW,KAAK,CAAC;AAE9C,aAAW,UAAU,OAAO,IAAI,SAAS;AACxC,UAAM,UAAU,iBAAiB,SAAS,QAAQ;AAAA,MACjD,KAAK,WAAW;AAAA,IACjB,CAAC;AACD,UAAM,MAAM,WAAW,QAAQ,QAAQ;AACvC,UAAMC,WAAU,KAAK,OAAO,QAAQ,iBAAiB,GAAG,EAAE,GAAG,SAAS,MAAM;AAAA,EAC7E;AAEA,MAAI,OAAO,IAAI,SAAS;AACvB,UAAM,OAAO,gBAAgB,SAAS,MAAM;AAC5C,UAAMA,WAAU,KAAK,OAAO,QAAQ,UAAU,GAAG,MAAM,MAAM;AAE7D,UAAM,WAAW,oBAAoB,SAAS,MAAM;AACpD,UAAMA,WAAU,KAAK,OAAO,QAAQ,eAAe,GAAG,UAAU,MAAM;AAAA,EACvE;AAEA,MAAI,OAAO,IAAI,YAAY;AAC1B,UAAM,WAAW,KAAK,OAAO,SAAS,WAAW,GAAG,OAAO;AAAA,EAC5D;AAEA,SAAO;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,QAAQ,CAAC;AAAA,IACT,UAAU,CAAC;AAAA,IACX,UAAU,KAAK,IAAI,IAAI;AAAA,EACxB;AACD;","names":["writeFile","writeFile"]}
1
+ {"version":3,"sources":["../src/llms.ts","../src/markdown.ts","../src/readme-sync.ts","../src/index.ts"],"sourcesContent":["import type { ForgeConfig, ForgeSymbol } from \"@forge-ts/core\";\n\n/**\n * Derives a compact one-line signature for routing manifest entries.\n * @internal\n */\nfunction compactEntry(symbol: ForgeSymbol): string {\n\tif (symbol.signature) {\n\t\treturn symbol.signature;\n\t}\n\tconst ext = symbol.kind === \"function\" ? \"()\" : \"\";\n\treturn `${symbol.kind} ${symbol.name}${ext}`;\n}\n\n/**\n * Generates an `llms.txt` routing manifest from the extracted symbols.\n *\n * The file follows the llms.txt specification: a compact, structured overview\n * designed to help large language models navigate a project's documentation.\n *\n * @param symbols - The symbols to include.\n * @param config - The resolved {@link ForgeConfig}.\n * @returns The generated `llms.txt` content as a string.\n * @public\n */\nexport function generateLlmsTxt(symbols: ForgeSymbol[], config: ForgeConfig): string {\n\tconst exported = symbols.filter((s) => s.exported);\n\tconst projectName = config.rootDir.split(\"/\").pop() ?? \"Project\";\n\n\tconst lines: string[] = [];\n\n\tlines.push(`# ${projectName}`);\n\tlines.push(`> Auto-generated API documentation`);\n\tlines.push(\"\");\n\n\t// Sections block — link to generated files\n\tlines.push(\"## Sections\");\n\tlines.push(\"\");\n\tif (config.gen.formats.includes(\"markdown\")) {\n\t\tlines.push(\"- [API Reference](./api-reference.md): Full API documentation\");\n\t}\n\tif (config.gen.formats.includes(\"mdx\")) {\n\t\tlines.push(\"- [API Reference](./api-reference.mdx): Full API documentation (MDX)\");\n\t}\n\tif (config.gen.llmsTxt) {\n\t\tlines.push(\"- [Full Context](./llms-full.txt): Dense context for LLM consumption\");\n\t}\n\tlines.push(\"\");\n\n\t// Quick Reference block\n\tif (exported.length > 0) {\n\t\tlines.push(\"## Quick Reference\");\n\t\tlines.push(\"\");\n\t\tfor (const symbol of exported) {\n\t\t\tconst summary = symbol.documentation?.summary ?? \"\";\n\t\t\tconst entry = compactEntry(symbol);\n\t\t\tlines.push(summary ? `${entry} - ${summary}` : entry);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Renders a full parameter list section.\n * @internal\n */\nfunction renderParams(params: NonNullable<ForgeSymbol[\"documentation\"]>[\"params\"]): string {\n\tif (!params || params.length === 0) return \"\";\n\tconst lines: string[] = [\"\", \"Parameters:\"];\n\tfor (const p of params) {\n\t\tconst typeStr = p.type ? ` (${p.type})` : \"\";\n\t\tlines.push(`- ${p.name}${typeStr}: ${p.description}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Renders a single symbol section for llms-full.txt.\n * @internal\n */\nfunction renderFullSymbol(symbol: ForgeSymbol, depth: number): string {\n\tconst hashes = \"#\".repeat(depth);\n\tconst ext = symbol.kind === \"function\" || symbol.kind === \"method\" ? \"()\" : \"\";\n\tconst lines: string[] = [];\n\n\tlines.push(`${hashes} ${symbol.name}${ext}`);\n\n\tif (symbol.signature) {\n\t\tlines.push(\"\");\n\t\tlines.push(symbol.signature);\n\t}\n\n\tif (symbol.documentation?.deprecated) {\n\t\tlines.push(\"\");\n\t\tlines.push(`DEPRECATED: ${symbol.documentation.deprecated}`);\n\t}\n\n\tif (symbol.documentation?.summary) {\n\t\tlines.push(\"\");\n\t\tlines.push(symbol.documentation.summary);\n\t}\n\n\tconst params = symbol.documentation?.params ?? [];\n\tconst paramBlock = renderParams(params);\n\tif (paramBlock) {\n\t\tlines.push(paramBlock);\n\t}\n\n\tif (symbol.documentation?.returns) {\n\t\tconst retType = symbol.documentation.returns.type\n\t\t\t? ` (${symbol.documentation.returns.type})`\n\t\t\t: \"\";\n\t\tlines.push(\"\");\n\t\tlines.push(`Returns${retType}: ${symbol.documentation.returns.description}`);\n\t}\n\n\tconst examples = symbol.documentation?.examples ?? [];\n\tif (examples.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Example:\");\n\t\tfor (const ex of examples) {\n\t\t\tconst exLines = ex.code.trim().split(\"\\n\");\n\t\t\tfor (const l of exLines) {\n\t\t\t\tlines.push(` ${l}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Render children inline\n\tconst children = symbol.children ?? [];\n\tif (children.length > 0 && depth < 5) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Members:\");\n\t\tfor (const child of children) {\n\t\t\tlines.push(\"\");\n\t\t\tconst childSection = renderFullSymbol(child, depth + 1);\n\t\t\t// indent child one level\n\t\t\tfor (const cl of childSection.split(\"\\n\")) {\n\t\t\t\tlines.push(cl);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Generates an `llms-full.txt` dense context file from the extracted symbols.\n *\n * Unlike `llms.txt`, this file contains complete documentation for every\n * exported symbol, intended for LLM ingestion that requires full context.\n *\n * @param symbols - The symbols to include.\n * @param config - The resolved {@link ForgeConfig}.\n * @returns The generated `llms-full.txt` content as a string.\n * @public\n */\nexport function generateLlmsFullTxt(symbols: ForgeSymbol[], config: ForgeConfig): string {\n\tconst exported = symbols.filter(\n\t\t(s) => s.exported && s.kind !== \"method\" && s.kind !== \"property\",\n\t);\n\tconst projectName = config.rootDir.split(\"/\").pop() ?? \"Project\";\n\n\tconst lines: string[] = [];\n\n\tlines.push(`# ${projectName} - Full Context`);\n\tlines.push(\"\");\n\tlines.push(`Root: ${config.rootDir}`);\n\tlines.push(`Generated: ${new Date().toISOString()}`);\n\tlines.push(\"\");\n\n\t// Group by kind\n\tconst kindGroups: Record<string, ForgeSymbol[]> = {};\n\tfor (const symbol of exported) {\n\t\tconst list = kindGroups[symbol.kind] ?? [];\n\t\tlist.push(symbol);\n\t\tkindGroups[symbol.kind] = list;\n\t}\n\n\tconst kindOrder: Array<ForgeSymbol[\"kind\"]> = [\n\t\t\"function\",\n\t\t\"class\",\n\t\t\"interface\",\n\t\t\"type\",\n\t\t\"enum\",\n\t\t\"variable\",\n\t];\n\n\tconst kindLabels: Record<string, string> = {\n\t\tfunction: \"Functions\",\n\t\tclass: \"Classes\",\n\t\tinterface: \"Interfaces\",\n\t\ttype: \"Types\",\n\t\tenum: \"Enums\",\n\t\tvariable: \"Variables\",\n\t};\n\n\tfor (const kind of kindOrder) {\n\t\tconst group = kindGroups[kind];\n\t\tif (!group || group.length === 0) continue;\n\n\t\tlines.push(`## ${kindLabels[kind]}`);\n\t\tlines.push(\"\");\n\n\t\tfor (const symbol of group) {\n\t\t\tlines.push(renderFullSymbol(symbol, 3));\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\treturn `${lines\n\t\t.join(\"\\n\")\n\t\t.replace(/\\n{3,}/g, \"\\n\\n\")\n\t\t.trimEnd()}\\n`;\n}\n","import { relative } from \"node:path\";\nimport type { ForgeConfig, ForgeSymbol } from \"@forge-ts/core\";\n\n/**\n * Options controlling Markdown output.\n * @public\n */\nexport interface MarkdownOptions {\n\t/** Whether to use MDX syntax (default: Markdown). */\n\tmdx?: boolean;\n}\n\n/** Display labels for each symbol kind. */\nconst KIND_LABELS: Record<ForgeSymbol[\"kind\"], string> = {\n\tfunction: \"Functions\",\n\tclass: \"Classes\",\n\tinterface: \"Interfaces\",\n\ttype: \"Types\",\n\tenum: \"Enums\",\n\tvariable: \"Variables\",\n\tmethod: \"Methods\",\n\tproperty: \"Properties\",\n};\n\n/** Canonical ordering for top-level kind groups. */\nconst KIND_ORDER: Array<ForgeSymbol[\"kind\"]> = [\n\t\"function\",\n\t\"class\",\n\t\"interface\",\n\t\"type\",\n\t\"enum\",\n\t\"variable\",\n];\n\n/** Convert a label to a GitHub-compatible anchor slug. */\nfunction toAnchor(text: string): string {\n\treturn text\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9\\s-]/g, \"\")\n\t\t.trim()\n\t\t.replace(/\\s+/g, \"-\");\n}\n\n/** Build the frontmatter block for the configured SSG target. */\nfunction buildFrontmatter(config: ForgeConfig, mdx: boolean): string {\n\tconst target = config.gen.ssgTarget;\n\tif (!target) return \"\";\n\n\tconst lines: string[] = [\"---\"];\n\n\tswitch (target) {\n\t\tcase \"docusaurus\":\n\t\t\tlines.push(\"sidebar_position: 1\");\n\t\t\tlines.push(\"title: API Reference\");\n\t\t\tbreak;\n\t\tcase \"mintlify\":\n\t\t\tlines.push(\"title: API Reference\");\n\t\t\tbreak;\n\t\tcase \"nextra\":\n\t\t\tlines.push(\"title: API Reference\");\n\t\t\tlines.push(\"description: Auto-generated API reference\");\n\t\t\tbreak;\n\t\tcase \"vitepress\":\n\t\t\tlines.push(\"title: API Reference\");\n\t\t\tlines.push(\"outline: deep\");\n\t\t\tbreak;\n\t}\n\n\tlines.push(\"---\");\n\tif (mdx) {\n\t\tlines.push(\"\");\n\t}\n\treturn `${lines.join(\"\\n\")}\\n`;\n}\n\n/** Build MDX import block for custom components. */\nfunction buildMdxImports(): string {\n\treturn 'import { Callout } from \"@components/Callout\";\\n\\n';\n}\n\n/**\n * Render a deprecation notice banner.\n * @internal\n */\nfunction renderDeprecation(deprecated: string): string {\n\treturn `> **Deprecated**: ${deprecated}\\n`;\n}\n\n/**\n * Render source location line.\n * @internal\n */\nfunction renderSourceLink(symbol: ForgeSymbol, rootDir: string): string {\n\tconst rel = relative(rootDir, symbol.filePath);\n\treturn `_Defined in \\`${rel}:${symbol.line}\\`_\\n`;\n}\n\n/**\n * Renders a symbol at H3 level (used for both top-level and children).\n * @internal\n */\nfunction renderSymbolSection(\n\tsymbol: ForgeSymbol,\n\trootDir: string,\n\tmdx: boolean,\n\tdepth: number,\n): string {\n\tconst lines: string[] = [];\n\tconst hashes = \"#\".repeat(depth);\n\tconst ext = symbol.kind === \"function\" || symbol.kind === \"method\" ? \"()\" : \"\";\n\tlines.push(`${hashes} \\`${symbol.name}${ext}\\``);\n\tlines.push(\"\");\n\n\tif (symbol.documentation?.deprecated) {\n\t\tlines.push(renderDeprecation(symbol.documentation.deprecated));\n\t}\n\n\tlines.push(renderSourceLink(symbol, rootDir));\n\n\tif (symbol.signature) {\n\t\tlines.push(\"```typescript\");\n\t\tlines.push(symbol.signature);\n\t\tlines.push(\"```\");\n\t\tlines.push(\"\");\n\t}\n\n\tif (symbol.documentation?.summary) {\n\t\tlines.push(symbol.documentation.summary);\n\t\tlines.push(\"\");\n\t}\n\n\tconst params = symbol.documentation?.params ?? [];\n\tif (params.length > 0) {\n\t\tlines.push(\"**Parameters**\");\n\t\tlines.push(\"\");\n\t\tfor (const p of params) {\n\t\t\tconst typeStr = p.type ? ` (\\`${p.type}\\`)` : \"\";\n\t\t\tlines.push(`- \\`${p.name}\\`${typeStr} — ${p.description}`);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tif (symbol.documentation?.returns) {\n\t\tconst retType = symbol.documentation.returns.type\n\t\t\t? ` (\\`${symbol.documentation.returns.type}\\`)`\n\t\t\t: \"\";\n\t\tlines.push(`**Returns**${retType}: ${symbol.documentation.returns.description}`);\n\t\tlines.push(\"\");\n\t}\n\n\tconst throws = symbol.documentation?.throws ?? [];\n\tif (throws.length > 0) {\n\t\tlines.push(\"**Throws**\");\n\t\tlines.push(\"\");\n\t\tfor (const t of throws) {\n\t\t\tconst typeStr = t.type ? `\\`${t.type}\\` — ` : \"\";\n\t\t\tlines.push(`- ${typeStr}${t.description}`);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tconst examples = symbol.documentation?.examples ?? [];\n\tif (examples.length > 0) {\n\t\tlines.push(\"**Examples**\");\n\t\tlines.push(\"\");\n\t\tfor (const ex of examples) {\n\t\t\tlines.push(`\\`\\`\\`${ex.language}`);\n\t\t\tlines.push(ex.code.trim());\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\t// Render children (class members, enum values, interface properties)\n\tconst children = symbol.children ?? [];\n\tif (children.length > 0 && depth < 5) {\n\t\tconst childDepth = depth + 1;\n\t\tfor (const child of children) {\n\t\t\tlines.push(renderSymbolSection(child, rootDir, mdx, childDepth));\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Build a Table of Contents from grouped symbols.\n * @internal\n */\nfunction buildToc(groups: Map<ForgeSymbol[\"kind\"], ForgeSymbol[]>): string {\n\tconst lines: string[] = [];\n\tlines.push(\"## Table of Contents\");\n\tlines.push(\"\");\n\n\tfor (const kind of KIND_ORDER) {\n\t\tconst group = groups.get(kind);\n\t\tif (!group || group.length === 0) continue;\n\n\t\tconst label = KIND_LABELS[kind];\n\t\tconst anchor = toAnchor(label);\n\t\tlines.push(`- [${label}](#${anchor})`);\n\n\t\tfor (const symbol of group) {\n\t\t\tconst ext = kind === \"function\" ? \"()\" : \"\";\n\t\t\tconst displayName = `${symbol.name}${ext}`;\n\t\t\tconst symAnchor = toAnchor(displayName);\n\t\t\tlines.push(` - [\\`${displayName}\\`](#${symAnchor})`);\n\t\t}\n\t}\n\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Generates a Markdown (or MDX) string from a list of symbols.\n *\n * @param symbols - The symbols to document.\n * @param config - The resolved {@link ForgeConfig}.\n * @param options - Rendering options.\n * @returns The generated Markdown string.\n * @public\n */\nexport function generateMarkdown(\n\tsymbols: ForgeSymbol[],\n\tconfig: ForgeConfig,\n\toptions: MarkdownOptions = {},\n): string {\n\tconst mdx = options.mdx ?? false;\n\tconst exported = symbols.filter((s) => s.exported);\n\n\t// Group by kind (top-level only — children are nested under their parent)\n\tconst topLevel = exported.filter((s) => s.kind !== \"method\" && s.kind !== \"property\");\n\n\tconst groups = new Map<ForgeSymbol[\"kind\"], ForgeSymbol[]>();\n\tfor (const symbol of topLevel) {\n\t\tconst list = groups.get(symbol.kind) ?? [];\n\t\tlist.push(symbol);\n\t\tgroups.set(symbol.kind, list);\n\t}\n\n\tconst parts: string[] = [];\n\n\t// Frontmatter\n\tconst frontmatter = buildFrontmatter(config, mdx);\n\tif (frontmatter) {\n\t\tparts.push(frontmatter);\n\t}\n\n\t// MDX imports\n\tif (mdx) {\n\t\tparts.push(buildMdxImports());\n\t}\n\n\t// Page title + preamble\n\tparts.push(\"# API Reference\\n\");\n\tparts.push(\n\t\t`Generated by [forge-ts](https://github.com/forge-ts/forge-ts) from \\`${config.rootDir}\\`.\\n`,\n\t);\n\n\t// Table of Contents\n\tif (topLevel.length > 0) {\n\t\tparts.push(buildToc(groups));\n\t}\n\n\t// Symbol groups\n\tfor (const kind of KIND_ORDER) {\n\t\tconst group = groups.get(kind);\n\t\tif (!group || group.length === 0) continue;\n\n\t\tconst label = KIND_LABELS[kind];\n\t\tparts.push(`## ${label}\\n`);\n\n\t\tfor (const symbol of group) {\n\t\t\tparts.push(renderSymbolSection(symbol, config.rootDir, mdx, 3));\n\t\t\tparts.push(\"\");\n\t\t}\n\t}\n\n\treturn `${parts\n\t\t.join(\"\\n\")\n\t\t.replace(/\\n{3,}/g, \"\\n\\n\")\n\t\t.trimEnd()}\\n`;\n}\n","import { existsSync } from \"node:fs\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport type { ForgeSymbol } from \"@forge-ts/core\";\n\nconst SECTION_START = \"<!-- forge-ts:start -->\";\nconst SECTION_END = \"<!-- forge-ts:end -->\";\n\n/** Options controlling README sync behaviour. */\nexport interface ReadmeSyncOptions {\n\t/** Include a \"Documented with forge-ts\" badge above the API table. */\n\tbadge?: boolean;\n\t/** Include first @example from each top-level symbol. */\n\tincludeExamples?: boolean;\n}\n\n/**\n * Derives a compact type signature string for the table.\n * @internal\n */\nfunction tableSignature(symbol: ForgeSymbol): string {\n\tif (!symbol.signature) {\n\t\tconst ext = symbol.kind === \"function\" ? \"()\" : \"\";\n\t\treturn `\\`${symbol.name}${ext}\\``;\n\t}\n\t// Keep it short: show at most 60 characters of the signature\n\tconst sig =\n\t\tsymbol.signature.length > 60 ? `${symbol.signature.slice(0, 57)}...` : symbol.signature;\n\treturn `\\`${sig}\\``;\n}\n\n/**\n * Renders the first @example block as a fenced code snippet.\n * @internal\n */\nfunction renderFirstExample(symbol: ForgeSymbol): string {\n\tconst examples = symbol.documentation?.examples ?? [];\n\tif (examples.length === 0) return \"\";\n\tconst ex = examples[0];\n\treturn [\"\", `\\`\\`\\`${ex.language}`, ex.code.trim(), \"```\"].join(\"\\n\");\n}\n\n/**\n * Builds the markdown table rows for the API overview.\n * @internal\n */\nfunction buildApiTable(symbols: ForgeSymbol[], includeExamples: boolean): string[] {\n\tconst lines: string[] = [\"| Symbol | Kind | Description |\", \"|--------|------|-------------|\"];\n\n\tfor (const s of symbols) {\n\t\tconst sig = tableSignature(s);\n\t\tconst summary = s.documentation?.summary ?? \"\";\n\t\tlines.push(`| ${sig} | ${s.kind} | ${summary} |`);\n\t}\n\n\tif (includeExamples) {\n\t\tconst withExamples = symbols.filter((s) => (s.documentation?.examples ?? []).length > 0);\n\t\tif (withExamples.length > 0) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"### Examples\");\n\t\t\tfor (const s of withExamples) {\n\t\t\t\tlines.push(\"\");\n\t\t\t\tconst ext = s.kind === \"function\" ? \"()\" : \"\";\n\t\t\t\tlines.push(`#### \\`${s.name}${ext}\\``);\n\t\t\t\tlines.push(renderFirstExample(s));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn lines;\n}\n\n/**\n * Injects a summary of exported symbols into a `README.md` file.\n *\n * The content is placed between `<!-- forge-ts:start -->` and\n * `<!-- forge-ts:end -->` comment markers. If neither marker exists, the\n * summary is appended to the end of the file.\n *\n * @param readmePath - Absolute path to the `README.md` to update.\n * @param symbols - Symbols to summarise in the README.\n * @param options - Options controlling sync behaviour.\n * @returns `true` if the file was modified, `false` otherwise.\n * @public\n */\nexport async function syncReadme(\n\treadmePath: string,\n\tsymbols: ForgeSymbol[],\n\toptions: ReadmeSyncOptions = {},\n): Promise<boolean> {\n\tconst exported = symbols.filter((s) => s.exported);\n\tif (exported.length === 0) return false;\n\n\tconst badge = options.badge ?? false;\n\tconst includeExamples = options.includeExamples ?? false;\n\n\tconst innerLines: string[] = [];\n\tinnerLines.push(\"## API Overview\");\n\tinnerLines.push(\"\");\n\n\tif (badge) {\n\t\tinnerLines.push(\n\t\t\t\"[![Documented with forge-ts](https://img.shields.io/badge/docs-forge--ts-blue)](https://github.com/forge-ts/forge-ts)\",\n\t\t);\n\t\tinnerLines.push(\"\");\n\t}\n\n\tinnerLines.push(...buildApiTable(exported, includeExamples));\n\n\tconst summaryLines = [SECTION_START, \"\", ...innerLines, \"\", SECTION_END];\n\tconst injection = summaryLines.join(\"\\n\");\n\n\tlet existing = existsSync(readmePath) ? await readFile(readmePath, \"utf8\") : \"\";\n\n\tconst startIdx = existing.indexOf(SECTION_START);\n\tconst endIdx = existing.indexOf(SECTION_END);\n\n\tif (startIdx !== -1 && endIdx !== -1) {\n\t\texisting =\n\t\t\texisting.slice(0, startIdx) + injection + existing.slice(endIdx + SECTION_END.length);\n\t} else {\n\t\texisting = `${existing.trimEnd()}\\n\\n${injection}\\n`;\n\t}\n\n\tawait writeFile(readmePath, existing, \"utf8\");\n\treturn true;\n}\n","/**\n * @forge-ts/gen — Markdown/MDX documentation and llms.txt generator.\n *\n * Generates human- and machine-readable documentation from the forge-ts\n * symbol graph, with optional README injection.\n *\n * @packageDocumentation\n * @public\n */\n\nexport { generateLlmsFullTxt, generateLlmsTxt } from \"./llms.js\";\nexport {\n\tgenerateMarkdown,\n\ttype MarkdownOptions,\n} from \"./markdown.js\";\nexport { type ReadmeSyncOptions, syncReadme } from \"./readme-sync.js\";\n\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { createWalker, type ForgeConfig, type ForgeResult } from \"@forge-ts/core\";\nimport { generateLlmsFullTxt, generateLlmsTxt } from \"./llms.js\";\nimport { generateMarkdown } from \"./markdown.js\";\nimport { syncReadme } from \"./readme-sync.js\";\n\n/**\n * Runs the full generation pipeline: walk → render → write.\n *\n * @param config - The resolved {@link ForgeConfig} for the project.\n * @returns A {@link ForgeResult} describing the outcome.\n * @public\n */\nexport async function generate(config: ForgeConfig): Promise<ForgeResult> {\n\tconst start = Date.now();\n\n\tconst walker = createWalker(config);\n\tconst symbols = walker.walk();\n\n\tawait mkdir(config.outDir, { recursive: true });\n\n\tfor (const format of config.gen.formats) {\n\t\tconst content = generateMarkdown(symbols, config, {\n\t\t\tmdx: format === \"mdx\",\n\t\t});\n\t\tconst ext = format === \"mdx\" ? \"mdx\" : \"md\";\n\t\tawait writeFile(join(config.outDir, `api-reference.${ext}`), content, \"utf8\");\n\t}\n\n\tif (config.gen.llmsTxt) {\n\t\tconst llms = generateLlmsTxt(symbols, config);\n\t\tawait writeFile(join(config.outDir, \"llms.txt\"), llms, \"utf8\");\n\n\t\tconst llmsFull = generateLlmsFullTxt(symbols, config);\n\t\tawait writeFile(join(config.outDir, \"llms-full.txt\"), llmsFull, \"utf8\");\n\t}\n\n\tif (config.gen.readmeSync) {\n\t\tawait syncReadme(join(config.rootDir, \"README.md\"), symbols);\n\t}\n\n\treturn {\n\t\tsuccess: true,\n\t\tsymbols,\n\t\terrors: [],\n\t\twarnings: [],\n\t\tduration: Date.now() - start,\n\t};\n}\n"],"mappings":";AAMA,SAAS,aAAa,QAA6B;AAClD,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO;AAAA,EACf;AACA,QAAM,MAAM,OAAO,SAAS,aAAa,OAAO;AAChD,SAAO,GAAG,OAAO,IAAI,IAAI,OAAO,IAAI,GAAG,GAAG;AAC3C;AAaO,SAAS,gBAAgB,SAAwB,QAA6B;AACpF,QAAM,WAAW,QAAQ,OAAO,CAAC,MAAM,EAAE,QAAQ;AACjD,QAAM,cAAc,OAAO,QAAQ,MAAM,GAAG,EAAE,IAAI,KAAK;AAEvD,QAAM,QAAkB,CAAC;AAEzB,QAAM,KAAK,KAAK,WAAW,EAAE;AAC7B,QAAM,KAAK,oCAAoC;AAC/C,QAAM,KAAK,EAAE;AAGb,QAAM,KAAK,aAAa;AACxB,QAAM,KAAK,EAAE;AACb,MAAI,OAAO,IAAI,QAAQ,SAAS,UAAU,GAAG;AAC5C,UAAM,KAAK,+DAA+D;AAAA,EAC3E;AACA,MAAI,OAAO,IAAI,QAAQ,SAAS,KAAK,GAAG;AACvC,UAAM,KAAK,sEAAsE;AAAA,EAClF;AACA,MAAI,OAAO,IAAI,SAAS;AACvB,UAAM,KAAK,sEAAsE;AAAA,EAClF;AACA,QAAM,KAAK,EAAE;AAGb,MAAI,SAAS,SAAS,GAAG;AACxB,UAAM,KAAK,oBAAoB;AA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AAG,MAAM,MAAM;AAE7D,UAAM,WAAW,oBAAoB,SAAS,MAAM;AACpD,UAAMA,WAAU,KAAK,OAAO,QAAQ,eAAe,GAAG,UAAU,MAAM;AAAA,EACvE;AAEA,MAAI,OAAO,IAAI,YAAY;AAC1B,UAAM,WAAW,KAAK,OAAO,SAAS,WAAW,GAAG,OAAO;AAAA,EAC5D;AAEA,SAAO;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,QAAQ,CAAC;AAAA,IACT,UAAU,CAAC;AAAA,IACX,UAAU,KAAK,IAAI,IAAI;AAAA,EACxB;AACD;","names":["writeFile","writeFile"]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@forge-ts/gen",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "Markdown/MDX and llms.txt generator for forge-ts",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/codluv/forge-ts"
9
+ "url": "https://github.com/kryptobaseddev/forge-ts"
10
10
  },
11
11
  "publishConfig": {
12
12
  "access": "public"
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@codluv/forge-core": "npm:@forge-ts/core@0.2.0"
27
+ "@forge-ts/core": "0.2.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "tsup": "^8.3.5",