MCPcopy
hub / github.com/compodoc/compodoc / parseIndexFiles

Method parseIndexFiles

src/utils/public-api-parser.util.ts:37–69  ·  view source on GitHub ↗

* Parse all index.d.ts files in the dist folder and extract exported symbols

()

Source from the content-addressed store, hash-verified

35 * Parse all index.d.ts files in the dist folder and extract exported symbols
36 */
37 public async parseIndexFiles(): Promise<PublicApiExports> {
38 logger.info(`Scanning for index.d.ts files in ${this.distPath}`);
39
40 if (!fs.existsSync(this.distPath)) {
41 logger.error(`Public API dist path does not exist: ${this.distPath}`);
42 return {
43 symbolToFiles: this.symbolToFiles,
44 indexFiles: this.indexFiles
45 };
46 }
47
48 // Find all index.d.ts files recursively
49 const pattern = path.join(this.distPath, '**/index.d.ts');
50 const indexFiles = await glob(pattern, {
51 absolute: true,
52 ignore: ['**/node_modules/**']
53 });
54
55 logger.info(`Found ${indexFiles.length} index.d.ts file(s)`);
56
57 // Process each index.d.ts file
58 for (const indexFile of indexFiles) {
59 this.indexFiles.add(indexFile);
60 await this.parseIndexFile(indexFile);
61 }
62
63 logger.info(`Extracted ${this.symbolToFiles.size} public API symbol(s)`);
64
65 return {
66 symbolToFiles: this.symbolToFiles,
67 indexFiles: this.indexFiles
68 };
69 }
70
71 /**
72 * Parse a single index.d.ts file and extract its exports

Callers 1

parsePublicApiFunction · 0.95

Calls 5

parseIndexFileMethod · 0.95
infoMethod · 0.45
existsSyncMethod · 0.45
errorMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected