@overkill-dev/reporter-line 0.0.1 → 0.0.3
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/LICENSE +21 -0
- package/package.json +41 -6
- package/packages/reporter-line/reporter-line.entry-point.d.ts +3 -0
- package/packages/reporter-line/reporter-line.entry-point.d.ts.map +1 -0
- package/packages/reporter-line/reporter-line.entry-point.js +7 -0
- package/packages/reporter-line/reporter-line.entry-point.js.map +1 -0
- package/readme.md +28 -5
- package/reporters/line-failure-rendering.d.ts +3 -0
- package/reporters/line-failure-rendering.d.ts.map +1 -0
- package/reporters/line-failure-rendering.js +241 -0
- package/reporters/line-failure-rendering.js.map +1 -0
- package/reporters/line-reporter.d.ts +6 -0
- package/reporters/line-reporter.d.ts.map +1 -0
- package/reporters/line-reporter.js +123 -0
- package/reporters/line-reporter.js.map +1 -0
- package/reporters/serialized-value-rendering.d.ts +4 -0
- package/reporters/serialized-value-rendering.d.ts.map +1 -0
- package/reporters/serialized-value-rendering.js +108 -0
- package/reporters/serialized-value-rendering.js.map +1 -0
- package/reporters/terminal.d.ts +25 -0
- package/reporters/terminal.d.ts.map +1 -0
- package/reporters/terminal.js +13 -0
- package/reporters/terminal.js.map +1 -0
- package/sbom.cdx.json +118 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Overkill contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,7 +1,42 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"author": "Christian Rackerseder <git@echooff.de>",
|
|
3
|
+
"bugs": {
|
|
4
|
+
"url": "https://github.com/enormora/overkill/issues"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"ansi-escapes": "7.3.0",
|
|
8
|
+
"figures": "6.1.0",
|
|
9
|
+
"string-width": "8.2.2",
|
|
10
|
+
"yoctocolors": "2.1.2"
|
|
11
|
+
},
|
|
12
|
+
"description": "Human-readable Overkill line reporter.",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": "^26"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./packages/reporter-line/reporter-line.entry-point.js",
|
|
19
|
+
"types": "./packages/reporter-line/reporter-line.entry-point.d.ts"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/enormora/overkill#readme",
|
|
23
|
+
"keywords": [
|
|
24
|
+
"tdd",
|
|
25
|
+
"test",
|
|
26
|
+
"tests"
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"name": "@overkill-dev/reporter-line",
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@overkill-dev/engine": "0.0.3"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/enormora/overkill.git"
|
|
36
|
+
},
|
|
37
|
+
"sideEffects": [
|
|
38
|
+
"./reporters/line-reporter.js"
|
|
39
|
+
],
|
|
40
|
+
"type": "module",
|
|
41
|
+
"version": "0.0.3"
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter-line.entry-point.d.ts","sourceRoot":"","sources":["../../../../../source/packages/reporter-line/reporter-line.entry-point.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,wBAAgB,kBAAkB,IAAI,gBAAgB,CAIrD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createLineReporter as createLineReporterInstance } from "../../reporters/line-reporter.js";
|
|
2
|
+
export function createLineReporter() {
|
|
3
|
+
return createLineReporterInstance({
|
|
4
|
+
stdoutConsole: console
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=reporter-line.entry-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter-line.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/reporter-line/reporter-line.entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAGpG,MAAM,UAAU,kBAAkB;IAC9B,OAAO,0BAA0B,CAAC;QAC9B,aAAa,EAAE,OAAO;KACzB,CAAC,CAAC;AACP,CAAC"}
|
package/readme.md
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@overkill-dev/reporter-line`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
can subsequently be configured for it. It contains no real package content and is published already
|
|
5
|
-
deprecated.
|
|
3
|
+
Human-readable real-time line reporter for Overkill test runs.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
Top-level API:
|
|
6
|
+
|
|
7
|
+
- `createLineReporter()`
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { execute } from '@overkill-dev/engine';
|
|
13
|
+
import { createLineReporter } from '@overkill-dev/reporter-line';
|
|
14
|
+
|
|
15
|
+
await execute(testPlan, {
|
|
16
|
+
reporters: [ createLineReporter() ],
|
|
17
|
+
runFacts: {},
|
|
18
|
+
startedAt: new Date().toISOString()
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The reporter writes to `stdout` and declares that sink as exclusive.
|
|
23
|
+
|
|
24
|
+
Rendering:
|
|
25
|
+
|
|
26
|
+
- failed test headers show identity and duration only
|
|
27
|
+
- all failure details come from structured `outcome.failures`
|
|
28
|
+
- all failed checks are rendered
|
|
29
|
+
- run summaries include discovered, planned, executed, pass, fail, and skip
|
|
30
|
+
counts, with inconclusive, crash, and orphan counts only when non-zero
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-failure-rendering.d.ts","sourceRoot":"","sources":["../../../../source/reporters/line-failure-rendering.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAiT3D,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,MAAM,EAAE,CAUrE"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import colors from 'yoctocolors';
|
|
2
|
+
import { formatSerializedValue, keyText } from "./serialized-value-rendering.js";
|
|
3
|
+
const blockLineLimit = 100;
|
|
4
|
+
const bytesPerKilobyte = 1024;
|
|
5
|
+
const valueKilobytes = 8;
|
|
6
|
+
const valueByteLimit = valueKilobytes * bytesPerKilobyte;
|
|
7
|
+
function byteLength(value) {
|
|
8
|
+
return Buffer.byteLength(value, 'utf8');
|
|
9
|
+
}
|
|
10
|
+
function truncateBytes(value) {
|
|
11
|
+
if (byteLength(value) <= valueByteLimit) {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
let truncated = '';
|
|
15
|
+
for (const character of value) {
|
|
16
|
+
const next = `${truncated}${character}`;
|
|
17
|
+
if (byteLength(next) > valueByteLimit) {
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
truncated = next;
|
|
21
|
+
}
|
|
22
|
+
return `${truncated}\n... truncated after ${valueByteLimit} bytes`;
|
|
23
|
+
}
|
|
24
|
+
function truncateLines(value) {
|
|
25
|
+
const lines = value.split('\n');
|
|
26
|
+
if (lines.length <= blockLineLimit) {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
return [
|
|
30
|
+
...lines.slice(0, blockLineLimit),
|
|
31
|
+
`... truncated ${lines.length - blockLineLimit} lines`
|
|
32
|
+
]
|
|
33
|
+
.join('\n');
|
|
34
|
+
}
|
|
35
|
+
function truncateRenderedValue(value) {
|
|
36
|
+
return truncateLines(truncateBytes(value));
|
|
37
|
+
}
|
|
38
|
+
function formatPropertySegment(segment) {
|
|
39
|
+
const key = keyText(segment.key);
|
|
40
|
+
return /^[A-Za-z_$][\w$]*$/u.test(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
|
|
41
|
+
}
|
|
42
|
+
function isPropertySegment(segment) {
|
|
43
|
+
return segment.kind === 'property';
|
|
44
|
+
}
|
|
45
|
+
function formatKeyedSegment(segment) {
|
|
46
|
+
if (segment.kind === 'set-value') {
|
|
47
|
+
return `[set ${formatSerializedValue(segment.value)}]`;
|
|
48
|
+
}
|
|
49
|
+
if (segment.kind === 'map-key') {
|
|
50
|
+
return `[map key ${formatSerializedValue(segment.key)}]`;
|
|
51
|
+
}
|
|
52
|
+
if (segment.kind === 'map-value') {
|
|
53
|
+
return `[map value ${formatSerializedValue(segment.key)}]`;
|
|
54
|
+
}
|
|
55
|
+
return isPropertySegment(segment) ? formatPropertySegment(segment) : '';
|
|
56
|
+
}
|
|
57
|
+
function formatSegment(segment) {
|
|
58
|
+
if (segment.kind === 'index') {
|
|
59
|
+
return `[${segment.index}]`;
|
|
60
|
+
}
|
|
61
|
+
return segment.kind === 'byte' ? `[byte ${segment.offset}]` : formatKeyedSegment(segment);
|
|
62
|
+
}
|
|
63
|
+
function formatPath(path) {
|
|
64
|
+
return path.map(formatSegment).join('');
|
|
65
|
+
}
|
|
66
|
+
function formatLocation(location) {
|
|
67
|
+
if (location.file.length === 0) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
if (location.line === null) {
|
|
71
|
+
return location.file;
|
|
72
|
+
}
|
|
73
|
+
if (location.column === null) {
|
|
74
|
+
return `${location.file}:${location.line}`;
|
|
75
|
+
}
|
|
76
|
+
return `${location.file}:${location.line}:${location.column}`;
|
|
77
|
+
}
|
|
78
|
+
function formatSerializedValueLines(label, value) {
|
|
79
|
+
return [`${label}: ${truncateRenderedValue(formatSerializedValue(value))}`];
|
|
80
|
+
}
|
|
81
|
+
function formatObjectOperation(operation) {
|
|
82
|
+
if (operation.operation === 'replace') {
|
|
83
|
+
return `replace ${formatPath(operation.path)}: expected ${formatSerializedValue(operation.from)}, actual ${formatSerializedValue(operation.to)}`;
|
|
84
|
+
}
|
|
85
|
+
if (operation.operation === 'add') {
|
|
86
|
+
return `add ${formatPath(operation.path)}: ${formatSerializedValue(operation.value)}`;
|
|
87
|
+
}
|
|
88
|
+
if (operation.operation === 'remove') {
|
|
89
|
+
return `remove ${formatPath(operation.path)}: ${formatSerializedValue(operation.value)}`;
|
|
90
|
+
}
|
|
91
|
+
return `missing ${formatPath(operation.path)}: ${formatSerializedValue(operation.value)}`;
|
|
92
|
+
}
|
|
93
|
+
function formatArrayOperation(operation) {
|
|
94
|
+
if (operation.operation === 'missing-index') {
|
|
95
|
+
return `missing [${operation.index}]: ${formatSerializedValue(operation.value)}`;
|
|
96
|
+
}
|
|
97
|
+
if (operation.operation === 'missing-member') {
|
|
98
|
+
return `missing array member: ${formatSerializedValue(operation.value)}`;
|
|
99
|
+
}
|
|
100
|
+
return formatObjectOperation(operation);
|
|
101
|
+
}
|
|
102
|
+
function formatMapOperation(operation) {
|
|
103
|
+
if (operation.operation === 'missing-entry') {
|
|
104
|
+
return `missing map entry ${formatSerializedValue(operation.key)}: ${formatSerializedValue(operation.value)}`;
|
|
105
|
+
}
|
|
106
|
+
return formatObjectOperation(operation);
|
|
107
|
+
}
|
|
108
|
+
function formatSetOperation(operation) {
|
|
109
|
+
if (operation.operation === 'missing-member') {
|
|
110
|
+
return `missing set member: ${formatSerializedValue(operation.value)}`;
|
|
111
|
+
}
|
|
112
|
+
return formatObjectOperation(operation);
|
|
113
|
+
}
|
|
114
|
+
function formatValueDiff(diff) {
|
|
115
|
+
return [
|
|
116
|
+
...formatSerializedValueLines('expected', diff.expected),
|
|
117
|
+
...formatSerializedValueLines('actual', diff.actual)
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
function formatStringDiff(diff) {
|
|
121
|
+
return diff.hunks.flatMap(function formatHunk(hunk) {
|
|
122
|
+
return [
|
|
123
|
+
`string hunk expected ${hunk.expectedStart}, actual ${hunk.actualStart}`,
|
|
124
|
+
...hunk.removed.map(function removed(line) {
|
|
125
|
+
return `- ${line}`;
|
|
126
|
+
}),
|
|
127
|
+
...hunk.added.map(function added(line) {
|
|
128
|
+
return `+ ${line}`;
|
|
129
|
+
})
|
|
130
|
+
];
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function formatCollectionDiff(diff) {
|
|
134
|
+
if (diff.kind === 'object') {
|
|
135
|
+
return diff.operations.map(formatObjectOperation);
|
|
136
|
+
}
|
|
137
|
+
if (diff.kind === 'array') {
|
|
138
|
+
return diff.operations.map(formatArrayOperation);
|
|
139
|
+
}
|
|
140
|
+
if (diff.kind === 'map') {
|
|
141
|
+
return diff.operations.map(formatMapOperation);
|
|
142
|
+
}
|
|
143
|
+
if (diff.kind === 'set') {
|
|
144
|
+
return diff.operations.map(formatSetOperation);
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
function formatBinaryDiff(diff) {
|
|
149
|
+
const expectedSummary = `expected ${diff.expectedSize} bytes ${diff.expectedHash}`;
|
|
150
|
+
const actualSummary = `actual ${diff.actualSize} bytes ${diff.actualHash}`;
|
|
151
|
+
const header = `binary differs: ${expectedSummary}, ${actualSummary}`;
|
|
152
|
+
return [
|
|
153
|
+
header,
|
|
154
|
+
...diff.ranges.map(function formatRange(range) {
|
|
155
|
+
return `byte ${range.offset}: expected [${range.expected.join(', ')}], actual [${range.actual.join(', ')}]`;
|
|
156
|
+
})
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
function formatDiff(diff) {
|
|
160
|
+
if (diff.kind === 'value') {
|
|
161
|
+
return formatValueDiff(diff);
|
|
162
|
+
}
|
|
163
|
+
if (diff.kind === 'string') {
|
|
164
|
+
return formatStringDiff(diff);
|
|
165
|
+
}
|
|
166
|
+
const collection = formatCollectionDiff(diff);
|
|
167
|
+
if (collection !== null) {
|
|
168
|
+
return collection;
|
|
169
|
+
}
|
|
170
|
+
return diff.kind === 'binary' ? formatBinaryDiff(diff) : [];
|
|
171
|
+
}
|
|
172
|
+
function failedCheckDetailLines(check) {
|
|
173
|
+
if (check.kind === 'foreign') {
|
|
174
|
+
return [
|
|
175
|
+
`foreign assertion: ${check.label}`,
|
|
176
|
+
`${check.error.name}: ${check.error.message}`
|
|
177
|
+
];
|
|
178
|
+
}
|
|
179
|
+
return check.diff === null
|
|
180
|
+
? [
|
|
181
|
+
...formatSerializedValueLines('expected', check.expected),
|
|
182
|
+
...formatSerializedValueLines('actual', check.actual)
|
|
183
|
+
]
|
|
184
|
+
: formatDiff(check.diff);
|
|
185
|
+
}
|
|
186
|
+
function formatFailedCheck(check) {
|
|
187
|
+
const path = formatPath(check.path);
|
|
188
|
+
const location = formatLocation(check.location);
|
|
189
|
+
const detailLines = failedCheckDetailLines(check);
|
|
190
|
+
const childLines = check.kind === 'composite'
|
|
191
|
+
? check.children.flatMap(function formatChild(child, index) {
|
|
192
|
+
return [
|
|
193
|
+
`child check ${index + 1}`,
|
|
194
|
+
...formatFailedCheck(child).map(function indentChild(line) {
|
|
195
|
+
return ` ${line}`;
|
|
196
|
+
})
|
|
197
|
+
];
|
|
198
|
+
})
|
|
199
|
+
: [];
|
|
200
|
+
return [
|
|
201
|
+
check.summary,
|
|
202
|
+
...path.length === 0 ? [] : [`path: ${path}`],
|
|
203
|
+
...location === null ? [] : [`location: ${location}`],
|
|
204
|
+
...detailLines,
|
|
205
|
+
...childLines
|
|
206
|
+
];
|
|
207
|
+
}
|
|
208
|
+
function formatTestContractFailure(failure) {
|
|
209
|
+
return [
|
|
210
|
+
`${failure.summary} (${failure.code})`,
|
|
211
|
+
`expected: ${failure.expected}`,
|
|
212
|
+
`actual: ${truncateRenderedValue(String(failure.actual))}`
|
|
213
|
+
];
|
|
214
|
+
}
|
|
215
|
+
function formatBodyErrorFailure(failure) {
|
|
216
|
+
const stackLines = failure.error.stack === null
|
|
217
|
+
? []
|
|
218
|
+
: truncateRenderedValue(failure.error.stack).split('\n').map(function dimStackLine(line) {
|
|
219
|
+
return colors.dim(line);
|
|
220
|
+
});
|
|
221
|
+
return [
|
|
222
|
+
`${failure.error.name}: ${failure.error.message}`,
|
|
223
|
+
...stackLines
|
|
224
|
+
];
|
|
225
|
+
}
|
|
226
|
+
function formatAssertionFailure(failure) {
|
|
227
|
+
return failure.checks.flatMap(function formatCheck(check, index) {
|
|
228
|
+
const prefix = failure.checks.length === 1 ? [] : [`check ${index + 1}`];
|
|
229
|
+
return [...prefix, ...formatFailedCheck(check)];
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
export function formatFailure(failure) {
|
|
233
|
+
if (failure.kind === 'assertion') {
|
|
234
|
+
return formatAssertionFailure(failure);
|
|
235
|
+
}
|
|
236
|
+
if (failure.kind === 'body-error') {
|
|
237
|
+
return formatBodyErrorFailure(failure);
|
|
238
|
+
}
|
|
239
|
+
return formatTestContractFailure(failure);
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=line-failure-rendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-failure-rendering.js","sourceRoot":"","sources":["../../../../source/reporters/line-failure-rendering.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAYjC,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAEjF,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAUzD,SAAS,UAAU,CAAC,KAAa;IAC7B,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAChC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,cAAc,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,KAAK,MAAM,SAAS,IAAI,KAAK,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC;QAExC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,cAAc,EAAE,CAAC;YACpC,MAAM;QACV,CAAC;QAED,SAAS,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,OAAO,GAAG,SAAS,yBAAyB,cAAc,QAAQ,CAAC;AACvE,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI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AAE,KAAK;QAC3D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,SAAS,KAAK,GAAG,CAAC,EAAE,CAAE,CAAC;QAE3E,OAAO,CAAE,GAAG,MAAM,EAAE,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAE,CAAC;IACtD,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAoB;IAC9C,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC/B,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAChC,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RealTimeReporter } from '@overkill-dev/engine/engine/reporter.js';
|
|
2
|
+
export type LineReporterDependencies = {
|
|
3
|
+
readonly stdoutConsole: Pick<typeof console, 'log'>;
|
|
4
|
+
};
|
|
5
|
+
export declare function createLineReporter(dependencies: LineReporterDependencies): RealTimeReporter;
|
|
6
|
+
//# sourceMappingURL=line-reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-reporter.d.ts","sourceRoot":"","sources":["../../../../source/reporters/line-reporter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,uBAAuB,CAAC;AAS7E,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,OAAO,EAAE,KAAK,CAAC,CAAC;CACvD,CAAC;AAkGF,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,wBAAwB,GAAG,gBAAgB,CA4C3F"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import figures from 'figures';
|
|
2
|
+
import colors from 'yoctocolors';
|
|
3
|
+
import { formatFailure } from "./line-failure-rendering.js";
|
|
4
|
+
import { createTerminalLineLogger } from "./terminal.js";
|
|
5
|
+
const successSymbol = colors.green(figures.tick);
|
|
6
|
+
const errorSymbol = colors.red(figures.cross);
|
|
7
|
+
const infoSymbol = colors.cyan(figures.info);
|
|
8
|
+
function indent(depth) {
|
|
9
|
+
return ' '.repeat(depth);
|
|
10
|
+
}
|
|
11
|
+
function formatCaseName(id) {
|
|
12
|
+
if (id.params === null) {
|
|
13
|
+
return id.name;
|
|
14
|
+
}
|
|
15
|
+
return `${id.name} [${id.params}]`;
|
|
16
|
+
}
|
|
17
|
+
function outcomeReason(outcome) {
|
|
18
|
+
if (outcome.kind === 'skip' || outcome.kind === 'inconclusive') {
|
|
19
|
+
return outcome.reason;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
function formatDuration(wallTimeMs) {
|
|
24
|
+
return `${wallTimeMs} ms`;
|
|
25
|
+
}
|
|
26
|
+
function formatTestResult(id, outcome, wallTimeMs) {
|
|
27
|
+
const reason = outcomeReason(outcome);
|
|
28
|
+
const detail = reason === null ? '' : `: ${reason}`;
|
|
29
|
+
const message = `${formatCaseName(id)}${detail} (${formatDuration(wallTimeMs)})`;
|
|
30
|
+
if (outcome.kind === 'fail') {
|
|
31
|
+
return [errorSymbol, message];
|
|
32
|
+
}
|
|
33
|
+
if (outcome.kind === 'pass') {
|
|
34
|
+
return [successSymbol, message];
|
|
35
|
+
}
|
|
36
|
+
return [infoSymbol, message];
|
|
37
|
+
}
|
|
38
|
+
function formatSuiteName(event) {
|
|
39
|
+
return event.suitePath.at(-1) ?? '<root>';
|
|
40
|
+
}
|
|
41
|
+
function formatOrphan(orphan) {
|
|
42
|
+
return `${orphan.kind}: ${orphan.name} (${orphan.file ?? '<unknown>'})`;
|
|
43
|
+
}
|
|
44
|
+
function logFailures(terminal, suiteDepth, outcome) {
|
|
45
|
+
for (const failure of outcome.failures) {
|
|
46
|
+
for (const line of formatFailure(failure)) {
|
|
47
|
+
terminal.line(`${indent(suiteDepth + 1)}${line}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function logSummary(terminal, result) {
|
|
52
|
+
const { summary } = result;
|
|
53
|
+
const crashCount = result
|
|
54
|
+
.runnerErrors
|
|
55
|
+
.filter(function isCrash(error) {
|
|
56
|
+
return error.subtype === 'crash';
|
|
57
|
+
})
|
|
58
|
+
.length;
|
|
59
|
+
const executed = summary.passed + summary.failed + summary.skipped + summary.inconclusive + crashCount;
|
|
60
|
+
const outcomes = [
|
|
61
|
+
`${summary.passed} pass`,
|
|
62
|
+
`${summary.failed} fail`,
|
|
63
|
+
`${summary.skipped} skip`,
|
|
64
|
+
...summary.inconclusive === 0 ? [] : [`${summary.inconclusive} inconclusive`],
|
|
65
|
+
...crashCount === 0 ? [] : [`${crashCount} crash`]
|
|
66
|
+
]
|
|
67
|
+
.join(', ');
|
|
68
|
+
const orphanSummary = result.orphans.length === 0 ? '' : `, ${result.orphans.length} orphaned`;
|
|
69
|
+
const countSummary = `${summary.discovered} discovered, ${summary.planned} planned, ${executed} executed`;
|
|
70
|
+
terminal.line(infoSymbol, `${countSummary} (${outcomes})${orphanSummary} in ${formatDuration(result.wallTimeMs)}`);
|
|
71
|
+
}
|
|
72
|
+
function logOrphans(terminal, orphans) {
|
|
73
|
+
if (orphans.length === 0) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
for (const orphan of orphans) {
|
|
77
|
+
terminal.line(infoSymbol, formatOrphan(orphan));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export function createLineReporter(dependencies) {
|
|
81
|
+
const { stdoutConsole } = dependencies;
|
|
82
|
+
const terminal = createTerminalLineLogger({ stdoutConsole });
|
|
83
|
+
let suiteDepth = 0;
|
|
84
|
+
function logTestEnd(event) {
|
|
85
|
+
const [symbol, message] = formatTestResult(event.case, event.outcome, event.wallTimeMs);
|
|
86
|
+
terminal.line(symbol, `${indent(suiteDepth)}${message}`);
|
|
87
|
+
if (event.outcome.kind === 'fail') {
|
|
88
|
+
logFailures(terminal, suiteDepth, event.outcome);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function logSuiteStart(event) {
|
|
92
|
+
terminal.line(infoSymbol, `${indent(suiteDepth)}${formatSuiteName(event)}`);
|
|
93
|
+
suiteDepth += 1;
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
dispose: null,
|
|
97
|
+
kind: 'real-time',
|
|
98
|
+
name: 'line',
|
|
99
|
+
sinks: [{ conflictPolicy: 'exclusive', kind: 'stdout' }],
|
|
100
|
+
async onEvent(event) {
|
|
101
|
+
if (event.kind === 'run-start') {
|
|
102
|
+
terminal.line(infoSymbol, 'Test run started');
|
|
103
|
+
}
|
|
104
|
+
else if (event.kind === 'suite-start') {
|
|
105
|
+
logSuiteStart(event);
|
|
106
|
+
}
|
|
107
|
+
else if (event.kind === 'suite-end') {
|
|
108
|
+
suiteDepth = Math.max(0, suiteDepth - 1);
|
|
109
|
+
}
|
|
110
|
+
else if (event.kind === 'test-end') {
|
|
111
|
+
logTestEnd(event);
|
|
112
|
+
}
|
|
113
|
+
else if (event.kind === 'runner-error') {
|
|
114
|
+
terminal.line(errorSymbol, `Runner error: ${event.error.message}`);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
async onFinish(finalResult) {
|
|
118
|
+
logSummary(terminal, finalResult);
|
|
119
|
+
logOrphans(terminal, finalResult.orphans);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=line-reporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-reporter.js","sourceRoot":"","sources":["../../../../source/reporters/line-reporter.ts"],"names":[],"mappings":"AAAA,OAAO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BACtC,aAAa,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC;iBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBACpC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;YAC7C,CAAC;iBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBACnC,UAAU,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;iBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;gBACvC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACvE,CAAC;QACL,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,WAAW;YACtB,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAClC,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QAC9C,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SerializedPropertyKey, SerializedValue } from '@overkill-dev/engine/compare/serialized-value.js';
|
|
2
|
+
export declare function keyText(key: SerializedPropertyKey): string;
|
|
3
|
+
export declare function formatSerializedValue(value: SerializedValue): string;
|
|
4
|
+
//# sourceMappingURL=serialized-value-rendering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialized-value-rendering.d.ts","sourceRoot":"","sources":["../../../../source/reporters/serialized-value-rendering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAW7F,wBAAgB,OAAO,CAAC,GAAG,EAAE,qBAAqB,GAAG,MAAM,CAE1D;AAgID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAWpE"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export function keyText(key) {
|
|
2
|
+
return key.kind === 'symbol' ? `[${key.value}]` : key.value;
|
|
3
|
+
}
|
|
4
|
+
function formatEntries(entries, format) {
|
|
5
|
+
return `{ ${entries
|
|
6
|
+
.map(function formatEntry(entry) {
|
|
7
|
+
return `${keyText(entry.key)}: ${format(entry.value)}`;
|
|
8
|
+
})
|
|
9
|
+
.join(', ')} }`;
|
|
10
|
+
}
|
|
11
|
+
function formatNullishValue(value) {
|
|
12
|
+
if (value.kind === 'undefined') {
|
|
13
|
+
return 'undefined';
|
|
14
|
+
}
|
|
15
|
+
return value.kind === 'null' ? 'null' : null;
|
|
16
|
+
}
|
|
17
|
+
function formatScalarValue(value) {
|
|
18
|
+
if (value.kind === 'boolean' || value.kind === 'number') {
|
|
19
|
+
return String(value.value);
|
|
20
|
+
}
|
|
21
|
+
return value.kind === 'bigint' ? `${value.value}n` : null;
|
|
22
|
+
}
|
|
23
|
+
function formatTextValue(value) {
|
|
24
|
+
if (value.kind === 'string') {
|
|
25
|
+
const rendered = JSON.stringify(value.value);
|
|
26
|
+
return value.truncation === null
|
|
27
|
+
? rendered
|
|
28
|
+
: `${rendered} (truncated at ${value.truncation.budget} bytes)`;
|
|
29
|
+
}
|
|
30
|
+
return value.kind === 'symbol' ? value.value : null;
|
|
31
|
+
}
|
|
32
|
+
function formatFunctionValue(value) {
|
|
33
|
+
if (value.kind !== 'function') {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return value.name === null ? '[Function]' : `[Function ${value.name}]`;
|
|
37
|
+
}
|
|
38
|
+
function formatCollectionValue(value, format) {
|
|
39
|
+
if (value.kind === 'array') {
|
|
40
|
+
return `[${value
|
|
41
|
+
.entries
|
|
42
|
+
.map(function formatArrayEntry(entry) {
|
|
43
|
+
return format(entry.value);
|
|
44
|
+
})
|
|
45
|
+
.join(', ')}]`;
|
|
46
|
+
}
|
|
47
|
+
if (value.kind === 'object') {
|
|
48
|
+
return `${value.constructorName} ${formatEntries(value.entries, format)}`;
|
|
49
|
+
}
|
|
50
|
+
if (value.kind === 'map') {
|
|
51
|
+
return `Map(${value.size})`;
|
|
52
|
+
}
|
|
53
|
+
return value.kind === 'set' ? `Set(${value.size})` : null;
|
|
54
|
+
}
|
|
55
|
+
function formatBuiltInValue(value) {
|
|
56
|
+
if (value.kind === 'date') {
|
|
57
|
+
return value.value === null ? 'Invalid Date' : `Date ${value.value}`;
|
|
58
|
+
}
|
|
59
|
+
if (value.kind === 'regexp') {
|
|
60
|
+
return `/${value.source}/${value.flags}`;
|
|
61
|
+
}
|
|
62
|
+
return value.kind === 'error' ? `${value.name}: ${value.message}` : null;
|
|
63
|
+
}
|
|
64
|
+
function formatByteValue(value) {
|
|
65
|
+
if (value.kind === 'array-buffer' || value.kind === 'data-view') {
|
|
66
|
+
return `${value.kind}(${value.byteLength} bytes)`;
|
|
67
|
+
}
|
|
68
|
+
return value.kind === 'typed-array' ? `${value.constructorName}(${value.length})` : null;
|
|
69
|
+
}
|
|
70
|
+
function formatFallbackValue(value) {
|
|
71
|
+
if (value.kind === 'circular') {
|
|
72
|
+
return `[Circular ${value.reference}]`;
|
|
73
|
+
}
|
|
74
|
+
if (value.kind === 'opaque') {
|
|
75
|
+
return `[${value.type}]`;
|
|
76
|
+
}
|
|
77
|
+
return value.kind === 'unavailable' ? `[Unavailable: ${value.reason}]` : null;
|
|
78
|
+
}
|
|
79
|
+
const scalarRenderers = [
|
|
80
|
+
formatNullishValue,
|
|
81
|
+
formatScalarValue,
|
|
82
|
+
formatTextValue,
|
|
83
|
+
formatFunctionValue
|
|
84
|
+
];
|
|
85
|
+
const referenceRenderers = [
|
|
86
|
+
formatBuiltInValue,
|
|
87
|
+
formatByteValue,
|
|
88
|
+
formatFallbackValue
|
|
89
|
+
];
|
|
90
|
+
function formatWithRenderers(value, renderers) {
|
|
91
|
+
for (const renderer of renderers) {
|
|
92
|
+
const rendered = renderer(value);
|
|
93
|
+
if (rendered !== null) {
|
|
94
|
+
return rendered;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
export function formatSerializedValue(value) {
|
|
100
|
+
const scalar = formatWithRenderers(value, scalarRenderers);
|
|
101
|
+
if (scalar !== null) {
|
|
102
|
+
return scalar;
|
|
103
|
+
}
|
|
104
|
+
const collection = formatCollectionValue(value, formatSerializedValue);
|
|
105
|
+
return collection ?? formatWithRenderers(value, referenceRenderers) ??
|
|
106
|
+
'[Unavailable: unsupported serialized value]';
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=serialized-value-rendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialized-value-rendering.js","sourceRoot":"","sources":["../../../../source/reporters/serialized-value-rendering.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,OAAO,CAAC,GAA0B;IAC9C,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;AAChE,CAAC;AAED,SAAS,aAAa,CAAC,OAAmC,EAAE,MAAyC;IACjG,OAAO,KACH,OAAO;SACF,GAAG,CAAC,SAAS,WAAW,CAAC,KAAK;QAC3B,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;IAC3D,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAClB,IAAI,CAAC;AACT,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAsB;IAC9C,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC7B,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAED,SAAS,iBAAi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K,EAAE,qBAAqB,CAAC,CAAC;IAEvE,OAAO,UAAU,IAAI,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,CAAC;QAC/D,6CAA6C,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type TerminalLineLogger = {
|
|
2
|
+
readonly line: (...values: readonly string[]) => void;
|
|
3
|
+
};
|
|
4
|
+
export type TerminalLineLoggerDependencies = {
|
|
5
|
+
readonly stdoutConsole: Pick<typeof console, 'log'>;
|
|
6
|
+
};
|
|
7
|
+
export type TerminalOutput = {
|
|
8
|
+
readonly columns: number;
|
|
9
|
+
readonly off: (event: 'resize', listener: () => void) => unknown;
|
|
10
|
+
readonly on: (event: 'resize', listener: () => void) => unknown;
|
|
11
|
+
readonly write: (text: string) => unknown;
|
|
12
|
+
};
|
|
13
|
+
export type TerminalProgressRenderer = {
|
|
14
|
+
readonly dispose: () => void;
|
|
15
|
+
readonly finish: () => void;
|
|
16
|
+
readonly writeMark: (mark: string) => void;
|
|
17
|
+
};
|
|
18
|
+
export type TerminalProgressRendererDependencies = {
|
|
19
|
+
readonly interactive: boolean;
|
|
20
|
+
readonly output: TerminalOutput;
|
|
21
|
+
};
|
|
22
|
+
export declare function createTerminalLineLogger(dependencies: TerminalLineLoggerDependencies): TerminalLineLogger;
|
|
23
|
+
export declare function visibleTerminalWidth(value: string): number;
|
|
24
|
+
export declare function createTerminalProgressRenderer(dependencies: TerminalProgressRendererDependencies): TerminalProgressRenderer;
|
|
25
|
+
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../../source/reporters/terminal.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG;IAC7B,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,MAAM,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IACzC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,OAAO,EAAE,KAAK,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,OAAO,CAAC;IACjE,QAAQ,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,OAAO,CAAC;IAChE,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IAC/C,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CACnC,CAAC;AAeF,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,8BAA8B,GAAG,kBAAkB,CAQzG;AAMD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D;AAqFD,wBAAgB,8BAA8B,CAC1C,YAAY,EAAE,oCAAoC,GACnD,wBAAwB,CA2D1B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ansiEscapes from 'ansi-escapes';
|
|
2
|
+
import stringWidth from 'string-width';
|
|
3
|
+
|
|
4
|
+
export function createTerminalLineLogger(dependencies) {
|
|
5
|
+
const { stdoutConsole } = dependencies;
|
|
6
|
+
return {
|
|
7
|
+
line(...values) {
|
|
8
|
+
stdoutConsole.log(...values);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../../../source/reporters/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc;AACtC,OAAO,WAAW,MAAM,cAAc;;AAyCtC,MAAM,UAAU,wBAAwB,CAAC,YAA4C;IACjF,MAAM,EAAE,aAAa,EAAE,GAAG,YAAY,CAAC;IAEvC,OAAO;QACH,IAAI,CAAC,GAAG,MAAM;YACV,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;QACjC,CAAC;KACJ,CAAC;AACN"}
|
package/sbom.cdx.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
|
|
3
|
+
"bomFormat": "CycloneDX",
|
|
4
|
+
"specVersion": "1.6",
|
|
5
|
+
"version": 1,
|
|
6
|
+
"metadata": {
|
|
7
|
+
"tools": {
|
|
8
|
+
"components": [
|
|
9
|
+
{
|
|
10
|
+
"type": "application",
|
|
11
|
+
"name": "packtory",
|
|
12
|
+
"version": "0.0.78"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"component": {
|
|
17
|
+
"type": "library",
|
|
18
|
+
"name": "@overkill-dev/reporter-line",
|
|
19
|
+
"version": "0.0.3",
|
|
20
|
+
"bom-ref": "pkg:npm/@overkill-dev/reporter-line@0.0.3",
|
|
21
|
+
"purl": "pkg:npm/@overkill-dev/reporter-line@0.0.3"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"components": [
|
|
25
|
+
{
|
|
26
|
+
"type": "library",
|
|
27
|
+
"name": "@overkill-dev/engine",
|
|
28
|
+
"version": "0.0.3",
|
|
29
|
+
"bom-ref": "pkg:npm/@overkill-dev/engine@0.0.3",
|
|
30
|
+
"scope": "optional",
|
|
31
|
+
"licenses": [
|
|
32
|
+
{
|
|
33
|
+
"expression": "MIT"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"purl": "pkg:npm/@overkill-dev/engine@0.0.3"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "library",
|
|
40
|
+
"name": "ansi-escapes",
|
|
41
|
+
"version": "7.3.0",
|
|
42
|
+
"bom-ref": "pkg:npm/ansi-escapes@7.3.0",
|
|
43
|
+
"scope": "required",
|
|
44
|
+
"licenses": [
|
|
45
|
+
{
|
|
46
|
+
"expression": "MIT"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"purl": "pkg:npm/ansi-escapes@7.3.0"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "library",
|
|
53
|
+
"name": "figures",
|
|
54
|
+
"version": "6.1.0",
|
|
55
|
+
"bom-ref": "pkg:npm/figures@6.1.0",
|
|
56
|
+
"scope": "required",
|
|
57
|
+
"licenses": [
|
|
58
|
+
{
|
|
59
|
+
"expression": "MIT"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"purl": "pkg:npm/figures@6.1.0"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "library",
|
|
66
|
+
"name": "string-width",
|
|
67
|
+
"version": "8.2.2",
|
|
68
|
+
"bom-ref": "pkg:npm/string-width@8.2.2",
|
|
69
|
+
"scope": "required",
|
|
70
|
+
"licenses": [
|
|
71
|
+
{
|
|
72
|
+
"expression": "MIT"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"purl": "pkg:npm/string-width@8.2.2"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"type": "library",
|
|
79
|
+
"name": "yoctocolors",
|
|
80
|
+
"version": "2.1.2",
|
|
81
|
+
"bom-ref": "pkg:npm/yoctocolors@2.1.2",
|
|
82
|
+
"scope": "required",
|
|
83
|
+
"licenses": [
|
|
84
|
+
{
|
|
85
|
+
"expression": "MIT"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"purl": "pkg:npm/yoctocolors@2.1.2"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"dependencies": [
|
|
92
|
+
{
|
|
93
|
+
"ref": "pkg:npm/@overkill-dev/engine@0.0.3"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"ref": "pkg:npm/@overkill-dev/reporter-line@0.0.3",
|
|
97
|
+
"dependsOn": [
|
|
98
|
+
"pkg:npm/@overkill-dev/engine@0.0.3",
|
|
99
|
+
"pkg:npm/ansi-escapes@7.3.0",
|
|
100
|
+
"pkg:npm/figures@6.1.0",
|
|
101
|
+
"pkg:npm/string-width@8.2.2",
|
|
102
|
+
"pkg:npm/yoctocolors@2.1.2"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"ref": "pkg:npm/ansi-escapes@7.3.0"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"ref": "pkg:npm/figures@6.1.0"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"ref": "pkg:npm/string-width@8.2.2"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"ref": "pkg:npm/yoctocolors@2.1.2"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|