@nexiq/shared 1.0.1 → 1.0.3
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/component.d.ts +99 -25
- package/dist/component.d.ts.map +1 -1
- package/dist/db/sqlite.d.ts +7 -1
- package/dist/db/sqlite.d.ts.map +1 -1
- package/dist/db/sqlite.js +24 -0
- package/dist/db/sqlite.js.map +1 -1
- package/dist/index.d.ts +128 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/nexiq/graph-view/graph-combo.d.ts +37 -0
- package/dist/nexiq/graph-view/graph-combo.d.ts.map +1 -0
- package/dist/nexiq/graph-view/graph-combo.js +103 -0
- package/dist/nexiq/graph-view/graph-combo.js.map +1 -0
- package/dist/nexiq/graph-view/graph-edge.d.ts +30 -0
- package/dist/nexiq/graph-view/graph-edge.d.ts.map +1 -0
- package/dist/nexiq/graph-view/graph-edge.js +78 -0
- package/dist/nexiq/graph-view/graph-edge.js.map +1 -0
- package/dist/nexiq/graph-view/graph-node-detail.d.ts +26 -0
- package/dist/nexiq/graph-view/graph-node-detail.d.ts.map +1 -0
- package/dist/nexiq/graph-view/graph-node-detail.js +62 -0
- package/dist/nexiq/graph-view/graph-node-detail.js.map +1 -0
- package/dist/nexiq/graph-view/graph-node.d.ts +35 -0
- package/dist/nexiq/graph-view/graph-node.d.ts.map +1 -0
- package/dist/nexiq/graph-view/graph-node.js +95 -0
- package/dist/nexiq/graph-view/graph-node.js.map +1 -0
- package/dist/nexiq/graph-view/graph-view.d.ts +39 -0
- package/dist/nexiq/graph-view/graph-view.d.ts.map +1 -0
- package/dist/nexiq/graph-view/graph-view.js +131 -0
- package/dist/nexiq/graph-view/graph-view.js.map +1 -0
- package/dist/nexiq/graph-view/item-type.d.ts +18 -0
- package/dist/nexiq/graph-view/item-type.d.ts.map +1 -0
- package/dist/nexiq/graph-view/item-type.js +20 -0
- package/dist/nexiq/graph-view/item-type.js.map +1 -0
- package/dist/nexiq/graph-view/loc.d.ts +16 -0
- package/dist/nexiq/graph-view/loc.d.ts.map +1 -0
- package/dist/nexiq/graph-view/loc.js +46 -0
- package/dist/nexiq/graph-view/loc.js.map +1 -0
- package/dist/nexiq/graph-view.d.ts +8 -0
- package/dist/nexiq/graph-view.d.ts.map +1 -0
- package/dist/nexiq/graph-view.js +9 -0
- package/dist/nexiq/graph-view.js.map +1 -0
- package/dist/types/backend.d.ts +17 -28
- package/dist/types/backend.d.ts.map +1 -1
- package/dist/types/config.d.ts +2 -29
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/function.d.ts.map +1 -1
- package/dist/types/index.d.ts +16 -14
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/primitive.d.ts +12 -0
- package/dist/types/primitive.d.ts.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/eslint.config.js +32 -0
- package/package.json +16 -6
- package/src/component.ts +159 -35
- package/src/db/sqlite.ts +30 -0
- package/src/index.ts +144 -3
- package/src/nexiq/graph-view/graph-combo.ts +141 -0
- package/src/nexiq/graph-view/graph-edge.ts +108 -0
- package/src/nexiq/graph-view/graph-node-detail.ts +88 -0
- package/src/nexiq/graph-view/graph-node.ts +131 -0
- package/src/nexiq/graph-view/graph-view.ts +162 -0
- package/src/nexiq/graph-view/item-type.ts +19 -0
- package/src/nexiq/graph-view/loc.ts +56 -0
- package/src/nexiq/graph-view.ts +9 -0
- package/src/schema/graph_view.fbs +74 -0
- package/src/types/backend.ts +11 -23
- package/src/types/config.ts +2 -33
- package/src/types/function.ts +2 -4
- package/src/types/index.ts +17 -16
- package/src/types/primitive.ts +7 -1
- package/src/utils.ts +4 -0
- package/tsconfig.json +13 -24
package/eslint.config.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
5
|
+
|
|
6
|
+
export default defineConfig([
|
|
7
|
+
globalIgnores(["dist"]),
|
|
8
|
+
{
|
|
9
|
+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
10
|
+
files: ["**/*.{ts,tsx}"],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
ecmaVersion: 2020,
|
|
13
|
+
globals: globals.node,
|
|
14
|
+
parserOptions: {
|
|
15
|
+
projectService: true,
|
|
16
|
+
tsconfigRootDir: import.meta.dirname,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
rules: {
|
|
20
|
+
"@typescript-eslint/no-unused-vars": [
|
|
21
|
+
"error",
|
|
22
|
+
{
|
|
23
|
+
argsIgnorePattern: "^_",
|
|
24
|
+
varsIgnorePattern: "^_",
|
|
25
|
+
caughtErrorsIgnorePattern: "^_",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
"no-debugger": "warn",
|
|
29
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexiq/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
|
+
"sideEffects": false,
|
|
5
6
|
"description": "",
|
|
6
7
|
"main": "dist/index.js",
|
|
7
8
|
"types": "dist/index.d.ts",
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
},
|
|
18
19
|
"repository": {
|
|
19
20
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/Naputt1/
|
|
21
|
+
"url": "git+https://github.com/Naputt1/nexiq.git",
|
|
21
22
|
"directory": "packages/shared"
|
|
22
23
|
},
|
|
23
24
|
"publishConfig": {
|
|
@@ -27,14 +28,23 @@
|
|
|
27
28
|
"keywords": [],
|
|
28
29
|
"author": "",
|
|
29
30
|
"license": "ISC",
|
|
30
|
-
"dependencies": {},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"
|
|
32
|
+
"@eslint/js": "^10.0.1",
|
|
33
33
|
"@types/better-sqlite3": "^7.6.13",
|
|
34
|
-
"
|
|
34
|
+
"@types/node": "^25.5.0",
|
|
35
|
+
"better-sqlite3": "^12.8.0",
|
|
36
|
+
"eslint": "^10.1.0",
|
|
37
|
+
"globals": "^17.4.0",
|
|
38
|
+
"typescript": "^5.7.3",
|
|
39
|
+
"typescript-eslint": "^8.58.0"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"flatbuffers": "^25.9.23"
|
|
35
43
|
},
|
|
36
44
|
"scripts": {
|
|
37
45
|
"build": "tsc",
|
|
38
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
46
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
47
|
+
"lint": "eslint .",
|
|
48
|
+
"typecheck": "tsc --noEmit"
|
|
39
49
|
}
|
|
40
50
|
}
|
package/src/component.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TypeDataDeclare
|
|
1
|
+
import type { TypeDataDeclare } from "./types/index.js";
|
|
2
2
|
import type { PropDataType, TypeData } from "./types/primitive.js";
|
|
3
3
|
|
|
4
4
|
export type ComponentFileImport = {
|
|
@@ -7,6 +7,8 @@ export type ComponentFileImport = {
|
|
|
7
7
|
source: string;
|
|
8
8
|
type: "default" | "named" | "namespace" | "type";
|
|
9
9
|
importKind: "value" | "type";
|
|
10
|
+
resolvedId?: string | undefined;
|
|
11
|
+
unresolvedWorkspace?: boolean | undefined;
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
export type ComponentFileExport = {
|
|
@@ -56,9 +58,10 @@ export interface ComponentInfoRender extends ComponentLoc {
|
|
|
56
58
|
|
|
57
59
|
export interface EffectInfo extends ComponentLoc, ReactDependencies {
|
|
58
60
|
id: string;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
name?: string | undefined;
|
|
62
|
+
scope?: VariableScope | undefined;
|
|
63
|
+
file?: string | undefined;
|
|
64
|
+
kind?: "effect" | undefined;
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
export interface PropData {
|
|
@@ -67,19 +70,20 @@ export interface PropData {
|
|
|
67
70
|
type: string;
|
|
68
71
|
kind: "prop" | "spread";
|
|
69
72
|
props?: PropData[];
|
|
70
|
-
hash?: string;
|
|
73
|
+
hash?: string | undefined;
|
|
71
74
|
gitStatus?: "added" | "modified" | "deleted";
|
|
72
|
-
file?: string;
|
|
73
|
-
loc?: VariableLoc;
|
|
75
|
+
file?: string | undefined;
|
|
76
|
+
loc?: VariableLoc | undefined;
|
|
74
77
|
defaultValue?: PropDataType | undefined;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
export interface ReactFunctionInfoBase {
|
|
78
81
|
states: string[];
|
|
82
|
+
refs: string[];
|
|
79
83
|
hooks: string[];
|
|
80
84
|
props: PropData[];
|
|
81
85
|
propName?: string | undefined;
|
|
82
|
-
propType?: TypeData;
|
|
86
|
+
propType?: TypeData | undefined;
|
|
83
87
|
effects: Record<string, EffectInfo>;
|
|
84
88
|
}
|
|
85
89
|
|
|
@@ -89,19 +93,69 @@ export interface ReactFunctionInfo extends ReactFunctionInfoBase {
|
|
|
89
93
|
file: string;
|
|
90
94
|
}
|
|
91
95
|
|
|
92
|
-
export
|
|
96
|
+
export type HookInfo = ReactFunctionInfoBase;
|
|
93
97
|
|
|
94
|
-
export interface
|
|
95
|
-
componentType: "Function" | "Class";
|
|
98
|
+
export interface ComponentInfoBase {
|
|
96
99
|
contexts: string[];
|
|
97
100
|
forwardRef?: boolean;
|
|
101
|
+
memo?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface FunctionComponentInfo
|
|
105
|
+
extends ReactFunctionInfoBase, ComponentInfoBase {
|
|
106
|
+
componentType: "Function";
|
|
98
107
|
}
|
|
99
108
|
|
|
109
|
+
export interface ClassComponentInfo
|
|
110
|
+
extends ReactFunctionInfoBase, ComponentInfoBase {
|
|
111
|
+
componentType: "Class";
|
|
112
|
+
stateType?: TypeData | undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export type ComponentInfo = FunctionComponentInfo | ClassComponentInfo;
|
|
116
|
+
|
|
100
117
|
export interface ComponentFileVarDependency {
|
|
101
118
|
id: string;
|
|
102
119
|
name: string;
|
|
103
120
|
}
|
|
104
121
|
|
|
122
|
+
export type UsageRelationKind =
|
|
123
|
+
| "usage-read"
|
|
124
|
+
| "usage-call"
|
|
125
|
+
| "usage-write"
|
|
126
|
+
| "usage-render-call";
|
|
127
|
+
|
|
128
|
+
export type RelationKind =
|
|
129
|
+
| "render"
|
|
130
|
+
| "dependency"
|
|
131
|
+
| "parent-child"
|
|
132
|
+
| "import"
|
|
133
|
+
| UsageRelationKind
|
|
134
|
+
| (string & {});
|
|
135
|
+
|
|
136
|
+
export interface UsageOccurrence {
|
|
137
|
+
usageId: string;
|
|
138
|
+
filePath: string;
|
|
139
|
+
line: number;
|
|
140
|
+
column: number;
|
|
141
|
+
ownerId: string;
|
|
142
|
+
ownerKind: string;
|
|
143
|
+
accessPath?: string[] | undefined;
|
|
144
|
+
isOptional?: boolean | undefined;
|
|
145
|
+
isComputed?: boolean | undefined;
|
|
146
|
+
hiddenIntermediate?: string | undefined;
|
|
147
|
+
displayLabel?: string | undefined;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface ComponentRelation {
|
|
151
|
+
from_id: string;
|
|
152
|
+
to_id: string;
|
|
153
|
+
kind: RelationKind;
|
|
154
|
+
line?: number | null | undefined;
|
|
155
|
+
column?: number | null | undefined;
|
|
156
|
+
data_json?: UsageOccurrence | Record<string, unknown> | null | undefined;
|
|
157
|
+
}
|
|
158
|
+
|
|
105
159
|
export interface VariableLoc {
|
|
106
160
|
line: number;
|
|
107
161
|
column: number;
|
|
@@ -116,6 +170,12 @@ export interface VariableScope {
|
|
|
116
170
|
end: VariableLoc;
|
|
117
171
|
}
|
|
118
172
|
|
|
173
|
+
export type ComponentFileBlockScope = {
|
|
174
|
+
id: string;
|
|
175
|
+
parentId?: string | undefined;
|
|
176
|
+
scope: VariableScope;
|
|
177
|
+
};
|
|
178
|
+
|
|
119
179
|
export type VarType = "function" | "data" | "jsx" | "class";
|
|
120
180
|
|
|
121
181
|
export type ReactFunctionVar = "component" | "hook";
|
|
@@ -125,7 +185,7 @@ export type ReactVarKind =
|
|
|
125
185
|
| ReactFunctionVar
|
|
126
186
|
| ReactStateVar
|
|
127
187
|
| ReactWithCallbackVar;
|
|
128
|
-
export type VarKind = "normal" | ReactVarKind;
|
|
188
|
+
export type VarKind = "normal" | "class" | "method" | "property" | ReactVarKind;
|
|
129
189
|
|
|
130
190
|
export type VariableNamePattern =
|
|
131
191
|
| { type: "identifier"; name: string; loc: VariableLoc; id: string }
|
|
@@ -183,12 +243,6 @@ interface ComponentFileVarBaseType<TType extends VarType> {
|
|
|
183
243
|
| "await using"
|
|
184
244
|
| undefined;
|
|
185
245
|
dependencies: Record<string, ComponentFileVarDependency>;
|
|
186
|
-
ui?:
|
|
187
|
-
| (UIItemState & {
|
|
188
|
-
children?: Record<string, UIItemState>;
|
|
189
|
-
vars?: Record<string, UIItemState>;
|
|
190
|
-
})
|
|
191
|
-
| undefined;
|
|
192
246
|
}
|
|
193
247
|
|
|
194
248
|
export interface ComponentFileVarBase<
|
|
@@ -197,6 +251,8 @@ export interface ComponentFileVarBase<
|
|
|
197
251
|
>
|
|
198
252
|
extends ComponentLoc, ComponentFileVarBaseType<TType> {
|
|
199
253
|
kind: TKind;
|
|
254
|
+
isStatic?: boolean | undefined;
|
|
255
|
+
memberKind?: string | undefined;
|
|
200
256
|
}
|
|
201
257
|
|
|
202
258
|
export type FunctionReturn = PropDataType | ComponentFileVarJSX | string;
|
|
@@ -210,7 +266,7 @@ export interface ComponentFileVarBaseTypeFunction<
|
|
|
210
266
|
async?: boolean | undefined;
|
|
211
267
|
var: Record<string, ComponentFileVar>;
|
|
212
268
|
return?: FunctionReturn | undefined;
|
|
213
|
-
|
|
269
|
+
superClass?: { id?: string; name: string } | undefined;
|
|
214
270
|
}
|
|
215
271
|
|
|
216
272
|
export interface ComponentFileVarBaseTypeData<
|
|
@@ -247,27 +303,52 @@ export type ReactDependencies = {
|
|
|
247
303
|
export type ComponentFileVarReactWithCallback<
|
|
248
304
|
TKind extends ReactVarKind,
|
|
249
305
|
TType extends VarType = "function",
|
|
250
|
-
> = ComponentFileVarBaseTypeFunction<TKind, TType> &
|
|
306
|
+
> = ComponentFileVarBaseTypeFunction<TKind, TType> &
|
|
307
|
+
ReactDependencies &
|
|
308
|
+
ReactFunctionInfoBase;
|
|
309
|
+
|
|
310
|
+
export type ComponentFileVarFunctionComponent = ComponentFileVarReactFunction<
|
|
311
|
+
"component",
|
|
312
|
+
"function"
|
|
313
|
+
> &
|
|
314
|
+
FunctionComponentInfo & {
|
|
315
|
+
kind: "component";
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
export type ComponentFileVarClassComponent = ComponentFileVarReactFunction<
|
|
319
|
+
"component",
|
|
320
|
+
"class"
|
|
321
|
+
> &
|
|
322
|
+
ClassComponentInfo & {
|
|
323
|
+
kind: "component";
|
|
324
|
+
};
|
|
251
325
|
|
|
252
326
|
export type ComponentFileVarComponent =
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
kind: "component";
|
|
256
|
-
};
|
|
327
|
+
| ComponentFileVarFunctionComponent
|
|
328
|
+
| ComponentFileVarClassComponent;
|
|
257
329
|
|
|
258
330
|
export type ComponentFileVarState = ComponentFileVarReact<"data", "state"> & {
|
|
259
331
|
setter?: string | undefined;
|
|
332
|
+
stateType?: TypeData | undefined;
|
|
260
333
|
};
|
|
261
334
|
|
|
262
335
|
export type ComponentFileVarCallHook = ComponentFileVarReact<"data", "hook"> & {
|
|
263
|
-
call: {
|
|
336
|
+
call: {
|
|
337
|
+
id: string;
|
|
338
|
+
name: string;
|
|
339
|
+
resolvedId?: string | undefined;
|
|
340
|
+
unresolvedWorkspace?: boolean | undefined;
|
|
341
|
+
};
|
|
264
342
|
};
|
|
265
343
|
|
|
266
344
|
export type ComponentFileVarRef = ComponentFileVarReact<"data", "ref"> & {
|
|
267
345
|
defaultData: PropDataType;
|
|
268
346
|
};
|
|
269
347
|
|
|
270
|
-
export type ComponentFileVarHook = ComponentFileVarReactFunction<
|
|
348
|
+
export type ComponentFileVarHook = ComponentFileVarReactFunction<
|
|
349
|
+
"hook",
|
|
350
|
+
"function"
|
|
351
|
+
> &
|
|
271
352
|
HookInfo & {
|
|
272
353
|
kind: "hook";
|
|
273
354
|
};
|
|
@@ -283,9 +364,10 @@ export type ComponentFileVarNormalBase<TType extends VarType> = ComponentLoc &
|
|
|
283
364
|
kind: "normal";
|
|
284
365
|
};
|
|
285
366
|
|
|
286
|
-
export type ComponentFileVarNormalFunction =
|
|
287
|
-
|
|
288
|
-
|
|
367
|
+
export type ComponentFileVarNormalFunction = ComponentFileVarNormalBase<
|
|
368
|
+
"function" | "class"
|
|
369
|
+
> &
|
|
370
|
+
ComponentFileVarBaseTypeFunction<"normal">;
|
|
289
371
|
export type ComponentFileVarNormalData = ComponentFileVarNormalBase<"data"> &
|
|
290
372
|
ComponentFileVarBaseTypeData<"normal">;
|
|
291
373
|
|
|
@@ -298,12 +380,29 @@ export interface ComponentFileVarJSX extends ComponentFileVarBase<
|
|
|
298
380
|
"normal"
|
|
299
381
|
> {
|
|
300
382
|
type: "jsx";
|
|
301
|
-
|
|
302
|
-
props: ComponentInfoRenderDependency[];
|
|
303
|
-
children: Record<string, ComponentInfoRender>;
|
|
383
|
+
render: ComponentInfoRender | null;
|
|
304
384
|
srcId?: string | undefined;
|
|
305
385
|
}
|
|
306
386
|
|
|
387
|
+
export type ComponentFileVarClass = ComponentFileVarBaseTypeData<
|
|
388
|
+
"class",
|
|
389
|
+
"data"
|
|
390
|
+
> & {
|
|
391
|
+
var: Record<string, ComponentFileVar>;
|
|
392
|
+
scope: VariableScope;
|
|
393
|
+
superClass?: { id?: string; name: string } | undefined;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export type ComponentFileVarMethod = ComponentFileVarBaseTypeFunction<
|
|
397
|
+
"method",
|
|
398
|
+
"function"
|
|
399
|
+
>;
|
|
400
|
+
|
|
401
|
+
export type ComponentFileVarProperty = ComponentFileVarBaseTypeData<
|
|
402
|
+
"property",
|
|
403
|
+
"data"
|
|
404
|
+
>;
|
|
405
|
+
|
|
307
406
|
export type ComponentFileVarFunction =
|
|
308
407
|
ComponentFileVarBaseTypeFunction<"normal"> & {
|
|
309
408
|
kind: "normal";
|
|
@@ -319,7 +418,10 @@ export type ComponentFileVar =
|
|
|
319
418
|
| ComponentFileVarCallback
|
|
320
419
|
| MemoFileVarHook
|
|
321
420
|
| ComponentFileVarFunction
|
|
322
|
-
| ComponentFileVarJSX
|
|
421
|
+
| ComponentFileVarJSX
|
|
422
|
+
| ComponentFileVarClass
|
|
423
|
+
| ComponentFileVarMethod
|
|
424
|
+
| ComponentFileVarProperty;
|
|
323
425
|
|
|
324
426
|
export type IResolveAddRender = {
|
|
325
427
|
type: "comAddRender";
|
|
@@ -330,13 +432,13 @@ export type IResolveAddRender = {
|
|
|
330
432
|
kind?: ComponentInfoRender["kind"] | undefined;
|
|
331
433
|
parentId?: string | undefined;
|
|
332
434
|
};
|
|
333
|
-
|
|
334
435
|
export type IResolveAddHook = {
|
|
335
436
|
type: "comAddHook";
|
|
336
437
|
name: string;
|
|
337
438
|
fileName: string;
|
|
338
439
|
hook: string;
|
|
339
440
|
loc: VariableLoc;
|
|
441
|
+
parentId?: string | undefined;
|
|
340
442
|
};
|
|
341
443
|
|
|
342
444
|
export type IResolveCallHook = {
|
|
@@ -359,12 +461,31 @@ export type IResolveComPropsTsType = {
|
|
|
359
461
|
id: string;
|
|
360
462
|
};
|
|
361
463
|
|
|
464
|
+
export type IResolveComClassStateTsType = {
|
|
465
|
+
type: "comClassStateTsType";
|
|
466
|
+
fileName: string;
|
|
467
|
+
id: string;
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
export type IResolveCrossPackageImport = {
|
|
471
|
+
type: "crossPackageImport";
|
|
472
|
+
fileName: string;
|
|
473
|
+
source: string;
|
|
474
|
+
localName: string;
|
|
475
|
+
importedName: string | null;
|
|
476
|
+
importType: ComponentFileImport["type"];
|
|
477
|
+
importKind: ComponentFileImport["importKind"];
|
|
478
|
+
message?: string | undefined;
|
|
479
|
+
};
|
|
480
|
+
|
|
362
481
|
export type ComponentDBResolve =
|
|
363
482
|
| IResolveAddRender
|
|
364
483
|
| IResolveAddHook
|
|
365
484
|
| IResolveCallHook
|
|
366
485
|
| IResolveTsType
|
|
367
|
-
| IResolveComPropsTsType
|
|
486
|
+
| IResolveComPropsTsType
|
|
487
|
+
| IResolveComClassStateTsType
|
|
488
|
+
| IResolveCrossPackageImport;
|
|
368
489
|
|
|
369
490
|
export type ComponentFile = {
|
|
370
491
|
path: string;
|
|
@@ -376,4 +497,7 @@ export type ComponentFile = {
|
|
|
376
497
|
defaultExport: string | null;
|
|
377
498
|
tsTypes: Record<string, TypeDataDeclare>;
|
|
378
499
|
var: Record<string, ComponentFileVar>;
|
|
500
|
+
blockScopes?: ComponentFileBlockScope[] | undefined;
|
|
501
|
+
relations?: ComponentRelation[] | undefined;
|
|
502
|
+
package_id?: string | undefined;
|
|
379
503
|
};
|
package/src/db/sqlite.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Database } from "better-sqlite3";
|
|
2
2
|
import type {
|
|
3
|
+
AnalysisRunRow,
|
|
4
|
+
FileRunStatusRow,
|
|
5
|
+
FileAnalysisErrorRow,
|
|
6
|
+
ResolveErrorRow,
|
|
3
7
|
FileRow,
|
|
4
8
|
EntityRow,
|
|
5
9
|
RelationRow,
|
|
@@ -7,6 +11,8 @@ import type {
|
|
|
7
11
|
SymbolRow,
|
|
8
12
|
RenderRow,
|
|
9
13
|
ExportRow,
|
|
14
|
+
PackageRow,
|
|
15
|
+
PackageDependencyRow,
|
|
10
16
|
} from "../index.js";
|
|
11
17
|
|
|
12
18
|
export class SqliteDB {
|
|
@@ -38,6 +44,12 @@ export class SqliteDB {
|
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
public getAllData() {
|
|
47
|
+
const packages = this.db
|
|
48
|
+
.prepare("SELECT * FROM packages")
|
|
49
|
+
.all() as PackageRow[];
|
|
50
|
+
const package_dependencies = this.db
|
|
51
|
+
.prepare("SELECT * FROM package_dependencies")
|
|
52
|
+
.all() as PackageDependencyRow[];
|
|
41
53
|
const files = this.db.prepare("SELECT * FROM files").all() as FileRow[];
|
|
42
54
|
const entities = this.db
|
|
43
55
|
.prepare("SELECT * FROM entities")
|
|
@@ -55,8 +67,22 @@ export class SqliteDB {
|
|
|
55
67
|
const relations = this.db
|
|
56
68
|
.prepare("SELECT * FROM relations")
|
|
57
69
|
.all() as RelationRow[];
|
|
70
|
+
const analysis_runs = this.db
|
|
71
|
+
.prepare("SELECT * FROM analysis_runs")
|
|
72
|
+
.all() as AnalysisRunRow[];
|
|
73
|
+
const file_run_status = this.db
|
|
74
|
+
.prepare("SELECT * FROM file_run_status")
|
|
75
|
+
.all() as FileRunStatusRow[];
|
|
76
|
+
const file_analysis_errors = this.db
|
|
77
|
+
.prepare("SELECT * FROM file_analysis_errors")
|
|
78
|
+
.all() as FileAnalysisErrorRow[];
|
|
79
|
+
const resolve_errors = this.db
|
|
80
|
+
.prepare("SELECT * FROM resolve_errors")
|
|
81
|
+
.all() as ResolveErrorRow[];
|
|
58
82
|
|
|
59
83
|
return {
|
|
84
|
+
packages,
|
|
85
|
+
package_dependencies,
|
|
60
86
|
files,
|
|
61
87
|
entities,
|
|
62
88
|
scopes,
|
|
@@ -64,6 +90,10 @@ export class SqliteDB {
|
|
|
64
90
|
renders,
|
|
65
91
|
exports,
|
|
66
92
|
relations,
|
|
93
|
+
analysis_runs,
|
|
94
|
+
file_run_status,
|
|
95
|
+
file_analysis_errors,
|
|
96
|
+
resolve_errors,
|
|
67
97
|
};
|
|
68
98
|
}
|
|
69
99
|
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
PropData,
|
|
5
5
|
EffectInfo,
|
|
6
6
|
ComponentDBResolve,
|
|
7
|
+
RelationKind,
|
|
7
8
|
} from "./component.js";
|
|
8
9
|
|
|
9
10
|
export type DataEdge = {
|
|
@@ -12,6 +13,21 @@ export type DataEdge = {
|
|
|
12
13
|
label: string;
|
|
13
14
|
};
|
|
14
15
|
|
|
16
|
+
export interface PackageRow {
|
|
17
|
+
id: string; // usually name@version or path
|
|
18
|
+
name: string;
|
|
19
|
+
version: string;
|
|
20
|
+
path: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface PackageDependencyRow {
|
|
24
|
+
id: number;
|
|
25
|
+
package_id: string;
|
|
26
|
+
dependency_name: string;
|
|
27
|
+
dependency_version: string;
|
|
28
|
+
is_dev: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
15
31
|
export interface EntityRow {
|
|
16
32
|
id: string;
|
|
17
33
|
scope_id: string;
|
|
@@ -63,21 +79,139 @@ export interface RenderRow {
|
|
|
63
79
|
export interface RelationRow {
|
|
64
80
|
from_id: string;
|
|
65
81
|
to_id: string;
|
|
66
|
-
kind:
|
|
82
|
+
kind: RelationKind;
|
|
67
83
|
line: number | null;
|
|
68
84
|
column: number | null;
|
|
69
85
|
data_json: string | null;
|
|
70
86
|
}
|
|
71
87
|
|
|
88
|
+
export type {
|
|
89
|
+
RelationKind,
|
|
90
|
+
UsageOccurrence,
|
|
91
|
+
ComponentRelation,
|
|
92
|
+
} from "./component.js";
|
|
93
|
+
|
|
72
94
|
export interface FileRow {
|
|
73
95
|
id: number;
|
|
74
96
|
path: string;
|
|
97
|
+
package_id: string | null;
|
|
75
98
|
hash: string;
|
|
76
99
|
fingerprint: string;
|
|
77
100
|
default_export: string | null;
|
|
78
101
|
star_exports_json: string | null;
|
|
79
102
|
}
|
|
80
103
|
|
|
104
|
+
export interface AnalysisRunRow {
|
|
105
|
+
id: string;
|
|
106
|
+
package_id: string | null;
|
|
107
|
+
src_dir: string;
|
|
108
|
+
status: string;
|
|
109
|
+
started_at: string;
|
|
110
|
+
finished_at: string | null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface FileRunStatusRow {
|
|
114
|
+
id: string;
|
|
115
|
+
run_id: string;
|
|
116
|
+
package_id: string | null;
|
|
117
|
+
file_path: string;
|
|
118
|
+
status: string;
|
|
119
|
+
started_at: string;
|
|
120
|
+
finished_at: string | null;
|
|
121
|
+
attempt: number;
|
|
122
|
+
file_hash: string | null;
|
|
123
|
+
fingerprint: string | null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface FileAnalysisErrorRow {
|
|
127
|
+
id: string;
|
|
128
|
+
run_id: string;
|
|
129
|
+
package_id: string | null;
|
|
130
|
+
file_path: string;
|
|
131
|
+
stage: string;
|
|
132
|
+
error_code: string | null;
|
|
133
|
+
message: string;
|
|
134
|
+
line: number | null;
|
|
135
|
+
column: number | null;
|
|
136
|
+
stack: string | null;
|
|
137
|
+
parser: string | null;
|
|
138
|
+
file_hash: string | null;
|
|
139
|
+
fingerprint: string | null;
|
|
140
|
+
created_at: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface ResolveErrorRow {
|
|
144
|
+
id: string;
|
|
145
|
+
run_id: string;
|
|
146
|
+
package_id: string | null;
|
|
147
|
+
file_path: string;
|
|
148
|
+
scope_id: string | null;
|
|
149
|
+
entity_id: string | null;
|
|
150
|
+
relation_kind: string;
|
|
151
|
+
source_name: string | null;
|
|
152
|
+
source_module: string | null;
|
|
153
|
+
target_hint: string | null;
|
|
154
|
+
resolver_stage: string;
|
|
155
|
+
message: string;
|
|
156
|
+
loc_line: number | null;
|
|
157
|
+
loc_column: number | null;
|
|
158
|
+
retry_count: number;
|
|
159
|
+
created_at: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface WorkspacePackageRow {
|
|
163
|
+
package_id: string;
|
|
164
|
+
name: string;
|
|
165
|
+
version: string | null;
|
|
166
|
+
path: string;
|
|
167
|
+
db_path: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface WorkspaceRunRow {
|
|
171
|
+
id: string;
|
|
172
|
+
root_dir: string;
|
|
173
|
+
status: string;
|
|
174
|
+
started_at: string;
|
|
175
|
+
finished_at: string | null;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface PackageRunSummaryRow {
|
|
179
|
+
id: string;
|
|
180
|
+
workspace_run_id: string;
|
|
181
|
+
package_id: string;
|
|
182
|
+
analysis_run_id: string;
|
|
183
|
+
status: string;
|
|
184
|
+
files_total: number;
|
|
185
|
+
files_succeeded: number;
|
|
186
|
+
files_failed: number;
|
|
187
|
+
resolve_errors: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface PackageRelationRow {
|
|
191
|
+
from_package_id: string;
|
|
192
|
+
to_package_id: string;
|
|
193
|
+
relation_kind: string;
|
|
194
|
+
source_file_path: string | null;
|
|
195
|
+
target_file_path: string | null;
|
|
196
|
+
source_symbol: string | null;
|
|
197
|
+
target_symbol: string | null;
|
|
198
|
+
run_id: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface CrossPackageResolveErrorRow {
|
|
202
|
+
id: string;
|
|
203
|
+
run_id: string;
|
|
204
|
+
from_package_id: string;
|
|
205
|
+
file_path: string;
|
|
206
|
+
source_name: string | null;
|
|
207
|
+
source_module: string | null;
|
|
208
|
+
relation_kind: string;
|
|
209
|
+
message: string;
|
|
210
|
+
loc_line: number | null;
|
|
211
|
+
loc_column: number | null;
|
|
212
|
+
created_at: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
81
215
|
export interface ExportRow {
|
|
82
216
|
id: string;
|
|
83
217
|
scope_id: string;
|
|
@@ -88,6 +222,8 @@ export interface ExportRow {
|
|
|
88
222
|
}
|
|
89
223
|
|
|
90
224
|
export type DatabaseData = {
|
|
225
|
+
packages?: PackageRow[] | undefined;
|
|
226
|
+
package_dependencies?: PackageDependencyRow[] | undefined;
|
|
91
227
|
files: FileRow[];
|
|
92
228
|
entities: EntityRow[];
|
|
93
229
|
scopes: ScopeRow[];
|
|
@@ -95,7 +231,11 @@ export type DatabaseData = {
|
|
|
95
231
|
renders: RenderRow[];
|
|
96
232
|
exports: ExportRow[];
|
|
97
233
|
relations: RelationRow[];
|
|
98
|
-
|
|
234
|
+
analysis_runs?: AnalysisRunRow[] | undefined;
|
|
235
|
+
file_run_status?: FileRunStatusRow[] | undefined;
|
|
236
|
+
file_analysis_errors?: FileAnalysisErrorRow[] | undefined;
|
|
237
|
+
resolve_errors?: ResolveErrorRow[] | undefined;
|
|
238
|
+
diff?: AnalyzedDiff | undefined;
|
|
99
239
|
};
|
|
100
240
|
|
|
101
241
|
export type AnalyzedDiff = {
|
|
@@ -132,7 +272,7 @@ export interface BenchmarkStep {
|
|
|
132
272
|
export interface BenchmarkResult {
|
|
133
273
|
scenarioId: string;
|
|
134
274
|
projectName: string;
|
|
135
|
-
approach: "baseline" | "
|
|
275
|
+
approach: "baseline" | "nexiq-cold" | "nexiq-warm";
|
|
136
276
|
testType: "single-prompt" | "planning";
|
|
137
277
|
model: string;
|
|
138
278
|
success: boolean;
|
|
@@ -145,3 +285,4 @@ export interface BenchmarkResult {
|
|
|
145
285
|
export * from "./types/index.js";
|
|
146
286
|
export * from "./component.js";
|
|
147
287
|
export * from "./utils.js";
|
|
288
|
+
export * as FlatBuffers from "./nexiq/graph-view.js";
|