@living-architecture/riviere-extract-ts 0.4.16 → 0.4.18
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/dist/features/extraction/domain/component-extraction/draft-component.d.ts +23 -0
- package/dist/features/extraction/domain/component-extraction/draft-component.d.ts.map +1 -0
- package/dist/features/extraction/domain/component-extraction/draft-component.js +15 -0
- package/dist/features/extraction/domain/component-extraction/extractor.d.ts +3 -15
- package/dist/features/extraction/domain/component-extraction/extractor.d.ts.map +1 -1
- package/dist/features/extraction/domain/component-extraction/extractor.js +11 -24
- package/dist/features/extraction/domain/config-resolution/config-resolution-errors.d.ts +1 -6
- package/dist/features/extraction/domain/config-resolution/config-resolution-errors.d.ts.map +1 -1
- package/dist/features/extraction/domain/config-resolution/config-resolution-errors.js +1 -10
- package/dist/features/extraction/domain/config-resolution/resolve-config.d.ts +2 -4
- package/dist/features/extraction/domain/config-resolution/resolve-config.d.ts.map +1 -1
- package/dist/features/extraction/domain/config-resolution/resolve-config.js +4 -38
- package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-options.d.ts +11 -0
- package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-options.d.ts.map +1 -0
- package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-options.js +9 -0
- package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-types.d.ts +1 -6
- package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-types.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/async-detection/detect-event-publisher-connections.d.ts +3 -3
- package/dist/features/extraction/domain/connection-detection/async-detection/detect-event-publisher-connections.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/async-detection/detect-event-publisher-connections.js +9 -8
- package/dist/features/extraction/domain/connection-detection/async-detection/detect-subscribe-connections.d.ts +3 -3
- package/dist/features/extraction/domain/connection-detection/async-detection/detect-subscribe-connections.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/async-detection/detect-subscribe-connections.js +7 -6
- package/dist/features/extraction/domain/connection-detection/call-graph/build-call-graph.d.ts +2 -2
- package/dist/features/extraction/domain/connection-detection/call-graph/build-call-graph.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/call-graph/build-call-graph.js +25 -14
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.d.ts +2 -2
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.js +7 -4
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-outcomes.d.ts +25 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-outcomes.d.ts.map +1 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-outcomes.js +20 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-shared.d.ts +3 -13
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-shared.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-shared.js +21 -12
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-types.d.ts +41 -21
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-types.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-types.js +41 -15
- package/dist/features/extraction/domain/connection-detection/call-graph/component-identity.d.ts +4 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/component-identity.d.ts.map +1 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/component-identity.js +10 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/deduplicate-links.d.ts +1 -1
- package/dist/features/extraction/domain/connection-detection/call-graph/deduplicate-links.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/call-graph/deduplicate-links.js +36 -6
- package/dist/features/extraction/domain/connection-detection/call-graph/method-level-target.d.ts +12 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/method-level-target.d.ts.map +1 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/method-level-target.js +9 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/trace-calls.d.ts +3 -7
- package/dist/features/extraction/domain/connection-detection/call-graph/trace-calls.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/call-graph/trace-calls.js +17 -8
- package/dist/features/extraction/domain/connection-detection/call-graph/type-name-normalization.d.ts +3 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/type-name-normalization.d.ts.map +1 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/type-name-normalization.js +8 -0
- package/dist/features/extraction/domain/connection-detection/call-graph/type-resolver.d.ts +9 -10
- package/dist/features/extraction/domain/connection-detection/call-graph/type-resolver.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/call-graph/type-resolver.js +28 -12
- package/dist/features/extraction/domain/connection-detection/component-index.d.ts +3 -1
- package/dist/features/extraction/domain/connection-detection/component-index.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/component-index.js +9 -3
- package/dist/features/extraction/domain/connection-detection/connection-detection-error.d.ts +1 -1
- package/dist/features/extraction/domain/connection-detection/connection-detection-error.js +1 -1
- package/dist/features/extraction/domain/connection-detection/connection-detection-values.d.ts +115 -0
- package/dist/features/extraction/domain/connection-detection/connection-detection-values.d.ts.map +1 -0
- package/dist/features/extraction/domain/connection-detection/connection-detection-values.js +96 -0
- package/dist/features/extraction/domain/connection-detection/detect-connections.d.ts +4 -61
- package/dist/features/extraction/domain/connection-detection/detect-connections.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/detect-connections.js +26 -29
- package/dist/features/extraction/domain/connection-detection/extracted-link.d.ts +14 -2
- package/dist/features/extraction/domain/connection-detection/extracted-link.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/extracted-link.js +15 -1
- package/dist/features/extraction/domain/connection-detection/http-link-resolution-result.d.ts +13 -0
- package/dist/features/extraction/domain/connection-detection/http-link-resolution-result.d.ts.map +1 -0
- package/dist/features/extraction/domain/connection-detection/http-link-resolution-result.js +9 -0
- package/dist/features/extraction/domain/connection-detection/interface-resolution/resolve-interface.d.ts +13 -11
- package/dist/features/extraction/domain/connection-detection/interface-resolution/resolve-interface.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/interface-resolution/resolve-interface.js +34 -10
- package/dist/features/extraction/domain/connection-detection/resolve-http-links.d.ts +3 -8
- package/dist/features/extraction/domain/connection-detection/resolve-http-links.d.ts.map +1 -1
- package/dist/features/extraction/domain/connection-detection/resolve-http-links.js +13 -8
- package/dist/features/extraction/domain/value-extraction/enrich-components.d.ts +4 -29
- package/dist/features/extraction/domain/value-extraction/enrich-components.d.ts.map +1 -1
- package/dist/features/extraction/domain/value-extraction/enrich-components.js +27 -28
- package/dist/features/extraction/domain/value-extraction/enriched-component.d.ts +52 -0
- package/dist/features/extraction/domain/value-extraction/enriched-component.d.ts.map +1 -0
- package/dist/features/extraction/domain/value-extraction/enriched-component.js +39 -0
- package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-generic.d.ts +2 -5
- package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-generic.d.ts.map +1 -1
- package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-generic.js +3 -2
- package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-method.d.ts +1 -16
- package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-method.d.ts.map +1 -1
- package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-method.js +11 -10
- package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule.d.ts +2 -10
- package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule.d.ts.map +1 -1
- package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule.js +18 -17
- package/dist/features/extraction/domain/value-extraction/extraction-result.d.ts +19 -0
- package/dist/features/extraction/domain/value-extraction/extraction-result.d.ts.map +1 -0
- package/dist/features/extraction/domain/value-extraction/extraction-result.js +14 -0
- package/dist/features/extraction/domain/value-extraction/index.d.ts +2 -1
- package/dist/features/extraction/domain/value-extraction/index.d.ts.map +1 -1
- package/dist/features/extraction/domain/value-extraction/index.js +1 -1
- package/dist/features/extraction/domain/value-extraction/method-extraction-result.d.ts +31 -0
- package/dist/features/extraction/domain/value-extraction/method-extraction-result.d.ts.map +1 -0
- package/dist/features/extraction/domain/value-extraction/method-extraction-result.js +25 -0
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/platform/domain/ast-literals/literal-detection.d.ts +11 -15
- package/dist/platform/domain/ast-literals/literal-detection.d.ts.map +1 -1
- package/dist/platform/domain/ast-literals/literal-detection.js +21 -12
- package/package.json +3 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @riviere-role value-object */
|
|
2
|
+
export declare class DraftComponent {
|
|
3
|
+
private brand;
|
|
4
|
+
readonly type: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly location: {
|
|
7
|
+
file: string;
|
|
8
|
+
line: number;
|
|
9
|
+
};
|
|
10
|
+
readonly domain: string;
|
|
11
|
+
readonly module: string;
|
|
12
|
+
constructor(params: {
|
|
13
|
+
type: string;
|
|
14
|
+
name: string;
|
|
15
|
+
location: {
|
|
16
|
+
file: string;
|
|
17
|
+
line: number;
|
|
18
|
+
};
|
|
19
|
+
domain: string;
|
|
20
|
+
module: string;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=draft-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-component.d.ts","sourceRoot":"","sources":["../../../../../src/features/extraction/domain/component-extraction/draft-component.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,qBAAa,cAAc;IACzB,QAAgB,KAAK,CAAkB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE;QACjB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBAEX,MAAM,EAAE;QAClB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAA;YACZ,IAAI,EAAE,MAAM,CAAA;SACb,CAAA;QACD,MAAM,EAAE,MAAM,CAAA;QACd,MAAM,EAAE,MAAM,CAAA;KACf;CAOF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @riviere-role value-object */
|
|
2
|
+
export class DraftComponent {
|
|
3
|
+
type;
|
|
4
|
+
name;
|
|
5
|
+
location;
|
|
6
|
+
domain;
|
|
7
|
+
module;
|
|
8
|
+
constructor(params) {
|
|
9
|
+
this.type = params.type;
|
|
10
|
+
this.name = params.name;
|
|
11
|
+
this.location = params.location;
|
|
12
|
+
this.domain = params.domain;
|
|
13
|
+
this.module = params.module;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { type Project } from 'ts-morph';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export type GlobMatcher = (path: string, pattern: string) => boolean;
|
|
5
|
-
/** @riviere-role value-object */
|
|
6
|
-
export interface DraftComponent {
|
|
7
|
-
type: string;
|
|
8
|
-
name: string;
|
|
9
|
-
location: {
|
|
10
|
-
file: string;
|
|
11
|
-
line: number;
|
|
12
|
-
};
|
|
13
|
-
domain: string;
|
|
14
|
-
module: string;
|
|
15
|
-
}
|
|
2
|
+
import type { Module } from '@living-architecture/riviere-extract-config';
|
|
3
|
+
import { DraftComponent } from './draft-component';
|
|
16
4
|
/** @riviere-role domain-service */
|
|
17
|
-
export declare function extractComponents(project: Project, sourceFilePaths: string[],
|
|
5
|
+
export declare function extractComponents(project: Project, sourceFilePaths: string[], module: Module): DraftComponent[];
|
|
18
6
|
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../../../src/features/extraction/domain/component-extraction/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,OAAO,EAEb,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../../../src/features/extraction/domain/component-extraction/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,OAAO,EAEb,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAEV,MAAM,EAEP,MAAM,6CAA6C,CAAA;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAWlD,mCAAmC;AACnC,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,MAAM,EAAE,EACzB,MAAM,EAAE,MAAM,GACb,cAAc,EAAE,CAElB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Scope, } from 'ts-morph';
|
|
2
|
-
import { posix } from 'node:path';
|
|
3
2
|
import { evaluatePredicate } from '../predicate-evaluation/evaluate-predicate';
|
|
3
|
+
import { DraftComponent } from './draft-component';
|
|
4
4
|
const COMPONENT_TYPES = [
|
|
5
5
|
'api',
|
|
6
6
|
'useCase',
|
|
@@ -10,19 +10,15 @@ const COMPONENT_TYPES = [
|
|
|
10
10
|
'ui',
|
|
11
11
|
];
|
|
12
12
|
/** @riviere-role domain-service */
|
|
13
|
-
export function extractComponents(project, sourceFilePaths,
|
|
14
|
-
return sourceFilePaths.flatMap((filePath) => extractFromFile(project, filePath,
|
|
13
|
+
export function extractComponents(project, sourceFilePaths, module) {
|
|
14
|
+
return sourceFilePaths.flatMap((filePath) => extractFromFile(project, filePath, module));
|
|
15
15
|
}
|
|
16
|
-
function extractFromFile(project, filePath,
|
|
16
|
+
function extractFromFile(project, filePath, module) {
|
|
17
17
|
const sourceFile = project.getSourceFile(filePath);
|
|
18
18
|
if (sourceFile === undefined) {
|
|
19
19
|
return [];
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
if (matchingModule === undefined) {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
return extractFromModule(sourceFile, filePath, matchingModule);
|
|
21
|
+
return extractFromModule(sourceFile, filePath, module);
|
|
26
22
|
}
|
|
27
23
|
function extractFromModule(sourceFile, filePath, module) {
|
|
28
24
|
const context = resolveComponentContext(filePath, module);
|
|
@@ -118,7 +114,7 @@ function createClassComponent(classDecl, filePath, context, componentType) {
|
|
|
118
114
|
return [];
|
|
119
115
|
}
|
|
120
116
|
return [
|
|
121
|
-
{
|
|
117
|
+
new DraftComponent({
|
|
122
118
|
type: componentType,
|
|
123
119
|
name,
|
|
124
120
|
location: {
|
|
@@ -127,13 +123,13 @@ function createClassComponent(classDecl, filePath, context, componentType) {
|
|
|
127
123
|
},
|
|
128
124
|
domain: context.domain,
|
|
129
125
|
module: context.module,
|
|
130
|
-
},
|
|
126
|
+
}),
|
|
131
127
|
];
|
|
132
128
|
}
|
|
133
129
|
function createMethodComponent(method, filePath, context, componentType) {
|
|
134
130
|
const name = method.getName();
|
|
135
131
|
return [
|
|
136
|
-
{
|
|
132
|
+
new DraftComponent({
|
|
137
133
|
type: componentType,
|
|
138
134
|
name,
|
|
139
135
|
location: {
|
|
@@ -142,7 +138,7 @@ function createMethodComponent(method, filePath, context, componentType) {
|
|
|
142
138
|
},
|
|
143
139
|
domain: context.domain,
|
|
144
140
|
module: context.module,
|
|
145
|
-
},
|
|
141
|
+
}),
|
|
146
142
|
];
|
|
147
143
|
}
|
|
148
144
|
function createFunctionComponent(func, filePath, context, componentType) {
|
|
@@ -151,7 +147,7 @@ function createFunctionComponent(func, filePath, context, componentType) {
|
|
|
151
147
|
return [];
|
|
152
148
|
}
|
|
153
149
|
return [
|
|
154
|
-
{
|
|
150
|
+
new DraftComponent({
|
|
155
151
|
type: componentType,
|
|
156
152
|
name,
|
|
157
153
|
location: {
|
|
@@ -160,15 +156,6 @@ function createFunctionComponent(func, filePath, context, componentType) {
|
|
|
160
156
|
},
|
|
161
157
|
domain: context.domain,
|
|
162
158
|
module: context.module,
|
|
163
|
-
},
|
|
159
|
+
}),
|
|
164
160
|
];
|
|
165
161
|
}
|
|
166
|
-
function findMatchingModule(filePath, modules, globMatcher, configDir) {
|
|
167
|
-
const normalized = filePath.replaceAll(/\\+/g, '/');
|
|
168
|
-
if (configDir === undefined) {
|
|
169
|
-
return modules.find((m) => globMatcher(normalized, posix.join(m.path, m.glob)));
|
|
170
|
-
}
|
|
171
|
-
const normalizedConfigDir = configDir.replaceAll(/\\+/g, '/');
|
|
172
|
-
const pathToMatch = posix.relative(normalizedConfigDir, normalized);
|
|
173
|
-
return modules.find((m) => globMatcher(pathToMatch, posix.join(m.path, m.glob)));
|
|
174
|
-
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/** @riviere-role
|
|
2
|
-
export declare class ConfigLoaderRequiredError extends Error {
|
|
3
|
-
readonly moduleName: string;
|
|
4
|
-
constructor(moduleName: string);
|
|
5
|
-
}
|
|
6
|
-
/** @riviere-role value-object */
|
|
1
|
+
/** @riviere-role domain-error */
|
|
7
2
|
export declare class MissingComponentRuleError extends Error {
|
|
8
3
|
readonly moduleName: string;
|
|
9
4
|
readonly ruleName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-resolution-errors.d.ts","sourceRoot":"","sources":["../../../../../src/features/extraction/domain/config-resolution/config-resolution-errors.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"config-resolution-errors.d.ts","sourceRoot":"","sources":["../../../../../src/features/extraction/domain/config-resolution/config-resolution-errors.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;gBAEb,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CASjD"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
/** @riviere-role
|
|
2
|
-
export class ConfigLoaderRequiredError extends Error {
|
|
3
|
-
moduleName;
|
|
4
|
-
constructor(moduleName) {
|
|
5
|
-
super(`Module '${moduleName}' uses extends but no config loader was provided.`);
|
|
6
|
-
this.name = 'ConfigLoaderRequiredError';
|
|
7
|
-
this.moduleName = moduleName;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
/** @riviere-role value-object */
|
|
1
|
+
/** @riviere-role domain-error */
|
|
11
2
|
export class MissingComponentRuleError extends Error {
|
|
12
3
|
moduleName;
|
|
13
4
|
ruleName;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { ExtractionConfig, ResolvedExtractionConfig
|
|
2
|
-
/** @riviere-role value-object */
|
|
3
|
-
export type ConfigLoader = (source: string) => Module;
|
|
1
|
+
import type { ExtractionConfig, ResolvedExtractionConfig } from '@living-architecture/riviere-extract-config';
|
|
4
2
|
/** @riviere-role domain-service */
|
|
5
|
-
export declare function resolveConfig(config: ExtractionConfig
|
|
3
|
+
export declare function resolveConfig(config: ExtractionConfig): ResolvedExtractionConfig;
|
|
6
4
|
//# sourceMappingURL=resolve-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-config.d.ts","sourceRoot":"","sources":["../../../../../src/features/extraction/domain/config-resolution/resolve-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"resolve-config.d.ts","sourceRoot":"","sources":["../../../../../src/features/extraction/domain/config-resolution/resolve-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EAIzB,MAAM,6CAA6C,CAAA;AAGpD,mCAAmC;AACnC,wBAAgB,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,wBAAwB,CAKhF"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MissingComponentRuleError } from './config-resolution-errors';
|
|
2
2
|
/** @riviere-role domain-service */
|
|
3
|
-
export function resolveConfig(config
|
|
3
|
+
export function resolveConfig(config) {
|
|
4
4
|
return {
|
|
5
5
|
...config,
|
|
6
|
-
modules: config.modules.map(
|
|
6
|
+
modules: config.modules.map(resolveModule),
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
function resolveModule(moduleConfig
|
|
10
|
-
const extendsSource = moduleConfig.extends;
|
|
11
|
-
if (extendsSource !== undefined) {
|
|
12
|
-
return resolveModuleWithExtends(moduleConfig, extendsSource, loader);
|
|
13
|
-
}
|
|
9
|
+
function resolveModule(moduleConfig) {
|
|
14
10
|
return {
|
|
15
11
|
name: moduleConfig.name,
|
|
16
12
|
domain: moduleConfig.domain,
|
|
@@ -26,36 +22,6 @@ function resolveModule(moduleConfig, loader) {
|
|
|
26
22
|
...(moduleConfig.customTypes !== undefined && { customTypes: moduleConfig.customTypes }),
|
|
27
23
|
};
|
|
28
24
|
}
|
|
29
|
-
function resolveModuleWithExtends(moduleConfig, extendsSource, loader) {
|
|
30
|
-
if (loader === undefined) {
|
|
31
|
-
throw new ConfigLoaderRequiredError(moduleConfig.name);
|
|
32
|
-
}
|
|
33
|
-
const baseModule = loader(extendsSource);
|
|
34
|
-
const mergedCustomTypes = mergeCustomTypes(baseModule.customTypes, moduleConfig.customTypes);
|
|
35
|
-
return {
|
|
36
|
-
name: moduleConfig.name,
|
|
37
|
-
domain: moduleConfig.domain,
|
|
38
|
-
path: moduleConfig.path,
|
|
39
|
-
glob: moduleConfig.glob,
|
|
40
|
-
...(moduleConfig.modules !== undefined && { modules: moduleConfig.modules }),
|
|
41
|
-
api: moduleConfig.api ?? baseModule.api,
|
|
42
|
-
useCase: moduleConfig.useCase ?? baseModule.useCase,
|
|
43
|
-
domainOp: moduleConfig.domainOp ?? baseModule.domainOp,
|
|
44
|
-
event: moduleConfig.event ?? baseModule.event,
|
|
45
|
-
eventHandler: moduleConfig.eventHandler ?? baseModule.eventHandler,
|
|
46
|
-
ui: moduleConfig.ui ?? baseModule.ui,
|
|
47
|
-
...(mergedCustomTypes !== undefined && { customTypes: mergedCustomTypes }),
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function mergeCustomTypes(base, local) {
|
|
51
|
-
if (base === undefined && local === undefined) {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
...base,
|
|
56
|
-
...local,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
25
|
function requireRule(rule, ruleName, moduleName) {
|
|
60
26
|
if (rule === undefined) {
|
|
61
27
|
throw new MissingComponentRuleError(moduleName, ruleName);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @riviere-role value-object */
|
|
2
|
+
export declare class AsyncDetectionOptions {
|
|
3
|
+
private brand;
|
|
4
|
+
readonly strict: boolean;
|
|
5
|
+
readonly repository: string;
|
|
6
|
+
constructor(params: {
|
|
7
|
+
strict: boolean;
|
|
8
|
+
repository: string;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=async-detection-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-detection-options.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/async-detection/async-detection-options.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,qBAAa,qBAAqB;IAChC,QAAgB,KAAK,CAAyB;IAC9C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;gBAEf,MAAM,EAAE;QAClB,MAAM,EAAE,OAAO,CAAC;QAChB,UAAU,EAAE,MAAM,CAAA;KACnB;CAIF"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { SourceLocation } from '@living-architecture/riviere-schema';
|
|
2
|
-
import type { EnrichedComponent } from '../../value-extraction/
|
|
3
|
-
/** @riviere-role value-object */
|
|
4
|
-
export interface AsyncDetectionOptions {
|
|
5
|
-
strict: boolean;
|
|
6
|
-
repository: string;
|
|
7
|
-
}
|
|
2
|
+
import type { EnrichedComponent } from '../../value-extraction/enriched-component';
|
|
8
3
|
/** @riviere-role domain-service */
|
|
9
4
|
export declare function toSourceLocation(component: EnrichedComponent, repository: string): SourceLocation;
|
|
10
5
|
//# sourceMappingURL=async-detection-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-detection-types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/async-detection/async-detection-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"async-detection-types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/async-detection/async-detection-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAElF,mCAAmC;AACnC,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAMjG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EventPublisherConfig } from '@living-architecture/riviere-extract-config';
|
|
2
|
-
import type { EnrichedComponent } from '../../value-extraction/
|
|
3
|
-
import
|
|
4
|
-
import type { AsyncDetectionOptions } from './async-detection-
|
|
2
|
+
import type { EnrichedComponent } from '../../value-extraction/enriched-component';
|
|
3
|
+
import { ExtractedLink } from '../extracted-link';
|
|
4
|
+
import type { AsyncDetectionOptions } from './async-detection-options';
|
|
5
5
|
/** @riviere-role domain-service */
|
|
6
6
|
export declare function detectEventPublisherConnections(components: readonly EnrichedComponent[], eventPublishers: readonly EventPublisherConfig[], options: AsyncDetectionOptions): ExtractedLink[];
|
|
7
7
|
//# sourceMappingURL=detect-event-publisher-connections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-event-publisher-connections.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/async-detection/detect-event-publisher-connections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAA;AAEvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"detect-event-publisher-connections.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/async-detection/detect-event-publisher-connections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAA;AAEvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAGtE,mCAAmC;AACnC,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,SAAS,iBAAiB,EAAE,EACxC,eAAe,EAAE,SAAS,oBAAoB,EAAE,EAChD,OAAO,EAAE,qBAAqB,GAC7B,aAAa,EAAE,CAgCjB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EVENT_NAME_FIELD } from '@living-architecture/riviere-schema';
|
|
2
|
+
import { ExtractedLink } from '../extracted-link';
|
|
2
3
|
import { ConnectionDetectionError } from '../connection-detection-error';
|
|
3
|
-
import { componentIdentity } from '../call-graph/
|
|
4
|
+
import { componentIdentity } from '../call-graph/component-identity';
|
|
4
5
|
import { toSourceLocation } from './async-detection-types';
|
|
5
6
|
/** @riviere-role domain-service */
|
|
6
7
|
export function detectEventPublisherConnections(components, eventPublishers, options) {
|
|
@@ -36,13 +37,13 @@ function handleMissingMetadata(publisher, metadataKey, options) {
|
|
|
36
37
|
reason: `published event type in "${metadataKey}" metadata is missing or invalid`,
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
|
-
return {
|
|
40
|
+
return new ExtractedLink({
|
|
40
41
|
source: componentIdentity(publisher),
|
|
41
42
|
target: '_unresolved',
|
|
42
43
|
type: 'async',
|
|
43
44
|
sourceLocation: toSourceLocation(publisher, options.repository),
|
|
44
45
|
_uncertain: `event publisher "${publisher.name}" is missing required "${metadataKey}" metadata`,
|
|
45
|
-
};
|
|
46
|
+
});
|
|
46
47
|
}
|
|
47
48
|
function resolvePublishTarget(publisher, publishedEventType, events, options) {
|
|
48
49
|
const matchingEvents = events.filter((e) => e.metadata[EVENT_NAME_FIELD] === publishedEventType);
|
|
@@ -52,7 +53,7 @@ function resolvePublishTarget(publisher, publishedEventType, events, options) {
|
|
|
52
53
|
if (matchingEvents.length > 1) {
|
|
53
54
|
return [handleAmbiguousMatch(publisher, publishedEventType, matchingEvents.length, options)];
|
|
54
55
|
}
|
|
55
|
-
return matchingEvents.map((event) => ({
|
|
56
|
+
return matchingEvents.map((event) => new ExtractedLink({
|
|
56
57
|
source: componentIdentity(publisher),
|
|
57
58
|
target: componentIdentity(event),
|
|
58
59
|
type: 'async',
|
|
@@ -68,13 +69,13 @@ function handleAmbiguousMatch(publisher, publishedEventType, matchCount, options
|
|
|
68
69
|
reason: `published event "${publishedEventType}" matches ${matchCount} Event components (ambiguous)`,
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
|
-
return {
|
|
72
|
+
return new ExtractedLink({
|
|
72
73
|
source: componentIdentity(publisher),
|
|
73
74
|
target: '_unresolved',
|
|
74
75
|
type: 'async',
|
|
75
76
|
sourceLocation: toSourceLocation(publisher, options.repository),
|
|
76
77
|
_uncertain: `ambiguous: ${matchCount} events match published event type: ${publishedEventType}`,
|
|
77
|
-
};
|
|
78
|
+
});
|
|
78
79
|
}
|
|
79
80
|
function handleNoMatch(publisher, publishedEventType, options) {
|
|
80
81
|
if (options.strict) {
|
|
@@ -85,11 +86,11 @@ function handleNoMatch(publisher, publishedEventType, options) {
|
|
|
85
86
|
reason: `published event "${publishedEventType}" does not match any Event component`,
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
|
-
return {
|
|
89
|
+
return new ExtractedLink({
|
|
89
90
|
source: componentIdentity(publisher),
|
|
90
91
|
target: '_unresolved',
|
|
91
92
|
type: 'async',
|
|
92
93
|
sourceLocation: toSourceLocation(publisher, options.repository),
|
|
93
94
|
_uncertain: `no event found for published event type: ${publishedEventType}`,
|
|
94
|
-
};
|
|
95
|
+
});
|
|
95
96
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { EnrichedComponent } from '../../value-extraction/
|
|
2
|
-
import
|
|
3
|
-
import type { AsyncDetectionOptions } from './async-detection-
|
|
1
|
+
import type { EnrichedComponent } from '../../value-extraction/enriched-component';
|
|
2
|
+
import { ExtractedLink } from '../extracted-link';
|
|
3
|
+
import type { AsyncDetectionOptions } from './async-detection-options';
|
|
4
4
|
/** @riviere-role domain-service */
|
|
5
5
|
export declare function detectSubscribeConnections(components: readonly EnrichedComponent[], options: AsyncDetectionOptions): ExtractedLink[];
|
|
6
6
|
//# sourceMappingURL=detect-subscribe-connections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-subscribe-connections.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/async-detection/detect-subscribe-connections.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"detect-subscribe-connections.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/async-detection/detect-subscribe-connections.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAGtE,mCAAmC;AACnC,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,SAAS,iBAAiB,EAAE,EACxC,OAAO,EAAE,qBAAqB,GAC7B,aAAa,EAAE,CAUjB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EVENT_NAME_FIELD, SUBSCRIBED_EVENTS_FIELD } from '@living-architecture/riviere-schema';
|
|
2
|
+
import { ExtractedLink } from '../extracted-link';
|
|
2
3
|
import { ConnectionDetectionError } from '../connection-detection-error';
|
|
3
|
-
import { componentIdentity } from '../call-graph/
|
|
4
|
+
import { componentIdentity } from '../call-graph/component-identity';
|
|
4
5
|
import { toSourceLocation } from './async-detection-types';
|
|
5
6
|
/** @riviere-role domain-service */
|
|
6
7
|
export function detectSubscribeConnections(components, options) {
|
|
@@ -17,7 +18,7 @@ function resolveSubscription(handler, eventName, events, options, repository) {
|
|
|
17
18
|
if (matchingEvents.length > 1) {
|
|
18
19
|
return [handleAmbiguousMatch(handler, eventName, matchingEvents.length, options, repository)];
|
|
19
20
|
}
|
|
20
|
-
return matchingEvents.map((event) => ({
|
|
21
|
+
return matchingEvents.map((event) => new ExtractedLink({
|
|
21
22
|
source: componentIdentity(event),
|
|
22
23
|
target: componentIdentity(handler),
|
|
23
24
|
type: 'async',
|
|
@@ -33,13 +34,13 @@ function handleAmbiguousMatch(handler, eventName, matchCount, options, repositor
|
|
|
33
34
|
reason: `subscribed event "${eventName}" matches ${matchCount} Event components (ambiguous)`,
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
return {
|
|
37
|
+
return new ExtractedLink({
|
|
37
38
|
source: '_unresolved',
|
|
38
39
|
target: componentIdentity(handler),
|
|
39
40
|
type: 'async',
|
|
40
41
|
sourceLocation: toSourceLocation(handler, repository),
|
|
41
42
|
_uncertain: `ambiguous: ${matchCount} events match subscribed event name: ${eventName}`,
|
|
42
|
-
};
|
|
43
|
+
});
|
|
43
44
|
}
|
|
44
45
|
function handleNoMatch(handler, eventName, options, repository) {
|
|
45
46
|
if (options.strict) {
|
|
@@ -50,13 +51,13 @@ function handleNoMatch(handler, eventName, options, repository) {
|
|
|
50
51
|
reason: `subscribed event "${eventName}" does not match any Event component`,
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
return {
|
|
54
|
+
return new ExtractedLink({
|
|
54
55
|
source: '_unresolved',
|
|
55
56
|
target: componentIdentity(handler),
|
|
56
57
|
type: 'async',
|
|
57
58
|
sourceLocation: toSourceLocation(handler, repository),
|
|
58
59
|
_uncertain: `no event found for subscribed event name: ${eventName}`,
|
|
59
|
-
};
|
|
60
|
+
});
|
|
60
61
|
}
|
|
61
62
|
function getSubscribedEvents(handler) {
|
|
62
63
|
const raw = handler.metadata[SUBSCRIBED_EVENTS_FIELD];
|
package/dist/features/extraction/domain/connection-detection/call-graph/build-call-graph.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Project } from 'ts-morph';
|
|
2
|
-
import type { EnrichedComponent } from '../../value-extraction/
|
|
2
|
+
import type { EnrichedComponent } from '../../value-extraction/enriched-component';
|
|
3
3
|
import type { ComponentIndex } from '../component-index';
|
|
4
4
|
import type { ExtractedLink } from '../extracted-link';
|
|
5
|
-
import
|
|
5
|
+
import { CallGraphOptions } from './call-graph-types';
|
|
6
6
|
/** @riviere-role domain-service */
|
|
7
7
|
export declare function buildCallGraph(project: Project, components: readonly EnrichedComponent[], componentIndex: ComponentIndex, options: CallGraphOptions): ExtractedLink[];
|
|
8
8
|
//# sourceMappingURL=build-call-graph.d.ts.map
|
package/dist/features/extraction/domain/connection-detection/call-graph/build-call-graph.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-call-graph.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/call-graph/build-call-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,OAAO,EAEb,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"build-call-graph.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/call-graph/build-call-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,OAAO,EAEb,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EACL,gBAAgB,EACjB,MAAM,oBAAoB,CAAA;AA6K3B,mCAAmC;AACnC,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,SAAS,iBAAiB,EAAE,EACxC,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,gBAAgB,GACxB,aAAa,EAAE,CA0CjB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Node, SyntaxKind, } from 'ts-morph';
|
|
2
|
-
import {
|
|
2
|
+
import { CallGraphOptions, CallSite, RawLink, UncertainRawLink } from './call-graph-types';
|
|
3
|
+
import { componentIdentity } from './component-identity';
|
|
3
4
|
import { findClassInProject, findFunctionInProject, findMethodLevelComponent, traceCallsInBody, } from './trace-calls';
|
|
4
5
|
import { deduplicateLinks } from './deduplicate-links';
|
|
5
6
|
import { resolveCallExpressionReceiverType } from './type-resolver';
|
|
@@ -10,45 +11,55 @@ function processCallExpression(callExpr, component, methodName, project, compone
|
|
|
10
11
|
}
|
|
11
12
|
const sourceFile = callExpr.getSourceFile();
|
|
12
13
|
const typeResult = resolveCallExpressionReceiverType(callExpr, sourceFile, { strict: options.strict, });
|
|
13
|
-
const currentCallSite = {
|
|
14
|
+
const currentCallSite = new CallSite({
|
|
14
15
|
filePath: component.location.file,
|
|
15
16
|
lineNumber: callExpr.getStartLineNumber(),
|
|
16
17
|
methodName,
|
|
17
|
-
};
|
|
18
|
+
});
|
|
18
19
|
if (!typeResult.resolved) {
|
|
19
|
-
uncertainLinks.push({
|
|
20
|
+
uncertainLinks.push(new UncertainRawLink({
|
|
20
21
|
source: component,
|
|
21
|
-
reason: typeResult.reason,
|
|
22
|
+
reason: typeResult.reason ?? 'Receiver type unresolved',
|
|
22
23
|
callSite: currentCallSite,
|
|
23
|
-
});
|
|
24
|
+
}));
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
|
-
const typeName = typeResult
|
|
27
|
+
const typeName = requireResolvedTypeName(typeResult);
|
|
27
28
|
const calledMethodName = getCalledMethodName(callExpr);
|
|
28
|
-
const
|
|
29
|
+
const interfaceResolution = resolveTypeThroughInterface(typeName, project, componentIndex, options);
|
|
30
|
+
const targetComponent = interfaceResolution.component;
|
|
31
|
+
const resolvedTypeName = interfaceResolution.resolvedTypeName;
|
|
32
|
+
const uncertain = interfaceResolution.uncertain;
|
|
29
33
|
if (targetComponent !== undefined) {
|
|
30
34
|
if (componentIdentity(component) !== componentIdentity(targetComponent)) {
|
|
31
|
-
rawLinks.push({
|
|
35
|
+
rawLinks.push(new RawLink({
|
|
32
36
|
source: component,
|
|
33
37
|
target: targetComponent,
|
|
34
38
|
callSite: currentCallSite,
|
|
35
|
-
});
|
|
39
|
+
}));
|
|
36
40
|
}
|
|
37
41
|
return;
|
|
38
42
|
}
|
|
39
43
|
const containerTarget = resolveContainerMethod(project, resolvedTypeName ?? typeName, calledMethodName, componentIndex);
|
|
40
44
|
if (containerTarget !== undefined) {
|
|
41
45
|
if (componentIdentity(component) !== componentIdentity(containerTarget)) {
|
|
42
|
-
rawLinks.push({
|
|
46
|
+
rawLinks.push(new RawLink({
|
|
43
47
|
source: component,
|
|
44
48
|
target: containerTarget,
|
|
45
49
|
callSite: currentCallSite,
|
|
46
|
-
});
|
|
50
|
+
}));
|
|
47
51
|
}
|
|
48
52
|
return;
|
|
49
53
|
}
|
|
50
54
|
traceNonComponent(project, componentIndex, component, resolvedTypeName ?? typeName, calledMethodName, currentCallSite, rawLinks, uncertainLinks, uncertain, options);
|
|
51
55
|
}
|
|
56
|
+
function requireResolvedTypeName(typeResolution) {
|
|
57
|
+
const typeName = typeResolution.typeName;
|
|
58
|
+
if (typeName === undefined) {
|
|
59
|
+
throw new TypeError('Expected resolved type name');
|
|
60
|
+
}
|
|
61
|
+
return typeName;
|
|
62
|
+
}
|
|
52
63
|
function processFunction(funcDecl, component, project, componentIndex, rawLinks, uncertainLinks, options) {
|
|
53
64
|
const functionName = funcDecl.getNameOrThrow();
|
|
54
65
|
const callExpressions = funcDecl.getDescendantsOfKind(SyntaxKind.CallExpression);
|
|
@@ -96,10 +107,10 @@ function traceNonComponent(project, componentIndex, source, typeName, calledMeth
|
|
|
96
107
|
return;
|
|
97
108
|
}
|
|
98
109
|
if (!classFound && interfaceUncertainty !== undefined) {
|
|
99
|
-
uncertainLinks.push({
|
|
110
|
+
uncertainLinks.push(new UncertainRawLink({
|
|
100
111
|
source,
|
|
101
112
|
reason: interfaceUncertainty,
|
|
102
113
|
callSite,
|
|
103
|
-
});
|
|
114
|
+
}));
|
|
104
115
|
}
|
|
105
116
|
}
|
package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Project } from 'ts-morph';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { EnrichedComponent } from '../../value-extraction/enriched-component';
|
|
3
|
+
import { CallGraphOptions } from './call-graph-types';
|
|
4
4
|
export declare const sharedProject: Project;
|
|
5
5
|
export declare function nextFile(content: string): string;
|
|
6
6
|
export declare function buildComponent(name: string, file: string, line: number, overrides?: Partial<EnrichedComponent>): EnrichedComponent;
|
package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-graph-fixtures.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"call-graph-fixtures.d.ts","sourceRoot":"","sources":["../../../../../../src/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,eAAO,MAAM,aAAa,SAOxB,CAAA;AAIF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,OAAO,CAAC,iBAAiB,CAAM,GACzC,iBAAiB,CAcnB;AAED,wBAAgB,cAAc,IAAI,gBAAgB,CAMjD"}
|
package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Project } from 'ts-morph';
|
|
2
|
+
import { EnrichedComponent } from '../../value-extraction/enriched-component';
|
|
3
|
+
import { CallGraphOptions } from './call-graph-types';
|
|
2
4
|
export const sharedProject = new Project({
|
|
3
5
|
useInMemoryFileSystem: true,
|
|
4
6
|
compilerOptions: {
|
|
@@ -15,7 +17,7 @@ export function nextFile(content) {
|
|
|
15
17
|
return filePath;
|
|
16
18
|
}
|
|
17
19
|
export function buildComponent(name, file, line, overrides = {}) {
|
|
18
|
-
return {
|
|
20
|
+
return new EnrichedComponent({
|
|
19
21
|
type: 'useCase',
|
|
20
22
|
name,
|
|
21
23
|
location: {
|
|
@@ -25,13 +27,14 @@ export function buildComponent(name, file, line, overrides = {}) {
|
|
|
25
27
|
domain: 'orders',
|
|
26
28
|
module: 'orders-module',
|
|
27
29
|
metadata: {},
|
|
30
|
+
_missing: undefined,
|
|
28
31
|
...overrides,
|
|
29
|
-
};
|
|
32
|
+
});
|
|
30
33
|
}
|
|
31
34
|
export function defaultOptions() {
|
|
32
|
-
return {
|
|
35
|
+
return new CallGraphOptions({
|
|
33
36
|
strict: false,
|
|
34
37
|
sourceFilePaths: sharedProject.getSourceFiles().map((sf) => sf.getFilePath()),
|
|
35
38
|
repository: 'test-repo',
|
|
36
|
-
};
|
|
39
|
+
});
|
|
37
40
|
}
|