@hublo/sentinel 1.4.3 → 1.5.0-alpha.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/dist/bin/sentinel.js +15 -6
- package/dist/{chunk-DYK6UEMO.js → chunk-AHA7LGGA.js} +501 -57
- package/dist/{chunk-TDNPPNGK.js → chunk-E3MYVYEZ.js} +35 -7
- package/dist/chunk-GJGZRXM3.js +92 -0
- package/dist/chunk-GJGZRXM3.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +4 -3
- package/dist/roles/static-analysis/config.d.ts +60 -0
- package/dist/roles/static-analysis/config.js +7 -0
- package/dist/roles/static-analysis/config.js.map +1 -0
- package/dist/roles/test/setup/file-boundary.js +3 -3
- package/dist/{validate-3QMCX2HW.js → validate-STUK2AGG.js} +2 -2
- package/docs/static-analysis-study.md +788 -0
- package/docs/typescript-traces.md +1 -1
- package/package.json +7 -1
package/dist/bin/sentinel.js
CHANGED
|
@@ -15,12 +15,10 @@ import {
|
|
|
15
15
|
palette,
|
|
16
16
|
registerAdapters,
|
|
17
17
|
resolve
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-AHA7LGGA.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveContext
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-O7REVMOC.js";
|
|
23
|
-
import "../chunk-QXFCZON7.js";
|
|
21
|
+
} from "../chunk-E3MYVYEZ.js";
|
|
24
22
|
import {
|
|
25
23
|
ensureWorkspacePrep,
|
|
26
24
|
findWorkspaceRoot,
|
|
@@ -28,6 +26,9 @@ import {
|
|
|
28
26
|
readOwnVersion,
|
|
29
27
|
readProjectPackageJson
|
|
30
28
|
} from "../chunk-KMKQDGI6.js";
|
|
29
|
+
import "../chunk-GJGZRXM3.js";
|
|
30
|
+
import "../chunk-O7REVMOC.js";
|
|
31
|
+
import "../chunk-QXFCZON7.js";
|
|
31
32
|
|
|
32
33
|
// bin/sentinel.ts
|
|
33
34
|
import { program } from "commander";
|
|
@@ -145,7 +146,7 @@ async function runValidate(ctx) {
|
|
|
145
146
|
);
|
|
146
147
|
}
|
|
147
148
|
if (!ctx.targets.includes("test")) return 1;
|
|
148
|
-
const { validateModuleTests } = await import("../validate-
|
|
149
|
+
const { validateModuleTests } = await import("../validate-STUK2AGG.js");
|
|
149
150
|
const outcomes = modules.flatMap(
|
|
150
151
|
(module) => validateModuleTests(module.name, module.root)
|
|
151
152
|
);
|
|
@@ -210,7 +211,8 @@ async function analyse(params) {
|
|
|
210
211
|
ci: params.ci,
|
|
211
212
|
fix: params.fix,
|
|
212
213
|
maxDiagnostics: params.maxDiagnostics,
|
|
213
|
-
toolArgs: params.toolArgs
|
|
214
|
+
toolArgs: params.toolArgs,
|
|
215
|
+
output: params.output
|
|
214
216
|
};
|
|
215
217
|
try {
|
|
216
218
|
let adoption;
|
|
@@ -485,6 +487,7 @@ async function runVerb(ctx) {
|
|
|
485
487
|
ci: ctx.ci,
|
|
486
488
|
fix: ctx.fix,
|
|
487
489
|
toolArgs: ctx.toolArgs,
|
|
490
|
+
output: ctx.output,
|
|
488
491
|
// Per-module progress is a HUMAN affordance: it tells someone staring at a slow sweep
|
|
489
492
|
// that it is alive. On this monorepo's 441 projects it is 441 lines that bury the four
|
|
490
493
|
// that matter, and it is pure noise in a captured log. So emit it only for an
|
|
@@ -599,6 +602,9 @@ program.name("sentinel").description("One CLI that guards code health: presets,
|
|
|
599
602
|
"--module <name>",
|
|
600
603
|
"from the workspace root: scope to one module (omit = all; inside a module dir, drop this)"
|
|
601
604
|
).option("--preset <name>", `the stack preset to apply (${PRESET_NAMES.join(", ")})`).option("--flavour <name>", "deprecated: use --preset").option("--runner <tool>", "override the default runner (e.g. eslint, biome)").option("--ci", "CI mode: from the root, only the affected modules; non-zero exit on failure").option("--fix", "auto-fix where applicable").option("--dry-run", "preview the changes without writing (--init)").option("--json", "machine-readable output, for every verb").option(
|
|
605
|
+
"--output <shape>",
|
|
606
|
+
"output shape for a role that writes reports (console, json, html); console by default"
|
|
607
|
+
).option(
|
|
602
608
|
"--max-diagnostics <n>",
|
|
603
609
|
"cap the diagnostics embedded per module in --report (0 = no cap)",
|
|
604
610
|
"100"
|
|
@@ -724,6 +730,9 @@ async function main() {
|
|
|
724
730
|
ci: Boolean(opts.ci),
|
|
725
731
|
fix: Boolean(opts.fix),
|
|
726
732
|
json: Boolean(opts.json),
|
|
733
|
+
// `--json` stays the engine-wide machine-readable flag, so it also selects the json shape for
|
|
734
|
+
// a role that writes reports: two ways to ask for the same thing would be a trap.
|
|
735
|
+
output: typeof opts.output === "string" ? opts.output : opts.json ? "json" : void 0,
|
|
727
736
|
dryRun: Boolean(opts.dryRun),
|
|
728
737
|
fail: (message) => program.error(message)
|
|
729
738
|
};
|