@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,188 +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 expression_abstraction_exports = {};
19
- __export(expression_abstraction_exports, {
20
- ExpressionAbstraction: () => ExpressionAbstraction,
21
- checkAllExpressionsStrategy: () => checkAllExpressionsStrategy,
22
- countExpressionAbstraction: () => countExpressionAbstraction
23
- });
24
- module.exports = __toCommonJS(expression_abstraction_exports);
25
- var import_codegular = require("@core/codegular");
26
- var import_core = require("../../../core");
27
- var import_binary_expression = require("./binary-expression.implementation");
28
- var import_call_expression = require("./call-expression.implementation");
29
- var import_property_access_expression = require("./property-access-expression.implementation");
30
- var import_unary_expression = require("./unary-expression.implementation");
31
- const ts = require("typescript");
32
- var ExpressionAbstraction = /* @__PURE__ */ ((ExpressionAbstraction2) => {
33
- ExpressionAbstraction2["MUTATING"] = "MutatingExpression";
34
- ExpressionAbstraction2["NON_MUTATING"] = "NonMutatingExpression";
35
- ExpressionAbstraction2["UNKNOWN"] = "UnknownExpression";
36
- return ExpressionAbstraction2;
37
- })(ExpressionAbstraction || {});
38
- const mutatingKinds = /* @__PURE__ */ new Set([
39
- ts.SyntaxKind.PostfixUnaryExpression,
40
- ts.SyntaxKind.DeleteExpression
41
- ]);
42
- const both = /* @__PURE__ */ new Set([
43
- ts.SyntaxKind.PrefixUnaryExpression,
44
- ts.SyntaxKind.CallExpression,
45
- ts.SyntaxKind.BinaryExpression,
46
- ts.SyntaxKind.Identifier
47
- ]);
48
- const nonMutatingKinds = /* @__PURE__ */ new Set([
49
- ts.SyntaxKind.PropertyAccessExpression,
50
- ts.SyntaxKind.ElementAccessExpression,
51
- ts.SyntaxKind.ConditionalExpression,
52
- ts.SyntaxKind.AsExpression,
53
- ts.SyntaxKind.SatisfiesExpression,
54
- ts.SyntaxKind.YieldExpression,
55
- ts.SyntaxKind.JsxExpression,
56
- ts.SyntaxKind.CommaListExpression,
57
- ts.SyntaxKind.ArrayLiteralExpression,
58
- ts.SyntaxKind.ObjectLiteralExpression,
59
- ts.SyntaxKind.TemplateExpression,
60
- ts.SyntaxKind.ParenthesizedExpression,
61
- ts.SyntaxKind.ArrowFunction,
62
- ts.SyntaxKind.FunctionExpression,
63
- ts.SyntaxKind.NewExpression,
64
- ts.SyntaxKind.TypeOfExpression,
65
- ts.SyntaxKind.VoidExpression,
66
- ts.SyntaxKind.AwaitExpression,
67
- ts.SyntaxKind.ThisKeyword,
68
- ts.SyntaxKind.SuperKeyword,
69
- ts.SyntaxKind.TrueKeyword,
70
- ts.SyntaxKind.FalseKeyword,
71
- ts.SyntaxKind.NullKeyword,
72
- ts.SyntaxKind.UndefinedKeyword,
73
- ts.SyntaxKind.Identifier,
74
- ts.SyntaxKind.SpreadElement,
75
- ts.SyntaxKind.NonNullExpression,
76
- ts.SyntaxKind.TypeAssertionExpression,
77
- ts.SyntaxKind.TaggedTemplateExpression,
78
- ts.SyntaxKind.MetaProperty,
79
- ts.SyntaxKind.OmittedExpression,
80
- // Literal expressions (always non-mutating)
81
- ts.SyntaxKind.StringLiteral,
82
- ts.SyntaxKind.NumericLiteral,
83
- ts.SyntaxKind.RegularExpressionLiteral,
84
- ts.SyntaxKind.NoSubstitutionTemplateLiteral
85
- ]);
86
- const checkAllExpressionsStrategy = (node, context) => {
87
- const counts = {
88
- ["MutatingExpression" /* MUTATING */]: 0,
89
- ["NonMutatingExpression" /* NON_MUTATING */]: 0,
90
- ["UnknownExpression" /* UNKNOWN */]: 0
91
- };
92
- for (const expr of (0, import_codegular.getAllExpressions)(node)) {
93
- if (ts.isLiteralExpression(expr)) {
94
- counts["NonMutatingExpression" /* NON_MUTATING */]++;
95
- continue;
96
- }
97
- if (nonMutatingKinds.has(expr.kind)) {
98
- counts["NonMutatingExpression" /* NON_MUTATING */]++;
99
- continue;
100
- }
101
- if (ts.isCallExpression(expr)) {
102
- const abstraction = new import_call_expression.CallExpressionImplementation(
103
- expr,
104
- context
105
- ).abstraction;
106
- counts[abstraction]++;
107
- continue;
108
- }
109
- if (ts.isBinaryExpression(expr)) {
110
- const abstraction = new import_binary_expression.BinaryExpressionImplementation(
111
- expr,
112
- context
113
- ).abstraction;
114
- counts[abstraction]++;
115
- continue;
116
- }
117
- if (ts.isPrefixUnaryExpression(expr) || ts.isPostfixUnaryExpression(expr) || ts.isDeleteExpression(expr)) {
118
- const abstraction = new import_unary_expression.UnaryExpressionImplementation(
119
- expr,
120
- context
121
- ).abstraction;
122
- counts[abstraction]++;
123
- continue;
124
- }
125
- if (ts.isPropertyAccessExpression(expr)) {
126
- const abstraction = new import_property_access_expression.PropertyAccessExpressionImplementation(
127
- expr,
128
- context
129
- ).abstraction;
130
- counts[abstraction]++;
131
- continue;
132
- }
133
- console.error((0, import_codegular.getText)(expr));
134
- throw new Error(`Unknown expression type: ${(0, import_core.getSyntaxKindName)(expr.kind)}`);
135
- }
136
- return counts;
137
- };
138
- const checkSpecificExpressionsStrategy = (node, context) => {
139
- const counts = {
140
- ["MutatingExpression" /* MUTATING */]: 0,
141
- ["NonMutatingExpression" /* NON_MUTATING */]: 0,
142
- ["UnknownExpression" /* UNKNOWN */]: 0
143
- };
144
- (0, import_codegular.getDescendantsByKinds)(node, [...mutatingKinds]).forEach((expr) => {
145
- counts["MutatingExpression" /* MUTATING */]++;
146
- });
147
- (0, import_codegular.getDescendantsByKinds)(node, [...nonMutatingKinds]).forEach((expr) => {
148
- counts["NonMutatingExpression" /* NON_MUTATING */]++;
149
- });
150
- const bothExpressions = (0, import_codegular.getDescendantsByKinds)(node, [...both]);
151
- for (const expr of bothExpressions) {
152
- if (ts.isCallExpression(expr)) {
153
- const impl = new import_call_expression.CallExpressionImplementation(
154
- expr,
155
- context
156
- );
157
- counts[impl.abstraction]++;
158
- } else if (ts.isBinaryExpression(expr)) {
159
- const impl = new import_binary_expression.BinaryExpressionImplementation(
160
- expr,
161
- context
162
- );
163
- counts[impl.abstraction]++;
164
- } else if (ts.isPrefixUnaryExpression(expr) || ts.isPostfixUnaryExpression(expr) || ts.isDeleteExpression(expr)) {
165
- const impl = new import_unary_expression.UnaryExpressionImplementation(
166
- expr,
167
- context
168
- );
169
- counts[impl.abstraction]++;
170
- }
171
- }
172
- return counts;
173
- };
174
- const countExpressionAbstraction = (node, context, strategy = "specific") => {
175
- if (strategy === "all") {
176
- return checkAllExpressionsStrategy(node, context);
177
- }
178
- if (strategy === "specific") {
179
- return checkSpecificExpressionsStrategy(node, context);
180
- }
181
- throw new Error(`Invalid strategy: ${strategy}`);
182
- };
183
- // Annotate the CommonJS export names for ESM import in node:
184
- 0 && (module.exports = {
185
- ExpressionAbstraction,
186
- checkAllExpressionsStrategy,
187
- countExpressionAbstraction
188
- });
@@ -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 property_access_expression_implementation_exports = {};
19
- __export(property_access_expression_implementation_exports, {
20
- PropertyAccessExpressionImplementation: () => PropertyAccessExpressionImplementation
21
- });
22
- module.exports = __toCommonJS(property_access_expression_implementation_exports);
23
- var import_core = require("../../../core");
24
- var import_expression = require("./expression.abstraction");
25
- const ts = require("typescript");
26
- class PropertyAccessExpressionImplementation extends import_core.NodableImpl {
27
- constructor(node, context) {
28
- super(node);
29
- this.abstraction = import_expression.ExpressionAbstraction.NON_MUTATING;
30
- }
31
- }
32
- // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- PropertyAccessExpressionImplementation
35
- });
@@ -1,51 +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 unary_expression_implementation_exports = {};
19
- __export(unary_expression_implementation_exports, {
20
- UnaryExpressionImplementation: () => UnaryExpressionImplementation
21
- });
22
- module.exports = __toCommonJS(unary_expression_implementation_exports);
23
- var import_core = require("../../../core");
24
- var import_expression = require("./expression.abstraction");
25
- const ts = require("typescript");
26
- class UnaryExpressionImplementation extends import_core.NodableImpl {
27
- constructor(node, context) {
28
- super(node);
29
- if (this.isMutating(node)) {
30
- this.abstraction = import_expression.ExpressionAbstraction.MUTATING;
31
- } else {
32
- this.abstraction = import_expression.ExpressionAbstraction.NON_MUTATING;
33
- }
34
- }
35
- isMutating(node) {
36
- if (node.kind === ts.SyntaxKind.DeleteExpression) {
37
- return true;
38
- }
39
- if (ts.isPrefixUnaryExpression(node)) {
40
- return node.operator === ts.SyntaxKind.PlusPlusToken || node.operator === ts.SyntaxKind.MinusMinusToken;
41
- }
42
- if (ts.isPostfixUnaryExpression(node)) {
43
- return node.operator === ts.SyntaxKind.PlusPlusToken || node.operator === ts.SyntaxKind.MinusMinusToken;
44
- }
45
- return false;
46
- }
47
- }
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- UnaryExpressionImplementation
51
- });
@@ -1,49 +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 statement_implementation_exports = {};
29
- __export(statement_implementation_exports, {
30
- ReturnStatementImplementation: () => ReturnStatementImplementation
31
- });
32
- module.exports = __toCommonJS(statement_implementation_exports);
33
- var import_codegular = require("@core/codegular");
34
- var ts = __toESM(require("typescript"));
35
- var import_core = require("../../core");
36
- var import_call_expression = require("./expressions/call-expression.implementation");
37
- class ReturnStatementImplementation extends import_core.NodableImpl {
38
- constructor(node, context) {
39
- super(node);
40
- this.callExpressions = (0, import_codegular.getDescendantsByKind)(
41
- node,
42
- ts.SyntaxKind.CallExpression
43
- ).map((expr) => new import_call_expression.CallExpressionImplementation(expr, context));
44
- }
45
- }
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {
48
- ReturnStatementImplementation
49
- });
@@ -1,51 +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
- extractTypeName: () => extractTypeName,
21
- isMutatorByName: () => isMutatorByName
22
- });
23
- module.exports = __toCommonJS(utils_exports);
24
- const isMutatorByName = (methodName) => {
25
- const mutatorPatterns = [
26
- /^set[A-Z]/,
27
- /^add[A-Z]/,
28
- /^remove[A-Z]/,
29
- /^delete[A-Z]/,
30
- /^update[A-Z]/,
31
- /^modify[A-Z]/,
32
- /^change[A-Z]/,
33
- /^insert[A-Z]/,
34
- /^append[A-Z]/,
35
- /^push[A-Z]/,
36
- /^pop[A-Z]/,
37
- /^clear$/,
38
- /^reset$/,
39
- /^mutate[A-Z]/
40
- ];
41
- return mutatorPatterns.some((pattern) => pattern.test(methodName));
42
- };
43
- const extractTypeName = (typeString) => {
44
- const match = typeString.match(/^([A-Z][a-zA-Z0-9]*)/);
45
- return match ? match[1] : typeString.split("<")[0].trim();
46
- };
47
- // Annotate the CommonJS export names for ESM import in node:
48
- 0 && (module.exports = {
49
- extractTypeName,
50
- isMutatorByName
51
- });
@@ -1,258 +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 built_in_plugin_exports = {};
29
- __export(built_in_plugin_exports, {
30
- BuiltInPlugin: () => BuiltInPlugin
31
- });
32
- module.exports = __toCommonJS(built_in_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 BUILT_IN_TYPES = /* @__PURE__ */ new Set(["Array", "Set", "Map", "WeakSet", "WeakMap"]);
39
- class ArrayImplementation extends import_stubs.StubNameable {
40
- constructor() {
41
- super("Array", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
42
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
43
- this.properties = [];
44
- const mutatingMethods = [
45
- "push",
46
- "pop",
47
- "shift",
48
- "unshift",
49
- "splice",
50
- "sort",
51
- "reverse",
52
- "fill",
53
- "copyWithin"
54
- ].map(
55
- (name) => new import_stubs.StubMethodSignature(
56
- name,
57
- void 0,
58
- [],
59
- import_method.MethodImplementationAbstraction.COMMAND
60
- )
61
- );
62
- const queryMethods = [
63
- // Iteration and transformation
64
- "map",
65
- "filter",
66
- "flat",
67
- "flatMap",
68
- "forEach",
69
- "reduce",
70
- "reduceRight",
71
- // Search and test
72
- "find",
73
- "findIndex",
74
- "findLast",
75
- "findLastIndex",
76
- "some",
77
- "every",
78
- "includes",
79
- "indexOf",
80
- "lastIndexOf",
81
- // Extraction and combination
82
- "slice",
83
- "concat",
84
- "at",
85
- // Immutable array methods (ES2023)
86
- "toReversed",
87
- "toSorted",
88
- "toSpliced",
89
- "with",
90
- // String conversion
91
- "join",
92
- "toString",
93
- "toLocaleString",
94
- // Iterators
95
- "entries",
96
- "keys",
97
- "values"
98
- ].map(
99
- (name) => new import_stubs.StubMethodSignature(
100
- name,
101
- void 0,
102
- [],
103
- import_method.MethodImplementationAbstraction.QUERY
104
- )
105
- );
106
- this.methods = [...mutatingMethods, ...queryMethods];
107
- }
108
- }
109
- class SetImplementation extends import_stubs.StubNameable {
110
- constructor() {
111
- super("Set", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
112
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
113
- this.properties = [];
114
- const mutatingMethods = ["add", "delete", "clear"].map(
115
- (name) => new import_stubs.StubMethodSignature(
116
- name,
117
- void 0,
118
- [],
119
- import_method.MethodImplementationAbstraction.COMMAND
120
- )
121
- );
122
- const queryMethods = [
123
- "has",
124
- "forEach",
125
- "entries",
126
- "keys",
127
- "values",
128
- "size"
129
- // Property accessor, but treated as method
130
- ].map(
131
- (name) => new import_stubs.StubMethodSignature(
132
- name,
133
- void 0,
134
- [],
135
- import_method.MethodImplementationAbstraction.QUERY
136
- )
137
- );
138
- this.methods = [...mutatingMethods, ...queryMethods];
139
- }
140
- }
141
- class MapImplementation extends import_stubs.StubNameable {
142
- constructor() {
143
- super("Map", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
144
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
145
- this.properties = [];
146
- const mutatingMethods = ["set", "delete", "clear"].map(
147
- (name) => new import_stubs.StubMethodSignature(
148
- name,
149
- void 0,
150
- [],
151
- import_method.MethodImplementationAbstraction.COMMAND
152
- )
153
- );
154
- const queryMethods = [
155
- "get",
156
- "has",
157
- "forEach",
158
- "entries",
159
- "keys",
160
- "values",
161
- "size"
162
- // Property accessor, but treated as method
163
- ].map(
164
- (name) => new import_stubs.StubMethodSignature(
165
- name,
166
- void 0,
167
- [],
168
- import_method.MethodImplementationAbstraction.QUERY
169
- )
170
- );
171
- this.methods = [...mutatingMethods, ...queryMethods];
172
- }
173
- }
174
- class WeakSetImplementation extends import_stubs.StubNameable {
175
- constructor() {
176
- super("WeakSet", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
177
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
178
- this.properties = [];
179
- const mutatingMethods = ["add", "delete"].map(
180
- (name) => new import_stubs.StubMethodSignature(
181
- name,
182
- void 0,
183
- [],
184
- import_method.MethodImplementationAbstraction.COMMAND
185
- )
186
- );
187
- const queryMethods = ["has"].map(
188
- (name) => new import_stubs.StubMethodSignature(
189
- name,
190
- void 0,
191
- [],
192
- import_method.MethodImplementationAbstraction.QUERY
193
- )
194
- );
195
- this.methods = [...mutatingMethods, ...queryMethods];
196
- }
197
- }
198
- class WeakMapImplementation extends import_stubs.StubNameable {
199
- constructor() {
200
- super("WeakMap", ts.SyntaxKind[ts.SyntaxKind.InterfaceDeclaration]);
201
- this.abstraction = import_declaration.DeclarationAbstraction.DATA_STRUCTURE;
202
- this.properties = [];
203
- const mutatingMethods = ["set", "delete"].map(
204
- (name) => new import_stubs.StubMethodSignature(
205
- name,
206
- void 0,
207
- [],
208
- import_method.MethodImplementationAbstraction.COMMAND
209
- )
210
- );
211
- const queryMethods = ["get", "has"].map(
212
- (name) => new import_stubs.StubMethodSignature(
213
- name,
214
- void 0,
215
- [],
216
- import_method.MethodImplementationAbstraction.QUERY
217
- )
218
- );
219
- this.methods = [...mutatingMethods, ...queryMethods];
220
- }
221
- }
222
- class BuiltInPlugin {
223
- matches(declaration, context) {
224
- const sourceFile = declaration.getSourceFile();
225
- const fileName = sourceFile.fileName;
226
- const isLibFilePattern = /lib\.[\w]+\.d\.ts$/.test(fileName);
227
- const isInTypeScriptLib = fileName.includes("typescript/lib/lib.") || fileName.includes("typescript\\lib\\lib.");
228
- if (isLibFilePattern || isInTypeScriptLib) {
229
- return true;
230
- }
231
- const declarationName = (0, import_codegular.getNameByIdentifier)(declaration);
232
- return declarationName ? BUILT_IN_TYPES.has(declarationName) : false;
233
- }
234
- resolve(declaration, context) {
235
- const declarationName = (0, import_codegular.getNameByIdentifier)(declaration);
236
- if (!declarationName) {
237
- return void 0;
238
- }
239
- switch (declarationName) {
240
- case "Array":
241
- return new ArrayImplementation();
242
- case "Set":
243
- return new SetImplementation();
244
- case "Map":
245
- return new MapImplementation();
246
- case "WeakSet":
247
- return new WeakSetImplementation();
248
- case "WeakMap":
249
- return new WeakMapImplementation();
250
- default:
251
- return void 0;
252
- }
253
- }
254
- }
255
- // Annotate the CommonJS export names for ESM import in node:
256
- 0 && (module.exports = {
257
- BuiltInPlugin
258
- });
@@ -1,15 +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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var plugin_interface_exports = {};
15
- module.exports = __toCommonJS(plugin_interface_exports);