@liendev/core 0.19.5
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 +336 -0
- package/dist/config/loader.d.ts +12 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +46 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/merge.d.ts +20 -0
- package/dist/config/merge.d.ts.map +1 -0
- package/dist/config/merge.js +71 -0
- package/dist/config/merge.js.map +1 -0
- package/dist/config/migration-manager.d.ts +46 -0
- package/dist/config/migration-manager.d.ts.map +1 -0
- package/dist/config/migration-manager.js +119 -0
- package/dist/config/migration-manager.js.map +1 -0
- package/dist/config/migration.d.ts +20 -0
- package/dist/config/migration.d.ts.map +1 -0
- package/dist/config/migration.js +155 -0
- package/dist/config/migration.js.map +1 -0
- package/dist/config/schema.d.ts +101 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +58 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/service.d.ts +122 -0
- package/dist/config/service.d.ts.map +1 -0
- package/dist/config/service.js +477 -0
- package/dist/config/service.js.map +1 -0
- package/dist/constants.d.ts +20 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +43 -0
- package/dist/constants.js.map +1 -0
- package/dist/embeddings/cache.d.ts +45 -0
- package/dist/embeddings/cache.d.ts.map +1 -0
- package/dist/embeddings/cache.js +109 -0
- package/dist/embeddings/cache.js.map +1 -0
- package/dist/embeddings/local.d.ts +10 -0
- package/dist/embeddings/local.d.ts.map +1 -0
- package/dist/embeddings/local.js +63 -0
- package/dist/embeddings/local.js.map +1 -0
- package/dist/embeddings/types.d.ts +9 -0
- package/dist/embeddings/types.d.ts.map +1 -0
- package/dist/embeddings/types.js +5 -0
- package/dist/embeddings/types.js.map +1 -0
- package/dist/errors/codes.d.ts +18 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/codes.js +25 -0
- package/dist/errors/codes.js.map +1 -0
- package/dist/errors/index.d.ts +85 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +134 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/frameworks/detector-service.d.ts +59 -0
- package/dist/frameworks/detector-service.d.ts.map +1 -0
- package/dist/frameworks/detector-service.js +219 -0
- package/dist/frameworks/detector-service.js.map +1 -0
- package/dist/frameworks/laravel/config.d.ts +6 -0
- package/dist/frameworks/laravel/config.d.ts.map +1 -0
- package/dist/frameworks/laravel/config.js +68 -0
- package/dist/frameworks/laravel/config.js.map +1 -0
- package/dist/frameworks/laravel/detector.d.ts +6 -0
- package/dist/frameworks/laravel/detector.d.ts.map +1 -0
- package/dist/frameworks/laravel/detector.js +96 -0
- package/dist/frameworks/laravel/detector.js.map +1 -0
- package/dist/frameworks/nodejs/config.d.ts +6 -0
- package/dist/frameworks/nodejs/config.d.ts.map +1 -0
- package/dist/frameworks/nodejs/config.js +57 -0
- package/dist/frameworks/nodejs/config.js.map +1 -0
- package/dist/frameworks/nodejs/detector.d.ts +6 -0
- package/dist/frameworks/nodejs/detector.d.ts.map +1 -0
- package/dist/frameworks/nodejs/detector.js +77 -0
- package/dist/frameworks/nodejs/detector.js.map +1 -0
- package/dist/frameworks/php/config.d.ts +6 -0
- package/dist/frameworks/php/config.d.ts.map +1 -0
- package/dist/frameworks/php/config.js +53 -0
- package/dist/frameworks/php/config.js.map +1 -0
- package/dist/frameworks/php/detector.d.ts +7 -0
- package/dist/frameworks/php/detector.d.ts.map +1 -0
- package/dist/frameworks/php/detector.js +101 -0
- package/dist/frameworks/php/detector.js.map +1 -0
- package/dist/frameworks/registry.d.ts +20 -0
- package/dist/frameworks/registry.d.ts.map +1 -0
- package/dist/frameworks/registry.js +38 -0
- package/dist/frameworks/registry.js.map +1 -0
- package/dist/frameworks/shopify/config.d.ts +6 -0
- package/dist/frameworks/shopify/config.d.ts.map +1 -0
- package/dist/frameworks/shopify/config.js +50 -0
- package/dist/frameworks/shopify/config.js.map +1 -0
- package/dist/frameworks/shopify/detector.d.ts +6 -0
- package/dist/frameworks/shopify/detector.d.ts.map +1 -0
- package/dist/frameworks/shopify/detector.js +103 -0
- package/dist/frameworks/shopify/detector.js.map +1 -0
- package/dist/frameworks/types.d.ts +51 -0
- package/dist/frameworks/types.d.ts.map +1 -0
- package/dist/frameworks/types.js +21 -0
- package/dist/frameworks/types.js.map +1 -0
- package/dist/git/tracker.d.ts +56 -0
- package/dist/git/tracker.d.ts.map +1 -0
- package/dist/git/tracker.js +189 -0
- package/dist/git/tracker.js.map +1 -0
- package/dist/git/utils.d.ts +60 -0
- package/dist/git/utils.d.ts.map +1 -0
- package/dist/git/utils.js +152 -0
- package/dist/git/utils.js.map +1 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer/ast/chunker.d.ts +28 -0
- package/dist/indexer/ast/chunker.d.ts.map +1 -0
- package/dist/indexer/ast/chunker.js +268 -0
- package/dist/indexer/ast/chunker.js.map +1 -0
- package/dist/indexer/ast/complexity/cognitive.d.ts +16 -0
- package/dist/indexer/ast/complexity/cognitive.d.ts.map +1 -0
- package/dist/indexer/ast/complexity/cognitive.js +106 -0
- package/dist/indexer/ast/complexity/cognitive.js.map +1 -0
- package/dist/indexer/ast/complexity/cyclomatic.d.ts +12 -0
- package/dist/indexer/ast/complexity/cyclomatic.d.ts.map +1 -0
- package/dist/indexer/ast/complexity/cyclomatic.js +61 -0
- package/dist/indexer/ast/complexity/cyclomatic.js.map +1 -0
- package/dist/indexer/ast/complexity/halstead.d.ts +55 -0
- package/dist/indexer/ast/complexity/halstead.d.ts.map +1 -0
- package/dist/indexer/ast/complexity/halstead.js +290 -0
- package/dist/indexer/ast/complexity/halstead.js.map +1 -0
- package/dist/indexer/ast/complexity/index.d.ts +13 -0
- package/dist/indexer/ast/complexity/index.d.ts.map +1 -0
- package/dist/indexer/ast/complexity/index.js +12 -0
- package/dist/indexer/ast/complexity/index.js.map +1 -0
- package/dist/indexer/ast/parser.d.ts +27 -0
- package/dist/indexer/ast/parser.d.ts.map +1 -0
- package/dist/indexer/ast/parser.js +103 -0
- package/dist/indexer/ast/parser.js.map +1 -0
- package/dist/indexer/ast/symbols.d.ts +17 -0
- package/dist/indexer/ast/symbols.d.ts.map +1 -0
- package/dist/indexer/ast/symbols.js +265 -0
- package/dist/indexer/ast/symbols.js.map +1 -0
- package/dist/indexer/ast/traversers/index.d.ts +19 -0
- package/dist/indexer/ast/traversers/index.d.ts.map +1 -0
- package/dist/indexer/ast/traversers/index.js +42 -0
- package/dist/indexer/ast/traversers/index.js.map +1 -0
- package/dist/indexer/ast/traversers/php.d.ts +21 -0
- package/dist/indexer/ast/traversers/php.d.ts.map +1 -0
- package/dist/indexer/ast/traversers/php.js +67 -0
- package/dist/indexer/ast/traversers/php.js.map +1 -0
- package/dist/indexer/ast/traversers/python.d.ts +28 -0
- package/dist/indexer/ast/traversers/python.d.ts.map +1 -0
- package/dist/indexer/ast/traversers/python.js +67 -0
- package/dist/indexer/ast/traversers/python.js.map +1 -0
- package/dist/indexer/ast/traversers/types.d.ts +98 -0
- package/dist/indexer/ast/traversers/types.d.ts.map +1 -0
- package/dist/indexer/ast/traversers/types.js +2 -0
- package/dist/indexer/ast/traversers/types.js.map +1 -0
- package/dist/indexer/ast/traversers/typescript.d.ts +29 -0
- package/dist/indexer/ast/traversers/typescript.d.ts.map +1 -0
- package/dist/indexer/ast/traversers/typescript.js +88 -0
- package/dist/indexer/ast/traversers/typescript.js.map +1 -0
- package/dist/indexer/ast/types.d.ts +59 -0
- package/dist/indexer/ast/types.d.ts.map +1 -0
- package/dist/indexer/ast/types.js +2 -0
- package/dist/indexer/ast/types.js.map +1 -0
- package/dist/indexer/change-detector.d.ts +17 -0
- package/dist/indexer/change-detector.d.ts.map +1 -0
- package/dist/indexer/change-detector.js +207 -0
- package/dist/indexer/change-detector.js.map +1 -0
- package/dist/indexer/chunk-batch-processor.d.ts +103 -0
- package/dist/indexer/chunk-batch-processor.d.ts.map +1 -0
- package/dist/indexer/chunk-batch-processor.js +179 -0
- package/dist/indexer/chunk-batch-processor.js.map +1 -0
- package/dist/indexer/chunker.d.ts +10 -0
- package/dist/indexer/chunker.d.ts.map +1 -0
- package/dist/indexer/chunker.js +96 -0
- package/dist/indexer/chunker.js.map +1 -0
- package/dist/indexer/dependency-analyzer.d.ts +60 -0
- package/dist/indexer/dependency-analyzer.d.ts.map +1 -0
- package/dist/indexer/dependency-analyzer.js +261 -0
- package/dist/indexer/dependency-analyzer.js.map +1 -0
- package/dist/indexer/incremental.d.ts +47 -0
- package/dist/indexer/incremental.d.ts.map +1 -0
- package/dist/indexer/incremental.js +284 -0
- package/dist/indexer/incremental.js.map +1 -0
- package/dist/indexer/index.d.ts +80 -0
- package/dist/indexer/index.d.ts.map +1 -0
- package/dist/indexer/index.js +364 -0
- package/dist/indexer/index.js.map +1 -0
- package/dist/indexer/json-template-chunker.d.ts +9 -0
- package/dist/indexer/json-template-chunker.d.ts.map +1 -0
- package/dist/indexer/json-template-chunker.js +83 -0
- package/dist/indexer/json-template-chunker.js.map +1 -0
- package/dist/indexer/liquid-chunker.d.ts +13 -0
- package/dist/indexer/liquid-chunker.d.ts.map +1 -0
- package/dist/indexer/liquid-chunker.js +272 -0
- package/dist/indexer/liquid-chunker.js.map +1 -0
- package/dist/indexer/manifest.d.ts +122 -0
- package/dist/indexer/manifest.d.ts.map +1 -0
- package/dist/indexer/manifest.js +262 -0
- package/dist/indexer/manifest.js.map +1 -0
- package/dist/indexer/progress-tracker.d.ts +35 -0
- package/dist/indexer/progress-tracker.d.ts.map +1 -0
- package/dist/indexer/progress-tracker.js +33 -0
- package/dist/indexer/progress-tracker.js.map +1 -0
- package/dist/indexer/scanner.d.ts +16 -0
- package/dist/indexer/scanner.d.ts.map +1 -0
- package/dist/indexer/scanner.js +159 -0
- package/dist/indexer/scanner.js.map +1 -0
- package/dist/indexer/symbol-extractor.d.ts +18 -0
- package/dist/indexer/symbol-extractor.d.ts.map +1 -0
- package/dist/indexer/symbol-extractor.js +351 -0
- package/dist/indexer/symbol-extractor.js.map +1 -0
- package/dist/indexer/types.d.ts +34 -0
- package/dist/indexer/types.d.ts.map +1 -0
- package/dist/indexer/types.js +2 -0
- package/dist/indexer/types.js.map +1 -0
- package/dist/insights/complexity-analyzer.d.ts +82 -0
- package/dist/insights/complexity-analyzer.d.ts.map +1 -0
- package/dist/insights/complexity-analyzer.js +356 -0
- package/dist/insights/complexity-analyzer.js.map +1 -0
- package/dist/insights/formatters/index.d.ts +11 -0
- package/dist/insights/formatters/index.d.ts.map +1 -0
- package/dist/insights/formatters/index.js +20 -0
- package/dist/insights/formatters/index.js.map +1 -0
- package/dist/insights/formatters/json.d.ts +7 -0
- package/dist/insights/formatters/json.d.ts.map +1 -0
- package/dist/insights/formatters/json.js +14 -0
- package/dist/insights/formatters/json.js.map +1 -0
- package/dist/insights/formatters/sarif.d.ts +6 -0
- package/dist/insights/formatters/sarif.d.ts.map +1 -0
- package/dist/insights/formatters/sarif.js +113 -0
- package/dist/insights/formatters/sarif.js.map +1 -0
- package/dist/insights/formatters/text.d.ts +6 -0
- package/dist/insights/formatters/text.d.ts.map +1 -0
- package/dist/insights/formatters/text.js +154 -0
- package/dist/insights/formatters/text.js.map +1 -0
- package/dist/insights/types.d.ts +73 -0
- package/dist/insights/types.d.ts.map +1 -0
- package/dist/insights/types.js +9 -0
- package/dist/insights/types.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/path-matching.d.ts +69 -0
- package/dist/utils/path-matching.d.ts.map +1 -0
- package/dist/utils/path-matching.js +123 -0
- package/dist/utils/path-matching.js.map +1 -0
- package/dist/utils/result.d.ts +65 -0
- package/dist/utils/result.d.ts.map +1 -0
- package/dist/utils/result.js +67 -0
- package/dist/utils/result.js.map +1 -0
- package/dist/utils/version.d.ts +22 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +28 -0
- package/dist/utils/version.js.map +1 -0
- package/dist/vectordb/batch-insert.d.ts +14 -0
- package/dist/vectordb/batch-insert.d.ts.map +1 -0
- package/dist/vectordb/batch-insert.js +185 -0
- package/dist/vectordb/batch-insert.js.map +1 -0
- package/dist/vectordb/boosting/composer.d.ts +51 -0
- package/dist/vectordb/boosting/composer.d.ts.map +1 -0
- package/dist/vectordb/boosting/composer.js +65 -0
- package/dist/vectordb/boosting/composer.js.map +1 -0
- package/dist/vectordb/boosting/index.d.ts +22 -0
- package/dist/vectordb/boosting/index.d.ts.map +1 -0
- package/dist/vectordb/boosting/index.js +22 -0
- package/dist/vectordb/boosting/index.js.map +1 -0
- package/dist/vectordb/boosting/strategies.d.ts +40 -0
- package/dist/vectordb/boosting/strategies.d.ts.map +1 -0
- package/dist/vectordb/boosting/strategies.js +174 -0
- package/dist/vectordb/boosting/strategies.js.map +1 -0
- package/dist/vectordb/boosting/types.d.ts +20 -0
- package/dist/vectordb/boosting/types.d.ts.map +1 -0
- package/dist/vectordb/boosting/types.js +2 -0
- package/dist/vectordb/boosting/types.js.map +1 -0
- package/dist/vectordb/intent-classifier.d.ts +99 -0
- package/dist/vectordb/intent-classifier.d.ts.map +1 -0
- package/dist/vectordb/intent-classifier.js +193 -0
- package/dist/vectordb/intent-classifier.js.map +1 -0
- package/dist/vectordb/lancedb.d.ts +45 -0
- package/dist/vectordb/lancedb.d.ts.map +1 -0
- package/dist/vectordb/lancedb.js +203 -0
- package/dist/vectordb/lancedb.js.map +1 -0
- package/dist/vectordb/maintenance.d.ts +18 -0
- package/dist/vectordb/maintenance.d.ts.map +1 -0
- package/dist/vectordb/maintenance.js +87 -0
- package/dist/vectordb/maintenance.js.map +1 -0
- package/dist/vectordb/query.d.ts +34 -0
- package/dist/vectordb/query.d.ts.map +1 -0
- package/dist/vectordb/query.js +303 -0
- package/dist/vectordb/query.js.map +1 -0
- package/dist/vectordb/relevance.d.ts +15 -0
- package/dist/vectordb/relevance.d.ts.map +1 -0
- package/dist/vectordb/relevance.js +19 -0
- package/dist/vectordb/relevance.js.map +1 -0
- package/dist/vectordb/types.d.ts +29 -0
- package/dist/vectordb/types.d.ts.map +1 -0
- package/dist/vectordb/types.js +2 -0
- package/dist/vectordb/types.js.map +1 -0
- package/dist/vectordb/version.d.ts +16 -0
- package/dist/vectordb/version.d.ts.map +1 -0
- package/dist/vectordb/version.js +40 -0
- package/dist/vectordb/version.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/indexer/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,aAAa,GAAG,eAAe,CAAC;AAsBtC;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IAClB,YAAY,CAAS;IACrB,SAAS,CAAS;IAE1B;;;OAGG;IACK,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAEvC;;;OAGG;IACH,YAAY,SAAiB;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI;QACR,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YAC9D,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAkB,CAAC;YAEtD,4DAA4D;YAC5D,IAA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AAQ;YAAE,OAAO,EAAE,CAAC;QAEzB,MAAM,YAAY,GAAa,EAAE,CAAC;QAElC,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACnD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAChC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qCAAqC;YACrC,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACvD,OAAO,CAAC,KAAK,CAAC,6CAA6C,KAAK,EAAE,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACK,WAAW;QACjB,OAAO;YACL,aAAa,EAAE,oBAAoB;YACnC,WAAW,EAAE,iBAAiB,EAAE;YAChC,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE;YACvB,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress tracker interface for indexing operations.
|
|
3
|
+
*
|
|
4
|
+
* This is a minimal interface that can be implemented by:
|
|
5
|
+
* - CLI (with ora spinner and witty messages)
|
|
6
|
+
* - Action (with GitHub Actions logging)
|
|
7
|
+
* - Custom integrations (with callbacks)
|
|
8
|
+
*
|
|
9
|
+
* The core package provides a simple no-op implementation.
|
|
10
|
+
*/
|
|
11
|
+
export interface ProgressTracker {
|
|
12
|
+
start(): void;
|
|
13
|
+
stop(): void;
|
|
14
|
+
incrementFiles(): void;
|
|
15
|
+
incrementChunks?(count: number): void;
|
|
16
|
+
setMessage?(message: string): void;
|
|
17
|
+
getProcessedCount(): number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Simple progress tracker that just counts.
|
|
21
|
+
* Used internally by core when no UI is needed.
|
|
22
|
+
*/
|
|
23
|
+
export declare class IndexingProgressTracker implements ProgressTracker {
|
|
24
|
+
private processedFiles;
|
|
25
|
+
private totalFiles;
|
|
26
|
+
constructor(totalFiles: number, _spinner?: unknown);
|
|
27
|
+
start(): void;
|
|
28
|
+
stop(): void;
|
|
29
|
+
incrementFiles(): void;
|
|
30
|
+
incrementChunks(_count: number): void;
|
|
31
|
+
setMessage(_message: string): void;
|
|
32
|
+
getProcessedCount(): number;
|
|
33
|
+
getTotalFiles(): number;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=progress-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-tracker.d.ts","sourceRoot":"","sources":["../../src/indexer/progress-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;IACb,cAAc,IAAI,IAAI,CAAC;IACvB,eAAe,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,UAAU,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,iBAAiB,IAAI,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,eAAe;IAC7D,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,UAAU,CAAS;gBAEf,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO;IAIlD,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,cAAc,IAAI,IAAI;IAItB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIrC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIlC,iBAAiB,IAAI,MAAM;IAI3B,aAAa,IAAI,MAAM;CAGxB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple progress tracker that just counts.
|
|
3
|
+
* Used internally by core when no UI is needed.
|
|
4
|
+
*/
|
|
5
|
+
export class IndexingProgressTracker {
|
|
6
|
+
processedFiles = 0;
|
|
7
|
+
totalFiles;
|
|
8
|
+
constructor(totalFiles, _spinner) {
|
|
9
|
+
this.totalFiles = totalFiles;
|
|
10
|
+
}
|
|
11
|
+
start() {
|
|
12
|
+
// No-op in core
|
|
13
|
+
}
|
|
14
|
+
stop() {
|
|
15
|
+
// No-op in core
|
|
16
|
+
}
|
|
17
|
+
incrementFiles() {
|
|
18
|
+
this.processedFiles++;
|
|
19
|
+
}
|
|
20
|
+
incrementChunks(_count) {
|
|
21
|
+
// No-op in core - chunks tracked separately
|
|
22
|
+
}
|
|
23
|
+
setMessage(_message) {
|
|
24
|
+
// No-op in core
|
|
25
|
+
}
|
|
26
|
+
getProcessedCount() {
|
|
27
|
+
return this.processedFiles;
|
|
28
|
+
}
|
|
29
|
+
getTotalFiles() {
|
|
30
|
+
return this.totalFiles;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=progress-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-tracker.js","sourceRoot":"","sources":["../../src/indexer/progress-tracker.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IAC1B,cAAc,GAAG,CAAC,CAAC;IACnB,UAAU,CAAS;IAE3B,YAAY,UAAkB,EAAE,QAAkB;QAChD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,KAAK;QACH,gBAAgB;IAClB,CAAC;IAED,IAAI;QACF,gBAAgB;IAClB,CAAC;IAED,cAAc;QACZ,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,eAAe,CAAC,MAAc;QAC5B,4CAA4C;IAC9C,CAAC;IAED,UAAU,CAAC,QAAgB;QACzB,gBAAgB;IAClB,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ScanOptions } from './types.js';
|
|
2
|
+
import { LienConfig } from '../config/schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* Scan codebase using framework-aware configuration
|
|
5
|
+
* @param rootDir - Project root directory
|
|
6
|
+
* @param config - Lien configuration with frameworks
|
|
7
|
+
* @returns Array of file paths relative to rootDir
|
|
8
|
+
*/
|
|
9
|
+
export declare function scanCodebaseWithFrameworks(rootDir: string, config: LienConfig): Promise<string[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Legacy scan function for backwards compatibility
|
|
12
|
+
* @deprecated Use scanCodebaseWithFrameworks instead
|
|
13
|
+
*/
|
|
14
|
+
export declare function scanCodebase(options: ScanOptions): Promise<string[]>;
|
|
15
|
+
export declare function detectLanguage(filepath: string): string;
|
|
16
|
+
//# sourceMappingURL=scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/indexer/scanner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,UAAU,EAAqB,MAAM,qBAAqB,CAAC;AAEpE;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB;AA8DD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoD1E;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAkCvD"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { glob } from 'glob';
|
|
2
|
+
import ignore from 'ignore';
|
|
3
|
+
import fs from 'fs/promises';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
/**
|
|
6
|
+
* Scan codebase using framework-aware configuration
|
|
7
|
+
* @param rootDir - Project root directory
|
|
8
|
+
* @param config - Lien configuration with frameworks
|
|
9
|
+
* @returns Array of file paths relative to rootDir
|
|
10
|
+
*/
|
|
11
|
+
export async function scanCodebaseWithFrameworks(rootDir, config) {
|
|
12
|
+
const allFiles = [];
|
|
13
|
+
// Scan each framework
|
|
14
|
+
for (const framework of config.frameworks) {
|
|
15
|
+
if (!framework.enabled) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const frameworkFiles = await scanFramework(rootDir, framework);
|
|
19
|
+
allFiles.push(...frameworkFiles);
|
|
20
|
+
}
|
|
21
|
+
// Deduplicate files across frameworks to prevent double-indexing
|
|
22
|
+
// This handles overlapping framework paths (e.g., root "." and "packages/cli")
|
|
23
|
+
return Array.from(new Set(allFiles));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Scan files for a specific framework instance
|
|
27
|
+
*/
|
|
28
|
+
async function scanFramework(rootDir, framework) {
|
|
29
|
+
const frameworkPath = path.join(rootDir, framework.path);
|
|
30
|
+
// Load .gitignore from framework path
|
|
31
|
+
const gitignorePath = path.join(frameworkPath, '.gitignore');
|
|
32
|
+
let ig = ignore();
|
|
33
|
+
try {
|
|
34
|
+
const gitignoreContent = await fs.readFile(gitignorePath, 'utf-8');
|
|
35
|
+
ig = ignore().add(gitignoreContent);
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
// No .gitignore in framework path, try root
|
|
39
|
+
const rootGitignorePath = path.join(rootDir, '.gitignore');
|
|
40
|
+
try {
|
|
41
|
+
const gitignoreContent = await fs.readFile(rootGitignorePath, 'utf-8');
|
|
42
|
+
ig = ignore().add(gitignoreContent);
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
// No .gitignore at all, that's fine
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Add framework-specific exclusions
|
|
49
|
+
ig.add([
|
|
50
|
+
...framework.config.exclude,
|
|
51
|
+
'.lien/**',
|
|
52
|
+
]);
|
|
53
|
+
// Find all files matching framework patterns
|
|
54
|
+
const allFiles = [];
|
|
55
|
+
for (const pattern of framework.config.include) {
|
|
56
|
+
const files = await glob(pattern, {
|
|
57
|
+
cwd: frameworkPath,
|
|
58
|
+
absolute: false, // Get paths relative to framework path
|
|
59
|
+
nodir: true,
|
|
60
|
+
ignore: framework.config.exclude,
|
|
61
|
+
});
|
|
62
|
+
allFiles.push(...files);
|
|
63
|
+
}
|
|
64
|
+
// Remove duplicates
|
|
65
|
+
const uniqueFiles = Array.from(new Set(allFiles));
|
|
66
|
+
// Filter using ignore patterns and prefix with framework path
|
|
67
|
+
return uniqueFiles
|
|
68
|
+
.filter(file => !ig.ignores(file))
|
|
69
|
+
.map(file => {
|
|
70
|
+
// Return path relative to root: framework.path/file
|
|
71
|
+
return framework.path === '.'
|
|
72
|
+
? file
|
|
73
|
+
: path.join(framework.path, file);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Legacy scan function for backwards compatibility
|
|
78
|
+
* @deprecated Use scanCodebaseWithFrameworks instead
|
|
79
|
+
*/
|
|
80
|
+
export async function scanCodebase(options) {
|
|
81
|
+
const { rootDir, includePatterns = [], excludePatterns = [] } = options;
|
|
82
|
+
// Load .gitignore
|
|
83
|
+
const gitignorePath = path.join(rootDir, '.gitignore');
|
|
84
|
+
let ig = ignore();
|
|
85
|
+
try {
|
|
86
|
+
const gitignoreContent = await fs.readFile(gitignorePath, 'utf-8');
|
|
87
|
+
ig = ignore().add(gitignoreContent);
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
// No .gitignore, that's fine
|
|
91
|
+
}
|
|
92
|
+
// Add default exclusions
|
|
93
|
+
ig.add([
|
|
94
|
+
'node_modules/**',
|
|
95
|
+
'.git/**',
|
|
96
|
+
'dist/**',
|
|
97
|
+
'build/**',
|
|
98
|
+
'*.min.js',
|
|
99
|
+
'*.min.css',
|
|
100
|
+
'.lien/**',
|
|
101
|
+
...excludePatterns,
|
|
102
|
+
]);
|
|
103
|
+
// Determine patterns to search for
|
|
104
|
+
const patterns = includePatterns.length > 0
|
|
105
|
+
? includePatterns
|
|
106
|
+
: ['**/*.{ts,tsx,js,jsx,py,php,go,rs,java,cpp,c,cs,h,md,mdx}'];
|
|
107
|
+
// Find all code files
|
|
108
|
+
const allFiles = [];
|
|
109
|
+
for (const pattern of patterns) {
|
|
110
|
+
const files = await glob(pattern, {
|
|
111
|
+
cwd: rootDir,
|
|
112
|
+
absolute: true,
|
|
113
|
+
nodir: true,
|
|
114
|
+
ignore: ['node_modules/**', '.git/**'],
|
|
115
|
+
});
|
|
116
|
+
allFiles.push(...files);
|
|
117
|
+
}
|
|
118
|
+
// Remove duplicates
|
|
119
|
+
const uniqueFiles = Array.from(new Set(allFiles));
|
|
120
|
+
// Filter using ignore patterns
|
|
121
|
+
return uniqueFiles.filter(file => {
|
|
122
|
+
const relativePath = path.relative(rootDir, file);
|
|
123
|
+
return !ig.ignores(relativePath);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
export function detectLanguage(filepath) {
|
|
127
|
+
const ext = path.extname(filepath).toLowerCase();
|
|
128
|
+
const languageMap = {
|
|
129
|
+
'.ts': 'typescript',
|
|
130
|
+
'.tsx': 'typescript',
|
|
131
|
+
'.js': 'javascript',
|
|
132
|
+
'.jsx': 'javascript',
|
|
133
|
+
'.mjs': 'javascript',
|
|
134
|
+
'.cjs': 'javascript',
|
|
135
|
+
'.vue': 'vue',
|
|
136
|
+
'.py': 'python',
|
|
137
|
+
'.go': 'go',
|
|
138
|
+
'.rs': 'rust',
|
|
139
|
+
'.java': 'java',
|
|
140
|
+
'.cpp': 'cpp',
|
|
141
|
+
'.cc': 'cpp',
|
|
142
|
+
'.cxx': 'cpp',
|
|
143
|
+
'.c': 'c',
|
|
144
|
+
'.h': 'c',
|
|
145
|
+
'.hpp': 'cpp',
|
|
146
|
+
'.php': 'php',
|
|
147
|
+
'.rb': 'ruby',
|
|
148
|
+
'.swift': 'swift',
|
|
149
|
+
'.kt': 'kotlin',
|
|
150
|
+
'.cs': 'csharp',
|
|
151
|
+
'.scala': 'scala',
|
|
152
|
+
'.liquid': 'liquid',
|
|
153
|
+
'.md': 'markdown',
|
|
154
|
+
'.mdx': 'markdown',
|
|
155
|
+
'.markdown': 'markdown',
|
|
156
|
+
};
|
|
157
|
+
return languageMap[ext] || 'unknown';
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=scanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../../src/indexer/scanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAAe,EACf,MAAkB;IAElB,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,sBAAsB;IACtB,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YACvB,SAAS;QACX,CAAC;QAED,MAAM,cAAc,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC/D,QAAQ,CAAC,IAAI,CAAC,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,EAAE,YAAY;QACnB,MAAM,EAAE,YAAY;QACpB,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,GAAG;QACT,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,OAAO;QACjB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,UAAU;KACxB,CAAC;IAEF,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol extraction utilities for different programming languages.
|
|
3
|
+
* Extracts function, class, and interface names from code chunks for better indexing.
|
|
4
|
+
*/
|
|
5
|
+
export interface ExtractedSymbols {
|
|
6
|
+
functions: string[];
|
|
7
|
+
classes: string[];
|
|
8
|
+
interfaces: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Extract symbols (functions, classes, interfaces) from code content.
|
|
12
|
+
*
|
|
13
|
+
* @param content - The code content to extract symbols from
|
|
14
|
+
* @param language - The programming language of the content
|
|
15
|
+
* @returns Extracted symbols organized by type
|
|
16
|
+
*/
|
|
17
|
+
export declare function extractSymbols(content: string, language: string): ExtractedSymbols;
|
|
18
|
+
//# sourceMappingURL=symbol-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-extractor.d.ts","sourceRoot":"","sources":["../../src/indexer/symbol-extractor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,gBAAgB,CAwElB"}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol extraction utilities for different programming languages.
|
|
3
|
+
* Extracts function, class, and interface names from code chunks for better indexing.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Extract symbols (functions, classes, interfaces) from code content.
|
|
7
|
+
*
|
|
8
|
+
* @param content - The code content to extract symbols from
|
|
9
|
+
* @param language - The programming language of the content
|
|
10
|
+
* @returns Extracted symbols organized by type
|
|
11
|
+
*/
|
|
12
|
+
export function extractSymbols(content, language) {
|
|
13
|
+
const symbols = {
|
|
14
|
+
functions: [],
|
|
15
|
+
classes: [],
|
|
16
|
+
interfaces: [],
|
|
17
|
+
};
|
|
18
|
+
const normalizedLang = language.toLowerCase();
|
|
19
|
+
switch (normalizedLang) {
|
|
20
|
+
case 'typescript':
|
|
21
|
+
case 'tsx':
|
|
22
|
+
symbols.functions = extractTSFunctions(content);
|
|
23
|
+
symbols.classes = extractTSClasses(content);
|
|
24
|
+
symbols.interfaces = extractTSInterfaces(content);
|
|
25
|
+
break;
|
|
26
|
+
case 'javascript':
|
|
27
|
+
case 'jsx':
|
|
28
|
+
symbols.functions = extractJSFunctions(content);
|
|
29
|
+
symbols.classes = extractJSClasses(content);
|
|
30
|
+
break;
|
|
31
|
+
case 'python':
|
|
32
|
+
case 'py':
|
|
33
|
+
symbols.functions = extractPythonFunctions(content);
|
|
34
|
+
symbols.classes = extractPythonClasses(content);
|
|
35
|
+
break;
|
|
36
|
+
case 'php':
|
|
37
|
+
symbols.functions = extractPHPFunctions(content);
|
|
38
|
+
symbols.classes = extractPHPClasses(content);
|
|
39
|
+
symbols.interfaces = extractPHPInterfaces(content);
|
|
40
|
+
break;
|
|
41
|
+
case 'vue':
|
|
42
|
+
// Extract from <script> blocks (handles both Options API and Composition API)
|
|
43
|
+
symbols.functions = extractVueFunctions(content);
|
|
44
|
+
symbols.classes = extractVueComponents(content);
|
|
45
|
+
break;
|
|
46
|
+
case 'go':
|
|
47
|
+
symbols.functions = extractGoFunctions(content);
|
|
48
|
+
symbols.interfaces = extractGoInterfaces(content);
|
|
49
|
+
break;
|
|
50
|
+
case 'java':
|
|
51
|
+
symbols.functions = extractJavaFunctions(content);
|
|
52
|
+
symbols.classes = extractJavaClasses(content);
|
|
53
|
+
symbols.interfaces = extractJavaInterfaces(content);
|
|
54
|
+
break;
|
|
55
|
+
case 'csharp':
|
|
56
|
+
case 'cs':
|
|
57
|
+
symbols.functions = extractCSharpFunctions(content);
|
|
58
|
+
symbols.classes = extractCSharpClasses(content);
|
|
59
|
+
symbols.interfaces = extractCSharpInterfaces(content);
|
|
60
|
+
break;
|
|
61
|
+
case 'ruby':
|
|
62
|
+
case 'rb':
|
|
63
|
+
symbols.functions = extractRubyFunctions(content);
|
|
64
|
+
symbols.classes = extractRubyClasses(content);
|
|
65
|
+
break;
|
|
66
|
+
case 'rust':
|
|
67
|
+
case 'rs':
|
|
68
|
+
symbols.functions = extractRustFunctions(content);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
return symbols;
|
|
72
|
+
}
|
|
73
|
+
// TypeScript / JavaScript Functions
|
|
74
|
+
function extractTSFunctions(content) {
|
|
75
|
+
const names = new Set();
|
|
76
|
+
// Regular functions: function name(...) or async function name(...)
|
|
77
|
+
const functionMatches = content.matchAll(/(?:async\s+)?function\s+(\w+)\s*\(/g);
|
|
78
|
+
for (const match of functionMatches) {
|
|
79
|
+
names.add(match[1]);
|
|
80
|
+
}
|
|
81
|
+
// Arrow functions: const/let/var name = (...) =>
|
|
82
|
+
const arrowMatches = content.matchAll(/(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s*)?\([^)]*\)\s*=>/g);
|
|
83
|
+
for (const match of arrowMatches) {
|
|
84
|
+
names.add(match[1]);
|
|
85
|
+
}
|
|
86
|
+
// Method definitions: name(...) { or async name(...) {
|
|
87
|
+
const methodMatches = content.matchAll(/(?:async\s+)?(\w+)\s*\([^)]*\)\s*[:{]/g);
|
|
88
|
+
for (const match of methodMatches) {
|
|
89
|
+
// Exclude common keywords
|
|
90
|
+
if (!['if', 'for', 'while', 'switch', 'catch'].includes(match[1])) {
|
|
91
|
+
names.add(match[1]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Export function
|
|
95
|
+
const exportMatches = content.matchAll(/export\s+(?:async\s+)?function\s+(\w+)\s*\(/g);
|
|
96
|
+
for (const match of exportMatches) {
|
|
97
|
+
names.add(match[1]);
|
|
98
|
+
}
|
|
99
|
+
return Array.from(names);
|
|
100
|
+
}
|
|
101
|
+
function extractJSFunctions(content) {
|
|
102
|
+
return extractTSFunctions(content); // Same patterns
|
|
103
|
+
}
|
|
104
|
+
function extractTSClasses(content) {
|
|
105
|
+
const names = new Set();
|
|
106
|
+
// Class declarations: class Name or export class Name
|
|
107
|
+
const classMatches = content.matchAll(/(?:export\s+)?(?:abstract\s+)?class\s+(\w+)/g);
|
|
108
|
+
for (const match of classMatches) {
|
|
109
|
+
names.add(match[1]);
|
|
110
|
+
}
|
|
111
|
+
return Array.from(names);
|
|
112
|
+
}
|
|
113
|
+
function extractJSClasses(content) {
|
|
114
|
+
return extractTSClasses(content); // Same patterns
|
|
115
|
+
}
|
|
116
|
+
function extractTSInterfaces(content) {
|
|
117
|
+
const names = new Set();
|
|
118
|
+
// Interface declarations: interface Name or export interface Name
|
|
119
|
+
const interfaceMatches = content.matchAll(/(?:export\s+)?interface\s+(\w+)/g);
|
|
120
|
+
for (const match of interfaceMatches) {
|
|
121
|
+
names.add(match[1]);
|
|
122
|
+
}
|
|
123
|
+
// Type aliases: type Name = or export type Name =
|
|
124
|
+
const typeMatches = content.matchAll(/(?:export\s+)?type\s+(\w+)\s*=/g);
|
|
125
|
+
for (const match of typeMatches) {
|
|
126
|
+
names.add(match[1]);
|
|
127
|
+
}
|
|
128
|
+
return Array.from(names);
|
|
129
|
+
}
|
|
130
|
+
// Python Functions
|
|
131
|
+
function extractPythonFunctions(content) {
|
|
132
|
+
const names = new Set();
|
|
133
|
+
// Function definitions: def name(...):
|
|
134
|
+
const functionMatches = content.matchAll(/def\s+(\w+)\s*\(/g);
|
|
135
|
+
for (const match of functionMatches) {
|
|
136
|
+
names.add(match[1]);
|
|
137
|
+
}
|
|
138
|
+
// Async functions: async def name(...):
|
|
139
|
+
const asyncMatches = content.matchAll(/async\s+def\s+(\w+)\s*\(/g);
|
|
140
|
+
for (const match of asyncMatches) {
|
|
141
|
+
names.add(match[1]);
|
|
142
|
+
}
|
|
143
|
+
return Array.from(names);
|
|
144
|
+
}
|
|
145
|
+
function extractPythonClasses(content) {
|
|
146
|
+
const names = new Set();
|
|
147
|
+
// Class definitions: class Name or class Name(Base):
|
|
148
|
+
const classMatches = content.matchAll(/class\s+(\w+)(?:\s*\(|:)/g);
|
|
149
|
+
for (const match of classMatches) {
|
|
150
|
+
names.add(match[1]);
|
|
151
|
+
}
|
|
152
|
+
return Array.from(names);
|
|
153
|
+
}
|
|
154
|
+
// PHP Functions
|
|
155
|
+
function extractPHPFunctions(content) {
|
|
156
|
+
const names = new Set();
|
|
157
|
+
// Function definitions: function name(...) or public function name(...)
|
|
158
|
+
const functionMatches = content.matchAll(/(?:public|private|protected)?\s*function\s+(\w+)\s*\(/g);
|
|
159
|
+
for (const match of functionMatches) {
|
|
160
|
+
names.add(match[1]);
|
|
161
|
+
}
|
|
162
|
+
return Array.from(names);
|
|
163
|
+
}
|
|
164
|
+
function extractPHPClasses(content) {
|
|
165
|
+
const names = new Set();
|
|
166
|
+
// Class definitions: class Name or abstract class Name
|
|
167
|
+
const classMatches = content.matchAll(/(?:abstract\s+)?class\s+(\w+)/g);
|
|
168
|
+
for (const match of classMatches) {
|
|
169
|
+
names.add(match[1]);
|
|
170
|
+
}
|
|
171
|
+
return Array.from(names);
|
|
172
|
+
}
|
|
173
|
+
function extractPHPInterfaces(content) {
|
|
174
|
+
const names = new Set();
|
|
175
|
+
// Interface definitions: interface Name
|
|
176
|
+
const interfaceMatches = content.matchAll(/interface\s+(\w+)/g);
|
|
177
|
+
for (const match of interfaceMatches) {
|
|
178
|
+
names.add(match[1]);
|
|
179
|
+
}
|
|
180
|
+
// Trait definitions: trait Name
|
|
181
|
+
const traitMatches = content.matchAll(/trait\s+(\w+)/g);
|
|
182
|
+
for (const match of traitMatches) {
|
|
183
|
+
names.add(match[1]);
|
|
184
|
+
}
|
|
185
|
+
return Array.from(names);
|
|
186
|
+
}
|
|
187
|
+
// Go Functions
|
|
188
|
+
function extractGoFunctions(content) {
|
|
189
|
+
const names = new Set();
|
|
190
|
+
// Function definitions: func Name(...) or func (r *Receiver) Name(...)
|
|
191
|
+
const functionMatches = content.matchAll(/func\s+(?:\(\w+\s+\*?\w+\)\s+)?(\w+)\s*\(/g);
|
|
192
|
+
for (const match of functionMatches) {
|
|
193
|
+
names.add(match[1]);
|
|
194
|
+
}
|
|
195
|
+
return Array.from(names);
|
|
196
|
+
}
|
|
197
|
+
function extractGoInterfaces(content) {
|
|
198
|
+
const names = new Set();
|
|
199
|
+
// Interface definitions: type Name interface {
|
|
200
|
+
const interfaceMatches = content.matchAll(/type\s+(\w+)\s+interface\s*\{/g);
|
|
201
|
+
for (const match of interfaceMatches) {
|
|
202
|
+
names.add(match[1]);
|
|
203
|
+
}
|
|
204
|
+
// Struct definitions: type Name struct {
|
|
205
|
+
const structMatches = content.matchAll(/type\s+(\w+)\s+struct\s*\{/g);
|
|
206
|
+
for (const match of structMatches) {
|
|
207
|
+
names.add(match[1]);
|
|
208
|
+
}
|
|
209
|
+
return Array.from(names);
|
|
210
|
+
}
|
|
211
|
+
// Java Functions
|
|
212
|
+
function extractJavaFunctions(content) {
|
|
213
|
+
const names = new Set();
|
|
214
|
+
// Method definitions: public/private/protected return_type name(...)
|
|
215
|
+
const methodMatches = content.matchAll(/(?:public|private|protected)\s+(?:static\s+)?(?:\w+(?:<[^>]+>)?)\s+(\w+)\s*\(/g);
|
|
216
|
+
for (const match of methodMatches) {
|
|
217
|
+
names.add(match[1]);
|
|
218
|
+
}
|
|
219
|
+
return Array.from(names);
|
|
220
|
+
}
|
|
221
|
+
function extractJavaClasses(content) {
|
|
222
|
+
const names = new Set();
|
|
223
|
+
// Class definitions: public class Name or abstract class Name
|
|
224
|
+
const classMatches = content.matchAll(/(?:public\s+)?(?:abstract\s+)?class\s+(\w+)/g);
|
|
225
|
+
for (const match of classMatches) {
|
|
226
|
+
names.add(match[1]);
|
|
227
|
+
}
|
|
228
|
+
return Array.from(names);
|
|
229
|
+
}
|
|
230
|
+
function extractJavaInterfaces(content) {
|
|
231
|
+
const names = new Set();
|
|
232
|
+
// Interface definitions: public interface Name
|
|
233
|
+
const interfaceMatches = content.matchAll(/(?:public\s+)?interface\s+(\w+)/g);
|
|
234
|
+
for (const match of interfaceMatches) {
|
|
235
|
+
names.add(match[1]);
|
|
236
|
+
}
|
|
237
|
+
return Array.from(names);
|
|
238
|
+
}
|
|
239
|
+
// C# Functions
|
|
240
|
+
function extractCSharpFunctions(content) {
|
|
241
|
+
const names = new Set();
|
|
242
|
+
// Method definitions: public/private/protected return_type Name(...)
|
|
243
|
+
const methodMatches = content.matchAll(/(?:public|private|protected|internal)\s+(?:static\s+)?(?:async\s+)?(?:\w+(?:<[^>]+>)?)\s+(\w+)\s*\(/g);
|
|
244
|
+
for (const match of methodMatches) {
|
|
245
|
+
names.add(match[1]);
|
|
246
|
+
}
|
|
247
|
+
return Array.from(names);
|
|
248
|
+
}
|
|
249
|
+
function extractCSharpClasses(content) {
|
|
250
|
+
const names = new Set();
|
|
251
|
+
// Class definitions: public class Name or abstract class Name
|
|
252
|
+
const classMatches = content.matchAll(/(?:public|internal)?\s*(?:abstract\s+)?class\s+(\w+)/g);
|
|
253
|
+
for (const match of classMatches) {
|
|
254
|
+
names.add(match[1]);
|
|
255
|
+
}
|
|
256
|
+
return Array.from(names);
|
|
257
|
+
}
|
|
258
|
+
function extractCSharpInterfaces(content) {
|
|
259
|
+
const names = new Set();
|
|
260
|
+
// Interface definitions: public interface Name
|
|
261
|
+
const interfaceMatches = content.matchAll(/(?:public|internal)?\s*interface\s+(\w+)/g);
|
|
262
|
+
for (const match of interfaceMatches) {
|
|
263
|
+
names.add(match[1]);
|
|
264
|
+
}
|
|
265
|
+
return Array.from(names);
|
|
266
|
+
}
|
|
267
|
+
// Ruby Functions
|
|
268
|
+
function extractRubyFunctions(content) {
|
|
269
|
+
const names = new Set();
|
|
270
|
+
// Method definitions: def name or def self.name
|
|
271
|
+
const methodMatches = content.matchAll(/def\s+(?:self\.)?(\w+)/g);
|
|
272
|
+
for (const match of methodMatches) {
|
|
273
|
+
names.add(match[1]);
|
|
274
|
+
}
|
|
275
|
+
return Array.from(names);
|
|
276
|
+
}
|
|
277
|
+
function extractRubyClasses(content) {
|
|
278
|
+
const names = new Set();
|
|
279
|
+
// Class definitions: class Name or class Name < Base
|
|
280
|
+
const classMatches = content.matchAll(/class\s+(\w+)/g);
|
|
281
|
+
for (const match of classMatches) {
|
|
282
|
+
names.add(match[1]);
|
|
283
|
+
}
|
|
284
|
+
// Module definitions: module Name
|
|
285
|
+
const moduleMatches = content.matchAll(/module\s+(\w+)/g);
|
|
286
|
+
for (const match of moduleMatches) {
|
|
287
|
+
names.add(match[1]);
|
|
288
|
+
}
|
|
289
|
+
return Array.from(names);
|
|
290
|
+
}
|
|
291
|
+
// Rust Functions
|
|
292
|
+
function extractRustFunctions(content) {
|
|
293
|
+
const names = new Set();
|
|
294
|
+
// Function definitions: fn name(...) or pub fn name(...)
|
|
295
|
+
const functionMatches = content.matchAll(/(?:pub\s+)?fn\s+(\w+)\s*\(/g);
|
|
296
|
+
for (const match of functionMatches) {
|
|
297
|
+
names.add(match[1]);
|
|
298
|
+
}
|
|
299
|
+
// Struct definitions: struct Name {
|
|
300
|
+
const structMatches = content.matchAll(/(?:pub\s+)?struct\s+(\w+)/g);
|
|
301
|
+
for (const match of structMatches) {
|
|
302
|
+
names.add(match[1]);
|
|
303
|
+
}
|
|
304
|
+
// Trait definitions: trait Name {
|
|
305
|
+
const traitMatches = content.matchAll(/(?:pub\s+)?trait\s+(\w+)/g);
|
|
306
|
+
for (const match of traitMatches) {
|
|
307
|
+
names.add(match[1]);
|
|
308
|
+
}
|
|
309
|
+
return Array.from(names);
|
|
310
|
+
}
|
|
311
|
+
// Vue Functions
|
|
312
|
+
function extractVueFunctions(content) {
|
|
313
|
+
const names = new Set();
|
|
314
|
+
// Extract script content from Vue SFC
|
|
315
|
+
const scriptMatch = content.match(/<script[^>]*>([\s\S]*?)<\/script>/);
|
|
316
|
+
if (!scriptMatch)
|
|
317
|
+
return [];
|
|
318
|
+
const scriptContent = scriptMatch[1];
|
|
319
|
+
// Composition API: const/function name = ...
|
|
320
|
+
const compositionMatches = scriptContent.matchAll(/(?:const|function)\s+(\w+)\s*=/g);
|
|
321
|
+
for (const match of compositionMatches) {
|
|
322
|
+
names.add(match[1]);
|
|
323
|
+
}
|
|
324
|
+
// Options API methods
|
|
325
|
+
const methodMatches = scriptContent.matchAll(/(\w+)\s*\([^)]*\)\s*{/g);
|
|
326
|
+
for (const match of methodMatches) {
|
|
327
|
+
names.add(match[1]);
|
|
328
|
+
}
|
|
329
|
+
return Array.from(names);
|
|
330
|
+
}
|
|
331
|
+
// Vue Components
|
|
332
|
+
function extractVueComponents(content) {
|
|
333
|
+
const names = new Set();
|
|
334
|
+
// Extract component name from filename convention or export
|
|
335
|
+
const scriptMatch = content.match(/<script[^>]*>([\s\S]*?)<\/script>/);
|
|
336
|
+
if (!scriptMatch)
|
|
337
|
+
return [];
|
|
338
|
+
const scriptContent = scriptMatch[1];
|
|
339
|
+
// export default { name: 'ComponentName' }
|
|
340
|
+
const nameMatch = scriptContent.match(/name:\s*['"](\w+)['"]/);
|
|
341
|
+
if (nameMatch) {
|
|
342
|
+
names.add(nameMatch[1]);
|
|
343
|
+
}
|
|
344
|
+
// defineComponent or <script setup> components
|
|
345
|
+
const defineComponentMatch = scriptContent.match(/defineComponent\s*\(/);
|
|
346
|
+
if (defineComponentMatch) {
|
|
347
|
+
names.add('VueComponent');
|
|
348
|
+
}
|
|
349
|
+
return Array.from(names);
|
|
350
|
+
}
|
|
351
|
+
//# sourceMappingURL=symbol-extractor.js.map
|