@lowgular/code-graph 0.0.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/bin/cli.js +2463 -0
  2. package/lib.js +2430 -0
  3. package/package.json +26 -7
  4. package/apps/code-graph/src/main.js +0 -50
  5. package/libs/cli/code-graph/src/index.js +0 -39
  6. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.js +0 -72
  7. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.stateful.js +0 -68
  8. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.doc.js +0 -147
  9. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.graph.js +0 -55
  10. package/libs/cli/code-graph/src/lib/class-declarations/index.js +0 -27
  11. package/libs/cli/code-graph/src/lib/code.graph.factory.js +0 -63
  12. package/libs/cli/code-graph/src/lib/code.graph.js +0 -62
  13. package/libs/cli/code-graph/src/lib/core/core.js +0 -58
  14. package/libs/cli/code-graph/src/lib/core.js +0 -85
  15. package/libs/cli/code-graph/src/lib/decorators/index.js +0 -36
  16. package/libs/cli/code-graph/src/lib/docs/index.js +0 -21
  17. package/libs/cli/code-graph/src/lib/docs/specs.js +0 -36
  18. package/libs/cli/code-graph/src/lib/expressions/call-expressions.graph.js +0 -28
  19. package/libs/cli/code-graph/src/lib/fixtures/reactive-event-bus/src/app/examples.event-bus.js +0 -53
  20. package/libs/cli/code-graph/src/lib/method-declarations/index.js +0 -23
  21. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.doc.js +0 -106
  22. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.graph.js +0 -56
  23. package/libs/cli/code-graph/src/lib/parameters/index.js +0 -42
  24. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.evals.js +0 -139
  25. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.js +0 -104
  26. package/libs/cli/code-graph/src/lib/property-declarations/index.js +0 -25
  27. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.doc.js +0 -74
  28. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.graph.js +0 -43
  29. package/libs/cli/code-graph/src/lib/tools/index.js +0 -34
  30. package/libs/cli/code-graph/src/lib/tools/match-code-graph.tool.js +0 -64
  31. package/libs/cli/code-graph/src/lib/types/index.js +0 -99
  32. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.doc.js +0 -345
  33. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.js +0 -52
  34. package/libs/cli/code-graph/src/lib/v2/extractors/index.js +0 -23
  35. package/libs/cli/code-graph/src/lib/v2/graph-builder/code-graph.builder.js +0 -76
  36. package/libs/cli/code-graph/src/lib/v2/graph-builder/index.js +0 -21
  37. package/libs/cli/code-graph/src/lib/v2/graph-builder/node.processor.js +0 -48
  38. package/libs/cli/code-graph/src/lib/v2/graph-builder/relationship.processor.js +0 -79
  39. package/libs/cli/code-graph/src/lib/v2/graph-builder/type.processor.js +0 -45
  40. package/libs/cli/code-graph/src/lib/v2/index.js +0 -37
  41. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.doc.js +0 -220
  42. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.tool.js +0 -42
  43. package/libs/cli/cypher/src/index.js +0 -25
  44. package/libs/cli/cypher/src/lib/docs/features/advanced-optional-match.feature.js +0 -277
  45. package/libs/cli/cypher/src/lib/docs/features/anonymous-relationship.feature.js +0 -69
  46. package/libs/cli/cypher/src/lib/docs/features/anonymous-variable-length.feature.js +0 -105
  47. package/libs/cli/cypher/src/lib/docs/features/basic-filtering.feature.js +0 -70
  48. package/libs/cli/cypher/src/lib/docs/features/basic-optional-match.feature.js +0 -99
  49. package/libs/cli/cypher/src/lib/docs/features/basic-relationship.feature.js +0 -125
  50. package/libs/cli/cypher/src/lib/docs/features/index.js +0 -51
  51. package/libs/cli/cypher/src/lib/docs/features/limit.feature.js +0 -50
  52. package/libs/cli/cypher/src/lib/docs/features/match-nodes.feature.js +0 -106
  53. package/libs/cli/cypher/src/lib/docs/features/multiple-relationship-types.feature.js +0 -105
  54. package/libs/cli/cypher/src/lib/docs/features/order-by.feature.js +0 -143
  55. package/libs/cli/cypher/src/lib/docs/features/property-matching.feature.js +0 -152
  56. package/libs/cli/cypher/src/lib/docs/features/relationship-without-variable.feature.js +0 -48
  57. package/libs/cli/cypher/src/lib/docs/features/return-statement.feature.js +0 -65
  58. package/libs/cli/cypher/src/lib/docs/features/unidirected-relationship.feature.js +0 -82
  59. package/libs/cli/cypher/src/lib/docs/features/variable-length-path.feature.js +0 -136
  60. package/libs/cli/cypher/src/lib/docs/features/where-conditional.feature.js +0 -187
  61. package/libs/cli/cypher/src/lib/docs/features/where-operators.feature.js +0 -302
  62. package/libs/cli/cypher/src/lib/docs/prompts.js +0 -36
  63. package/libs/cli/cypher/src/lib/docs/specs.js +0 -181
  64. package/libs/cli/cypher/src/lib/executor/condition-evaluator.js +0 -158
  65. package/libs/cli/cypher/src/lib/executor/executor.js +0 -83
  66. package/libs/cli/cypher/src/lib/executor/graph.js +0 -15
  67. package/libs/cli/cypher/src/lib/executor/match-engine.js +0 -153
  68. package/libs/cli/cypher/src/lib/executor/pattern-matcher.js +0 -109
  69. package/libs/cli/cypher/src/lib/executor/relationship-navigator.js +0 -64
  70. package/libs/cli/cypher/src/lib/executor/result-formatter.js +0 -143
  71. package/libs/cli/cypher/src/lib/executor/traverse-engine.js +0 -164
  72. package/libs/cli/cypher/src/lib/executor/utils.js +0 -37
  73. package/libs/cli/cypher/src/lib/graph.stub.js +0 -63
  74. package/libs/cli/cypher/src/lib/index.js +0 -74
  75. package/libs/cli/cypher/src/lib/lexer.js +0 -398
  76. package/libs/cli/cypher/src/lib/parser.js +0 -602
  77. package/libs/cli/cypher/src/lib/validator/query-validator.js +0 -95
  78. package/libs/cli/cypher/src/lib/validator/supported-features.config.js +0 -111
  79. package/libs/cli/cypher/src/lib/validator/unsupported-features.config.js +0 -150
  80. package/libs/cli/shared/src/index.js +0 -53
  81. package/libs/cli/shared/src/lib/admin-token.js +0 -121
  82. package/libs/cli/shared/src/lib/config.js +0 -49
  83. package/libs/cli/shared/src/lib/consts.js +0 -57
  84. package/libs/cli/shared/src/lib/core.js +0 -46
  85. package/libs/cli/shared/src/lib/infrastructure/cli.js +0 -47
  86. package/libs/cli/shared/src/lib/infrastructure/config.js +0 -47
  87. package/libs/cli/shared/src/lib/infrastructure/config.reporitory.js +0 -51
  88. package/libs/cli/shared/src/lib/infrastructure/formatters/console-formatter.js +0 -96
  89. package/libs/cli/shared/src/lib/infrastructure/formatters/index.js +0 -41
  90. package/libs/cli/shared/src/lib/infrastructure/formatters/json-formatter.js +0 -64
  91. package/libs/cli/shared/src/lib/infrastructure/formatters/markdown-formatter.js +0 -120
  92. package/libs/cli/shared/src/lib/infrastructure/formatters/types.js +0 -15
  93. package/libs/cli/shared/src/lib/infrastructure/formatters/utils.js +0 -72
  94. package/libs/cli/shared/src/lib/infrastructure/git.js +0 -147
  95. package/libs/cli/shared/src/lib/infrastructure/http.js +0 -257
  96. package/libs/cli/shared/src/lib/infrastructure/markdown.js +0 -95
  97. package/libs/cli/shared/src/lib/infrastructure/transformers/embeddings.js +0 -88
  98. package/libs/cli/shared/src/lib/infrastructure/transformers/index.js +0 -25
  99. package/libs/cli/shared/src/lib/infrastructure/transformers/rag-eval.js +0 -154
  100. package/libs/cli/shared/src/lib/infrastructure/transformers/similarity.js +0 -210
  101. package/libs/cli/shared/src/lib/infrastructure/workspace.js +0 -297
  102. package/libs/cli/shared/src/lib/infrastructure/yaml.js +0 -237
  103. package/libs/cli/shared/src/lib/lowgular.config.js +0 -120
  104. package/libs/cli/shared/src/lib/token.js +0 -135
  105. package/libs/cli/shared/src/lib/utils/solution.util.js +0 -35
  106. package/libs/cli/shared/src/lib/utils/utils.js +0 -89
  107. package/libs/cli/typescript/src/index.js +0 -21
  108. package/libs/cli/typescript/src/lib/base/index.js +0 -23
  109. package/libs/cli/typescript/src/lib/base/nameable.js +0 -34
  110. package/libs/cli/typescript/src/lib/base/nodeable.js +0 -36
  111. package/libs/cli/typescript/src/lib/class.implementation.js +0 -52
  112. package/libs/cli/typescript/src/lib/core/declaration.registry.js +0 -107
  113. package/libs/cli/typescript/src/lib/core/design-pattern.js +0 -55
  114. package/libs/cli/typescript/src/lib/core/index.js +0 -35
  115. package/libs/cli/typescript/src/lib/core/navigable-declaration.js +0 -69
  116. package/libs/cli/typescript/src/lib/core/program-context.js +0 -71
  117. package/libs/cli/typescript/src/lib/core/syntax-kind.utils.js +0 -40
  118. package/libs/cli/typescript/src/lib/core/type.js +0 -374
  119. package/libs/cli/typescript/src/lib/declaration.abstraction.js +0 -90
  120. package/libs/cli/typescript/src/lib/decorator.implementation.js +0 -35
  121. package/libs/cli/typescript/src/lib/enum.implementation.js +0 -35
  122. package/libs/cli/typescript/src/lib/function-declaration.implementation.js +0 -35
  123. package/libs/cli/typescript/src/lib/index.js +0 -57
  124. package/libs/cli/typescript/src/lib/interface.implementation.js +0 -51
  125. package/libs/cli/typescript/src/lib/members/method-abstraction.resolver.js +0 -90
  126. package/libs/cli/typescript/src/lib/members/method-declaration.implementation.js +0 -44
  127. package/libs/cli/typescript/src/lib/members/method-signature.implementation.js +0 -46
  128. package/libs/cli/typescript/src/lib/members/method.util.js +0 -32
  129. package/libs/cli/typescript/src/lib/members/parameter.implementation.js +0 -38
  130. package/libs/cli/typescript/src/lib/members/property-declaration.implementation.js +0 -64
  131. package/libs/cli/typescript/src/lib/members/property-signature.implementation.js +0 -34
  132. package/libs/cli/typescript/src/lib/members/property.util.js +0 -61
  133. package/libs/cli/typescript/src/lib/members/statements/expressions/binary-expression.implementation.js +0 -42
  134. package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js +0 -114
  135. package/libs/cli/typescript/src/lib/members/statements/expressions/expression.abstraction.js +0 -188
  136. package/libs/cli/typescript/src/lib/members/statements/expressions/property-access-expression.implementation.js +0 -35
  137. package/libs/cli/typescript/src/lib/members/statements/expressions/unary-expression.implementation.js +0 -51
  138. package/libs/cli/typescript/src/lib/members/statements/statement.implementation.js +0 -49
  139. package/libs/cli/typescript/src/lib/members/statements/utils.js +0 -51
  140. package/libs/cli/typescript/src/lib/plugins/built-in.plugin.js +0 -258
  141. package/libs/cli/typescript/src/lib/plugins/plugin.interface.js +0 -15
  142. package/libs/cli/typescript/src/lib/plugins/rxjs.plugin.js +0 -228
  143. package/libs/cli/typescript/src/lib/plugins/signal.plugin.js +0 -126
  144. package/libs/cli/typescript/src/lib/plugins/stubs.js +0 -66
  145. package/libs/cli/typescript/src/lib/type-alias.implementation.js +0 -72
  146. package/libs/cli/typescript/src/lib/utils.js +0 -39
  147. package/libs/cli/typescript/src/lib/variable-declaration.implementation.js +0 -35
  148. package/libs/core/codegular/src/index.js +0 -21
  149. package/libs/core/codegular/src/lib/index.js +0 -29
  150. package/libs/core/codegular/src/lib/node.js +0 -112
  151. package/libs/core/codegular/src/lib/program.js +0 -92
  152. package/libs/core/codegular/src/lib/string.js +0 -168
  153. package/libs/core/codegular/src/lib/type-checker.js +0 -170
  154. package/libs/core/codegular/src/lib/utils.js +0 -347
  155. package/main.js +0 -43
@@ -1,228 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var rxjs_plugin_exports = {};
29
- __export(rxjs_plugin_exports, {
30
- RxjsPlugin: () => RxjsPlugin
31
- });
32
- module.exports = __toCommonJS(rxjs_plugin_exports);
33
- var import_codegular = require("@core/codegular");
34
- var ts = __toESM(require("typescript"));
35
- var import_declaration = require("../declaration.abstraction");
36
- var import_method = require("../members/method.util");
37
- var import_stubs = require("./stubs");
38
- const RXJS_TYPES = /* @__PURE__ */ new Set([
39
- "Observable",
40
- "Subject",
41
- "BehaviorSubject",
42
- "ReplaySubject",
43
- "AsyncSubject"
44
- ]);
45
- class ObservableImplementation extends import_stubs.StubNameable {
46
- constructor() {
47
- super("Observable", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
48
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
49
- this.properties = [];
50
- const queryMethods = [
51
- "subscribe",
52
- "pipe",
53
- "forEach",
54
- "toPromise",
55
- "lift"
56
- ].map(
57
- (name) => new import_stubs.StubMethodSignature(
58
- name,
59
- void 0,
60
- [],
61
- import_method.MethodImplementationAbstraction.QUERY
62
- )
63
- );
64
- this.methods = queryMethods;
65
- }
66
- }
67
- class SubjectImplementation extends import_stubs.StubNameable {
68
- constructor() {
69
- super("Subject", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
70
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
71
- this.properties = [];
72
- const mutatingMethods = ["next", "error", "complete"].map(
73
- (name) => new import_stubs.StubMethodSignature(
74
- name,
75
- void 0,
76
- [],
77
- import_method.MethodImplementationAbstraction.COMMAND
78
- )
79
- );
80
- const queryMethods = [
81
- "subscribe",
82
- "pipe",
83
- "asObservable",
84
- "forEach",
85
- "toPromise",
86
- "lift"
87
- ].map(
88
- (name) => new import_stubs.StubMethodSignature(
89
- name,
90
- void 0,
91
- [],
92
- import_method.MethodImplementationAbstraction.QUERY
93
- )
94
- );
95
- this.methods = [...mutatingMethods, ...queryMethods];
96
- }
97
- }
98
- class BehaviorSubjectImplementation extends import_stubs.StubNameable {
99
- constructor() {
100
- super("BehaviorSubject", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
101
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
102
- this.properties = [];
103
- const mutatingMethods = ["next", "error", "complete"].map(
104
- (name) => new import_stubs.StubMethodSignature(
105
- name,
106
- void 0,
107
- [],
108
- import_method.MethodImplementationAbstraction.COMMAND
109
- )
110
- );
111
- const queryMethods = [
112
- "subscribe",
113
- "pipe",
114
- "asObservable",
115
- "getValue",
116
- // BehaviorSubject-specific: gets current value
117
- "forEach",
118
- "toPromise",
119
- "lift"
120
- ].map(
121
- (name) => new import_stubs.StubMethodSignature(
122
- name,
123
- void 0,
124
- [],
125
- import_method.MethodImplementationAbstraction.QUERY
126
- )
127
- );
128
- this.methods = [...mutatingMethods, ...queryMethods];
129
- }
130
- }
131
- class ReplaySubjectImplementation extends import_stubs.StubNameable {
132
- constructor() {
133
- super("ReplaySubject", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
134
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
135
- this.properties = [];
136
- const mutatingMethods = ["next", "error", "complete"].map(
137
- (name) => new import_stubs.StubMethodSignature(
138
- name,
139
- void 0,
140
- [],
141
- import_method.MethodImplementationAbstraction.COMMAND
142
- )
143
- );
144
- const queryMethods = [
145
- "subscribe",
146
- "pipe",
147
- "asObservable",
148
- "forEach",
149
- "toPromise",
150
- "lift"
151
- ].map(
152
- (name) => new import_stubs.StubMethodSignature(
153
- name,
154
- void 0,
155
- [],
156
- import_method.MethodImplementationAbstraction.QUERY
157
- )
158
- );
159
- this.methods = [...mutatingMethods, ...queryMethods];
160
- }
161
- }
162
- class AsyncSubjectImplementation extends import_stubs.StubNameable {
163
- constructor() {
164
- super("AsyncSubject", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
165
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
166
- this.properties = [];
167
- const mutatingMethods = ["next", "error", "complete"].map(
168
- (name) => new import_stubs.StubMethodSignature(
169
- name,
170
- void 0,
171
- [],
172
- import_method.MethodImplementationAbstraction.COMMAND
173
- )
174
- );
175
- const queryMethods = [
176
- "subscribe",
177
- "pipe",
178
- "asObservable",
179
- "forEach",
180
- "toPromise",
181
- "lift"
182
- ].map(
183
- (name) => new import_stubs.StubMethodSignature(
184
- name,
185
- void 0,
186
- [],
187
- import_method.MethodImplementationAbstraction.QUERY
188
- )
189
- );
190
- this.methods = [...mutatingMethods, ...queryMethods];
191
- }
192
- }
193
- class RxjsPlugin {
194
- matches(declaration, context) {
195
- const sourceFile = declaration.getSourceFile();
196
- const fileName = sourceFile.fileName;
197
- const isRxjsFile = fileName.includes("rxjs/") || fileName.includes("rxjs\\") || fileName.includes("node_modules/rxjs/") || fileName.includes("node_modules\\rxjs\\");
198
- if (isRxjsFile) {
199
- return true;
200
- }
201
- const declarationName = (0, import_codegular.getNameByIdentifier)(declaration);
202
- return declarationName ? RXJS_TYPES.has(declarationName) : false;
203
- }
204
- resolve(declaration, context) {
205
- const declarationName = (0, import_codegular.getNameByIdentifier)(declaration);
206
- if (!declarationName) {
207
- return void 0;
208
- }
209
- switch (declarationName) {
210
- case "Observable":
211
- return new ObservableImplementation();
212
- case "Subject":
213
- return new SubjectImplementation();
214
- case "BehaviorSubject":
215
- return new BehaviorSubjectImplementation();
216
- case "ReplaySubject":
217
- return new ReplaySubjectImplementation();
218
- case "AsyncSubject":
219
- return new AsyncSubjectImplementation();
220
- default:
221
- return void 0;
222
- }
223
- }
224
- }
225
- // Annotate the CommonJS export names for ESM import in node:
226
- 0 && (module.exports = {
227
- RxjsPlugin
228
- });
@@ -1,126 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var signal_plugin_exports = {};
29
- __export(signal_plugin_exports, {
30
- SignalPlugin: () => SignalPlugin
31
- });
32
- module.exports = __toCommonJS(signal_plugin_exports);
33
- var import_codegular = require("@core/codegular");
34
- var ts = __toESM(require("typescript"));
35
- var import_declaration = require("../declaration.abstraction");
36
- var import_method = require("../members/method.util");
37
- var import_stubs = require("./stubs");
38
- const SIGNAL_TYPES = /* @__PURE__ */ new Set(["Signal", "WritableSignal"]);
39
- class SignalImplementation extends import_stubs.StubNameable {
40
- constructor() {
41
- super("Signal", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
42
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
43
- this.properties = [];
44
- const callMethod = new import_stubs.StubMethodSignature(
45
- "()",
46
- // Represent call signature as a method named "()"
47
- void 0,
48
- // Return type is the generic type parameter
49
- [],
50
- import_method.MethodImplementationAbstraction.QUERY
51
- );
52
- const getMethod = new import_stubs.StubMethodSignature(
53
- "get",
54
- void 0,
55
- // Return type is the generic type parameter
56
- [],
57
- import_method.MethodImplementationAbstraction.QUERY
58
- );
59
- this.methods = [callMethod, getMethod];
60
- }
61
- }
62
- class WritableSignalImplementation extends import_stubs.StubNameable {
63
- constructor() {
64
- super("WritableSignal", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
65
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
66
- this.properties = [];
67
- const mutatingMethods = ["set", "update"].map(
68
- (name) => new import_stubs.StubMethodSignature(
69
- name,
70
- void 0,
71
- // set returns void, update returns void
72
- [],
73
- import_method.MethodImplementationAbstraction.COMMAND
74
- )
75
- );
76
- const callMethod = new import_stubs.StubMethodSignature(
77
- "()",
78
- // Represent call signature as a method named "()"
79
- void 0,
80
- // Return type is the generic type parameter
81
- [],
82
- import_method.MethodImplementationAbstraction.QUERY
83
- );
84
- const getMethod = new import_stubs.StubMethodSignature(
85
- "get",
86
- void 0,
87
- // Return type is the generic type parameter
88
- [],
89
- import_method.MethodImplementationAbstraction.QUERY
90
- );
91
- this.methods = [...mutatingMethods, callMethod, getMethod];
92
- }
93
- }
94
- class SignalPlugin {
95
- matches(declaration, context) {
96
- const declarationName = (0, import_codegular.getNameByIdentifier)(declaration);
97
- if (!declarationName) {
98
- return false;
99
- }
100
- if (!SIGNAL_TYPES.has(declarationName)) {
101
- return false;
102
- }
103
- const sourceFile = declaration.getSourceFile();
104
- const fileName = sourceFile.fileName;
105
- const isAngularCoreFile = fileName.includes("@angular/core") || fileName.includes("angular/core") || fileName.includes("node_modules/@angular/core/") || fileName.includes("node_modules\\@angular\\core\\");
106
- return isAngularCoreFile || SIGNAL_TYPES.has(declarationName);
107
- }
108
- resolve(declaration, context) {
109
- const declarationName = (0, import_codegular.getNameByIdentifier)(declaration);
110
- if (!declarationName) {
111
- return void 0;
112
- }
113
- switch (declarationName) {
114
- case "Signal":
115
- return new SignalImplementation();
116
- case "WritableSignal":
117
- return new WritableSignalImplementation();
118
- default:
119
- return void 0;
120
- }
121
- }
122
- }
123
- // Annotate the CommonJS export names for ESM import in node:
124
- 0 && (module.exports = {
125
- SignalPlugin
126
- });
@@ -1,66 +0,0 @@
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 stubs_exports = {};
19
- __export(stubs_exports, {
20
- StubMethodSignature: () => StubMethodSignature,
21
- StubNameable: () => StubNameable,
22
- StubNodable: () => StubNodable
23
- });
24
- module.exports = __toCommonJS(stubs_exports);
25
- const ts = require("typescript");
26
- const STUB_RANGE = {
27
- start: { line: 0, character: 0 },
28
- end: { line: 0, character: 0 }
29
- };
30
- const STUB_FILE_PATH = "node_modules/typescript/lib/lib.d.ts";
31
- const STUB_SNIPPET = "";
32
- class StubNodable {
33
- constructor(kind) {
34
- this.range = STUB_RANGE;
35
- this.filePath = STUB_FILE_PATH;
36
- this.snippet = STUB_SNIPPET;
37
- this.kind = kind;
38
- }
39
- }
40
- class StubMethodSignature extends StubNodable {
41
- constructor(name, type, parameters, abstraction) {
42
- super(ts.SyntaxKind[ts.SyntaxKind.MethodSignature]);
43
- this.name = name;
44
- this.type = type;
45
- this.parameters = parameters;
46
- this.abstraction = abstraction;
47
- }
48
- getSnippet() {
49
- throw new Error("Method not implemented.");
50
- }
51
- }
52
- class StubNameable extends StubNodable {
53
- constructor(name, kind) {
54
- super(kind);
55
- this.name = name;
56
- }
57
- getSnippet() {
58
- throw new Error("Method not implemented.");
59
- }
60
- }
61
- // Annotate the CommonJS export names for ESM import in node:
62
- 0 && (module.exports = {
63
- StubMethodSignature,
64
- StubNameable,
65
- StubNodable
66
- });
@@ -1,72 +0,0 @@
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 type_alias_implementation_exports = {};
19
- __export(type_alias_implementation_exports, {
20
- TypeAliasImplementation: () => TypeAliasImplementation
21
- });
22
- module.exports = __toCommonJS(type_alias_implementation_exports);
23
- var import_codegular = require("@core/codegular");
24
- var import_typescript = require("typescript");
25
- var import_core = require("./core");
26
- var import_declaration = require("./declaration.abstraction");
27
- var import_method_signature = require("./members/method-signature.implementation");
28
- var import_property_signature = require("./members/property-signature.implementation");
29
- class TypeAliasImplementation extends import_core.NameableImpl {
30
- constructor(node, context) {
31
- super(node);
32
- this.context = context;
33
- const typeLiteral = this.getTypeLiteral(node);
34
- if (typeLiteral) {
35
- this.properties = (0, import_codegular.findChildrenByKind)(
36
- typeLiteral,
37
- import_typescript.SyntaxKind.PropertySignature
38
- ).map(
39
- (p) => new import_property_signature.PropertySignatureImplementation(
40
- p,
41
- this.context
42
- )
43
- );
44
- this.methods = (0, import_codegular.findChildrenByKind)(
45
- typeLiteral,
46
- import_typescript.SyntaxKind.MethodSignature
47
- ).map(
48
- (m) => new import_method_signature.MethodSignatureImplementation(m, this.context)
49
- );
50
- } else {
51
- this.properties = [];
52
- this.methods = [];
53
- }
54
- this.abstraction = (0, import_declaration.resolveDeclarationAbstraction)(this);
55
- }
56
- /**
57
- * Extracts TypeLiteral from TypeAliasDeclaration if it's an object type
58
- */
59
- getTypeLiteral(node) {
60
- if (!node.type) {
61
- return void 0;
62
- }
63
- if (node.type.kind === import_typescript.SyntaxKind.TypeLiteral) {
64
- return node.type;
65
- }
66
- return void 0;
67
- }
68
- }
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {
71
- TypeAliasImplementation
72
- });
@@ -1,39 +0,0 @@
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 utils_exports = {};
19
- __export(utils_exports, {
20
- stubProgramFromFileContent: () => stubProgramFromFileContent
21
- });
22
- module.exports = __toCommonJS(utils_exports);
23
- var import_codegular = require("@core/codegular");
24
- var import_core = require("./core");
25
- const stubProgramFromFileContent = (fileContent) => {
26
- const fileSystem = {
27
- "test.ts": fileContent
28
- };
29
- const program = (0, import_codegular.createProgramFromFileSystem)(fileSystem);
30
- return {
31
- typeChecker: program.getTypeChecker(),
32
- typeResolutionTracker: new import_core.TypeResolutionTracker(),
33
- declarationRegistry: import_core.DeclarationRegistry.fromDefaultAngular()
34
- };
35
- };
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- stubProgramFromFileContent
39
- });
@@ -1,35 +0,0 @@
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 variable_declaration_implementation_exports = {};
19
- __export(variable_declaration_implementation_exports, {
20
- VariableDeclarationImplementation: () => VariableDeclarationImplementation
21
- });
22
- module.exports = __toCommonJS(variable_declaration_implementation_exports);
23
- var import_core = require("./core");
24
- var import_declaration = require("./declaration.abstraction");
25
- class VariableDeclarationImplementation extends import_core.NameableImpl {
26
- constructor(node, context) {
27
- super(node);
28
- this.context = context;
29
- this.abstraction = import_declaration.DeclarationAbstraction.UNKNOWN;
30
- }
31
- }
32
- // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- VariableDeclarationImplementation
35
- });
@@ -1,21 +0,0 @@
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 src_exports = {};
16
- module.exports = __toCommonJS(src_exports);
17
- __reExport(src_exports, require("./lib/index"), module.exports);
18
- // Annotate the CommonJS export names for ESM import in node:
19
- 0 && (module.exports = {
20
- ...require("./lib/index")
21
- });
@@ -1,29 +0,0 @@
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 lib_exports = {};
16
- module.exports = __toCommonJS(lib_exports);
17
- __reExport(lib_exports, require("./node.js"), module.exports);
18
- __reExport(lib_exports, require("./program.js"), module.exports);
19
- __reExport(lib_exports, require("./string.js"), module.exports);
20
- __reExport(lib_exports, require("./type-checker.js"), module.exports);
21
- __reExport(lib_exports, require("./utils.js"), module.exports);
22
- // Annotate the CommonJS export names for ESM import in node:
23
- 0 && (module.exports = {
24
- ...require("./node.js"),
25
- ...require("./program.js"),
26
- ...require("./string.js"),
27
- ...require("./type-checker.js"),
28
- ...require("./utils.js")
29
- });