@callidescope/nx 0.0.64 → 0.0.66
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/CHANGELOG.md +16 -0
- package/README.md +134 -62
- package/dist/{address.utilities-CsqyHZaJ.js → address.utilities-DjzmfI-l.js} +2 -2
- package/dist/{plugin-context.utilities-Bl7Iny6b.js → plugin-context.utilities-BstelNQl.js} +167 -131
- package/dist/{plugin.utilities-BYLiorWH.js → plugin.utilities-C8eEw5MU.js} +1 -1
- package/dist/src/executors/breadth/executor.js +2 -2
- package/dist/src/executors/depth/executor.js +2 -2
- package/dist/src/executors/gate/batch-executor.d.ts +54 -0
- package/dist/src/executors/gate/batch-executor.js +64 -0
- package/dist/src/executors/gate/executor.js +2 -2
- package/dist/src/executors/trace/executor.js +2 -2
- package/dist/src/index.d.ts +136 -48
- package/dist/src/index.js +1 -1
- package/executors.json +2 -0
- package/package.json +6 -6
|
@@ -5,15 +5,15 @@ import { existsSync as o, mkdirSync as s } from "node:fs";
|
|
|
5
5
|
import c from "node:path";
|
|
6
6
|
import l from "pino";
|
|
7
7
|
import { AddressLookupModule as u, AddressLookupService as d, CallidescopeModule as f, CallidescopeService as p } from "@callidescope/cli";
|
|
8
|
-
import { AddressDepthService as m, BreadthService as h, FileFilterService as g, GraphModule as ee, WorkspaceModule as
|
|
9
|
-
import { AddressReportModule as
|
|
10
|
-
import { CALLIDESCOPE_OUTPUT_FORMATS as
|
|
11
|
-
import { createProjectGraphAsync as
|
|
8
|
+
import { AddressDepthService as m, BreadthService as h, FileFilterService as g, GraphModule as ee, WorkspaceModule as te } from "@callidescope/graph";
|
|
9
|
+
import { AddressReportModule as _, AddressReportService as v, MarkdownReportService as y, ProjectReportsModule as ne, ProjectReportsService as b, ReportModule as re } from "@callidescope/output";
|
|
10
|
+
import { CALLIDESCOPE_OUTPUT_FORMATS as ie, ConfigurationModule as x, ConfigurationService as S, DEFAULT_OUTPUT_FORMAT as C, DEFAULT_PREVIEW_COUNT as w, DEFAULT_RUN_HEADING as T } from "@callidescope/configuration";
|
|
11
|
+
import { createProjectGraphAsync as E } from "@nx/devkit";
|
|
12
12
|
// \0rolldown/runtime.js
|
|
13
|
-
var
|
|
13
|
+
var D = Object.defineProperty, __name = (e, t) => D(e, "name", {
|
|
14
14
|
value: t,
|
|
15
15
|
configurable: !0
|
|
16
|
-
}),
|
|
16
|
+
}), ae = /^(\p{Extended_Pictographic}️?(?:\p{Extended_Pictographic}️?)*)\s+/u, oe = /^([A-Za-z]+)/, se = /* @__PURE__ */ new Set([
|
|
17
17
|
"built",
|
|
18
18
|
"cut",
|
|
19
19
|
"found",
|
|
@@ -31,7 +31,7 @@ var k = Object.defineProperty, __name = (e, t) => k(e, "name", {
|
|
|
31
31
|
"split",
|
|
32
32
|
"took",
|
|
33
33
|
"wrote"
|
|
34
|
-
]),
|
|
34
|
+
]), ce = /* @__PURE__ */ new Set([
|
|
35
35
|
"CommandFactory",
|
|
36
36
|
"ExceptionHandler",
|
|
37
37
|
"GraphQLModule",
|
|
@@ -54,9 +54,9 @@ function __decorate(e, t, n, r) {
|
|
|
54
54
|
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
55
55
|
}
|
|
56
56
|
// ../../../common/observability/src/modules/logger/logger.service.ts
|
|
57
|
-
var
|
|
57
|
+
var O, k = class LoggerService extends t {
|
|
58
58
|
static {
|
|
59
|
-
|
|
59
|
+
O = this;
|
|
60
60
|
}
|
|
61
61
|
constructor() {
|
|
62
62
|
super();
|
|
@@ -64,15 +64,15 @@ var A, j = class LoggerService extends t {
|
|
|
64
64
|
static isProduction = process.env.NODE_ENV === "production";
|
|
65
65
|
static rootLogger;
|
|
66
66
|
static writesToStandardError = !1;
|
|
67
|
-
child =
|
|
67
|
+
child = O.root;
|
|
68
68
|
static createRootLogger() {
|
|
69
69
|
let e = process.env.LOG_LEVEL ?? "info";
|
|
70
|
-
return
|
|
70
|
+
return O.isProduction ? O.writesToStandardError ? l({ level: e }, l.destination(2)) : l({ level: e }) : l({
|
|
71
71
|
level: e,
|
|
72
72
|
transport: {
|
|
73
73
|
options: {
|
|
74
74
|
colorize: !0,
|
|
75
|
-
destination:
|
|
75
|
+
destination: O.writesToStandardError ? 2 : 1,
|
|
76
76
|
ignore: "pid,hostname,emoji",
|
|
77
77
|
messageFormat: "{emoji} {msg}",
|
|
78
78
|
singleLine: !0
|
|
@@ -82,10 +82,10 @@ var A, j = class LoggerService extends t {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
static logToStandardError() {
|
|
85
|
-
|
|
85
|
+
O.rootLogger === void 0 ? O.writesToStandardError = !0 : 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.");
|
|
86
86
|
}
|
|
87
87
|
assertConventionalMessage(e) {
|
|
88
|
-
if (
|
|
88
|
+
if (O.isProduction || this.shouldSkipConventionalMessageValidation(e.context)) return;
|
|
89
89
|
let t = this.getConventionalMessageViolation(e.parsed);
|
|
90
90
|
if (t !== void 0) throw Error(t);
|
|
91
91
|
}
|
|
@@ -96,21 +96,21 @@ var A, j = class LoggerService extends t {
|
|
|
96
96
|
}), {
|
|
97
97
|
...e.data,
|
|
98
98
|
context: e.context,
|
|
99
|
-
...
|
|
99
|
+
...O.isProduction ? {} : { emoji: e.parsed.emoji }
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
getConventionalMessageViolation(e) {
|
|
103
103
|
let t = e.emoji, n = e.text;
|
|
104
104
|
if (t === void 0) return `Log message must start with an emoji naming its subject, then a verb: "${n}"`;
|
|
105
|
-
let r =
|
|
105
|
+
let r = oe.exec(n)?.[1];
|
|
106
106
|
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}"`;
|
|
107
107
|
}
|
|
108
108
|
isConventionalVerb(e) {
|
|
109
109
|
let t = e.toLowerCase();
|
|
110
|
-
return t.endsWith("ing") || t.endsWith("ed") ||
|
|
110
|
+
return t.endsWith("ing") || t.endsWith("ed") || se.has(t);
|
|
111
111
|
}
|
|
112
112
|
parseMessage(e) {
|
|
113
|
-
let t = String(e), n =
|
|
113
|
+
let t = String(e), n = ae.exec(t), r = n?.[1];
|
|
114
114
|
return r === void 0 ? {
|
|
115
115
|
emoji: void 0,
|
|
116
116
|
text: t
|
|
@@ -120,10 +120,10 @@ var A, j = class LoggerService extends t {
|
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
shouldSkipConventionalMessageValidation(e) {
|
|
123
|
-
return e !== void 0 &&
|
|
123
|
+
return e !== void 0 && ce.has(e);
|
|
124
124
|
}
|
|
125
125
|
static get root() {
|
|
126
|
-
return
|
|
126
|
+
return O.rootLogger ??= O.createRootLogger(), O.rootLogger;
|
|
127
127
|
}
|
|
128
128
|
buildErrorLogEntry(e, t) {
|
|
129
129
|
let n = t instanceof Error ? t.stack || t.message : String(t);
|
|
@@ -167,7 +167,7 @@ var A, j = class LoggerService extends t {
|
|
|
167
167
|
this.info(e, t, n);
|
|
168
168
|
}
|
|
169
169
|
setContext(e) {
|
|
170
|
-
super.setContext(e), this.child =
|
|
170
|
+
super.setContext(e), this.child = O.root.child({ context: e });
|
|
171
171
|
}
|
|
172
172
|
verbose(e, t, n) {
|
|
173
173
|
let r = this.parseMessage(e);
|
|
@@ -186,17 +186,17 @@ var A, j = class LoggerService extends t {
|
|
|
186
186
|
}), r.text);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
|
|
189
|
+
k = O = __decorate([r({ scope: a.TRANSIENT }), __decorateMetadata("design:paramtypes", [])], k);
|
|
190
190
|
// ../../../common/observability/src/modules/logger/logger.module.ts
|
|
191
|
-
var
|
|
192
|
-
|
|
191
|
+
var A = class LoggerModule {};
|
|
192
|
+
A = __decorate([n(), i({
|
|
193
193
|
controllers: [],
|
|
194
|
-
exports: [
|
|
194
|
+
exports: [k],
|
|
195
195
|
imports: [],
|
|
196
|
-
providers: [
|
|
197
|
-
})],
|
|
196
|
+
providers: [k]
|
|
197
|
+
})], A);
|
|
198
198
|
// src/modules/address/address.service.ts
|
|
199
|
-
var
|
|
199
|
+
var j = class AddressService {
|
|
200
200
|
addressLookupService;
|
|
201
201
|
addressReportService;
|
|
202
202
|
addressDepthService;
|
|
@@ -260,7 +260,7 @@ var N = class AddressService {
|
|
|
260
260
|
return {
|
|
261
261
|
ok: !0,
|
|
262
262
|
report: this.addressReportService.renderBreadthReports({
|
|
263
|
-
format: e.format ??
|
|
263
|
+
format: e.format ?? C,
|
|
264
264
|
reports: a
|
|
265
265
|
})
|
|
266
266
|
};
|
|
@@ -275,7 +275,7 @@ var N = class AddressService {
|
|
|
275
275
|
return {
|
|
276
276
|
ok: !0,
|
|
277
277
|
report: this.addressReportService.renderDepthReports({
|
|
278
|
-
format: e.format ??
|
|
278
|
+
format: e.format ?? C,
|
|
279
279
|
reports: n.map(({ address: e, id: t }) => {
|
|
280
280
|
let n = {
|
|
281
281
|
callablesById: r.located.callablesById,
|
|
@@ -292,26 +292,26 @@ var N = class AddressService {
|
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
294
|
};
|
|
295
|
-
|
|
295
|
+
j = __decorate([r(), __decorateMetadata("design:paramtypes", [
|
|
296
296
|
d === void 0 ? Object : d,
|
|
297
|
-
|
|
297
|
+
v === void 0 ? Object : v,
|
|
298
298
|
m === void 0 ? Object : m,
|
|
299
299
|
h === void 0 ? Object : h
|
|
300
|
-
])],
|
|
300
|
+
])], j);
|
|
301
301
|
// src/modules/address/address.module.ts
|
|
302
|
-
var
|
|
303
|
-
|
|
302
|
+
var M = class AddressModule {};
|
|
303
|
+
M = __decorate([i({
|
|
304
304
|
controllers: [],
|
|
305
|
-
exports: [
|
|
305
|
+
exports: [j],
|
|
306
306
|
imports: [
|
|
307
307
|
u,
|
|
308
|
-
|
|
308
|
+
_,
|
|
309
309
|
ee
|
|
310
310
|
],
|
|
311
|
-
providers: [
|
|
312
|
-
})],
|
|
311
|
+
providers: [j]
|
|
312
|
+
})], M);
|
|
313
313
|
// src/modules/options/options.constants.ts
|
|
314
|
-
var
|
|
314
|
+
var N = "@callidescope/nx", P = "callidescope-trace", F = "callidescope-depth", I = "callidescope-breadth", L = "callidescope-restrict", R = `The "configurationPath" option in the nx.json registration of ${N}`, z = "The \"configuration\" executor option", B = "tsconfig.json", V = class OptionsService {
|
|
315
315
|
configurationService;
|
|
316
316
|
constructor(e) {
|
|
317
317
|
this.configurationService = e;
|
|
@@ -324,10 +324,10 @@ var F = "@callidescope/nx", I = "callidescope-trace", L = "callidescope-depth",
|
|
|
324
324
|
return typeof t == "string" && t !== "" ? t : void 0;
|
|
325
325
|
}
|
|
326
326
|
readConfiguration(e) {
|
|
327
|
-
return this.configurationService.requireConfigurationPath(typeof e == "string" ? e : void 0,
|
|
327
|
+
return this.configurationService.requireConfigurationPath(typeof e == "string" ? e : void 0, z);
|
|
328
328
|
}
|
|
329
329
|
readFormat(e) {
|
|
330
|
-
return
|
|
330
|
+
return ie.find((t) => t === e);
|
|
331
331
|
}
|
|
332
332
|
readLookupOptions(e) {
|
|
333
333
|
return {
|
|
@@ -342,7 +342,7 @@ var F = "@callidescope/nx", I = "callidescope-trace", L = "callidescope-depth",
|
|
|
342
342
|
let t = typeof e == "object" && e ? { ...e } : {}, n = this.configurationService.requireConfigurationPath(this.readString({
|
|
343
343
|
key: "configurationPath",
|
|
344
344
|
options: t
|
|
345
|
-
}),
|
|
345
|
+
}), R);
|
|
346
346
|
return {
|
|
347
347
|
breadthTargetName: this.readString({
|
|
348
348
|
key: "breadthTargetName",
|
|
@@ -364,17 +364,17 @@ var F = "@callidescope/nx", I = "callidescope-trace", L = "callidescope-depth",
|
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
|
-
|
|
367
|
+
V = __decorate([r(), __decorateMetadata("design:paramtypes", [S === void 0 ? Object : S])], V);
|
|
368
368
|
// src/modules/options/options.module.ts
|
|
369
|
-
var
|
|
370
|
-
|
|
369
|
+
var H = class OptionsModule {};
|
|
370
|
+
H = __decorate([i({
|
|
371
371
|
controllers: [],
|
|
372
|
-
exports: [
|
|
373
|
-
imports: [
|
|
374
|
-
providers: [
|
|
375
|
-
})],
|
|
372
|
+
exports: [V],
|
|
373
|
+
imports: [x],
|
|
374
|
+
providers: [V]
|
|
375
|
+
})], H);
|
|
376
376
|
// src/modules/projects/projects.service.ts
|
|
377
|
-
var
|
|
377
|
+
var U = class ProjectsService {
|
|
378
378
|
constructor() {}
|
|
379
379
|
readTags(e) {
|
|
380
380
|
return [...new Set(e.flatMap((e) => e.tags))].toSorted((e, t) => e.localeCompare(t));
|
|
@@ -391,7 +391,7 @@ var G = class ProjectsService {
|
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
393
|
async readProjectGraph() {
|
|
394
|
-
return
|
|
394
|
+
return E({ exitOnError: !1 });
|
|
395
395
|
}
|
|
396
396
|
readProjects(e) {
|
|
397
397
|
return Object.entries(e.nodes).map(([e, t]) => ({
|
|
@@ -447,17 +447,17 @@ var G = class ProjectsService {
|
|
|
447
447
|
return [...n].toSorted((e, t) => e.localeCompare(t));
|
|
448
448
|
}
|
|
449
449
|
};
|
|
450
|
-
|
|
450
|
+
U = __decorate([r(), __decorateMetadata("design:paramtypes", [])], U);
|
|
451
451
|
// src/modules/projects/projects.module.ts
|
|
452
|
-
var
|
|
453
|
-
|
|
452
|
+
var W = class ProjectsModule {};
|
|
453
|
+
W = __decorate([i({
|
|
454
454
|
controllers: [],
|
|
455
|
-
exports: [
|
|
455
|
+
exports: [U],
|
|
456
456
|
imports: [],
|
|
457
|
-
providers: [
|
|
458
|
-
})],
|
|
457
|
+
providers: [U]
|
|
458
|
+
})], W);
|
|
459
459
|
// src/modules/run-configuration/run-configuration.service.ts
|
|
460
|
-
var
|
|
460
|
+
var G = class RunConfigurationService {
|
|
461
461
|
configurationService;
|
|
462
462
|
constructor(e) {
|
|
463
463
|
this.configurationService = e;
|
|
@@ -470,17 +470,17 @@ var q = class RunConfigurationService {
|
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
|
-
|
|
473
|
+
G = __decorate([r(), __decorateMetadata("design:paramtypes", [S === void 0 ? Object : S])], G);
|
|
474
474
|
// src/modules/run-configuration/run-configuration.module.ts
|
|
475
|
-
var
|
|
476
|
-
|
|
475
|
+
var K = class RunConfigurationModule {};
|
|
476
|
+
K = __decorate([i({
|
|
477
477
|
controllers: [],
|
|
478
|
-
exports: [
|
|
479
|
-
imports: [
|
|
480
|
-
providers: [
|
|
481
|
-
})],
|
|
478
|
+
exports: [G],
|
|
479
|
+
imports: [x],
|
|
480
|
+
providers: [G]
|
|
481
|
+
})], K);
|
|
482
482
|
// src/modules/plugin/plugin.constants.ts
|
|
483
|
-
var
|
|
483
|
+
var le = "**/{project.json,callidescope.config.*}", ue = "{projectRoot}/callidescope.config.*", q = "__callidescopePluginContext", reportUnreadProjects = (e) => [
|
|
484
484
|
"## Read nothing of its own (0 files)",
|
|
485
485
|
"",
|
|
486
486
|
`This run judged ${e.length === 1 ? "a project" : "projects"} whose own code it never read:`,
|
|
@@ -497,17 +497,57 @@ var se = "**/{project.json,callidescope.config.*}", ce = "{projectRoot}/callides
|
|
|
497
497
|
"configuration and `exclude` in the project's own `callidescope.config.*`",
|
|
498
498
|
"for a pattern matching everything that project holds, and check that the",
|
|
499
499
|
"project still holds sources its `tsconfig.json` includes."
|
|
500
|
-
].join("\n"),
|
|
500
|
+
].join("\n"), de = "## Traced nothing (0 callables)\n\nThis gate read no code, so it judged none. It fails rather than passing:\na gate that never looked cannot tell a clean project from an unread one.\n\nCheck `exclude` and `excludeFrom` in the workspace callidescope\nconfiguration and in this project's own `callidescope.config.*` for a\npattern matching everything the project holds.", J = "## Traced nothing (no directories in scope)\n\nThis gate's Nx selection resolved to no directory, so nothing was traced\nand nothing was judged. It fails rather than passing: a gate that never\nlooked cannot tell a clean project from an unread one.\n\nCheck the `projects` and `tags` this target was given, and whether the\nprojects they name still hold a root of their own.", Y = class VerdictService {
|
|
501
|
+
projectReportsService;
|
|
502
|
+
constructor(e) {
|
|
503
|
+
this.projectReportsService = e;
|
|
504
|
+
}
|
|
505
|
+
explain(e) {
|
|
506
|
+
return e.unreadProjectNames.length > 0 ? reportUnreadProjects(e.unreadProjectNames) : e.reason;
|
|
507
|
+
}
|
|
508
|
+
judge(e) {
|
|
509
|
+
let t = this.projectReportsService.findOwnedFindings({
|
|
510
|
+
limits: e.projectLimits,
|
|
511
|
+
projectNames: e.judgedProjectNames,
|
|
512
|
+
reports: e.result.projects
|
|
513
|
+
}), n = this.projectReportsService.findUnreadProjects({
|
|
514
|
+
projectNames: e.judgedProjectNames,
|
|
515
|
+
reports: e.result.projects
|
|
516
|
+
});
|
|
517
|
+
return e.result.summary.callableCount === 0 ? {
|
|
518
|
+
findings: t,
|
|
519
|
+
ok: !1,
|
|
520
|
+
reason: de,
|
|
521
|
+
unreadProjectNames: n
|
|
522
|
+
} : {
|
|
523
|
+
findings: t,
|
|
524
|
+
ok: t.deepStacks.length === 0 && t.wideCallables.length === 0,
|
|
525
|
+
reason: void 0,
|
|
526
|
+
unreadProjectNames: n
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
Y = __decorate([r(), __decorateMetadata("design:paramtypes", [b === void 0 ? Object : b])], Y);
|
|
531
|
+
// src/modules/verdict/verdict.module.ts
|
|
532
|
+
var X = class VerdictModule {};
|
|
533
|
+
X = __decorate([i({
|
|
534
|
+
controllers: [],
|
|
535
|
+
exports: [Y],
|
|
536
|
+
imports: [ne],
|
|
537
|
+
providers: [Y]
|
|
538
|
+
})], X);
|
|
539
|
+
// src/modules/plugin/plugin.service.ts
|
|
540
|
+
var Z = class PluginService {
|
|
501
541
|
callidescopeService;
|
|
502
542
|
configurationService;
|
|
503
543
|
fileFilterService;
|
|
504
544
|
markdownReportService;
|
|
505
545
|
optionsService;
|
|
506
|
-
projectReportsService;
|
|
507
546
|
projectsService;
|
|
508
547
|
runConfigurationService;
|
|
548
|
+
verdictService;
|
|
509
549
|
constructor(e, t, n, r, i, a, o, s) {
|
|
510
|
-
this.callidescopeService = e, this.configurationService = t, this.fileFilterService = n, this.markdownReportService = r, this.optionsService = i, this.
|
|
550
|
+
this.callidescopeService = e, this.configurationService = t, this.fileFilterService = n, this.markdownReportService = r, this.optionsService = i, this.projectsService = a, this.runConfigurationService = o, this.verdictService = s;
|
|
511
551
|
}
|
|
512
552
|
async buildExclusionFilter(e) {
|
|
513
553
|
try {
|
|
@@ -529,19 +569,19 @@ var se = "**/{project.json,callidescope.config.*}", ce = "{projectRoot}/callides
|
|
|
529
569
|
], r = { configuration: t.configurationPath }, i = {
|
|
530
570
|
[t.breadthTargetName]: {
|
|
531
571
|
cache: !0,
|
|
532
|
-
executor: `${
|
|
572
|
+
executor: `${N}:breadth`,
|
|
533
573
|
inputs: n,
|
|
534
574
|
options: r
|
|
535
575
|
},
|
|
536
576
|
[t.depthTargetName]: {
|
|
537
577
|
cache: !0,
|
|
538
|
-
executor: `${
|
|
578
|
+
executor: `${N}:depth`,
|
|
539
579
|
inputs: n,
|
|
540
580
|
options: r
|
|
541
581
|
},
|
|
542
582
|
[t.traceTargetName]: {
|
|
543
583
|
cache: !0,
|
|
544
|
-
executor: `${
|
|
584
|
+
executor: `${N}:trace`,
|
|
545
585
|
inputs: n,
|
|
546
586
|
options: r
|
|
547
587
|
}
|
|
@@ -550,40 +590,30 @@ var se = "**/{project.json,callidescope.config.*}", ce = "{projectRoot}/callides
|
|
|
550
590
|
...i,
|
|
551
591
|
[t.gateTargetName]: {
|
|
552
592
|
cache: !0,
|
|
553
|
-
executor: `${
|
|
554
|
-
inputs: [...n,
|
|
593
|
+
executor: `${N}:gate`,
|
|
594
|
+
inputs: [...n, ue],
|
|
555
595
|
options: r
|
|
556
596
|
}
|
|
557
597
|
};
|
|
558
598
|
}
|
|
559
|
-
explainVerdict(e) {
|
|
560
|
-
return e.unreadProjectNames.length > 0 ? reportUnreadProjects(e.unreadProjectNames) : e.reason;
|
|
561
|
-
}
|
|
562
599
|
holdsProgram(e) {
|
|
563
|
-
return o(c.join(e.workspaceRoot, e.projectRoot,
|
|
600
|
+
return o(c.join(e.workspaceRoot, e.projectRoot, B));
|
|
564
601
|
}
|
|
565
602
|
isExcludedProject(e) {
|
|
566
|
-
return e.fileFilter.isExcluded(c.posix.join(e.projectRoot,
|
|
603
|
+
return e.fileFilter.isExcluded(c.posix.join(e.projectRoot, B));
|
|
567
604
|
}
|
|
568
|
-
|
|
569
|
-
let t = this.
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}), n = this.projectReportsService.findUnreadProjects({
|
|
574
|
-
projectNames: e.judgedProjectNames,
|
|
575
|
-
reports: e.result.projects
|
|
605
|
+
renderGateVerdict(e) {
|
|
606
|
+
let t = this.verdictService.judge({
|
|
607
|
+
judgedProjectNames: e.judgedProjectNames,
|
|
608
|
+
projectLimits: e.outcome.projectLimits,
|
|
609
|
+
result: e.outcome.result
|
|
576
610
|
});
|
|
577
|
-
return
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
findings: t,
|
|
584
|
-
ok: t.deepStacks.length === 0 && t.wideCallables.length === 0,
|
|
585
|
-
reason: void 0,
|
|
586
|
-
unreadProjectNames: n
|
|
611
|
+
return {
|
|
612
|
+
ok: t.ok && t.unreadProjectNames.length === 0,
|
|
613
|
+
report: this.verdictService.explain(t) ?? this.markdownReportService.renderFindings({
|
|
614
|
+
...t.findings,
|
|
615
|
+
previewCount: w
|
|
616
|
+
})
|
|
587
617
|
};
|
|
588
618
|
}
|
|
589
619
|
describeRefusedScope(e) {
|
|
@@ -641,37 +671,43 @@ var se = "**/{project.json,callidescope.config.*}", ce = "{projectRoot}/callides
|
|
|
641
671
|
configurationPath: n,
|
|
642
672
|
directories: e.directories,
|
|
643
673
|
workspaceRoot: e.workspaceRoot
|
|
644
|
-
})
|
|
674
|
+
});
|
|
675
|
+
return this.renderGateVerdict({
|
|
645
676
|
judgedProjectNames: e.judgedProjectNames,
|
|
646
|
-
|
|
647
|
-
result: r.result
|
|
677
|
+
outcome: r
|
|
648
678
|
});
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
679
|
+
}
|
|
680
|
+
async runGateBatch(e) {
|
|
681
|
+
if (e.tasks.length === 0) return {};
|
|
682
|
+
let { configuration: t, path: n } = await this.runConfigurationService.load(e), r = await this.callidescopeService.trace({
|
|
683
|
+
configuration: t,
|
|
684
|
+
configurationPath: n,
|
|
685
|
+
directories: [...new Set(e.tasks.flatMap((e) => e.directories))],
|
|
686
|
+
workspaceRoot: e.workspaceRoot
|
|
687
|
+
});
|
|
688
|
+
return Object.fromEntries(e.tasks.map((e) => [e.id, this.renderGateVerdict({
|
|
689
|
+
judgedProjectNames: e.judgedProjectNames,
|
|
690
|
+
outcome: r
|
|
691
|
+
})]));
|
|
656
692
|
}
|
|
657
693
|
async runTrace(e) {
|
|
658
|
-
let { configuration: t, path: n } = await this.runConfigurationService.load(e), r = e.format ??
|
|
694
|
+
let { configuration: t, path: n } = await this.runConfigurationService.load(e), r = e.format ?? C, i = await this.callidescopeService.trace({
|
|
659
695
|
configuration: t,
|
|
660
696
|
configurationPath: n,
|
|
661
697
|
directories: e.directories,
|
|
662
698
|
workspaceRoot: e.workspaceRoot
|
|
663
|
-
}), a = this.judge({
|
|
699
|
+
}), a = this.verdictService.judge({
|
|
664
700
|
judgedProjectNames: e.judgedProjectNames,
|
|
665
701
|
projectLimits: i.projectLimits,
|
|
666
702
|
result: i.result
|
|
667
703
|
}), o = this.markdownReportService.renderRun({
|
|
668
704
|
description: void 0,
|
|
669
|
-
heading:
|
|
705
|
+
heading: T,
|
|
670
706
|
limits: i.projectLimits,
|
|
671
|
-
previewCount:
|
|
707
|
+
previewCount: w,
|
|
672
708
|
rendering: r === "mermaid" ? "diagram" : "tree",
|
|
673
709
|
result: i.result
|
|
674
|
-
}), s = this.
|
|
710
|
+
}), s = this.verdictService.explain(a);
|
|
675
711
|
return {
|
|
676
712
|
ok: a.ok,
|
|
677
713
|
report: s === void 0 ? o : `${o}\n${s}`
|
|
@@ -680,13 +716,13 @@ var se = "**/{project.json,callidescope.config.*}", ce = "{projectRoot}/callides
|
|
|
680
716
|
};
|
|
681
717
|
Z = __decorate([r(), __decorateMetadata("design:paramtypes", [
|
|
682
718
|
p === void 0 ? Object : p,
|
|
683
|
-
|
|
719
|
+
S === void 0 ? Object : S,
|
|
684
720
|
g === void 0 ? Object : g,
|
|
685
|
-
|
|
721
|
+
y === void 0 ? Object : y,
|
|
722
|
+
V === void 0 ? Object : V,
|
|
686
723
|
U === void 0 ? Object : U,
|
|
687
|
-
x === void 0 ? Object : x,
|
|
688
724
|
G === void 0 ? Object : G,
|
|
689
|
-
|
|
725
|
+
Y === void 0 ? Object : Y
|
|
690
726
|
])], Z);
|
|
691
727
|
// src/modules/plugin/plugin.module.ts
|
|
692
728
|
var Q = class PluginModule {};
|
|
@@ -695,14 +731,14 @@ Q = __decorate([i({
|
|
|
695
731
|
exports: [Z],
|
|
696
732
|
imports: [
|
|
697
733
|
f,
|
|
698
|
-
|
|
699
|
-
|
|
734
|
+
x,
|
|
735
|
+
A,
|
|
736
|
+
H,
|
|
700
737
|
W,
|
|
701
|
-
|
|
738
|
+
re,
|
|
702
739
|
K,
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
_
|
|
740
|
+
X,
|
|
741
|
+
te
|
|
706
742
|
],
|
|
707
743
|
providers: [Z]
|
|
708
744
|
})], Q);
|
|
@@ -710,32 +746,32 @@ Q = __decorate([i({
|
|
|
710
746
|
var $ = class MainModule {};
|
|
711
747
|
$ = __decorate([i({
|
|
712
748
|
controllers: [],
|
|
713
|
-
exports: [
|
|
749
|
+
exports: [M, Q],
|
|
714
750
|
imports: [
|
|
715
|
-
P,
|
|
716
751
|
M,
|
|
752
|
+
A,
|
|
717
753
|
Q
|
|
718
754
|
],
|
|
719
755
|
providers: []
|
|
720
756
|
})], $);
|
|
721
757
|
// src/modules/plugin/plugin-context.utilities.ts
|
|
722
758
|
async function resolveAddressService() {
|
|
723
|
-
return (await resolvePluginContext()).get(
|
|
759
|
+
return (await resolvePluginContext()).get(j);
|
|
724
760
|
}
|
|
725
761
|
async function resolveOptionsService() {
|
|
726
|
-
return (await resolvePluginContext()).get(
|
|
762
|
+
return (await resolvePluginContext()).get(V);
|
|
727
763
|
}
|
|
728
764
|
async function resolvePluginService() {
|
|
729
765
|
return (await resolvePluginContext()).get(Z);
|
|
730
766
|
}
|
|
731
767
|
async function resolveProjectsService() {
|
|
732
|
-
return (await resolvePluginContext()).get(
|
|
768
|
+
return (await resolvePluginContext()).get(U);
|
|
733
769
|
}
|
|
734
770
|
async function resolvePluginContext() {
|
|
735
771
|
let t = globalThis;
|
|
736
|
-
return t[
|
|
772
|
+
return t[q] ??= e.createApplicationContext($, {
|
|
737
773
|
abortOnError: !1,
|
|
738
774
|
logger: !1
|
|
739
|
-
}), await t[
|
|
775
|
+
}), await t[q];
|
|
740
776
|
}
|
|
741
|
-
export {
|
|
777
|
+
export { L as _, $ as a, j as b, J as c, U as d, H as f, F as g, I as h, resolveProjectsService as i, le as l, N as m, resolveOptionsService as n, Q as o, V as p, resolvePluginService as r, Z as s, resolveAddressService as t, W as u, P as v, __name as x, M as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, r as t } from "./plugin-context.utilities-
|
|
1
|
+
import { n as e, r as t } from "./plugin-context.utilities-BstelNQl.js";
|
|
2
2
|
// src/modules/plugin/plugin.utilities.ts
|
|
3
3
|
async function resolveExecutorScope(n) {
|
|
4
4
|
let r = await e(), i = r.readStringList(n.options.projects), a = r.readStringList(n.options.tags);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../../plugin-context.utilities-
|
|
2
|
-
import { t as e } from "../../../address.utilities-
|
|
1
|
+
import "../../../plugin-context.utilities-BstelNQl.js";
|
|
2
|
+
import { t as e } from "../../../address.utilities-DjzmfI-l.js";
|
|
3
3
|
// src/executors/breadth/executor.ts
|
|
4
4
|
async function breadthExecutor(t, n) {
|
|
5
5
|
return await e({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../../plugin-context.utilities-
|
|
2
|
-
import { t as e } from "../../../address.utilities-
|
|
1
|
+
import "../../../plugin-context.utilities-BstelNQl.js";
|
|
2
|
+
import { t as e } from "../../../address.utilities-DjzmfI-l.js";
|
|
3
3
|
// src/executors/depth/executor.ts
|
|
4
4
|
async function depthExecutor(t, n) {
|
|
5
5
|
return await e({
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { TaskGraph } from '@nx/devkit';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Gates every task Nx batched for this executor from one trace.
|
|
6
|
+
*
|
|
7
|
+
* One `gate` task per project used to trace the whole workspace on its own, so
|
|
8
|
+
* the cold run of a workspace of ~60 projects traced it ~60 times. A batch
|
|
9
|
+
* traces the combined scope once and judges each task by its own project's
|
|
10
|
+
* findings, so each still passes or fails alone and is still cached alone —
|
|
11
|
+
* Nx hashes and replays batched tasks one by one. Tasks that name different
|
|
12
|
+
* configuration files cannot share a trace, so they are batched per file.
|
|
13
|
+
*/
|
|
14
|
+
declare function gateBatchExecutor(...[taskGraph, options, overrides, context]: GateBatchExecutorArguments): Promise<Record<string, GateBatchTaskResult>>;
|
|
15
|
+
export default gateBatchExecutor;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The four arguments Nx calls a batch executor with, in the order it passes them.
|
|
19
|
+
*
|
|
20
|
+
* A tuple rather than four parameters because Nx fixes that signature and the
|
|
21
|
+
* workspace holds a function to three: the task graph, each task's resolved
|
|
22
|
+
* options by task id, the overrides of the whole run, and the context.
|
|
23
|
+
*/
|
|
24
|
+
declare type GateBatchExecutorArguments = [
|
|
25
|
+
taskGraph: TaskGraph,
|
|
26
|
+
options: Record<string, GateExecutorOptions>,
|
|
27
|
+
overrides: GateExecutorOptions,
|
|
28
|
+
context: ExecutorContext
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* What one task of a gate batch settled on.
|
|
33
|
+
*
|
|
34
|
+
* Nx's own type for a batch executor's result is not exported through
|
|
35
|
+
* `@nx/devkit`, so this states the shape Nx reads back: whether the task
|
|
36
|
+
* passed, and the output to show and to store with it in the cache.
|
|
37
|
+
*/
|
|
38
|
+
declare interface GateBatchTaskResult {
|
|
39
|
+
readonly success: boolean;
|
|
40
|
+
readonly terminalOutput: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Options the gate executor accepts. */
|
|
44
|
+
declare interface GateExecutorOptions {
|
|
45
|
+
readonly configuration: string;
|
|
46
|
+
/** Nx project names to gate, replacing the target's own project. */
|
|
47
|
+
readonly projects?: string[] | undefined;
|
|
48
|
+
/** Nx project tags to gate, selecting a project carrying any of them. */
|
|
49
|
+
readonly tags?: string[] | undefined;
|
|
50
|
+
/** Widen the selection along the Nx dependency graph. Defaults to true. */
|
|
51
|
+
readonly withDependencies?: boolean | undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { }
|