@hublo/sentinel 1.4.3 → 1.5.0-alpha.10
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 +19 -8
- package/dist/{chunk-Z7L4FGKP.js → chunk-AMCGMLPS.js} +2 -2
- package/dist/{chunk-DYK6UEMO.js → chunk-FWGU7QLH.js} +869 -62
- package/dist/chunk-KH2DCVC6.js +142 -0
- package/dist/chunk-KH2DCVC6.js.map +1 -0
- package/dist/{chunk-TDNPPNGK.js → chunk-KLEXJFJ6.js} +36 -8
- package/dist/{chunk-KMKQDGI6.js → chunk-YQRDKWSH.js} +31 -2
- package/dist/chunk-YQRDKWSH.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 +57 -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/roles/test/setup/jest-parity.js +2 -2
- package/dist/roles/test/setup/workspace-entry.js +2 -2
- package/dist/{validate-3QMCX2HW.js → validate-AWWMBSH5.js} +2 -2
- package/docs/static-analysis-study.md +818 -0
- package/docs/typescript-traces.md +157 -5
- package/package.json +7 -1
- package/dist/chunk-KMKQDGI6.js.map +0 -1
- /package/dist/{chunk-Z7L4FGKP.js.map → chunk-AMCGMLPS.js.map} +0 -0
package/dist/bin/sentinel.js
CHANGED
|
@@ -15,19 +15,20 @@ import {
|
|
|
15
15
|
palette,
|
|
16
16
|
registerAdapters,
|
|
17
17
|
resolve
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-FWGU7QLH.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveContext
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-O7REVMOC.js";
|
|
23
|
-
import "../chunk-QXFCZON7.js";
|
|
21
|
+
} from "../chunk-KLEXJFJ6.js";
|
|
24
22
|
import {
|
|
25
23
|
ensureWorkspacePrep,
|
|
26
24
|
findWorkspaceRoot,
|
|
27
25
|
inspectWorkspacePrep,
|
|
28
26
|
readOwnVersion,
|
|
29
27
|
readProjectPackageJson
|
|
30
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-YQRDKWSH.js";
|
|
29
|
+
import "../chunk-KH2DCVC6.js";
|
|
30
|
+
import "../chunk-O7REVMOC.js";
|
|
31
|
+
import "../chunk-QXFCZON7.js";
|
|
31
32
|
|
|
32
33
|
// bin/sentinel.ts
|
|
33
34
|
import { program } from "commander";
|
|
@@ -118,7 +119,9 @@ sentinel (${type}): ${asMessage(error)}
|
|
|
118
119
|
dryRun: ctx.dryRun,
|
|
119
120
|
// Only when the FORMAT role actually adopted: a module still formatted by the root
|
|
120
121
|
// must not be excluded from it.
|
|
121
|
-
formattedModule: toRun.includes("format") ? module.root : void 0
|
|
122
|
+
formattedModule: toRun.includes("format") ? module.root : void 0,
|
|
123
|
+
// Same rule for the report directory: only when the STATIC ANALYSIS role adopted.
|
|
124
|
+
analysedModule: toRun.includes("static-analysis")
|
|
122
125
|
});
|
|
123
126
|
const prefix = ctx.dryRun ? " dry run: " : " ";
|
|
124
127
|
for (const change of changes) process.stderr.write(`${prefix}${change}
|
|
@@ -145,7 +148,7 @@ async function runValidate(ctx) {
|
|
|
145
148
|
);
|
|
146
149
|
}
|
|
147
150
|
if (!ctx.targets.includes("test")) return 1;
|
|
148
|
-
const { validateModuleTests } = await import("../validate-
|
|
151
|
+
const { validateModuleTests } = await import("../validate-AWWMBSH5.js");
|
|
149
152
|
const outcomes = modules.flatMap(
|
|
150
153
|
(module) => validateModuleTests(module.name, module.root)
|
|
151
154
|
);
|
|
@@ -210,7 +213,8 @@ async function analyse(params) {
|
|
|
210
213
|
ci: params.ci,
|
|
211
214
|
fix: params.fix,
|
|
212
215
|
maxDiagnostics: params.maxDiagnostics,
|
|
213
|
-
toolArgs: params.toolArgs
|
|
216
|
+
toolArgs: params.toolArgs,
|
|
217
|
+
output: params.output
|
|
214
218
|
};
|
|
215
219
|
try {
|
|
216
220
|
let adoption;
|
|
@@ -485,6 +489,7 @@ async function runVerb(ctx) {
|
|
|
485
489
|
ci: ctx.ci,
|
|
486
490
|
fix: ctx.fix,
|
|
487
491
|
toolArgs: ctx.toolArgs,
|
|
492
|
+
output: ctx.output,
|
|
488
493
|
// Per-module progress is a HUMAN affordance: it tells someone staring at a slow sweep
|
|
489
494
|
// that it is alive. On this monorepo's 441 projects it is 441 lines that bury the four
|
|
490
495
|
// that matter, and it is pure noise in a captured log. So emit it only for an
|
|
@@ -599,6 +604,9 @@ program.name("sentinel").description("One CLI that guards code health: presets,
|
|
|
599
604
|
"--module <name>",
|
|
600
605
|
"from the workspace root: scope to one module (omit = all; inside a module dir, drop this)"
|
|
601
606
|
).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(
|
|
607
|
+
"--output <shape>",
|
|
608
|
+
"output shape for a role that writes reports (console, json, html); console by default"
|
|
609
|
+
).option(
|
|
602
610
|
"--max-diagnostics <n>",
|
|
603
611
|
"cap the diagnostics embedded per module in --report (0 = no cap)",
|
|
604
612
|
"100"
|
|
@@ -724,6 +732,9 @@ async function main() {
|
|
|
724
732
|
ci: Boolean(opts.ci),
|
|
725
733
|
fix: Boolean(opts.fix),
|
|
726
734
|
json: Boolean(opts.json),
|
|
735
|
+
// `--json` stays the engine-wide machine-readable flag, so it also selects the json shape for
|
|
736
|
+
// a role that writes reports: two ways to ask for the same thing would be a trap.
|
|
737
|
+
output: typeof opts.output === "string" ? opts.output : opts.json ? "json" : void 0,
|
|
727
738
|
dryRun: Boolean(opts.dryRun),
|
|
728
739
|
fail: (message) => program.error(message)
|
|
729
740
|
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ELZHIN6E.js";
|
|
4
4
|
import {
|
|
5
5
|
findWorkspaceRoot
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YQRDKWSH.js";
|
|
7
7
|
|
|
8
8
|
// src/roles/test/setup/workspace.ts
|
|
9
9
|
function isMissingModule(error) {
|
|
@@ -60,4 +60,4 @@ export {
|
|
|
60
60
|
installWorkspaceSetup,
|
|
61
61
|
pinWorkspaceTimezone
|
|
62
62
|
};
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
63
|
+
//# sourceMappingURL=chunk-AMCGMLPS.js.map
|