@hublo/sentinel 1.5.0-alpha.32 → 1.5.0-alpha.34

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.
@@ -15,7 +15,7 @@ import {
15
15
  palette,
16
16
  registerAdapters,
17
17
  resolve
18
- } from "../chunk-LYTDSMUF.js";
18
+ } from "../chunk-LCQZGHYL.js";
19
19
  import {
20
20
  resolveContext
21
21
  } from "../chunk-ZFNBW6S3.js";
@@ -4824,7 +4824,17 @@ function findBuildOutput(cwd) {
4824
4824
  const builds = typeof pkg.scripts?.["build"] === "string" || pkg.nx?.targets?.["build"] !== void 0;
4825
4825
  const declaresOutputs = Array.isArray(pkg.nx?.targets?.["build"]?.["outputs"]);
4826
4826
  return {
4827
- reason: builds ? `this module declares a build and wrote no entry manifest, so ${declaresOutputs ? "build it before measuring" : "declare that build's outputs on its nx target the way apps/front/career does"}. A build target with no declared \`outputs\` is still cached, and on a cache hit nx reports the task successful, restores no file and leaves the directory empty, so every job that reads the build sees nothing. Measured on this monorepo: 5 of the 48 projects with a build target are in that state.` : "this module declares no build, so it writes no entry manifest and there is nothing to measure here. A component library and a back-end service are in that case by construction, and no action follows.",
4827
+ reason: builds ? (declaresOutputs ? "nothing is built here, so build this module before measuring" : "the build wrote no files here, so declare `outputs` on its nx build target as `apps/front/career` does") + /*
4828
+ * ⛔ Problem, then solution, in ONE sentence and under 120 characters. The sentence that
4829
+ * stood here ran 230 characters of nested clauses and a reader said what was wrong with
4830
+ * it: *"un developpeur a bcp de taches en parallele donc son cerveau est concis, precis,
4831
+ * probleme / solution tout court"*. One sentence because the recap prints only the first:
4832
+ * split in two, the comment would carry the problem and lose the fix.
4833
+ *
4834
+ * ⚠️ The mechanism belongs AFTER, where the page and the json carry it and the comment
4835
+ * does not. It is the explanation, and nobody acts on an explanation.
4836
+ */
4837
+ ". A build target with no declared `outputs` is still cached, and on a cache hit nx reports the task successful, restores no file and leaves the directory empty, so every job that reads the build sees nothing. Measured on this monorepo: 5 of the 48 projects with a build target are in that state, so the six bundle figures cannot be produced for any of them until they declare where their build writes." : "this module declares no build, so there is nothing to measure here. A component library and a back-end service are in that case by construction, and no action follows.",
4828
4838
  lookedIn
4829
4839
  };
4830
4840
  }
@@ -6084,15 +6094,22 @@ function renderMarkdown(report) {
6084
6094
  ...notes,
6085
6095
  "",
6086
6096
  ...families,
6087
- "> Measured on this branch and **not compared with `main`**. No figure here refuses anything.",
6088
- "> **ok**, **near** or **exceeds** is where a figure sits against a PUBLISHED reference; a",
6089
- "> figure with no verdict has none, which is a decision and not a gap. A file breaching several",
6090
- "> rules counts once per rule. The code behind every place, and the drawing of the import",
6091
- "> graph, are in the `static-analysis.html` the artifact carries.",
6092
- // ⭐ The version that produced these numbers, because the thresholds a module cannot override
6093
- // live in the tool: nine gauge limits, the complexity bands, the bundle budgets. Two recaps
6094
- // from two versions are not comparable, and without this nothing on the comment would say so.
6095
- ...version === void 0 ? [] : [`> Measured by sentinel ${version}.`],
6097
+ /*
6098
+ * ⛔ ONE line, and it used to be five.
6099
+ *
6100
+ * The reserve explained `ok`, `near` and `exceeds`, defended the absence of a verdict as "a
6101
+ * decision and not a gap", and restated a counting rule. Measured on a five-module pull
6102
+ * request: not one of the 150 figures carried a verdict, so most of it explained a notation
6103
+ * that appeared nowhere and argued with an objection the reader had not made. A reader's
6104
+ * verdict on it: *"on doit supprimer, laissons le message efficace le plus possible"*.
6105
+ *
6106
+ * ⚠️ What survives is the one clause that prevents a WRONG READING rather than defending a
6107
+ * choice: a figure in a pull-request comment is read as a delta by default, so a module
6108
+ * already at 6.81% would look like one this branch pushed there. Plus where the detail is,
6109
+ * and the version, because two recaps from two versions are not comparable and nothing else
6110
+ * on the comment would say so.
6111
+ */
6112
+ `<sub>Values on this branch, not a diff with \`main\`. Nothing here blocks the merge. The code behind every place, and the import graph, are in the \`static-analysis.html\` this run keeps as an artifact.${version === void 0 ? "" : ` Measured by sentinel ${version}.`}</sub>`,
6096
6113
  ""
6097
6114
  ].join("\n");
6098
6115
  }
@@ -6285,10 +6302,11 @@ function summaryParts(report, bold) {
6285
6302
  const findings = report.findings ?? [];
6286
6303
  const inTests = findings.filter((finding) => finding.metric === "clonesTests").length;
6287
6304
  const inProduct = findings.length - inTests;
6305
+ const thresholds = withReference.length === 0 ? [] : above === 0 ? [`${bold("No threshold exceeded")}: the measured levels are within the recommended norm`] : [`${bold(`${above} threshold${above === 1 ? "" : "s"} exceeded`)}`];
6288
6306
  return [
6289
- withReference.length === 0 ? "No figure here has a published reference" : `${bold(`${above} of ${withReference.length}`)} figures with a published reference are above it`,
6290
- `${bold(grouped(inProduct))} places in product code`,
6291
- ...inTests === 0 ? [] : [`${bold(grouped(inTests))} clones in tests`]
6307
+ ...thresholds,
6308
+ `${bold(grouped(inProduct))} place${inProduct === 1 ? "" : "s"} in product code`,
6309
+ ...inTests === 0 ? [] : [`${bold(grouped(inTests))} clone${inTests === 1 ? "" : "s"} in tests`]
6292
6310
  ];
6293
6311
  }
6294
6312
  function summaryLine(report) {
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  registerAdapters,
7
7
  resolve,
8
8
  setDefaultRunner
9
- } from "./chunk-LYTDSMUF.js";
9
+ } from "./chunk-LCQZGHYL.js";
10
10
  import {
11
11
  BaseAdapter
12
12
  } from "./chunk-ZFNBW6S3.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.5.0-alpha.32",
3
+ "version": "1.5.0-alpha.34",
4
4
  "description": "One CLI that guards code health across Hublo repos: shared lint/typescript/build/test presets, static & dynamic analysis, and architecture checks.",
5
5
  "type": "module",
6
6
  "license": "MIT",