@hublo/sentinel 1.7.0-alpha.36 → 1.7.0-alpha.38
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 +1 -0
- package/dist/bin/sentinel.js +35 -10
- package/dist/{chunk-2PRJJRJI.js → chunk-E3FWHZ65.js} +3 -2
- package/dist/chunk-F5WISUN3.js +17 -0
- package/dist/chunk-F5WISUN3.js.map +1 -0
- package/dist/{chunk-YUZB4LRJ.js → chunk-KKHKRY7P.js} +6 -1
- package/dist/chunk-KKHKRY7P.js.map +1 -0
- package/dist/chunk-NE3IEJBN.js +59 -0
- package/dist/chunk-NE3IEJBN.js.map +1 -0
- package/dist/{chunk-5KNSTZ7F.js → chunk-NYNS4TLN.js} +11 -1
- package/dist/chunk-NYNS4TLN.js.map +1 -0
- package/dist/{chunk-TMVKYXZ3.js → chunk-QJCZ2EDV.js} +1 -1
- package/dist/chunk-QJCZ2EDV.js.map +1 -0
- package/dist/{chunk-LVY5NPOC.js → chunk-QMIJ4ZGJ.js} +2 -2
- package/dist/{chunk-OCTWLMUW.js → chunk-QWZ63CDX.js} +6863 -3066
- package/dist/chunk-U7G2Y6YC.js +15 -0
- package/dist/chunk-U7G2Y6YC.js.map +1 -0
- package/dist/chunk-VWASE6NN.js +34 -0
- package/dist/chunk-VWASE6NN.js.map +1 -0
- package/dist/{chunk-APBEGLRI.js → chunk-YOFCDKTI.js} +18 -4
- package/dist/chunk-YOFCDKTI.js.map +1 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +10 -6
- package/dist/roles/arch/config.d.ts +8 -2
- package/dist/roles/arch/config.js +1 -1
- package/dist/roles/runtime-analysis/config.d.ts +97 -0
- package/dist/roles/runtime-analysis/config.js +10 -0
- package/dist/roles/runtime-analysis/config.js.map +1 -0
- package/dist/roles/runtime-analysis/gateway.d.ts +2 -0
- package/dist/roles/runtime-analysis/gateway.js +89 -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/sql/config.d.ts +25 -0
- package/dist/roles/sql/config.js +1 -1
- package/dist/roles/static-analysis/config.d.ts +1 -0
- package/dist/roles/static-analysis/config.js +1 -1
- package/dist/roles/test/setup/jest-parity.js +2 -2
- package/dist/roles/test/setup/workspace-entry.js +2 -2
- package/dist/{validate-4GMB32V7.js → validate-UENGAIDH.js} +2 -2
- package/docs/arch-adoption.md +24 -9
- package/docs/env-adoption.md +35 -6
- package/docs/runtime-analysis-adoption.md +198 -0
- package/docs/sql-adoption.md +135 -11
- package/docs/static-analysis-adoption.md +4 -2
- package/docs/typescript-traces.md +77 -11
- package/lint/react.json +1 -0
- package/package.json +10 -2
- 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-5KNSTZ7F.js.map +0 -1
- package/dist/chunk-APBEGLRI.js.map +0 -1
- package/dist/chunk-TMVKYXZ3.js.map +0 -1
- package/dist/chunk-YUZB4LRJ.js.map +0 -1
- /package/dist/{chunk-LVY5NPOC.js.map → chunk-QMIJ4ZGJ.js.map} +0 -0
|
@@ -223,7 +223,9 @@ The **import graph** is explorable. Point at a dot for its path, which the brows
|
|
|
223
223
|
|
|
224
224
|
`--output markdown` writes `static-analysis-report/static-analysis.md`: one table, one row per family, the headline figure and how many places that family holds. It is what a workflow posts as a comment, one section per affected module.
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
**It compares with the merge base.** Each place (a clone, a dead file, a cycle) is compared by what it is, not by its line numbers: what the branch added, what it removed, and how many were already there. A module already at 6.81% is not read as one this branch pushed there.
|
|
227
|
+
|
|
228
|
+
**A new import cycle can fail the run.** `graph.newCycles` decides: `warn` (the default until January) reports a cycle the branch adds, `error` fails the run on it. A cycle already on `main` never fails it. A module raises it in its config, `overrides: { graph: { newCycles: 'error' } }`; anything but `warn` or `error`, `off` included, is refused and read as `warn`.
|
|
227
229
|
|
|
228
230
|
⚠️ `static-analysis-report/` is generated, and **`--init` ignores it for you**: it writes one line into your repository's root `.gitignore`, unanchored so it matches at every depth, rather than one line in every adopting module's own file. It checks first, in any spelling, so adopting a second module adds nothing. You have nothing to do and nothing to commit beyond that line.
|
|
229
231
|
|
|
@@ -279,7 +281,7 @@ Absent with its reason, rather than a figure that is wrong by half.
|
|
|
279
281
|
|
|
280
282
|
## What the role will not do
|
|
281
283
|
|
|
282
|
-
- **It will not fail your build.** No threshold here refuses anything, by design
|
|
284
|
+
- **It will not fail your build on a figure.** No threshold here refuses anything, by design. The non-zero exits are an unknown `--output` value, a tool that could not be run at all, and one finding: a new import cycle at `graph.newCycles: error`, the one deterministic rule that blocks what a pull request adds.
|
|
283
285
|
- **It will not read your module's `.oxlintrc.json`.** The size gauge writes its own config to a temporary directory, so its scale is the same in every module. A gauge whose scale moves per module compares nothing.
|
|
284
286
|
- **It will not look outside the module**, except for the one measurement that cannot be answered inside it: a library's reachability.
|
|
285
287
|
- **It will not measure your tests.** Specs, fixtures, mocks, stories and generated files are out of every product figure. Duplication reports the test suite separately, on its own two rows, because that one is worth seeing and must not be blended into the product number.
|
|
@@ -241,9 +241,7 @@ $ sentinel --report --json 2>/dev/null
|
|
|
241
241
|
"code-churn",
|
|
242
242
|
"arch"
|
|
243
243
|
],
|
|
244
|
-
"skipped": [
|
|
245
|
-
"runtime-analysis"
|
|
246
|
-
],
|
|
244
|
+
"skipped": [],
|
|
247
245
|
"results": [
|
|
248
246
|
{
|
|
249
247
|
"project": "svelte-app",
|
|
@@ -781,9 +779,7 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
781
779
|
"code-churn",
|
|
782
780
|
"arch"
|
|
783
781
|
],
|
|
784
|
-
"skipped": [
|
|
785
|
-
"runtime-analysis"
|
|
786
|
-
],
|
|
782
|
+
"skipped": [],
|
|
787
783
|
"results": [
|
|
788
784
|
{
|
|
789
785
|
"project": "svelte-app",
|
|
@@ -1602,6 +1598,7 @@ $ sentinel --init --dry-run
|
|
|
1602
1598
|
+ // deadCode.minConfidence 60
|
|
1603
1599
|
+ // deadCode.categories unused-file, unused-export, unused-symbol, unused-import
|
|
1604
1600
|
+ // graph.resolution 1
|
|
1601
|
+
+ // graph.newCycles warn
|
|
1605
1602
|
+ //
|
|
1606
1603
|
+ // A list shown as a count is not copyable, and replacing one means writing back what you keep,
|
|
1607
1604
|
+ // so read the values in full with:
|
|
@@ -1777,6 +1774,7 @@ $ sentinel --init --dry-run
|
|
|
1777
1774
|
+ }
|
|
1778
1775
|
+ }
|
|
1779
1776
|
dry run: the lint autofix runs on adoption and can rewrite source, as moving to another linter does; add --rehearse to name the files (it runs the pass in a throwaway copy, as long as the real one)
|
|
1777
|
+
dry run: adoption also measures the existing lint violations, which can rewrite .oxlintrc.baseline.json; --rehearse names it when it would change
|
|
1780
1778
|
dry run: the format autofix runs on adoption and can rewrite source, as moving to another formatter does; add --rehearse to name the files (it runs the pass in a throwaway copy, as long as the real one)
|
|
1781
1779
|
dry run: would ignore static-analysis-report/ in the root .gitignore
|
|
1782
1780
|
dry run: would ignore sql-report/ in the root .gitignore
|
|
@@ -1900,6 +1898,7 @@ $ sentinel --init --dry-run --rehearse
|
|
|
1900
1898
|
+ // deadCode.minConfidence 60
|
|
1901
1899
|
+ // deadCode.categories unused-file, unused-export, unused-symbol, unused-import
|
|
1902
1900
|
+ // graph.resolution 1
|
|
1901
|
+
+ // graph.newCycles warn
|
|
1903
1902
|
+ //
|
|
1904
1903
|
+ // A list shown as a count is not copyable, and replacing one means writing back what you keep,
|
|
1905
1904
|
+ // so read the values in full with:
|
|
@@ -2122,6 +2121,7 @@ $ sentinel --run --env
|
|
|
2122
2121
|
env (level warning: report, and annotate in GitHub Actions; never fails)
|
|
2123
2122
|
2 env file(s), 0 contract(s), 0 required and 0 optional variable(s) read, 1 Dockerfile(s), node 10.15.3
|
|
2124
2123
|
settings: sentinel defaults (no env.config.mjs)
|
|
2124
|
+
compared with origin/main at 90d0ae1: only what this branch adds is listed
|
|
2125
2125
|
|
|
2126
2126
|
✗ [committed-env-file] rule 2, blocking, 2
|
|
2127
2127
|
a real env file is committed: remove it from git (only .example contracts belong there; values come from a secret store)
|
|
@@ -2145,7 +2145,7 @@ env (level warning: report, and annotate in GitHub Actions; never fails)
|
|
|
2145
2145
|
note: no required reader call found (getOrFail, requireEnv, requireEnvVariable): rule 1 had nothing to check; name the repository's own helper in readers.required
|
|
2146
2146
|
note: not an nx workspace (no nx.json): rule 8 skipped
|
|
2147
2147
|
|
|
2148
|
-
5 blocking findings: reported, not failing
|
|
2148
|
+
5 blocking findings added: reported, not failing
|
|
2149
2149
|
✓ serviceapp (repository) env — level=warning blocking=5
|
|
2150
2150
|
1 repository [serviceapp] in <n>ms
|
|
2151
2151
|
# exit: 0
|
|
@@ -2155,9 +2155,10 @@ env (level warning: report, and annotate in GitHub Actions; never fails)
|
|
|
2155
2155
|
|
|
2156
2156
|
```console
|
|
2157
2157
|
$ sentinel --run --env
|
|
2158
|
-
env (level error: fails on a blocking finding (rules 1, 2, 6, 7 to 10))
|
|
2158
|
+
env (level error: fails on a blocking finding this branch adds (rules 1, 2, 6, 7 to 10))
|
|
2159
2159
|
2 env file(s), 0 contract(s), 0 required and 0 optional variable(s) read, 1 Dockerfile(s), node 10.15.3
|
|
2160
2160
|
settings: sentinel defaults (no env.config.mjs)
|
|
2161
|
+
compared with origin/main at 90d0ae1: only what this branch adds is listed
|
|
2161
2162
|
|
|
2162
2163
|
✗ [committed-env-file] rule 2, blocking, 2
|
|
2163
2164
|
a real env file is committed: remove it from git (only .example contracts belong there; values come from a secret store)
|
|
@@ -2181,7 +2182,7 @@ env (level error: fails on a blocking finding (rules 1, 2, 6, 7 to 10))
|
|
|
2181
2182
|
note: no required reader call found (getOrFail, requireEnv, requireEnvVariable): rule 1 had nothing to check; name the repository's own helper in readers.required
|
|
2182
2183
|
note: not an nx workspace (no nx.json): rule 8 skipped
|
|
2183
2184
|
|
|
2184
|
-
5 blocking findings: failing
|
|
2185
|
+
5 blocking findings added: failing
|
|
2185
2186
|
✗ serviceapp (repository) env — level=error blocking=5
|
|
2186
2187
|
1 repository [serviceapp] in <n>ms
|
|
2187
2188
|
# exit: 1
|
|
@@ -2194,6 +2195,7 @@ $ sentinel --run --env
|
|
|
2194
2195
|
env (level warning: report, and annotate in GitHub Actions; never fails)
|
|
2195
2196
|
2 env file(s), 0 contract(s), 0 required and 0 optional variable(s) read, 1 Dockerfile(s), node 10.15.3
|
|
2196
2197
|
settings: sentinel defaults (no env.config.mjs)
|
|
2198
|
+
compared with origin/main at 90d0ae1: only what this branch adds is listed
|
|
2197
2199
|
|
|
2198
2200
|
✗ [committed-env-file] rule 2, blocking, 2
|
|
2199
2201
|
a real env file is committed: remove it from git (only .example contracts belong there; values come from a secret store)
|
|
@@ -2217,7 +2219,7 @@ env (level warning: report, and annotate in GitHub Actions; never fails)
|
|
|
2217
2219
|
note: no required reader call found (getOrFail, requireEnv, requireEnvVariable): rule 1 had nothing to check; name the repository's own helper in readers.required
|
|
2218
2220
|
note: not an nx workspace (no nx.json): rule 8 skipped
|
|
2219
2221
|
|
|
2220
|
-
5 blocking findings: reported, not failing
|
|
2222
|
+
5 blocking findings added: reported, not failing
|
|
2221
2223
|
::warning file=variables/dev.variables.env,title=env rule 2%3A committed-env-file::variables/dev.variables.env: a real env file is committed: remove it from git (only .example contracts belong there; values come from a secret store)
|
|
2222
2224
|
::warning file=variables/production.variables.env,title=env rule 2%3A committed-env-file::variables/production.variables.env: a real env file is committed: remove it from git (only .example contracts belong there; values come from a secret store)
|
|
2223
2225
|
::warning file=variables/dev.variables.env,line=2,title=env rule 5%3A public-secret-to-review::REACT_APP_SEGMENT_API_KEY_ADMINS: a public-prefixed, secret-named variable carries a committed value: it ships to the browser by design, confirm it is genuinely public
|
|
@@ -2248,7 +2250,7 @@ $ sentinel --run --env --json 2>/dev/null
|
|
|
2248
2250
|
"ok": true,
|
|
2249
2251
|
"status": "ok",
|
|
2250
2252
|
"level": "warning",
|
|
2251
|
-
"verdict": "5 blocking findings: reported, not failing",
|
|
2253
|
+
"verdict": "5 blocking findings added: reported, not failing",
|
|
2252
2254
|
"blocking": 5,
|
|
2253
2255
|
"config": null,
|
|
2254
2256
|
"scanned": [
|
|
@@ -2323,6 +2325,70 @@ $ sentinel --run --env --json 2>/dev/null
|
|
|
2323
2325
|
"line": 8
|
|
2324
2326
|
}
|
|
2325
2327
|
],
|
|
2328
|
+
"comparison": {
|
|
2329
|
+
"base": {
|
|
2330
|
+
"ref": "origin/main",
|
|
2331
|
+
"commit": "90d0ae1"
|
|
2332
|
+
},
|
|
2333
|
+
"added": [
|
|
2334
|
+
{
|
|
2335
|
+
"rule": "committed-env-file",
|
|
2336
|
+
"number": 2,
|
|
2337
|
+
"severity": "blocking",
|
|
2338
|
+
"name": "variables/dev.variables.env",
|
|
2339
|
+
"file": "variables/dev.variables.env"
|
|
2340
|
+
},
|
|
2341
|
+
{
|
|
2342
|
+
"rule": "committed-env-file",
|
|
2343
|
+
"number": 2,
|
|
2344
|
+
"severity": "blocking",
|
|
2345
|
+
"name": "variables/production.variables.env",
|
|
2346
|
+
"file": "variables/production.variables.env"
|
|
2347
|
+
},
|
|
2348
|
+
{
|
|
2349
|
+
"rule": "public-secret-to-review",
|
|
2350
|
+
"number": 5,
|
|
2351
|
+
"severity": "advisory",
|
|
2352
|
+
"name": "REACT_APP_SEGMENT_API_KEY_ADMINS",
|
|
2353
|
+
"file": "variables/dev.variables.env",
|
|
2354
|
+
"line": 2
|
|
2355
|
+
},
|
|
2356
|
+
{
|
|
2357
|
+
"rule": "public-secret-to-review",
|
|
2358
|
+
"number": 5,
|
|
2359
|
+
"severity": "advisory",
|
|
2360
|
+
"name": "REACT_APP_SEGMENT_API_KEY_ADMINS",
|
|
2361
|
+
"file": "variables/production.variables.env",
|
|
2362
|
+
"line": 2
|
|
2363
|
+
},
|
|
2364
|
+
{
|
|
2365
|
+
"rule": "secret-not-blanked",
|
|
2366
|
+
"number": 6,
|
|
2367
|
+
"severity": "blocking",
|
|
2368
|
+
"name": "DPAE_PASSWORD",
|
|
2369
|
+
"file": "variables/dev.variables.env",
|
|
2370
|
+
"line": 1
|
|
2371
|
+
},
|
|
2372
|
+
{
|
|
2373
|
+
"rule": "secret-not-blanked",
|
|
2374
|
+
"number": 6,
|
|
2375
|
+
"severity": "blocking",
|
|
2376
|
+
"name": "DPAE_PASSWORD",
|
|
2377
|
+
"file": "variables/production.variables.env",
|
|
2378
|
+
"line": 1
|
|
2379
|
+
},
|
|
2380
|
+
{
|
|
2381
|
+
"rule": "copy-not-owned",
|
|
2382
|
+
"number": 10,
|
|
2383
|
+
"severity": "blocking",
|
|
2384
|
+
"name": "COPY --from=build /home/node/app .",
|
|
2385
|
+
"file": "Dockerfile",
|
|
2386
|
+
"line": 8
|
|
2387
|
+
}
|
|
2388
|
+
],
|
|
2389
|
+
"fixed": [],
|
|
2390
|
+
"known": 0
|
|
2391
|
+
},
|
|
2326
2392
|
"inventory": {
|
|
2327
2393
|
"required": [],
|
|
2328
2394
|
"optional": [],
|
package/lint/react.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hublo/sentinel",
|
|
3
|
-
"version": "1.7.0-alpha.
|
|
3
|
+
"version": "1.7.0-alpha.38",
|
|
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",
|
|
@@ -66,6 +66,10 @@
|
|
|
66
66
|
"types": "./dist/roles/code-churn/config.d.ts",
|
|
67
67
|
"import": "./dist/roles/code-churn/config.js"
|
|
68
68
|
},
|
|
69
|
+
"./runtime-analysis": {
|
|
70
|
+
"types": "./dist/roles/runtime-analysis/config.d.ts",
|
|
71
|
+
"import": "./dist/roles/runtime-analysis/config.js"
|
|
72
|
+
},
|
|
69
73
|
"./env": {
|
|
70
74
|
"types": "./dist/roles/env/config.d.ts",
|
|
71
75
|
"import": "./dist/roles/env/config.js"
|
|
@@ -125,7 +129,8 @@
|
|
|
125
129
|
"docs",
|
|
126
130
|
"lint",
|
|
127
131
|
"oxlint",
|
|
128
|
-
"plugins"
|
|
132
|
+
"plugins",
|
|
133
|
+
"runtime-analysis-deps"
|
|
129
134
|
],
|
|
130
135
|
"scripts": {
|
|
131
136
|
"build": "tsup && tsx scripts/build-presets.ts",
|
|
@@ -197,7 +202,10 @@
|
|
|
197
202
|
"@hublo/sentinel": "link:.",
|
|
198
203
|
"@types/node": "^24.19.2",
|
|
199
204
|
"@types/picomatch": "4.0.3",
|
|
205
|
+
"lighthouse": "13.6.0",
|
|
200
206
|
"nx": "^23.1.0",
|
|
207
|
+
"playwright-core": "1.64.1",
|
|
208
|
+
"puppeteer-core": "25.16.0",
|
|
201
209
|
"tsup": "^8.3.0",
|
|
202
210
|
"tsx": "^4.19.0"
|
|
203
211
|
},
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Imported by file path from sentinel's cache: the bare names below resolve to the node_modules
|
|
2
|
+
// installed next to this file, never to the workspace's.
|
|
3
|
+
export { startFlow } from 'lighthouse'
|
|
4
|
+
export { default as desktopConfig } from 'lighthouse/core/config/desktop-config.js'
|
|
5
|
+
export { chromium } from 'playwright-core'
|
|
6
|
+
export { default as puppeteer } from 'puppeteer-core'
|