@forge-ts/core 0.3.1 → 0.5.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/index.d.ts CHANGED
@@ -49,6 +49,11 @@ interface ForgeSymbol {
49
49
  }>;
50
50
  tags?: Record<string, string[]>;
51
51
  deprecated?: string;
52
+ /** {@link} cross-references found in this symbol's TSDoc. */
53
+ links?: Array<{
54
+ target: string;
55
+ line: number;
56
+ }>;
52
57
  };
53
58
  /** Human-readable type signature of the symbol. */
54
59
  signature?: string;
@@ -57,6 +62,35 @@ interface ForgeSymbol {
57
62
  /** Whether this symbol is part of the public module exports. */
58
63
  exported: boolean;
59
64
  }
65
+ /**
66
+ * Severity level for an individual enforcement rule.
67
+ * - `"error"` — violation fails the build.
68
+ * - `"warn"` — violation is reported but does not fail the build.
69
+ * - `"off"` — rule is disabled entirely.
70
+ * @public
71
+ */
72
+ type RuleSeverity = "error" | "warn" | "off";
73
+ /**
74
+ * Per-rule severity configuration for the TSDoc enforcer.
75
+ * Each key corresponds to one of the E001–E007 rule codes.
76
+ * @public
77
+ */
78
+ interface EnforceRules {
79
+ /** E001: Exported symbol missing TSDoc summary. */
80
+ "require-summary": RuleSeverity;
81
+ /** E002: Function parameter missing @param tag. */
82
+ "require-param": RuleSeverity;
83
+ /** E003: Non-void function missing @returns tag. */
84
+ "require-returns": RuleSeverity;
85
+ /** E004: Exported function missing @example block. */
86
+ "require-example": RuleSeverity;
87
+ /** E005: Entry point missing @packageDocumentation. */
88
+ "require-package-doc": RuleSeverity;
89
+ /** E006: Class member missing documentation. */
90
+ "require-class-member-doc": RuleSeverity;
91
+ /** E007: Interface/type member missing documentation. */
92
+ "require-interface-member-doc": RuleSeverity;
93
+ }
60
94
  /**
61
95
  * Full configuration for a forge-ts run.
62
96
  * Loaded from forge-ts.config.ts or the "forge-ts" key in package.json.
@@ -76,6 +110,8 @@ interface ForgeConfig {
76
110
  minVisibility: Visibility;
77
111
  /** Fail on warnings rather than only on errors. */
78
112
  strict: boolean;
113
+ /** Per-rule severity overrides. When strict is true, all "warn" become "error". */
114
+ rules: EnforceRules;
79
115
  };
80
116
  /** DocTest configuration. */
81
117
  doctest: {
@@ -482,4 +518,4 @@ interface ASTWalker {
482
518
  */
483
519
  declare function createWalker(config: ForgeConfig): ASTWalker;
484
520
 
485
- export { type ASTWalker, type ForgeConfig, type ForgeError, type ForgeResult, type ForgeSymbol, type ForgeWarning, type OpenAPIDocument, type OpenAPIEncodingObject, type OpenAPIInfoObject, type OpenAPIMediaTypeObject, type OpenAPIOperationObject, type OpenAPIParameterObject, type OpenAPIPathItemObject, type OpenAPIResponseObject, type OpenAPISchemaObject, type OpenAPITagObject, Visibility, createWalker, defaultConfig, filterByVisibility, loadConfig, meetsVisibility, resolveVisibility };
521
+ export { type ASTWalker, type EnforceRules, type ForgeConfig, type ForgeError, type ForgeResult, type ForgeSymbol, type ForgeWarning, type OpenAPIDocument, type OpenAPIEncodingObject, type OpenAPIInfoObject, type OpenAPIMediaTypeObject, type OpenAPIOperationObject, type OpenAPIParameterObject, type OpenAPIPathItemObject, type OpenAPIResponseObject, type OpenAPISchemaObject, type OpenAPITagObject, type RuleSeverity, Visibility, createWalker, defaultConfig, filterByVisibility, loadConfig, meetsVisibility, resolveVisibility };
package/dist/index.js CHANGED
@@ -22,7 +22,16 @@ function defaultConfig(rootDir) {
22
22
  enforce: {
23
23
  enabled: true,
24
24
  minVisibility: "public" /* Public */,
25
- strict: false
25
+ strict: false,
26
+ rules: {
27
+ "require-summary": "error",
28
+ "require-param": "error",
29
+ "require-returns": "error",
30
+ "require-example": "error",
31
+ "require-package-doc": "warn",
32
+ "require-class-member-doc": "error",
33
+ "require-interface-member-doc": "error"
34
+ }
26
35
  },
27
36
  doctest: {
28
37
  enabled: true,
@@ -46,7 +55,11 @@ function mergeWithDefaults(rootDir, partial) {
46
55
  return {
47
56
  ...defaults,
48
57
  ...partial,
49
- enforce: { ...defaults.enforce, ...partial.enforce },
58
+ enforce: {
59
+ ...defaults.enforce,
60
+ ...partial.enforce,
61
+ rules: { ...defaults.enforce.rules, ...partial.enforce?.rules }
62
+ },
50
63
  doctest: { ...defaults.doctest, ...partial.doctest },
51
64
  api: { ...defaults.api, ...partial.api },
52
65
  gen: { ...defaults.gen, ...partial.gen }
@@ -215,7 +228,33 @@ function parseTSDoc(rawComment, startLine) {
215
228
  throws.push({ description: renderBlock(block) });
216
229
  }
217
230
  }
231
+ for (const block of comment.customBlocks) {
232
+ if (block.blockTag.tagName.toLowerCase() === "@route") {
233
+ const routeText = renderBlock(block).trim();
234
+ const match = routeText.match(/^(GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD)\s+(\S+)/i);
235
+ if (match) {
236
+ if (!tags.route) tags.route = [];
237
+ tags.route.push(`${match[1].toUpperCase()} ${match[2]}`);
238
+ }
239
+ }
240
+ }
218
241
  const examples = extractExamples(comment, startLine);
242
+ const links = [];
243
+ function walkForLinks(node) {
244
+ if (node.kind === DocNodeKind.LinkTag) {
245
+ const linkTag = node;
246
+ if (linkTag.codeDestination) {
247
+ const target = linkTag.codeDestination.memberReferences.map((ref) => ref.memberIdentifier?.identifier ?? "").filter(Boolean).join(".");
248
+ if (target) {
249
+ links.push({ target, line: startLine });
250
+ }
251
+ }
252
+ }
253
+ for (const child of node.getChildNodes()) {
254
+ walkForLinks(child);
255
+ }
256
+ }
257
+ walkForLinks(comment);
219
258
  const summary = renderDocSection(comment.summarySection);
220
259
  return {
221
260
  summary: summary || void 0,
@@ -224,7 +263,8 @@ function parseTSDoc(rawComment, startLine) {
224
263
  throws: throws.length > 0 ? throws : void 0,
225
264
  examples: examples.length > 0 ? examples : void 0,
226
265
  tags: Object.keys(tags).length > 0 ? tags : void 0,
227
- deprecated
266
+ deprecated,
267
+ links: links.length > 0 ? links : void 0
228
268
  };
229
269
  }
230
270
  function getLeadingComment(node, sourceFile) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/config.ts","../src/types.ts","../src/visibility.ts","../src/walker.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { type ForgeConfig, Visibility } from \"./types.js\";\n\n/**\n * Constructs a sensible default {@link ForgeConfig} rooted at `rootDir`.\n *\n * @param rootDir - Absolute path to the project root.\n * @returns A fully-populated default configuration.\n * @example\n * ```typescript\n * import { defaultConfig } from \"@forge-ts/core\";\n * const config = defaultConfig(\"/path/to/project\");\n * console.log(config.enforce.enabled); // true\n * ```\n * @public\n */\nexport function defaultConfig(rootDir: string): ForgeConfig {\n\treturn {\n\t\trootDir,\n\t\ttsconfig: join(rootDir, \"tsconfig.json\"),\n\t\toutDir: join(rootDir, \"docs\"),\n\t\tenforce: {\n\t\t\tenabled: true,\n\t\t\tminVisibility: Visibility.Public,\n\t\t\tstrict: false,\n\t\t},\n\t\tdoctest: {\n\t\t\tenabled: true,\n\t\t\tcacheDir: join(rootDir, \".cache\", \"doctest\"),\n\t\t},\n\t\tapi: {\n\t\t\tenabled: false,\n\t\t\topenapi: false,\n\t\t\topenapiPath: join(rootDir, \"docs\", \"openapi.json\"),\n\t\t},\n\t\tgen: {\n\t\t\tenabled: true,\n\t\t\tformats: [\"markdown\"],\n\t\t\tllmsTxt: true,\n\t\t\treadmeSync: false,\n\t\t},\n\t};\n}\n\n/**\n * Merges a partial user config with the defaults so every field is present.\n *\n * @param rootDir - Absolute path to the project root.\n * @param partial - Partial config from the user's config file.\n * @returns A fully-populated {@link ForgeConfig}.\n * @internal\n */\nfunction mergeWithDefaults(rootDir: string, partial: Partial<ForgeConfig>): ForgeConfig {\n\tconst defaults = defaultConfig(rootDir);\n\treturn {\n\t\t...defaults,\n\t\t...partial,\n\t\tenforce: { ...defaults.enforce, ...partial.enforce },\n\t\tdoctest: { ...defaults.doctest, ...partial.doctest },\n\t\tapi: { ...defaults.api, ...partial.api },\n\t\tgen: { ...defaults.gen, ...partial.gen },\n\t};\n}\n\n/**\n * Attempts to load a TypeScript or JavaScript config file via dynamic import.\n *\n * @param filePath - Absolute path to the config file.\n * @returns The default export of the config module, or `null` on failure.\n * @internal\n */\nasync function loadModuleConfig(filePath: string): Promise<Partial<ForgeConfig> | null> {\n\ttry {\n\t\tconst fileUrl = pathToFileURL(filePath).href;\n\t\tconst mod = (await import(fileUrl)) as {\n\t\t\tdefault?: Partial<ForgeConfig>;\n\t\t};\n\t\treturn mod.default ?? null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/**\n * Minimal shape of a `package.json` file relevant to forge-ts config loading.\n * @internal\n */\ninterface PackageJson {\n\tname?: string;\n\tversion?: string;\n\t\"forge-ts\"?: Partial<ForgeConfig>;\n}\n\n/**\n * Attempts to read the `\"forge-ts\"` key from a `package.json` file.\n *\n * @param pkgPath - Absolute path to `package.json`.\n * @returns The value of the `\"forge-ts\"` key, or `null` if absent.\n * @internal\n */\nasync function loadPackageJsonConfig(pkgPath: string): Promise<Partial<ForgeConfig> | null> {\n\ttry {\n\t\tconst raw = await readFile(pkgPath, \"utf8\");\n\t\tconst pkg = JSON.parse(raw) as PackageJson;\n\t\tconst key = pkg[\"forge-ts\"];\n\t\tif (key) {\n\t\t\treturn key;\n\t\t}\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/**\n * Loads the forge-ts configuration for a project.\n *\n * Resolution order:\n * 1. `<rootDir>/forge-ts.config.ts`\n * 2. `<rootDir>/forge-ts.config.js`\n * 3. `\"forge-ts\"` key inside `<rootDir>/package.json`\n * 4. Built-in defaults (returned when none of the above is found)\n *\n * @param rootDir - The project root to search for config. Defaults to `process.cwd()`.\n * @returns A fully-resolved {@link ForgeConfig}.\n * @example\n * ```typescript\n * import { loadConfig } from \"@forge-ts/core\";\n * const config = await loadConfig(\"/path/to/project\");\n * // config is fully resolved with defaults\n * ```\n * @public\n */\nexport async function loadConfig(rootDir?: string): Promise<ForgeConfig> {\n\tconst root = resolve(rootDir ?? process.cwd());\n\n\tconst candidates = [join(root, \"forge-ts.config.ts\"), join(root, \"forge-ts.config.js\")];\n\n\tfor (const candidate of candidates) {\n\t\tif (existsSync(candidate)) {\n\t\t\tconst partial = await loadModuleConfig(candidate);\n\t\t\tif (partial) {\n\t\t\t\treturn mergeWithDefaults(root, partial);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst pkgPath = join(root, \"package.json\");\n\tif (existsSync(pkgPath)) {\n\t\tconst partial = await loadPackageJsonConfig(pkgPath);\n\t\tif (partial) {\n\t\t\treturn mergeWithDefaults(root, partial);\n\t\t}\n\t}\n\n\treturn defaultConfig(root);\n}\n","/**\n * Visibility levels for exported symbols.\n * Derived from TSDoc release tags (@public, @beta, @internal).\n * @public\n */\nexport enum Visibility {\n\tPublic = \"public\",\n\tBeta = \"beta\",\n\tInternal = \"internal\",\n\tPrivate = \"private\",\n}\n\n/**\n * A single extracted and annotated symbol from the TypeScript AST.\n * @public\n */\nexport interface ForgeSymbol {\n\t/** The declared name of the symbol. */\n\tname: string;\n\t/** The syntactic kind of the symbol. */\n\tkind: \"function\" | \"class\" | \"interface\" | \"type\" | \"enum\" | \"variable\" | \"method\" | \"property\";\n\t/** Resolved visibility from TSDoc release tags. */\n\tvisibility: Visibility;\n\t/** Absolute path to the source file. */\n\tfilePath: string;\n\t/** 1-based line number of the declaration. */\n\tline: number;\n\t/** 0-based column of the declaration. */\n\tcolumn: number;\n\t/** Parsed TSDoc documentation, if present. */\n\tdocumentation?: {\n\t\tsummary?: string;\n\t\tparams?: Array<{ name: string; description: string; type?: string }>;\n\t\treturns?: { description: string; type?: string };\n\t\tthrows?: Array<{ type?: string; description: string }>;\n\t\texamples?: Array<{ code: string; language: string; line: number }>;\n\t\ttags?: Record<string, string[]>;\n\t\tdeprecated?: string;\n\t};\n\t/** Human-readable type signature of the symbol. */\n\tsignature?: string;\n\t/** Child symbols (e.g., class members, enum values). */\n\tchildren?: ForgeSymbol[];\n\t/** Whether this symbol is part of the public module exports. */\n\texported: boolean;\n}\n\n/**\n * Full configuration for a forge-ts run.\n * Loaded from forge-ts.config.ts or the \"forge-ts\" key in package.json.\n * @public\n */\nexport interface ForgeConfig {\n\t/** Root directory of the project. */\n\trootDir: string;\n\t/** Path to the tsconfig.json to compile against. */\n\ttsconfig: string;\n\t/** Output directory for generated files. */\n\toutDir: string;\n\t/** Enforce TSDoc on all public exports. */\n\tenforce: {\n\t\tenabled: boolean;\n\t\t/** Minimum visibility level to enforce documentation on. */\n\t\tminVisibility: Visibility;\n\t\t/** Fail on warnings rather than only on errors. */\n\t\tstrict: boolean;\n\t};\n\t/** DocTest configuration. */\n\tdoctest: {\n\t\tenabled: boolean;\n\t\t/** Cache directory for virtual test files. */\n\t\tcacheDir: string;\n\t};\n\t/** API generation configuration. */\n\tapi: {\n\t\tenabled: boolean;\n\t\t/** Generate an OpenAPI spec from exported HTTP handlers. */\n\t\topenapi: boolean;\n\t\t/** Output path for the OpenAPI spec file. */\n\t\topenapiPath: string;\n\t};\n\t/** Output generation configuration. */\n\tgen: {\n\t\tenabled: boolean;\n\t\t/** Output formats to generate. */\n\t\tformats: Array<\"markdown\" | \"mdx\">;\n\t\t/** Generate an llms.txt companion file. */\n\t\tllmsTxt: boolean;\n\t\t/** Synchronise summaries back into README.md. */\n\t\treadmeSync: boolean;\n\t\t/** Static site generator to target for output format. */\n\t\tssgTarget?: \"docusaurus\" | \"mintlify\" | \"nextra\" | \"vitepress\";\n\t};\n}\n\n/**\n * The result of a forge-ts compilation pass.\n * @public\n */\nexport interface ForgeResult {\n\t/** Whether the run succeeded without errors. */\n\tsuccess: boolean;\n\t/** All symbols extracted during this run. */\n\tsymbols: ForgeSymbol[];\n\t/** Errors that caused or would cause failure. */\n\terrors: ForgeError[];\n\t/** Non-fatal warnings. */\n\twarnings: ForgeWarning[];\n\t/** Wall-clock duration of the run in milliseconds. */\n\tduration: number;\n}\n\n/**\n * A diagnostic error produced during a forge-ts run.\n * @public\n */\nexport interface ForgeError {\n\t/** Machine-readable error code (e.g. \"E001\"). */\n\tcode: string;\n\t/** Human-readable description of the error. */\n\tmessage: string;\n\t/** Absolute path of the file where the error occurred. */\n\tfilePath: string;\n\t/** 1-based line number. */\n\tline: number;\n\t/** 0-based column. */\n\tcolumn: number;\n\t/** Suggested fix for the agent — exact TSDoc block to add. */\n\tsuggestedFix?: string;\n\t/** The symbol name that needs fixing. */\n\tsymbolName?: string;\n\t/** The symbol kind (function, class, interface, etc.). */\n\tsymbolKind?: string;\n}\n\n/**\n * A diagnostic warning produced during a forge-ts run.\n * @public\n */\nexport interface ForgeWarning {\n\t/** Machine-readable warning code (e.g. \"W001\"). */\n\tcode: string;\n\t/** Human-readable description of the warning. */\n\tmessage: string;\n\t/** Absolute path of the file where the warning occurred. */\n\tfilePath: string;\n\t/** 1-based line number. */\n\tline: number;\n\t/** 0-based column. */\n\tcolumn: number;\n}\n","import { type ForgeSymbol, Visibility } from \"./types.js\";\n\n/**\n * Determines the visibility level of a symbol from its TSDoc release tags.\n *\n * The precedence order is:\n * 1. `@internal` → {@link Visibility.Internal}\n * 2. `@beta` → {@link Visibility.Beta}\n * 3. `@public` → {@link Visibility.Public}\n * 4. (no tag) → {@link Visibility.Public} (default for exports)\n *\n * @param tags - The parsed `tags` map from `ForgeSymbol.documentation`.\n * @returns The resolved {@link Visibility} value.\n * @example\n * ```typescript\n * import { resolveVisibility } from \"@forge-ts/core\";\n * const vis = resolveVisibility({ internal: [] });\n * // vis === Visibility.Internal\n * ```\n * @public\n */\nexport function resolveVisibility(tags: Record<string, string[]> | undefined): Visibility {\n\tif (!tags) return Visibility.Public;\n\n\tif (\"internal\" in tags) return Visibility.Internal;\n\tif (\"beta\" in tags) return Visibility.Beta;\n\tif (\"public\" in tags) return Visibility.Public;\n\n\treturn Visibility.Public;\n}\n\n/**\n * Numeric rank used for visibility comparisons.\n * Lower numbers are more restrictive.\n * @internal\n */\nconst VISIBILITY_RANK: Record<Visibility, number> = {\n\t[Visibility.Public]: 0,\n\t[Visibility.Beta]: 1,\n\t[Visibility.Internal]: 2,\n\t[Visibility.Private]: 3,\n};\n\n/**\n * Returns whether `candidate` meets or exceeds the required minimum visibility.\n *\n * \"Meets\" means the symbol is at least as visible as `minVisibility`.\n * For example, `Public` meets a minimum of `Public`, but `Internal` does not.\n *\n * @param candidate - The visibility of the symbol being tested.\n * @param minVisibility - The minimum visibility threshold.\n * @returns `true` if `candidate` is at least as visible as `minVisibility`.\n * @example\n * ```typescript\n * import { meetsVisibility, Visibility } from \"@forge-ts/core\";\n * meetsVisibility(Visibility.Public, Visibility.Public); // true\n * meetsVisibility(Visibility.Internal, Visibility.Public); // false\n * ```\n * @public\n */\nexport function meetsVisibility(candidate: Visibility, minVisibility: Visibility): boolean {\n\treturn VISIBILITY_RANK[candidate] <= VISIBILITY_RANK[minVisibility];\n}\n\n/**\n * Filters an array of {@link ForgeSymbol} objects to only include symbols\n * whose visibility meets or exceeds `minVisibility`.\n *\n * @param symbols - The full list of symbols to filter.\n * @param minVisibility - The minimum visibility threshold to keep.\n * @returns A new array containing only symbols that pass the visibility check.\n * @example\n * ```typescript\n * import { filterByVisibility, Visibility } from \"@forge-ts/core\";\n * const publicOnly = filterByVisibility(symbols, Visibility.Public);\n * ```\n * @public\n */\nexport function filterByVisibility(\n\tsymbols: ForgeSymbol[],\n\tminVisibility: Visibility,\n): ForgeSymbol[] {\n\treturn symbols.filter((s) => meetsVisibility(s.visibility, minVisibility));\n}\n","import { readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport {\n\ttype DocBlock,\n\ttype DocCodeSpan,\n\ttype DocComment,\n\ttype DocFencedCode,\n\ttype DocNode,\n\tDocNodeKind,\n\ttype DocParagraph,\n\ttype DocPlainText,\n\ttype DocSection,\n\tStandardTags,\n\tTSDocConfiguration,\n\tTSDocParser,\n} from \"@microsoft/tsdoc\";\nimport ts from \"typescript\";\nimport type { ForgeConfig, ForgeSymbol } from \"./types.js\";\nimport { resolveVisibility } from \"./visibility.js\";\n\n// ---------------------------------------------------------------------------\n// Public API surface\n// ---------------------------------------------------------------------------\n\n/**\n * The return type of {@link createWalker}.\n * @public\n */\nexport interface ASTWalker {\n\t/**\n\t * Walk all source files referenced by the configured tsconfig and return\n\t * one {@link ForgeSymbol} per exported declaration.\n\t */\n\twalk(): ForgeSymbol[];\n}\n\n// ---------------------------------------------------------------------------\n// TSDoc helpers\n// ---------------------------------------------------------------------------\n\n/** Render inline nodes (PlainText, CodeSpan, SoftBreak) to a plain string. @internal */\nfunction renderInlineNodes(nodes: readonly DocNode[]): string {\n\tconst parts: string[] = [];\n\tfor (const node of nodes) {\n\t\tswitch (node.kind) {\n\t\t\tcase DocNodeKind.PlainText:\n\t\t\t\tparts.push((node as DocPlainText).text);\n\t\t\t\tbreak;\n\t\t\tcase DocNodeKind.CodeSpan:\n\t\t\t\tparts.push(`\\`${(node as DocCodeSpan).code}\\``);\n\t\t\t\tbreak;\n\t\t\tcase DocNodeKind.SoftBreak:\n\t\t\t\tparts.push(\" \");\n\t\t\t\tbreak;\n\t\t\tcase DocNodeKind.Paragraph:\n\t\t\t\t// Recurse into paragraph nodes to extract nested text\n\t\t\t\tparts.push(renderInlineNodes((node as DocParagraph).nodes));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn parts.join(\"\");\n}\n\n/** Render a `DocSection` (or similar node) to a plain string. @internal */\nfunction renderDocSection(section: DocSection | undefined): string {\n\tif (!section) return \"\";\n\treturn renderInlineNodes(section.nodes).trim();\n}\n\n/** Render a `DocBlock`'s content to a plain string. @internal */\nfunction renderBlock(block: DocBlock): string {\n\treturn renderDocSection(block.content);\n}\n\n/** Extract all `@example` fenced code blocks from a parsed comment. @internal */\nfunction extractExamples(\n\tcomment: DocComment,\n\tstartLine: number,\n): Array<{ code: string; language: string; line: number }> {\n\tconst examples: Array<{ code: string; language: string; line: number }> = [];\n\n\tfor (const block of comment.customBlocks) {\n\t\tif (block.blockTag.tagName.toLowerCase() !== \"@example\") continue;\n\n\t\tfor (const node of block.content.nodes) {\n\t\t\tif (node.kind === DocNodeKind.FencedCode) {\n\t\t\t\tconst fenced = node as DocFencedCode;\n\t\t\t\texamples.push({\n\t\t\t\t\tcode: fenced.code,\n\t\t\t\t\tlanguage: fenced.language || \"typescript\",\n\t\t\t\t\tline: startLine,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treturn examples;\n}\n\n/** Parse a raw JSDoc/TSDoc comment string into a structured documentation object. @internal */\nfunction parseTSDoc(rawComment: string, startLine: number): ForgeSymbol[\"documentation\"] {\n\tconst configuration = new TSDocConfiguration();\n\tconst parser = new TSDocParser(configuration);\n\tconst result = parser.parseString(rawComment);\n\tconst comment = result.docComment;\n\n\tconst tags: Record<string, string[]> = {};\n\n\t// Release tags\n\tif (comment.modifierTagSet.hasTag(StandardTags.public)) {\n\t\ttags.public = [];\n\t}\n\tif (comment.modifierTagSet.hasTag(StandardTags.beta)) {\n\t\ttags.beta = [];\n\t}\n\tif (comment.modifierTagSet.hasTag(StandardTags.internal)) {\n\t\ttags.internal = [];\n\t}\n\tif (comment.modifierTagSet.hasTag(StandardTags.alpha)) {\n\t\ttags.alpha = [];\n\t}\n\tif (comment.modifierTagSet.hasTag(StandardTags.packageDocumentation)) {\n\t\ttags.packageDocumentation = [];\n\t}\n\n\t// @deprecated\n\tlet deprecated: string | undefined;\n\tif (comment.deprecatedBlock) {\n\t\tdeprecated = renderBlock(comment.deprecatedBlock).trim() || \"true\";\n\t}\n\n\t// @param blocks\n\tconst params: Array<{ name: string; description: string; type?: string }> = [];\n\tfor (const paramBlock of comment.params.blocks) {\n\t\tparams.push({\n\t\t\tname: paramBlock.parameterName,\n\t\t\tdescription: renderBlock(paramBlock),\n\t\t});\n\t}\n\n\t// @returns block\n\tlet returns: { description: string; type?: string } | undefined;\n\tif (comment.returnsBlock) {\n\t\tconst desc = renderBlock(comment.returnsBlock);\n\t\tif (desc) returns = { description: desc };\n\t}\n\n\t// @throws blocks\n\tconst throws: Array<{ type?: string; description: string }> = [];\n\tfor (const block of comment.customBlocks) {\n\t\tif (block.blockTag.tagName.toLowerCase() === \"@throws\") {\n\t\t\tthrows.push({ description: renderBlock(block) });\n\t\t}\n\t}\n\n\t// @example blocks\n\tconst examples = extractExamples(comment, startLine);\n\n\tconst summary = renderDocSection(comment.summarySection);\n\n\treturn {\n\t\tsummary: summary || undefined,\n\t\tparams: params.length > 0 ? params : undefined,\n\t\treturns,\n\t\tthrows: throws.length > 0 ? throws : undefined,\n\t\texamples: examples.length > 0 ? examples : undefined,\n\t\ttags: Object.keys(tags).length > 0 ? tags : undefined,\n\t\tdeprecated,\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// TypeScript AST helpers\n// ---------------------------------------------------------------------------\n\n/** Extract the leading JSDoc comment text for a node. @internal */\nfunction getLeadingComment(node: ts.Node, sourceFile: ts.SourceFile): string | undefined {\n\tconst fullText = sourceFile.getFullText();\n\tconst ranges = ts.getLeadingCommentRanges(fullText, node.getFullStart());\n\tif (!ranges || ranges.length === 0) return undefined;\n\n\t// Take the last leading comment (closest to the declaration)\n\tconst range = ranges[ranges.length - 1];\n\tif (\n\t\trange.kind !== ts.SyntaxKind.MultiLineCommentTrivia ||\n\t\t!fullText.slice(range.pos, range.end).startsWith(\"/**\")\n\t) {\n\t\treturn undefined;\n\t}\n\n\treturn fullText.slice(range.pos, range.end);\n}\n\n/** Map a TypeScript `SyntaxKind` to a `ForgeSymbol` kind string. @internal */\nfunction kindToString(kind: ts.SyntaxKind): ForgeSymbol[\"kind\"] | null {\n\tswitch (kind) {\n\t\tcase ts.SyntaxKind.FunctionDeclaration:\n\t\tcase ts.SyntaxKind.ArrowFunction:\n\t\tcase ts.SyntaxKind.FunctionExpression:\n\t\t\treturn \"function\";\n\t\tcase ts.SyntaxKind.ClassDeclaration:\n\t\t\treturn \"class\";\n\t\tcase ts.SyntaxKind.InterfaceDeclaration:\n\t\t\treturn \"interface\";\n\t\tcase ts.SyntaxKind.TypeAliasDeclaration:\n\t\t\treturn \"type\";\n\t\tcase ts.SyntaxKind.EnumDeclaration:\n\t\t\treturn \"enum\";\n\t\tcase ts.SyntaxKind.VariableDeclaration:\n\t\tcase ts.SyntaxKind.VariableStatement:\n\t\t\treturn \"variable\";\n\t\tcase ts.SyntaxKind.MethodDeclaration:\n\t\tcase ts.SyntaxKind.MethodSignature:\n\t\t\treturn \"method\";\n\t\tcase ts.SyntaxKind.PropertyDeclaration:\n\t\tcase ts.SyntaxKind.PropertySignature:\n\t\tcase ts.SyntaxKind.EnumMember:\n\t\t\treturn \"property\";\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\n/** Build a human-readable type signature string using the type checker. @internal */\nfunction buildSignature(node: ts.Declaration, checker: ts.TypeChecker): string | undefined {\n\ttry {\n\t\tconst symbol = checker.getSymbolAtLocation((node as ts.NamedDeclaration).name ?? node);\n\t\tif (!symbol) return undefined;\n\t\tconst type = checker.getTypeOfSymbolAtLocation(symbol, node);\n\t\treturn checker.typeToString(type);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Walker implementation\n// ---------------------------------------------------------------------------\n\n/** @internal */\nfunction extractSymbolsFromFile(\n\tsourceFile: ts.SourceFile,\n\tchecker: ts.TypeChecker,\n\t_tsdocParser: TSDocParser,\n): ForgeSymbol[] {\n\tconst symbols: ForgeSymbol[] = [];\n\tconst filePath = sourceFile.fileName;\n\n\tfunction visit(node: ts.Node, parentExported: boolean): void {\n\t\tconst isExported =\n\t\t\tparentExported ||\n\t\t\t(ts.getCombinedModifierFlags(node as ts.Declaration) & ts.ModifierFlags.Export) !== 0;\n\n\t\t// Handle export declarations: `export { Foo, Bar }`\n\t\tif (ts.isExportDeclaration(node)) {\n\t\t\tts.forEachChild(node, (child) => visit(child, true));\n\t\t\treturn;\n\t\t}\n\n\t\tconst kind = kindToString(node.kind);\n\n\t\t// Variable statements need special handling: `export const foo = ...`\n\t\tif (ts.isVariableStatement(node)) {\n\t\t\tif (!isExported) {\n\t\t\t\tts.forEachChild(node, (child) => visit(child, false));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const decl of node.declarationList.declarations) {\n\t\t\t\tconst name = decl.name.getText(sourceFile);\n\t\t\t\tconst pos = sourceFile.getLineAndCharacterOfPosition(decl.getStart());\n\t\t\t\tconst rawComment = getLeadingComment(node, sourceFile);\n\t\t\t\tconst documentation = rawComment ? parseTSDoc(rawComment, pos.line + 1) : undefined;\n\t\t\t\tconst tags = documentation?.tags;\n\t\t\t\tconst visibility = resolveVisibility(tags);\n\n\t\t\t\tsymbols.push({\n\t\t\t\t\tname,\n\t\t\t\t\tkind: \"variable\",\n\t\t\t\t\tvisibility,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tline: pos.line + 1,\n\t\t\t\t\tcolumn: pos.character,\n\t\t\t\t\tdocumentation,\n\t\t\t\t\tsignature: buildSignature(decl, checker),\n\t\t\t\t\texported: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (kind === null || !isExported) {\n\t\t\tts.forEachChild(node, (child) => visit(child, isExported));\n\t\t\treturn;\n\t\t}\n\n\t\tconst namedNode = node as ts.NamedDeclaration;\n\t\tconst nameNode = namedNode.name;\n\t\tif (!nameNode) {\n\t\t\tts.forEachChild(node, (child) => visit(child, isExported));\n\t\t\treturn;\n\t\t}\n\n\t\tconst name = nameNode.getText(sourceFile);\n\t\tconst pos = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n\t\tconst rawComment = getLeadingComment(node, sourceFile);\n\t\tconst documentation = rawComment ? parseTSDoc(rawComment, pos.line + 1) : undefined;\n\t\tconst tags = documentation?.tags;\n\t\tconst visibility = resolveVisibility(tags);\n\n\t\tconst children: ForgeSymbol[] = [];\n\n\t\t// Walk class members / interface members / enum members\n\t\tif (\n\t\t\tts.isClassDeclaration(node) ||\n\t\t\tts.isInterfaceDeclaration(node) ||\n\t\t\tts.isEnumDeclaration(node)\n\t\t) {\n\t\t\tfor (const member of node.members) {\n\t\t\t\tconst memberKind = kindToString(member.kind);\n\t\t\t\tif (!memberKind) continue;\n\t\t\t\tconst memberName = (member as ts.NamedDeclaration).name?.getText(sourceFile) ?? \"\";\n\t\t\t\tconst memberPos = sourceFile.getLineAndCharacterOfPosition(member.getStart());\n\t\t\t\tconst memberComment = getLeadingComment(member, sourceFile);\n\t\t\t\tconst memberDoc = memberComment ? parseTSDoc(memberComment, memberPos.line + 1) : undefined;\n\t\t\t\tconst memberTags = memberDoc?.tags;\n\t\t\t\tconst memberVisibility = resolveVisibility(memberTags);\n\n\t\t\t\tchildren.push({\n\t\t\t\t\tname: memberName,\n\t\t\t\t\tkind: memberKind,\n\t\t\t\t\tvisibility: memberVisibility,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tline: memberPos.line + 1,\n\t\t\t\t\tcolumn: memberPos.character,\n\t\t\t\t\tdocumentation: memberDoc,\n\t\t\t\t\tsignature: buildSignature(member as ts.Declaration, checker),\n\t\t\t\t\texported: false,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tsymbols.push({\n\t\t\tname,\n\t\t\tkind,\n\t\t\tvisibility,\n\t\t\tfilePath,\n\t\t\tline: pos.line + 1,\n\t\t\tcolumn: pos.character,\n\t\t\tdocumentation,\n\t\t\tsignature: buildSignature(namedNode as ts.Declaration, checker),\n\t\t\tchildren: children.length > 0 ? children : undefined,\n\t\t\texported: isExported,\n\t\t});\n\t}\n\n\tts.forEachChild(sourceFile, (node) => visit(node, false));\n\treturn symbols;\n}\n\n/**\n * Creates an {@link ASTWalker} configured for the given forge config.\n *\n * The walker uses the TypeScript Compiler API to create a `ts.Program` from\n * the project's tsconfig, then visits every source file to extract exported\n * declarations. TSDoc comments are parsed with `@microsoft/tsdoc` to\n * populate the `documentation` field on each {@link ForgeSymbol}.\n *\n * @param config - The resolved {@link ForgeConfig} for the project.\n * @returns An {@link ASTWalker} instance whose `walk()` method performs the extraction.\n * @example\n * ```typescript\n * import { loadConfig, createWalker } from \"@forge-ts/core\";\n * const config = await loadConfig();\n * const walker = createWalker(config);\n * const symbols = walker.walk();\n * console.log(`Found ${symbols.length} symbols`);\n * ```\n * @public\n */\nexport function createWalker(config: ForgeConfig): ASTWalker {\n\treturn {\n\t\twalk(): ForgeSymbol[] {\n\t\t\t// Load tsconfig\n\t\t\tconst tsconfigPath = resolve(config.tsconfig);\n\t\t\tconst configFile = ts.readConfigFile(tsconfigPath, (path) => readFileSync(path, \"utf8\"));\n\n\t\t\tif (configFile.error) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to read tsconfig at ${tsconfigPath}: ${ts.flattenDiagnosticMessageText(configFile.error.messageText, \"\\n\")}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst parsedCommandLine = ts.parseJsonConfigFileContent(\n\t\t\t\tconfigFile.config,\n\t\t\t\tts.sys,\n\t\t\t\tresolve(config.rootDir),\n\t\t\t);\n\n\t\t\tconst program = ts.createProgram({\n\t\t\t\trootNames: parsedCommandLine.fileNames,\n\t\t\t\toptions: parsedCommandLine.options,\n\t\t\t});\n\n\t\t\tconst checker = program.getTypeChecker();\n\n\t\t\tconst tsdocConfiguration = new TSDocConfiguration();\n\t\t\tconst tsdocParser = new TSDocParser(tsdocConfiguration);\n\n\t\t\tconst allSymbols: ForgeSymbol[] = [];\n\n\t\t\tfor (const sourceFile of program.getSourceFiles()) {\n\t\t\t\t// Skip declaration files and node_modules\n\t\t\t\tif (sourceFile.isDeclarationFile || sourceFile.fileName.includes(\"node_modules\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst fileSymbols = extractSymbolsFromFile(sourceFile, checker, tsdocParser);\n\t\t\t\tallSymbols.push(...fileSymbols);\n\t\t\t}\n\n\t\t\treturn allSymbols;\n\t\t},\n\t};\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,MAAM,eAAe;AAC9B,SAAS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;AAC3E,mBAAW,KAAK,GAAG,WAAW;AAAA,MAC/B;AAEA,aAAO;AAAA,IACR;AAAA,EACD;AACD;","names":["Visibility","resolve","name","pos","rawComment","documentation","tags","visibility","resolve"]}
1
+ {"version":3,"sources":["../src/config.ts","../src/types.ts","../src/visibility.ts","../src/walker.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { type ForgeConfig, Visibility } from \"./types.js\";\n\n/**\n * Constructs a sensible default {@link ForgeConfig} rooted at `rootDir`.\n *\n * @param rootDir - Absolute path to the project root.\n * @returns A fully-populated default configuration.\n * @example\n * ```typescript\n * import { defaultConfig } from \"@forge-ts/core\";\n * const config = defaultConfig(\"/path/to/project\");\n * console.log(config.enforce.enabled); // true\n * ```\n * @public\n */\nexport function defaultConfig(rootDir: string): ForgeConfig {\n\treturn {\n\t\trootDir,\n\t\ttsconfig: join(rootDir, \"tsconfig.json\"),\n\t\toutDir: join(rootDir, \"docs\"),\n\t\tenforce: {\n\t\t\tenabled: true,\n\t\t\tminVisibility: Visibility.Public,\n\t\t\tstrict: false,\n\t\t\trules: {\n\t\t\t\t\"require-summary\": \"error\",\n\t\t\t\t\"require-param\": \"error\",\n\t\t\t\t\"require-returns\": \"error\",\n\t\t\t\t\"require-example\": \"error\",\n\t\t\t\t\"require-package-doc\": \"warn\",\n\t\t\t\t\"require-class-member-doc\": \"error\",\n\t\t\t\t\"require-interface-member-doc\": \"error\",\n\t\t\t},\n\t\t},\n\t\tdoctest: {\n\t\t\tenabled: true,\n\t\t\tcacheDir: join(rootDir, \".cache\", \"doctest\"),\n\t\t},\n\t\tapi: {\n\t\t\tenabled: false,\n\t\t\topenapi: false,\n\t\t\topenapiPath: join(rootDir, \"docs\", \"openapi.json\"),\n\t\t},\n\t\tgen: {\n\t\t\tenabled: true,\n\t\t\tformats: [\"markdown\"],\n\t\t\tllmsTxt: true,\n\t\t\treadmeSync: false,\n\t\t},\n\t};\n}\n\n/**\n * Merges a partial user config with the defaults so every field is present.\n *\n * @param rootDir - Absolute path to the project root.\n * @param partial - Partial config from the user's config file.\n * @returns A fully-populated {@link ForgeConfig}.\n * @internal\n */\nfunction mergeWithDefaults(rootDir: string, partial: Partial<ForgeConfig>): ForgeConfig {\n\tconst defaults = defaultConfig(rootDir);\n\treturn {\n\t\t...defaults,\n\t\t...partial,\n\t\tenforce: {\n\t\t\t...defaults.enforce,\n\t\t\t...partial.enforce,\n\t\t\trules: { ...defaults.enforce.rules, ...partial.enforce?.rules },\n\t\t},\n\t\tdoctest: { ...defaults.doctest, ...partial.doctest },\n\t\tapi: { ...defaults.api, ...partial.api },\n\t\tgen: { ...defaults.gen, ...partial.gen },\n\t};\n}\n\n/**\n * Attempts to load a TypeScript or JavaScript config file via dynamic import.\n *\n * @param filePath - Absolute path to the config file.\n * @returns The default export of the config module, or `null` on failure.\n * @internal\n */\nasync function loadModuleConfig(filePath: string): Promise<Partial<ForgeConfig> | null> {\n\ttry {\n\t\tconst fileUrl = pathToFileURL(filePath).href;\n\t\tconst mod = (await import(fileUrl)) as {\n\t\t\tdefault?: Partial<ForgeConfig>;\n\t\t};\n\t\treturn mod.default ?? null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/**\n * Minimal shape of a `package.json` file relevant to forge-ts config loading.\n * @internal\n */\ninterface PackageJson {\n\tname?: string;\n\tversion?: string;\n\t\"forge-ts\"?: Partial<ForgeConfig>;\n}\n\n/**\n * Attempts to read the `\"forge-ts\"` key from a `package.json` file.\n *\n * @param pkgPath - Absolute path to `package.json`.\n * @returns The value of the `\"forge-ts\"` key, or `null` if absent.\n * @internal\n */\nasync function loadPackageJsonConfig(pkgPath: string): Promise<Partial<ForgeConfig> | null> {\n\ttry {\n\t\tconst raw = await readFile(pkgPath, \"utf8\");\n\t\tconst pkg = JSON.parse(raw) as PackageJson;\n\t\tconst key = pkg[\"forge-ts\"];\n\t\tif (key) {\n\t\t\treturn key;\n\t\t}\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/**\n * Loads the forge-ts configuration for a project.\n *\n * Resolution order:\n * 1. `<rootDir>/forge-ts.config.ts`\n * 2. `<rootDir>/forge-ts.config.js`\n * 3. `\"forge-ts\"` key inside `<rootDir>/package.json`\n * 4. Built-in defaults (returned when none of the above is found)\n *\n * @param rootDir - The project root to search for config. Defaults to `process.cwd()`.\n * @returns A fully-resolved {@link ForgeConfig}.\n * @example\n * ```typescript\n * import { loadConfig } from \"@forge-ts/core\";\n * const config = await loadConfig(\"/path/to/project\");\n * // config is fully resolved with defaults\n * ```\n * @public\n */\nexport async function loadConfig(rootDir?: string): Promise<ForgeConfig> {\n\tconst root = resolve(rootDir ?? process.cwd());\n\n\tconst candidates = [join(root, \"forge-ts.config.ts\"), join(root, \"forge-ts.config.js\")];\n\n\tfor (const candidate of candidates) {\n\t\tif (existsSync(candidate)) {\n\t\t\tconst partial = await loadModuleConfig(candidate);\n\t\t\tif (partial) {\n\t\t\t\treturn mergeWithDefaults(root, partial);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst pkgPath = join(root, \"package.json\");\n\tif (existsSync(pkgPath)) {\n\t\tconst partial = await loadPackageJsonConfig(pkgPath);\n\t\tif (partial) {\n\t\t\treturn mergeWithDefaults(root, partial);\n\t\t}\n\t}\n\n\treturn defaultConfig(root);\n}\n","/**\n * Visibility levels for exported symbols.\n * Derived from TSDoc release tags (@public, @beta, @internal).\n * @public\n */\nexport enum Visibility {\n\tPublic = \"public\",\n\tBeta = \"beta\",\n\tInternal = \"internal\",\n\tPrivate = \"private\",\n}\n\n/**\n * A single extracted and annotated symbol from the TypeScript AST.\n * @public\n */\nexport interface ForgeSymbol {\n\t/** The declared name of the symbol. */\n\tname: string;\n\t/** The syntactic kind of the symbol. */\n\tkind: \"function\" | \"class\" | \"interface\" | \"type\" | \"enum\" | \"variable\" | \"method\" | \"property\";\n\t/** Resolved visibility from TSDoc release tags. */\n\tvisibility: Visibility;\n\t/** Absolute path to the source file. */\n\tfilePath: string;\n\t/** 1-based line number of the declaration. */\n\tline: number;\n\t/** 0-based column of the declaration. */\n\tcolumn: number;\n\t/** Parsed TSDoc documentation, if present. */\n\tdocumentation?: {\n\t\tsummary?: string;\n\t\tparams?: Array<{ name: string; description: string; type?: string }>;\n\t\treturns?: { description: string; type?: string };\n\t\tthrows?: Array<{ type?: string; description: string }>;\n\t\texamples?: Array<{ code: string; language: string; line: number }>;\n\t\ttags?: Record<string, string[]>;\n\t\tdeprecated?: string;\n\t\t/** {@link} cross-references found in this symbol's TSDoc. */\n\t\tlinks?: Array<{ target: string; line: number }>;\n\t};\n\t/** Human-readable type signature of the symbol. */\n\tsignature?: string;\n\t/** Child symbols (e.g., class members, enum values). */\n\tchildren?: ForgeSymbol[];\n\t/** Whether this symbol is part of the public module exports. */\n\texported: boolean;\n}\n\n/**\n * Severity level for an individual enforcement rule.\n * - `\"error\"` — violation fails the build.\n * - `\"warn\"` — violation is reported but does not fail the build.\n * - `\"off\"` — rule is disabled entirely.\n * @public\n */\nexport type RuleSeverity = \"error\" | \"warn\" | \"off\";\n\n/**\n * Per-rule severity configuration for the TSDoc enforcer.\n * Each key corresponds to one of the E001–E007 rule codes.\n * @public\n */\nexport interface EnforceRules {\n\t/** E001: Exported symbol missing TSDoc summary. */\n\t\"require-summary\": RuleSeverity;\n\t/** E002: Function parameter missing @param tag. */\n\t\"require-param\": RuleSeverity;\n\t/** E003: Non-void function missing @returns tag. */\n\t\"require-returns\": RuleSeverity;\n\t/** E004: Exported function missing @example block. */\n\t\"require-example\": RuleSeverity;\n\t/** E005: Entry point missing @packageDocumentation. */\n\t\"require-package-doc\": RuleSeverity;\n\t/** E006: Class member missing documentation. */\n\t\"require-class-member-doc\": RuleSeverity;\n\t/** E007: Interface/type member missing documentation. */\n\t\"require-interface-member-doc\": RuleSeverity;\n}\n\n/**\n * Full configuration for a forge-ts run.\n * Loaded from forge-ts.config.ts or the \"forge-ts\" key in package.json.\n * @public\n */\nexport interface ForgeConfig {\n\t/** Root directory of the project. */\n\trootDir: string;\n\t/** Path to the tsconfig.json to compile against. */\n\ttsconfig: string;\n\t/** Output directory for generated files. */\n\toutDir: string;\n\t/** Enforce TSDoc on all public exports. */\n\tenforce: {\n\t\tenabled: boolean;\n\t\t/** Minimum visibility level to enforce documentation on. */\n\t\tminVisibility: Visibility;\n\t\t/** Fail on warnings rather than only on errors. */\n\t\tstrict: boolean;\n\t\t/** Per-rule severity overrides. When strict is true, all \"warn\" become \"error\". */\n\t\trules: EnforceRules;\n\t};\n\t/** DocTest configuration. */\n\tdoctest: {\n\t\tenabled: boolean;\n\t\t/** Cache directory for virtual test files. */\n\t\tcacheDir: string;\n\t};\n\t/** API generation configuration. */\n\tapi: {\n\t\tenabled: boolean;\n\t\t/** Generate an OpenAPI spec from exported HTTP handlers. */\n\t\topenapi: boolean;\n\t\t/** Output path for the OpenAPI spec file. */\n\t\topenapiPath: string;\n\t};\n\t/** Output generation configuration. */\n\tgen: {\n\t\tenabled: boolean;\n\t\t/** Output formats to generate. */\n\t\tformats: Array<\"markdown\" | \"mdx\">;\n\t\t/** Generate an llms.txt companion file. */\n\t\tllmsTxt: boolean;\n\t\t/** Synchronise summaries back into README.md. */\n\t\treadmeSync: boolean;\n\t\t/** Static site generator to target for output format. */\n\t\tssgTarget?: \"docusaurus\" | \"mintlify\" | \"nextra\" | \"vitepress\";\n\t};\n}\n\n/**\n * The result of a forge-ts compilation pass.\n * @public\n */\nexport interface ForgeResult {\n\t/** Whether the run succeeded without errors. */\n\tsuccess: boolean;\n\t/** All symbols extracted during this run. */\n\tsymbols: ForgeSymbol[];\n\t/** Errors that caused or would cause failure. */\n\terrors: ForgeError[];\n\t/** Non-fatal warnings. */\n\twarnings: ForgeWarning[];\n\t/** Wall-clock duration of the run in milliseconds. */\n\tduration: number;\n}\n\n/**\n * A diagnostic error produced during a forge-ts run.\n * @public\n */\nexport interface ForgeError {\n\t/** Machine-readable error code (e.g. \"E001\"). */\n\tcode: string;\n\t/** Human-readable description of the error. */\n\tmessage: string;\n\t/** Absolute path of the file where the error occurred. */\n\tfilePath: string;\n\t/** 1-based line number. */\n\tline: number;\n\t/** 0-based column. */\n\tcolumn: number;\n\t/** Suggested fix for the agent — exact TSDoc block to add. */\n\tsuggestedFix?: string;\n\t/** The symbol name that needs fixing. */\n\tsymbolName?: string;\n\t/** The symbol kind (function, class, interface, etc.). */\n\tsymbolKind?: string;\n}\n\n/**\n * A diagnostic warning produced during a forge-ts run.\n * @public\n */\nexport interface ForgeWarning {\n\t/** Machine-readable warning code (e.g. \"W001\"). */\n\tcode: string;\n\t/** Human-readable description of the warning. */\n\tmessage: string;\n\t/** Absolute path of the file where the warning occurred. */\n\tfilePath: string;\n\t/** 1-based line number. */\n\tline: number;\n\t/** 0-based column. */\n\tcolumn: number;\n}\n","import { type ForgeSymbol, Visibility } from \"./types.js\";\n\n/**\n * Determines the visibility level of a symbol from its TSDoc release tags.\n *\n * The precedence order is:\n * 1. `@internal` → {@link Visibility.Internal}\n * 2. `@beta` → {@link Visibility.Beta}\n * 3. `@public` → {@link Visibility.Public}\n * 4. (no tag) → {@link Visibility.Public} (default for exports)\n *\n * @param tags - The parsed `tags` map from `ForgeSymbol.documentation`.\n * @returns The resolved {@link Visibility} value.\n * @example\n * ```typescript\n * import { resolveVisibility } from \"@forge-ts/core\";\n * const vis = resolveVisibility({ internal: [] });\n * // vis === Visibility.Internal\n * ```\n * @public\n */\nexport function resolveVisibility(tags: Record<string, string[]> | undefined): Visibility {\n\tif (!tags) return Visibility.Public;\n\n\tif (\"internal\" in tags) return Visibility.Internal;\n\tif (\"beta\" in tags) return Visibility.Beta;\n\tif (\"public\" in tags) return Visibility.Public;\n\n\treturn Visibility.Public;\n}\n\n/**\n * Numeric rank used for visibility comparisons.\n * Lower numbers are more restrictive.\n * @internal\n */\nconst VISIBILITY_RANK: Record<Visibility, number> = {\n\t[Visibility.Public]: 0,\n\t[Visibility.Beta]: 1,\n\t[Visibility.Internal]: 2,\n\t[Visibility.Private]: 3,\n};\n\n/**\n * Returns whether `candidate` meets or exceeds the required minimum visibility.\n *\n * \"Meets\" means the symbol is at least as visible as `minVisibility`.\n * For example, `Public` meets a minimum of `Public`, but `Internal` does not.\n *\n * @param candidate - The visibility of the symbol being tested.\n * @param minVisibility - The minimum visibility threshold.\n * @returns `true` if `candidate` is at least as visible as `minVisibility`.\n * @example\n * ```typescript\n * import { meetsVisibility, Visibility } from \"@forge-ts/core\";\n * meetsVisibility(Visibility.Public, Visibility.Public); // true\n * meetsVisibility(Visibility.Internal, Visibility.Public); // false\n * ```\n * @public\n */\nexport function meetsVisibility(candidate: Visibility, minVisibility: Visibility): boolean {\n\treturn VISIBILITY_RANK[candidate] <= VISIBILITY_RANK[minVisibility];\n}\n\n/**\n * Filters an array of {@link ForgeSymbol} objects to only include symbols\n * whose visibility meets or exceeds `minVisibility`.\n *\n * @param symbols - The full list of symbols to filter.\n * @param minVisibility - The minimum visibility threshold to keep.\n * @returns A new array containing only symbols that pass the visibility check.\n * @example\n * ```typescript\n * import { filterByVisibility, Visibility } from \"@forge-ts/core\";\n * const publicOnly = filterByVisibility(symbols, Visibility.Public);\n * ```\n * @public\n */\nexport function filterByVisibility(\n\tsymbols: ForgeSymbol[],\n\tminVisibility: Visibility,\n): ForgeSymbol[] {\n\treturn symbols.filter((s) => meetsVisibility(s.visibility, minVisibility));\n}\n","import { readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport {\n\ttype DocBlock,\n\ttype DocCodeSpan,\n\ttype DocComment,\n\ttype DocFencedCode,\n\ttype DocLinkTag,\n\ttype DocNode,\n\tDocNodeKind,\n\ttype DocParagraph,\n\ttype DocPlainText,\n\ttype DocSection,\n\tStandardTags,\n\tTSDocConfiguration,\n\tTSDocParser,\n} from \"@microsoft/tsdoc\";\nimport ts from \"typescript\";\nimport type { ForgeConfig, ForgeSymbol } from \"./types.js\";\nimport { resolveVisibility } from \"./visibility.js\";\n\n// ---------------------------------------------------------------------------\n// Public API surface\n// ---------------------------------------------------------------------------\n\n/**\n * The return type of {@link createWalker}.\n * @public\n */\nexport interface ASTWalker {\n\t/**\n\t * Walk all source files referenced by the configured tsconfig and return\n\t * one {@link ForgeSymbol} per exported declaration.\n\t */\n\twalk(): ForgeSymbol[];\n}\n\n// ---------------------------------------------------------------------------\n// TSDoc helpers\n// ---------------------------------------------------------------------------\n\n/** Render inline nodes (PlainText, CodeSpan, SoftBreak) to a plain string. @internal */\nfunction renderInlineNodes(nodes: readonly DocNode[]): string {\n\tconst parts: string[] = [];\n\tfor (const node of nodes) {\n\t\tswitch (node.kind) {\n\t\t\tcase DocNodeKind.PlainText:\n\t\t\t\tparts.push((node as DocPlainText).text);\n\t\t\t\tbreak;\n\t\t\tcase DocNodeKind.CodeSpan:\n\t\t\t\tparts.push(`\\`${(node as DocCodeSpan).code}\\``);\n\t\t\t\tbreak;\n\t\t\tcase DocNodeKind.SoftBreak:\n\t\t\t\tparts.push(\" \");\n\t\t\t\tbreak;\n\t\t\tcase DocNodeKind.Paragraph:\n\t\t\t\t// Recurse into paragraph nodes to extract nested text\n\t\t\t\tparts.push(renderInlineNodes((node as DocParagraph).nodes));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn parts.join(\"\");\n}\n\n/** Render a `DocSection` (or similar node) to a plain string. @internal */\nfunction renderDocSection(section: DocSection | undefined): string {\n\tif (!section) return \"\";\n\treturn renderInlineNodes(section.nodes).trim();\n}\n\n/** Render a `DocBlock`'s content to a plain string. @internal */\nfunction renderBlock(block: DocBlock): string {\n\treturn renderDocSection(block.content);\n}\n\n/** Extract all `@example` fenced code blocks from a parsed comment. @internal */\nfunction extractExamples(\n\tcomment: DocComment,\n\tstartLine: number,\n): Array<{ code: string; language: string; line: number }> {\n\tconst examples: Array<{ code: string; language: string; line: number }> = [];\n\n\tfor (const block of comment.customBlocks) {\n\t\tif (block.blockTag.tagName.toLowerCase() !== \"@example\") continue;\n\n\t\tfor (const node of block.content.nodes) {\n\t\t\tif (node.kind === DocNodeKind.FencedCode) {\n\t\t\t\tconst fenced = node as DocFencedCode;\n\t\t\t\texamples.push({\n\t\t\t\t\tcode: fenced.code,\n\t\t\t\t\tlanguage: fenced.language || \"typescript\",\n\t\t\t\t\tline: startLine,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treturn examples;\n}\n\n/** Parse a raw JSDoc/TSDoc comment string into a structured documentation object. @internal */\nfunction parseTSDoc(rawComment: string, startLine: number): ForgeSymbol[\"documentation\"] {\n\tconst configuration = new TSDocConfiguration();\n\tconst parser = new TSDocParser(configuration);\n\tconst result = parser.parseString(rawComment);\n\tconst comment = result.docComment;\n\n\tconst tags: Record<string, string[]> = {};\n\n\t// Release tags\n\tif (comment.modifierTagSet.hasTag(StandardTags.public)) {\n\t\ttags.public = [];\n\t}\n\tif (comment.modifierTagSet.hasTag(StandardTags.beta)) {\n\t\ttags.beta = [];\n\t}\n\tif (comment.modifierTagSet.hasTag(StandardTags.internal)) {\n\t\ttags.internal = [];\n\t}\n\tif (comment.modifierTagSet.hasTag(StandardTags.alpha)) {\n\t\ttags.alpha = [];\n\t}\n\tif (comment.modifierTagSet.hasTag(StandardTags.packageDocumentation)) {\n\t\ttags.packageDocumentation = [];\n\t}\n\n\t// @deprecated\n\tlet deprecated: string | undefined;\n\tif (comment.deprecatedBlock) {\n\t\tdeprecated = renderBlock(comment.deprecatedBlock).trim() || \"true\";\n\t}\n\n\t// @param blocks\n\tconst params: Array<{ name: string; description: string; type?: string }> = [];\n\tfor (const paramBlock of comment.params.blocks) {\n\t\tparams.push({\n\t\t\tname: paramBlock.parameterName,\n\t\t\tdescription: renderBlock(paramBlock),\n\t\t});\n\t}\n\n\t// @returns block\n\tlet returns: { description: string; type?: string } | undefined;\n\tif (comment.returnsBlock) {\n\t\tconst desc = renderBlock(comment.returnsBlock);\n\t\tif (desc) returns = { description: desc };\n\t}\n\n\t// @throws blocks\n\tconst throws: Array<{ type?: string; description: string }> = [];\n\tfor (const block of comment.customBlocks) {\n\t\tif (block.blockTag.tagName.toLowerCase() === \"@throws\") {\n\t\t\tthrows.push({ description: renderBlock(block) });\n\t\t}\n\t}\n\n\t// @route blocks - format: \"METHOD /path\"\n\tfor (const block of comment.customBlocks) {\n\t\tif (block.blockTag.tagName.toLowerCase() === \"@route\") {\n\t\t\tconst routeText = renderBlock(block).trim();\n\t\t\tconst match = routeText.match(/^(GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD)\\s+(\\S+)/i);\n\t\t\tif (match) {\n\t\t\t\tif (!tags.route) tags.route = [];\n\t\t\t\ttags.route.push(`${match[1].toUpperCase()} ${match[2]}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// @example blocks\n\tconst examples = extractExamples(comment, startLine);\n\n\t// Extract {@link} references\n\tconst links: Array<{ target: string; line: number }> = [];\n\tfunction walkForLinks(node: DocNode): void {\n\t\tif (node.kind === DocNodeKind.LinkTag) {\n\t\t\tconst linkTag = node as DocLinkTag;\n\t\t\tif (linkTag.codeDestination) {\n\t\t\t\tconst target = linkTag.codeDestination.memberReferences\n\t\t\t\t\t.map((ref) => ref.memberIdentifier?.identifier ?? \"\")\n\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t.join(\".\");\n\t\t\t\tif (target) {\n\t\t\t\t\tlinks.push({ target, line: startLine });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const child of node.getChildNodes()) {\n\t\t\twalkForLinks(child);\n\t\t}\n\t}\n\twalkForLinks(comment);\n\n\tconst summary = renderDocSection(comment.summarySection);\n\n\treturn {\n\t\tsummary: summary || undefined,\n\t\tparams: params.length > 0 ? params : undefined,\n\t\treturns,\n\t\tthrows: throws.length > 0 ? throws : undefined,\n\t\texamples: examples.length > 0 ? examples : undefined,\n\t\ttags: Object.keys(tags).length > 0 ? tags : undefined,\n\t\tdeprecated,\n\t\tlinks: links.length > 0 ? links : undefined,\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// TypeScript AST helpers\n// ---------------------------------------------------------------------------\n\n/** Extract the leading JSDoc comment text for a node. @internal */\nfunction getLeadingComment(node: ts.Node, sourceFile: ts.SourceFile): string | undefined {\n\tconst fullText = sourceFile.getFullText();\n\tconst ranges = ts.getLeadingCommentRanges(fullText, node.getFullStart());\n\tif (!ranges || ranges.length === 0) return undefined;\n\n\t// Take the last leading comment (closest to the declaration)\n\tconst range = ranges[ranges.length - 1];\n\tif (\n\t\trange.kind !== ts.SyntaxKind.MultiLineCommentTrivia ||\n\t\t!fullText.slice(range.pos, range.end).startsWith(\"/**\")\n\t) {\n\t\treturn undefined;\n\t}\n\n\treturn fullText.slice(range.pos, range.end);\n}\n\n/** Map a TypeScript `SyntaxKind` to a `ForgeSymbol` kind string. @internal */\nfunction kindToString(kind: ts.SyntaxKind): ForgeSymbol[\"kind\"] | null {\n\tswitch (kind) {\n\t\tcase ts.SyntaxKind.FunctionDeclaration:\n\t\tcase ts.SyntaxKind.ArrowFunction:\n\t\tcase ts.SyntaxKind.FunctionExpression:\n\t\t\treturn \"function\";\n\t\tcase ts.SyntaxKind.ClassDeclaration:\n\t\t\treturn \"class\";\n\t\tcase ts.SyntaxKind.InterfaceDeclaration:\n\t\t\treturn \"interface\";\n\t\tcase ts.SyntaxKind.TypeAliasDeclaration:\n\t\t\treturn \"type\";\n\t\tcase ts.SyntaxKind.EnumDeclaration:\n\t\t\treturn \"enum\";\n\t\tcase ts.SyntaxKind.VariableDeclaration:\n\t\tcase ts.SyntaxKind.VariableStatement:\n\t\t\treturn \"variable\";\n\t\tcase ts.SyntaxKind.MethodDeclaration:\n\t\tcase ts.SyntaxKind.MethodSignature:\n\t\t\treturn \"method\";\n\t\tcase ts.SyntaxKind.PropertyDeclaration:\n\t\tcase ts.SyntaxKind.PropertySignature:\n\t\tcase ts.SyntaxKind.EnumMember:\n\t\t\treturn \"property\";\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\n/** Build a human-readable type signature string using the type checker. @internal */\nfunction buildSignature(node: ts.Declaration, checker: ts.TypeChecker): string | undefined {\n\ttry {\n\t\tconst symbol = checker.getSymbolAtLocation((node as ts.NamedDeclaration).name ?? node);\n\t\tif (!symbol) return undefined;\n\t\tconst type = checker.getTypeOfSymbolAtLocation(symbol, node);\n\t\treturn checker.typeToString(type);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Walker implementation\n// ---------------------------------------------------------------------------\n\n/** @internal */\nfunction extractSymbolsFromFile(\n\tsourceFile: ts.SourceFile,\n\tchecker: ts.TypeChecker,\n\t_tsdocParser: TSDocParser,\n): ForgeSymbol[] {\n\tconst symbols: ForgeSymbol[] = [];\n\tconst filePath = sourceFile.fileName;\n\n\tfunction visit(node: ts.Node, parentExported: boolean): void {\n\t\tconst isExported =\n\t\t\tparentExported ||\n\t\t\t(ts.getCombinedModifierFlags(node as ts.Declaration) & ts.ModifierFlags.Export) !== 0;\n\n\t\t// Handle export declarations: `export { Foo, Bar }`\n\t\tif (ts.isExportDeclaration(node)) {\n\t\t\tts.forEachChild(node, (child) => visit(child, true));\n\t\t\treturn;\n\t\t}\n\n\t\tconst kind = kindToString(node.kind);\n\n\t\t// Variable statements need special handling: `export const foo = ...`\n\t\tif (ts.isVariableStatement(node)) {\n\t\t\tif (!isExported) {\n\t\t\t\tts.forEachChild(node, (child) => visit(child, false));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const decl of node.declarationList.declarations) {\n\t\t\t\tconst name = decl.name.getText(sourceFile);\n\t\t\t\tconst pos = sourceFile.getLineAndCharacterOfPosition(decl.getStart());\n\t\t\t\tconst rawComment = getLeadingComment(node, sourceFile);\n\t\t\t\tconst documentation = rawComment ? parseTSDoc(rawComment, pos.line + 1) : undefined;\n\t\t\t\tconst tags = documentation?.tags;\n\t\t\t\tconst visibility = resolveVisibility(tags);\n\n\t\t\t\tsymbols.push({\n\t\t\t\t\tname,\n\t\t\t\t\tkind: \"variable\",\n\t\t\t\t\tvisibility,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tline: pos.line + 1,\n\t\t\t\t\tcolumn: pos.character,\n\t\t\t\t\tdocumentation,\n\t\t\t\t\tsignature: buildSignature(decl, checker),\n\t\t\t\t\texported: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (kind === null || !isExported) {\n\t\t\tts.forEachChild(node, (child) => visit(child, isExported));\n\t\t\treturn;\n\t\t}\n\n\t\tconst namedNode = node as ts.NamedDeclaration;\n\t\tconst nameNode = namedNode.name;\n\t\tif (!nameNode) {\n\t\t\tts.forEachChild(node, (child) => visit(child, isExported));\n\t\t\treturn;\n\t\t}\n\n\t\tconst name = nameNode.getText(sourceFile);\n\t\tconst pos = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n\t\tconst rawComment = getLeadingComment(node, sourceFile);\n\t\tconst documentation = rawComment ? parseTSDoc(rawComment, pos.line + 1) : undefined;\n\t\tconst tags = documentation?.tags;\n\t\tconst visibility = resolveVisibility(tags);\n\n\t\tconst children: ForgeSymbol[] = [];\n\n\t\t// Walk class members / interface members / enum members\n\t\tif (\n\t\t\tts.isClassDeclaration(node) ||\n\t\t\tts.isInterfaceDeclaration(node) ||\n\t\t\tts.isEnumDeclaration(node)\n\t\t) {\n\t\t\tfor (const member of node.members) {\n\t\t\t\tconst memberKind = kindToString(member.kind);\n\t\t\t\tif (!memberKind) continue;\n\t\t\t\tconst memberName = (member as ts.NamedDeclaration).name?.getText(sourceFile) ?? \"\";\n\t\t\t\tconst memberPos = sourceFile.getLineAndCharacterOfPosition(member.getStart());\n\t\t\t\tconst memberComment = getLeadingComment(member, sourceFile);\n\t\t\t\tconst memberDoc = memberComment ? parseTSDoc(memberComment, memberPos.line + 1) : undefined;\n\t\t\t\tconst memberTags = memberDoc?.tags;\n\t\t\t\tconst memberVisibility = resolveVisibility(memberTags);\n\n\t\t\t\tchildren.push({\n\t\t\t\t\tname: memberName,\n\t\t\t\t\tkind: memberKind,\n\t\t\t\t\tvisibility: memberVisibility,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tline: memberPos.line + 1,\n\t\t\t\t\tcolumn: memberPos.character,\n\t\t\t\t\tdocumentation: memberDoc,\n\t\t\t\t\tsignature: buildSignature(member as ts.Declaration, checker),\n\t\t\t\t\texported: false,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tsymbols.push({\n\t\t\tname,\n\t\t\tkind,\n\t\t\tvisibility,\n\t\t\tfilePath,\n\t\t\tline: pos.line + 1,\n\t\t\tcolumn: pos.character,\n\t\t\tdocumentation,\n\t\t\tsignature: buildSignature(namedNode as ts.Declaration, checker),\n\t\t\tchildren: children.length > 0 ? children : undefined,\n\t\t\texported: isExported,\n\t\t});\n\t}\n\n\tts.forEachChild(sourceFile, (node) => visit(node, false));\n\treturn symbols;\n}\n\n/**\n * Creates an {@link ASTWalker} configured for the given forge config.\n *\n * The walker uses the TypeScript Compiler API to create a `ts.Program` from\n * the project's tsconfig, then visits every source file to extract exported\n * declarations. TSDoc comments are parsed with `@microsoft/tsdoc` to\n * populate the `documentation` field on each {@link ForgeSymbol}.\n *\n * @param config - The resolved {@link ForgeConfig} for the project.\n * @returns An {@link ASTWalker} instance whose `walk()` method performs the extraction.\n * @example\n * ```typescript\n * import { loadConfig, createWalker } from \"@forge-ts/core\";\n * const config = await loadConfig();\n * const walker = createWalker(config);\n * const symbols = walker.walk();\n * console.log(`Found ${symbols.length} symbols`);\n * ```\n * @public\n */\nexport function createWalker(config: ForgeConfig): ASTWalker {\n\treturn {\n\t\twalk(): ForgeSymbol[] {\n\t\t\t// Load tsconfig\n\t\t\tconst tsconfigPath = resolve(config.tsconfig);\n\t\t\tconst configFile = ts.readConfigFile(tsconfigPath, (path) => readFileSync(path, \"utf8\"));\n\n\t\t\tif (configFile.error) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to read tsconfig at ${tsconfigPath}: ${ts.flattenDiagnosticMessageText(configFile.error.messageText, \"\\n\")}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst parsedCommandLine = ts.parseJsonConfigFileContent(\n\t\t\t\tconfigFile.config,\n\t\t\t\tts.sys,\n\t\t\t\tresolve(config.rootDir),\n\t\t\t);\n\n\t\t\tconst program = ts.createProgram({\n\t\t\t\trootNames: parsedCommandLine.fileNames,\n\t\t\t\toptions: parsedCommandLine.options,\n\t\t\t});\n\n\t\t\tconst checker = program.getTypeChecker();\n\n\t\t\tconst tsdocConfiguration = new TSDocConfiguration();\n\t\t\tconst tsdocParser = new TSDocParser(tsdocConfiguration);\n\n\t\t\tconst allSymbols: ForgeSymbol[] = [];\n\n\t\t\tfor (const sourceFile of program.getSourceFiles()) {\n\t\t\t\t// Skip declaration files and node_modules\n\t\t\t\tif (sourceFile.isDeclarationFile || sourceFile.fileName.includes(\"node_modules\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst fileSymbols = extractSymbolsFromFile(sourceFile, checker, tsdocParser);\n\t\t\t\tallSymbols.push(...fileSymbols);\n\t\t\t}\n\n\t\t\treturn allSymbols;\n\t\t},\n\t};\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;;;ACEvB,IAAK,aAAL,kBAAKA,gBAAL;AACN,EAAAA,YAAA,YAAS;AACT,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,cAAW;AACX,EAAAA,YAAA,aAAU;AAJC,SAAAA;AAAA,GAAA;;;ADcL,SAAS,cAAc,SAA8B;AAC3D,SAAO;AAAA,IACN;AAAA,IACA,UAAU,KAAK,SAAS,eAAe;AAAA,IACvC,QAAQ,KAAK,SAAS,MAAM;AAAA,IAC5B,SAAS;AAAA,MACR,SAAS;AAAA,MACT;AAAA,MACA,QAAQ;AAAA,MACR,OAAO;AAAA,QACN,mBAAmB;AAAA,QACnB,iBAAiB;AA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a,GAAG,eAAe,cAAc,CAAC,SAAS,aAAa,MAAM,MAAM,CAAC;AAEvF,UAAI,WAAW,OAAO;AACrB,cAAM,IAAI;AAAA,UACT,8BAA8B,YAAY,KAAK,GAAG,6BAA6B,WAAW,MAAM,aAAa,IAAI,CAAC;AAAA,QACnH;AAAA,MACD;AAEA,YAAM,oBAAoB,GAAG;AAAA,QAC5B,WAAW;AAAA,QACX,GAAG;AAAA,QACHA,SAAQ,OAAO,OAAO;AAAA,MACvB;AAEA,YAAM,UAAU,GAAG,cAAc;AAAA,QAChC,WAAW,kBAAkB;AAAA,QAC7B,SAAS,kBAAkB;AAAA,MAC5B,CAAC;AAED,YAAM,UAAU,QAAQ,eAAe;AAEvC,YAAM,qBAAqB,IAAI,mBAAmB;AAClD,YAAM,cAAc,IAAI,YAAY,kBAAkB;AAEtD,YAAM,aAA4B,CAAC;AAEnC,iBAAW,cAAc,QAAQ,eAAe,GAAG;AAElD,YAAI,WAAW,qBAAqB,WAAW,SAAS,SAAS,cAAc,GAAG;AACjF;AAAA,QACD;AAEA,cAAM,cAAc,uBAAuB,YAAY,SAAS,WAAW;AAC3E,mBAAW,KAAK,GAAG,WAAW;AAAA,MAC/B;AAEA,aAAO;AAAA,IACR;AAAA,EACD;AACD;","names":["Visibility","resolve","name","pos","rawComment","documentation","tags","visibility","resolve"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge-ts/core",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Shared types, interfaces, and core AST walker for forge-ts",
6
6
  "license": "MIT",
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "tsup": "^8.3.5",
32
- "@forge-ts/api": "0.3.1",
33
- "@forge-ts/gen": "0.3.1",
34
- "@forge-ts/enforcer": "0.3.1"
32
+ "@forge-ts/api": "0.5.0",
33
+ "@forge-ts/gen": "0.5.0",
34
+ "@forge-ts/enforcer": "0.5.0"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsup",