@opensip-cli/fitness 0.1.14 โ 0.1.15
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
CHANGED
|
@@ -25,8 +25,8 @@ This package is published for the CLI and advanced plugin authors; most users sh
|
|
|
25
25
|
## Documentation
|
|
26
26
|
|
|
27
27
|
- ๐ Project docs: https://opensip.ai/docs/opensip-cli/
|
|
28
|
-
- ๐งญ Package catalog (what every package does): https://github.com/opensip-ai/opensip-cli/blob/v0.1.
|
|
29
|
-
- ๐ฆ Source: https://github.com/opensip-ai/opensip-cli/tree/v0.1.
|
|
28
|
+
- ๐งญ Package catalog (what every package does): https://github.com/opensip-ai/opensip-cli/blob/v0.1.15/docs/public/70-reference/02-package-catalog.md
|
|
29
|
+
- ๐ฆ Source: https://github.com/opensip-ai/opensip-cli/tree/v0.1.15/packages/fitness/engine
|
|
30
30
|
|
|
31
31
|
## License
|
|
32
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-compare-render.d.ts","sourceRoot":"","sources":["../../../src/cli/fit/gate-compare-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"gate-compare-render.d.ts","sourceRoot":"","sources":["../../../src/cli/fit/gate-compare-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAKzE"}
|
|
@@ -7,81 +7,12 @@
|
|
|
7
7
|
* type changed (`GateViolation` โ `Signal`), and `Signal` carries the same
|
|
8
8
|
* `ruleId`/`filePath`/`line`/`message` fields the old renderer read.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
if (!s.filePath)
|
|
12
|
-
return '(no location)';
|
|
13
|
-
return s.line == null ? s.filePath : `${s.filePath}:${s.line}`;
|
|
14
|
-
}
|
|
15
|
-
function sortSignals(signals) {
|
|
16
|
-
return [...signals].sort((a, b) => {
|
|
17
|
-
if (a.ruleId !== b.ruleId)
|
|
18
|
-
return a.ruleId.localeCompare(b.ruleId);
|
|
19
|
-
if (a.filePath !== b.filePath)
|
|
20
|
-
return a.filePath.localeCompare(b.filePath);
|
|
21
|
-
return (a.line ?? 0) - (b.line ?? 0);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function truncate(s, max) {
|
|
25
|
-
if (s.length <= max)
|
|
26
|
-
return s;
|
|
27
|
-
return s.slice(0, max - 1) + 'โฆ';
|
|
28
|
-
}
|
|
29
|
-
/** `Added (n):` block โ each entry plus its (truncated) message line. */
|
|
30
|
-
function renderAdded(added) {
|
|
31
|
-
if (added.length === 0)
|
|
32
|
-
return [];
|
|
33
|
-
const lines = [`Added (${added.length}):`];
|
|
34
|
-
for (const v of sortSignals(added)) {
|
|
35
|
-
lines.push(` โ ${v.ruleId.padEnd(40)} ${formatLocation(v)}`);
|
|
36
|
-
if (v.message && v.message !== v.ruleId)
|
|
37
|
-
lines.push(` ${truncate(v.message, 120)}`);
|
|
38
|
-
}
|
|
39
|
-
lines.push('');
|
|
40
|
-
return lines;
|
|
41
|
-
}
|
|
42
|
-
/** `Resolved (n):` block. */
|
|
43
|
-
function renderResolved(resolved) {
|
|
44
|
-
if (resolved.length === 0)
|
|
45
|
-
return [];
|
|
46
|
-
const lines = [`Resolved (${resolved.length}):`];
|
|
47
|
-
for (const v of sortSignals(resolved))
|
|
48
|
-
lines.push(` โ ${v.ruleId.padEnd(40)} ${formatLocation(v)}`);
|
|
49
|
-
lines.push('');
|
|
50
|
-
return lines;
|
|
51
|
-
}
|
|
52
|
-
/** `Unchanged (n):` block โ truncated to the first 5 (usually long, not actionable). */
|
|
53
|
-
function renderUnchanged(unchanged) {
|
|
54
|
-
if (unchanged.length === 0)
|
|
55
|
-
return [];
|
|
56
|
-
const lines = [`Unchanged (${unchanged.length}):`];
|
|
57
|
-
const sample = sortSignals(unchanged).slice(0, 5);
|
|
58
|
-
for (const v of sample)
|
|
59
|
-
lines.push(` ยท ${v.ruleId.padEnd(40)} ${formatLocation(v)}`);
|
|
60
|
-
if (unchanged.length > sample.length) {
|
|
61
|
-
lines.push(` ยท ... and ${unchanged.length - sample.length} more`);
|
|
62
|
-
}
|
|
63
|
-
lines.push('');
|
|
64
|
-
return lines;
|
|
65
|
-
}
|
|
66
|
-
/** The verdict footer (`DEGRADED` / `IMPROVED` / `STABLE`). */
|
|
67
|
-
function renderVerdict(result) {
|
|
68
|
-
if (result.degraded) {
|
|
69
|
-
return `โ DEGRADED โ ${result.added.length} new violation${result.added.length === 1 ? '' : 's'}`;
|
|
70
|
-
}
|
|
71
|
-
if (result.resolved.length > 0) {
|
|
72
|
-
return `โ IMPROVED โ ${result.resolved.length} violation${result.resolved.length === 1 ? '' : 's'} resolved, none added`;
|
|
73
|
-
}
|
|
74
|
-
return `โ STABLE โ no change`;
|
|
75
|
-
}
|
|
10
|
+
import { renderGateCompareLines } from '@opensip-cli/core';
|
|
76
11
|
/** Render fit's gate-compare report. Byte-preserved from the old gate.ts renderer. */
|
|
77
12
|
export function renderGateCompareOutput(result) {
|
|
78
|
-
return
|
|
79
|
-
'opensip gate compare',
|
|
80
|
-
'',
|
|
81
|
-
|
|
82
|
-
...renderResolved(result.resolved),
|
|
83
|
-
...renderUnchanged(result.unchanged),
|
|
84
|
-
renderVerdict(result),
|
|
85
|
-
].join('\n');
|
|
13
|
+
return renderGateCompareLines(result, {
|
|
14
|
+
title: 'opensip gate compare',
|
|
15
|
+
singularNoun: 'violation',
|
|
16
|
+
}).join('\n');
|
|
86
17
|
}
|
|
87
18
|
//# sourceMappingURL=gate-compare-render.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-compare-render.js","sourceRoot":"","sources":["../../../src/cli/fit/gate-compare-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"gate-compare-render.js","sourceRoot":"","sources":["../../../src/cli/fit/gate-compare-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAI3D,sFAAsF;AACtF,MAAM,UAAU,uBAAuB,CAAC,MAAyB;IAC/D,OAAO,sBAAsB,CAAC,MAAM,EAAE;QACpC,KAAK,EAAE,sBAAsB;QAC7B,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -52,6 +52,9 @@ export declare const SignalersConfigSchema: z.ZodObject<{
|
|
|
52
52
|
sync: z.ZodOptional<z.ZodBoolean>;
|
|
53
53
|
endpoint: z.ZodOptional<z.ZodString>;
|
|
54
54
|
}, z.core.$strip>>;
|
|
55
|
+
artifacts: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
keep: z.ZodDefault<z.ZodNumber>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
55
58
|
}, z.core.$strip>>;
|
|
56
59
|
dashboard: z.ZodPreprocess<z.ZodObject<{
|
|
57
60
|
editor: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/signalers/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoExB,wDAAwD;AACxD,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/signalers/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoExB,wDAAwD;AACxD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAahC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensip-cli/fitness",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Fitness checks engine for OpenSIP CLI",
|
|
6
6
|
"keywords": [
|
|
@@ -281,20 +281,20 @@
|
|
|
281
281
|
"react": "^19.2.7",
|
|
282
282
|
"typescript": "~6.0.3",
|
|
283
283
|
"zod": "^4.4.3",
|
|
284
|
-
"@opensip-cli/cli-live": "0.1.
|
|
285
|
-
"@opensip-cli/
|
|
286
|
-
"@opensip-cli/
|
|
287
|
-
"@opensip-cli/
|
|
288
|
-
"@opensip-cli/
|
|
289
|
-
"@opensip-cli/
|
|
290
|
-
"@opensip-cli/
|
|
291
|
-
"@opensip-cli/
|
|
284
|
+
"@opensip-cli/cli-live": "0.1.15",
|
|
285
|
+
"@opensip-cli/contracts": "0.1.15",
|
|
286
|
+
"@opensip-cli/config": "0.1.15",
|
|
287
|
+
"@opensip-cli/core": "0.1.15",
|
|
288
|
+
"@opensip-cli/datastore": "0.1.15",
|
|
289
|
+
"@opensip-cli/session-store": "0.1.15",
|
|
290
|
+
"@opensip-cli/targeting": "0.1.15",
|
|
291
|
+
"@opensip-cli/cli-ui": "0.1.15"
|
|
292
292
|
},
|
|
293
293
|
"devDependencies": {
|
|
294
294
|
"@types/node": "^24.13.2",
|
|
295
295
|
"@types/react": "^19.2.17",
|
|
296
296
|
"vitest": "^4.1.8",
|
|
297
|
-
"@opensip-cli/lang-typescript": "0.1.
|
|
297
|
+
"@opensip-cli/lang-typescript": "0.1.15"
|
|
298
298
|
},
|
|
299
299
|
"scripts": {
|
|
300
300
|
"build": "tsc",
|