@hublo/sentinel 1.7.0-alpha.21 → 1.7.0-alpha.23
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/README.md +0 -1
- package/dist/bin/sentinel.js +15 -16
- package/dist/{chunk-RI7R3S3T.js → chunk-426EFSK7.js} +7068 -6911
- package/dist/{chunk-J2RMARWP.js → chunk-4YQXLPJ5.js} +2 -2
- package/dist/{chunk-UVXXEAHU.js → chunk-7JTCUK77.js} +3 -3
- package/dist/{chunk-BBNABWZ6.js → chunk-CSZW7OMC.js} +8 -6
- package/dist/chunk-CSZW7OMC.js.map +1 -0
- package/dist/chunk-F5WISUN3.js +17 -0
- package/dist/chunk-F5WISUN3.js.map +1 -0
- package/dist/chunk-FY3P5QPH.js +15 -0
- package/dist/chunk-FY3P5QPH.js.map +1 -0
- package/dist/chunk-NE3IEJBN.js +59 -0
- package/dist/chunk-NE3IEJBN.js.map +1 -0
- package/dist/chunk-VWASE6NN.js +34 -0
- package/dist/chunk-VWASE6NN.js.map +1 -0
- package/dist/{chunk-XTBHIKFG.js → chunk-ZNANJEMK.js} +16 -30
- package/dist/chunk-ZNANJEMK.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -6
- package/dist/roles/runtime-analysis/config.d.ts +92 -0
- package/dist/roles/runtime-analysis/config.js +10 -0
- package/dist/roles/runtime-analysis/gateway.d.ts +2 -0
- package/dist/roles/runtime-analysis/gateway.js +82 -0
- package/dist/roles/runtime-analysis/gateway.js.map +1 -0
- package/dist/roles/runtime-analysis/mock-api.d.ts +2 -0
- package/dist/roles/runtime-analysis/mock-api.js +43 -0
- package/dist/roles/runtime-analysis/mock-api.js.map +1 -0
- package/dist/roles/static-analysis/config.js +1 -2
- package/dist/roles/test/setup/jest-parity.js +2 -2
- package/dist/roles/test/setup/workspace-entry.js +2 -2
- package/dist/{validate-YCTNTNFT.js → validate-GD63SP6M.js} +2 -2
- package/docs/static-analysis-study.md +10 -49
- package/docs/typescript-traces.md +2 -216
- package/package.json +9 -5
- package/runtime-analysis-deps/load.mjs +6 -0
- package/runtime-analysis-deps/package-lock.json +1766 -0
- package/runtime-analysis-deps/package.json +11 -0
- package/dist/chunk-BBNABWZ6.js.map +0 -1
- package/dist/chunk-PXTU5MPW.js +0 -9
- package/dist/chunk-PXTU5MPW.js.map +0 -1
- package/dist/chunk-XTBHIKFG.js.map +0 -1
- package/dist/chunk-XYOIXC6A.js +0 -126
- package/dist/chunk-XYOIXC6A.js.map +0 -1
- package/dist/roles/code-churn/config.d.ts +0 -92
- package/dist/roles/code-churn/config.js +0 -10
- package/docs/code-churn-adoption.md +0 -237
- /package/dist/{chunk-J2RMARWP.js.map → chunk-4YQXLPJ5.js.map} +0 -0
- /package/dist/roles/{code-churn → runtime-analysis}/config.js.map +0 -0
package/README.md
CHANGED
|
@@ -176,7 +176,6 @@ throwaway run wants. Once a module has adopted, nothing is fetched any more: the
|
|
|
176
176
|
- [`docs/typescript-adoption.md`](docs/typescript-adoption.md) — the adoption cheat sheet: the two adoption steps, the command model (verb x type x location), options, reading a report, and troubleshooting.
|
|
177
177
|
- [`docs/test-adoption.md`](docs/test-adoption.md) — migrating a module from jest to Vitest: the two steps, what the migration rewrites and what it refuses BY NAME, how the baseline gate proves nothing was lost, and the failures worth recognising.
|
|
178
178
|
- [`docs/static-analysis-adoption.md`](docs/static-analysis-adoption.md) — running the static analysis role on a module: the two steps, the four output shapes, how to read each row and where its threshold comes from, declaring an entry point, and the two limits worth knowing before trusting a number.
|
|
179
|
-
- [`docs/code-churn-adoption.md`](docs/code-churn-adoption.md) — the code churn role: the share of a module's new lines rewritten or deleted within 21 days, read from main's git history; adopting it, what it reads, how to read the figure, what it does not say, and how it was validated against `git blame`.
|
|
180
179
|
- [`docs/env-adoption.md`](docs/env-adoption.md) — checking a whole repository's env files, contracts and Dockerfiles from its root: the ten rules and which block, the three levels of `SENTINEL_ENV_LEVEL`, the optional `env.config.mjs`, and what changed from the monorepo's `tools/repo-env`.
|
|
181
180
|
- [`docs/typescript-traces.md`](docs/typescript-traces.md) — a **generated, versioned** reference of live command + output traces (every verb, option, config result and edge case) against the mock monorepo. Regenerate after CLI changes with `pnpm docs:traces`.
|
|
182
181
|
|
package/dist/bin/sentinel.js
CHANGED
|
@@ -12,18 +12,20 @@ import {
|
|
|
12
12
|
presetNotInstalledYet,
|
|
13
13
|
registerAdapters,
|
|
14
14
|
resolve
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-426EFSK7.js";
|
|
16
|
+
import "../chunk-NE3IEJBN.js";
|
|
17
|
+
import "../chunk-VWASE6NN.js";
|
|
16
18
|
import {
|
|
17
19
|
resolveContext,
|
|
18
20
|
separateToolArgs
|
|
19
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-7JTCUK77.js";
|
|
20
22
|
import {
|
|
21
23
|
ensureWorkspacePrep,
|
|
22
24
|
findWorkspaceRoot,
|
|
23
25
|
inspectWorkspacePrep,
|
|
24
26
|
readOwnVersion,
|
|
25
27
|
readProjectPackageJson
|
|
26
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-ZNANJEMK.js";
|
|
27
29
|
import {
|
|
28
30
|
DEFAULT_ENV_LEVEL,
|
|
29
31
|
ENV_LEVELS,
|
|
@@ -34,9 +36,9 @@ import {
|
|
|
34
36
|
SWEEPABLE_TARGETS,
|
|
35
37
|
TARGETS,
|
|
36
38
|
VERBS
|
|
37
|
-
} from "../chunk-
|
|
38
|
-
import "../chunk-
|
|
39
|
-
import "../chunk-
|
|
39
|
+
} from "../chunk-CSZW7OMC.js";
|
|
40
|
+
import "../chunk-FY3P5QPH.js";
|
|
41
|
+
import "../chunk-F5WISUN3.js";
|
|
40
42
|
import "../chunk-4EIY7TTR.js";
|
|
41
43
|
import "../chunk-O7REVMOC.js";
|
|
42
44
|
import "../chunk-QXFCZON7.js";
|
|
@@ -550,8 +552,8 @@ sentinel (${type}): ${asMessage(error)}
|
|
|
550
552
|
// Only when the FORMAT role actually adopted: a module still formatted by the root
|
|
551
553
|
// must not be excluded from it.
|
|
552
554
|
formattedModule: toRun.includes("format") ? module.root : void 0,
|
|
553
|
-
// Same rule for the report
|
|
554
|
-
|
|
555
|
+
// Same rule for the report directory: only when the STATIC ANALYSIS role adopted.
|
|
556
|
+
analysedModule: toRun.includes("static-analysis")
|
|
555
557
|
});
|
|
556
558
|
workspace = changes;
|
|
557
559
|
const prefix = ctx.dryRun ? " dry run: " : " ";
|
|
@@ -604,7 +606,7 @@ async function runValidate(ctx) {
|
|
|
604
606
|
);
|
|
605
607
|
}
|
|
606
608
|
if (!ctx.targets.includes("test")) return 1;
|
|
607
|
-
const { validateModuleTests } = await import("../validate-
|
|
609
|
+
const { validateModuleTests } = await import("../validate-GD63SP6M.js");
|
|
608
610
|
const outcomes = modules.flatMap(
|
|
609
611
|
(module) => validateModuleTests(module.name, module.root)
|
|
610
612
|
);
|
|
@@ -937,7 +939,6 @@ var TARGET_HELP = {
|
|
|
937
939
|
dev: "dev server (long-running: never swept by an unqualified --run)",
|
|
938
940
|
test: "tests",
|
|
939
941
|
"static-analysis": "duplication, dead code, complexity, import graph, file size, bundle weight",
|
|
940
|
-
"code-churn": "the share of new lines rewritten or deleted within weeks, read from git history",
|
|
941
942
|
env: "env files, contracts and Dockerfiles, for the whole repository (run from its root)",
|
|
942
943
|
"runtime-analysis": "Lighthouse, web vitals",
|
|
943
944
|
arch: "architecture boundaries"
|
|
@@ -1120,12 +1121,10 @@ function parseEnvLevel(value) {
|
|
|
1120
1121
|
var envLevel = targets.some((target) => REPOSITORY_TARGETS.includes(target)) ? parseEnvLevel(process.env.SENTINEL_ENV_LEVEL) : DEFAULT_ENV_LEVEL;
|
|
1121
1122
|
var githubActions = process.env.GITHUB_ACTIONS === "true";
|
|
1122
1123
|
var targetsExplicit = !(opts.all || namedTargets.length === 0);
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
);
|
|
1128
|
-
}
|
|
1124
|
+
if (namedTargets.includes("static-analysis") && (verb === "report" || verb === "run" && opts.json)) {
|
|
1125
|
+
program.error(
|
|
1126
|
+
`sentinel: --static-analysis writes its own report, so ${verb === "report" ? "--report" : "--json"} has nothing to add to it. Run it bare for the console report, or with --output json|html|markdown for the files.`
|
|
1127
|
+
);
|
|
1129
1128
|
}
|
|
1130
1129
|
var maxDiagnostics = Number(opts.maxDiagnostics);
|
|
1131
1130
|
if (!Number.isInteger(maxDiagnostics) || maxDiagnostics < 0) {
|