Add AST extraction tests, broader ignore patterns, build dist

- ast-extract.ts: Support tree-sitter-python and tree-sitter-go grammar
  loading (pkg.language fallback)
- discover.ts: Add cache directories to default ignore (.cache, tmp,
  temp, .turbo, .parcel-cache, .eslintcache, .prettiercache)
- tests: Add TypeScript AST extraction tests (exports + imports)
- Verified on real project: media_library_viewer (196 .pi-map.md files)
  with accurate React component extraction
- Build: npm run build produces clean dist/ output

All 16 tests pass.
This commit is contained in:
2026-06-09 19:25:56 +02:00
parent 3dbb3cb7b2
commit ab45859d65
6 changed files with 111 additions and 16 deletions
+40
View File
@@ -11,6 +11,8 @@
"dependencies": {
"ignore": "^5.3.0",
"tree-sitter": "^0.21.0",
"tree-sitter-go": "^0.25.0",
"tree-sitter-python": "^0.25.0",
"tree-sitter-typescript": "^0.21.0"
},
"bin": {
@@ -3318,6 +3320,44 @@
"node-gyp-build": "^4.8.0"
}
},
"node_modules/tree-sitter-go": {
"version": "0.25.0",
"resolved": "https://registry.npmjs.org/tree-sitter-go/-/tree-sitter-go-0.25.0.tgz",
"integrity": "sha512-APBc/Dq3xz/e35Xpkhb1blu5UgW+2E3RyGWawZSCNcbGwa7jhSQPS8KsUupuzBla8PCo8+lz9W/JDJjmfRa2tw==",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"node-addon-api": "^8.3.1",
"node-gyp-build": "^4.8.4"
},
"peerDependencies": {
"tree-sitter": "^0.25.0"
},
"peerDependenciesMeta": {
"tree-sitter": {
"optional": true
}
}
},
"node_modules/tree-sitter-python": {
"version": "0.25.0",
"resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.25.0.tgz",
"integrity": "sha512-eCmJx6zQa35GxaCtQD+wXHOhYqBxEL+bp71W/s3fcDMu06MrtzkVXR437dRrCrbrDbyLuUDJpAgycs7ncngLXw==",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"node-addon-api": "^8.5.0",
"node-gyp-build": "^4.8.4"
},
"peerDependencies": {
"tree-sitter": "^0.25.0"
},
"peerDependenciesMeta": {
"tree-sitter": {
"optional": true
}
}
},
"node_modules/tree-sitter-typescript": {
"version": "0.21.2",
"resolved": "https://registry.npmjs.org/tree-sitter-typescript/-/tree-sitter-typescript-0.21.2.tgz",