@lowgular/code-graph 0.0.1
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/apps/code-graph/src/main.js +50 -0
- package/libs/cli/code-graph/src/index.js +39 -0
- package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.js +72 -0
- package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.stateful.js +68 -0
- package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.doc.js +147 -0
- package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.graph.js +55 -0
- package/libs/cli/code-graph/src/lib/class-declarations/index.js +27 -0
- package/libs/cli/code-graph/src/lib/code.graph.factory.js +63 -0
- package/libs/cli/code-graph/src/lib/code.graph.js +62 -0
- package/libs/cli/code-graph/src/lib/core/core.js +58 -0
- package/libs/cli/code-graph/src/lib/core.js +85 -0
- package/libs/cli/code-graph/src/lib/decorators/index.js +36 -0
- package/libs/cli/code-graph/src/lib/docs/index.js +21 -0
- package/libs/cli/code-graph/src/lib/docs/specs.js +36 -0
- package/libs/cli/code-graph/src/lib/expressions/call-expressions.graph.js +28 -0
- package/libs/cli/code-graph/src/lib/fixtures/reactive-event-bus/src/app/examples.event-bus.js +53 -0
- package/libs/cli/code-graph/src/lib/method-declarations/index.js +23 -0
- package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.doc.js +106 -0
- package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.graph.js +56 -0
- package/libs/cli/code-graph/src/lib/parameters/index.js +42 -0
- package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.evals.js +139 -0
- package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.js +104 -0
- package/libs/cli/code-graph/src/lib/property-declarations/index.js +25 -0
- package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.doc.js +74 -0
- package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.graph.js +43 -0
- package/libs/cli/code-graph/src/lib/tools/index.js +34 -0
- package/libs/cli/code-graph/src/lib/tools/match-code-graph.tool.js +64 -0
- package/libs/cli/code-graph/src/lib/types/index.js +99 -0
- package/libs/cli/code-graph/src/lib/v2/extractors/extractor.doc.js +345 -0
- package/libs/cli/code-graph/src/lib/v2/extractors/extractor.js +52 -0
- package/libs/cli/code-graph/src/lib/v2/extractors/index.js +23 -0
- package/libs/cli/code-graph/src/lib/v2/graph-builder/code-graph.builder.js +76 -0
- package/libs/cli/code-graph/src/lib/v2/graph-builder/index.js +21 -0
- package/libs/cli/code-graph/src/lib/v2/graph-builder/node.processor.js +48 -0
- package/libs/cli/code-graph/src/lib/v2/graph-builder/relationship.processor.js +79 -0
- package/libs/cli/code-graph/src/lib/v2/graph-builder/type.processor.js +45 -0
- package/libs/cli/code-graph/src/lib/v2/index.js +37 -0
- package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.doc.js +220 -0
- package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.tool.js +42 -0
- package/libs/cli/cypher/src/index.js +25 -0
- package/libs/cli/cypher/src/lib/docs/features/advanced-optional-match.feature.js +277 -0
- package/libs/cli/cypher/src/lib/docs/features/anonymous-relationship.feature.js +69 -0
- package/libs/cli/cypher/src/lib/docs/features/anonymous-variable-length.feature.js +105 -0
- package/libs/cli/cypher/src/lib/docs/features/basic-filtering.feature.js +70 -0
- package/libs/cli/cypher/src/lib/docs/features/basic-optional-match.feature.js +99 -0
- package/libs/cli/cypher/src/lib/docs/features/basic-relationship.feature.js +125 -0
- package/libs/cli/cypher/src/lib/docs/features/index.js +51 -0
- package/libs/cli/cypher/src/lib/docs/features/limit.feature.js +50 -0
- package/libs/cli/cypher/src/lib/docs/features/match-nodes.feature.js +106 -0
- package/libs/cli/cypher/src/lib/docs/features/multiple-relationship-types.feature.js +105 -0
- package/libs/cli/cypher/src/lib/docs/features/order-by.feature.js +143 -0
- package/libs/cli/cypher/src/lib/docs/features/property-matching.feature.js +152 -0
- package/libs/cli/cypher/src/lib/docs/features/relationship-without-variable.feature.js +48 -0
- package/libs/cli/cypher/src/lib/docs/features/return-statement.feature.js +65 -0
- package/libs/cli/cypher/src/lib/docs/features/unidirected-relationship.feature.js +82 -0
- package/libs/cli/cypher/src/lib/docs/features/variable-length-path.feature.js +136 -0
- package/libs/cli/cypher/src/lib/docs/features/where-conditional.feature.js +187 -0
- package/libs/cli/cypher/src/lib/docs/features/where-operators.feature.js +302 -0
- package/libs/cli/cypher/src/lib/docs/prompts.js +36 -0
- package/libs/cli/cypher/src/lib/docs/specs.js +181 -0
- package/libs/cli/cypher/src/lib/executor/condition-evaluator.js +158 -0
- package/libs/cli/cypher/src/lib/executor/executor.js +83 -0
- package/libs/cli/cypher/src/lib/executor/graph.js +15 -0
- package/libs/cli/cypher/src/lib/executor/match-engine.js +153 -0
- package/libs/cli/cypher/src/lib/executor/pattern-matcher.js +109 -0
- package/libs/cli/cypher/src/lib/executor/relationship-navigator.js +64 -0
- package/libs/cli/cypher/src/lib/executor/result-formatter.js +143 -0
- package/libs/cli/cypher/src/lib/executor/traverse-engine.js +164 -0
- package/libs/cli/cypher/src/lib/executor/utils.js +37 -0
- package/libs/cli/cypher/src/lib/graph.stub.js +63 -0
- package/libs/cli/cypher/src/lib/index.js +74 -0
- package/libs/cli/cypher/src/lib/lexer.js +398 -0
- package/libs/cli/cypher/src/lib/parser.js +602 -0
- package/libs/cli/cypher/src/lib/validator/query-validator.js +95 -0
- package/libs/cli/cypher/src/lib/validator/supported-features.config.js +111 -0
- package/libs/cli/cypher/src/lib/validator/unsupported-features.config.js +150 -0
- package/libs/cli/shared/src/index.js +53 -0
- package/libs/cli/shared/src/lib/admin-token.js +121 -0
- package/libs/cli/shared/src/lib/config.js +49 -0
- package/libs/cli/shared/src/lib/consts.js +57 -0
- package/libs/cli/shared/src/lib/core.js +46 -0
- package/libs/cli/shared/src/lib/infrastructure/cli.js +47 -0
- package/libs/cli/shared/src/lib/infrastructure/config.js +47 -0
- package/libs/cli/shared/src/lib/infrastructure/config.reporitory.js +51 -0
- package/libs/cli/shared/src/lib/infrastructure/formatters/console-formatter.js +96 -0
- package/libs/cli/shared/src/lib/infrastructure/formatters/index.js +41 -0
- package/libs/cli/shared/src/lib/infrastructure/formatters/json-formatter.js +64 -0
- package/libs/cli/shared/src/lib/infrastructure/formatters/markdown-formatter.js +120 -0
- package/libs/cli/shared/src/lib/infrastructure/formatters/types.js +15 -0
- package/libs/cli/shared/src/lib/infrastructure/formatters/utils.js +72 -0
- package/libs/cli/shared/src/lib/infrastructure/git.js +147 -0
- package/libs/cli/shared/src/lib/infrastructure/http.js +257 -0
- package/libs/cli/shared/src/lib/infrastructure/markdown.js +95 -0
- package/libs/cli/shared/src/lib/infrastructure/transformers/embeddings.js +88 -0
- package/libs/cli/shared/src/lib/infrastructure/transformers/index.js +25 -0
- package/libs/cli/shared/src/lib/infrastructure/transformers/rag-eval.js +154 -0
- package/libs/cli/shared/src/lib/infrastructure/transformers/similarity.js +210 -0
- package/libs/cli/shared/src/lib/infrastructure/workspace.js +297 -0
- package/libs/cli/shared/src/lib/infrastructure/yaml.js +237 -0
- package/libs/cli/shared/src/lib/lowgular.config.js +120 -0
- package/libs/cli/shared/src/lib/token.js +135 -0
- package/libs/cli/shared/src/lib/utils/solution.util.js +35 -0
- package/libs/cli/shared/src/lib/utils/utils.js +89 -0
- package/libs/cli/typescript/src/index.js +21 -0
- package/libs/cli/typescript/src/lib/base/index.js +23 -0
- package/libs/cli/typescript/src/lib/base/nameable.js +34 -0
- package/libs/cli/typescript/src/lib/base/nodeable.js +36 -0
- package/libs/cli/typescript/src/lib/class.implementation.js +52 -0
- package/libs/cli/typescript/src/lib/core/declaration.registry.js +107 -0
- package/libs/cli/typescript/src/lib/core/design-pattern.js +55 -0
- package/libs/cli/typescript/src/lib/core/index.js +35 -0
- package/libs/cli/typescript/src/lib/core/navigable-declaration.js +69 -0
- package/libs/cli/typescript/src/lib/core/program-context.js +71 -0
- package/libs/cli/typescript/src/lib/core/syntax-kind.utils.js +40 -0
- package/libs/cli/typescript/src/lib/core/type.js +374 -0
- package/libs/cli/typescript/src/lib/declaration.abstraction.js +90 -0
- package/libs/cli/typescript/src/lib/decorator.implementation.js +35 -0
- package/libs/cli/typescript/src/lib/enum.implementation.js +35 -0
- package/libs/cli/typescript/src/lib/function-declaration.implementation.js +35 -0
- package/libs/cli/typescript/src/lib/index.js +57 -0
- package/libs/cli/typescript/src/lib/interface.implementation.js +51 -0
- package/libs/cli/typescript/src/lib/members/method-abstraction.resolver.js +90 -0
- package/libs/cli/typescript/src/lib/members/method-declaration.implementation.js +44 -0
- package/libs/cli/typescript/src/lib/members/method-signature.implementation.js +46 -0
- package/libs/cli/typescript/src/lib/members/method.util.js +32 -0
- package/libs/cli/typescript/src/lib/members/parameter.implementation.js +38 -0
- package/libs/cli/typescript/src/lib/members/property-declaration.implementation.js +64 -0
- package/libs/cli/typescript/src/lib/members/property-signature.implementation.js +34 -0
- package/libs/cli/typescript/src/lib/members/property.util.js +61 -0
- package/libs/cli/typescript/src/lib/members/statements/expressions/binary-expression.implementation.js +42 -0
- package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js +114 -0
- package/libs/cli/typescript/src/lib/members/statements/expressions/expression.abstraction.js +188 -0
- package/libs/cli/typescript/src/lib/members/statements/expressions/property-access-expression.implementation.js +35 -0
- package/libs/cli/typescript/src/lib/members/statements/expressions/unary-expression.implementation.js +51 -0
- package/libs/cli/typescript/src/lib/members/statements/statement.implementation.js +49 -0
- package/libs/cli/typescript/src/lib/members/statements/utils.js +51 -0
- package/libs/cli/typescript/src/lib/plugins/built-in.plugin.js +258 -0
- package/libs/cli/typescript/src/lib/plugins/plugin.interface.js +15 -0
- package/libs/cli/typescript/src/lib/plugins/rxjs.plugin.js +228 -0
- package/libs/cli/typescript/src/lib/plugins/signal.plugin.js +126 -0
- package/libs/cli/typescript/src/lib/plugins/stubs.js +66 -0
- package/libs/cli/typescript/src/lib/type-alias.implementation.js +72 -0
- package/libs/cli/typescript/src/lib/utils.js +39 -0
- package/libs/cli/typescript/src/lib/variable-declaration.implementation.js +35 -0
- package/libs/core/codegular/src/index.js +21 -0
- package/libs/core/codegular/src/lib/index.js +29 -0
- package/libs/core/codegular/src/lib/node.js +112 -0
- package/libs/core/codegular/src/lib/program.js +92 -0
- package/libs/core/codegular/src/lib/string.js +168 -0
- package/libs/core/codegular/src/lib/type-checker.js +170 -0
- package/libs/core/codegular/src/lib/utils.js +347 -0
- package/main.js +43 -0
- package/package.json +12 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var reactive_state_exports = {};
|
|
19
|
+
__export(reactive_state_exports, {
|
|
20
|
+
PROPERTY_STUB: () => PROPERTY_STUB,
|
|
21
|
+
REACTIVE_STATE_PROPERTY_ABSTRACTION: () => REACTIVE_STATE_PROPERTY_ABSTRACTION,
|
|
22
|
+
REACTIVE_STATE_PROPERTY_EXAMPLES: () => REACTIVE_STATE_PROPERTY_EXAMPLES,
|
|
23
|
+
REACTIVE_STATE_PROPERTY_MATCH_QUERY: () => REACTIVE_STATE_PROPERTY_MATCH_QUERY
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(reactive_state_exports);
|
|
26
|
+
const PROPERTY_STUB = `
|
|
27
|
+
import { Subject, BehaviorSubject, ReplaySubject, AsyncSubject } from 'rxjs';
|
|
28
|
+
import { signal, computed, writableSignal, toSignal } from '@angular/core';
|
|
29
|
+
|
|
30
|
+
export class RxJSClass {
|
|
31
|
+
private readonly subject = new Subject<number>();
|
|
32
|
+
private readonly behaviorSubject = new BehaviorSubject<number>(0);
|
|
33
|
+
private readonly replaySubject = new ReplaySubject<number>(10);
|
|
34
|
+
private readonly asyncSubject = new AsyncSubject<number>();
|
|
35
|
+
private readonly observable = new Observable<number>();
|
|
36
|
+
private readonly asObservable = this.subject.asObservable();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class SignalClass {
|
|
40
|
+
private readonly signal = signal<number>(0);
|
|
41
|
+
private readonly computed = computed(() => this.counter.value * 2);
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
const REACTIVE_STATE_PROPERTY_MATCH_QUERY = `(p:PropertyDeclaration)-[:HAS_TYPE]->(t:Type)
|
|
45
|
+
WHERE t.name STARTS WITH 'Subject'
|
|
46
|
+
OR t.name STARTS WITH 'BehaviorSubject'
|
|
47
|
+
OR t.name STARTS WITH 'ReplaySubject'
|
|
48
|
+
OR t.name STARTS WITH 'AsyncSubject'
|
|
49
|
+
OR t.name STARTS WITH 'WritableSignal'`;
|
|
50
|
+
const REACTIVE_STATE_PROPERTY_EXAMPLES = [
|
|
51
|
+
{
|
|
52
|
+
userPrompt: "Find all reactive properties",
|
|
53
|
+
given: PROPERTY_STUB,
|
|
54
|
+
when: `MATCH ${REACTIVE_STATE_PROPERTY_MATCH_QUERY}
|
|
55
|
+
RETURN p, t`,
|
|
56
|
+
then: [
|
|
57
|
+
[
|
|
58
|
+
{
|
|
59
|
+
labels: ["PropertyDeclaration"],
|
|
60
|
+
name: "subject"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
{
|
|
65
|
+
labels: ["PropertyDeclaration"],
|
|
66
|
+
name: "behaviorSubject"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
{
|
|
71
|
+
labels: ["PropertyDeclaration"],
|
|
72
|
+
name: "replaySubject"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
{
|
|
77
|
+
labels: ["PropertyDeclaration"],
|
|
78
|
+
name: "asyncSubject"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
{
|
|
83
|
+
labels: ["PropertyDeclaration"],
|
|
84
|
+
name: "signal"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
];
|
|
90
|
+
const REACTIVE_STATE_PROPERTY_ABSTRACTION = {
|
|
91
|
+
id: "reactive-state-property",
|
|
92
|
+
name: "Reactive State Property",
|
|
93
|
+
schema: {},
|
|
94
|
+
relationships: {},
|
|
95
|
+
description: "Abstraction on top of the TypeScript PropertyDeclaration that holds reactive state (primitives, data structures, or custom types). Instantiated and can be set/read reactively",
|
|
96
|
+
examples: REACTIVE_STATE_PROPERTY_EXAMPLES
|
|
97
|
+
};
|
|
98
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
+
0 && (module.exports = {
|
|
100
|
+
PROPERTY_STUB,
|
|
101
|
+
REACTIVE_STATE_PROPERTY_ABSTRACTION,
|
|
102
|
+
REACTIVE_STATE_PROPERTY_EXAMPLES,
|
|
103
|
+
REACTIVE_STATE_PROPERTY_MATCH_QUERY
|
|
104
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var property_declarations_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(property_declarations_exports);
|
|
17
|
+
__reExport(property_declarations_exports, require("./abstractions/reactive-state"), module.exports);
|
|
18
|
+
__reExport(property_declarations_exports, require("./property-declarations.doc"), module.exports);
|
|
19
|
+
__reExport(property_declarations_exports, require("./property-declarations.graph"), module.exports);
|
|
20
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
21
|
+
0 && (module.exports = {
|
|
22
|
+
...require("./abstractions/reactive-state"),
|
|
23
|
+
...require("./property-declarations.doc"),
|
|
24
|
+
...require("./property-declarations.graph")
|
|
25
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var property_declarations_doc_exports = {};
|
|
19
|
+
__export(property_declarations_doc_exports, {
|
|
20
|
+
PROPERTY_DECLARATION_DOC: () => PROPERTY_DECLARATION_DOC,
|
|
21
|
+
PROPERTY_EXAMPLES: () => PROPERTY_EXAMPLES
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(property_declarations_doc_exports);
|
|
24
|
+
var import_core = require("../core/core");
|
|
25
|
+
const STUB = `class Test {
|
|
26
|
+
num = 1;
|
|
27
|
+
str = 'test';
|
|
28
|
+
bool = true;
|
|
29
|
+
}`;
|
|
30
|
+
const PROPERTY_EXAMPLES = [
|
|
31
|
+
{
|
|
32
|
+
userPrompt: "Find all property declarations",
|
|
33
|
+
given: STUB,
|
|
34
|
+
when: `MATCH (propDecl:PropertyDeclaration) RETURN propDecl`,
|
|
35
|
+
then: [
|
|
36
|
+
[
|
|
37
|
+
{
|
|
38
|
+
labels: ["PropertyDeclaration"],
|
|
39
|
+
name: "num"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
{
|
|
44
|
+
labels: ["PropertyDeclaration"],
|
|
45
|
+
name: "str"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
{
|
|
50
|
+
labels: ["PropertyDeclaration"],
|
|
51
|
+
name: "bool"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
const PROPERTY_DECLARATION_DOC = {
|
|
58
|
+
id: "property-declaration",
|
|
59
|
+
name: "PropertyDeclaration",
|
|
60
|
+
schema: {
|
|
61
|
+
...import_core.NameableSchema,
|
|
62
|
+
modifiers: "string[]",
|
|
63
|
+
name: "string",
|
|
64
|
+
initializerText: "string"
|
|
65
|
+
},
|
|
66
|
+
relationships: {},
|
|
67
|
+
description: `The node represents TypeScript AST kind: PropertyDeclaration.`,
|
|
68
|
+
examples: PROPERTY_EXAMPLES
|
|
69
|
+
};
|
|
70
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
+
0 && (module.exports = {
|
|
72
|
+
PROPERTY_DECLARATION_DOC,
|
|
73
|
+
PROPERTY_EXAMPLES
|
|
74
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var property_declarations_graph_exports = {};
|
|
19
|
+
__export(property_declarations_graph_exports, {
|
|
20
|
+
appendClassPropertiesGraph: () => appendClassPropertiesGraph
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(property_declarations_graph_exports);
|
|
23
|
+
var import_class_declarations = require("../class-declarations/class-declarations.doc");
|
|
24
|
+
var import_code = require("../code.graph");
|
|
25
|
+
var import_core = require("../core/core");
|
|
26
|
+
const appendClassPropertiesGraph = (classCodeGraph, classId, classImplementation) => {
|
|
27
|
+
classImplementation.properties.forEach((p) => {
|
|
28
|
+
const propertyNode = (0, import_core.extendNameable)(p, {
|
|
29
|
+
modifiers: p.modifiers,
|
|
30
|
+
initializerText: p.initializerText
|
|
31
|
+
});
|
|
32
|
+
(0, import_code.addNode)(classCodeGraph, propertyNode);
|
|
33
|
+
(0, import_code.addEdge)(classCodeGraph, {
|
|
34
|
+
source: classId,
|
|
35
|
+
target: propertyNode.id,
|
|
36
|
+
type: import_class_declarations.CLASS_DECLARATION_EDGE_TYPES.HAS_PROPERTY
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
appendClassPropertiesGraph
|
|
43
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var tools_exports = {};
|
|
19
|
+
__export(tools_exports, {
|
|
20
|
+
TOOLS: () => TOOLS
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(tools_exports);
|
|
23
|
+
var import_match_code_graph = require("./match-code-graph.tool");
|
|
24
|
+
const TOOLS = {
|
|
25
|
+
matchCodeGraph: import_match_code_graph.matchCodeGraphTool,
|
|
26
|
+
matchAll: import_match_code_graph.matchAllTool,
|
|
27
|
+
query: import_match_code_graph.queryTool,
|
|
28
|
+
queryFromProgram: import_match_code_graph.queryToolFromProgram,
|
|
29
|
+
queryFromGraph: import_match_code_graph.queryToolFromGraph
|
|
30
|
+
};
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
TOOLS
|
|
34
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var match_code_graph_tool_exports = {};
|
|
19
|
+
__export(match_code_graph_tool_exports, {
|
|
20
|
+
matchAllTool: () => matchAllTool,
|
|
21
|
+
matchCodeGraphTool: () => matchCodeGraphTool,
|
|
22
|
+
queryTool: () => queryTool,
|
|
23
|
+
queryToolFromGraph: () => queryToolFromGraph,
|
|
24
|
+
queryToolFromProgram: () => queryToolFromProgram
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(match_code_graph_tool_exports);
|
|
27
|
+
var import_cypher = require("@cli/cypher");
|
|
28
|
+
var import_codegular = require("@core/codegular");
|
|
29
|
+
var import_fs = require("fs");
|
|
30
|
+
var import_code_graph = require("../code.graph.factory");
|
|
31
|
+
const matchCodeGraphTool = async (tsConfigPath, query2) => {
|
|
32
|
+
const program = (0, import_codegular.createProgramFromTsConfig)(tsConfigPath);
|
|
33
|
+
const codeGraph = (0, import_code_graph.makeCodeGraphFromSourceFiles)(program);
|
|
34
|
+
const result = (0, import_cypher.matchAll)(query2, codeGraph);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
const queryTool = async (graphPath, queryStatements) => {
|
|
38
|
+
const codeGraph = JSON.parse((0, import_fs.readFileSync)(graphPath, "utf8"));
|
|
39
|
+
const result = (0, import_cypher.query)(queryStatements, codeGraph);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
const queryToolFromGraph = async (queryStatements, graph) => {
|
|
43
|
+
const result = (0, import_cypher.query)(queryStatements, graph);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
const queryToolFromProgram = async (program, queryStatements) => {
|
|
47
|
+
const codeGraph = (0, import_code_graph.makeCodeGraphFromSourceFiles)(program);
|
|
48
|
+
const result = (0, import_cypher.query)(queryStatements, codeGraph);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
const matchAllTool = async (query2, tsConfigPath = "./tsconfig.json") => {
|
|
52
|
+
const program = (0, import_codegular.createProgramFromTsConfig)(tsConfigPath);
|
|
53
|
+
const codeGraph = (0, import_code_graph.makeCodeGraphFromSourceFiles)(program);
|
|
54
|
+
const result = (0, import_cypher.matchAll)(query2, codeGraph);
|
|
55
|
+
return result;
|
|
56
|
+
};
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
matchAllTool,
|
|
60
|
+
matchCodeGraphTool,
|
|
61
|
+
queryTool,
|
|
62
|
+
queryToolFromGraph,
|
|
63
|
+
queryToolFromProgram
|
|
64
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var types_exports = {};
|
|
19
|
+
__export(types_exports, {
|
|
20
|
+
TYPE_DOC: () => TYPE_DOC,
|
|
21
|
+
TYPE_INFO_EDGE_TYPES: () => TYPE_INFO_EDGE_TYPES,
|
|
22
|
+
appendTypeInfoGraph: () => appendTypeInfoGraph
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(types_exports);
|
|
25
|
+
var import_typescript = require("@cli/typescript");
|
|
26
|
+
var import_core = require("../core/core");
|
|
27
|
+
var TYPE_INFO_EDGE_TYPES = /* @__PURE__ */ ((TYPE_INFO_EDGE_TYPES2) => {
|
|
28
|
+
TYPE_INFO_EDGE_TYPES2["HAS_TYPE"] = "HAS_TYPE";
|
|
29
|
+
TYPE_INFO_EDGE_TYPES2["HAS_BASE_TYPE"] = "HAS_BASE_TYPE";
|
|
30
|
+
TYPE_INFO_EDGE_TYPES2["HAS_DECLARATION"] = "HAS_DECLARATION";
|
|
31
|
+
TYPE_INFO_EDGE_TYPES2["HAS_TYPE_ARGUMENT"] = "HAS_TYPE_ARGUMENT";
|
|
32
|
+
return TYPE_INFO_EDGE_TYPES2;
|
|
33
|
+
})(TYPE_INFO_EDGE_TYPES || {});
|
|
34
|
+
const appendTypeInfoGraph = (classCodeGraph, sourceId, typeInfo) => {
|
|
35
|
+
if (typeInfo) {
|
|
36
|
+
const typeInfoId = typeInfo.name;
|
|
37
|
+
(0, import_typescript.addNode)(classCodeGraph, {
|
|
38
|
+
id: typeInfoId,
|
|
39
|
+
labels: [typeInfo.kind],
|
|
40
|
+
name: typeInfo.name
|
|
41
|
+
});
|
|
42
|
+
(0, import_typescript.addEdge)(classCodeGraph, {
|
|
43
|
+
source: sourceId,
|
|
44
|
+
target: typeInfoId,
|
|
45
|
+
type: "HAS_TYPE" /* HAS_TYPE */
|
|
46
|
+
});
|
|
47
|
+
if (typeInfo.baseTypes.length > 0) {
|
|
48
|
+
typeInfo.baseTypes.forEach((baseType) => {
|
|
49
|
+
appendTypeInfoGraph(classCodeGraph, typeInfoId, baseType);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (typeInfo.declaration) {
|
|
53
|
+
const declarationNode = (0, import_core.extendNameable)(
|
|
54
|
+
typeInfo.declaration
|
|
55
|
+
);
|
|
56
|
+
(0, import_typescript.addNode)(classCodeGraph, declarationNode);
|
|
57
|
+
(0, import_typescript.addEdge)(classCodeGraph, {
|
|
58
|
+
source: typeInfoId,
|
|
59
|
+
target: declarationNode.id,
|
|
60
|
+
type: "HAS_DECLARATION" /* HAS_DECLARATION */
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (typeInfo.typeArguments) {
|
|
64
|
+
typeInfo.typeArguments.forEach((typeArgument) => {
|
|
65
|
+
appendTypeInfoGraph(classCodeGraph, typeInfoId, typeArgument);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const TYPE_DOC = {
|
|
71
|
+
id: "type",
|
|
72
|
+
name: "Type",
|
|
73
|
+
schema: {
|
|
74
|
+
name: "string"
|
|
75
|
+
},
|
|
76
|
+
description: `The node represents TypeScript AST kind: Type.`,
|
|
77
|
+
relationships: {
|
|
78
|
+
["HAS_DECLARATION" /* HAS_DECLARATION */]: {
|
|
79
|
+
examples: [
|
|
80
|
+
`(t:Type)-[:${"HAS_DECLARATION" /* HAS_DECLARATION */}]->(c:ClassDeclaration)`
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
["HAS_TYPE_ARGUMENT" /* HAS_TYPE_ARGUMENT */]: {
|
|
84
|
+
examples: [
|
|
85
|
+
`(t:Type)-[:${"HAS_TYPE_ARGUMENT" /* HAS_TYPE_ARGUMENT */}]->(t:Type)`
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
["HAS_BASE_TYPE" /* HAS_BASE_TYPE */]: {
|
|
89
|
+
examples: [`(t:Type)-[:${"HAS_BASE_TYPE" /* HAS_BASE_TYPE */}]->(t:Type)`]
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
examples: []
|
|
93
|
+
};
|
|
94
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
+
0 && (module.exports = {
|
|
96
|
+
TYPE_DOC,
|
|
97
|
+
TYPE_INFO_EDGE_TYPES,
|
|
98
|
+
appendTypeInfoGraph
|
|
99
|
+
});
|