@ankhorage/dependency-graph 0.7.2 → 1.1.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/CHANGELOG.md +12 -0
- package/README.md +12 -3
- package/dist/dependencyGraph.d.ts +14 -9
- package/dist/dependencyGraph.d.ts.map +1 -1
- package/dist/dependencyGraph.js +12 -8
- package/dist/dependencyGraph.js.map +1 -1
- package/dist/features/dependency-analysis/adapters/outbound/cpp/extractCppDependencies.d.ts +2 -1
- package/dist/features/dependency-analysis/adapters/outbound/cpp/extractCppDependencies.d.ts.map +1 -1
- package/dist/features/dependency-analysis/adapters/outbound/cpp/extractCppDependencies.js.map +1 -1
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaSourceFacts.d.ts +4 -0
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaSourceFacts.d.ts.map +1 -0
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaSourceFacts.js +201 -0
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaSourceFacts.js.map +1 -0
- package/dist/features/dependency-analysis/adapters/outbound/typescript/extractTypeScriptSourceFacts.d.ts +4 -0
- package/dist/features/dependency-analysis/adapters/outbound/typescript/extractTypeScriptSourceFacts.d.ts.map +1 -0
- package/dist/features/dependency-analysis/adapters/outbound/typescript/extractTypeScriptSourceFacts.js +159 -0
- package/dist/features/dependency-analysis/adapters/outbound/typescript/extractTypeScriptSourceFacts.js.map +1 -0
- package/dist/features/dependency-analysis/application/assertDependencyGraphInspections.d.ts +4 -0
- package/dist/features/dependency-analysis/application/assertDependencyGraphInspections.d.ts.map +1 -0
- package/dist/features/dependency-analysis/application/assertDependencyGraphInspections.js +13 -0
- package/dist/features/dependency-analysis/application/assertDependencyGraphInspections.js.map +1 -0
- package/dist/features/dependency-analysis/application/projectDependencyGraphFromInspections.d.ts +5 -0
- package/dist/features/dependency-analysis/application/projectDependencyGraphFromInspections.d.ts.map +1 -0
- package/dist/features/dependency-analysis/application/projectDependencyGraphFromInspections.js +43 -0
- package/dist/features/dependency-analysis/application/projectDependencyGraphFromInspections.js.map +1 -0
- package/dist/features/dependency-analysis/{application → composition}/createDependencyGraphAsync.d.ts.map +1 -1
- package/dist/features/dependency-analysis/{application → composition}/createDependencyGraphAsync.js +1 -2
- package/dist/features/dependency-analysis/composition/createDependencyGraphAsync.js.map +1 -0
- package/dist/features/dependency-analysis/{application → composition}/createDependencyGraphFromInspectionsAsync.d.ts +1 -3
- package/dist/features/dependency-analysis/composition/createDependencyGraphFromInspectionsAsync.d.ts.map +1 -0
- package/dist/features/dependency-analysis/composition/createDependencyGraphFromInspectionsAsync.js +13 -0
- package/dist/features/dependency-analysis/composition/createDependencyGraphFromInspectionsAsync.js.map +1 -0
- package/dist/features/dependency-analysis/domain/extractCppPackageFromInclude.d.ts.map +1 -0
- package/dist/features/dependency-analysis/domain/extractCppPackageFromInclude.js.map +1 -0
- package/dist/features/dependency-analysis/domain/extractDelphiPackageFromImport.d.ts.map +1 -0
- package/dist/features/dependency-analysis/domain/extractDelphiPackageFromImport.js.map +1 -0
- package/dist/features/dependency-analysis/domain/extractJavaPackageFromImport.d.ts +3 -0
- package/dist/features/dependency-analysis/domain/extractJavaPackageFromImport.d.ts.map +1 -0
- package/dist/features/dependency-analysis/{adapters/outbound/java → domain}/extractJavaPackageFromImport.js +1 -1
- package/dist/features/dependency-analysis/domain/extractJavaPackageFromImport.js.map +1 -0
- package/dist/features/dependency-analysis/domain/extractKotlinPackageFromImport.d.ts.map +1 -0
- package/dist/features/dependency-analysis/domain/extractKotlinPackageFromImport.js.map +1 -0
- package/dist/features/dependency-analysis/domain/extractPythonPackageFromImport.d.ts.map +1 -0
- package/dist/features/dependency-analysis/domain/extractPythonPackageFromImport.js.map +1 -0
- package/dist/features/dependency-analysis/domain/projectDependencyGraphFromSourceGraph.d.ts +5 -0
- package/dist/features/dependency-analysis/domain/projectDependencyGraphFromSourceGraph.d.ts.map +1 -0
- package/dist/features/dependency-analysis/domain/projectDependencyGraphFromSourceGraph.js +144 -0
- package/dist/features/dependency-analysis/domain/projectDependencyGraphFromSourceGraph.js.map +1 -0
- package/dist/features/source-graph/adapters/outbound/extractOtherLanguageFacts.d.ts +4 -0
- package/dist/features/source-graph/adapters/outbound/extractOtherLanguageFacts.d.ts.map +1 -0
- package/dist/features/source-graph/adapters/outbound/extractOtherLanguageFacts.js +36 -0
- package/dist/features/source-graph/adapters/outbound/extractOtherLanguageFacts.js.map +1 -0
- package/dist/features/source-graph/composition/createSourceGraphAsync.d.ts +4 -0
- package/dist/features/source-graph/composition/createSourceGraphAsync.d.ts.map +1 -0
- package/dist/features/source-graph/composition/createSourceGraphAsync.js +16 -0
- package/dist/features/source-graph/composition/createSourceGraphAsync.js.map +1 -0
- package/dist/features/source-graph/composition/createSourceGraphFromInspectionsAsync.d.ts +4 -0
- package/dist/features/source-graph/composition/createSourceGraphFromInspectionsAsync.d.ts.map +1 -0
- package/dist/features/source-graph/composition/createSourceGraphFromInspectionsAsync.js +118 -0
- package/dist/features/source-graph/composition/createSourceGraphFromInspectionsAsync.js.map +1 -0
- package/dist/features/source-graph/domain/createSourceGraph.d.ts +4 -0
- package/dist/features/source-graph/domain/createSourceGraph.d.ts.map +1 -0
- package/dist/features/source-graph/domain/createSourceGraph.js +73 -0
- package/dist/features/source-graph/domain/createSourceGraph.js.map +1 -0
- package/dist/features/source-graph/domain/createSourceGraphIndex.d.ts +4 -0
- package/dist/features/source-graph/domain/createSourceGraphIndex.d.ts.map +1 -0
- package/dist/features/source-graph/domain/createSourceGraphIndex.js +57 -0
- package/dist/features/source-graph/domain/createSourceGraphIndex.js.map +1 -0
- package/dist/features/source-graph/domain/createSourceRelationDraft.d.ts +4 -0
- package/dist/features/source-graph/domain/createSourceRelationDraft.d.ts.map +1 -0
- package/dist/features/source-graph/domain/createSourceRelationDraft.js +119 -0
- package/dist/features/source-graph/domain/createSourceRelationDraft.js.map +1 -0
- package/dist/features/source-graph/domain/createSourceRollupIndex.d.ts +8 -0
- package/dist/features/source-graph/domain/createSourceRollupIndex.d.ts.map +1 -0
- package/dist/features/source-graph/domain/createSourceRollupIndex.js +27 -0
- package/dist/features/source-graph/domain/createSourceRollupIndex.js.map +1 -0
- package/dist/features/source-graph/domain/createSourceStructureDraft.d.ts +11 -0
- package/dist/features/source-graph/domain/createSourceStructureDraft.d.ts.map +1 -0
- package/dist/features/source-graph/domain/createSourceStructureDraft.js +238 -0
- package/dist/features/source-graph/domain/createSourceStructureDraft.js.map +1 -0
- package/dist/features/source-graph/domain/querySourceGraph.d.ts +15 -0
- package/dist/features/source-graph/domain/querySourceGraph.d.ts.map +1 -0
- package/dist/features/source-graph/domain/querySourceGraph.js +40 -0
- package/dist/features/source-graph/domain/querySourceGraph.js.map +1 -0
- package/dist/features/source-graph/domain/resolveSourceImport.d.ts +9 -0
- package/dist/features/source-graph/domain/resolveSourceImport.d.ts.map +1 -0
- package/dist/features/source-graph/domain/resolveSourceImport.js +146 -0
- package/dist/features/source-graph/domain/resolveSourceImport.js.map +1 -0
- package/dist/features/source-graph/domain/rollupSourceRelations.d.ts +4 -0
- package/dist/features/source-graph/domain/rollupSourceRelations.d.ts.map +1 -0
- package/dist/features/source-graph/domain/rollupSourceRelations.js +46 -0
- package/dist/features/source-graph/domain/rollupSourceRelations.js.map +1 -0
- package/dist/features/source-graph/domain/serializeSourceGraph.d.ts +6 -0
- package/dist/features/source-graph/domain/serializeSourceGraph.d.ts.map +1 -0
- package/dist/features/source-graph/domain/serializeSourceGraph.js +64 -0
- package/dist/features/source-graph/domain/serializeSourceGraph.js.map +1 -0
- package/dist/features/source-graph/domain/sourceSemanticPath.d.ts +3 -0
- package/dist/features/source-graph/domain/sourceSemanticPath.d.ts.map +1 -0
- package/dist/features/source-graph/domain/sourceSemanticPath.js +5 -0
- package/dist/features/source-graph/domain/sourceSemanticPath.js.map +1 -0
- package/dist/features/source-graph/domain/summarizeSourceNode.d.ts +4 -0
- package/dist/features/source-graph/domain/summarizeSourceNode.d.ts.map +1 -0
- package/dist/features/source-graph/domain/summarizeSourceNode.js +66 -0
- package/dist/features/source-graph/domain/summarizeSourceNode.js.map +1 -0
- package/dist/types/dependencyGraph.d.ts +2 -23
- package/dist/types/dependencyGraph.d.ts.map +1 -1
- package/dist/types/dependencyGraph.js.map +1 -1
- package/dist/types/sourceGraph.d.ts +173 -0
- package/dist/types/sourceGraph.d.ts.map +1 -0
- package/dist/types/sourceGraph.js +2 -0
- package/dist/types/sourceGraph.js.map +1 -0
- package/package.json +6 -4
- package/dist/features/dependency-analysis/adapters/outbound/cpp/analyzeCppProjectAsync.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/cpp/analyzeCppProjectAsync.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/cpp/analyzeCppProjectAsync.js +0 -103
- package/dist/features/dependency-analysis/adapters/outbound/cpp/analyzeCppProjectAsync.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.js +0 -8
- package/dist/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/cpp/extractCppPackageFromInclude.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/cpp/extractCppPackageFromInclude.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/delphi/analyzeDelphiProjectAsync.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/delphi/analyzeDelphiProjectAsync.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/delphi/analyzeDelphiProjectAsync.js +0 -105
- package/dist/features/dependency-analysis/adapters/outbound/delphi/analyzeDelphiProjectAsync.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/delphi/delphiDependencyGraphAnalyzer.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/delphi/delphiDependencyGraphAnalyzer.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/delphi/delphiDependencyGraphAnalyzer.js +0 -8
- package/dist/features/dependency-analysis/adapters/outbound/delphi/delphiDependencyGraphAnalyzer.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/delphi/extractDelphiPackageFromImport.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/delphi/extractDelphiPackageFromImport.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/java/analyzeJavaProjectAsync.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/java/analyzeJavaProjectAsync.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/java/analyzeJavaProjectAsync.js +0 -103
- package/dist/features/dependency-analysis/adapters/outbound/java/analyzeJavaProjectAsync.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaDependencies.d.ts +0 -7
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaDependencies.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaDependencies.js +0 -7
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaDependencies.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaPackageFromImport.d.ts +0 -3
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaPackageFromImport.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaPackageFromImport.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/java/javaDependencyGraphAnalyzer.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/java/javaDependencyGraphAnalyzer.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/java/javaDependencyGraphAnalyzer.js +0 -8
- package/dist/features/dependency-analysis/adapters/outbound/java/javaDependencyGraphAnalyzer.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/analyzeKotlinProjectAsync.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/analyzeKotlinProjectAsync.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/analyzeKotlinProjectAsync.js +0 -103
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/analyzeKotlinProjectAsync.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/extractKotlinPackageFromImport.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/extractKotlinPackageFromImport.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/kotlinDependencyGraphAnalyzer.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/kotlinDependencyGraphAnalyzer.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/kotlinDependencyGraphAnalyzer.js +0 -8
- package/dist/features/dependency-analysis/adapters/outbound/kotlin/kotlinDependencyGraphAnalyzer.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/python/analyzePythonProjectAsync.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/python/analyzePythonProjectAsync.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/python/analyzePythonProjectAsync.js +0 -103
- package/dist/features/dependency-analysis/adapters/outbound/python/analyzePythonProjectAsync.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/python/extractPythonPackageFromImport.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/python/extractPythonPackageFromImport.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/python/pythonDependencyGraphAnalyzer.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/python/pythonDependencyGraphAnalyzer.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/python/pythonDependencyGraphAnalyzer.js +0 -8
- package/dist/features/dependency-analysis/adapters/outbound/python/pythonDependencyGraphAnalyzer.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/analyzeTypeScriptProjectAsync.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/typescript/analyzeTypeScriptProjectAsync.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/analyzeTypeScriptProjectAsync.js +0 -92
- package/dist/features/dependency-analysis/adapters/outbound/typescript/analyzeTypeScriptProjectAsync.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/createTypeScriptModuleNodes.d.ts +0 -5
- package/dist/features/dependency-analysis/adapters/outbound/typescript/createTypeScriptModuleNodes.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/createTypeScriptModuleNodes.js +0 -29
- package/dist/features/dependency-analysis/adapters/outbound/typescript/createTypeScriptModuleNodes.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/extractTypeScriptImports.d.ts +0 -3
- package/dist/features/dependency-analysis/adapters/outbound/typescript/extractTypeScriptImports.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/extractTypeScriptImports.js +0 -9
- package/dist/features/dependency-analysis/adapters/outbound/typescript/extractTypeScriptImports.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/modulePathForFile.d.ts +0 -3
- package/dist/features/dependency-analysis/adapters/outbound/typescript/modulePathForFile.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/modulePathForFile.js +0 -8
- package/dist/features/dependency-analysis/adapters/outbound/typescript/modulePathForFile.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/resolveTypeScriptImport.d.ts +0 -11
- package/dist/features/dependency-analysis/adapters/outbound/typescript/resolveTypeScriptImport.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/resolveTypeScriptImport.js +0 -85
- package/dist/features/dependency-analysis/adapters/outbound/typescript/resolveTypeScriptImport.js.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/typescriptDependencyGraphAnalyzer.d.ts +0 -4
- package/dist/features/dependency-analysis/adapters/outbound/typescript/typescriptDependencyGraphAnalyzer.d.ts.map +0 -1
- package/dist/features/dependency-analysis/adapters/outbound/typescript/typescriptDependencyGraphAnalyzer.js +0 -8
- package/dist/features/dependency-analysis/adapters/outbound/typescript/typescriptDependencyGraphAnalyzer.js.map +0 -1
- package/dist/features/dependency-analysis/application/createDependencyGraphAsync.js.map +0 -1
- package/dist/features/dependency-analysis/application/createDependencyGraphFromInspectionsAsync.d.ts.map +0 -1
- package/dist/features/dependency-analysis/application/createDependencyGraphFromInspectionsAsync.js +0 -111
- package/dist/features/dependency-analysis/application/createDependencyGraphFromInspectionsAsync.js.map +0 -1
- package/dist/features/dependency-analysis/utils/collectInspectedSourceFiles.d.ts +0 -4
- package/dist/features/dependency-analysis/utils/collectInspectedSourceFiles.d.ts.map +0 -1
- package/dist/features/dependency-analysis/utils/collectInspectedSourceFiles.js +0 -36
- package/dist/features/dependency-analysis/utils/collectInspectedSourceFiles.js.map +0 -1
- package/dist/features/dependency-analysis/utils/findIntrinsicPackageForReference.d.ts +0 -3
- package/dist/features/dependency-analysis/utils/findIntrinsicPackageForReference.d.ts.map +0 -1
- package/dist/features/dependency-analysis/utils/findIntrinsicPackageForReference.js +0 -8
- package/dist/features/dependency-analysis/utils/findIntrinsicPackageForReference.js.map +0 -1
- /package/dist/features/dependency-analysis/{application → composition}/createDependencyGraphAsync.d.ts +0 -0
- /package/dist/features/dependency-analysis/{adapters/outbound/cpp → domain}/extractCppPackageFromInclude.d.ts +0 -0
- /package/dist/features/dependency-analysis/{adapters/outbound/cpp → domain}/extractCppPackageFromInclude.js +0 -0
- /package/dist/features/dependency-analysis/{adapters/outbound/delphi → domain}/extractDelphiPackageFromImport.d.ts +0 -0
- /package/dist/features/dependency-analysis/{adapters/outbound/delphi → domain}/extractDelphiPackageFromImport.js +0 -0
- /package/dist/features/dependency-analysis/{adapters/outbound/kotlin → domain}/extractKotlinPackageFromImport.d.ts +0 -0
- /package/dist/features/dependency-analysis/{adapters/outbound/kotlin → domain}/extractKotlinPackageFromImport.js +0 -0
- /package/dist/features/dependency-analysis/{adapters/outbound/python → domain}/extractPythonPackageFromImport.d.ts +0 -0
- /package/dist/features/dependency-analysis/{adapters/outbound/python → domain}/extractPythonPackageFromImport.js +0 -0
package/dist/features/dependency-analysis/adapters/outbound/cpp/analyzeCppProjectAsync.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeCppProjectAsync.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/cpp/analyzeCppProjectAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAS9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAE5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAuC;IAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG,2BAA2B,CACvC,OAAO,EACP,QAAQ,EAAE,WAAW,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,EACrC,CAAC,IAAI,EAAE,EAAE,CACP,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CA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AAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO;gBAC3C,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS;gBACpC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBACpF,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;aACnF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,8EAA8E;AAC9E,SAAS,kBAAkB,CAAC,OAAuC,EAAE,SAAiB;IACpF,OAAO,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;AAC9F,CAAC","sourcesContent":["import { readFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport type { GraphEdge, GraphNode } from '@ankhorage/graph';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type {\n DependencyGraphAnalyzerContext,\n DependencyGraphEdgeData,\n DependencyGraphFragment,\n DependencyGraphNodeData,\n DependencyImportEvidence,\n} from '../../../../../types/dependencyGraph.js';\nimport { collectInspectedSourceFiles } from '../../../utils/collectInspectedSourceFiles.js';\nimport type { CppInclude } from './extractCppDependencies.js';\nimport { extractCppDependencies } from './extractCppDependencies.js';\nimport { extractCppPackageFromInclude } from './extractCppPackageFromInclude.js';\n\n/*** Analyze one detected C++ package into namespace/include dependency evidence. */\nexport async function analyzeCppProjectAsync(\n context: DependencyGraphAnalyzerContext,\n): Promise<DependencyGraphFragment> {\n const language = context.package.detection.languages.find(({ id }) => id === 'cpp');\n const files = collectInspectedSourceFiles(\n context,\n language?.sourceRoots ?? ['src', '.'],\n (file) =>\n ['.cpp', '.cc', '.cxx', '.h', '.hpp', '.hxx'].some((extension) => file.endsWith(extension)),\n ['.git', 'build', 'coverage', 'dist', 'out'],\n );\n const sources = await Promise.all(\n files.map(async (file) => ({\n file,\n dependencies: extractCppDependencies(await readFile(file, 'utf8')),\n })),\n );\n const intrinsicNamespaces = new Set(\n sources\n .map(({ dependencies }) => dependencies.namespace)\n .filter((namespace) => namespace !== ''),\n );\n const nodes = new Map<string, GraphNode<DependencyGraphNodeData>>();\n for (const namespace of intrinsicNamespaces) addIntrinsicHierarchy(context, namespace, nodes);\n const edges = new Map<string, GraphEdge<DependencyGraphEdgeData>>();\n\n for (const { file, dependencies } of sources) {\n context.signal?.throwIfAborted();\n const sourceNodeId = nodeIdForNamespace(context, dependencies.namespace);\n for (const include of dependencies.includes) {\n addInclude(context, file, sourceNodeId, include, nodes, edges);\n }\n }\n return { nodes: [...nodes.values()], edges: [...edges.values()] };\n}\n\n/*** Aggregate one C++ include into stable target nodes and weighted evidence. */\nfunction addInclude(\n context: DependencyGraphAnalyzerContext,\n sourceFile: string,\n sourceNodeId: string,\n include: CppInclude,\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n edges: Map<string, GraphEdge<DependencyGraphEdgeData>>,\n): void {\n const targetPackage = extractCppPackageFromInclude(include.specifier);\n if (targetPackage === '') return;\n const targetNodeId = include.local\n ? nodeIdForNamespace(context, targetPackage)\n : `unknown:${targetPackage}`;\n if (targetNodeId === sourceNodeId) return;\n\n if (include.local) {\n addIntrinsicHierarchy(context, targetPackage, nodes);\n } else if (!nodes.has(targetNodeId)) {\n nodes.set(targetNodeId, {\n id: targetNodeId,\n data: {\n kind: 'package',\n classification: 'unknown',\n focus: false,\n label: targetPackage,\n packageName: targetPackage,\n },\n });\n }\n\n const edgeId = `${sourceNodeId}->${targetNodeId}`;\n const existing = edges.get(edgeId);\n const evidence: DependencyImportEvidence = {\n sourceFile: toPortablePath(path.relative(context.package.rootPath, sourceFile)),\n specifier: include.specifier,\n classification: include.local ? 'intrinsic' : 'unknown',\n declarations: [],\n };\n edges.set(edgeId, {\n id: edgeId,\n source: sourceNodeId,\n target: targetNodeId,\n data: {\n kind: 'import',\n analyzerId: 'cpp',\n weight: (existing?.data.weight ?? 0) + 1,\n evidence: [...(existing?.data.evidence ?? []), evidence],\n },\n });\n}\n\n/*** Materialize a C++ namespace/package and all ancestor nodes. */\nfunction addIntrinsicHierarchy(\n context: DependencyGraphAnalyzerContext,\n namespace: string,\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n): void {\n const segments = namespace.split('.');\n segments.forEach((_, index) => {\n const current = segments.slice(0, index + 1).join('.');\n const id = nodeIdForNamespace(context, current);\n if (nodes.has(id)) return;\n nodes.set(id, {\n id,\n data: {\n kind: 'module',\n classification: 'intrinsic',\n focus: true,\n label: current.split('.').at(-1) ?? current,\n projectId: context.package.projectId,\n ...(context.package.name === undefined ? {} : { packageName: context.package.name }),\n path: current,\n parentPath: current.includes('.') ? current.split('.').slice(0, -1).join('.') : '',\n },\n });\n });\n}\n\n/*** Resolve a C++ namespace/package node inside the current focus package. */\nfunction nodeIdForNamespace(context: DependencyGraphAnalyzerContext, namespace: string): string {\n return namespace === '' ? context.package.nodeId : `${context.package.nodeId}#${namespace}`;\n}\n"]}
|
package/dist/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DependencyGraphAnalyzer } from '../../../../../types/dependencyGraph.js';
|
|
2
|
-
/*** C++ analyzer adapter selected from project-detector language evidence. */
|
|
3
|
-
export declare const cppDependencyGraphAnalyzer: DependencyGraphAnalyzer;
|
|
4
|
-
//# sourceMappingURL=cppDependencyGraphAnalyzer.d.ts.map
|
package/dist/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cppDependencyGraphAnalyzer.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGvF,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,EAAE,uBAIxC,CAAC"}
|
package/dist/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { analyzeCppProjectAsync } from './analyzeCppProjectAsync.js';
|
|
2
|
-
/*** C++ analyzer adapter selected from project-detector language evidence. */
|
|
3
|
-
export const cppDependencyGraphAnalyzer = {
|
|
4
|
-
id: 'cpp',
|
|
5
|
-
supports: (detection) => detection.languages.some(({ id }) => id === 'cpp'),
|
|
6
|
-
analyzeAsync: analyzeCppProjectAsync,
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=cppDependencyGraphAnalyzer.js.map
|
package/dist/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cppDependencyGraphAnalyzer.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/cpp/cppDependencyGraphAnalyzer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAA4B;IACjE,EAAE,EAAE,KAAK;IACT,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,KAAK,CAAC;IAC3E,YAAY,EAAE,sBAAsB;CACrC,CAAC","sourcesContent":["import type { DependencyGraphAnalyzer } from '../../../../../types/dependencyGraph.js';\nimport { analyzeCppProjectAsync } from './analyzeCppProjectAsync.js';\n\n/*** C++ analyzer adapter selected from project-detector language evidence. */\nexport const cppDependencyGraphAnalyzer: DependencyGraphAnalyzer = {\n id: 'cpp',\n supports: (detection) => detection.languages.some(({ id }) => id === 'cpp'),\n analyzeAsync: analyzeCppProjectAsync,\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractCppPackageFromInclude.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/cpp/extractCppPackageFromInclude.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKtE"}
|
package/dist/features/dependency-analysis/adapters/outbound/cpp/extractCppPackageFromInclude.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractCppPackageFromInclude.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/cpp/extractCppPackageFromInclude.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC5D,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACpC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC","sourcesContent":["/*** Reduce a C++ include path to PKGViz-compatible package notation. */\nexport function extractCppPackageFromInclude(specifier: string): string {\n const withoutExtension = specifier.replace(/\\.(h|hpp|hxx)$/u, '');\n const segments = withoutExtension.split('/');\n if (segments.length <= 1) return '';\n return segments.slice(0, -1).join('.');\n}\n"]}
|
package/dist/features/dependency-analysis/adapters/outbound/delphi/analyzeDelphiProjectAsync.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DependencyGraphAnalyzerContext, DependencyGraphFragment } from '../../../../../types/dependencyGraph.js';
|
|
2
|
-
/*** Analyze one detected Delphi package into unit/import dependency evidence. */
|
|
3
|
-
export declare function analyzeDelphiProjectAsync(context: DependencyGraphAnalyzerContext): Promise<DependencyGraphFragment>;
|
|
4
|
-
//# sourceMappingURL=analyzeDelphiProjectAsync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeDelphiProjectAsync.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/delphi/analyzeDelphiProjectAsync.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,8BAA8B,EAE9B,uBAAuB,EAGxB,MAAM,yCAAyC,CAAC;AAMjD,iFAAiF;AACjF,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,uBAAuB,CAAC,CAuClC"}
|
package/dist/features/dependency-analysis/adapters/outbound/delphi/analyzeDelphiProjectAsync.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { toPortablePath } from '@ankhorage/utility/node/path';
|
|
4
|
-
import { collectInspectedSourceFiles } from '../../../utils/collectInspectedSourceFiles.js';
|
|
5
|
-
import { delphiPackageForFile } from './delphiPackageForFile.js';
|
|
6
|
-
import { extractDelphiDependencies } from './extractDelphiDependencies.js';
|
|
7
|
-
import { extractDelphiPackageFromImport } from './extractDelphiPackageFromImport.js';
|
|
8
|
-
/*** Analyze one detected Delphi package into unit/import dependency evidence. */
|
|
9
|
-
export async function analyzeDelphiProjectAsync(context) {
|
|
10
|
-
const language = context.package.detection.languages.find(({ id }) => id === 'delphi');
|
|
11
|
-
const sourceRoots = language?.sourceRoots ?? ['src', 'Source', '.'];
|
|
12
|
-
const files = collectInspectedSourceFiles(context, sourceRoots, (file) => ['.pas', '.pp', '.dpr'].some((extension) => file.toLowerCase().endsWith(extension)), ['.git', 'build', 'coverage', 'dist', 'lib']);
|
|
13
|
-
const sources = await Promise.all(files.map(async (file) => {
|
|
14
|
-
const dependencies = extractDelphiDependencies(await readFile(file, 'utf8'));
|
|
15
|
-
return {
|
|
16
|
-
file,
|
|
17
|
-
dependencies,
|
|
18
|
-
packageName: delphiPackageForFile(context.package.rootPath, sourceRoots, file, dependencies.unitName),
|
|
19
|
-
};
|
|
20
|
-
}));
|
|
21
|
-
const intrinsicPackages = new Set(sources.map(({ packageName }) => packageName).filter((packageName) => packageName !== ''));
|
|
22
|
-
const nodes = new Map();
|
|
23
|
-
for (const packageName of intrinsicPackages)
|
|
24
|
-
addIntrinsicHierarchy(context, packageName, nodes);
|
|
25
|
-
const edges = new Map();
|
|
26
|
-
for (const { file, packageName, dependencies } of sources) {
|
|
27
|
-
context.signal?.throwIfAborted();
|
|
28
|
-
const sourceNodeId = nodeIdForPackage(context, packageName);
|
|
29
|
-
for (const specifier of dependencies.imports) {
|
|
30
|
-
addImport(context, file, sourceNodeId, specifier, intrinsicPackages, nodes, edges);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return { nodes: [...nodes.values()], edges: [...edges.values()] };
|
|
34
|
-
}
|
|
35
|
-
/*** Aggregate one Delphi uses-clause import into stable target nodes and weighted evidence. */
|
|
36
|
-
function addImport(context, sourceFile, sourceNodeId, specifier, intrinsicPackages, nodes, edges) {
|
|
37
|
-
const targetPackage = extractDelphiPackageFromImport(specifier);
|
|
38
|
-
if (targetPackage === '')
|
|
39
|
-
return;
|
|
40
|
-
const intrinsic = intrinsicPackages.has(targetPackage);
|
|
41
|
-
const targetNodeId = intrinsic
|
|
42
|
-
? nodeIdForPackage(context, targetPackage)
|
|
43
|
-
: `unknown:${targetPackage}`;
|
|
44
|
-
if (targetNodeId === sourceNodeId)
|
|
45
|
-
return;
|
|
46
|
-
if (!intrinsic && !nodes.has(targetNodeId)) {
|
|
47
|
-
nodes.set(targetNodeId, {
|
|
48
|
-
id: targetNodeId,
|
|
49
|
-
data: {
|
|
50
|
-
kind: 'package',
|
|
51
|
-
classification: 'unknown',
|
|
52
|
-
focus: false,
|
|
53
|
-
label: targetPackage,
|
|
54
|
-
packageName: targetPackage,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
const edgeId = `${sourceNodeId}->${targetNodeId}`;
|
|
59
|
-
const existing = edges.get(edgeId);
|
|
60
|
-
const evidence = {
|
|
61
|
-
sourceFile: toPortablePath(path.relative(context.package.rootPath, sourceFile)),
|
|
62
|
-
specifier,
|
|
63
|
-
classification: intrinsic ? 'intrinsic' : 'unknown',
|
|
64
|
-
declarations: [],
|
|
65
|
-
};
|
|
66
|
-
edges.set(edgeId, {
|
|
67
|
-
id: edgeId,
|
|
68
|
-
source: sourceNodeId,
|
|
69
|
-
target: targetNodeId,
|
|
70
|
-
data: {
|
|
71
|
-
kind: 'import',
|
|
72
|
-
analyzerId: 'delphi',
|
|
73
|
-
weight: (existing?.data.weight ?? 0) + 1,
|
|
74
|
-
evidence: [...(existing?.data.evidence ?? []), evidence],
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
/*** Materialize a Delphi package and all ancestor package nodes. */
|
|
79
|
-
function addIntrinsicHierarchy(context, packageName, nodes) {
|
|
80
|
-
const segments = packageName.split('.');
|
|
81
|
-
segments.forEach((_, index) => {
|
|
82
|
-
const current = segments.slice(0, index + 1).join('.');
|
|
83
|
-
const id = nodeIdForPackage(context, current);
|
|
84
|
-
if (nodes.has(id))
|
|
85
|
-
return;
|
|
86
|
-
nodes.set(id, {
|
|
87
|
-
id,
|
|
88
|
-
data: {
|
|
89
|
-
kind: 'module',
|
|
90
|
-
classification: 'intrinsic',
|
|
91
|
-
focus: true,
|
|
92
|
-
label: current.split('.').at(-1) ?? current,
|
|
93
|
-
projectId: context.package.projectId,
|
|
94
|
-
...(context.package.name === undefined ? {} : { packageName: context.package.name }),
|
|
95
|
-
path: current,
|
|
96
|
-
parentPath: current.includes('.') ? current.split('.').slice(0, -1).join('.') : '',
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
/*** Resolve a Delphi package node inside the current focus package. */
|
|
102
|
-
function nodeIdForPackage(context, packageName) {
|
|
103
|
-
return packageName === '' ? context.package.nodeId : `${context.package.nodeId}#${packageName}`;
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=analyzeDelphiProjectAsync.js.map
|
package/dist/features/dependency-analysis/adapters/outbound/delphi/analyzeDelphiProjectAsync.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeDelphiProjectAsync.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/delphi/analyzeDelphiProjectAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAS9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,OAAuC;IAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,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;AAClG,CAAC","sourcesContent":["import { readFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport type { GraphEdge, GraphNode } from '@ankhorage/graph';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type {\n DependencyGraphAnalyzerContext,\n DependencyGraphEdgeData,\n DependencyGraphFragment,\n DependencyGraphNodeData,\n DependencyImportEvidence,\n} from '../../../../../types/dependencyGraph.js';\nimport { collectInspectedSourceFiles } from '../../../utils/collectInspectedSourceFiles.js';\nimport { delphiPackageForFile } from './delphiPackageForFile.js';\nimport { extractDelphiDependencies } from './extractDelphiDependencies.js';\nimport { extractDelphiPackageFromImport } from './extractDelphiPackageFromImport.js';\n\n/*** Analyze one detected Delphi package into unit/import dependency evidence. */\nexport async function analyzeDelphiProjectAsync(\n context: DependencyGraphAnalyzerContext,\n): Promise<DependencyGraphFragment> {\n const language = context.package.detection.languages.find(({ id }) => id === 'delphi');\n const sourceRoots = language?.sourceRoots ?? ['src', 'Source', '.'];\n const files = collectInspectedSourceFiles(\n context,\n sourceRoots,\n (file) => ['.pas', '.pp', '.dpr'].some((extension) => file.toLowerCase().endsWith(extension)),\n ['.git', 'build', 'coverage', 'dist', 'lib'],\n );\n const sources = await Promise.all(\n files.map(async (file) => {\n const dependencies = extractDelphiDependencies(await readFile(file, 'utf8'));\n return {\n file,\n dependencies,\n packageName: delphiPackageForFile(\n context.package.rootPath,\n sourceRoots,\n file,\n dependencies.unitName,\n ),\n };\n }),\n );\n const intrinsicPackages = new Set(\n sources.map(({ packageName }) => packageName).filter((packageName) => packageName !== ''),\n );\n const nodes = new Map<string, GraphNode<DependencyGraphNodeData>>();\n for (const packageName of intrinsicPackages) addIntrinsicHierarchy(context, packageName, nodes);\n const edges = new Map<string, GraphEdge<DependencyGraphEdgeData>>();\n\n for (const { file, packageName, dependencies } of sources) {\n context.signal?.throwIfAborted();\n const sourceNodeId = nodeIdForPackage(context, packageName);\n for (const specifier of dependencies.imports) {\n addImport(context, file, sourceNodeId, specifier, intrinsicPackages, nodes, edges);\n }\n }\n return { nodes: [...nodes.values()], edges: [...edges.values()] };\n}\n\n/*** Aggregate one Delphi uses-clause import into stable target nodes and weighted evidence. */\nfunction addImport(\n context: DependencyGraphAnalyzerContext,\n sourceFile: string,\n sourceNodeId: string,\n specifier: string,\n intrinsicPackages: ReadonlySet<string>,\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n edges: Map<string, GraphEdge<DependencyGraphEdgeData>>,\n): void {\n const targetPackage = extractDelphiPackageFromImport(specifier);\n if (targetPackage === '') return;\n const intrinsic = intrinsicPackages.has(targetPackage);\n const targetNodeId = intrinsic\n ? nodeIdForPackage(context, targetPackage)\n : `unknown:${targetPackage}`;\n if (targetNodeId === sourceNodeId) return;\n if (!intrinsic && !nodes.has(targetNodeId)) {\n nodes.set(targetNodeId, {\n id: targetNodeId,\n data: {\n kind: 'package',\n classification: 'unknown',\n focus: false,\n label: targetPackage,\n packageName: targetPackage,\n },\n });\n }\n const edgeId = `${sourceNodeId}->${targetNodeId}`;\n const existing = edges.get(edgeId);\n const evidence: DependencyImportEvidence = {\n sourceFile: toPortablePath(path.relative(context.package.rootPath, sourceFile)),\n specifier,\n classification: intrinsic ? 'intrinsic' : 'unknown',\n declarations: [],\n };\n edges.set(edgeId, {\n id: edgeId,\n source: sourceNodeId,\n target: targetNodeId,\n data: {\n kind: 'import',\n analyzerId: 'delphi',\n weight: (existing?.data.weight ?? 0) + 1,\n evidence: [...(existing?.data.evidence ?? []), evidence],\n },\n });\n}\n\n/*** Materialize a Delphi package and all ancestor package nodes. */\nfunction addIntrinsicHierarchy(\n context: DependencyGraphAnalyzerContext,\n packageName: string,\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n): void {\n const segments = packageName.split('.');\n segments.forEach((_, index) => {\n const current = segments.slice(0, index + 1).join('.');\n const id = nodeIdForPackage(context, current);\n if (nodes.has(id)) return;\n nodes.set(id, {\n id,\n data: {\n kind: 'module',\n classification: 'intrinsic',\n focus: true,\n label: current.split('.').at(-1) ?? current,\n projectId: context.package.projectId,\n ...(context.package.name === undefined ? {} : { packageName: context.package.name }),\n path: current,\n parentPath: current.includes('.') ? current.split('.').slice(0, -1).join('.') : '',\n },\n });\n });\n}\n\n/*** Resolve a Delphi package node inside the current focus package. */\nfunction nodeIdForPackage(context: DependencyGraphAnalyzerContext, packageName: string): string {\n return packageName === '' ? context.package.nodeId : `${context.package.nodeId}#${packageName}`;\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DependencyGraphAnalyzer } from '../../../../../types/dependencyGraph.js';
|
|
2
|
-
/*** Delphi analyzer adapter selected from project-detector language evidence. */
|
|
3
|
-
export declare const delphiDependencyGraphAnalyzer: DependencyGraphAnalyzer;
|
|
4
|
-
//# sourceMappingURL=delphiDependencyGraphAnalyzer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delphiDependencyGraphAnalyzer.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/delphi/delphiDependencyGraphAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGvF,iFAAiF;AACjF,eAAO,MAAM,6BAA6B,EAAE,uBAI3C,CAAC"}
|
package/dist/features/dependency-analysis/adapters/outbound/delphi/delphiDependencyGraphAnalyzer.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { analyzeDelphiProjectAsync } from './analyzeDelphiProjectAsync.js';
|
|
2
|
-
/*** Delphi analyzer adapter selected from project-detector language evidence. */
|
|
3
|
-
export const delphiDependencyGraphAnalyzer = {
|
|
4
|
-
id: 'delphi',
|
|
5
|
-
supports: (detection) => detection.languages.some(({ id }) => id === 'delphi'),
|
|
6
|
-
analyzeAsync: analyzeDelphiProjectAsync,
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=delphiDependencyGraphAnalyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delphiDependencyGraphAnalyzer.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/delphi/delphiDependencyGraphAnalyzer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,iFAAiF;AACjF,MAAM,CAAC,MAAM,6BAA6B,GAA4B;IACpE,EAAE,EAAE,QAAQ;IACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,QAAQ,CAAC;IAC9E,YAAY,EAAE,yBAAyB;CACxC,CAAC","sourcesContent":["import type { DependencyGraphAnalyzer } from '../../../../../types/dependencyGraph.js';\nimport { analyzeDelphiProjectAsync } from './analyzeDelphiProjectAsync.js';\n\n/*** Delphi analyzer adapter selected from project-detector language evidence. */\nexport const delphiDependencyGraphAnalyzer: DependencyGraphAnalyzer = {\n id: 'delphi',\n supports: (detection) => detection.languages.some(({ id }) => id === 'delphi'),\n analyzeAsync: analyzeDelphiProjectAsync,\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractDelphiPackageFromImport.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/delphi/extractDelphiPackageFromImport.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractDelphiPackageFromImport.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/delphi/extractDelphiPackageFromImport.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,UAAU,8BAA8B,CAAC,SAAiB;IAC9D,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;IACjC,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;AAC1C,CAAC","sourcesContent":["/*** Reduce a Delphi unit import to its PKGViz-compatible package target. */\nexport function extractDelphiPackageFromImport(specifier: string): string {\n const trimmed = specifier.trim();\n return trimmed.split('.')[0] ?? trimmed;\n}\n"]}
|
package/dist/features/dependency-analysis/adapters/outbound/java/analyzeJavaProjectAsync.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DependencyGraphAnalyzerContext, DependencyGraphFragment } from '../../../../../types/dependencyGraph.js';
|
|
2
|
-
/*** Analyze one detected Java package into package/import dependency evidence. */
|
|
3
|
-
export declare function analyzeJavaProjectAsync(context: DependencyGraphAnalyzerContext): Promise<DependencyGraphFragment>;
|
|
4
|
-
//# sourceMappingURL=analyzeJavaProjectAsync.d.ts.map
|
package/dist/features/dependency-analysis/adapters/outbound/java/analyzeJavaProjectAsync.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeJavaProjectAsync.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/java/analyzeJavaProjectAsync.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,8BAA8B,EAE9B,uBAAuB,EAGxB,MAAM,yCAAyC,CAAC;AAMjD,kFAAkF;AAClF,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,uBAAuB,CAAC,CA+BlC"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { toPortablePath } from '@ankhorage/utility/node/path';
|
|
4
|
-
import { collectInspectedSourceFiles } from '../../../utils/collectInspectedSourceFiles.js';
|
|
5
|
-
import { findIntrinsicPackageForReference } from '../../../utils/findIntrinsicPackageForReference.js';
|
|
6
|
-
import { extractJavaDependencies } from './extractJavaDependencies.js';
|
|
7
|
-
import { extractJavaPackageFromImport } from './extractJavaPackageFromImport.js';
|
|
8
|
-
/*** Analyze one detected Java package into package/import dependency evidence. */
|
|
9
|
-
export async function analyzeJavaProjectAsync(context) {
|
|
10
|
-
const language = context.package.detection.languages.find(({ id }) => id === 'java');
|
|
11
|
-
const files = collectInspectedSourceFiles(context, language?.sourceRoots ?? ['src/main/java', '.'], (file) => file.endsWith('.java'), ['.git', 'build', 'coverage', 'dist', 'target']);
|
|
12
|
-
const sources = await Promise.all(files.map(async (file) => ({
|
|
13
|
-
file,
|
|
14
|
-
dependencies: extractJavaDependencies(await readFile(file, 'utf8')),
|
|
15
|
-
})));
|
|
16
|
-
const intrinsicPackages = new Set(sources
|
|
17
|
-
.map(({ dependencies }) => dependencies.packageName)
|
|
18
|
-
.filter((packageName) => packageName !== ''));
|
|
19
|
-
const nodes = new Map();
|
|
20
|
-
for (const packageName of intrinsicPackages)
|
|
21
|
-
addIntrinsicHierarchy(context, packageName, nodes);
|
|
22
|
-
const edges = new Map();
|
|
23
|
-
for (const { file, dependencies } of sources) {
|
|
24
|
-
context.signal?.throwIfAborted();
|
|
25
|
-
const sourceNodeId = nodeIdForPackage(context, dependencies.packageName);
|
|
26
|
-
for (const specifier of dependencies.imports) {
|
|
27
|
-
addImport(context, file, sourceNodeId, specifier, intrinsicPackages, nodes, edges);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return { nodes: [...nodes.values()], edges: [...edges.values()] };
|
|
31
|
-
}
|
|
32
|
-
/*** Aggregate one Java import into stable target nodes and weighted evidence. */
|
|
33
|
-
function addImport(context, sourceFile, sourceNodeId, specifier, intrinsicPackages, nodes, edges) {
|
|
34
|
-
const intrinsicPackage = findIntrinsicPackageForReference(specifier, intrinsicPackages);
|
|
35
|
-
const targetPackage = intrinsicPackage ?? extractJavaPackageFromImport(specifier);
|
|
36
|
-
if (targetPackage === '')
|
|
37
|
-
return;
|
|
38
|
-
const intrinsic = intrinsicPackage !== undefined;
|
|
39
|
-
const targetNodeId = intrinsic
|
|
40
|
-
? nodeIdForPackage(context, targetPackage)
|
|
41
|
-
: `unknown:${targetPackage}`;
|
|
42
|
-
if (targetNodeId === sourceNodeId)
|
|
43
|
-
return;
|
|
44
|
-
if (!intrinsic && !nodes.has(targetNodeId)) {
|
|
45
|
-
nodes.set(targetNodeId, {
|
|
46
|
-
id: targetNodeId,
|
|
47
|
-
data: {
|
|
48
|
-
kind: 'package',
|
|
49
|
-
classification: 'unknown',
|
|
50
|
-
focus: false,
|
|
51
|
-
label: targetPackage,
|
|
52
|
-
packageName: targetPackage,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
const edgeId = `${sourceNodeId}->${targetNodeId}`;
|
|
57
|
-
const existing = edges.get(edgeId);
|
|
58
|
-
const evidence = {
|
|
59
|
-
sourceFile: toPortablePath(path.relative(context.package.rootPath, sourceFile)),
|
|
60
|
-
specifier,
|
|
61
|
-
classification: intrinsic ? 'intrinsic' : 'unknown',
|
|
62
|
-
declarations: [],
|
|
63
|
-
};
|
|
64
|
-
edges.set(edgeId, {
|
|
65
|
-
id: edgeId,
|
|
66
|
-
source: sourceNodeId,
|
|
67
|
-
target: targetNodeId,
|
|
68
|
-
data: {
|
|
69
|
-
kind: 'import',
|
|
70
|
-
analyzerId: 'java',
|
|
71
|
-
weight: (existing?.data.weight ?? 0) + 1,
|
|
72
|
-
evidence: [...(existing?.data.evidence ?? []), evidence],
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/*** Materialize a Java package and all ancestor package nodes. */
|
|
77
|
-
function addIntrinsicHierarchy(context, packageName, nodes) {
|
|
78
|
-
const segments = packageName.split('.');
|
|
79
|
-
segments.forEach((_, index) => {
|
|
80
|
-
const current = segments.slice(0, index + 1).join('.');
|
|
81
|
-
const id = nodeIdForPackage(context, current);
|
|
82
|
-
if (nodes.has(id))
|
|
83
|
-
return;
|
|
84
|
-
nodes.set(id, {
|
|
85
|
-
id,
|
|
86
|
-
data: {
|
|
87
|
-
kind: 'module',
|
|
88
|
-
classification: 'intrinsic',
|
|
89
|
-
focus: true,
|
|
90
|
-
label: current.split('.').at(-1) ?? current,
|
|
91
|
-
projectId: context.package.projectId,
|
|
92
|
-
...(context.package.name === undefined ? {} : { packageName: context.package.name }),
|
|
93
|
-
path: current,
|
|
94
|
-
parentPath: current.includes('.') ? current.split('.').slice(0, -1).join('.') : '',
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/*** Resolve a Java package node inside the current focus package. */
|
|
100
|
-
function nodeIdForPackage(context, packageName) {
|
|
101
|
-
return packageName === '' ? context.package.nodeId : `${context.package.nodeId}#${packageName}`;
|
|
102
|
-
}
|
|
103
|
-
//# sourceMappingURL=analyzeJavaProjectAsync.js.map
|
package/dist/features/dependency-analysis/adapters/outbound/java/analyzeJavaProjectAsync.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeJavaProjectAsync.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/java/analyzeJavaProjectAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAS9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,kFAAkF;AAClF,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAuC;IAEvC,MAAM,QAAQ,GAAG,OAAO,CA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AAC,EAAE,CAAC;YAAE,OAAO;QAC1B,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE;YACZ,EAAE;YACF,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE,WAAW;gBAC3B,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO;gBAC3C,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS;gBACpC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBACpF,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;aACnF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,qEAAqE;AACrE,SAAS,gBAAgB,CAAC,OAAuC,EAAE,WAAmB;IACpF,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,WAAW,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import { readFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport type { GraphEdge, GraphNode } from '@ankhorage/graph';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type {\n DependencyGraphAnalyzerContext,\n DependencyGraphEdgeData,\n DependencyGraphFragment,\n DependencyGraphNodeData,\n DependencyImportEvidence,\n} from '../../../../../types/dependencyGraph.js';\nimport { collectInspectedSourceFiles } from '../../../utils/collectInspectedSourceFiles.js';\nimport { findIntrinsicPackageForReference } from '../../../utils/findIntrinsicPackageForReference.js';\nimport { extractJavaDependencies } from './extractJavaDependencies.js';\nimport { extractJavaPackageFromImport } from './extractJavaPackageFromImport.js';\n\n/*** Analyze one detected Java package into package/import dependency evidence. */\nexport async function analyzeJavaProjectAsync(\n context: DependencyGraphAnalyzerContext,\n): Promise<DependencyGraphFragment> {\n const language = context.package.detection.languages.find(({ id }) => id === 'java');\n const files = collectInspectedSourceFiles(\n context,\n language?.sourceRoots ?? ['src/main/java', '.'],\n (file) => file.endsWith('.java'),\n ['.git', 'build', 'coverage', 'dist', 'target'],\n );\n const sources = await Promise.all(\n files.map(async (file) => ({\n file,\n dependencies: extractJavaDependencies(await readFile(file, 'utf8')),\n })),\n );\n const intrinsicPackages = new Set(\n sources\n .map(({ dependencies }) => dependencies.packageName)\n .filter((packageName) => packageName !== ''),\n );\n const nodes = new Map<string, GraphNode<DependencyGraphNodeData>>();\n for (const packageName of intrinsicPackages) addIntrinsicHierarchy(context, packageName, nodes);\n const edges = new Map<string, GraphEdge<DependencyGraphEdgeData>>();\n\n for (const { file, dependencies } of sources) {\n context.signal?.throwIfAborted();\n const sourceNodeId = nodeIdForPackage(context, dependencies.packageName);\n for (const specifier of dependencies.imports) {\n addImport(context, file, sourceNodeId, specifier, intrinsicPackages, nodes, edges);\n }\n }\n return { nodes: [...nodes.values()], edges: [...edges.values()] };\n}\n\n/*** Aggregate one Java import into stable target nodes and weighted evidence. */\nfunction addImport(\n context: DependencyGraphAnalyzerContext,\n sourceFile: string,\n sourceNodeId: string,\n specifier: string,\n intrinsicPackages: ReadonlySet<string>,\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n edges: Map<string, GraphEdge<DependencyGraphEdgeData>>,\n): void {\n const intrinsicPackage = findIntrinsicPackageForReference(specifier, intrinsicPackages);\n const targetPackage = intrinsicPackage ?? extractJavaPackageFromImport(specifier);\n if (targetPackage === '') return;\n const intrinsic = intrinsicPackage !== undefined;\n const targetNodeId = intrinsic\n ? nodeIdForPackage(context, targetPackage)\n : `unknown:${targetPackage}`;\n if (targetNodeId === sourceNodeId) return;\n if (!intrinsic && !nodes.has(targetNodeId)) {\n nodes.set(targetNodeId, {\n id: targetNodeId,\n data: {\n kind: 'package',\n classification: 'unknown',\n focus: false,\n label: targetPackage,\n packageName: targetPackage,\n },\n });\n }\n const edgeId = `${sourceNodeId}->${targetNodeId}`;\n const existing = edges.get(edgeId);\n const evidence: DependencyImportEvidence = {\n sourceFile: toPortablePath(path.relative(context.package.rootPath, sourceFile)),\n specifier,\n classification: intrinsic ? 'intrinsic' : 'unknown',\n declarations: [],\n };\n edges.set(edgeId, {\n id: edgeId,\n source: sourceNodeId,\n target: targetNodeId,\n data: {\n kind: 'import',\n analyzerId: 'java',\n weight: (existing?.data.weight ?? 0) + 1,\n evidence: [...(existing?.data.evidence ?? []), evidence],\n },\n });\n}\n\n/*** Materialize a Java package and all ancestor package nodes. */\nfunction addIntrinsicHierarchy(\n context: DependencyGraphAnalyzerContext,\n packageName: string,\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n): void {\n const segments = packageName.split('.');\n segments.forEach((_, index) => {\n const current = segments.slice(0, index + 1).join('.');\n const id = nodeIdForPackage(context, current);\n if (nodes.has(id)) return;\n nodes.set(id, {\n id,\n data: {\n kind: 'module',\n classification: 'intrinsic',\n focus: true,\n label: current.split('.').at(-1) ?? current,\n projectId: context.package.projectId,\n ...(context.package.name === undefined ? {} : { packageName: context.package.name }),\n path: current,\n parentPath: current.includes('.') ? current.split('.').slice(0, -1).join('.') : '',\n },\n });\n });\n}\n\n/*** Resolve a Java package node inside the current focus package. */\nfunction nodeIdForPackage(context: DependencyGraphAnalyzerContext, packageName: string): string {\n return packageName === '' ? context.package.nodeId : `${context.package.nodeId}#${packageName}`;\n}\n"]}
|
package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaDependencies.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface JavaDependencies {
|
|
2
|
-
readonly packageName: string;
|
|
3
|
-
readonly imports: readonly string[];
|
|
4
|
-
}
|
|
5
|
-
/*** Extract a Java package declaration and static import specifiers from source text. */
|
|
6
|
-
export declare function extractJavaDependencies(content: string): JavaDependencies;
|
|
7
|
-
//# sourceMappingURL=extractJavaDependencies.d.ts.map
|
package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaDependencies.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractJavaDependencies.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/java/extractJavaDependencies.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,yFAAyF;AACzF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAMzE"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/*** Extract a Java package declaration and static import specifiers from source text. */
|
|
2
|
-
export function extractJavaDependencies(content) {
|
|
3
|
-
const packageName = /^package\s+([a-zA-Z0-9_.]+);/mu.exec(content)?.[1] ?? '';
|
|
4
|
-
const imports = Array.from(content.matchAll(/^import\s+(?:static\s+)?([a-zA-Z0-9_.*]+);/gmu)).map((match) => match[1] ?? '');
|
|
5
|
-
return { packageName, imports: imports.filter((value) => value !== '') };
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=extractJavaDependencies.js.map
|
package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaDependencies.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractJavaDependencies.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/java/extractJavaDependencies.ts"],"names":[],"mappings":"AAKA,yFAAyF;AACzF,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,MAAM,WAAW,GAAG,gCAAgC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9E,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,+CAA+C,CAAC,CAAC,CAAC,GAAG,CAC/F,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAC1B,CAAC;IACF,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,EAAE,CAAC;AAC3E,CAAC","sourcesContent":["export interface JavaDependencies {\n readonly packageName: string;\n readonly imports: readonly string[];\n}\n\n/*** Extract a Java package declaration and static import specifiers from source text. */\nexport function extractJavaDependencies(content: string): JavaDependencies {\n const packageName = /^package\\s+([a-zA-Z0-9_.]+);/mu.exec(content)?.[1] ?? '';\n const imports = Array.from(content.matchAll(/^import\\s+(?:static\\s+)?([a-zA-Z0-9_.*]+);/gmu)).map(\n (match) => match[1] ?? '',\n );\n return { packageName, imports: imports.filter((value) => value !== '') };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractJavaPackageFromImport.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/java/extractJavaPackageFromImport.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOtE"}
|
package/dist/features/dependency-analysis/adapters/outbound/java/extractJavaPackageFromImport.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractJavaPackageFromImport.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/java/extractJavaPackageFromImport.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC5D,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;IAC9C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,OAAO,CAAC;IACxC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACpF,IAAI,iBAAiB,GAAG,CAAC;QAAE,OAAO,OAAO,CAAC;IAC1C,OAAO,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["/*** Reduce a Java import specifier to its package path using PKGViz-compatible semantics. */\nexport function extractJavaPackageFromImport(specifier: string): string {\n const cleaned = specifier.replace(/\\.\\*$/u, '');\n const segments = cleaned.split('.').reverse();\n if (segments.length < 2) return cleaned;\n const firstPackageIndex = segments.findIndex((segment) => !/^[A-Z]/u.test(segment));\n if (firstPackageIndex < 0) return cleaned;\n return segments.slice(firstPackageIndex).reverse().join('.');\n}\n"]}
|
package/dist/features/dependency-analysis/adapters/outbound/java/javaDependencyGraphAnalyzer.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DependencyGraphAnalyzer } from '../../../../../types/dependencyGraph.js';
|
|
2
|
-
/*** Java analyzer adapter selected from project-detector language evidence. */
|
|
3
|
-
export declare const javaDependencyGraphAnalyzer: DependencyGraphAnalyzer;
|
|
4
|
-
//# sourceMappingURL=javaDependencyGraphAnalyzer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"javaDependencyGraphAnalyzer.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/java/javaDependencyGraphAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGvF,+EAA+E;AAC/E,eAAO,MAAM,2BAA2B,EAAE,uBAIzC,CAAC"}
|
package/dist/features/dependency-analysis/adapters/outbound/java/javaDependencyGraphAnalyzer.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { analyzeJavaProjectAsync } from './analyzeJavaProjectAsync.js';
|
|
2
|
-
/*** Java analyzer adapter selected from project-detector language evidence. */
|
|
3
|
-
export const javaDependencyGraphAnalyzer = {
|
|
4
|
-
id: 'java',
|
|
5
|
-
supports: (detection) => detection.languages.some(({ id }) => id === 'java'),
|
|
6
|
-
analyzeAsync: analyzeJavaProjectAsync,
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=javaDependencyGraphAnalyzer.js.map
|
package/dist/features/dependency-analysis/adapters/outbound/java/javaDependencyGraphAnalyzer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"javaDependencyGraphAnalyzer.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/java/javaDependencyGraphAnalyzer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,2BAA2B,GAA4B;IAClE,EAAE,EAAE,MAAM;IACV,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,MAAM,CAAC;IAC5E,YAAY,EAAE,uBAAuB;CACtC,CAAC","sourcesContent":["import type { DependencyGraphAnalyzer } from '../../../../../types/dependencyGraph.js';\nimport { analyzeJavaProjectAsync } from './analyzeJavaProjectAsync.js';\n\n/*** Java analyzer adapter selected from project-detector language evidence. */\nexport const javaDependencyGraphAnalyzer: DependencyGraphAnalyzer = {\n id: 'java',\n supports: (detection) => detection.languages.some(({ id }) => id === 'java'),\n analyzeAsync: analyzeJavaProjectAsync,\n};\n"]}
|
package/dist/features/dependency-analysis/adapters/outbound/kotlin/analyzeKotlinProjectAsync.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DependencyGraphAnalyzerContext, DependencyGraphFragment } from '../../../../../types/dependencyGraph.js';
|
|
2
|
-
/*** Analyze one detected Kotlin package into package/import dependency evidence. */
|
|
3
|
-
export declare function analyzeKotlinProjectAsync(context: DependencyGraphAnalyzerContext): Promise<DependencyGraphFragment>;
|
|
4
|
-
//# sourceMappingURL=analyzeKotlinProjectAsync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeKotlinProjectAsync.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/kotlin/analyzeKotlinProjectAsync.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,8BAA8B,EAE9B,uBAAuB,EAGxB,MAAM,yCAAyC,CAAC;AAMjD,oFAAoF;AACpF,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,uBAAuB,CAAC,CA+BlC"}
|
package/dist/features/dependency-analysis/adapters/outbound/kotlin/analyzeKotlinProjectAsync.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { toPortablePath } from '@ankhorage/utility/node/path';
|
|
4
|
-
import { collectInspectedSourceFiles } from '../../../utils/collectInspectedSourceFiles.js';
|
|
5
|
-
import { findIntrinsicPackageForReference } from '../../../utils/findIntrinsicPackageForReference.js';
|
|
6
|
-
import { extractKotlinDependencies } from './extractKotlinDependencies.js';
|
|
7
|
-
import { extractKotlinPackageFromImport } from './extractKotlinPackageFromImport.js';
|
|
8
|
-
/*** Analyze one detected Kotlin package into package/import dependency evidence. */
|
|
9
|
-
export async function analyzeKotlinProjectAsync(context) {
|
|
10
|
-
const language = context.package.detection.languages.find(({ id }) => id === 'kotlin');
|
|
11
|
-
const files = collectInspectedSourceFiles(context, language?.sourceRoots ?? ['src/main/kotlin', 'src', '.'], (file) => file.endsWith('.kt') || file.endsWith('.kts'), ['.git', 'build', 'coverage', 'dist', 'target']);
|
|
12
|
-
const sources = await Promise.all(files.map(async (file) => ({
|
|
13
|
-
file,
|
|
14
|
-
dependencies: extractKotlinDependencies(await readFile(file, 'utf8')),
|
|
15
|
-
})));
|
|
16
|
-
const intrinsicPackages = new Set(sources
|
|
17
|
-
.map(({ dependencies }) => dependencies.packageName)
|
|
18
|
-
.filter((packageName) => packageName !== ''));
|
|
19
|
-
const nodes = new Map();
|
|
20
|
-
for (const packageName of intrinsicPackages)
|
|
21
|
-
addIntrinsicHierarchy(context, packageName, nodes);
|
|
22
|
-
const edges = new Map();
|
|
23
|
-
for (const { file, dependencies } of sources) {
|
|
24
|
-
context.signal?.throwIfAborted();
|
|
25
|
-
const sourceNodeId = nodeIdForPackage(context, dependencies.packageName);
|
|
26
|
-
for (const specifier of dependencies.imports) {
|
|
27
|
-
addImport(context, file, sourceNodeId, specifier, intrinsicPackages, nodes, edges);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return { nodes: [...nodes.values()], edges: [...edges.values()] };
|
|
31
|
-
}
|
|
32
|
-
/*** Aggregate one Kotlin import into stable target nodes and weighted evidence. */
|
|
33
|
-
function addImport(context, sourceFile, sourceNodeId, specifier, intrinsicPackages, nodes, edges) {
|
|
34
|
-
const intrinsicPackage = findIntrinsicPackageForReference(specifier, intrinsicPackages);
|
|
35
|
-
const targetPackage = intrinsicPackage ?? extractKotlinPackageFromImport(specifier);
|
|
36
|
-
if (targetPackage === '')
|
|
37
|
-
return;
|
|
38
|
-
const intrinsic = intrinsicPackage !== undefined;
|
|
39
|
-
const targetNodeId = intrinsic
|
|
40
|
-
? nodeIdForPackage(context, targetPackage)
|
|
41
|
-
: `unknown:${targetPackage}`;
|
|
42
|
-
if (targetNodeId === sourceNodeId)
|
|
43
|
-
return;
|
|
44
|
-
if (!intrinsic && !nodes.has(targetNodeId)) {
|
|
45
|
-
nodes.set(targetNodeId, {
|
|
46
|
-
id: targetNodeId,
|
|
47
|
-
data: {
|
|
48
|
-
kind: 'package',
|
|
49
|
-
classification: 'unknown',
|
|
50
|
-
focus: false,
|
|
51
|
-
label: targetPackage,
|
|
52
|
-
packageName: targetPackage,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
const edgeId = `${sourceNodeId}->${targetNodeId}`;
|
|
57
|
-
const existing = edges.get(edgeId);
|
|
58
|
-
const evidence = {
|
|
59
|
-
sourceFile: toPortablePath(path.relative(context.package.rootPath, sourceFile)),
|
|
60
|
-
specifier,
|
|
61
|
-
classification: intrinsic ? 'intrinsic' : 'unknown',
|
|
62
|
-
declarations: [],
|
|
63
|
-
};
|
|
64
|
-
edges.set(edgeId, {
|
|
65
|
-
id: edgeId,
|
|
66
|
-
source: sourceNodeId,
|
|
67
|
-
target: targetNodeId,
|
|
68
|
-
data: {
|
|
69
|
-
kind: 'import',
|
|
70
|
-
analyzerId: 'kotlin',
|
|
71
|
-
weight: (existing?.data.weight ?? 0) + 1,
|
|
72
|
-
evidence: [...(existing?.data.evidence ?? []), evidence],
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/*** Materialize a Kotlin package and all ancestor package nodes. */
|
|
77
|
-
function addIntrinsicHierarchy(context, packageName, nodes) {
|
|
78
|
-
const segments = packageName.split('.');
|
|
79
|
-
segments.forEach((_, index) => {
|
|
80
|
-
const current = segments.slice(0, index + 1).join('.');
|
|
81
|
-
const id = nodeIdForPackage(context, current);
|
|
82
|
-
if (nodes.has(id))
|
|
83
|
-
return;
|
|
84
|
-
nodes.set(id, {
|
|
85
|
-
id,
|
|
86
|
-
data: {
|
|
87
|
-
kind: 'module',
|
|
88
|
-
classification: 'intrinsic',
|
|
89
|
-
focus: true,
|
|
90
|
-
label: current.split('.').at(-1) ?? current,
|
|
91
|
-
projectId: context.package.projectId,
|
|
92
|
-
...(context.package.name === undefined ? {} : { packageName: context.package.name }),
|
|
93
|
-
path: current,
|
|
94
|
-
parentPath: current.includes('.') ? current.split('.').slice(0, -1).join('.') : '',
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/*** Resolve a Kotlin package node inside the current focus package. */
|
|
100
|
-
function nodeIdForPackage(context, packageName) {
|
|
101
|
-
return packageName === '' ? context.package.nodeId : `${context.package.nodeId}#${packageName}`;
|
|
102
|
-
}
|
|
103
|
-
//# sourceMappingURL=analyzeKotlinProjectAsync.js.map
|
package/dist/features/dependency-analysis/adapters/outbound/kotlin/analyzeKotlinProjectAsync.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeKotlinProjectAsync.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/kotlin/analyzeKotlinProjectAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAS9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACtG,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,oFAAoF;AACpF,MAAM,CAAC,KAAK,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AC,GAAG,CAAC,CAAC;QACvD,MAAM,EAAE,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,OAAO;QAC1B,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE;YACZ,EAAE;YACF,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE,WAAW;gBAC3B,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO;gBAC3C,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS;gBACpC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBACpF,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;aACnF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,uEAAuE;AACvE,SAAS,gBAAgB,CAAC,OAAuC,EAAE,WAAmB;IACpF,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,WAAW,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import { readFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport type { GraphEdge, GraphNode } from '@ankhorage/graph';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type {\n DependencyGraphAnalyzerContext,\n DependencyGraphEdgeData,\n DependencyGraphFragment,\n DependencyGraphNodeData,\n DependencyImportEvidence,\n} from '../../../../../types/dependencyGraph.js';\nimport { collectInspectedSourceFiles } from '../../../utils/collectInspectedSourceFiles.js';\nimport { findIntrinsicPackageForReference } from '../../../utils/findIntrinsicPackageForReference.js';\nimport { extractKotlinDependencies } from './extractKotlinDependencies.js';\nimport { extractKotlinPackageFromImport } from './extractKotlinPackageFromImport.js';\n\n/*** Analyze one detected Kotlin package into package/import dependency evidence. */\nexport async function analyzeKotlinProjectAsync(\n context: DependencyGraphAnalyzerContext,\n): Promise<DependencyGraphFragment> {\n const language = context.package.detection.languages.find(({ id }) => id === 'kotlin');\n const files = collectInspectedSourceFiles(\n context,\n language?.sourceRoots ?? ['src/main/kotlin', 'src', '.'],\n (file) => file.endsWith('.kt') || file.endsWith('.kts'),\n ['.git', 'build', 'coverage', 'dist', 'target'],\n );\n const sources = await Promise.all(\n files.map(async (file) => ({\n file,\n dependencies: extractKotlinDependencies(await readFile(file, 'utf8')),\n })),\n );\n const intrinsicPackages = new Set(\n sources\n .map(({ dependencies }) => dependencies.packageName)\n .filter((packageName) => packageName !== ''),\n );\n const nodes = new Map<string, GraphNode<DependencyGraphNodeData>>();\n for (const packageName of intrinsicPackages) addIntrinsicHierarchy(context, packageName, nodes);\n const edges = new Map<string, GraphEdge<DependencyGraphEdgeData>>();\n\n for (const { file, dependencies } of sources) {\n context.signal?.throwIfAborted();\n const sourceNodeId = nodeIdForPackage(context, dependencies.packageName);\n for (const specifier of dependencies.imports) {\n addImport(context, file, sourceNodeId, specifier, intrinsicPackages, nodes, edges);\n }\n }\n return { nodes: [...nodes.values()], edges: [...edges.values()] };\n}\n\n/*** Aggregate one Kotlin import into stable target nodes and weighted evidence. */\nfunction addImport(\n context: DependencyGraphAnalyzerContext,\n sourceFile: string,\n sourceNodeId: string,\n specifier: string,\n intrinsicPackages: ReadonlySet<string>,\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n edges: Map<string, GraphEdge<DependencyGraphEdgeData>>,\n): void {\n const intrinsicPackage = findIntrinsicPackageForReference(specifier, intrinsicPackages);\n const targetPackage = intrinsicPackage ?? extractKotlinPackageFromImport(specifier);\n if (targetPackage === '') return;\n const intrinsic = intrinsicPackage !== undefined;\n const targetNodeId = intrinsic\n ? nodeIdForPackage(context, targetPackage)\n : `unknown:${targetPackage}`;\n if (targetNodeId === sourceNodeId) return;\n if (!intrinsic && !nodes.has(targetNodeId)) {\n nodes.set(targetNodeId, {\n id: targetNodeId,\n data: {\n kind: 'package',\n classification: 'unknown',\n focus: false,\n label: targetPackage,\n packageName: targetPackage,\n },\n });\n }\n const edgeId = `${sourceNodeId}->${targetNodeId}`;\n const existing = edges.get(edgeId);\n const evidence: DependencyImportEvidence = {\n sourceFile: toPortablePath(path.relative(context.package.rootPath, sourceFile)),\n specifier,\n classification: intrinsic ? 'intrinsic' : 'unknown',\n declarations: [],\n };\n edges.set(edgeId, {\n id: edgeId,\n source: sourceNodeId,\n target: targetNodeId,\n data: {\n kind: 'import',\n analyzerId: 'kotlin',\n weight: (existing?.data.weight ?? 0) + 1,\n evidence: [...(existing?.data.evidence ?? []), evidence],\n },\n });\n}\n\n/*** Materialize a Kotlin package and all ancestor package nodes. */\nfunction addIntrinsicHierarchy(\n context: DependencyGraphAnalyzerContext,\n packageName: string,\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n): void {\n const segments = packageName.split('.');\n segments.forEach((_, index) => {\n const current = segments.slice(0, index + 1).join('.');\n const id = nodeIdForPackage(context, current);\n if (nodes.has(id)) return;\n nodes.set(id, {\n id,\n data: {\n kind: 'module',\n classification: 'intrinsic',\n focus: true,\n label: current.split('.').at(-1) ?? current,\n projectId: context.package.projectId,\n ...(context.package.name === undefined ? {} : { packageName: context.package.name }),\n path: current,\n parentPath: current.includes('.') ? current.split('.').slice(0, -1).join('.') : '',\n },\n });\n });\n}\n\n/*** Resolve a Kotlin package node inside the current focus package. */\nfunction nodeIdForPackage(context: DependencyGraphAnalyzerContext, packageName: string): string {\n return packageName === '' ? context.package.nodeId : `${context.package.nodeId}#${packageName}`;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractKotlinPackageFromImport.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/kotlin/extractKotlinPackageFromImport.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractKotlinPackageFromImport.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/kotlin/extractKotlinPackageFromImport.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,MAAM,UAAU,8BAA8B,CAAC,SAAiB;IAC9D,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,OAAO,CAAC;IACtC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC","sourcesContent":["/*** Reduce a Kotlin import specifier to its package path using PKGViz-compatible semantics. */\nexport function extractKotlinPackageFromImport(specifier: string): string {\n const cleaned = specifier.replace(/\\.\\*$/u, '');\n const parts = cleaned.split('.');\n if (parts.length <= 1) return cleaned;\n return parts.slice(0, -1).join('.');\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DependencyGraphAnalyzer } from '../../../../../types/dependencyGraph.js';
|
|
2
|
-
/*** Kotlin analyzer adapter selected from project-detector language evidence. */
|
|
3
|
-
export declare const kotlinDependencyGraphAnalyzer: DependencyGraphAnalyzer;
|
|
4
|
-
//# sourceMappingURL=kotlinDependencyGraphAnalyzer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kotlinDependencyGraphAnalyzer.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/outbound/kotlin/kotlinDependencyGraphAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGvF,iFAAiF;AACjF,eAAO,MAAM,6BAA6B,EAAE,uBAI3C,CAAC"}
|