@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,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
- });