@ttsc/graph 0.19.3 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/TtscGraphApplication.js +3 -1
- package/lib/TtscGraphApplication.js.map +1 -1
- package/lib/bin.js +15 -3
- package/lib/bin.js.map +1 -1
- package/lib/index.d.ts +13 -2
- package/lib/index.js +24 -30
- package/lib/index.js.map +1 -1
- package/lib/launcherArgs.d.ts +24 -0
- package/lib/launcherArgs.js +136 -0
- package/lib/launcherArgs.js.map +1 -0
- package/lib/model/TtscGraphMemory.d.ts +9 -5
- package/lib/model/TtscGraphMemory.js +35 -58
- package/lib/model/TtscGraphMemory.js.map +1 -1
- package/lib/model/TtscGraphNodeId.d.ts +17 -0
- package/lib/model/TtscGraphNodeId.js +69 -0
- package/lib/model/TtscGraphNodeId.js.map +1 -0
- package/lib/model/TtscGraphSession.d.ts +23 -7
- package/lib/model/TtscGraphSession.js +402 -210
- package/lib/model/TtscGraphSession.js.map +1 -1
- package/lib/model/TtscGraphSourceReader.d.ts +27 -0
- package/lib/model/TtscGraphSourceReader.js +97 -0
- package/lib/model/TtscGraphSourceReader.js.map +1 -0
- package/lib/model/loadGraph.d.ts +4 -4
- package/lib/model/loadGraph.js +233 -168
- package/lib/model/loadGraph.js.map +1 -1
- package/lib/reduce.d.ts +4 -1
- package/lib/reduce.js +112 -29
- package/lib/reduce.js.map +1 -1
- package/lib/server/createServer.js +17 -6
- package/lib/server/createServer.js.map +1 -1
- package/lib/server/pathPolicy.d.ts +6 -0
- package/lib/server/pathPolicy.js +10 -1
- package/lib/server/pathPolicy.js.map +1 -1
- package/lib/server/resolveHandle.js +22 -18
- package/lib/server/resolveHandle.js.map +1 -1
- package/lib/server/resultAudit.d.ts +41 -20
- package/lib/server/resultAudit.js +62 -34
- package/lib/server/resultAudit.js.map +1 -1
- package/lib/server/resultNext.d.ts +5 -0
- package/lib/server/resultNext.js.map +1 -1
- package/lib/server/runDetails.d.ts +2 -2
- package/lib/server/runDetails.js +54 -108
- package/lib/server/runDetails.js.map +1 -1
- package/lib/server/runEntrypoints.js +1 -1
- package/lib/server/runEntrypoints.js.map +1 -1
- package/lib/server/runLookup.js +1 -1
- package/lib/server/runLookup.js.map +1 -1
- package/lib/server/runTour.js +113 -30
- package/lib/server/runTour.js.map +1 -1
- package/lib/server/runTrace.d.ts +22 -0
- package/lib/server/runTrace.js +293 -63
- package/lib/server/runTrace.js.map +1 -1
- package/lib/structures/ITtscGraphDump.d.ts +13 -13
- package/lib/structures/ITtscGraphNode.d.ts +34 -0
- package/lib/structures/ITtscGraphTrace.d.ts +1 -1
- package/lib/view.js +18 -28
- package/lib/view.js.map +1 -1
- package/package.json +5 -5
- package/src/TtscGraphApplication.ts +5 -1
- package/src/bin.ts +13 -3
- package/src/index.ts +34 -27
- package/src/launcherArgs.ts +168 -0
- package/src/model/TtscGraphMemory.ts +34 -60
- package/src/model/TtscGraphNodeId.ts +77 -0
- package/src/model/TtscGraphSession.ts +228 -55
- package/src/model/TtscGraphSourceReader.ts +117 -0
- package/src/model/loadGraph.ts +4 -4
- package/src/reduce.ts +136 -31
- package/src/server/createServer.ts +12 -2
- package/src/server/pathPolicy.ts +10 -1
- package/src/server/resolveHandle.ts +21 -22
- package/src/server/resultAudit.ts +64 -33
- package/src/server/resultNext.ts +6 -0
- package/src/server/runDetails.ts +57 -113
- package/src/server/runEntrypoints.ts +1 -1
- package/src/server/runLookup.ts +1 -1
- package/src/server/runTour.ts +133 -39
- package/src/server/runTrace.ts +401 -65
- package/src/structures/ITtscGraphDump.ts +13 -13
- package/src/structures/ITtscGraphNode.ts +40 -0
- package/src/structures/ITtscGraphTrace.ts +1 -1
- package/src/view.ts +25 -23
|
@@ -89,12 +89,37 @@ export interface ITtscGraphNode {
|
|
|
89
89
|
*/
|
|
90
90
|
enumMembers?: ITtscGraphNode.IEnumMember[];
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Direct, statically named members when this variable is initialized with an
|
|
94
|
+
* object literal, in declaration order.
|
|
95
|
+
*
|
|
96
|
+
* The native builder takes identity from the compiler AST and renders the
|
|
97
|
+
* compact signature from the same Program-owned source snapshot. A spread or
|
|
98
|
+
* dynamic computed name has no declaration name it can report soundly, so it
|
|
99
|
+
* contributes no fabricated member.
|
|
100
|
+
*/
|
|
101
|
+
objectMembers?: ITtscGraphNode.IObjectMember[];
|
|
102
|
+
|
|
92
103
|
/**
|
|
93
104
|
* Decorators written on this declaration, in source order: raw facts
|
|
94
105
|
* (`@Controller`, `@Get`) a consumer interprets without re-parsing source.
|
|
95
106
|
*/
|
|
96
107
|
decorators?: ITtscGraphDecorator[];
|
|
97
108
|
|
|
109
|
+
/**
|
|
110
|
+
* The declaration head, cut by the producer where the compiler says the body
|
|
111
|
+
* opens.
|
|
112
|
+
*
|
|
113
|
+
* Absent when the producer could not bound the head, in which case a consumer
|
|
114
|
+
* falls back to reading the declaration span. That fallback is a line scan,
|
|
115
|
+
* and a physical line is not a declaration boundary: it leaks implementation
|
|
116
|
+
* text when a declaration shares its line with its body, and it stops early
|
|
117
|
+
* when the head itself contains a brace — a type-literal parameter, an object
|
|
118
|
+
* return type, a destructured parameter. Prefer this field wherever it is
|
|
119
|
+
* present.
|
|
120
|
+
*/
|
|
121
|
+
signature?: string;
|
|
122
|
+
|
|
98
123
|
/** The declaration span, for display and signatures. */
|
|
99
124
|
evidence?: ITtscGraphEvidence;
|
|
100
125
|
|
|
@@ -117,4 +142,19 @@ export namespace ITtscGraphNode {
|
|
|
117
142
|
*/
|
|
118
143
|
value?: string;
|
|
119
144
|
}
|
|
145
|
+
|
|
146
|
+
/** One direct, statically named member of an object-literal variable. */
|
|
147
|
+
export interface IObjectMember {
|
|
148
|
+
/** The source-visible static property name. */
|
|
149
|
+
name: string;
|
|
150
|
+
|
|
151
|
+
/** Whether the declaration is a data property or callable/accessor member. */
|
|
152
|
+
kind: "property" | "method";
|
|
153
|
+
|
|
154
|
+
/** 1-based declaration line in the node's file, when source was available. */
|
|
155
|
+
line?: number;
|
|
156
|
+
|
|
157
|
+
/** Compact declaration outline rendered from the compiler source snapshot. */
|
|
158
|
+
signature?: string;
|
|
159
|
+
}
|
|
120
160
|
}
|
|
@@ -17,7 +17,7 @@ export interface ITtscGraphTrace {
|
|
|
17
17
|
/** Unique nodes reached (excluding the start), each with its depth and roles. */
|
|
18
18
|
reached: ITtscGraphTrace.INode[];
|
|
19
19
|
|
|
20
|
-
/**
|
|
20
|
+
/** In an open trace, true when a bound omitted an eligible node or hop. */
|
|
21
21
|
truncated: boolean;
|
|
22
22
|
|
|
23
23
|
/** The resolved `to` target, when a path was requested. */
|
package/src/view.ts
CHANGED
|
@@ -3,6 +3,12 @@ import fs from "node:fs";
|
|
|
3
3
|
import http from "node:http";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
|
|
6
|
+
import {
|
|
7
|
+
nonNegativeIntegerOption,
|
|
8
|
+
parseLauncherOptions,
|
|
9
|
+
positiveIntegerOption,
|
|
10
|
+
projectOptions,
|
|
11
|
+
} from "./launcherArgs";
|
|
6
12
|
import { ensureExecutable } from "./nativeExecutable";
|
|
7
13
|
import { type RawDump, reduce } from "./reduce";
|
|
8
14
|
import { resolveGraphBinary } from "./resolveGraphBinary";
|
|
@@ -16,30 +22,26 @@ interface ViewOptions {
|
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
function parseViewArgs(argv: readonly string[]): ViewOptions {
|
|
19
|
-
const
|
|
20
|
-
cwd:
|
|
21
|
-
tsconfig: "tsconfig
|
|
22
|
-
port:
|
|
23
|
-
open:
|
|
24
|
-
|
|
25
|
+
const values = parseLauncherOptions(argv, [
|
|
26
|
+
{ key: "cwd", flags: ["--cwd"], kind: "value" },
|
|
27
|
+
{ key: "tsconfig", flags: ["--tsconfig", "-p"], kind: "value" },
|
|
28
|
+
{ key: "port", flags: ["--port"], kind: "value" },
|
|
29
|
+
{ key: "open", flags: ["--no-open"], kind: "flag" },
|
|
30
|
+
{ key: "max_nodes", flags: ["--max-nodes"], kind: "value" },
|
|
31
|
+
]);
|
|
32
|
+
const project = projectOptions(values);
|
|
33
|
+
return {
|
|
34
|
+
...project,
|
|
35
|
+
port:
|
|
36
|
+
values.has("port") === true
|
|
37
|
+
? nonNegativeIntegerOption(values, "port", 65_535)
|
|
38
|
+
: 0,
|
|
39
|
+
open: values.get("open") !== true,
|
|
40
|
+
maxNodes:
|
|
41
|
+
values.has("max_nodes") === true
|
|
42
|
+
? positiveIntegerOption(values, "max_nodes", Number.MAX_SAFE_INTEGER)
|
|
43
|
+
: 1200,
|
|
25
44
|
};
|
|
26
|
-
for (let i = 0; i < argv.length; i++) {
|
|
27
|
-
const arg = argv[i]!;
|
|
28
|
-
if (arg === "--cwd") opts.cwd = argv[++i] ?? opts.cwd;
|
|
29
|
-
else if (arg.startsWith("--cwd=")) opts.cwd = arg.slice("--cwd=".length);
|
|
30
|
-
else if (arg === "--tsconfig" || arg === "-p")
|
|
31
|
-
opts.tsconfig = argv[++i] ?? opts.tsconfig;
|
|
32
|
-
else if (arg.startsWith("--tsconfig="))
|
|
33
|
-
opts.tsconfig = arg.slice("--tsconfig=".length);
|
|
34
|
-
else if (arg === "--port") opts.port = Number(argv[++i]);
|
|
35
|
-
else if (arg.startsWith("--port="))
|
|
36
|
-
opts.port = Number(arg.slice("--port=".length));
|
|
37
|
-
else if (arg === "--no-open") opts.open = false;
|
|
38
|
-
else if (arg === "--max-nodes") opts.maxNodes = Number(argv[++i]);
|
|
39
|
-
else if (arg.startsWith("--max-nodes="))
|
|
40
|
-
opts.maxNodes = Number(arg.slice("--max-nodes=".length));
|
|
41
|
-
}
|
|
42
|
-
return opts;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
/**
|