@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.
- package/bin/cli.js +2463 -0
- package/lib.js +2430 -0
- package/package.json +26 -7
- package/apps/code-graph/src/main.js +0 -50
- package/libs/cli/code-graph/src/index.js +0 -39
- package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.js +0 -72
- package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.stateful.js +0 -68
- package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.doc.js +0 -147
- package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.graph.js +0 -55
- package/libs/cli/code-graph/src/lib/class-declarations/index.js +0 -27
- package/libs/cli/code-graph/src/lib/code.graph.factory.js +0 -63
- package/libs/cli/code-graph/src/lib/code.graph.js +0 -62
- package/libs/cli/code-graph/src/lib/core/core.js +0 -58
- package/libs/cli/code-graph/src/lib/core.js +0 -85
- package/libs/cli/code-graph/src/lib/decorators/index.js +0 -36
- package/libs/cli/code-graph/src/lib/docs/index.js +0 -21
- package/libs/cli/code-graph/src/lib/docs/specs.js +0 -36
- package/libs/cli/code-graph/src/lib/expressions/call-expressions.graph.js +0 -28
- package/libs/cli/code-graph/src/lib/fixtures/reactive-event-bus/src/app/examples.event-bus.js +0 -53
- package/libs/cli/code-graph/src/lib/method-declarations/index.js +0 -23
- package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.doc.js +0 -106
- package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.graph.js +0 -56
- package/libs/cli/code-graph/src/lib/parameters/index.js +0 -42
- package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.evals.js +0 -139
- package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.js +0 -104
- package/libs/cli/code-graph/src/lib/property-declarations/index.js +0 -25
- package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.doc.js +0 -74
- package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.graph.js +0 -43
- package/libs/cli/code-graph/src/lib/tools/index.js +0 -34
- package/libs/cli/code-graph/src/lib/tools/match-code-graph.tool.js +0 -64
- package/libs/cli/code-graph/src/lib/types/index.js +0 -99
- package/libs/cli/code-graph/src/lib/v2/extractors/extractor.doc.js +0 -345
- package/libs/cli/code-graph/src/lib/v2/extractors/extractor.js +0 -52
- package/libs/cli/code-graph/src/lib/v2/extractors/index.js +0 -23
- package/libs/cli/code-graph/src/lib/v2/graph-builder/code-graph.builder.js +0 -76
- package/libs/cli/code-graph/src/lib/v2/graph-builder/index.js +0 -21
- package/libs/cli/code-graph/src/lib/v2/graph-builder/node.processor.js +0 -48
- package/libs/cli/code-graph/src/lib/v2/graph-builder/relationship.processor.js +0 -79
- package/libs/cli/code-graph/src/lib/v2/graph-builder/type.processor.js +0 -45
- package/libs/cli/code-graph/src/lib/v2/index.js +0 -37
- package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.doc.js +0 -220
- package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.tool.js +0 -42
- package/libs/cli/cypher/src/index.js +0 -25
- package/libs/cli/cypher/src/lib/docs/features/advanced-optional-match.feature.js +0 -277
- package/libs/cli/cypher/src/lib/docs/features/anonymous-relationship.feature.js +0 -69
- package/libs/cli/cypher/src/lib/docs/features/anonymous-variable-length.feature.js +0 -105
- package/libs/cli/cypher/src/lib/docs/features/basic-filtering.feature.js +0 -70
- package/libs/cli/cypher/src/lib/docs/features/basic-optional-match.feature.js +0 -99
- package/libs/cli/cypher/src/lib/docs/features/basic-relationship.feature.js +0 -125
- package/libs/cli/cypher/src/lib/docs/features/index.js +0 -51
- package/libs/cli/cypher/src/lib/docs/features/limit.feature.js +0 -50
- package/libs/cli/cypher/src/lib/docs/features/match-nodes.feature.js +0 -106
- package/libs/cli/cypher/src/lib/docs/features/multiple-relationship-types.feature.js +0 -105
- package/libs/cli/cypher/src/lib/docs/features/order-by.feature.js +0 -143
- package/libs/cli/cypher/src/lib/docs/features/property-matching.feature.js +0 -152
- package/libs/cli/cypher/src/lib/docs/features/relationship-without-variable.feature.js +0 -48
- package/libs/cli/cypher/src/lib/docs/features/return-statement.feature.js +0 -65
- package/libs/cli/cypher/src/lib/docs/features/unidirected-relationship.feature.js +0 -82
- package/libs/cli/cypher/src/lib/docs/features/variable-length-path.feature.js +0 -136
- package/libs/cli/cypher/src/lib/docs/features/where-conditional.feature.js +0 -187
- package/libs/cli/cypher/src/lib/docs/features/where-operators.feature.js +0 -302
- package/libs/cli/cypher/src/lib/docs/prompts.js +0 -36
- package/libs/cli/cypher/src/lib/docs/specs.js +0 -181
- package/libs/cli/cypher/src/lib/executor/condition-evaluator.js +0 -158
- package/libs/cli/cypher/src/lib/executor/executor.js +0 -83
- package/libs/cli/cypher/src/lib/executor/graph.js +0 -15
- package/libs/cli/cypher/src/lib/executor/match-engine.js +0 -153
- package/libs/cli/cypher/src/lib/executor/pattern-matcher.js +0 -109
- package/libs/cli/cypher/src/lib/executor/relationship-navigator.js +0 -64
- package/libs/cli/cypher/src/lib/executor/result-formatter.js +0 -143
- package/libs/cli/cypher/src/lib/executor/traverse-engine.js +0 -164
- package/libs/cli/cypher/src/lib/executor/utils.js +0 -37
- package/libs/cli/cypher/src/lib/graph.stub.js +0 -63
- package/libs/cli/cypher/src/lib/index.js +0 -74
- package/libs/cli/cypher/src/lib/lexer.js +0 -398
- package/libs/cli/cypher/src/lib/parser.js +0 -602
- package/libs/cli/cypher/src/lib/validator/query-validator.js +0 -95
- package/libs/cli/cypher/src/lib/validator/supported-features.config.js +0 -111
- package/libs/cli/cypher/src/lib/validator/unsupported-features.config.js +0 -150
- package/libs/cli/shared/src/index.js +0 -53
- package/libs/cli/shared/src/lib/admin-token.js +0 -121
- package/libs/cli/shared/src/lib/config.js +0 -49
- package/libs/cli/shared/src/lib/consts.js +0 -57
- package/libs/cli/shared/src/lib/core.js +0 -46
- package/libs/cli/shared/src/lib/infrastructure/cli.js +0 -47
- package/libs/cli/shared/src/lib/infrastructure/config.js +0 -47
- package/libs/cli/shared/src/lib/infrastructure/config.reporitory.js +0 -51
- package/libs/cli/shared/src/lib/infrastructure/formatters/console-formatter.js +0 -96
- package/libs/cli/shared/src/lib/infrastructure/formatters/index.js +0 -41
- package/libs/cli/shared/src/lib/infrastructure/formatters/json-formatter.js +0 -64
- package/libs/cli/shared/src/lib/infrastructure/formatters/markdown-formatter.js +0 -120
- package/libs/cli/shared/src/lib/infrastructure/formatters/types.js +0 -15
- package/libs/cli/shared/src/lib/infrastructure/formatters/utils.js +0 -72
- package/libs/cli/shared/src/lib/infrastructure/git.js +0 -147
- package/libs/cli/shared/src/lib/infrastructure/http.js +0 -257
- package/libs/cli/shared/src/lib/infrastructure/markdown.js +0 -95
- package/libs/cli/shared/src/lib/infrastructure/transformers/embeddings.js +0 -88
- package/libs/cli/shared/src/lib/infrastructure/transformers/index.js +0 -25
- package/libs/cli/shared/src/lib/infrastructure/transformers/rag-eval.js +0 -154
- package/libs/cli/shared/src/lib/infrastructure/transformers/similarity.js +0 -210
- package/libs/cli/shared/src/lib/infrastructure/workspace.js +0 -297
- package/libs/cli/shared/src/lib/infrastructure/yaml.js +0 -237
- package/libs/cli/shared/src/lib/lowgular.config.js +0 -120
- package/libs/cli/shared/src/lib/token.js +0 -135
- package/libs/cli/shared/src/lib/utils/solution.util.js +0 -35
- package/libs/cli/shared/src/lib/utils/utils.js +0 -89
- package/libs/cli/typescript/src/index.js +0 -21
- package/libs/cli/typescript/src/lib/base/index.js +0 -23
- package/libs/cli/typescript/src/lib/base/nameable.js +0 -34
- package/libs/cli/typescript/src/lib/base/nodeable.js +0 -36
- package/libs/cli/typescript/src/lib/class.implementation.js +0 -52
- package/libs/cli/typescript/src/lib/core/declaration.registry.js +0 -107
- package/libs/cli/typescript/src/lib/core/design-pattern.js +0 -55
- package/libs/cli/typescript/src/lib/core/index.js +0 -35
- package/libs/cli/typescript/src/lib/core/navigable-declaration.js +0 -69
- package/libs/cli/typescript/src/lib/core/program-context.js +0 -71
- package/libs/cli/typescript/src/lib/core/syntax-kind.utils.js +0 -40
- package/libs/cli/typescript/src/lib/core/type.js +0 -374
- package/libs/cli/typescript/src/lib/declaration.abstraction.js +0 -90
- package/libs/cli/typescript/src/lib/decorator.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/enum.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/function-declaration.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/index.js +0 -57
- package/libs/cli/typescript/src/lib/interface.implementation.js +0 -51
- package/libs/cli/typescript/src/lib/members/method-abstraction.resolver.js +0 -90
- package/libs/cli/typescript/src/lib/members/method-declaration.implementation.js +0 -44
- package/libs/cli/typescript/src/lib/members/method-signature.implementation.js +0 -46
- package/libs/cli/typescript/src/lib/members/method.util.js +0 -32
- package/libs/cli/typescript/src/lib/members/parameter.implementation.js +0 -38
- package/libs/cli/typescript/src/lib/members/property-declaration.implementation.js +0 -64
- package/libs/cli/typescript/src/lib/members/property-signature.implementation.js +0 -34
- package/libs/cli/typescript/src/lib/members/property.util.js +0 -61
- package/libs/cli/typescript/src/lib/members/statements/expressions/binary-expression.implementation.js +0 -42
- package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js +0 -114
- package/libs/cli/typescript/src/lib/members/statements/expressions/expression.abstraction.js +0 -188
- package/libs/cli/typescript/src/lib/members/statements/expressions/property-access-expression.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/members/statements/expressions/unary-expression.implementation.js +0 -51
- package/libs/cli/typescript/src/lib/members/statements/statement.implementation.js +0 -49
- package/libs/cli/typescript/src/lib/members/statements/utils.js +0 -51
- package/libs/cli/typescript/src/lib/plugins/built-in.plugin.js +0 -258
- package/libs/cli/typescript/src/lib/plugins/plugin.interface.js +0 -15
- package/libs/cli/typescript/src/lib/plugins/rxjs.plugin.js +0 -228
- package/libs/cli/typescript/src/lib/plugins/signal.plugin.js +0 -126
- package/libs/cli/typescript/src/lib/plugins/stubs.js +0 -66
- package/libs/cli/typescript/src/lib/type-alias.implementation.js +0 -72
- package/libs/cli/typescript/src/lib/utils.js +0 -39
- package/libs/cli/typescript/src/lib/variable-declaration.implementation.js +0 -35
- package/libs/core/codegular/src/index.js +0 -21
- package/libs/core/codegular/src/lib/index.js +0 -29
- package/libs/core/codegular/src/lib/node.js +0 -112
- package/libs/core/codegular/src/lib/program.js +0 -92
- package/libs/core/codegular/src/lib/string.js +0 -168
- package/libs/core/codegular/src/lib/type-checker.js +0 -170
- package/libs/core/codegular/src/lib/utils.js +0 -347
- package/main.js +0 -43
|
@@ -1,347 +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 utils_exports = {};
|
|
29
|
-
__export(utils_exports, {
|
|
30
|
-
consoleAllChildren: () => consoleAllChildren,
|
|
31
|
-
escapeValue: () => escapeValue,
|
|
32
|
-
findChildByIndex: () => findChildByIndex,
|
|
33
|
-
findChildByName: () => findChildByName,
|
|
34
|
-
findChildrenByKind: () => findChildrenByKind,
|
|
35
|
-
findChildrenByKinds: () => findChildrenByKinds,
|
|
36
|
-
findChildrenByName: () => findChildrenByName,
|
|
37
|
-
findFirstChildByKind: () => findFirstChildByKind,
|
|
38
|
-
findFirstChildByKinds: () => findFirstChildByKinds,
|
|
39
|
-
findTypeDeclarationByName: () => findTypeDeclarationByName,
|
|
40
|
-
getAllExpressions: () => getAllExpressions,
|
|
41
|
-
getAncestorByKind: () => getAncestorByKind,
|
|
42
|
-
getAncestorsBy: () => getAncestorsBy,
|
|
43
|
-
getAncestorsByKind: () => getAncestorsByKind,
|
|
44
|
-
getComments: () => getComments,
|
|
45
|
-
getDescendantByName: () => getDescendantByName,
|
|
46
|
-
getDescendantsBy: () => getDescendantsBy,
|
|
47
|
-
getDescendantsByKind: () => getDescendantsByKind,
|
|
48
|
-
getDescendantsByKinds: () => getDescendantsByKinds,
|
|
49
|
-
getSolutionSourceFiles: () => getSolutionSourceFiles,
|
|
50
|
-
parseArrayLiteralExpression: () => parseArrayLiteralExpression,
|
|
51
|
-
parseObjectLiteralExpression: () => parseObjectLiteralExpression,
|
|
52
|
-
peelCallTarget: () => peelCallTarget,
|
|
53
|
-
readSourceFiles: () => readSourceFiles
|
|
54
|
-
});
|
|
55
|
-
module.exports = __toCommonJS(utils_exports);
|
|
56
|
-
var ts = __toESM(require("typescript"));
|
|
57
|
-
var import_string = require("./string");
|
|
58
|
-
const path = require("path");
|
|
59
|
-
const { forEachChild, SyntaxKind } = ts;
|
|
60
|
-
function escapeValue(value) {
|
|
61
|
-
return value.replace(/^['"`]+/i, "").replace(/['"`]+$/i, "");
|
|
62
|
-
}
|
|
63
|
-
function findFirstChildByKind(node, kind) {
|
|
64
|
-
let element;
|
|
65
|
-
forEachChild(node, (child) => {
|
|
66
|
-
if (child.kind !== kind || !!element) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
element = child;
|
|
70
|
-
});
|
|
71
|
-
return element;
|
|
72
|
-
}
|
|
73
|
-
function peelCallTarget(expr) {
|
|
74
|
-
const chain = [];
|
|
75
|
-
let hasOptional = false;
|
|
76
|
-
let e = expr;
|
|
77
|
-
let baseAccess;
|
|
78
|
-
while (true) {
|
|
79
|
-
if (ts.isPropertyAccessExpression(e)) {
|
|
80
|
-
chain.unshift(e.name.text);
|
|
81
|
-
hasOptional = hasOptional || !!e.questionDotToken;
|
|
82
|
-
baseAccess = e;
|
|
83
|
-
e = e.expression;
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
if (ts.isElementAccessExpression(e)) {
|
|
87
|
-
const arg = e.argumentExpression;
|
|
88
|
-
const key = ts.isStringLiteral(arg) || ts.isIdentifier(arg) ? arg.text : "<computed>";
|
|
89
|
-
chain.unshift(key);
|
|
90
|
-
hasOptional = hasOptional || !!e.questionDotToken;
|
|
91
|
-
baseAccess = e;
|
|
92
|
-
e = e.expression;
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
root: e,
|
|
99
|
-
basePropAccess: baseAccess,
|
|
100
|
-
chain,
|
|
101
|
-
invoked: chain.length ? chain[chain.length - 1] : void 0,
|
|
102
|
-
hasOptional
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function getAncestorsBy(node, predicate) {
|
|
106
|
-
let currentNode = node;
|
|
107
|
-
const nodes = [];
|
|
108
|
-
while (currentNode) {
|
|
109
|
-
if (predicate(currentNode)) {
|
|
110
|
-
nodes.push(currentNode);
|
|
111
|
-
}
|
|
112
|
-
const parent = currentNode?.parent;
|
|
113
|
-
if (!parent) {
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
currentNode = parent;
|
|
117
|
-
}
|
|
118
|
-
return nodes;
|
|
119
|
-
}
|
|
120
|
-
function getAncestorsByKind(node, kind) {
|
|
121
|
-
return getAncestorsBy(node, (node2) => node2.kind === kind);
|
|
122
|
-
}
|
|
123
|
-
function getAncestorByKind(node, kinds) {
|
|
124
|
-
let currentNode = node;
|
|
125
|
-
while (currentNode) {
|
|
126
|
-
if (kinds.includes(currentNode.kind)) {
|
|
127
|
-
return currentNode;
|
|
128
|
-
}
|
|
129
|
-
currentNode = currentNode.parent;
|
|
130
|
-
}
|
|
131
|
-
return void 0;
|
|
132
|
-
}
|
|
133
|
-
function getAllExpressions(node) {
|
|
134
|
-
const expressions = [];
|
|
135
|
-
function visit(currentNode) {
|
|
136
|
-
if (!currentNode)
|
|
137
|
-
return;
|
|
138
|
-
if (ts.isExpression(currentNode)) {
|
|
139
|
-
expressions.push(currentNode);
|
|
140
|
-
}
|
|
141
|
-
ts.forEachChild(currentNode, visit);
|
|
142
|
-
}
|
|
143
|
-
visit(node);
|
|
144
|
-
return expressions;
|
|
145
|
-
}
|
|
146
|
-
function getDescendantsBy(node, predicate) {
|
|
147
|
-
let foundElements = [];
|
|
148
|
-
let queue = [node];
|
|
149
|
-
while (queue.length > 0) {
|
|
150
|
-
const currentNode = queue.shift();
|
|
151
|
-
const children = Array.from(
|
|
152
|
-
currentNode?.getChildren(node.getSourceFile()) || []
|
|
153
|
-
);
|
|
154
|
-
foundElements = [
|
|
155
|
-
...foundElements,
|
|
156
|
-
...children.filter((node2) => predicate(node2))
|
|
157
|
-
];
|
|
158
|
-
queue = [...queue, ...children];
|
|
159
|
-
}
|
|
160
|
-
return foundElements;
|
|
161
|
-
}
|
|
162
|
-
function getDescendantsByKind(node, kind) {
|
|
163
|
-
return getDescendantsBy(node, (node2) => node2.kind === kind);
|
|
164
|
-
}
|
|
165
|
-
function getDescendantsByKinds(node, kinds) {
|
|
166
|
-
return getDescendantsBy(node, (node2) => kinds.includes(node2.kind));
|
|
167
|
-
}
|
|
168
|
-
function getDescendantByName(node, name) {
|
|
169
|
-
return getDescendantsBy(
|
|
170
|
-
node,
|
|
171
|
-
(node2) => (0, import_string.getNameByIdentifier)(node2) === name
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
function findFirstChildByKinds(node, kinds) {
|
|
175
|
-
let element;
|
|
176
|
-
forEachChild(node, (child) => {
|
|
177
|
-
if (!kinds.includes(child.kind) || !!element) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
element = child;
|
|
181
|
-
});
|
|
182
|
-
return element;
|
|
183
|
-
}
|
|
184
|
-
function findChildrenByKinds(node, kinds) {
|
|
185
|
-
const elements = [];
|
|
186
|
-
forEachChild(node, (child) => {
|
|
187
|
-
if (!kinds.includes(child.kind)) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
elements.push(child);
|
|
191
|
-
});
|
|
192
|
-
return elements;
|
|
193
|
-
}
|
|
194
|
-
function findChildrenByKind(node, kind) {
|
|
195
|
-
return findChildrenByKinds(node, [kind]);
|
|
196
|
-
}
|
|
197
|
-
function findChildrenByName(sourceFile, node, name) {
|
|
198
|
-
const elements = [];
|
|
199
|
-
forEachChild(node, (child) => {
|
|
200
|
-
const [nameNode] = findChildrenByKind(child, SyntaxKind.Identifier);
|
|
201
|
-
if (nameNode?.getText(sourceFile) !== name) {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
elements.push(child);
|
|
205
|
-
});
|
|
206
|
-
return elements;
|
|
207
|
-
}
|
|
208
|
-
function findChildByName(sourceFile, node, name) {
|
|
209
|
-
let element;
|
|
210
|
-
forEachChild(node, (child) => {
|
|
211
|
-
const [nameNode] = findChildrenByKind(child, SyntaxKind.Identifier);
|
|
212
|
-
if (nameNode?.getText(sourceFile) !== name) {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
element = child;
|
|
216
|
-
});
|
|
217
|
-
return element;
|
|
218
|
-
}
|
|
219
|
-
function findChildByIndex(node, index) {
|
|
220
|
-
let element;
|
|
221
|
-
let i = 0;
|
|
222
|
-
forEachChild(node, (child) => {
|
|
223
|
-
if (i !== index) {
|
|
224
|
-
i++;
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
element = child;
|
|
228
|
-
});
|
|
229
|
-
return element;
|
|
230
|
-
}
|
|
231
|
-
function consoleAllChildren(sourceFile, node) {
|
|
232
|
-
forEachChild(node, (child) => {
|
|
233
|
-
console.log(child.kind, child.getText(sourceFile));
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
function parseArrayLiteralExpression(sourceFile, node) {
|
|
237
|
-
return findChildrenByKind(node, SyntaxKind.ObjectLiteralExpression).map(
|
|
238
|
-
(obj) => {
|
|
239
|
-
return parseObjectLiteralExpression(sourceFile, obj);
|
|
240
|
-
}
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
function parseObjectLiteralExpression(sourceFile, node) {
|
|
244
|
-
return findChildrenByKind(node, SyntaxKind.PropertyAssignment).reduce(
|
|
245
|
-
(state, currentNode) => {
|
|
246
|
-
const [property, _, value] = Array.from(
|
|
247
|
-
currentNode?.getChildren(sourceFile) || []
|
|
248
|
-
);
|
|
249
|
-
if (value.kind === SyntaxKind.ObjectLiteralExpression) {
|
|
250
|
-
const obj = parseObjectLiteralExpression(sourceFile, value);
|
|
251
|
-
return {
|
|
252
|
-
...state,
|
|
253
|
-
...Object.keys(obj).reduce((s, k) => {
|
|
254
|
-
return {
|
|
255
|
-
...s,
|
|
256
|
-
[property.getText(sourceFile) + "." + k]: escapeValue(obj[k])
|
|
257
|
-
};
|
|
258
|
-
}, {})
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
return {
|
|
262
|
-
...state,
|
|
263
|
-
[property.getText(sourceFile)]: escapeValue(value.getText(sourceFile))
|
|
264
|
-
};
|
|
265
|
-
},
|
|
266
|
-
{}
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
const isComment = (content) => content.match(/^\s*\/\/.*/) !== null;
|
|
270
|
-
const extractCommentContent = (content) => content.replace(/^\s*\/\/\s*/, "");
|
|
271
|
-
const getComments = (nodeContent) => {
|
|
272
|
-
const blockLines = nodeContent.split("\r\n");
|
|
273
|
-
const comments = blockLines.filter(isComment).map(extractCommentContent);
|
|
274
|
-
return comments;
|
|
275
|
-
};
|
|
276
|
-
function findTypeDeclarationByName(sourceFile, typeName) {
|
|
277
|
-
let result;
|
|
278
|
-
function visit(node) {
|
|
279
|
-
if (ts.isInterfaceDeclaration(node) || ts.isClassDeclaration(node) || ts.isTypeAliasDeclaration(node)) {
|
|
280
|
-
const name = node.name?.getText(sourceFile);
|
|
281
|
-
if (name === typeName) {
|
|
282
|
-
result = node;
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
ts.forEachChild(node, visit);
|
|
287
|
-
}
|
|
288
|
-
visit(sourceFile);
|
|
289
|
-
return result;
|
|
290
|
-
}
|
|
291
|
-
const getSolutionSourceFiles = (program) => {
|
|
292
|
-
const allSourceFiles = program.getSourceFiles();
|
|
293
|
-
const sourceFiles = allSourceFiles.filter((sourceFile) => {
|
|
294
|
-
const fileName = sourceFile.fileName;
|
|
295
|
-
if (fileName.includes("node_modules")) {
|
|
296
|
-
return false;
|
|
297
|
-
}
|
|
298
|
-
if (fileName.endsWith(".d.ts")) {
|
|
299
|
-
return false;
|
|
300
|
-
}
|
|
301
|
-
return true;
|
|
302
|
-
});
|
|
303
|
-
return sourceFiles;
|
|
304
|
-
};
|
|
305
|
-
function readSourceFiles(tsConfigPath) {
|
|
306
|
-
const configFile = ts.readConfigFile(tsConfigPath, ts.sys.readFile);
|
|
307
|
-
if (configFile.error) {
|
|
308
|
-
throw new Error("Error reading tsconfig at " + tsConfigPath);
|
|
309
|
-
}
|
|
310
|
-
const parsedConfig = ts.parseJsonConfigFileContent(
|
|
311
|
-
configFile.config,
|
|
312
|
-
ts.sys,
|
|
313
|
-
path.dirname(tsConfigPath)
|
|
314
|
-
);
|
|
315
|
-
const program = ts.createProgram(
|
|
316
|
-
parsedConfig.fileNames,
|
|
317
|
-
parsedConfig.options
|
|
318
|
-
);
|
|
319
|
-
return { sourceFiles: getSolutionSourceFiles(program), program };
|
|
320
|
-
}
|
|
321
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
322
|
-
0 && (module.exports = {
|
|
323
|
-
consoleAllChildren,
|
|
324
|
-
escapeValue,
|
|
325
|
-
findChildByIndex,
|
|
326
|
-
findChildByName,
|
|
327
|
-
findChildrenByKind,
|
|
328
|
-
findChildrenByKinds,
|
|
329
|
-
findChildrenByName,
|
|
330
|
-
findFirstChildByKind,
|
|
331
|
-
findFirstChildByKinds,
|
|
332
|
-
findTypeDeclarationByName,
|
|
333
|
-
getAllExpressions,
|
|
334
|
-
getAncestorByKind,
|
|
335
|
-
getAncestorsBy,
|
|
336
|
-
getAncestorsByKind,
|
|
337
|
-
getComments,
|
|
338
|
-
getDescendantByName,
|
|
339
|
-
getDescendantsBy,
|
|
340
|
-
getDescendantsByKind,
|
|
341
|
-
getDescendantsByKinds,
|
|
342
|
-
getSolutionSourceFiles,
|
|
343
|
-
parseArrayLiteralExpression,
|
|
344
|
-
parseObjectLiteralExpression,
|
|
345
|
-
peelCallTarget,
|
|
346
|
-
readSourceFiles
|
|
347
|
-
});
|
package/main.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const Module = require("module");
|
|
2
|
-
const path = require("path");
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const originalResolveFilename = Module._resolveFilename;
|
|
5
|
-
const distPath = __dirname;
|
|
6
|
-
const manifest = [{ "module": "@features/practice-solutions/api", "exactMatch": "libs/features/practice-solutions/api/src/index.js", "pattern": "libs/features/practice-solutions/api/src/index.ts" }, { "module": "@core/code-snapshot/api", "exactMatch": "libs/core/code-snapshot/api/src/index.js", "pattern": "libs/core/code-snapshot/api/src/index.ts" }, { "module": "@platform/challenge/solution", "exactMatch": "libs/platform/challenge/solution/src/index.js", "pattern": "libs/platform/challenge/solution/src/index.ts" }, { "module": "@core/story-points/api", "exactMatch": "libs/core/story-points/api/src/index.js", "pattern": "libs/core/story-points/api/src/index.ts" }, { "module": "@core/story-points/platform", "exactMatch": "libs/core/story-points/platform/src/index.js", "pattern": "libs/core/story-points/platform/src/index.ts" }, { "module": "@shared/http-utils/api", "exactMatch": "libs/shared/http-utils/api/src/index.js", "pattern": "libs/shared/http-utils/api/src/index.ts" }, { "module": "@academy/features/articles", "exactMatch": "libs/features/articles/academy/src/index.js", "pattern": "libs/features/articles/academy/src/index.ts" }, { "module": "@academy/features/code-snapshot-review", "exactMatch": "libs/features/code-snapshot-review/academy/src/index.js", "pattern": "libs/features/code-snapshot-review/academy/src/index.ts" }, { "module": "@academy/features/code-solutions", "exactMatch": "libs/features/code-solutions/academy/src/index.js", "pattern": "libs/features/code-solutions/academy/src/index.ts" }, { "module": "@academy/features/content", "exactMatch": "libs/features/content/academy/src/index.js", "pattern": "libs/features/content/academy/src/index.ts" }, { "module": "@academy/features/ide", "exactMatch": "libs/features/ide/academy/src/index.js", "pattern": "libs/features/ide/academy/src/index.ts" }, { "module": "@academy/features/modules", "exactMatch": "libs/features/modules/academy/src/index.js", "pattern": "libs/features/modules/academy/src/index.ts" }, { "module": "@academy/features/patterns", "exactMatch": "libs/features/patterns/academy/src/index.js", "pattern": "libs/features/patterns/academy/src/index.ts" }, { "module": "@academy/features/practices", "exactMatch": "libs/features/practices/academy/src/index.js", "pattern": "libs/features/practices/academy/src/index.ts" }, { "module": "@academy/features/projects", "exactMatch": "libs/features/projects/academy/src/index.js", "pattern": "libs/features/projects/academy/src/index.ts" }, { "module": "@academy/features/sequences", "exactMatch": "libs/features/sequences/academy/src/index.js", "pattern": "libs/features/sequences/academy/src/index.ts" }, { "module": "@core/app-events/api", "exactMatch": "libs/core/app-events/api/src/index.js", "pattern": "libs/core/app-events/api/src/index.ts" }, { "module": "@platform/report/build", "exactMatch": "libs/platform/report/build/src/index.js", "pattern": "libs/platform/report/build/src/index.ts" }, { "module": "@platform/report/code", "exactMatch": "libs/platform/report/code/src/index.js", "pattern": "libs/platform/report/code/src/index.ts" }, { "module": "@platform/report/feature", "exactMatch": "libs/platform/report/feature/src/index.js", "pattern": "libs/platform/report/feature/src/index.ts" }, { "module": "@platform/report/lint", "exactMatch": "libs/platform/report/lint/src/index.js", "pattern": "libs/platform/report/lint/src/index.ts" }, { "module": "@platform/report/ui", "exactMatch": "libs/platform/report/ui/src/index.js", "pattern": "libs/platform/report/ui/src/index.ts" }, { "module": "@platform/review/ui", "exactMatch": "libs/platform/review/ui/src/index.js", "pattern": "libs/platform/review/ui/src/index.ts" }, { "module": "@platform/shared/layouts", "exactMatch": "libs/platform/shared/layouts/src/index.js", "pattern": "libs/platform/shared/layouts/src/index.ts" }, { "module": "@platform/shared/modals", "exactMatch": "libs/platform/shared/modals/src/index.js", "pattern": "libs/platform/shared/modals/src/index.ts" }, { "module": "@platform/shared/polling", "exactMatch": "libs/platform/shared/polling/src/index.js", "pattern": "libs/platform/shared/polling/src/index.ts" }, { "module": "@platform/shared/progress", "exactMatch": "libs/platform/shared/progress/src/index.js", "pattern": "libs/platform/shared/progress/src/index.ts" }, { "module": "@platform/shared/tables", "exactMatch": "libs/platform/shared/tables/src/index.js", "pattern": "libs/platform/shared/tables/src/index.ts" }, { "module": "@platform/shared/text", "exactMatch": "libs/platform/shared/text/src/index.js", "pattern": "libs/platform/shared/text/src/index.ts" }, { "module": "@platform/shared/utils", "exactMatch": "libs/platform/shared/utils/index.js", "pattern": "libs/platform/shared/utils/index.ts" }, { "module": "@shared/features/benchmark", "exactMatch": "libs/features/benchmark/shared/src/index.js", "pattern": "libs/features/benchmark/shared/src/index.ts" }, { "module": "@shared/features/code-snapshot-review", "exactMatch": "libs/features/code-snapshot-review/shared/src/index.js", "pattern": "libs/features/code-snapshot-review/shared/src/index.ts" }, { "module": "@shared/features/code-solutions", "exactMatch": "libs/features/code-solutions/shared/src/index.js", "pattern": "libs/features/code-solutions/shared/src/index.ts" }, { "module": "@shared/features/content", "exactMatch": "libs/features/content/shared/src/index.js", "pattern": "libs/features/content/shared/src/index.ts" }, { "module": "@shared/features/llm", "exactMatch": "libs/features/llm/shared/src/index.js", "pattern": "libs/features/llm/shared/src/index.ts" }, { "module": "@shared/features/modules", "exactMatch": "libs/features/modules/shared/src/index.js", "pattern": "libs/features/modules/shared/src/index.ts" }, { "module": "@shared/features/patterns", "exactMatch": "libs/features/patterns/shared/src/index.js", "pattern": "libs/features/patterns/shared/src/index.ts" }, { "module": "@shared/features/projects", "exactMatch": "libs/features/projects/shared/src/index.js", "pattern": "libs/features/projects/shared/src/index.ts" }, { "module": "@shared/features/sequences", "exactMatch": "libs/features/sequences/shared/src/index.js", "pattern": "libs/features/sequences/shared/src/index.ts" }, { "module": "@shared/firebase/api", "exactMatch": "libs/shared/firebase/api/src/index.js", "pattern": "libs/shared/firebase/api/src/index.ts" }, { "module": "@feature-shared/challenges", "exactMatch": "libs/features/challenges/shared/src/index.js", "pattern": "libs/features/challenges/shared/src/index.ts" }, { "module": "@platform/core/code-snapshot", "exactMatch": "libs/core/code-snapshot/platform/src/index.js", "pattern": "libs/core/code-snapshot/platform/src/index.ts" }, { "module": "@platform/core/feature-flags", "exactMatch": "libs/platform/core/feature-flags/src/index.js", "pattern": "libs/platform/core/feature-flags/src/index.ts" }, { "module": "@academy/core/feature-flags", "exactMatch": "libs/academy/core/feature-flags/src/index.js", "pattern": "libs/academy/core/feature-flags/src/index.ts" }, { "module": "@api/features/articles", "exactMatch": "libs/features/articles/api/src/index.js", "pattern": "libs/features/articles/api/src/index.ts" }, { "module": "@api/features/challenge-solutions", "exactMatch": "libs/features/challenge-solutions/api/src/index.js", "pattern": "libs/features/challenge-solutions/api/src/index.ts" }, { "module": "@api/features/challenges", "exactMatch": "libs/features/challenges/api/src/index.js", "pattern": "libs/features/challenges/api/src/index.ts" }, { "module": "@api/features/code-snapshot-review", "exactMatch": "libs/features/code-snapshot-review/api/src/index.js", "pattern": "libs/features/code-snapshot-review/api/src/index.ts" }, { "module": "@api/features/code-solutions", "exactMatch": "libs/features/code-solutions/api/src/index.js", "pattern": "libs/features/code-solutions/api/src/index.ts" }, { "module": "@api/features/content", "exactMatch": "libs/features/content/api/src/index.js", "pattern": "libs/features/content/api/src/index.ts" }, { "module": "@api/features/lessons", "exactMatch": "libs/features/lessons/api/src/index.js", "pattern": "libs/features/lessons/api/src/index.ts" }, { "module": "@api/features/llm", "exactMatch": "libs/features/llm/api/src/index.js", "pattern": "libs/features/llm/api/src/index.ts" }, { "module": "@api/features/modules", "exactMatch": "libs/features/modules/api/src/index.js", "pattern": "libs/features/modules/api/src/index.ts" }, { "module": "@api/features/patterns", "exactMatch": "libs/features/patterns/api/src/index.js", "pattern": "libs/features/patterns/api/src/index.ts" }, { "module": "@api/features/pipelines", "exactMatch": "libs/features/pipelines/api/src/index.js", "pattern": "libs/features/pipelines/api/src/index.ts" }, { "module": "@api/features/practices", "exactMatch": "libs/features/practices/api/src/index.js", "pattern": "libs/features/practices/api/src/index.ts" }, { "module": "@api/features/projects", "exactMatch": "libs/features/projects/api/src/index.js", "pattern": "libs/features/projects/api/src/index.ts" }, { "module": "@api/features/sequences", "exactMatch": "libs/features/sequences/api/src/index.js", "pattern": "libs/features/sequences/api/src/index.ts" }, { "module": "@api/features/sprints", "exactMatch": "libs/features/sprints/api/src/index.js", "pattern": "libs/features/sprints/api/src/index.ts" }, { "module": "@api/features/users", "exactMatch": "libs/features/users/api/src/index.js", "pattern": "libs/features/users/api/src/index.ts" }, { "module": "@cli/features/articles", "exactMatch": "libs/features/articles/cli/src/index.js", "pattern": "libs/features/articles/cli/src/index.ts" }, { "module": "@cli/features/challenges", "exactMatch": "libs/features/challenges/cli/src/index.js", "pattern": "libs/features/challenges/cli/src/index.ts" }, { "module": "@cli/features/code-snapshot-review", "exactMatch": "libs/features/code-snapshot-review/cli/src/index.js", "pattern": "libs/features/code-snapshot-review/cli/src/index.ts" }, { "module": "@cli/features/content", "exactMatch": "libs/features/content/cli/src/index.js", "pattern": "libs/features/content/cli/src/index.ts" }, { "module": "@cli/features/patterns", "exactMatch": "libs/features/patterns/cli/src/index.js", "pattern": "libs/features/patterns/cli/src/index.ts" }, { "module": "@cli/features/practices", "exactMatch": "libs/features/practices/cli/src/index.js", "pattern": "libs/features/practices/cli/src/index.ts" }, { "module": "@cli/features/projects", "exactMatch": "libs/features/projects/cli/src/index.js", "pattern": "libs/features/projects/cli/src/index.ts" }, { "module": "@cli/features/sequences", "exactMatch": "libs/features/sequences/cli/src/index.js", "pattern": "libs/features/sequences/cli/src/index.ts" }, { "module": "@api/core/circle-ci", "exactMatch": "libs/api/core/circle-ci/src/index.js", "pattern": "libs/api/core/circle-ci/src/index.ts" }, { "module": "@api/core/http", "exactMatch": "libs/api/core/http/src/index.js", "pattern": "libs/api/core/http/src/index.ts" }, { "module": "@api/core/payments", "exactMatch": "libs/core/payments/api/src/index.js", "pattern": "libs/core/payments/api/src/index.ts" }, { "module": "@api/core/rating", "exactMatch": "libs/core/rating/api/src/index.js", "pattern": "libs/core/rating/api/src/index.ts" }, { "module": "@api/core/subscriptions", "exactMatch": "libs/core/subscriptions/api/src/index.js", "pattern": "libs/core/subscriptions/api/src/index.ts" }, { "module": "@api/core/utils", "exactMatch": "libs/api/core/utils/src/index.js", "pattern": "libs/api/core/utils/src/index.ts" }, { "module": "@lowgular/code-locator", "exactMatch": "libs/lowgular/code-locator/src/index.js", "pattern": "libs/lowgular/code-locator/src/index.ts" }, { "module": "@lowgular/codegular", "exactMatch": "libs/lowgular/codegular/src/index.js", "pattern": "libs/lowgular/codegular/src/index.ts" }, { "module": "@lowgular/marked-bootstrap", "exactMatch": "libs/lowgular/marked-bootstrap/src/index.js", "pattern": "libs/lowgular/marked-bootstrap/src/index.ts" }, { "module": "@platform/challenges", "exactMatch": "libs/platform/challenges/src/index.js", "pattern": "libs/platform/challenges/src/index.ts" }, { "module": "@platform/code-editor", "exactMatch": "libs/code-editor/src/index.js", "pattern": "libs/code-editor/src/index.ts" }, { "module": "@platform/featured-reports", "exactMatch": "libs/platform/featured-reports/src/index.js", "pattern": "libs/platform/featured-reports/src/index.ts" }, { "module": "@platform/featured-solutions", "exactMatch": "libs/platform/featured-solutions/src/index.js", "pattern": "libs/platform/featured-solutions/src/index.ts" }, { "module": "@platform/legacy-review", "exactMatch": "libs/platform/legacy-review/src/index.js", "pattern": "libs/platform/legacy-review/src/index.ts" }, { "module": "@platform/lessons", "exactMatch": "libs/platform/lessons/src/index.js", "pattern": "libs/platform/lessons/src/index.ts" }, { "module": "@platform/module", "exactMatch": "libs/platform/module/src/index.js", "pattern": "libs/platform/module/src/index.ts" }, { "module": "@platform/page-title", "exactMatch": "libs/platform/page-title/src/index.js", "pattern": "libs/platform/page-title/src/index.ts" }, { "module": "@platform/payment", "exactMatch": "libs/platform/payment/src/index.js", "pattern": "libs/platform/payment/src/index.ts" }, { "module": "@platform/pipelines", "exactMatch": "libs/platform/pipelines/src/index.js", "pattern": "libs/platform/pipelines/src/index.ts" }, { "module": "@platform/practice", "exactMatch": "libs/platform/practice/src/index.js", "pattern": "libs/platform/practice/src/index.ts" }, { "module": "@platform/practice-solutions", "exactMatch": "libs/platform/practice-solutions/src/index.js", "pattern": "libs/platform/practice-solutions/src/index.ts" }, { "module": "@platform/rating", "exactMatch": "libs/platform/rating/src/index.js", "pattern": "libs/platform/rating/src/index.ts" }, { "module": "@platform/sprints", "exactMatch": "libs/platform/sprints/src/index.js", "pattern": "libs/platform/sprints/src/index.ts" }, { "module": "@platform/subscriptions", "exactMatch": "libs/platform/subscriptions/src/index.js", "pattern": "libs/platform/subscriptions/src/index.ts" }, { "module": "@platform/users", "exactMatch": "libs/platform/users/src/index.js", "pattern": "libs/platform/users/src/index.ts" }, { "module": "@shared/alerts", "exactMatch": "libs/shared/alerts/src/index.js", "pattern": "libs/shared/alerts/src/index.ts" }, { "module": "@shared/annotation", "exactMatch": "libs/shared/annotation/src/index.js", "pattern": "libs/shared/annotation/src/index.ts" }, { "module": "@shared/articles", "exactMatch": "libs/features/articles/shared/src/index.js", "pattern": "libs/features/articles/shared/src/index.ts" }, { "module": "@shared/canvas", "exactMatch": "libs/shared/canvas/src/index.js", "pattern": "libs/shared/canvas/src/index.ts" }, { "module": "@shared/code-editor", "exactMatch": "libs/platform/shared/code-editor/src/index.js", "pattern": "libs/platform/shared/code-editor/src/index.ts" }, { "module": "@shared/components", "exactMatch": "libs/shared/components/src/index.js", "pattern": "libs/shared/components/src/index.ts" }, { "module": "@shared/design-system", "exactMatch": "libs/shared/design-system/src/index.js", "pattern": "libs/shared/design-system/src/index.ts" }, { "module": "@shared/directives", "exactMatch": "libs/shared/directives/src/index.js", "pattern": "libs/shared/directives/src/index.ts" }, { "module": "@shared/errors", "exactMatch": "libs/shared/errors/src/index.js", "pattern": "libs/shared/errors/src/index.ts" }, { "module": "@shared/forms", "exactMatch": "libs/shared/forms/src/index.js", "pattern": "libs/shared/forms/src/index.ts" }, { "module": "@shared/full-screen", "exactMatch": "libs/shared/full-screen/src/index.js", "pattern": "libs/shared/full-screen/src/index.ts" }, { "module": "@shared/ghosts", "exactMatch": "libs/shared/ghosts/src/index.js", "pattern": "libs/shared/ghosts/src/index.ts" }, { "module": "@shared/http", "exactMatch": "libs/shared/http/src/index.js", "pattern": "libs/shared/http/src/index.ts" }, { "module": "@shared/modals", "exactMatch": "libs/shared/modals/src/index.js", "pattern": "libs/shared/modals/src/index.ts" }, { "module": "@shared/pagination", "exactMatch": "libs/shared/pagination/src/index.js", "pattern": "libs/shared/pagination/src/index.ts" }, { "module": "@shared/pipes", "exactMatch": "libs/shared/pipes/src/index.js", "pattern": "libs/shared/pipes/src/index.ts" }, { "module": "@shared/states", "exactMatch": "libs/shared/states/src/index.js", "pattern": "libs/shared/states/src/index.ts" }, { "module": "@shared/text-area", "exactMatch": "libs/shared/text-area/src/index.js", "pattern": "libs/shared/text-area/src/index.ts" }, { "module": "@shared/theme", "exactMatch": "libs/shared/theme/src/index.js", "pattern": "libs/shared/theme/src/index.ts" }, { "module": "@shared/utils", "exactMatch": "libs/shared/utils/src/index.js", "pattern": "libs/shared/utils/src/index.ts" }, { "module": "@core/environment", "exactMatch": "libs/core/environment/src/index.js", "pattern": "libs/core/environment/src/index.ts" }, { "module": "@core/users", "exactMatch": "libs/core/users/src/index.js", "pattern": "libs/core/users/src/index.ts" }, { "module": "@core/codegular", "exactMatch": "libs/core/codegular/src/index.js", "pattern": "libs/core/codegular/src/index.ts" }, { "module": "@cli/code-graph", "exactMatch": "libs/cli/code-graph/src/index.js", "pattern": "libs/cli/code-graph/src/index.ts" }, { "module": "@cli/core", "exactMatch": "libs/cli/core/src/index.js", "pattern": "libs/cli/core/src/index.ts" }, { "module": "@cli/cypher", "exactMatch": "libs/cli/cypher/src/index.js", "pattern": "libs/cli/cypher/src/index.ts" }, { "module": "@cli/shared", "exactMatch": "libs/cli/shared/src/index.js", "pattern": "libs/cli/shared/src/index.ts" }, { "module": "@cli/typescript", "exactMatch": "libs/cli/typescript/src/index.js", "pattern": "libs/cli/typescript/src/index.ts" }, { "module": "@achievements", "exactMatch": "libs/achievements/src/index.js", "pattern": "libs/achievements/src/index.ts" }, { "module": "@auth", "exactMatch": "libs/auth/src/index.js", "pattern": "libs/auth/src/index.ts" }, { "module": "@breadcrumbs", "exactMatch": "libs/breadcrumbs/src/index.js", "pattern": "libs/breadcrumbs/src/index.ts" }, { "module": "@common", "exactMatch": "libs/common/src/index.js", "pattern": "libs/common/src/index.ts" }, { "module": "theme", "exactMatch": "libs/shared/theme/src/index.js", "pattern": "libs/shared/theme/src/index.ts" }];
|
|
7
|
-
Module._resolveFilename = function(request, parent) {
|
|
8
|
-
let found;
|
|
9
|
-
for (const entry of manifest) {
|
|
10
|
-
if (request === entry.module && entry.exactMatch) {
|
|
11
|
-
const entry2 = manifest.find((x) => request === x.module || request.startsWith(x.module + "/"));
|
|
12
|
-
const candidate = path.join(distPath, entry2.exactMatch);
|
|
13
|
-
if (isFile(candidate)) {
|
|
14
|
-
found = candidate;
|
|
15
|
-
break;
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
const re = new RegExp(entry.module.replace(/\*$/, "(?<rest>.*)"));
|
|
19
|
-
const match = request.match(re);
|
|
20
|
-
if (match?.groups) {
|
|
21
|
-
const candidate = path.join(distPath, entry.pattern.replace("*", ""), match.groups.rest);
|
|
22
|
-
if (isFile(candidate)) {
|
|
23
|
-
found = candidate;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
if (found) {
|
|
29
|
-
const modifiedArguments = [found, ...[].slice.call(arguments, 1)];
|
|
30
|
-
return originalResolveFilename.apply(this, modifiedArguments);
|
|
31
|
-
} else {
|
|
32
|
-
return originalResolveFilename.apply(this, arguments);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
function isFile(s) {
|
|
36
|
-
try {
|
|
37
|
-
require.resolve(s);
|
|
38
|
-
return true;
|
|
39
|
-
} catch (_e) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
module.exports = require("./apps/code-graph/src/main.js");
|