headlamp 0.1.16 → 0.1.17
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 +5 -5
- package/dist/cli.cjs +22 -24
- package/dist/cli.cjs.map +2 -2
- package/dist/index.js +22 -24
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,20 +69,20 @@ npx headlamp --onlyFailures
|
|
|
69
69
|
npx headlamp --changed --onlyFailures
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
- `--
|
|
72
|
+
- `--showLogs[=true|false]`:
|
|
73
73
|
- When enabled, Headlamp prints a dedicated "Logs" section under each failing test and failing file with the full console output captured by the runner.
|
|
74
|
-
- By default (without this flag), Headlamp shows a condensed "Console errors" snippet with only the most relevant error messages. `--
|
|
75
|
-
- Supported forms: `--
|
|
74
|
+
- By default (without this flag), Headlamp shows a condensed "Console errors" snippet with only the most relevant error messages. `--showLogs` includes all console entries (log/info/warn/error).
|
|
75
|
+
- Supported forms: `--showLogs`, `--showLogs=true`, `--showLogs=false`.
|
|
76
76
|
- Works alongside `--onlyFailures`, coverage flags, and selection flags.
|
|
77
77
|
|
|
78
78
|
Examples:
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
81
|
# Always include the full console output for each failure
|
|
82
|
-
npx headlamp --
|
|
82
|
+
npx headlamp --showLogs
|
|
83
83
|
|
|
84
84
|
# Combine with only failures visible during the run
|
|
85
|
-
npx headlamp --onlyFailures --
|
|
85
|
+
npx headlamp --onlyFailures --showLogs
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
## Changed-file selection
|
package/dist/cli.cjs
CHANGED
|
@@ -249,7 +249,7 @@ var init_args = __esm({
|
|
|
249
249
|
coverageUi: (value) => ({ type: "coverageUi", value }),
|
|
250
250
|
coverageAbortOnFailure: (value) => ({ type: "coverageAbortOnFailure", value }),
|
|
251
251
|
onlyFailures: (value) => ({ type: "onlyFailures", value }),
|
|
252
|
-
|
|
252
|
+
showLogs: (value) => ({ type: "showLogs", value }),
|
|
253
253
|
jestArg: (value) => ({ type: "jestArg", value }),
|
|
254
254
|
jestArgs: (values) => ({ type: "jestArgs", values }),
|
|
255
255
|
vitestArg: (value) => ({ type: "vitestArg", value }),
|
|
@@ -416,17 +416,15 @@ var init_args = __esm({
|
|
|
416
416
|
"--onlyFailures",
|
|
417
417
|
(_flag, lookahead) => step([ActionBuilders.onlyFailures(isTruthy(String(lookahead)))], true)
|
|
418
418
|
),
|
|
419
|
-
// --
|
|
420
|
-
rule.eq("--
|
|
419
|
+
// --showLogs flag (boolean)
|
|
420
|
+
rule.eq("--showLogs", () => step([ActionBuilders.showLogs(true)])),
|
|
421
421
|
rule.startsWith(
|
|
422
|
-
"--
|
|
423
|
-
(value) => step([
|
|
424
|
-
ActionBuilders.showConsole(isTruthy((value.split("=")[1] ?? "").trim().toLowerCase()))
|
|
425
|
-
])
|
|
422
|
+
"--showLogs=",
|
|
423
|
+
(value) => step([ActionBuilders.showLogs(isTruthy((value.split("=")[1] ?? "").trim().toLowerCase()))])
|
|
426
424
|
),
|
|
427
425
|
rule.withLookahead(
|
|
428
|
-
"--
|
|
429
|
-
(_flag, lookahead) => step([ActionBuilders.
|
|
426
|
+
"--showLogs",
|
|
427
|
+
(_flag, lookahead) => step([ActionBuilders.showLogs(isTruthy(String(lookahead)))], true)
|
|
430
428
|
),
|
|
431
429
|
rule.withLookahead(
|
|
432
430
|
"--testPathPattern",
|
|
@@ -586,8 +584,8 @@ var init_args = __esm({
|
|
|
586
584
|
return { vitest: [], jest: [], coverage: false, coverageAbortOnFailure: action.value };
|
|
587
585
|
case "onlyFailures":
|
|
588
586
|
return { vitest: [], jest: [], coverage: false, onlyFailures: action.value };
|
|
589
|
-
case "
|
|
590
|
-
return { vitest: [], jest: [], coverage: false,
|
|
587
|
+
case "showLogs":
|
|
588
|
+
return { vitest: [], jest: [], coverage: false, showLogs: action.value };
|
|
591
589
|
case "jestArgs":
|
|
592
590
|
return { vitest: [], jest: action.values, coverage: false };
|
|
593
591
|
case "selectionHint":
|
|
@@ -663,7 +661,7 @@ var init_args = __esm({
|
|
|
663
661
|
...right.changedDepth !== void 0 || left.changedDepth !== void 0 ? { changedDepth: right.changedDepth ?? left.changedDepth } : {},
|
|
664
662
|
...right.coverageAbortOnFailure !== void 0 || left.coverageAbortOnFailure !== void 0 ? { coverageAbortOnFailure: right.coverageAbortOnFailure ?? left.coverageAbortOnFailure } : {},
|
|
665
663
|
...right.onlyFailures !== void 0 || left.onlyFailures !== void 0 ? { onlyFailures: right.onlyFailures ?? left.onlyFailures } : {},
|
|
666
|
-
...right.
|
|
664
|
+
...right.showLogs !== void 0 || left.showLogs !== void 0 ? { showLogs: right.showLogs ?? left.showLogs } : {},
|
|
667
665
|
...right.coverageDetail !== void 0 || left.coverageDetail !== void 0 ? { coverageDetail: right.coverageDetail ?? left.coverageDetail } : {},
|
|
668
666
|
...right.coverageShowCode !== void 0 || left.coverageShowCode !== void 0 ? { coverageShowCode: right.coverageShowCode ?? left.coverageShowCode } : {},
|
|
669
667
|
...right.coverageMode !== void 0 || left.coverageMode !== void 0 ? { coverageMode: right.coverageMode ?? left.coverageMode } : {},
|
|
@@ -688,7 +686,7 @@ var init_args = __esm({
|
|
|
688
686
|
let coverageUi = "both";
|
|
689
687
|
let coverageAbortOnFailure = false;
|
|
690
688
|
let onlyFailures = false;
|
|
691
|
-
let
|
|
689
|
+
let showLogs = false;
|
|
692
690
|
let coverageShowCode = Boolean(process.stdout.isTTY);
|
|
693
691
|
let coverageMode = "auto";
|
|
694
692
|
const coverageMaxFilesLocalInit = void 0;
|
|
@@ -707,7 +705,7 @@ var init_args = __esm({
|
|
|
707
705
|
coverageUi = contrib.coverageUi ?? coverageUi;
|
|
708
706
|
coverageAbortOnFailure = contrib.coverageAbortOnFailure ?? coverageAbortOnFailure;
|
|
709
707
|
onlyFailures = contrib.onlyFailures ?? onlyFailures;
|
|
710
|
-
|
|
708
|
+
showLogs = contrib.showLogs ?? showLogs;
|
|
711
709
|
coverageShowCode = contrib.coverageShowCode ?? coverageShowCode;
|
|
712
710
|
const coverageDetailComputed = contrib.coverageDetail ?? (contrib.selection ? "auto" : void 0);
|
|
713
711
|
coverageMode = contrib.coverageMode ?? (contrib.selection ? "compact" : "auto");
|
|
@@ -742,7 +740,7 @@ var init_args = __esm({
|
|
|
742
740
|
coverageUi,
|
|
743
741
|
coverageAbortOnFailure,
|
|
744
742
|
onlyFailures,
|
|
745
|
-
|
|
743
|
+
showLogs,
|
|
746
744
|
selectionSpecified: Boolean(contrib.selection),
|
|
747
745
|
selectionPaths: [...contrib.selectionPaths ?? []],
|
|
748
746
|
includeGlobs,
|
|
@@ -5404,7 +5402,7 @@ var renderChunks = (chunks, ctx, fns, opts) => {
|
|
|
5404
5402
|
|
|
5405
5403
|
// src/lib/formatter/context.ts
|
|
5406
5404
|
var fs5 = __toESM(require("node:fs"), 1);
|
|
5407
|
-
var makeCtx = (opts, showStacks = false,
|
|
5405
|
+
var makeCtx = (opts, showStacks = false, showLogs = false) => {
|
|
5408
5406
|
const cwd = (opts?.cwd ?? process.cwd()).replace(/\\/g, "/");
|
|
5409
5407
|
const width = Math.max(
|
|
5410
5408
|
40,
|
|
@@ -5424,7 +5422,7 @@ var makeCtx = (opts, showStacks = false, showConsole = false) => {
|
|
|
5424
5422
|
cwd,
|
|
5425
5423
|
width,
|
|
5426
5424
|
showStacks,
|
|
5427
|
-
|
|
5425
|
+
showLogs,
|
|
5428
5426
|
projectHint,
|
|
5429
5427
|
editorCmd: opts?.editorCmd,
|
|
5430
5428
|
readSource: readSource2
|
|
@@ -5751,7 +5749,7 @@ var renderFileLevelFailure = (file, ctx) => {
|
|
|
5751
5749
|
stackPreview
|
|
5752
5750
|
});
|
|
5753
5751
|
const consoleBlock = buildConsoleSection(stripBridgeEventsFromConsole(file.console ?? null), {
|
|
5754
|
-
full: Boolean(ctx.
|
|
5752
|
+
full: Boolean(ctx.showLogs)
|
|
5755
5753
|
});
|
|
5756
5754
|
const stackTail = ctx.showStacks && stackPreview.length === 0 ? (() => {
|
|
5757
5755
|
const tail = mergedForStack.filter((ln) => isStackLine(stripAnsiSimple(ln))).slice(-4).map((ln) => ` ${colorStackLine(String(ln), ctx.projectHint)}`);
|
|
@@ -6068,7 +6066,7 @@ var renderFailedAssertion = (args) => {
|
|
|
6068
6066
|
}
|
|
6069
6067
|
})() : empty;
|
|
6070
6068
|
const consoleBlock = buildConsoleSection(stripBridgeEventsFromConsole(file.console ?? null), {
|
|
6071
|
-
full: Boolean(ctx.
|
|
6069
|
+
full: Boolean(ctx.showLogs)
|
|
6072
6070
|
});
|
|
6073
6071
|
const stackTail = ctx.showStacks && stackPreview.length === 0 ? (() => {
|
|
6074
6072
|
const merged = collapseStacks([...msgLines, ...details.stacks]);
|
|
@@ -6169,7 +6167,7 @@ var formatJestOutputVitest = (raw, opts) => pipe(
|
|
|
6169
6167
|
ctx: makeCtx(
|
|
6170
6168
|
state.opts,
|
|
6171
6169
|
/\bFAIL\b/.test(stripAnsiSimple(state.raw)),
|
|
6172
|
-
Boolean(state.opts?.
|
|
6170
|
+
Boolean(state.opts?.showLogs)
|
|
6173
6171
|
)
|
|
6174
6172
|
}),
|
|
6175
6173
|
(state) => ({ ...state, chunks: parseChunks(state.raw) }),
|
|
@@ -6525,7 +6523,7 @@ var program = async () => {
|
|
|
6525
6523
|
coverageUi,
|
|
6526
6524
|
coverageAbortOnFailure,
|
|
6527
6525
|
onlyFailures,
|
|
6528
|
-
|
|
6526
|
+
showLogs,
|
|
6529
6527
|
selectionSpecified,
|
|
6530
6528
|
selectionPaths,
|
|
6531
6529
|
includeGlobs,
|
|
@@ -7229,7 +7227,7 @@ var program = async () => {
|
|
|
7229
7227
|
makeCtx(
|
|
7230
7228
|
{ cwd: repoRootForDiscovery, ...editorCmd !== void 0 ? { editorCmd } : {} },
|
|
7231
7229
|
/\bFAIL\b/.test(stripAnsiSimple(output)),
|
|
7232
|
-
Boolean(
|
|
7230
|
+
Boolean(showLogs)
|
|
7233
7231
|
),
|
|
7234
7232
|
{ onlyFailures }
|
|
7235
7233
|
);
|
|
@@ -7239,7 +7237,7 @@ var program = async () => {
|
|
|
7239
7237
|
makeCtx(
|
|
7240
7238
|
{ cwd: repoRootForDiscovery, ...editorCmd !== void 0 ? { editorCmd } : {} },
|
|
7241
7239
|
/\bFAIL\b/.test(stripAnsiSimple(output)),
|
|
7242
|
-
Boolean(
|
|
7240
|
+
Boolean(showLogs)
|
|
7243
7241
|
),
|
|
7244
7242
|
{ onlyFailures }
|
|
7245
7243
|
);
|
|
@@ -7342,7 +7340,7 @@ ${stripFooter(rawAlso)}`.trimEnd();
|
|
|
7342
7340
|
makeCtx(
|
|
7343
7341
|
{ cwd: repoRootForDiscovery, ...editorCmd !== void 0 ? { editorCmd } : {} },
|
|
7344
7342
|
showStacks,
|
|
7345
|
-
Boolean(
|
|
7343
|
+
Boolean(showLogs)
|
|
7346
7344
|
),
|
|
7347
7345
|
{ onlyFailures }
|
|
7348
7346
|
);
|