@lowgular/code-graph 0.0.1 → 0.1.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.
Files changed (179) hide show
  1. package/bin/cli.js +10 -0
  2. package/code-graph-v2/code.graph.js +37 -0
  3. package/code-graph-v2/config-from-query.js +131 -0
  4. package/code-graph-v2/extractors/extractor.js +27 -0
  5. package/code-graph-v2/extractors/index.js +1 -0
  6. package/code-graph-v2/graph-builder/code-graph.builder.js +49 -0
  7. package/code-graph-v2/graph-builder/index.js +1 -0
  8. package/code-graph-v2/graph-builder/node.processor.js +22 -0
  9. package/{libs/cli/code-graph/src/lib/v2 → code-graph-v2}/graph-builder/relationship.processor.js +11 -35
  10. package/code-graph-v2/graph-builder/type.processor.js +21 -0
  11. package/code-graph-v2/index.js +4 -0
  12. package/code-graph-v2/tools/build-code-graph.tool.js +19 -0
  13. package/code-graph-v2/utils.js +34 -0
  14. package/codegular/index.js +5 -0
  15. package/codegular/node.js +71 -0
  16. package/codegular/program.js +100 -0
  17. package/{libs/core/codegular/src/lib → codegular}/string.js +6 -53
  18. package/{libs/core/codegular/src/lib → codegular}/type-checker.js +3 -40
  19. package/codegular/type.js +356 -0
  20. package/{libs/core/codegular/src/lib → codegular}/utils.js +50 -62
  21. package/cypher/index.js +1 -0
  22. package/{libs/cli/cypher/src → cypher}/lib/executor/condition-evaluator.js +2 -25
  23. package/cypher/lib/executor/executor.js +60 -0
  24. package/cypher/lib/executor/graph.js +0 -0
  25. package/{libs/cli/cypher/src → cypher}/lib/executor/match-engine.js +4 -27
  26. package/{libs/cli/cypher/src → cypher}/lib/executor/pattern-matcher.js +2 -25
  27. package/{libs/cli/cypher/src → cypher}/lib/executor/relationship-navigator.js +2 -25
  28. package/{libs/cli/cypher/src → cypher}/lib/executor/result-formatter.js +37 -31
  29. package/{libs/cli/cypher/src → cypher}/lib/executor/traverse-engine.js +4 -27
  30. package/cypher/lib/executor/utils.js +14 -0
  31. package/cypher/lib/graph.stub.js +38 -0
  32. package/cypher/lib/index.js +32 -0
  33. package/{libs/cli/cypher/src → cypher}/lib/lexer.js +4 -26
  34. package/{libs/cli/cypher/src → cypher}/lib/parser.js +119 -135
  35. package/{libs/cli/cypher/src → cypher}/lib/validator/query-validator.js +12 -32
  36. package/{libs/cli/cypher/src → cypher}/lib/validator/supported-features.config.js +2 -30
  37. package/{libs/cli/cypher/src → cypher}/lib/validator/unsupported-features.config.js +8 -34
  38. package/cypher-cli.js +41 -0
  39. package/infra/code-graph.js +147 -0
  40. package/main.js +0 -43
  41. package/package.json +25 -7
  42. package/resources-cli.js +75 -0
  43. package/run-cli.js +43 -0
  44. package/apps/code-graph/src/main.js +0 -50
  45. package/libs/cli/code-graph/src/index.js +0 -39
  46. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.js +0 -72
  47. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.stateful.js +0 -68
  48. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.doc.js +0 -147
  49. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.graph.js +0 -55
  50. package/libs/cli/code-graph/src/lib/class-declarations/index.js +0 -27
  51. package/libs/cli/code-graph/src/lib/code.graph.factory.js +0 -63
  52. package/libs/cli/code-graph/src/lib/code.graph.js +0 -62
  53. package/libs/cli/code-graph/src/lib/core/core.js +0 -58
  54. package/libs/cli/code-graph/src/lib/core.js +0 -85
  55. package/libs/cli/code-graph/src/lib/decorators/index.js +0 -36
  56. package/libs/cli/code-graph/src/lib/docs/index.js +0 -21
  57. package/libs/cli/code-graph/src/lib/docs/specs.js +0 -36
  58. package/libs/cli/code-graph/src/lib/expressions/call-expressions.graph.js +0 -28
  59. package/libs/cli/code-graph/src/lib/fixtures/reactive-event-bus/src/app/examples.event-bus.js +0 -53
  60. package/libs/cli/code-graph/src/lib/method-declarations/index.js +0 -23
  61. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.doc.js +0 -106
  62. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.graph.js +0 -56
  63. package/libs/cli/code-graph/src/lib/parameters/index.js +0 -42
  64. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.evals.js +0 -139
  65. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.js +0 -104
  66. package/libs/cli/code-graph/src/lib/property-declarations/index.js +0 -25
  67. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.doc.js +0 -74
  68. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.graph.js +0 -43
  69. package/libs/cli/code-graph/src/lib/tools/index.js +0 -34
  70. package/libs/cli/code-graph/src/lib/tools/match-code-graph.tool.js +0 -64
  71. package/libs/cli/code-graph/src/lib/types/index.js +0 -99
  72. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.doc.js +0 -345
  73. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.js +0 -52
  74. package/libs/cli/code-graph/src/lib/v2/extractors/index.js +0 -23
  75. package/libs/cli/code-graph/src/lib/v2/graph-builder/code-graph.builder.js +0 -76
  76. package/libs/cli/code-graph/src/lib/v2/graph-builder/index.js +0 -21
  77. package/libs/cli/code-graph/src/lib/v2/graph-builder/node.processor.js +0 -48
  78. package/libs/cli/code-graph/src/lib/v2/graph-builder/type.processor.js +0 -45
  79. package/libs/cli/code-graph/src/lib/v2/index.js +0 -37
  80. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.doc.js +0 -220
  81. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.tool.js +0 -42
  82. package/libs/cli/cypher/src/index.js +0 -25
  83. package/libs/cli/cypher/src/lib/docs/features/advanced-optional-match.feature.js +0 -277
  84. package/libs/cli/cypher/src/lib/docs/features/anonymous-relationship.feature.js +0 -69
  85. package/libs/cli/cypher/src/lib/docs/features/anonymous-variable-length.feature.js +0 -105
  86. package/libs/cli/cypher/src/lib/docs/features/basic-filtering.feature.js +0 -70
  87. package/libs/cli/cypher/src/lib/docs/features/basic-optional-match.feature.js +0 -99
  88. package/libs/cli/cypher/src/lib/docs/features/basic-relationship.feature.js +0 -125
  89. package/libs/cli/cypher/src/lib/docs/features/index.js +0 -51
  90. package/libs/cli/cypher/src/lib/docs/features/limit.feature.js +0 -50
  91. package/libs/cli/cypher/src/lib/docs/features/match-nodes.feature.js +0 -106
  92. package/libs/cli/cypher/src/lib/docs/features/multiple-relationship-types.feature.js +0 -105
  93. package/libs/cli/cypher/src/lib/docs/features/order-by.feature.js +0 -143
  94. package/libs/cli/cypher/src/lib/docs/features/property-matching.feature.js +0 -152
  95. package/libs/cli/cypher/src/lib/docs/features/relationship-without-variable.feature.js +0 -48
  96. package/libs/cli/cypher/src/lib/docs/features/return-statement.feature.js +0 -65
  97. package/libs/cli/cypher/src/lib/docs/features/unidirected-relationship.feature.js +0 -82
  98. package/libs/cli/cypher/src/lib/docs/features/variable-length-path.feature.js +0 -136
  99. package/libs/cli/cypher/src/lib/docs/features/where-conditional.feature.js +0 -187
  100. package/libs/cli/cypher/src/lib/docs/features/where-operators.feature.js +0 -302
  101. package/libs/cli/cypher/src/lib/docs/prompts.js +0 -36
  102. package/libs/cli/cypher/src/lib/docs/specs.js +0 -181
  103. package/libs/cli/cypher/src/lib/executor/executor.js +0 -83
  104. package/libs/cli/cypher/src/lib/executor/graph.js +0 -15
  105. package/libs/cli/cypher/src/lib/executor/utils.js +0 -37
  106. package/libs/cli/cypher/src/lib/graph.stub.js +0 -63
  107. package/libs/cli/cypher/src/lib/index.js +0 -74
  108. package/libs/cli/shared/src/index.js +0 -53
  109. package/libs/cli/shared/src/lib/admin-token.js +0 -121
  110. package/libs/cli/shared/src/lib/config.js +0 -49
  111. package/libs/cli/shared/src/lib/consts.js +0 -57
  112. package/libs/cli/shared/src/lib/core.js +0 -46
  113. package/libs/cli/shared/src/lib/infrastructure/cli.js +0 -47
  114. package/libs/cli/shared/src/lib/infrastructure/config.js +0 -47
  115. package/libs/cli/shared/src/lib/infrastructure/config.reporitory.js +0 -51
  116. package/libs/cli/shared/src/lib/infrastructure/formatters/console-formatter.js +0 -96
  117. package/libs/cli/shared/src/lib/infrastructure/formatters/index.js +0 -41
  118. package/libs/cli/shared/src/lib/infrastructure/formatters/json-formatter.js +0 -64
  119. package/libs/cli/shared/src/lib/infrastructure/formatters/markdown-formatter.js +0 -120
  120. package/libs/cli/shared/src/lib/infrastructure/formatters/types.js +0 -15
  121. package/libs/cli/shared/src/lib/infrastructure/formatters/utils.js +0 -72
  122. package/libs/cli/shared/src/lib/infrastructure/git.js +0 -147
  123. package/libs/cli/shared/src/lib/infrastructure/http.js +0 -257
  124. package/libs/cli/shared/src/lib/infrastructure/markdown.js +0 -95
  125. package/libs/cli/shared/src/lib/infrastructure/transformers/embeddings.js +0 -88
  126. package/libs/cli/shared/src/lib/infrastructure/transformers/index.js +0 -25
  127. package/libs/cli/shared/src/lib/infrastructure/transformers/rag-eval.js +0 -154
  128. package/libs/cli/shared/src/lib/infrastructure/transformers/similarity.js +0 -210
  129. package/libs/cli/shared/src/lib/infrastructure/workspace.js +0 -297
  130. package/libs/cli/shared/src/lib/infrastructure/yaml.js +0 -237
  131. package/libs/cli/shared/src/lib/lowgular.config.js +0 -120
  132. package/libs/cli/shared/src/lib/token.js +0 -135
  133. package/libs/cli/shared/src/lib/utils/solution.util.js +0 -35
  134. package/libs/cli/shared/src/lib/utils/utils.js +0 -89
  135. package/libs/cli/typescript/src/index.js +0 -21
  136. package/libs/cli/typescript/src/lib/base/index.js +0 -23
  137. package/libs/cli/typescript/src/lib/base/nameable.js +0 -34
  138. package/libs/cli/typescript/src/lib/base/nodeable.js +0 -36
  139. package/libs/cli/typescript/src/lib/class.implementation.js +0 -52
  140. package/libs/cli/typescript/src/lib/core/declaration.registry.js +0 -107
  141. package/libs/cli/typescript/src/lib/core/design-pattern.js +0 -55
  142. package/libs/cli/typescript/src/lib/core/index.js +0 -35
  143. package/libs/cli/typescript/src/lib/core/navigable-declaration.js +0 -69
  144. package/libs/cli/typescript/src/lib/core/program-context.js +0 -71
  145. package/libs/cli/typescript/src/lib/core/syntax-kind.utils.js +0 -40
  146. package/libs/cli/typescript/src/lib/core/type.js +0 -374
  147. package/libs/cli/typescript/src/lib/declaration.abstraction.js +0 -90
  148. package/libs/cli/typescript/src/lib/decorator.implementation.js +0 -35
  149. package/libs/cli/typescript/src/lib/enum.implementation.js +0 -35
  150. package/libs/cli/typescript/src/lib/function-declaration.implementation.js +0 -35
  151. package/libs/cli/typescript/src/lib/index.js +0 -57
  152. package/libs/cli/typescript/src/lib/interface.implementation.js +0 -51
  153. package/libs/cli/typescript/src/lib/members/method-abstraction.resolver.js +0 -90
  154. package/libs/cli/typescript/src/lib/members/method-declaration.implementation.js +0 -44
  155. package/libs/cli/typescript/src/lib/members/method-signature.implementation.js +0 -46
  156. package/libs/cli/typescript/src/lib/members/method.util.js +0 -32
  157. package/libs/cli/typescript/src/lib/members/parameter.implementation.js +0 -38
  158. package/libs/cli/typescript/src/lib/members/property-declaration.implementation.js +0 -64
  159. package/libs/cli/typescript/src/lib/members/property-signature.implementation.js +0 -34
  160. package/libs/cli/typescript/src/lib/members/property.util.js +0 -61
  161. package/libs/cli/typescript/src/lib/members/statements/expressions/binary-expression.implementation.js +0 -42
  162. package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js +0 -114
  163. package/libs/cli/typescript/src/lib/members/statements/expressions/expression.abstraction.js +0 -188
  164. package/libs/cli/typescript/src/lib/members/statements/expressions/property-access-expression.implementation.js +0 -35
  165. package/libs/cli/typescript/src/lib/members/statements/expressions/unary-expression.implementation.js +0 -51
  166. package/libs/cli/typescript/src/lib/members/statements/statement.implementation.js +0 -49
  167. package/libs/cli/typescript/src/lib/members/statements/utils.js +0 -51
  168. package/libs/cli/typescript/src/lib/plugins/built-in.plugin.js +0 -258
  169. package/libs/cli/typescript/src/lib/plugins/plugin.interface.js +0 -15
  170. package/libs/cli/typescript/src/lib/plugins/rxjs.plugin.js +0 -228
  171. package/libs/cli/typescript/src/lib/plugins/signal.plugin.js +0 -126
  172. package/libs/cli/typescript/src/lib/plugins/stubs.js +0 -66
  173. package/libs/cli/typescript/src/lib/type-alias.implementation.js +0 -72
  174. package/libs/cli/typescript/src/lib/utils.js +0 -39
  175. package/libs/cli/typescript/src/lib/variable-declaration.implementation.js +0 -35
  176. package/libs/core/codegular/src/index.js +0 -21
  177. package/libs/core/codegular/src/lib/index.js +0 -29
  178. package/libs/core/codegular/src/lib/node.js +0 -112
  179. package/libs/core/codegular/src/lib/program.js +0 -92
@@ -1,36 +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 nodeable_exports = {};
19
- __export(nodeable_exports, {
20
- NodableImpl: () => NodableImpl
21
- });
22
- module.exports = __toCommonJS(nodeable_exports);
23
- var import_codegular = require("@core/codegular");
24
- var import_syntax_kind = require("../core/syntax-kind.utils");
25
- class NodableImpl {
26
- constructor(node) {
27
- this.range = (0, import_codegular.getRange)(node);
28
- this.filePath = node.getSourceFile().fileName;
29
- this.kind = (0, import_syntax_kind.getSyntaxKindName)(node.kind);
30
- this.snippet = (0, import_codegular.getText)(node);
31
- }
32
- }
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- NodableImpl
36
- });
@@ -1,52 +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 class_implementation_exports = {};
19
- __export(class_implementation_exports, {
20
- ClassImplementation: () => ClassImplementation
21
- });
22
- module.exports = __toCommonJS(class_implementation_exports);
23
- var import_codegular = require("@core/codegular");
24
- var import_typescript = require("typescript");
25
- var import_core = require("./core");
26
- var import_decorator = require("./decorator.implementation");
27
- var import_method_declaration = require("./members/method-declaration.implementation");
28
- var import_property_declaration = require("./members/property-declaration.implementation");
29
- class ClassImplementation extends import_core.NameableImpl {
30
- constructor(node, context) {
31
- super(node);
32
- this.decorators = (0, import_codegular.findChildrenByKind)(node, import_typescript.SyntaxKind.Decorator).map(
33
- (d) => new import_decorator.DecoratorImplementation(d)
34
- );
35
- this.properties = (0, import_codegular.findChildrenByKind)(
36
- node,
37
- import_typescript.SyntaxKind.PropertyDeclaration
38
- ).map(
39
- (p) => new import_property_declaration.PropertyDeclarationImplementation(
40
- p,
41
- context
42
- )
43
- );
44
- this.methods = (0, import_codegular.findChildrenByKind)(node, import_typescript.SyntaxKind.MethodDeclaration).map(
45
- (m) => new import_method_declaration.MethodDeclarationImplementation(m, context)
46
- );
47
- }
48
- }
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
51
- ClassImplementation
52
- });
@@ -1,107 +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 declaration_registry_exports = {};
19
- __export(declaration_registry_exports, {
20
- DeclarationRegistry: () => DeclarationRegistry,
21
- createImplementationKey: () => createImplementationKey
22
- });
23
- module.exports = __toCommonJS(declaration_registry_exports);
24
- var import_codegular = require("@core/codegular");
25
- var import_built_in = require("../plugins/built-in.plugin");
26
- var import_rxjs = require("../plugins/rxjs.plugin");
27
- var import_signal = require("../plugins/signal.plugin");
28
- const ts = require("typescript");
29
- const createImplementationKey = (declaration, declarationName) => {
30
- let fileName;
31
- let name;
32
- if (typeof declaration === "string") {
33
- fileName = "node_modules/typescript/lib/lib.d.ts";
34
- name = declaration;
35
- } else {
36
- const sourceFile = declaration.getSourceFile();
37
- fileName = sourceFile.fileName;
38
- name = declarationName || (0, import_codegular.getNameByIdentifier)(declaration);
39
- }
40
- const normalizedPath = fileName.replace(/\\/g, "/");
41
- return `${normalizedPath}!${name}`;
42
- };
43
- class DeclarationRegistry {
44
- constructor(plugins = []) {
45
- this._symbolCache = /* @__PURE__ */ new Map();
46
- this._plugins = plugins;
47
- }
48
- static fromDefaultAngular() {
49
- return new DeclarationRegistry([
50
- new import_built_in.BuiltInPlugin(),
51
- new import_rxjs.RxjsPlugin(),
52
- new import_signal.SignalPlugin()
53
- ]);
54
- }
55
- /**
56
- * Gets a cached implementation by key
57
- */
58
- get(key) {
59
- return this._symbolCache.get(key);
60
- }
61
- /**
62
- * Caches an implementation with a key
63
- */
64
- set(key, nodable) {
65
- this._symbolCache.set(key, nodable);
66
- }
67
- /**
68
- * Gets or creates an implementation for a declaration
69
- * If not cached, calls the factory function and caches the result
70
- */
71
- getOrCreate(declaration, factory) {
72
- const key = createImplementationKey(declaration);
73
- const cached = this.get(key);
74
- if (cached) {
75
- return cached;
76
- }
77
- const impl = factory(declaration);
78
- this.set(key, impl);
79
- return impl;
80
- }
81
- /**
82
- * Gets a cached implementation for a declaration using plugins
83
- * Checks all registered plugins to see if any can resolve the declaration
84
- * The declaration passed should already be the last one (for handling overrides)
85
- */
86
- getFromDeclaration(declaration, context) {
87
- for (const plugin of this._plugins) {
88
- if (plugin.matches(declaration, context)) {
89
- const implementation = plugin.resolve(declaration, context);
90
- if (implementation) {
91
- const declarationName = (0, import_codegular.getNameByIdentifier)(declaration);
92
- if (declarationName) {
93
- const key = createImplementationKey(declarationName);
94
- this.set(key, implementation);
95
- }
96
- return implementation;
97
- }
98
- }
99
- }
100
- return void 0;
101
- }
102
- }
103
- // Annotate the CommonJS export names for ESM import in node:
104
- 0 && (module.exports = {
105
- DeclarationRegistry,
106
- createImplementationKey
107
- });
@@ -1,55 +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 design_pattern_exports = {};
19
- __export(design_pattern_exports, {
20
- reduceToDesignPattern: () => reduceToDesignPattern
21
- });
22
- module.exports = __toCommonJS(design_pattern_exports);
23
- const reduceToDesignPattern = (result, allConcepts, requiredConcepts) => {
24
- return result.reduce(
25
- (designPatternResult, r) => {
26
- const concepts = Object.keys(r).reduce(
27
- (concepts2, conceptId) => {
28
- if (r[conceptId] && Object.values(allConcepts).includes(conceptId)) {
29
- concepts2[conceptId] = r[conceptId];
30
- }
31
- return concepts2;
32
- },
33
- {}
34
- );
35
- const missingRequiredConcepts = requiredConcepts.filter(
36
- (concept) => !Object.keys(concepts).includes(concept)
37
- );
38
- if (missingRequiredConcepts.length) {
39
- return designPatternResult;
40
- }
41
- return [
42
- ...designPatternResult,
43
- {
44
- classImplementation: r.EventBusPattern,
45
- concepts
46
- }
47
- ];
48
- },
49
- []
50
- );
51
- };
52
- // Annotate the CommonJS export names for ESM import in node:
53
- 0 && (module.exports = {
54
- reduceToDesignPattern
55
- });
@@ -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 __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 core_exports = {};
16
- module.exports = __toCommonJS(core_exports);
17
- __reExport(core_exports, require("../base/nameable"), module.exports);
18
- __reExport(core_exports, require("../base/nodeable"), module.exports);
19
- __reExport(core_exports, require("./declaration.registry"), module.exports);
20
- __reExport(core_exports, require("./design-pattern"), module.exports);
21
- __reExport(core_exports, require("./navigable-declaration"), module.exports);
22
- __reExport(core_exports, require("./program-context"), module.exports);
23
- __reExport(core_exports, require("./syntax-kind.utils"), module.exports);
24
- __reExport(core_exports, require("./type"), module.exports);
25
- // Annotate the CommonJS export names for ESM import in node:
26
- 0 && (module.exports = {
27
- ...require("../base/nameable"),
28
- ...require("../base/nodeable"),
29
- ...require("./declaration.registry"),
30
- ...require("./design-pattern"),
31
- ...require("./navigable-declaration"),
32
- ...require("./program-context"),
33
- ...require("./syntax-kind.utils"),
34
- ...require("./type")
35
- });
@@ -1,69 +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 navigable_declaration_exports = {};
29
- __export(navigable_declaration_exports, {
30
- makeNavigableDeclaration: () => makeNavigableDeclaration
31
- });
32
- module.exports = __toCommonJS(navigable_declaration_exports);
33
- var ts = __toESM(require("typescript"));
34
- var import_declaration = require("../declaration.abstraction");
35
- var import_enum = require("../enum.implementation");
36
- var import_function_declaration = require("../function-declaration.implementation");
37
- var import_variable_declaration = require("../variable-declaration.implementation");
38
- var import_syntax_kind = require("./syntax-kind.utils");
39
- const makeNavigableDeclaration = (declaration, context) => {
40
- const kind = declaration.kind;
41
- switch (kind) {
42
- case ts.SyntaxKind.ClassDeclaration:
43
- case ts.SyntaxKind.InterfaceDeclaration:
44
- case ts.SyntaxKind.TypeAliasDeclaration:
45
- return (0, import_declaration.makeDeclarationInterface)(
46
- declaration,
47
- context
48
- );
49
- case ts.SyntaxKind.EnumDeclaration:
50
- return new import_enum.EnumImplementation(declaration, context);
51
- case ts.SyntaxKind.VariableDeclaration:
52
- return new import_variable_declaration.VariableDeclarationImplementation(
53
- declaration,
54
- context
55
- );
56
- case ts.SyntaxKind.FunctionDeclaration:
57
- return new import_function_declaration.FunctionDeclarationImplementation(
58
- declaration,
59
- context
60
- );
61
- }
62
- throw new Error(
63
- `Node is not a navigable declaration: ` + (0, import_syntax_kind.getSyntaxKindName)(kind)
64
- );
65
- };
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- makeNavigableDeclaration
69
- });
@@ -1,71 +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 program_context_exports = {};
19
- __export(program_context_exports, {
20
- TypeResolutionTracker: () => TypeResolutionTracker,
21
- cacheDecorator: () => cacheDecorator
22
- });
23
- module.exports = __toCommonJS(program_context_exports);
24
- class TypeResolutionTracker {
25
- constructor() {
26
- // Cache for resolved types - maps ts.Type to TypeInfoImpl
27
- this._typeCache = /* @__PURE__ */ new WeakMap();
28
- // Cache for resolved types from nodes - maps ts.Node to TypeInfoImpl
29
- this._nodeCache = /* @__PURE__ */ new WeakMap();
30
- }
31
- /**
32
- * Gets the cached TypeInfoImpl for a type, or undefined if not cached.
33
- */
34
- get(type) {
35
- return this._typeCache.get(type);
36
- }
37
- /**
38
- * Caches a TypeInfoImpl for a type.
39
- */
40
- set(type, value) {
41
- this._typeCache.set(type, value);
42
- }
43
- /**
44
- * Gets the cached TypeInfoImpl for a node, or undefined if not cached.
45
- */
46
- getFromNode(node) {
47
- return this._nodeCache.get(node);
48
- }
49
- /**
50
- * Caches a TypeInfoImpl for a node.
51
- */
52
- setFromNode(node, value) {
53
- this._nodeCache.set(node, value);
54
- }
55
- }
56
- const cacheDecorator = (cb, node, typeResolutionTracker) => {
57
- const cached = typeResolutionTracker.getFromNode(node);
58
- if (cached !== void 0) {
59
- return cached;
60
- }
61
- const result = cb(node);
62
- if (result) {
63
- typeResolutionTracker.setFromNode(node, result);
64
- }
65
- return result;
66
- };
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {
69
- TypeResolutionTracker,
70
- cacheDecorator
71
- });
@@ -1,40 +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 syntax_kind_utils_exports = {};
29
- __export(syntax_kind_utils_exports, {
30
- getSyntaxKindName: () => getSyntaxKindName
31
- });
32
- module.exports = __toCommonJS(syntax_kind_utils_exports);
33
- var ts = __toESM(require("typescript"));
34
- const getSyntaxKindName = (kind) => {
35
- return ts.SyntaxKind[kind];
36
- };
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- getSyntaxKindName
40
- });