@produtype/core 1.21.0 → 1.21.1
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.
|
@@ -69,7 +69,21 @@ async function detectObservability(ctx) {
|
|
|
69
69
|
evidence.push({ type: 'dependency', value: d, claim: 'logging' });
|
|
70
70
|
for (const d of sentryDeps)
|
|
71
71
|
evidence.push({ type: 'dependency', value: d, claim: 'logging' });
|
|
72
|
-
|
|
72
|
+
/**
|
|
73
|
+
* An import path is not a route.
|
|
74
|
+
*
|
|
75
|
+
* `import Health from 'typings/Health';` is a TypeScript type in Radarr's frontend,
|
|
76
|
+
* and `/Health'` matches the route pattern exactly as `/health` in a URL does. It
|
|
77
|
+
* was the evidence behind Radarr's passing health check — a false pass, which is
|
|
78
|
+
* the direction that raises a score rather than lowering one.
|
|
79
|
+
*
|
|
80
|
+
* Imports are good evidence elsewhere and are left alone there; this is the search
|
|
81
|
+
* for a *route*, and a module specifier is never one. Filtered inside the search so
|
|
82
|
+
* that a frontend full of them cannot spend the budget before a real route is
|
|
83
|
+
* reached.
|
|
84
|
+
*/
|
|
85
|
+
const IMPORT_LINE = /^\s*(?:import\b|from\s+['"]|const\s+\{?[\w\s,}]*\}?\s*=\s*require\()/;
|
|
86
|
+
const hits = await (0, textSearch_1.searchInFiles)(ctx.root, ctx.files.source, [HEALTH_ROUTE, /x-request-id/i, /correlation-id/i, /error\s*handler/i, /RotatingFileHandler/i], 25, (match) => !IMPORT_LINE.test(match.snippet));
|
|
73
87
|
/**
|
|
74
88
|
* One search, three answers, so the claim is decided per hit rather than per search.
|
|
75
89
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@produtype/core",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"description": "Deterministic CLI and library that analyzes a web application repository and reports how far it is from production-ready for the kind of product it is meant to be.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|