@codependix/cli 0.0.3
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/LICENSE +21 -0
- package/README.md +894 -0
- package/dist/main.module-B07sXqnE.js +718 -0
- package/dist/src/index.d.ts +511 -0
- package/dist/src/index.js +2 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/main.js +15 -0
- package/package.json +77 -0
|
@@ -0,0 +1,718 @@
|
|
|
1
|
+
import { ConsoleLogger as e, Global as t, Injectable as n, Module as r, Scope as i } from "@nestjs/common";
|
|
2
|
+
import { ConfigModule as a } from "@nestjs/config";
|
|
3
|
+
import { DiscoveryModule as o } from "@nestjs/core";
|
|
4
|
+
import { existsSync as s, mkdirSync as c } from "node:fs";
|
|
5
|
+
import l from "node:path";
|
|
6
|
+
import u from "pino";
|
|
7
|
+
import { z as d } from "zod";
|
|
8
|
+
import { BoundaryCheckModule as f, BoundaryCheckService as p, RunContextModule as m, RunContextService as h } from "@codependix/boundaries";
|
|
9
|
+
import { CHECK_NAMES as g, ConfigurationModule as _, ConfigurationService as v } from "@codependix/configuration";
|
|
10
|
+
import { CombinedOutputModule as y, CombinedOutputService as b, FORMAT_MARKDOWN as x, FORMAT_NAMES as S, GraphRunModule as C, GraphRunService as w, PATH_FORMAT_NAMES as T, PathQueryModule as E, PathQueryService as D, ReportingModule as O, ReportingService as k } from "@codependix/output";
|
|
11
|
+
import { Command as A, CommandRunner as j, Option as M } from "nest-commander";
|
|
12
|
+
//#region packages/logger/src/modules/logger/logger.constants.ts
|
|
13
|
+
var N = /^(\p{Extended_Pictographic}️?(?:\p{Extended_Pictographic}️?)*)\s+/u, P = /^([A-Za-z]+)/, F = /* @__PURE__ */ new Set([
|
|
14
|
+
"built",
|
|
15
|
+
"cut",
|
|
16
|
+
"found",
|
|
17
|
+
"got",
|
|
18
|
+
"kept",
|
|
19
|
+
"left",
|
|
20
|
+
"lost",
|
|
21
|
+
"made",
|
|
22
|
+
"put",
|
|
23
|
+
"ran",
|
|
24
|
+
"read",
|
|
25
|
+
"rebuilt",
|
|
26
|
+
"sent",
|
|
27
|
+
"set",
|
|
28
|
+
"split",
|
|
29
|
+
"took",
|
|
30
|
+
"wrote"
|
|
31
|
+
]), I = /* @__PURE__ */ new Set([
|
|
32
|
+
"CommandFactory",
|
|
33
|
+
"ExceptionHandler",
|
|
34
|
+
"GraphQLModule",
|
|
35
|
+
"InstanceLoader",
|
|
36
|
+
"NestApplication",
|
|
37
|
+
"NestFactory",
|
|
38
|
+
"RouterExplorer",
|
|
39
|
+
"RoutesResolver",
|
|
40
|
+
"TypeOrmModule"
|
|
41
|
+
]);
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
|
|
44
|
+
function L(e, t) {
|
|
45
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
49
|
+
function R(e, t, n, r) {
|
|
50
|
+
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
51
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
52
|
+
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
53
|
+
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region packages/logger/src/modules/logger/logger.service.ts
|
|
57
|
+
var z, B = class extends e {
|
|
58
|
+
static {
|
|
59
|
+
z = this;
|
|
60
|
+
}
|
|
61
|
+
constructor() {
|
|
62
|
+
super();
|
|
63
|
+
}
|
|
64
|
+
static isProduction = process.env.NODE_ENV === "production";
|
|
65
|
+
static rootLogger;
|
|
66
|
+
static writesToStandardError = !1;
|
|
67
|
+
child = z.root;
|
|
68
|
+
static createRootLogger() {
|
|
69
|
+
let e = process.env.LOG_LEVEL ?? "info";
|
|
70
|
+
return z.isProduction ? z.writesToStandardError ? u({ level: e }, u.destination(2)) : u({ level: e }) : u({
|
|
71
|
+
level: e,
|
|
72
|
+
transport: {
|
|
73
|
+
options: {
|
|
74
|
+
colorize: !0,
|
|
75
|
+
destination: z.writesToStandardError ? 2 : 1,
|
|
76
|
+
ignore: "pid,hostname,emoji",
|
|
77
|
+
messageFormat: "{emoji} {msg}",
|
|
78
|
+
singleLine: !0
|
|
79
|
+
},
|
|
80
|
+
target: "pino-pretty"
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
static logToStandardError() {
|
|
85
|
+
if (z.rootLogger !== void 0) {
|
|
86
|
+
process.emitWarning("LoggerService.logToStandardError() was called after the first log line, so log lines still go to standard output and anything piping that stream will read them as data. Call it as the first statement of the application's bootstrap.");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
z.writesToStandardError = !0;
|
|
90
|
+
}
|
|
91
|
+
assertConventionalMessage(e) {
|
|
92
|
+
if (z.isProduction || this.shouldSkipConventionalMessageValidation(e.context)) return;
|
|
93
|
+
let t = this.getConventionalMessageViolation(e.parsed);
|
|
94
|
+
if (t !== void 0) throw Error(t);
|
|
95
|
+
}
|
|
96
|
+
buildBindings(e) {
|
|
97
|
+
return this.assertConventionalMessage({
|
|
98
|
+
context: e.context,
|
|
99
|
+
parsed: e.parsed
|
|
100
|
+
}), {
|
|
101
|
+
...e.data,
|
|
102
|
+
context: e.context,
|
|
103
|
+
...z.isProduction ? {} : { emoji: e.parsed.emoji }
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
getConventionalMessageViolation(e) {
|
|
107
|
+
let t = e.emoji, n = e.text;
|
|
108
|
+
if (t === void 0) return `Log message must start with an emoji naming its subject, then a verb: "${n}"`;
|
|
109
|
+
let r = P.exec(n)?.[1];
|
|
110
|
+
if (r === void 0 || !this.isConventionalVerb(r)) return `Log message must begin with a verb in present progressive or past tense, got "${r ?? ""}": "${t} ${n}"`;
|
|
111
|
+
}
|
|
112
|
+
isConventionalVerb(e) {
|
|
113
|
+
let t = e.toLowerCase();
|
|
114
|
+
return t.endsWith("ing") || t.endsWith("ed") || F.has(t);
|
|
115
|
+
}
|
|
116
|
+
parseMessage(e) {
|
|
117
|
+
let t = String(e), n = N.exec(t), r = n?.[1];
|
|
118
|
+
return r === void 0 ? {
|
|
119
|
+
emoji: void 0,
|
|
120
|
+
text: t
|
|
121
|
+
} : {
|
|
122
|
+
emoji: r,
|
|
123
|
+
text: t.slice(n?.[0].length)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
shouldSkipConventionalMessageValidation(e) {
|
|
127
|
+
return e !== void 0 && I.has(e);
|
|
128
|
+
}
|
|
129
|
+
static get root() {
|
|
130
|
+
return z.rootLogger ??= z.createRootLogger(), z.rootLogger;
|
|
131
|
+
}
|
|
132
|
+
buildErrorLogEntry(e, t) {
|
|
133
|
+
let n = t instanceof Error ? t.stack || t.message : String(t);
|
|
134
|
+
return {
|
|
135
|
+
errorMessage: n,
|
|
136
|
+
logLine: `[${(/* @__PURE__ */ new Date()).toISOString()}] ${e}: ${n}\n`
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
createTimestampedOutputLogFilePath(e) {
|
|
140
|
+
let t = l.join(process.cwd(), "output");
|
|
141
|
+
return s(t) || c(t, { recursive: !0 }), l.join(t, `${e}-${(/* @__PURE__ */ new Date()).toISOString().replaceAll(/[:.]/g, "-")}.log`);
|
|
142
|
+
}
|
|
143
|
+
debug(e, t, n) {
|
|
144
|
+
let r = this.parseMessage(e);
|
|
145
|
+
this.child.debug(this.buildBindings({
|
|
146
|
+
context: t ?? this.context,
|
|
147
|
+
data: n,
|
|
148
|
+
parsed: r
|
|
149
|
+
}), r.text);
|
|
150
|
+
}
|
|
151
|
+
error(e, t, n) {
|
|
152
|
+
let r = this.parseMessage(e), i = typeof n == "object" ? n : void 0, a = typeof n == "string" ? n : this.context;
|
|
153
|
+
this.child.error({
|
|
154
|
+
...this.buildBindings({
|
|
155
|
+
context: a,
|
|
156
|
+
data: i,
|
|
157
|
+
parsed: r
|
|
158
|
+
}),
|
|
159
|
+
stack: t
|
|
160
|
+
}, r.text);
|
|
161
|
+
}
|
|
162
|
+
info(e, t, n) {
|
|
163
|
+
let r = this.parseMessage(e);
|
|
164
|
+
this.child.info(this.buildBindings({
|
|
165
|
+
context: t ?? this.context,
|
|
166
|
+
data: n,
|
|
167
|
+
parsed: r
|
|
168
|
+
}), r.text);
|
|
169
|
+
}
|
|
170
|
+
log(e, t, n) {
|
|
171
|
+
this.info(e, t, n);
|
|
172
|
+
}
|
|
173
|
+
setContext(e) {
|
|
174
|
+
super.setContext(e), this.child = z.root.child({ context: e });
|
|
175
|
+
}
|
|
176
|
+
verbose(e, t, n) {
|
|
177
|
+
let r = this.parseMessage(e);
|
|
178
|
+
this.child.trace(this.buildBindings({
|
|
179
|
+
context: t ?? this.context,
|
|
180
|
+
data: n,
|
|
181
|
+
parsed: r
|
|
182
|
+
}), r.text);
|
|
183
|
+
}
|
|
184
|
+
warn(e, t, n) {
|
|
185
|
+
let r = this.parseMessage(e);
|
|
186
|
+
this.child.warn(this.buildBindings({
|
|
187
|
+
context: t ?? this.context,
|
|
188
|
+
data: n,
|
|
189
|
+
parsed: r
|
|
190
|
+
}), r.text);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
B = z = R([n({ scope: i.TRANSIENT }), L("design:paramtypes", [])], B);
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region packages/logger/src/modules/logger/logger.module.ts
|
|
196
|
+
var V = class {};
|
|
197
|
+
V = R([t(), r({
|
|
198
|
+
controllers: [],
|
|
199
|
+
exports: [B],
|
|
200
|
+
imports: [],
|
|
201
|
+
providers: [B]
|
|
202
|
+
})], V);
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region packages/ic-suite/codependix/codependix-cli/src/constants.ts
|
|
205
|
+
var H = d.object({}), U, W = U = class extends j {
|
|
206
|
+
graphRunService;
|
|
207
|
+
boundaryCheckService;
|
|
208
|
+
combinedOutputService;
|
|
209
|
+
configurationService;
|
|
210
|
+
logger;
|
|
211
|
+
reportingService;
|
|
212
|
+
runContextService;
|
|
213
|
+
constructor(e, t, n, r, i, a, o) {
|
|
214
|
+
super(), this.graphRunService = e, this.boundaryCheckService = t, this.combinedOutputService = n, this.configurationService = r, this.logger = i, this.reportingService = a, this.runContextService = o, this.logger.setContext(U.name);
|
|
215
|
+
}
|
|
216
|
+
runCombinedOutput(e) {
|
|
217
|
+
e.combinedGraphs !== void 0 && this.combinedOutputService.run({
|
|
218
|
+
format: e.format,
|
|
219
|
+
graphs: e.combinedGraphs,
|
|
220
|
+
jsonOutputPath: e.options.jsonOutput,
|
|
221
|
+
markdownOutputPath: e.options.markdownOutput,
|
|
222
|
+
workingDirectory: e.workingDirectory
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
async runExports(e) {
|
|
226
|
+
let t = await this.graphRunService.run(e);
|
|
227
|
+
return this.reportingService.reportEmptySelection(t.outcome.results.length + t.outcome.failures.length), t;
|
|
228
|
+
}
|
|
229
|
+
async runMode(e) {
|
|
230
|
+
let { format: t, mode: n, options: r } = e, i = await this.runContextService.build({
|
|
231
|
+
mode: n.writes ? "write" : "check",
|
|
232
|
+
options: r,
|
|
233
|
+
workingDirectory: l.resolve(r.directory ?? process.cwd())
|
|
234
|
+
}), a = this.configurationService.touchesFiles(n) ? await this.runExports(i) : void 0, o = n.checksBoundaries ? await this.boundaryCheckService.run(i) : void 0;
|
|
235
|
+
if (this.runCombinedOutput({
|
|
236
|
+
combinedGraphs: a?.combinedGraphs,
|
|
237
|
+
format: t,
|
|
238
|
+
options: r,
|
|
239
|
+
workingDirectory: i.workingDirectory
|
|
240
|
+
}), !this.reportingService.reportPassOutcomes({
|
|
241
|
+
boundaryOutcome: o,
|
|
242
|
+
exportRun: a
|
|
243
|
+
})) {
|
|
244
|
+
process.exitCode = 1;
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
this.reportingService.reportSuccess({
|
|
248
|
+
boundaryOutcome: o,
|
|
249
|
+
exportOutcome: a?.outcome
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
parseCheck(e) {
|
|
253
|
+
return e;
|
|
254
|
+
}
|
|
255
|
+
parseConfig(e) {
|
|
256
|
+
return this.configurationService.parseOptionalOption(e);
|
|
257
|
+
}
|
|
258
|
+
parseDirectory(e) {
|
|
259
|
+
return this.configurationService.parsePathOption(e);
|
|
260
|
+
}
|
|
261
|
+
parseExclude(e) {
|
|
262
|
+
return this.configurationService.parseCommaDelimitedOption(e);
|
|
263
|
+
}
|
|
264
|
+
parseFileImports() {
|
|
265
|
+
return !0;
|
|
266
|
+
}
|
|
267
|
+
parseFormat(e) {
|
|
268
|
+
return this.configurationService.parseOptionalOption(e);
|
|
269
|
+
}
|
|
270
|
+
parseInclude(e) {
|
|
271
|
+
return this.configurationService.parseCommaDelimitedOption(e);
|
|
272
|
+
}
|
|
273
|
+
parseJsonOutput(e) {
|
|
274
|
+
return this.configurationService.parseOptionalOption(e);
|
|
275
|
+
}
|
|
276
|
+
parseMarkdownOutput(e) {
|
|
277
|
+
return this.configurationService.parseOptionalOption(e);
|
|
278
|
+
}
|
|
279
|
+
parseNestjsModules() {
|
|
280
|
+
return !0;
|
|
281
|
+
}
|
|
282
|
+
parseNoFileImports() {
|
|
283
|
+
return !1;
|
|
284
|
+
}
|
|
285
|
+
parseNoNestjsModules() {
|
|
286
|
+
return !1;
|
|
287
|
+
}
|
|
288
|
+
parseNoNxProjects() {
|
|
289
|
+
return !1;
|
|
290
|
+
}
|
|
291
|
+
parseNxProjects() {
|
|
292
|
+
return !0;
|
|
293
|
+
}
|
|
294
|
+
parseProjects(e) {
|
|
295
|
+
return this.configurationService.parseOptionalOption(e);
|
|
296
|
+
}
|
|
297
|
+
parseTags(e) {
|
|
298
|
+
return this.configurationService.parseOptionalOption(e);
|
|
299
|
+
}
|
|
300
|
+
parseWrite(e) {
|
|
301
|
+
return this.configurationService.parseFlagOption(e);
|
|
302
|
+
}
|
|
303
|
+
async run(e, t = {}) {
|
|
304
|
+
try {
|
|
305
|
+
let { errors: e, mode: n } = await this.configurationService.selectMode(t), { errors: r, format: i } = this.combinedOutputService.resolveFormat(t.format), a = [...e, ...r];
|
|
306
|
+
if (a.length > 0) {
|
|
307
|
+
this.logger.error("🕸️ Rejected the command line", void 0, { reasons: a }), process.exitCode = 1;
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
await this.runMode({
|
|
311
|
+
format: i,
|
|
312
|
+
mode: n,
|
|
313
|
+
options: t
|
|
314
|
+
});
|
|
315
|
+
} catch (e) {
|
|
316
|
+
this.reportingService.reportFailure(e);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
R([
|
|
321
|
+
M({
|
|
322
|
+
description: `Fail on a comma-separated set drawn from ${g.map((e) => `"${e}"`).join(" and ")}`,
|
|
323
|
+
flags: "--check [check]"
|
|
324
|
+
}),
|
|
325
|
+
L("design:type", Function),
|
|
326
|
+
L("design:paramtypes", [String]),
|
|
327
|
+
L("design:returntype", String)
|
|
328
|
+
], W.prototype, "parseCheck", null), R([
|
|
329
|
+
M({
|
|
330
|
+
description: "Path to the codependix configuration file",
|
|
331
|
+
flags: "--config [config]"
|
|
332
|
+
}),
|
|
333
|
+
L("design:type", Function),
|
|
334
|
+
L("design:paramtypes", [Object]),
|
|
335
|
+
L("design:returntype", Object)
|
|
336
|
+
], W.prototype, "parseConfig", null), R([
|
|
337
|
+
M({
|
|
338
|
+
description: "Directory whose Nx workspace this run reads",
|
|
339
|
+
flags: "-d, --directory [directory]"
|
|
340
|
+
}),
|
|
341
|
+
L("design:type", Function),
|
|
342
|
+
L("design:paramtypes", [Object]),
|
|
343
|
+
L("design:returntype", String)
|
|
344
|
+
], W.prototype, "parseDirectory", null), R([
|
|
345
|
+
M({
|
|
346
|
+
description: "Comma-separated globs overriding the configured exclude. Refused when exclude was never configured",
|
|
347
|
+
flags: "--exclude [exclude]"
|
|
348
|
+
}),
|
|
349
|
+
L("design:type", Function),
|
|
350
|
+
L("design:paramtypes", [Object]),
|
|
351
|
+
L("design:returntype", Array)
|
|
352
|
+
], W.prototype, "parseExclude", null), R([
|
|
353
|
+
M({
|
|
354
|
+
description: "Build, check, and write the fileImports graph type",
|
|
355
|
+
flags: "--file-imports"
|
|
356
|
+
}),
|
|
357
|
+
L("design:type", Function),
|
|
358
|
+
L("design:paramtypes", []),
|
|
359
|
+
L("design:returntype", Boolean)
|
|
360
|
+
], W.prototype, "parseFileImports", null), R([
|
|
361
|
+
M({
|
|
362
|
+
description: `What to print to standard output, one of ${S.join(" and ")} (default: ${x}). A graph type prints only when this run also configured a workspace destination for it, even if its own toggle flag enabled it`,
|
|
363
|
+
flags: "-f, --format [format]"
|
|
364
|
+
}),
|
|
365
|
+
L("design:type", Function),
|
|
366
|
+
L("design:paramtypes", [Object]),
|
|
367
|
+
L("design:returntype", Object)
|
|
368
|
+
], W.prototype, "parseFormat", null), R([
|
|
369
|
+
M({
|
|
370
|
+
description: "Comma-separated globs overriding the configured include. Refused when include was never configured",
|
|
371
|
+
flags: "--include [include]"
|
|
372
|
+
}),
|
|
373
|
+
L("design:type", Function),
|
|
374
|
+
L("design:paramtypes", [Object]),
|
|
375
|
+
L("design:returntype", Array)
|
|
376
|
+
], W.prototype, "parseInclude", null), R([
|
|
377
|
+
M({
|
|
378
|
+
description: "Write every active graph type's data, combined into one JSON file at this path, keyed by graph type name. A type appears only when this run also configured a workspace destination for it",
|
|
379
|
+
flags: "--json-output [jsonOutput]"
|
|
380
|
+
}),
|
|
381
|
+
L("design:type", Function),
|
|
382
|
+
L("design:paramtypes", [Object]),
|
|
383
|
+
L("design:returntype", Object)
|
|
384
|
+
], W.prototype, "parseJsonOutput", null), R([
|
|
385
|
+
M({
|
|
386
|
+
description: "Write every active graph type's rendered diagram, combined into one Markdown file at this path. A type appears only when this run also configured a workspace destination for it",
|
|
387
|
+
flags: "--markdown-output [markdownOutput]"
|
|
388
|
+
}),
|
|
389
|
+
L("design:type", Function),
|
|
390
|
+
L("design:paramtypes", [Object]),
|
|
391
|
+
L("design:returntype", Object)
|
|
392
|
+
], W.prototype, "parseMarkdownOutput", null), R([
|
|
393
|
+
M({
|
|
394
|
+
description: "Build, check, and write the nestjsModules graph type",
|
|
395
|
+
flags: "--nestjs-modules"
|
|
396
|
+
}),
|
|
397
|
+
L("design:type", Function),
|
|
398
|
+
L("design:paramtypes", []),
|
|
399
|
+
L("design:returntype", Boolean)
|
|
400
|
+
], W.prototype, "parseNestjsModules", null), R([
|
|
401
|
+
M({
|
|
402
|
+
description: "Skip the fileImports graph type for this run",
|
|
403
|
+
flags: "--no-file-imports"
|
|
404
|
+
}),
|
|
405
|
+
L("design:type", Function),
|
|
406
|
+
L("design:paramtypes", []),
|
|
407
|
+
L("design:returntype", Boolean)
|
|
408
|
+
], W.prototype, "parseNoFileImports", null), R([
|
|
409
|
+
M({
|
|
410
|
+
description: "Skip the nestjsModules graph type for this run",
|
|
411
|
+
flags: "--no-nestjs-modules"
|
|
412
|
+
}),
|
|
413
|
+
L("design:type", Function),
|
|
414
|
+
L("design:paramtypes", []),
|
|
415
|
+
L("design:returntype", Boolean)
|
|
416
|
+
], W.prototype, "parseNoNestjsModules", null), R([
|
|
417
|
+
M({
|
|
418
|
+
description: "Skip the nxProjects graph type for this run",
|
|
419
|
+
flags: "--no-nx-projects"
|
|
420
|
+
}),
|
|
421
|
+
L("design:type", Function),
|
|
422
|
+
L("design:paramtypes", []),
|
|
423
|
+
L("design:returntype", Boolean)
|
|
424
|
+
], W.prototype, "parseNoNxProjects", null), R([
|
|
425
|
+
M({
|
|
426
|
+
description: "Build, check, and write the nxProjects graph type",
|
|
427
|
+
flags: "--nx-projects"
|
|
428
|
+
}),
|
|
429
|
+
L("design:type", Function),
|
|
430
|
+
L("design:paramtypes", []),
|
|
431
|
+
L("design:returntype", Boolean)
|
|
432
|
+
], W.prototype, "parseNxProjects", null), R([
|
|
433
|
+
M({
|
|
434
|
+
description: "Comma-separated project names or roots to export for, as globs, beyond those include already selects. Also narrows the Workspace Graph and --check boundaries to the named set",
|
|
435
|
+
flags: "--projects [projects]"
|
|
436
|
+
}),
|
|
437
|
+
L("design:type", Function),
|
|
438
|
+
L("design:paramtypes", [Object]),
|
|
439
|
+
L("design:returntype", Object)
|
|
440
|
+
], W.prototype, "parseProjects", null), R([
|
|
441
|
+
M({
|
|
442
|
+
description: "Comma-separated Nx tags to export for, beyond what include already selects. Also narrows the Workspace Graph and --check boundaries to the tagged projects",
|
|
443
|
+
flags: "--tags [tags]"
|
|
444
|
+
}),
|
|
445
|
+
L("design:type", Function),
|
|
446
|
+
L("design:paramtypes", [Object]),
|
|
447
|
+
L("design:returntype", Object)
|
|
448
|
+
], W.prototype, "parseTags", null), R([
|
|
449
|
+
M({
|
|
450
|
+
description: "Write every configured export",
|
|
451
|
+
flags: "--write"
|
|
452
|
+
}),
|
|
453
|
+
L("design:type", Function),
|
|
454
|
+
L("design:paramtypes", [Object]),
|
|
455
|
+
L("design:returntype", Boolean)
|
|
456
|
+
], W.prototype, "parseWrite", null), W = U = R([
|
|
457
|
+
A({
|
|
458
|
+
description: "Map every configured dependency graph and export it",
|
|
459
|
+
name: "map"
|
|
460
|
+
}),
|
|
461
|
+
n(),
|
|
462
|
+
L("design:paramtypes", [
|
|
463
|
+
w === void 0 ? Object : w,
|
|
464
|
+
p === void 0 ? Object : p,
|
|
465
|
+
b === void 0 ? Object : b,
|
|
466
|
+
v === void 0 ? Object : v,
|
|
467
|
+
B === void 0 ? Object : B,
|
|
468
|
+
k === void 0 ? Object : k,
|
|
469
|
+
h === void 0 ? Object : h
|
|
470
|
+
])
|
|
471
|
+
], W);
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region packages/ic-suite/codependix/codependix-cli/src/modules/map/map.module.ts
|
|
474
|
+
var G = class {};
|
|
475
|
+
G = R([r({
|
|
476
|
+
controllers: [],
|
|
477
|
+
exports: [W],
|
|
478
|
+
imports: [
|
|
479
|
+
f,
|
|
480
|
+
y,
|
|
481
|
+
_,
|
|
482
|
+
C,
|
|
483
|
+
O,
|
|
484
|
+
m
|
|
485
|
+
],
|
|
486
|
+
providers: [W]
|
|
487
|
+
})], G);
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region packages/ic-suite/codependix/codependix-cli/src/modules/path/path.constants.ts
|
|
490
|
+
var K = "The path command requires both <from> and <to> arguments, as in \"codependix path <from> <to>\".", q, J = q = class extends j {
|
|
491
|
+
configurationService;
|
|
492
|
+
logger;
|
|
493
|
+
pathQueryService;
|
|
494
|
+
reportingService;
|
|
495
|
+
runContextService;
|
|
496
|
+
constructor(e, t, n, r, i) {
|
|
497
|
+
super(), this.configurationService = e, this.logger = t, this.pathQueryService = n, this.reportingService = r, this.runContextService = i, this.logger.setContext(q.name);
|
|
498
|
+
}
|
|
499
|
+
validateInputs(e, t) {
|
|
500
|
+
let n = e[0], r = e[1];
|
|
501
|
+
if (!n || !r) return this.logger.error("🕸️ Rejected the command line", void 0, { reasons: [K] }), process.exitCode = 1, null;
|
|
502
|
+
let { errors: i, format: a } = this.pathQueryService.resolveFormat(t.format);
|
|
503
|
+
return i.length > 0 ? (this.logger.error("🕸️ Rejected the command line", void 0, { reasons: i }), process.exitCode = 1, null) : {
|
|
504
|
+
format: a,
|
|
505
|
+
from: n,
|
|
506
|
+
to: r
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
parseConfig(e) {
|
|
510
|
+
return this.configurationService.parseOptionalOption(e);
|
|
511
|
+
}
|
|
512
|
+
parseDirectory(e) {
|
|
513
|
+
return this.configurationService.parsePathOption(e);
|
|
514
|
+
}
|
|
515
|
+
parseExclude(e) {
|
|
516
|
+
return this.configurationService.parseCommaDelimitedOption(e);
|
|
517
|
+
}
|
|
518
|
+
parseFileImports() {
|
|
519
|
+
return !0;
|
|
520
|
+
}
|
|
521
|
+
parseFormat(e) {
|
|
522
|
+
return this.configurationService.parseOptionalOption(e);
|
|
523
|
+
}
|
|
524
|
+
parseInclude(e) {
|
|
525
|
+
return this.configurationService.parseCommaDelimitedOption(e);
|
|
526
|
+
}
|
|
527
|
+
parseNestjsModules() {
|
|
528
|
+
return !0;
|
|
529
|
+
}
|
|
530
|
+
parseNoFileImports() {
|
|
531
|
+
return !1;
|
|
532
|
+
}
|
|
533
|
+
parseNoNestjsModules() {
|
|
534
|
+
return !1;
|
|
535
|
+
}
|
|
536
|
+
parseNoNxProjects() {
|
|
537
|
+
return !1;
|
|
538
|
+
}
|
|
539
|
+
parseNxProjects() {
|
|
540
|
+
return !0;
|
|
541
|
+
}
|
|
542
|
+
parseProjects(e) {
|
|
543
|
+
return this.configurationService.parseOptionalOption(e);
|
|
544
|
+
}
|
|
545
|
+
parseTags(e) {
|
|
546
|
+
return this.configurationService.parseOptionalOption(e);
|
|
547
|
+
}
|
|
548
|
+
async run(e, t = {}) {
|
|
549
|
+
try {
|
|
550
|
+
let n = this.validateInputs(e, t);
|
|
551
|
+
if (!n) return;
|
|
552
|
+
let r = await this.runContextService.build({
|
|
553
|
+
mode: "check",
|
|
554
|
+
options: t,
|
|
555
|
+
workingDirectory: l.resolve(t.directory ?? process.cwd())
|
|
556
|
+
}), i = await this.pathQueryService.query({
|
|
557
|
+
context: r,
|
|
558
|
+
from: n.from,
|
|
559
|
+
to: n.to
|
|
560
|
+
}), a = this.pathQueryService.render({
|
|
561
|
+
format: n.format,
|
|
562
|
+
results: i
|
|
563
|
+
});
|
|
564
|
+
process.stdout.write(`${a}\n`);
|
|
565
|
+
} catch (e) {
|
|
566
|
+
this.reportingService.reportFailure(e);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
R([
|
|
571
|
+
M({
|
|
572
|
+
description: "Path to the codependix configuration file",
|
|
573
|
+
flags: "--config [config]"
|
|
574
|
+
}),
|
|
575
|
+
L("design:type", Function),
|
|
576
|
+
L("design:paramtypes", [Object]),
|
|
577
|
+
L("design:returntype", Object)
|
|
578
|
+
], J.prototype, "parseConfig", null), R([
|
|
579
|
+
M({
|
|
580
|
+
description: "Directory whose Nx workspace this run reads",
|
|
581
|
+
flags: "-d, --directory [directory]"
|
|
582
|
+
}),
|
|
583
|
+
L("design:type", Function),
|
|
584
|
+
L("design:paramtypes", [Object]),
|
|
585
|
+
L("design:returntype", String)
|
|
586
|
+
], J.prototype, "parseDirectory", null), R([
|
|
587
|
+
M({
|
|
588
|
+
description: "Comma-separated globs overriding the configured exclude. Refused when exclude was never configured",
|
|
589
|
+
flags: "--exclude [exclude]"
|
|
590
|
+
}),
|
|
591
|
+
L("design:type", Function),
|
|
592
|
+
L("design:paramtypes", [Object]),
|
|
593
|
+
L("design:returntype", Array)
|
|
594
|
+
], J.prototype, "parseExclude", null), R([
|
|
595
|
+
M({
|
|
596
|
+
description: "Query the fileImports graph type",
|
|
597
|
+
flags: "--file-imports"
|
|
598
|
+
}),
|
|
599
|
+
L("design:type", Function),
|
|
600
|
+
L("design:paramtypes", []),
|
|
601
|
+
L("design:returntype", Boolean)
|
|
602
|
+
], J.prototype, "parseFileImports", null), R([
|
|
603
|
+
M({
|
|
604
|
+
description: `What to print to standard output, one of ${T.join(", ")} (default: ${x})`,
|
|
605
|
+
flags: "-f, --format [format]"
|
|
606
|
+
}),
|
|
607
|
+
L("design:type", Function),
|
|
608
|
+
L("design:paramtypes", [Object]),
|
|
609
|
+
L("design:returntype", Object)
|
|
610
|
+
], J.prototype, "parseFormat", null), R([
|
|
611
|
+
M({
|
|
612
|
+
description: "Comma-separated globs overriding the configured include. Refused when include was never configured",
|
|
613
|
+
flags: "--include [include]"
|
|
614
|
+
}),
|
|
615
|
+
L("design:type", Function),
|
|
616
|
+
L("design:paramtypes", [Object]),
|
|
617
|
+
L("design:returntype", Array)
|
|
618
|
+
], J.prototype, "parseInclude", null), R([
|
|
619
|
+
M({
|
|
620
|
+
description: "Query the nestjsModules graph type",
|
|
621
|
+
flags: "--nestjs-modules"
|
|
622
|
+
}),
|
|
623
|
+
L("design:type", Function),
|
|
624
|
+
L("design:paramtypes", []),
|
|
625
|
+
L("design:returntype", Boolean)
|
|
626
|
+
], J.prototype, "parseNestjsModules", null), R([
|
|
627
|
+
M({
|
|
628
|
+
description: "Skip the fileImports graph type for this query",
|
|
629
|
+
flags: "--no-file-imports"
|
|
630
|
+
}),
|
|
631
|
+
L("design:type", Function),
|
|
632
|
+
L("design:paramtypes", []),
|
|
633
|
+
L("design:returntype", Boolean)
|
|
634
|
+
], J.prototype, "parseNoFileImports", null), R([
|
|
635
|
+
M({
|
|
636
|
+
description: "Skip the nestjsModules graph type for this query",
|
|
637
|
+
flags: "--no-nestjs-modules"
|
|
638
|
+
}),
|
|
639
|
+
L("design:type", Function),
|
|
640
|
+
L("design:paramtypes", []),
|
|
641
|
+
L("design:returntype", Boolean)
|
|
642
|
+
], J.prototype, "parseNoNestjsModules", null), R([
|
|
643
|
+
M({
|
|
644
|
+
description: "Skip the nxProjects graph type for this query",
|
|
645
|
+
flags: "--no-nx-projects"
|
|
646
|
+
}),
|
|
647
|
+
L("design:type", Function),
|
|
648
|
+
L("design:paramtypes", []),
|
|
649
|
+
L("design:returntype", Boolean)
|
|
650
|
+
], J.prototype, "parseNoNxProjects", null), R([
|
|
651
|
+
M({
|
|
652
|
+
description: "Query the nxProjects graph type",
|
|
653
|
+
flags: "--nx-projects"
|
|
654
|
+
}),
|
|
655
|
+
L("design:type", Function),
|
|
656
|
+
L("design:paramtypes", []),
|
|
657
|
+
L("design:returntype", Boolean)
|
|
658
|
+
], J.prototype, "parseNxProjects", null), R([
|
|
659
|
+
M({
|
|
660
|
+
description: "Comma-separated project names or roots to search across, as globs, beyond those include already selects",
|
|
661
|
+
flags: "--projects [projects]"
|
|
662
|
+
}),
|
|
663
|
+
L("design:type", Function),
|
|
664
|
+
L("design:paramtypes", [Object]),
|
|
665
|
+
L("design:returntype", Object)
|
|
666
|
+
], J.prototype, "parseProjects", null), R([
|
|
667
|
+
M({
|
|
668
|
+
description: "Comma-separated Nx tags to search across, beyond what include already selects",
|
|
669
|
+
flags: "--tags [tags]"
|
|
670
|
+
}),
|
|
671
|
+
L("design:type", Function),
|
|
672
|
+
L("design:paramtypes", [Object]),
|
|
673
|
+
L("design:returntype", Object)
|
|
674
|
+
], J.prototype, "parseTags", null), J = q = R([
|
|
675
|
+
A({
|
|
676
|
+
arguments: "<from> <to>",
|
|
677
|
+
description: "Find the shortest connecting path between two nodes in codependix graphs",
|
|
678
|
+
name: "path"
|
|
679
|
+
}),
|
|
680
|
+
n(),
|
|
681
|
+
L("design:paramtypes", [
|
|
682
|
+
v === void 0 ? Object : v,
|
|
683
|
+
B === void 0 ? Object : B,
|
|
684
|
+
D === void 0 ? Object : D,
|
|
685
|
+
k === void 0 ? Object : k,
|
|
686
|
+
h === void 0 ? Object : h
|
|
687
|
+
])
|
|
688
|
+
], J);
|
|
689
|
+
//#endregion
|
|
690
|
+
//#region packages/ic-suite/codependix/codependix-cli/src/modules/path/path.module.ts
|
|
691
|
+
var Y = class {};
|
|
692
|
+
Y = R([r({
|
|
693
|
+
controllers: [],
|
|
694
|
+
exports: [J],
|
|
695
|
+
imports: [
|
|
696
|
+
_,
|
|
697
|
+
E,
|
|
698
|
+
O,
|
|
699
|
+
m
|
|
700
|
+
],
|
|
701
|
+
providers: [J]
|
|
702
|
+
})], Y);
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region packages/ic-suite/codependix/codependix-cli/src/main.module.ts
|
|
705
|
+
var X = class {};
|
|
706
|
+
X = R([r({ imports: [
|
|
707
|
+
a.forRoot({
|
|
708
|
+
envFilePath: ".env",
|
|
709
|
+
isGlobal: !0,
|
|
710
|
+
validate: (e) => H.parse(e)
|
|
711
|
+
}),
|
|
712
|
+
o,
|
|
713
|
+
V,
|
|
714
|
+
G,
|
|
715
|
+
Y
|
|
716
|
+
] })], X);
|
|
717
|
+
//#endregion
|
|
718
|
+
export { B as i, G as n, W as r, X as t };
|