@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.
Files changed (110) hide show
  1. package/dist/features/extraction/domain/component-extraction/draft-component.d.ts +23 -0
  2. package/dist/features/extraction/domain/component-extraction/draft-component.d.ts.map +1 -0
  3. package/dist/features/extraction/domain/component-extraction/draft-component.js +15 -0
  4. package/dist/features/extraction/domain/component-extraction/extractor.d.ts +3 -15
  5. package/dist/features/extraction/domain/component-extraction/extractor.d.ts.map +1 -1
  6. package/dist/features/extraction/domain/component-extraction/extractor.js +11 -24
  7. package/dist/features/extraction/domain/config-resolution/config-resolution-errors.d.ts +1 -6
  8. package/dist/features/extraction/domain/config-resolution/config-resolution-errors.d.ts.map +1 -1
  9. package/dist/features/extraction/domain/config-resolution/config-resolution-errors.js +1 -10
  10. package/dist/features/extraction/domain/config-resolution/resolve-config.d.ts +2 -4
  11. package/dist/features/extraction/domain/config-resolution/resolve-config.d.ts.map +1 -1
  12. package/dist/features/extraction/domain/config-resolution/resolve-config.js +4 -38
  13. package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-options.d.ts +11 -0
  14. package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-options.d.ts.map +1 -0
  15. package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-options.js +9 -0
  16. package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-types.d.ts +1 -6
  17. package/dist/features/extraction/domain/connection-detection/async-detection/async-detection-types.d.ts.map +1 -1
  18. package/dist/features/extraction/domain/connection-detection/async-detection/detect-event-publisher-connections.d.ts +3 -3
  19. package/dist/features/extraction/domain/connection-detection/async-detection/detect-event-publisher-connections.d.ts.map +1 -1
  20. package/dist/features/extraction/domain/connection-detection/async-detection/detect-event-publisher-connections.js +9 -8
  21. package/dist/features/extraction/domain/connection-detection/async-detection/detect-subscribe-connections.d.ts +3 -3
  22. package/dist/features/extraction/domain/connection-detection/async-detection/detect-subscribe-connections.d.ts.map +1 -1
  23. package/dist/features/extraction/domain/connection-detection/async-detection/detect-subscribe-connections.js +7 -6
  24. package/dist/features/extraction/domain/connection-detection/call-graph/build-call-graph.d.ts +2 -2
  25. package/dist/features/extraction/domain/connection-detection/call-graph/build-call-graph.d.ts.map +1 -1
  26. package/dist/features/extraction/domain/connection-detection/call-graph/build-call-graph.js +25 -14
  27. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.d.ts +2 -2
  28. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.d.ts.map +1 -1
  29. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-fixtures.js +7 -4
  30. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-outcomes.d.ts +25 -0
  31. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-outcomes.d.ts.map +1 -0
  32. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-outcomes.js +20 -0
  33. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-shared.d.ts +3 -13
  34. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-shared.d.ts.map +1 -1
  35. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-shared.js +21 -12
  36. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-types.d.ts +41 -21
  37. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-types.d.ts.map +1 -1
  38. package/dist/features/extraction/domain/connection-detection/call-graph/call-graph-types.js +41 -15
  39. package/dist/features/extraction/domain/connection-detection/call-graph/component-identity.d.ts +4 -0
  40. package/dist/features/extraction/domain/connection-detection/call-graph/component-identity.d.ts.map +1 -0
  41. package/dist/features/extraction/domain/connection-detection/call-graph/component-identity.js +10 -0
  42. package/dist/features/extraction/domain/connection-detection/call-graph/deduplicate-links.d.ts +1 -1
  43. package/dist/features/extraction/domain/connection-detection/call-graph/deduplicate-links.d.ts.map +1 -1
  44. package/dist/features/extraction/domain/connection-detection/call-graph/deduplicate-links.js +36 -6
  45. package/dist/features/extraction/domain/connection-detection/call-graph/method-level-target.d.ts +12 -0
  46. package/dist/features/extraction/domain/connection-detection/call-graph/method-level-target.d.ts.map +1 -0
  47. package/dist/features/extraction/domain/connection-detection/call-graph/method-level-target.js +9 -0
  48. package/dist/features/extraction/domain/connection-detection/call-graph/trace-calls.d.ts +3 -7
  49. package/dist/features/extraction/domain/connection-detection/call-graph/trace-calls.d.ts.map +1 -1
  50. package/dist/features/extraction/domain/connection-detection/call-graph/trace-calls.js +17 -8
  51. package/dist/features/extraction/domain/connection-detection/call-graph/type-name-normalization.d.ts +3 -0
  52. package/dist/features/extraction/domain/connection-detection/call-graph/type-name-normalization.d.ts.map +1 -0
  53. package/dist/features/extraction/domain/connection-detection/call-graph/type-name-normalization.js +8 -0
  54. package/dist/features/extraction/domain/connection-detection/call-graph/type-resolver.d.ts +9 -10
  55. package/dist/features/extraction/domain/connection-detection/call-graph/type-resolver.d.ts.map +1 -1
  56. package/dist/features/extraction/domain/connection-detection/call-graph/type-resolver.js +28 -12
  57. package/dist/features/extraction/domain/connection-detection/component-index.d.ts +3 -1
  58. package/dist/features/extraction/domain/connection-detection/component-index.d.ts.map +1 -1
  59. package/dist/features/extraction/domain/connection-detection/component-index.js +9 -3
  60. package/dist/features/extraction/domain/connection-detection/connection-detection-error.d.ts +1 -1
  61. package/dist/features/extraction/domain/connection-detection/connection-detection-error.js +1 -1
  62. package/dist/features/extraction/domain/connection-detection/connection-detection-values.d.ts +115 -0
  63. package/dist/features/extraction/domain/connection-detection/connection-detection-values.d.ts.map +1 -0
  64. package/dist/features/extraction/domain/connection-detection/connection-detection-values.js +96 -0
  65. package/dist/features/extraction/domain/connection-detection/detect-connections.d.ts +4 -61
  66. package/dist/features/extraction/domain/connection-detection/detect-connections.d.ts.map +1 -1
  67. package/dist/features/extraction/domain/connection-detection/detect-connections.js +26 -29
  68. package/dist/features/extraction/domain/connection-detection/extracted-link.d.ts +14 -2
  69. package/dist/features/extraction/domain/connection-detection/extracted-link.d.ts.map +1 -1
  70. package/dist/features/extraction/domain/connection-detection/extracted-link.js +15 -1
  71. package/dist/features/extraction/domain/connection-detection/http-link-resolution-result.d.ts +13 -0
  72. package/dist/features/extraction/domain/connection-detection/http-link-resolution-result.d.ts.map +1 -0
  73. package/dist/features/extraction/domain/connection-detection/http-link-resolution-result.js +9 -0
  74. package/dist/features/extraction/domain/connection-detection/interface-resolution/resolve-interface.d.ts +13 -11
  75. package/dist/features/extraction/domain/connection-detection/interface-resolution/resolve-interface.d.ts.map +1 -1
  76. package/dist/features/extraction/domain/connection-detection/interface-resolution/resolve-interface.js +34 -10
  77. package/dist/features/extraction/domain/connection-detection/resolve-http-links.d.ts +3 -8
  78. package/dist/features/extraction/domain/connection-detection/resolve-http-links.d.ts.map +1 -1
  79. package/dist/features/extraction/domain/connection-detection/resolve-http-links.js +13 -8
  80. package/dist/features/extraction/domain/value-extraction/enrich-components.d.ts +4 -29
  81. package/dist/features/extraction/domain/value-extraction/enrich-components.d.ts.map +1 -1
  82. package/dist/features/extraction/domain/value-extraction/enrich-components.js +27 -28
  83. package/dist/features/extraction/domain/value-extraction/enriched-component.d.ts +52 -0
  84. package/dist/features/extraction/domain/value-extraction/enriched-component.d.ts.map +1 -0
  85. package/dist/features/extraction/domain/value-extraction/enriched-component.js +39 -0
  86. package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-generic.d.ts +2 -5
  87. package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-generic.d.ts.map +1 -1
  88. package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-generic.js +3 -2
  89. package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-method.d.ts +1 -16
  90. package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-method.d.ts.map +1 -1
  91. package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule-method.js +11 -10
  92. package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule.d.ts +2 -10
  93. package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule.d.ts.map +1 -1
  94. package/dist/features/extraction/domain/value-extraction/evaluate-extraction-rule.js +18 -17
  95. package/dist/features/extraction/domain/value-extraction/extraction-result.d.ts +19 -0
  96. package/dist/features/extraction/domain/value-extraction/extraction-result.d.ts.map +1 -0
  97. package/dist/features/extraction/domain/value-extraction/extraction-result.js +14 -0
  98. package/dist/features/extraction/domain/value-extraction/index.d.ts +2 -1
  99. package/dist/features/extraction/domain/value-extraction/index.d.ts.map +1 -1
  100. package/dist/features/extraction/domain/value-extraction/index.js +1 -1
  101. package/dist/features/extraction/domain/value-extraction/method-extraction-result.d.ts +31 -0
  102. package/dist/features/extraction/domain/value-extraction/method-extraction-result.d.ts.map +1 -0
  103. package/dist/features/extraction/domain/value-extraction/method-extraction-result.js +25 -0
  104. package/dist/index.d.ts +9 -7
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +8 -5
  107. package/dist/platform/domain/ast-literals/literal-detection.d.ts +11 -15
  108. package/dist/platform/domain/ast-literals/literal-detection.d.ts.map +1 -1
  109. package/dist/platform/domain/ast-literals/literal-detection.js +21 -12
  110. 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 { ResolvedExtractionConfig } from '@living-architecture/riviere-extract-config';
3
- /** @riviere-role value-object */
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[], config: ResolvedExtractionConfig, globMatcher: GlobMatcher, configDir?: string): DraftComponent[];
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;AAEjB,OAAO,KAAK,EACV,wBAAwB,EAIzB,MAAM,6CAA6C,CAAA;AAGpD,iCAAiC;AACjC,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAA;AAEpE,iCAAiC;AACjC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAWD,mCAAmC;AACnC,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,MAAM,EAAE,EACzB,MAAM,EAAE,wBAAwB,EAChC,WAAW,EAAE,WAAW,EACxB,SAAS,CAAC,EAAE,MAAM,GACjB,cAAc,EAAE,CAIlB"}
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, config, globMatcher, configDir) {
14
- return sourceFilePaths.flatMap((filePath) => extractFromFile(project, filePath, config, globMatcher, configDir));
13
+ export function extractComponents(project, sourceFilePaths, module) {
14
+ return sourceFilePaths.flatMap((filePath) => extractFromFile(project, filePath, module));
15
15
  }
16
- function extractFromFile(project, filePath, config, globMatcher, configDir) {
16
+ function extractFromFile(project, filePath, module) {
17
17
  const sourceFile = project.getSourceFile(filePath);
18
18
  if (sourceFile === undefined) {
19
19
  return [];
20
20
  }
21
- const matchingModule = findMatchingModule(filePath, config.modules, globMatcher, configDir);
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 value-object */
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;gBAEf,UAAU,EAAE,MAAM;CAK/B;AAED,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
+ {"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 value-object */
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, Module } from '@living-architecture/riviere-extract-config';
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, loader?: ConfigLoader): ResolvedExtractionConfig;
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,EACxB,MAAM,EAGP,MAAM,6CAA6C,CAAA;AAKpD,iCAAiC;AACjC,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;AAErD,mCAAmC;AACnC,wBAAgB,aAAa,CAC3B,MAAM,EAAE,gBAAgB,EACxB,MAAM,CAAC,EAAE,YAAY,GACpB,wBAAwB,CAK1B"}
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 { ConfigLoaderRequiredError, MissingComponentRuleError } from './config-resolution-errors';
1
+ import { MissingComponentRuleError } from './config-resolution-errors';
2
2
  /** @riviere-role domain-service */
3
- export function resolveConfig(config, loader) {
3
+ export function resolveConfig(config) {
4
4
  return {
5
5
  ...config,
6
- modules: config.modules.map((m) => resolveModule(m, loader)),
6
+ modules: config.modules.map(resolveModule),
7
7
  };
8
8
  }
9
- function resolveModule(moduleConfig, loader) {
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"}
@@ -0,0 +1,9 @@
1
+ /** @riviere-role value-object */
2
+ export class AsyncDetectionOptions {
3
+ strict;
4
+ repository;
5
+ constructor(params) {
6
+ this.strict = params.strict;
7
+ this.repository = params.repository;
8
+ }
9
+ }
@@ -1,10 +1,5 @@
1
1
  import type { SourceLocation } from '@living-architecture/riviere-schema';
2
- import type { EnrichedComponent } from '../../value-extraction/enrich-components';
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,0CAA0C,CAAA;AAEjF,iCAAiC;AACjC,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,mCAAmC;AACnC,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAMjG"}
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/enrich-components';
3
- import type { ExtractedLink } from '../extracted-link';
4
- import type { AsyncDetectionOptions } from './async-detection-types';
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,0CAA0C,CAAA;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAGpE,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
+ {"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/call-graph-types';
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/enrich-components';
2
- import type { ExtractedLink } from '../extracted-link';
3
- import type { AsyncDetectionOptions } from './async-detection-types';
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,0CAA0C,CAAA;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAGpE,mCAAmC;AACnC,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,SAAS,iBAAiB,EAAE,EACxC,OAAO,EAAE,qBAAqB,GAC7B,aAAa,EAAE,CAUjB"}
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/call-graph-types';
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];
@@ -1,8 +1,8 @@
1
1
  import { type Project } from 'ts-morph';
2
- import type { EnrichedComponent } from '../../value-extraction/enrich-components';
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 type { CallGraphOptions } from './call-graph-types';
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
@@ -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,0CAA0C,CAAA;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EACV,gBAAgB,EACjB,MAAM,oBAAoB,CAAA;AAwJ3B,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
+ {"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 { componentIdentity } from './call-graph-types';
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.typeName;
27
+ const typeName = requireResolvedTypeName(typeResult);
27
28
  const calledMethodName = getCalledMethodName(callExpr);
28
- const { component: targetComponent, resolvedTypeName, uncertain, } = resolveTypeThroughInterface(typeName, project, componentIndex, options);
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
  }
@@ -1,6 +1,6 @@
1
1
  import { Project } from 'ts-morph';
2
- import type { EnrichedComponent } from '../../value-extraction/enrich-components';
3
- import type { CallGraphOptions } from './call-graph-types';
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;
@@ -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,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,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,CAanB;AAED,wBAAgB,cAAc,IAAI,gBAAgB,CAMjD"}
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"}
@@ -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
  }