## New Features - Implemented TSDoc extraction using TypeDoc API - Added API documentation indexing with LanceDB vector search - Created search_babylon_api MCP tool for querying API docs - Added 6 indexing and testing scripts ## API Indexing System - TSDocExtractor: Parses TypeScript source files and extracts documentation - ApiIndexer: Converts API docs to embeddings and stores in LanceDB - Support for all Babylon.js packages (core, gui, materials, loaders, etc.) - Successfully indexed 44,253 API entries from core package ## Bug Fixes - Fixed TypeScript strict mode errors with exactOptionalPropertyTypes - Fixed optional property handling in tsConfigPath and returns fields - Resolved EventEmitter MaxListeners warning in test suite - Updated all failing handler tests for real implementation ## Test Coverage Improvements - Added 27 new tests (92 → 119 tests passing) - Lines: 93.88% (was 82.53%, target 80%) ✓ - Functions: 100% (was 91.17%, target 80%) ✓ - Statements: 93.3% (was 81.58%, target 80%) ✓ - Branches: 69.72% (was 51.37%, target 75%) ## New Test Files - src/search/lancedb-search.test.ts (15 tests) - Enhanced handlers.test.ts with API search tests - Enhanced document-parser.test.ts with edge case tests ## Scripts Added - scripts/index-api.ts: Index all Babylon.js API documentation - scripts/test-api-indexing.ts: Test API indexing for core package - scripts/test-api-search.ts: Test API search functionality - scripts/get-api-details.ts: Display detailed API documentation - scripts/search-handmenu-api.ts: Search for HandMenu API examples ## Technical Details - TypeDoc integration for TSDoc extraction - Vector embeddings using Xenova/all-MiniLM-L6-v2 model - Semantic search across 11 Babylon.js packages - GitHub source links with line numbers in search results 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
38 lines
1019 B
TypeScript
38 lines
1019 B
TypeScript
import { ApiIndexer } from '../src/search/api-indexer.js';
|
|
import path from 'path';
|
|
|
|
async function main() {
|
|
// Start with just core package for testing
|
|
const repositoryPath = path.resolve('./data/repositories/Babylon.js');
|
|
|
|
// Use the index.ts entry point like Babylon.js does
|
|
const entryPoints = [
|
|
`${repositoryPath}/packages/dev/core/src/index.ts`,
|
|
];
|
|
|
|
console.log('Testing API documentation indexing with a single file...');
|
|
console.log('Entry point:', entryPoints[0]);
|
|
|
|
const indexer = new ApiIndexer(
|
|
'./data/lancedb',
|
|
'babylon_api_test',
|
|
entryPoints,
|
|
`${repositoryPath}/tsconfig.json`
|
|
);
|
|
|
|
try {
|
|
await indexer.initialize();
|
|
await indexer.indexApi();
|
|
await indexer.close();
|
|
console.log('\n✓ Test indexing completed successfully!');
|
|
} catch (error) {
|
|
console.error('Error during test indexing:', error);
|
|
if (error instanceof Error) {
|
|
console.error('Stack trace:', error.stack);
|
|
}
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
main().catch(console.error);
|