@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
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DependencyGraphInspectionProjectInput } from '../../../types/dependencyGraph.js';
|
|
2
|
+
/*** Preserve dependency projection preconditions before reading source files. */
|
|
3
|
+
export declare function assertDependencyGraphInspections(projects: readonly DependencyGraphInspectionProjectInput[]): void;
|
|
4
|
+
//# sourceMappingURL=assertDependencyGraphInspections.d.ts.map
|
package/dist/features/dependency-analysis/application/assertDependencyGraphInspections.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertDependencyGraphInspections.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/application/assertDependencyGraphInspections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,mCAAmC,CAAC;AAG/F,iFAAiF;AACjF,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,SAAS,qCAAqC,EAAE,GACzD,IAAI,CAUN"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { assertDependencyGraphProjectIds } from './assertDependencyGraphProjectIds.js';
|
|
2
|
+
/*** Preserve dependency projection preconditions before reading source files. */
|
|
3
|
+
export function assertDependencyGraphInspections(projects) {
|
|
4
|
+
assertDependencyGraphProjectIds(projects);
|
|
5
|
+
for (const { id, inspection } of projects) {
|
|
6
|
+
if (inspection.complete)
|
|
7
|
+
continue;
|
|
8
|
+
throw new Error(`Dependency graph inspection is incomplete for "${id}": ${inspection.diagnostics
|
|
9
|
+
.map(({ message }) => message)
|
|
10
|
+
.join('; ')}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=assertDependencyGraphInspections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertDependencyGraphInspections.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/application/assertDependencyGraphInspections.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAEvF,iFAAiF;AACjF,MAAM,UAAU,gCAAgC,CAC9C,QAA0D;IAE1D,+BAA+B,CAAC,QAAQ,CAAC,CAAC;IAC1C,KAAK,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC1C,IAAI,UAAU,CAAC,QAAQ;YAAE,SAAS;QAClC,MAAM,IAAI,KAAK,CACb,kDAAkD,EAAE,MAAM,UAAU,CAAC,WAAW;aAC7E,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC;aAC7B,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type { DependencyGraphInspectionProjectInput } from '../../../types/dependencyGraph.js';\nimport { assertDependencyGraphProjectIds } from './assertDependencyGraphProjectIds.js';\n\n/*** Preserve dependency projection preconditions before reading source files. */\nexport function assertDependencyGraphInspections(\n projects: readonly DependencyGraphInspectionProjectInput[],\n): void {\n assertDependencyGraphProjectIds(projects);\n for (const { id, inspection } of projects) {\n if (inspection.complete) continue;\n throw new Error(\n `Dependency graph inspection is incomplete for \"${id}\": ${inspection.diagnostics\n .map(({ message }) => message)\n .join('; ')}`,\n );\n }\n}\n"]}
|
package/dist/features/dependency-analysis/application/projectDependencyGraphFromInspections.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DependencyGraph, DependencyGraphInspectionProjectInput } from '../../../types/dependencyGraph.js';
|
|
2
|
+
import type { SourceGraph } from '../../../types/sourceGraph.js';
|
|
3
|
+
/*** Project a previously analyzed source graph into the established package/module view. */
|
|
4
|
+
export declare function projectDependencyGraphFromInspections(sourceGraph: SourceGraph, projects: readonly DependencyGraphInspectionProjectInput[]): DependencyGraph;
|
|
5
|
+
//# sourceMappingURL=projectDependencyGraphFromInspections.d.ts.map
|
package/dist/features/dependency-analysis/application/projectDependencyGraphFromInspections.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectDependencyGraphFromInspections.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/application/projectDependencyGraphFromInspections.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,qCAAqC,EAEtC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAIjE,4FAA4F;AAC5F,wBAAgB,qCAAqC,CACnD,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,SAAS,qCAAqC,EAAE,GACzD,eAAe,CAKjB"}
|
package/dist/features/dependency-analysis/application/projectDependencyGraphFromInspections.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { projectDependencyGraphFromSourceGraph } from '../domain/projectDependencyGraphFromSourceGraph.js';
|
|
2
|
+
import { assertDependencyGraphInspections } from './assertDependencyGraphInspections.js';
|
|
3
|
+
/*** Project a previously analyzed source graph into the established package/module view. */
|
|
4
|
+
export function projectDependencyGraphFromInspections(sourceGraph, projects) {
|
|
5
|
+
assertDependencyGraphInspections(projects);
|
|
6
|
+
const packages = projects.flatMap(createInspectedPackages);
|
|
7
|
+
assertUniqueFocusNames(packages);
|
|
8
|
+
return projectDependencyGraphFromSourceGraph(sourceGraph, packages, projects);
|
|
9
|
+
}
|
|
10
|
+
/*** Normalize one supplied inspection into dependency-analysis package contexts. */
|
|
11
|
+
function createInspectedPackages(project) {
|
|
12
|
+
const { inspection } = project;
|
|
13
|
+
return selectFocusPackages(inspection).map((detected) => {
|
|
14
|
+
const relativeRoot = detected.rootPath;
|
|
15
|
+
const id = `${project.id}:${relativeRoot}`;
|
|
16
|
+
return {
|
|
17
|
+
id,
|
|
18
|
+
nodeId: `package:${id}`,
|
|
19
|
+
projectId: project.id,
|
|
20
|
+
relativeRoot,
|
|
21
|
+
...(detected.name === undefined ? {} : { name: detected.name }),
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/*** Select the root plus packages declared by root workspace metadata as graph focus. */
|
|
26
|
+
function selectFocusPackages(inspection) {
|
|
27
|
+
const rootPackage = inspection.packages.find(({ rootPath }) => rootPath === '.');
|
|
28
|
+
const workspaceRoots = new Set(inspection.workspaces
|
|
29
|
+
.filter(({ rootPath }) => rootPath === '.')
|
|
30
|
+
.flatMap(({ packagePaths }) => packagePaths));
|
|
31
|
+
const workspacePackages = inspection.packages.filter(({ rootPath }) => rootPath !== '.' && workspaceRoots.has(rootPath));
|
|
32
|
+
const root = rootPackage ?? { rootPath: '.', detection: inspection.detection, manifestPath: '' };
|
|
33
|
+
return [root, ...workspacePackages];
|
|
34
|
+
}
|
|
35
|
+
/*** Reject ambiguous package names before resolving cross-project source imports. */
|
|
36
|
+
function assertUniqueFocusNames(packages) {
|
|
37
|
+
const named = packages.filter((packageContext) => packageContext.name !== undefined);
|
|
38
|
+
const duplicates = named.filter((item, index) => named.findIndex(({ name }) => name === item.name) !== index);
|
|
39
|
+
if (duplicates.length > 0) {
|
|
40
|
+
throw new Error(`Duplicate focus package name: ${duplicates[0]?.name ?? 'unknown'}.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=projectDependencyGraphFromInspections.js.map
|
package/dist/features/dependency-analysis/application/projectDependencyGraphFromInspections.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectDependencyGraphFromInspections.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/application/projectDependencyGraphFromInspections.ts"],"names":[],"mappings":"AAQA,OAAO,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,CAAC,UAAU;SAClB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,KAAK,GAAG,CAAC;SAC1C,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,CAC/C,CAAC;IACF,MAAM,iBAAiB,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAClD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,KAAK,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CACnE,CAAC;IACF,MAAM,IAAI,GAAG,WAAW,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IACjG,OAAO,CAAC,IAAI,EAAE,GAAG,iBAAiB,CAAC,CAAC;AACtC,CAAC;AAED,qFAAqF;AACrF,SAAS,sBAAsB,CAAC,QAA2C;IACzE,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAC3B,CAAC,cAAc,EAAwE,EAAE,CACvF,cAAc,CAAC,IAAI,KAAK,SAAS,CACpC,CAAC;IACF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAC7B,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAC7E,CAAC;IACF,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,iCAAiC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,SAAS,GAAG,CAAC,CAAC;IACxF,CAAC;AACH,CAAC","sourcesContent":["import type { InspectedPackage, ProjectInspection } from '@ankhorage/project-detector/types';\n\nimport type {\n DependencyGraph,\n DependencyGraphInspectionProjectInput,\n DependencyGraphPackage,\n} from '../../../types/dependencyGraph.js';\nimport type { SourceGraph } from '../../../types/sourceGraph.js';\nimport { projectDependencyGraphFromSourceGraph } from '../domain/projectDependencyGraphFromSourceGraph.js';\nimport { assertDependencyGraphInspections } from './assertDependencyGraphInspections.js';\n\n/*** Project a previously analyzed source graph into the established package/module view. */\nexport function projectDependencyGraphFromInspections(\n sourceGraph: SourceGraph,\n projects: readonly DependencyGraphInspectionProjectInput[],\n): DependencyGraph {\n assertDependencyGraphInspections(projects);\n const packages = projects.flatMap(createInspectedPackages);\n assertUniqueFocusNames(packages);\n return projectDependencyGraphFromSourceGraph(sourceGraph, packages, projects);\n}\n\n/*** Normalize one supplied inspection into dependency-analysis package contexts. */\nfunction createInspectedPackages(\n project: DependencyGraphInspectionProjectInput,\n): readonly DependencyGraphPackage[] {\n const { inspection } = project;\n return selectFocusPackages(inspection).map((detected) => {\n const relativeRoot = detected.rootPath;\n const id = `${project.id}:${relativeRoot}`;\n return {\n id,\n nodeId: `package:${id}`,\n projectId: project.id,\n relativeRoot,\n ...(detected.name === undefined ? {} : { name: detected.name }),\n } satisfies DependencyGraphPackage;\n });\n}\n\n/*** Select the root plus packages declared by root workspace metadata as graph focus. */\nfunction selectFocusPackages(inspection: ProjectInspection): readonly InspectedPackage[] {\n const rootPackage = inspection.packages.find(({ rootPath }) => rootPath === '.');\n const workspaceRoots = new Set(\n inspection.workspaces\n .filter(({ rootPath }) => rootPath === '.')\n .flatMap(({ packagePaths }) => packagePaths),\n );\n const workspacePackages = inspection.packages.filter(\n ({ rootPath }) => rootPath !== '.' && workspaceRoots.has(rootPath),\n );\n const root = rootPackage ?? { rootPath: '.', detection: inspection.detection, manifestPath: '' };\n return [root, ...workspacePackages];\n}\n\n/*** Reject ambiguous package names before resolving cross-project source imports. */\nfunction assertUniqueFocusNames(packages: readonly DependencyGraphPackage[]): void {\n const named = packages.filter(\n (packageContext): packageContext is DependencyGraphPackage & { readonly name: string } =>\n packageContext.name !== undefined,\n );\n const duplicates = named.filter(\n (item, index) => named.findIndex(({ name }) => name === item.name) !== index,\n );\n if (duplicates.length > 0) {\n throw new Error(`Duplicate focus package name: ${duplicates[0]?.name ?? 'unknown'}.`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDependencyGraphAsync.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/
|
|
1
|
+
{"version":3,"file":"createDependencyGraphAsync.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/composition/createDependencyGraphAsync.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,0BAA0B,EAC1B,eAAe,EAChB,MAAM,mCAAmC,CAAC;AAI3C,oGAAoG;AACpG,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,0BAA0B,GAChC,OAAO,CAAC,eAAe,CAAC,CAe1B"}
|
package/dist/features/dependency-analysis/{application → composition}/createDependencyGraphAsync.js
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inspectProjectAsync } from '@ankhorage/project-detector/node';
|
|
2
|
-
import { assertDependencyGraphProjectIds } from '
|
|
2
|
+
import { assertDependencyGraphProjectIds } from '../application/assertDependencyGraphProjectIds.js';
|
|
3
3
|
import { createDependencyGraphFromInspectionsAsync } from './createDependencyGraphFromInspectionsAsync.js';
|
|
4
4
|
/*** Inspect project roots, then delegate dependency topology construction to the inspection API. */
|
|
5
5
|
export async function createDependencyGraphAsync(input) {
|
|
@@ -12,7 +12,6 @@ export async function createDependencyGraphAsync(input) {
|
|
|
12
12
|
})));
|
|
13
13
|
return createDependencyGraphFromInspectionsAsync({
|
|
14
14
|
projects,
|
|
15
|
-
...(input.analyzers === undefined ? {} : { analyzers: input.analyzers }),
|
|
16
15
|
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
17
16
|
});
|
|
18
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDependencyGraphAsync.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/composition/createDependencyGraphAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAMvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACpG,OAAO,EAAE,yCAAyC,EAAE,MAAM,gDAAgD,CAAC;AAE3G,oGAAoG;AACpG,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,KAAiC;IAEjC,+BAA+B,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;QACrC,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,UAAU,EAAE,MAAM,mBAAmB,CAAC,OAAO,CAAC,QAAQ,EAAE;YACtD,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;SAChE,CAAC;KACH,CAAC,CAAC,CACJ,CAAC;IAEF,OAAO,yCAAyC,CAAC;QAC/C,QAAQ;QACR,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;KAChE,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { inspectProjectAsync } from '@ankhorage/project-detector/node';\n\nimport type {\n CreateDependencyGraphInput,\n DependencyGraph,\n} from '../../../types/dependencyGraph.js';\nimport { assertDependencyGraphProjectIds } from '../application/assertDependencyGraphProjectIds.js';\nimport { createDependencyGraphFromInspectionsAsync } from './createDependencyGraphFromInspectionsAsync.js';\n\n/*** Inspect project roots, then delegate dependency topology construction to the inspection API. */\nexport async function createDependencyGraphAsync(\n input: CreateDependencyGraphInput,\n): Promise<DependencyGraph> {\n assertDependencyGraphProjectIds(input.projects);\n const projects = await Promise.all(\n input.projects.map(async (project) => ({\n id: project.id,\n inspection: await inspectProjectAsync(project.rootPath, {\n ...(input.signal === undefined ? {} : { signal: input.signal }),\n }),\n })),\n );\n\n return createDependencyGraphFromInspectionsAsync({\n projects,\n ...(input.signal === undefined ? {} : { signal: input.signal }),\n });\n}\n"]}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { CreateDependencyGraphFromInspectionsInput, DependencyGraph } from '../../../types/dependencyGraph.js';
|
|
2
|
-
/***
|
|
3
|
-
* Build one canonical dependency graph from already-inspected projects without rescanning them.
|
|
4
|
-
*/
|
|
2
|
+
/*** Build the established dependency view from one canonical source analysis. */
|
|
5
3
|
export declare function createDependencyGraphFromInspectionsAsync(input: CreateDependencyGraphFromInspectionsInput): Promise<DependencyGraph>;
|
|
6
4
|
//# sourceMappingURL=createDependencyGraphFromInspectionsAsync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDependencyGraphFromInspectionsAsync.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/composition/createDependencyGraphFromInspectionsAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yCAAyC,EACzC,eAAe,EAChB,MAAM,mCAAmC,CAAC;AAK3C,iFAAiF;AACjF,wBAAsB,yCAAyC,CAC7D,KAAK,EAAE,yCAAyC,GAC/C,OAAO,CAAC,eAAe,CAAC,CAO1B"}
|
package/dist/features/dependency-analysis/composition/createDependencyGraphFromInspectionsAsync.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createSourceGraphFromInspectionsAsync } from '../../source-graph/composition/createSourceGraphFromInspectionsAsync.js';
|
|
2
|
+
import { assertDependencyGraphInspections } from '../application/assertDependencyGraphInspections.js';
|
|
3
|
+
import { projectDependencyGraphFromInspections } from '../application/projectDependencyGraphFromInspections.js';
|
|
4
|
+
/*** Build the established dependency view from one canonical source analysis. */
|
|
5
|
+
export async function createDependencyGraphFromInspectionsAsync(input) {
|
|
6
|
+
assertDependencyGraphInspections(input.projects);
|
|
7
|
+
const sourceGraph = await createSourceGraphFromInspectionsAsync({
|
|
8
|
+
projects: input.projects,
|
|
9
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
10
|
+
});
|
|
11
|
+
return projectDependencyGraphFromInspections(sourceGraph, input.projects);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=createDependencyGraphFromInspectionsAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDependencyGraphFromInspectionsAsync.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/composition/createDependencyGraphFromInspectionsAsync.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qCAAqC,EAAE,MAAM,yEAAyE,CAAC;AAChI,OAAO,EAAE,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACtG,OAAO,EAAE,qCAAqC,EAAE,MAAM,yDAAyD,CAAC;AAEhH,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,yCAAyC,CAC7D,KAAgD;IAEhD,gCAAgC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,MAAM,qCAAqC,CAAC;QAC9D,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;KAChE,CAAC,CAAC;IACH,OAAO,qCAAqC,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["import type {\n CreateDependencyGraphFromInspectionsInput,\n DependencyGraph,\n} from '../../../types/dependencyGraph.js';\nimport { createSourceGraphFromInspectionsAsync } from '../../source-graph/composition/createSourceGraphFromInspectionsAsync.js';\nimport { assertDependencyGraphInspections } from '../application/assertDependencyGraphInspections.js';\nimport { projectDependencyGraphFromInspections } from '../application/projectDependencyGraphFromInspections.js';\n\n/*** Build the established dependency view from one canonical source analysis. */\nexport async function createDependencyGraphFromInspectionsAsync(\n input: CreateDependencyGraphFromInspectionsInput,\n): Promise<DependencyGraph> {\n assertDependencyGraphInspections(input.projects);\n const sourceGraph = await createSourceGraphFromInspectionsAsync({\n projects: input.projects,\n ...(input.signal === undefined ? {} : { signal: input.signal }),\n });\n return projectDependencyGraphFromInspections(sourceGraph, input.projects);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractCppPackageFromInclude.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/extractCppPackageFromInclude.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractCppPackageFromInclude.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractDelphiPackageFromImport.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/extractDelphiPackageFromImport.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractDelphiPackageFromImport.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractJavaPackageFromImport.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/extractJavaPackageFromImport.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOtE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*** Reduce a Java import specifier to its package path using
|
|
1
|
+
/*** Reduce a Java import specifier to its package path using established projection semantics. */
|
|
2
2
|
export function extractJavaPackageFromImport(specifier) {
|
|
3
3
|
const cleaned = specifier.replace(/\.\*$/u, '');
|
|
4
4
|
const segments = cleaned.split('.').reverse();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractJavaPackageFromImport.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/extractJavaPackageFromImport.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,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 established projection 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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractKotlinPackageFromImport.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/extractKotlinPackageFromImport.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractKotlinPackageFromImport.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractPythonPackageFromImport.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/extractPythonPackageFromImport.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractPythonPackageFromImport.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/extractPythonPackageFromImport.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,UAAU,8BAA8B,CAAC,SAAiB;IAC9D,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACzC,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;AAC9C,CAAC","sourcesContent":["/*** Reduce a Python import specifier to its PKGViz-compatible package target. */\nexport function extractPythonPackageFromImport(specifier: string): string {\n if (specifier.startsWith('.')) return '';\n return specifier.split('.')[0] ?? specifier;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DependencyGraph, DependencyGraphInspectionProjectInput, DependencyGraphPackage } from '../../../types/dependencyGraph.js';
|
|
2
|
+
import type { SourceGraph } from '../../../types/sourceGraph.js';
|
|
3
|
+
/*** Derive the established module/package dependency view from canonical source facts. */
|
|
4
|
+
export declare function projectDependencyGraphFromSourceGraph(sourceGraph: SourceGraph, packages: readonly DependencyGraphPackage[], projects: readonly DependencyGraphInspectionProjectInput[]): DependencyGraph;
|
|
5
|
+
//# sourceMappingURL=projectDependencyGraphFromSourceGraph.d.ts.map
|
package/dist/features/dependency-analysis/domain/projectDependencyGraphFromSourceGraph.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectDependencyGraphFromSourceGraph.d.ts","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/projectDependencyGraphFromSourceGraph.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EAEf,qCAAqC,EAErC,sBAAsB,EAGvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,WAAW,EAGZ,MAAM,+BAA+B,CAAC;AAGvC,0FAA0F;AAC1F,wBAAgB,qCAAqC,CACnD,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,SAAS,sBAAsB,EAAE,EAC3C,QAAQ,EAAE,SAAS,qCAAqC,EAAE,GACzD,eAAe,CAuCjB"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { createGraph } from '@ankhorage/graph';
|
|
2
|
+
import { createFocusPackageNode } from './createFocusPackageNode.js';
|
|
3
|
+
/*** Derive the established module/package dependency view from canonical source facts. */
|
|
4
|
+
export function projectDependencyGraphFromSourceGraph(sourceGraph, packages, projects) {
|
|
5
|
+
const detectedRoots = new Map(projects.map(({ id, inspection }) => [id, inspection.packages.map(({ rootPath }) => rootPath)]));
|
|
6
|
+
const nodes = new Map(packages.map((item) => [item.nodeId, createFocusPackageNode(item)]));
|
|
7
|
+
const edges = new Map();
|
|
8
|
+
const sourceNodes = new Map(sourceGraph.graph.nodes.map((node) => [node.id, node.data]));
|
|
9
|
+
const files = sourceGraph.graph.nodes.filter(({ data }) => data.kind === 'file' && data.analyzerId !== undefined);
|
|
10
|
+
for (const { data } of files) {
|
|
11
|
+
const owner = packageForFile(packages, detectedRoots, data);
|
|
12
|
+
if (owner !== undefined)
|
|
13
|
+
addModuleHierarchy(nodes, owner, moduleForFile(data, owner));
|
|
14
|
+
}
|
|
15
|
+
for (const edge of sourceGraph.graph.edges) {
|
|
16
|
+
if (edge.data.kind !== 'imports')
|
|
17
|
+
continue;
|
|
18
|
+
const source = sourceNodes.get(edge.source);
|
|
19
|
+
const target = sourceNodes.get(edge.target);
|
|
20
|
+
if (source === undefined || target === undefined)
|
|
21
|
+
continue;
|
|
22
|
+
const owner = packageForFile(packages, detectedRoots, source);
|
|
23
|
+
if (owner === undefined || source.analyzerId === undefined)
|
|
24
|
+
continue;
|
|
25
|
+
const sourceId = moduleNodeId(owner, moduleForFile(source, owner));
|
|
26
|
+
const targetId = projectTarget(target, owner, packages, detectedRoots, nodes);
|
|
27
|
+
if (targetId === undefined || targetId === sourceId)
|
|
28
|
+
continue;
|
|
29
|
+
addProjectedEdge(edges, sourceId, targetId, source.analyzerId, owner, edge.data.evidence, target);
|
|
30
|
+
}
|
|
31
|
+
return createGraph({ nodes: [...nodes.values()], edges: [...edges.values()] });
|
|
32
|
+
}
|
|
33
|
+
/*** Select the deepest focus package root containing one project-relative source file. */
|
|
34
|
+
function packageForFile(packages, detectedRoots, file) {
|
|
35
|
+
if (file.filePath === undefined)
|
|
36
|
+
return undefined;
|
|
37
|
+
const { filePath } = file;
|
|
38
|
+
const detected = (detectedRoots.get(file.projectId) ?? ['.'])
|
|
39
|
+
.filter((root) => root === '.' || filePath === root || filePath.startsWith(`${root}/`))
|
|
40
|
+
.sort((left, right) => right.length - left.length)[0] ?? '.';
|
|
41
|
+
if (!packages.some((item) => item.projectId === file.projectId && item.relativeRoot === detected))
|
|
42
|
+
return undefined;
|
|
43
|
+
return packages
|
|
44
|
+
.filter((item) => item.projectId === file.projectId &&
|
|
45
|
+
(item.relativeRoot === '.' ||
|
|
46
|
+
filePath === item.relativeRoot ||
|
|
47
|
+
filePath.startsWith(`${item.relativeRoot}/`)))
|
|
48
|
+
.sort((left, right) => right.relativeRoot.length - left.relativeRoot.length)[0];
|
|
49
|
+
}
|
|
50
|
+
/*** Read the established dotted module path from one analyzed source file. */
|
|
51
|
+
function moduleForFile(file, owner) {
|
|
52
|
+
if (file.analyzerId !== 'typescript')
|
|
53
|
+
return file.packageName ?? '';
|
|
54
|
+
const relative = owner.relativeRoot === '.'
|
|
55
|
+
? (file.filePath ?? '')
|
|
56
|
+
: (file.filePath ?? '').slice(owner.relativeRoot.length + 1);
|
|
57
|
+
const directory = relative.split('/').slice(0, -1).join('/');
|
|
58
|
+
return directory.split('/').filter(Boolean).join('.');
|
|
59
|
+
}
|
|
60
|
+
/*** Preserve the existing package/module node identity and dotted ancestor structure. */
|
|
61
|
+
function addModuleHierarchy(nodes, owner, modulePath) {
|
|
62
|
+
const parts = modulePath.split('.').filter(Boolean);
|
|
63
|
+
parts.forEach((_, index) => {
|
|
64
|
+
const current = parts.slice(0, index + 1).join('.');
|
|
65
|
+
const id = moduleNodeId(owner, current);
|
|
66
|
+
if (nodes.has(id))
|
|
67
|
+
return;
|
|
68
|
+
nodes.set(id, {
|
|
69
|
+
id,
|
|
70
|
+
data: {
|
|
71
|
+
kind: 'module',
|
|
72
|
+
classification: 'intrinsic',
|
|
73
|
+
focus: true,
|
|
74
|
+
label: parts.at(index) ?? current,
|
|
75
|
+
projectId: owner.projectId,
|
|
76
|
+
...(owner.name === undefined ? {} : { packageName: owner.name }),
|
|
77
|
+
path: current,
|
|
78
|
+
parentPath: index === 0 ? '' : parts.slice(0, index).join('.'),
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/*** Resolve canonical import targets to stable package/module projection identities. */
|
|
84
|
+
function projectTarget(target, sourceOwner, packages, detectedRoots, nodes) {
|
|
85
|
+
if (target.classification === 'vendor' || target.classification === 'unknown') {
|
|
86
|
+
const name = target.packageName ?? target.name;
|
|
87
|
+
const id = `${target.classification}:${name}`;
|
|
88
|
+
if (!nodes.has(id))
|
|
89
|
+
nodes.set(id, {
|
|
90
|
+
id,
|
|
91
|
+
data: {
|
|
92
|
+
kind: 'package',
|
|
93
|
+
classification: target.classification,
|
|
94
|
+
focus: false,
|
|
95
|
+
label: name,
|
|
96
|
+
packageName: name,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
return id;
|
|
100
|
+
}
|
|
101
|
+
if (target.kind === 'package' && target.path !== undefined) {
|
|
102
|
+
return packages.find((item) => item.projectId === target.projectId && item.relativeRoot === target.path)?.nodeId;
|
|
103
|
+
}
|
|
104
|
+
const owner = target.filePath === undefined ? sourceOwner : packageForFile(packages, detectedRoots, target);
|
|
105
|
+
if (owner === undefined)
|
|
106
|
+
return undefined;
|
|
107
|
+
const modulePath = target.analyzerId === 'typescript' || target.kind === 'file'
|
|
108
|
+
? moduleForFile(target, owner)
|
|
109
|
+
: (target.packageName ?? '');
|
|
110
|
+
addModuleHierarchy(nodes, owner, modulePath);
|
|
111
|
+
return moduleNodeId(owner, modulePath);
|
|
112
|
+
}
|
|
113
|
+
/*** Add one canonical import to a weighted package edge with original evidence. */
|
|
114
|
+
function addProjectedEdge(edges, sourceId, targetId, analyzerId, owner, evidence, target) {
|
|
115
|
+
const id = `${sourceId}->${targetId}`;
|
|
116
|
+
const previous = edges.get(id);
|
|
117
|
+
const classification = target.kind === 'package' && target.path !== undefined
|
|
118
|
+
? 'focus'
|
|
119
|
+
: (target.classification ?? 'unknown');
|
|
120
|
+
const observed = evidence.map((item) => ({
|
|
121
|
+
sourceFile: owner.relativeRoot === '.'
|
|
122
|
+
? item.sourcePath
|
|
123
|
+
: item.sourcePath.slice(owner.relativeRoot.length + 1),
|
|
124
|
+
specifier: item.specifier ?? '',
|
|
125
|
+
classification,
|
|
126
|
+
declarations: item.declarations ?? [],
|
|
127
|
+
}));
|
|
128
|
+
edges.set(id, {
|
|
129
|
+
id,
|
|
130
|
+
source: sourceId,
|
|
131
|
+
target: targetId,
|
|
132
|
+
data: {
|
|
133
|
+
kind: 'import',
|
|
134
|
+
analyzerId,
|
|
135
|
+
weight: (previous?.data.weight ?? 0) + observed.length,
|
|
136
|
+
evidence: [...(previous?.data.evidence ?? []), ...observed],
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/*** Preserve the legacy projection's readable package/module node ID. */
|
|
141
|
+
function moduleNodeId(owner, modulePath) {
|
|
142
|
+
return modulePath === '' ? owner.nodeId : `${owner.nodeId}#${modulePath}`;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=projectDependencyGraphFromSourceGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectDependencyGraphFromSourceGraph.js","sourceRoot":"","sources":["../../../../src/features/dependency-analysis/domain/projectDependencyGraphFromSourceGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgB/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,0FAA0F;AAC1F,MAAM,UAAU,qCAAqC,CACnD,WAAwB,EACxB,QAA2C,EAC3C,QAA0D;IAE1D,MAAM,aAAa,GAAG,IAAI,GAAG,CAC3B,QAAQ,CAAC,GAAG,CACV,CAAC,EAAE,EA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CAAC,CAAC;QAC1D,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE;QAC/B,cAAc;QACd,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE;KACtC,CAAC,CAAC,CAAC;IACJ,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE;QACZ,EAAE;QACF,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,UAAU;YACV,MAAM,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM;YACtD,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC;SAC5D;KACF,CAAC,CAAC;AACL,CAAC;AAED,yEAAyE;AACzE,SAAS,YAAY,CAAC,KAA6B,EAAE,UAAkB;IACrE,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC;AAC5E,CAAC","sourcesContent":["import type { GraphEdge, GraphNode } from '@ankhorage/graph';\nimport { createGraph } from '@ankhorage/graph';\n\nimport type {\n DependencyGraph,\n DependencyGraphEdgeData,\n DependencyGraphInspectionProjectInput,\n DependencyGraphNodeData,\n DependencyGraphPackage,\n DependencyImportEvidence,\n DependencyReferenceClassification,\n} from '../../../types/dependencyGraph.js';\nimport type {\n SourceGraph,\n SourceNodeData,\n SourceRelationEvidence,\n} from '../../../types/sourceGraph.js';\nimport { createFocusPackageNode } from './createFocusPackageNode.js';\n\n/*** Derive the established module/package dependency view from canonical source facts. */\nexport function projectDependencyGraphFromSourceGraph(\n sourceGraph: SourceGraph,\n packages: readonly DependencyGraphPackage[],\n projects: readonly DependencyGraphInspectionProjectInput[],\n): DependencyGraph {\n const detectedRoots = new Map(\n projects.map(\n ({ id, inspection }) => [id, inspection.packages.map(({ rootPath }) => rootPath)] as const,\n ),\n );\n const nodes = new Map<string, GraphNode<DependencyGraphNodeData>>(\n packages.map((item) => [item.nodeId, createFocusPackageNode(item)]),\n );\n const edges = new Map<string, GraphEdge<DependencyGraphEdgeData>>();\n const sourceNodes = new Map(sourceGraph.graph.nodes.map((node) => [node.id, node.data]));\n const files = sourceGraph.graph.nodes.filter(\n ({ data }) => data.kind === 'file' && data.analyzerId !== undefined,\n );\n for (const { data } of files) {\n const owner = packageForFile(packages, detectedRoots, data);\n if (owner !== undefined) addModuleHierarchy(nodes, owner, moduleForFile(data, owner));\n }\n for (const edge of sourceGraph.graph.edges) {\n if (edge.data.kind !== 'imports') continue;\n const source = sourceNodes.get(edge.source);\n const target = sourceNodes.get(edge.target);\n if (source === undefined || target === undefined) continue;\n const owner = packageForFile(packages, detectedRoots, source);\n if (owner === undefined || source.analyzerId === undefined) continue;\n const sourceId = moduleNodeId(owner, moduleForFile(source, owner));\n const targetId = projectTarget(target, owner, packages, detectedRoots, nodes);\n if (targetId === undefined || targetId === sourceId) continue;\n addProjectedEdge(\n edges,\n sourceId,\n targetId,\n source.analyzerId,\n owner,\n edge.data.evidence,\n target,\n );\n }\n return createGraph({ nodes: [...nodes.values()], edges: [...edges.values()] });\n}\n\n/*** Select the deepest focus package root containing one project-relative source file. */\nfunction packageForFile(\n packages: readonly DependencyGraphPackage[],\n detectedRoots: ReadonlyMap<string, readonly string[]>,\n file: SourceNodeData,\n): DependencyGraphPackage | undefined {\n if (file.filePath === undefined) return undefined;\n const { filePath } = file;\n const detected =\n (detectedRoots.get(file.projectId) ?? ['.'])\n .filter((root) => root === '.' || filePath === root || filePath.startsWith(`${root}/`))\n .sort((left, right) => right.length - left.length)[0] ?? '.';\n if (!packages.some((item) => item.projectId === file.projectId && item.relativeRoot === detected))\n return undefined;\n return packages\n .filter(\n (item) =>\n item.projectId === file.projectId &&\n (item.relativeRoot === '.' ||\n filePath === item.relativeRoot ||\n filePath.startsWith(`${item.relativeRoot}/`)),\n )\n .sort((left, right) => right.relativeRoot.length - left.relativeRoot.length)[0];\n}\n\n/*** Read the established dotted module path from one analyzed source file. */\nfunction moduleForFile(file: SourceNodeData, owner: DependencyGraphPackage): string {\n if (file.analyzerId !== 'typescript') return file.packageName ?? '';\n const relative =\n owner.relativeRoot === '.'\n ? (file.filePath ?? '')\n : (file.filePath ?? '').slice(owner.relativeRoot.length + 1);\n const directory = relative.split('/').slice(0, -1).join('/');\n return directory.split('/').filter(Boolean).join('.');\n}\n\n/*** Preserve the existing package/module node identity and dotted ancestor structure. */\nfunction addModuleHierarchy(\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n owner: DependencyGraphPackage,\n modulePath: string,\n): void {\n const parts = modulePath.split('.').filter(Boolean);\n parts.forEach((_, index) => {\n const current = parts.slice(0, index + 1).join('.');\n const id = moduleNodeId(owner, 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: parts.at(index) ?? current,\n projectId: owner.projectId,\n ...(owner.name === undefined ? {} : { packageName: owner.name }),\n path: current,\n parentPath: index === 0 ? '' : parts.slice(0, index).join('.'),\n },\n });\n });\n}\n\n/*** Resolve canonical import targets to stable package/module projection identities. */\nfunction projectTarget(\n target: SourceNodeData,\n sourceOwner: DependencyGraphPackage,\n packages: readonly DependencyGraphPackage[],\n detectedRoots: ReadonlyMap<string, readonly string[]>,\n nodes: Map<string, GraphNode<DependencyGraphNodeData>>,\n): string | undefined {\n if (target.classification === 'vendor' || target.classification === 'unknown') {\n const name = target.packageName ?? target.name;\n const id = `${target.classification}:${name}`;\n if (!nodes.has(id))\n nodes.set(id, {\n id,\n data: {\n kind: 'package',\n classification: target.classification,\n focus: false,\n label: name,\n packageName: name,\n },\n });\n return id;\n }\n if (target.kind === 'package' && target.path !== undefined) {\n return packages.find(\n (item) => item.projectId === target.projectId && item.relativeRoot === target.path,\n )?.nodeId;\n }\n const owner =\n target.filePath === undefined ? sourceOwner : packageForFile(packages, detectedRoots, target);\n if (owner === undefined) return undefined;\n const modulePath =\n target.analyzerId === 'typescript' || target.kind === 'file'\n ? moduleForFile(target, owner)\n : (target.packageName ?? '');\n addModuleHierarchy(nodes, owner, modulePath);\n return moduleNodeId(owner, modulePath);\n}\n\n/*** Add one canonical import to a weighted package edge with original evidence. */\nfunction addProjectedEdge(\n edges: Map<string, GraphEdge<DependencyGraphEdgeData>>,\n sourceId: string,\n targetId: string,\n analyzerId: string,\n owner: DependencyGraphPackage,\n evidence: readonly SourceRelationEvidence[],\n target: SourceNodeData,\n): void {\n const id = `${sourceId}->${targetId}`;\n const previous = edges.get(id);\n const classification: DependencyReferenceClassification =\n target.kind === 'package' && target.path !== undefined\n ? 'focus'\n : (target.classification ?? 'unknown');\n const observed = evidence.map((item): DependencyImportEvidence => ({\n sourceFile:\n owner.relativeRoot === '.'\n ? item.sourcePath\n : item.sourcePath.slice(owner.relativeRoot.length + 1),\n specifier: item.specifier ?? '',\n classification,\n declarations: item.declarations ?? [],\n }));\n edges.set(id, {\n id,\n source: sourceId,\n target: targetId,\n data: {\n kind: 'import',\n analyzerId,\n weight: (previous?.data.weight ?? 0) + observed.length,\n evidence: [...(previous?.data.evidence ?? []), ...observed],\n },\n });\n}\n\n/*** Preserve the legacy projection's readable package/module node ID. */\nfunction moduleNodeId(owner: DependencyGraphPackage, modulePath: string): string {\n return modulePath === '' ? owner.nodeId : `${owner.nodeId}#${modulePath}`;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SourceFileFacts } from '../../../../types/sourceGraph.js';
|
|
2
|
+
/*** Map existing import-only analyzers into the canonical factual vocabulary. */
|
|
3
|
+
export declare function extractOtherLanguageFacts(analyzerId: 'cpp' | 'delphi' | 'kotlin' | 'python', content: string, file: string, packageRoot: string, sourceRoots: readonly string[]): SourceFileFacts;
|
|
4
|
+
//# sourceMappingURL=extractOtherLanguageFacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractOtherLanguageFacts.d.ts","sourceRoot":"","sources":["../../../../../src/features/source-graph/adapters/outbound/extractOtherLanguageFacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAQxE,iFAAiF;AACjF,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,EAClD,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,eAAe,CA2BjB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { extractCppDependencies } from '../../../dependency-analysis/adapters/outbound/cpp/extractCppDependencies.js';
|
|
2
|
+
import { delphiPackageForFile } from '../../../dependency-analysis/adapters/outbound/delphi/delphiPackageForFile.js';
|
|
3
|
+
import { extractDelphiDependencies } from '../../../dependency-analysis/adapters/outbound/delphi/extractDelphiDependencies.js';
|
|
4
|
+
import { extractKotlinDependencies } from '../../../dependency-analysis/adapters/outbound/kotlin/extractKotlinDependencies.js';
|
|
5
|
+
import { extractPythonDependencies } from '../../../dependency-analysis/adapters/outbound/python/extractPythonDependencies.js';
|
|
6
|
+
import { pythonPackageForFile } from '../../../dependency-analysis/adapters/outbound/python/pythonPackageForFile.js';
|
|
7
|
+
/*** Map existing import-only analyzers into the canonical factual vocabulary. */
|
|
8
|
+
export function extractOtherLanguageFacts(analyzerId, content, file, packageRoot, sourceRoots) {
|
|
9
|
+
if (analyzerId === 'kotlin') {
|
|
10
|
+
const { packageName, imports } = extractKotlinDependencies(content);
|
|
11
|
+
return { packageName, imports: imports.map((specifier) => ({ specifier })), declarations: [] };
|
|
12
|
+
}
|
|
13
|
+
if (analyzerId === 'python') {
|
|
14
|
+
const { imports } = extractPythonDependencies(content);
|
|
15
|
+
return {
|
|
16
|
+
packageName: pythonPackageForFile(packageRoot, sourceRoots, file),
|
|
17
|
+
imports: imports.map((specifier) => ({ specifier })),
|
|
18
|
+
declarations: [],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (analyzerId === 'cpp') {
|
|
22
|
+
const { namespace, includes } = extractCppDependencies(content);
|
|
23
|
+
return {
|
|
24
|
+
packageName: namespace,
|
|
25
|
+
imports: includes.map(({ specifier, local }) => ({ specifier, local })),
|
|
26
|
+
declarations: [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const { imports, unitName } = extractDelphiDependencies(content);
|
|
30
|
+
return {
|
|
31
|
+
packageName: delphiPackageForFile(packageRoot, sourceRoots, file, unitName),
|
|
32
|
+
imports: imports.map((specifier) => ({ specifier })),
|
|
33
|
+
declarations: [],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=extractOtherLanguageFacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractOtherLanguageFacts.js","sourceRoot":"","sources":["../../../../../src/features/source-graph/adapters/outbound/extractOtherLanguageFacts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8EAA8E,CAAC;AACtH,OAAO,EAAE,oBAAoB,EAAE,MAAM,+EAA+E,CAAC;AACrH,OAAO,EAAE,yBAAyB,EAAE,MAAM,oFAAoF,CAAC;AAC/H,OAAO,EAAE,yBAAyB,EAAE,MAAM,oFAAoF,CAAC;AAC/H,OAAO,EAAE,yBAAyB,EAAE,MAAM,oFAAoF,CAAC;AAC/H,OAAO,EAAE,oBAAoB,EAAE,MAAM,+EAA+E,CAAC;AAErH,iFAAiF;AACjF,MAAM,UAAU,yBAAyB,CACvC,UAAkD,EAClD,OAAe,EACf,IAAY,EACZ,WAAmB,EACnB,WAA8B;IAE9B,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,EAAE,WAAW,EAA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,EAAE;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import type { SourceFileFacts } from '../../../../types/sourceGraph.js';\nimport { extractCppDependencies } from '../../../dependency-analysis/adapters/outbound/cpp/extractCppDependencies.js';\nimport { delphiPackageForFile } from '../../../dependency-analysis/adapters/outbound/delphi/delphiPackageForFile.js';\nimport { extractDelphiDependencies } from '../../../dependency-analysis/adapters/outbound/delphi/extractDelphiDependencies.js';\nimport { extractKotlinDependencies } from '../../../dependency-analysis/adapters/outbound/kotlin/extractKotlinDependencies.js';\nimport { extractPythonDependencies } from '../../../dependency-analysis/adapters/outbound/python/extractPythonDependencies.js';\nimport { pythonPackageForFile } from '../../../dependency-analysis/adapters/outbound/python/pythonPackageForFile.js';\n\n/*** Map existing import-only analyzers into the canonical factual vocabulary. */\nexport function extractOtherLanguageFacts(\n analyzerId: 'cpp' | 'delphi' | 'kotlin' | 'python',\n content: string,\n file: string,\n packageRoot: string,\n sourceRoots: readonly string[],\n): SourceFileFacts {\n if (analyzerId === 'kotlin') {\n const { packageName, imports } = extractKotlinDependencies(content);\n return { packageName, imports: imports.map((specifier) => ({ specifier })), declarations: [] };\n }\n if (analyzerId === 'python') {\n const { imports } = extractPythonDependencies(content);\n return {\n packageName: pythonPackageForFile(packageRoot, sourceRoots, file),\n imports: imports.map((specifier) => ({ specifier })),\n declarations: [],\n };\n }\n if (analyzerId === 'cpp') {\n const { namespace, includes } = extractCppDependencies(content);\n return {\n packageName: namespace,\n imports: includes.map(({ specifier, local }) => ({ specifier, local })),\n declarations: [],\n };\n }\n const { imports, unitName } = extractDelphiDependencies(content);\n return {\n packageName: delphiPackageForFile(packageRoot, sourceRoots, file, unitName),\n imports: imports.map((specifier) => ({ specifier })),\n declarations: [],\n };\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CreateSourceGraphInput, SourceGraph } from '../../../types/sourceGraph.js';
|
|
2
|
+
/*** Inspect project roots, then build the canonical source graph from their bounded scan. */
|
|
3
|
+
export declare function createSourceGraphAsync(input: CreateSourceGraphInput): Promise<SourceGraph>;
|
|
4
|
+
//# sourceMappingURL=createSourceGraphAsync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSourceGraphAsync.d.ts","sourceRoot":"","sources":["../../../../src/features/source-graph/composition/createSourceGraphAsync.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGzF,6FAA6F;AAC7F,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,CAahG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { inspectProjectAsync } from '@ankhorage/project-detector/node';
|
|
2
|
+
import { createSourceGraphFromInspectionsAsync } from './createSourceGraphFromInspectionsAsync.js';
|
|
3
|
+
/*** Inspect project roots, then build the canonical source graph from their bounded scan. */
|
|
4
|
+
export async function createSourceGraphAsync(input) {
|
|
5
|
+
const projects = await Promise.all(input.projects.map(async ({ id, rootPath }) => ({
|
|
6
|
+
id,
|
|
7
|
+
inspection: await inspectProjectAsync(rootPath, {
|
|
8
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
9
|
+
}),
|
|
10
|
+
})));
|
|
11
|
+
return createSourceGraphFromInspectionsAsync({
|
|
12
|
+
projects,
|
|
13
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=createSourceGraphAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSourceGraphAsync.js","sourceRoot":"","sources":["../../../../src/features/source-graph/composition/createSourceGraphAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAC;AAEnG,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,KAA6B;IACxE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9C,EAAE;QACF,UAAU,EAAE,MAAM,mBAAmB,CAAC,QAAQ,EAAE;YAC9C,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;SAChE,CAAC;KACH,CAAC,CAAC,CACJ,CAAC;IACF,OAAO,qCAAqC,CAAC;QAC3C,QAAQ;QACR,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;KAChE,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { inspectProjectAsync } from '@ankhorage/project-detector/node';\n\nimport type { CreateSourceGraphInput, SourceGraph } from '../../../types/sourceGraph.js';\nimport { createSourceGraphFromInspectionsAsync } from './createSourceGraphFromInspectionsAsync.js';\n\n/*** Inspect project roots, then build the canonical source graph from their bounded scan. */\nexport async function createSourceGraphAsync(input: CreateSourceGraphInput): Promise<SourceGraph> {\n const projects = await Promise.all(\n input.projects.map(async ({ id, rootPath }) => ({\n id,\n inspection: await inspectProjectAsync(rootPath, {\n ...(input.signal === undefined ? {} : { signal: input.signal }),\n }),\n })),\n );\n return createSourceGraphFromInspectionsAsync({\n projects,\n ...(input.signal === undefined ? {} : { signal: input.signal }),\n });\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CreateSourceGraphFromInspectionsInput, SourceGraph } from '../../../types/sourceGraph.js';
|
|
2
|
+
/*** Analyze inspected files once into a language-neutral factual source graph. */
|
|
3
|
+
export declare function createSourceGraphFromInspectionsAsync(input: CreateSourceGraphFromInspectionsInput): Promise<SourceGraph>;
|
|
4
|
+
//# sourceMappingURL=createSourceGraphFromInspectionsAsync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSourceGraphFromInspectionsAsync.d.ts","sourceRoot":"","sources":["../../../../src/features/source-graph/composition/createSourceGraphFromInspectionsAsync.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,qCAAqC,EAErC,WAAW,EACZ,MAAM,+BAA+B,CAAC;AASvC,kFAAkF;AAClF,wBAAsB,qCAAqC,CACzD,KAAK,EAAE,qCAAqC,GAC3C,OAAO,CAAC,WAAW,CAAC,CAWtB"}
|