@callidescope/core 0.0.0-stage β 0.0.4
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/LICENSE +21 -0
- package/README.md +345 -2
- package/dist/src/index.d.ts +225 -0
- package/dist/src/index.js +30 -0
- package/package.json +57 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jimmy Paolini
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,346 @@
|
|
|
1
|
-
#
|
|
1
|
+
# π Callidescope Core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**The domain vocabulary every other Callidescope package speaks.**
|
|
4
|
+
|
|
5
|
+
This package is the contracts leaf of the Callidescope spine: it declares what a
|
|
6
|
+
run produces β call graphs, stacks, frames, findings β and depends on nothing.
|
|
7
|
+
It holds no service and no NestJS module, so importing a result type never drags
|
|
8
|
+
a configuration loader or a TypeScript program behind it.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install --save-dev @callidescope/core
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What This Package Owns
|
|
15
|
+
|
|
16
|
+
- **`call-graph`** β the result and finding vocabulary: `CallGraphResult`,
|
|
17
|
+
`ProjectReport`, `CallStack`, `StackFrame`, `CallableNode`, `CallEdge`,
|
|
18
|
+
`DeepStackFinding`, `WideCallableFinding`, and the identifiers and locations
|
|
19
|
+
they are built from
|
|
20
|
+
|
|
21
|
+
The sharp test for what belongs here: a type describing **what the tool
|
|
22
|
+
produced** is core; a type describing **what the user wrote in
|
|
23
|
+
`callidescope.config.ts`** belongs in
|
|
24
|
+
[`@callidescope/configuration`](../callidescope-configuration/README.md).
|
|
25
|
+
|
|
26
|
+
## Test
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
nx run callidescope-core:vitest
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## π Conformetry
|
|
33
|
+
|
|
34
|
+
This project was generated from the [nestjs-service-project](../../configuration/conformetry-templates/nestjs-service-project) conformetry template.
|
|
35
|
+
|
|
36
|
+
## πΈοΈ Codependix
|
|
37
|
+
|
|
38
|
+
Dependency graphs exported by [codependix](https://github.com/Organizzolini/codebase/tree/main/packages/ic-suite/codependix/codependix-cli), regenerated by `nx run codebase:codependix:write`.
|
|
39
|
+
|
|
40
|
+
### Nx Neighborhood
|
|
41
|
+
|
|
42
|
+
<!-- codependix:start name="codependix-nx-projects" -->
|
|
43
|
+
```mermaid
|
|
44
|
+
graph LR
|
|
45
|
+
callidescope_cli["callidescope-cli"]
|
|
46
|
+
callidescope_configuration["callidescope-configuration"]
|
|
47
|
+
callidescope_core["callidescope-core"]
|
|
48
|
+
callidescope_examples["callidescope-examples"]
|
|
49
|
+
callidescope_graph["callidescope-graph"]
|
|
50
|
+
callidescope_nx["callidescope-nx"]
|
|
51
|
+
callidescope_output["callidescope-output"]
|
|
52
|
+
callidescope_cli --> callidescope_core
|
|
53
|
+
callidescope_configuration --> callidescope_core
|
|
54
|
+
callidescope_examples --> callidescope_core
|
|
55
|
+
callidescope_graph --> callidescope_core
|
|
56
|
+
callidescope_nx --> callidescope_core
|
|
57
|
+
callidescope_output --> callidescope_core
|
|
58
|
+
classDef subject fill:#7c3aed,color:#fff,stroke:#4c1d95,stroke-width:2px
|
|
59
|
+
class callidescope_core subject
|
|
60
|
+
```
|
|
61
|
+
<!-- codependix:end name="codependix-nx-projects" -->
|
|
62
|
+
|
|
63
|
+
### NestJS Module Graph
|
|
64
|
+
|
|
65
|
+
<!-- codependix:start name="codependix-nestjs-modules" -->
|
|
66
|
+
```mermaid
|
|
67
|
+
flowchart LR
|
|
68
|
+
CallidescopeCoreModule
|
|
69
|
+
```
|
|
70
|
+
<!-- codependix:end name="codependix-nestjs-modules" -->
|
|
71
|
+
|
|
72
|
+
### File Imports
|
|
73
|
+
|
|
74
|
+
<!-- codependix:start name="codependix-file-imports" -->
|
|
75
|
+
```mermaid
|
|
76
|
+
graph LR
|
|
77
|
+
file_callidescope_config_ts["callidescope.config.ts"]
|
|
78
|
+
file_codependix_config_ts["codependix.config.ts"]
|
|
79
|
+
file_codometer_config_ts["codometer.config.ts"]
|
|
80
|
+
file_eslint_config_ts["eslint.config.ts"]
|
|
81
|
+
file_src_index_ts["src/index.ts"]
|
|
82
|
+
file_src_index_unit_test_ts["src/index.unit.test.ts"]
|
|
83
|
+
file_src_modules_callidescope_core_callidescope_core_constants_ts["src/modules/callidescope-core/callidescope-core.constants.ts"]
|
|
84
|
+
file_src_modules_callidescope_core_callidescope_core_module_ts["src/modules/callidescope-core/callidescope-core.module.ts"]
|
|
85
|
+
file_src_modules_callidescope_core_callidescope_core_service_ts["src/modules/callidescope-core/callidescope-core.service.ts"]
|
|
86
|
+
file_src_modules_callidescope_core_callidescope_core_service_unit_test_ts["src/modules/callidescope-core/callidescope-core.service.unit.test.ts"]
|
|
87
|
+
file_src_modules_callidescope_core_callidescope_core_types_ts["src/modules/callidescope-core/callidescope-core.types.ts"]
|
|
88
|
+
file_testing_mocks_ts["testing/mocks.ts"]
|
|
89
|
+
file_testing_setup_ts["testing/setup.ts"]
|
|
90
|
+
file_vite_config_ts["vite.config.ts"]
|
|
91
|
+
file_vitest_config_ts["vitest.config.ts"]
|
|
92
|
+
file_src_index_unit_test_ts --> file_src_index_ts
|
|
93
|
+
file_src_modules_callidescope_core_callidescope_core_module_ts --> file_src_modules_callidescope_core_callidescope_core_service_ts
|
|
94
|
+
file_src_modules_callidescope_core_callidescope_core_service_unit_test_ts --> file_src_modules_callidescope_core_callidescope_core_service_ts
|
|
95
|
+
```
|
|
96
|
+
<!-- codependix:end name="codependix-file-imports" -->
|
|
97
|
+
|
|
98
|
+
<!-- callidescope:start -->
|
|
99
|
+
|
|
100
|
+
## π Callidescope
|
|
101
|
+
|
|
102
|
+
Call stacks traced through `packages/ic-suite/callidescope/callidescope-core`, deepest first. Each frame shows what it takes, what it returns, and what its documentation says.
|
|
103
|
+
|
|
104
|
+
| Measure | Value |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| Callables | 1 |
|
|
107
|
+
| Files | 11 |
|
|
108
|
+
| Calls traced | 0 |
|
|
109
|
+
| Call stacks | 0 |
|
|
110
|
+
| Deepest stack | 0 |
|
|
111
|
+
| Stacks through recursion | 0 |
|
|
112
|
+
| Unfollowable calls | 0 |
|
|
113
|
+
|
|
114
|
+
### Limits
|
|
115
|
+
|
|
116
|
+
What this project is judged against, as declared in its own `callidescope.config.ts`.
|
|
117
|
+
|
|
118
|
+
| Limit | Value |
|
|
119
|
+
| --- | --- |
|
|
120
|
+
| `maximumDepth` | 17 |
|
|
121
|
+
| `maximumBreadth` | none |
|
|
122
|
+
|
|
123
|
+
### Call stacks (depth)
|
|
124
|
+
|
|
125
|
+
None.
|
|
126
|
+
|
|
127
|
+
### Breadth
|
|
128
|
+
|
|
129
|
+
None.
|
|
130
|
+
<!-- callidescope:end -->
|
|
131
|
+
|
|
132
|
+
<!-- codometer:start -->
|
|
133
|
+
|
|
134
|
+
## β²οΈ Codometer
|
|
135
|
+
|
|
136
|
+
### Project
|
|
137
|
+
|
|
138
|
+

|
|
139
|
+

|
|
140
|
+

|
|
141
|
+

|
|
142
|
+
|
|
143
|
+
### Measured Targets
|
|
144
|
+
|
|
145
|
+

|
|
146
|
+
|
|
147
|
+
### TypeScript
|
|
148
|
+
|
|
149
|
+

|
|
150
|
+

|
|
151
|
+

|
|
152
|
+

|
|
153
|
+

|
|
154
|
+

|
|
155
|
+

|
|
156
|
+
|
|
157
|
+
### JavaScript
|
|
158
|
+
|
|
159
|
+

|
|
160
|
+

|
|
161
|
+

|
|
162
|
+

|
|
163
|
+

|
|
164
|
+

|
|
165
|
+

|
|
166
|
+

|
|
167
|
+

|
|
168
|
+

|
|
169
|
+

|
|
170
|
+

|
|
171
|
+

|
|
172
|
+

|
|
173
|
+
|
|
174
|
+
### Python
|
|
175
|
+
|
|
176
|
+

|
|
177
|
+

|
|
178
|
+

|
|
179
|
+

|
|
180
|
+

|
|
181
|
+

|
|
182
|
+

|
|
183
|
+

|
|
184
|
+

|
|
185
|
+

|
|
186
|
+

|
|
187
|
+

|
|
188
|
+
|
|
189
|
+
### JSON
|
|
190
|
+
|
|
191
|
+

|
|
192
|
+

|
|
193
|
+

|
|
194
|
+

|
|
195
|
+

|
|
196
|
+

|
|
197
|
+

|
|
198
|
+

|
|
199
|
+

|
|
200
|
+

|
|
201
|
+

|
|
202
|
+

|
|
203
|
+
|
|
204
|
+
### YAML
|
|
205
|
+
|
|
206
|
+

|
|
207
|
+

|
|
208
|
+

|
|
209
|
+

|
|
210
|
+

|
|
211
|
+

|
|
212
|
+

|
|
213
|
+

|
|
214
|
+

|
|
215
|
+

|
|
216
|
+

|
|
217
|
+
|
|
218
|
+
### TOML
|
|
219
|
+
|
|
220
|
+

|
|
221
|
+

|
|
222
|
+

|
|
223
|
+

|
|
224
|
+

|
|
225
|
+

|
|
226
|
+

|
|
227
|
+
|
|
228
|
+
### Shell
|
|
229
|
+
|
|
230
|
+

|
|
231
|
+

|
|
232
|
+

|
|
233
|
+

|
|
234
|
+

|
|
235
|
+

|
|
236
|
+

|
|
237
|
+

|
|
238
|
+

|
|
239
|
+

|
|
240
|
+

|
|
241
|
+
|
|
242
|
+
### SQL
|
|
243
|
+
|
|
244
|
+

|
|
245
|
+

|
|
246
|
+

|
|
247
|
+

|
|
248
|
+

|
|
249
|
+

|
|
250
|
+

|
|
251
|
+

|
|
252
|
+

|
|
253
|
+

|
|
254
|
+

|
|
255
|
+
|
|
256
|
+
### HCL
|
|
257
|
+
|
|
258
|
+

|
|
259
|
+

|
|
260
|
+

|
|
261
|
+

|
|
262
|
+

|
|
263
|
+

|
|
264
|
+

|
|
265
|
+

|
|
266
|
+

|
|
267
|
+
|
|
268
|
+
### CSS
|
|
269
|
+
|
|
270
|
+

|
|
271
|
+

|
|
272
|
+

|
|
273
|
+

|
|
274
|
+

|
|
275
|
+

|
|
276
|
+

|
|
277
|
+

|
|
278
|
+

|
|
279
|
+
|
|
280
|
+
### Conventions
|
|
281
|
+
|
|
282
|
+

|
|
283
|
+

|
|
284
|
+

|
|
285
|
+

|
|
286
|
+

|
|
287
|
+

|
|
288
|
+

|
|
289
|
+

|
|
290
|
+

|
|
291
|
+

|
|
292
|
+

|
|
293
|
+

|
|
294
|
+

|
|
295
|
+

|
|
296
|
+

|
|
297
|
+

|
|
298
|
+

|
|
299
|
+

|
|
300
|
+
|
|
301
|
+
### Jupyter
|
|
302
|
+
|
|
303
|
+

|
|
304
|
+

|
|
305
|
+

|
|
306
|
+

|
|
307
|
+

|
|
308
|
+

|
|
309
|
+

|
|
310
|
+

|
|
311
|
+

|
|
312
|
+

|
|
313
|
+

|
|
314
|
+

|
|
315
|
+

|
|
316
|
+

|
|
317
|
+

|
|
318
|
+

|
|
319
|
+

|
|
320
|
+

|
|
321
|
+

|
|
322
|
+

|
|
323
|
+
|
|
324
|
+
### Markdown
|
|
325
|
+
|
|
326
|
+

|
|
327
|
+

|
|
328
|
+

|
|
329
|
+

|
|
330
|
+

|
|
331
|
+

|
|
332
|
+

|
|
333
|
+

|
|
334
|
+

|
|
335
|
+

|
|
336
|
+

|
|
337
|
+

|
|
338
|
+

|
|
339
|
+

|
|
340
|
+

|
|
341
|
+

|
|
342
|
+

|
|
343
|
+

|
|
344
|
+

|
|
345
|
+

|
|
346
|
+
<!-- codometer:end -->
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One callable and every distinct callable it calls directly, unfiltered by
|
|
3
|
+
* any limit.
|
|
4
|
+
*
|
|
5
|
+
* Held on a `ProjectReport` the same way `stacks` holds every `CallStack`
|
|
6
|
+
* regardless of `maximumDepth`: computing breadth does not require a
|
|
7
|
+
* configured limit, only reporting a violation does.
|
|
8
|
+
*/
|
|
9
|
+
export declare interface CallableBreadthReport {
|
|
10
|
+
readonly breadth: number;
|
|
11
|
+
readonly callees: readonly WideCallableCallee[];
|
|
12
|
+
readonly displayName: string;
|
|
13
|
+
readonly id: CallableId;
|
|
14
|
+
readonly location: SourceLocation;
|
|
15
|
+
/** Absent when the checker could not resolve a signature. */
|
|
16
|
+
readonly signature: CallableSignature | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** What the documentation comment above a callable says. */
|
|
20
|
+
export declare interface CallableDocumentation {
|
|
21
|
+
readonly isDeprecated: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The comment's prose in full, newlines collapsed. Empty when it is all tags.
|
|
24
|
+
*
|
|
25
|
+
* Never shortened. How much of it fits belongs to whatever renders it, and
|
|
26
|
+
* a consumer reading this has no line to fit inside.
|
|
27
|
+
*/
|
|
28
|
+
readonly summary: string;
|
|
29
|
+
/** Tag names present, without the leading `@`, in source order. */
|
|
30
|
+
readonly tags: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Stable identifier for one callable: workspace-relative path plus the byte
|
|
35
|
+
* offset its declaration starts at.
|
|
36
|
+
*
|
|
37
|
+
* The offset rather than a line number, because two callables can share a line
|
|
38
|
+
* β an arrow property and its enclosing statement do β while exactly one
|
|
39
|
+
* declaration can start at one offset.
|
|
40
|
+
*/
|
|
41
|
+
export declare type CallableId = string;
|
|
42
|
+
|
|
43
|
+
/** The declaration shape a callable was found as. */
|
|
44
|
+
export declare type CallableKind = "accessor" | "arrow-property" | "callback" | "constructor" | "function" | "method" | "module" | "object-literal-method";
|
|
45
|
+
|
|
46
|
+
/** One function-like declaration in the workspace. */
|
|
47
|
+
export declare interface CallableNode {
|
|
48
|
+
readonly displayName: string;
|
|
49
|
+
readonly enclosingTypeName: string | undefined;
|
|
50
|
+
readonly id: CallableId;
|
|
51
|
+
readonly isExported: boolean;
|
|
52
|
+
readonly kind: CallableKind;
|
|
53
|
+
readonly location: SourceLocation;
|
|
54
|
+
readonly memberName: string;
|
|
55
|
+
readonly projectName: string;
|
|
56
|
+
readonly statementCount: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** One parameter of a callable, as the type checker renders it. */
|
|
60
|
+
export declare interface CallableParameter {
|
|
61
|
+
/** True for a parameter with a `?` or a default value. */
|
|
62
|
+
readonly isOptional: boolean;
|
|
63
|
+
readonly isRest: boolean;
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly type: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** What a callable takes and gives back. */
|
|
69
|
+
export declare interface CallableSignature {
|
|
70
|
+
readonly parameters: readonly CallableParameter[];
|
|
71
|
+
readonly returnType: string;
|
|
72
|
+
/**
|
|
73
|
+
* The whole signature on one line, as TypeScript writes it.
|
|
74
|
+
*
|
|
75
|
+
* Kept alongside the parts because TypeScript renders some shapes better
|
|
76
|
+
* than reassembling them does β a destructured parameter reads as
|
|
77
|
+
* `{ alpha, beta }` here and as the synthetic `__0` in `parameters`.
|
|
78
|
+
*/
|
|
79
|
+
readonly text: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** One caller-to-callee edge, produced by one call site. */
|
|
83
|
+
export declare interface CallEdge {
|
|
84
|
+
readonly calleeId: CallableId;
|
|
85
|
+
readonly callerId: CallableId;
|
|
86
|
+
readonly callSite: SourceLocation;
|
|
87
|
+
/** Above one means a virtual dispatch: the call site had several targets. */
|
|
88
|
+
readonly candidateCount: number;
|
|
89
|
+
readonly resolution: EdgeResolution;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Everything one callidescope run produced. */
|
|
93
|
+
export declare interface CallGraphResult {
|
|
94
|
+
readonly deepStacks: readonly DeepStackFinding[];
|
|
95
|
+
/** One report per project traced, in the order projects were discovered. */
|
|
96
|
+
readonly projects: readonly ProjectReport[];
|
|
97
|
+
readonly summary: CallGraphSummary;
|
|
98
|
+
readonly wideCallables: readonly WideCallableFinding[];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Counts describing the graph a run built. */
|
|
102
|
+
export declare interface CallGraphSummary {
|
|
103
|
+
readonly callableCount: number;
|
|
104
|
+
readonly cyclicComponentCount: number;
|
|
105
|
+
readonly edgeCount: number;
|
|
106
|
+
readonly entryPointCount: number;
|
|
107
|
+
readonly fileCount: number;
|
|
108
|
+
readonly maximumDepth: number;
|
|
109
|
+
readonly projectCount: number;
|
|
110
|
+
readonly unresolvedCallCount: number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* TODO: Document the callidescopeCore module.
|
|
115
|
+
*/
|
|
116
|
+
export declare class CallidescopeCoreModule {
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* TODO: Document the callidescopeCore service.
|
|
121
|
+
*/
|
|
122
|
+
export declare class CallidescopeCoreService {
|
|
123
|
+
constructor();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** One entry point and the deepest stack below it. */
|
|
127
|
+
export declare interface CallStack {
|
|
128
|
+
readonly depth: number;
|
|
129
|
+
readonly entryPointKind: EntryPointKind;
|
|
130
|
+
readonly frames: readonly StackFrame[];
|
|
131
|
+
/**
|
|
132
|
+
* True when a frame on this path holds an unresolved call, making `depth` a
|
|
133
|
+
* floor rather than a measurement.
|
|
134
|
+
*/
|
|
135
|
+
readonly isLowerBound: boolean;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** A call stack deeper than the configured limit. */
|
|
139
|
+
export declare interface DeepStackFinding extends CallStack {
|
|
140
|
+
readonly limit: number;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** How a call site was resolved to its target. */
|
|
144
|
+
export declare type EdgeResolution = "alias" | "callback" | "direct" | "implementation" | "super";
|
|
145
|
+
|
|
146
|
+
/** A callable a framework, a runtime, or nothing at all calls. */
|
|
147
|
+
export declare interface EntryPoint {
|
|
148
|
+
readonly callableId: CallableId;
|
|
149
|
+
readonly kind: EntryPointKind;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* What promoted a callable to the root of a call stack.
|
|
154
|
+
*
|
|
155
|
+
* `declared` is the only one a person chose: a configuration named that
|
|
156
|
+
* callable's address outright, saying "this is the surface this package has".
|
|
157
|
+
* Every other kind is inferred β from a decorator, a file name, an export, or
|
|
158
|
+
* from nothing at all having called it.
|
|
159
|
+
*/
|
|
160
|
+
export declare type EntryPointKind = "declared" | "decorated-method" | "exported-function" | "lifecycle" | "module-bootstrap" | "orphan-root";
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Everything one project contributed to a run.
|
|
164
|
+
*
|
|
165
|
+
* Scoped by the project the entry point sits in, so a section embedded in a
|
|
166
|
+
* project's own README describes that project rather than the workspace.
|
|
167
|
+
*/
|
|
168
|
+
export declare interface ProjectReport {
|
|
169
|
+
/** Every callable with at least one direct callee. */
|
|
170
|
+
readonly callableBreadths: readonly CallableBreadthReport[];
|
|
171
|
+
readonly projectName: string;
|
|
172
|
+
/** Every stack that makes at least one call, deepest first. */
|
|
173
|
+
readonly stacks: readonly CallStack[];
|
|
174
|
+
readonly summary: CallGraphSummary;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Where a declaration or a call site sits. */
|
|
178
|
+
export declare interface SourceLocation {
|
|
179
|
+
readonly column: number;
|
|
180
|
+
/** Workspace-relative, POSIX separators, so reports are machine-independent. */
|
|
181
|
+
readonly filePath: string;
|
|
182
|
+
readonly line: number;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** One frame of a reported call stack. */
|
|
186
|
+
export declare interface StackFrame {
|
|
187
|
+
readonly displayName: string;
|
|
188
|
+
/** Absent when the callable carries no documentation comment. */
|
|
189
|
+
readonly documentation: CallableDocumentation | undefined;
|
|
190
|
+
readonly id: CallableId;
|
|
191
|
+
/** True when this frame belongs to a recursive cycle. */
|
|
192
|
+
readonly isCycle: boolean;
|
|
193
|
+
readonly location: SourceLocation;
|
|
194
|
+
/** Absent when the checker could not resolve a signature. */
|
|
195
|
+
readonly signature: CallableSignature | undefined;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* A call site that produced no edge.
|
|
200
|
+
*
|
|
201
|
+
* Every depth measured through a callable holding one of these is a lower
|
|
202
|
+
* bound, which is why the reason is kept rather than discarded.
|
|
203
|
+
*/
|
|
204
|
+
export declare interface UnresolvedCall {
|
|
205
|
+
readonly calleeText: string;
|
|
206
|
+
readonly callerId: CallableId;
|
|
207
|
+
readonly callSite: SourceLocation;
|
|
208
|
+
readonly reason: UnresolvedReason;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Why a call site produced no edge. */
|
|
212
|
+
export declare type UnresolvedReason = "computed-member" | "dynamic-value" | "generic-parameter" | "no-implementation" | "no-symbol" | "too-many-implementations";
|
|
213
|
+
|
|
214
|
+
/** One callable reached directly by another, named in its breadth report. */
|
|
215
|
+
export declare interface WideCallableCallee {
|
|
216
|
+
readonly displayName: string;
|
|
217
|
+
readonly id: CallableId;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** A callable calling more callables directly than the configured limit. */
|
|
221
|
+
export declare interface WideCallableFinding extends CallableBreadthReport {
|
|
222
|
+
readonly limit: number;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export { }
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Injectable as e, Module as t } from "@nestjs/common";
|
|
2
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
|
|
3
|
+
function n(e, t) {
|
|
4
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
8
|
+
function r(e, t, n, r) {
|
|
9
|
+
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
10
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
11
|
+
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
12
|
+
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region packages/ic-suite/callidescope/callidescope-core/src/modules/callidescope-core/callidescope-core.service.ts
|
|
16
|
+
var i = class {
|
|
17
|
+
constructor() {}
|
|
18
|
+
};
|
|
19
|
+
i = r([e(), n("design:paramtypes", [])], i);
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region packages/ic-suite/callidescope/callidescope-core/src/modules/callidescope-core/callidescope-core.module.ts
|
|
22
|
+
var a = class {};
|
|
23
|
+
a = r([t({
|
|
24
|
+
controllers: [],
|
|
25
|
+
exports: [i],
|
|
26
|
+
imports: [],
|
|
27
|
+
providers: [i]
|
|
28
|
+
})], a);
|
|
29
|
+
//#endregion
|
|
30
|
+
export { a as CallidescopeCoreModule, i as CallidescopeCoreService };
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
|
+
"author": "Jimmy Paolini",
|
|
3
|
+
"bugs": {
|
|
4
|
+
"url": "https://github.com/organizzolini/codebase/issues"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@nestjs/common": "^11.1.21 || ^12.0.1",
|
|
8
|
+
"reflect-metadata": "^0.2.2"
|
|
9
|
+
},
|
|
10
|
+
"description": "Domain vocabulary, call-graph representations, and limit contracts for the Callidescope toolchain",
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@golevelup/ts-vitest": "^4.0.0",
|
|
13
|
+
"@nestjs/testing": "^12.0.1",
|
|
14
|
+
"@nx/eslint-plugin": "^23.0.0",
|
|
15
|
+
"@swc/helpers": "^0.5.21",
|
|
16
|
+
"@types/node": "^26.5.1",
|
|
17
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
18
|
+
"vitest": "^5.0.0"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/src/index.d.ts",
|
|
23
|
+
"default": "./dist/src/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"homepage": "https://github.com/organizzolini/codebase/tree/main/packages/ic-suite/callidescope/callidescope-core#readme",
|
|
33
|
+
"keywords": [
|
|
34
|
+
"call-graph",
|
|
35
|
+
"call-stack",
|
|
36
|
+
"callidescope",
|
|
37
|
+
"contracts",
|
|
38
|
+
"depth-analysis",
|
|
39
|
+
"types"
|
|
40
|
+
],
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"main": "./dist/src/index.js",
|
|
2
43
|
"name": "@callidescope/core",
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public",
|
|
46
|
+
"registry": "https://registry.npmjs.org"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"directory": "packages/ic-suite/callidescope/callidescope-core",
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/organizzolini/codebase.git"
|
|
52
|
+
},
|
|
53
|
+
"type": "module",
|
|
54
|
+
"typeCoverage": {
|
|
55
|
+
"atLeast": 100,
|
|
56
|
+
"strict": true
|
|
57
|
+
},
|
|
58
|
+
"types": "./dist/src/index.d.ts",
|
|
59
|
+
"version": "0.0.4"
|
|
6
60
|
}
|