headlamp 0.1.5 → 0.1.8
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 +30 -2
- package/dist/cli.cjs +398 -262
- package/dist/cli.cjs.map +4 -4
- package/dist/index.js +405 -266
- package/dist/index.js.map +4 -4
- package/package.json +10 -4
- package/scripts/build.mjs +117 -0
- package/scripts/postinstall.mjs +13 -0
- package/scripts/print-publish-log.mjs +29 -0
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Coverage-first, runner-agnostic test UX for Jest/Vitest. Delegates execution to
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
Only in /Users/david/src/headlamp/src/lib: PLACEHOLDER
|
|
8
|
-
Only in /Users/david/src/headlamp/src/lib: _exec.ts
|
|
8
|
+
Only in /Users/david/src/headlamp/src/lib: \_exec.ts
|
|
9
9
|
Files /Users/david/src/gigworx-node/scripts/cli/coverage-print.ts and /Users/david/src/headlamp/src/lib/coverage-print.ts differ
|
|
10
10
|
Files /Users/david/src/gigworx-node/scripts/cli/discovery.ts and /Users/david/src/headlamp/src/lib/discovery.ts differ
|
|
11
11
|
Only in /Users/david/src/headlamp/src/lib: env-utils.ts
|
|
@@ -31,6 +31,7 @@ removed
|
|
|
31
31
|
|
|
32
32
|
Alpha. API/CLI flags may change.
|
|
33
33
|
und hotspots
|
|
34
|
+
|
|
34
35
|
- `--coverage.mode=compact|full|auto`: compact table vs full per-file details
|
|
35
36
|
- `--coverage.maxFiles`, `--coverage.maxHotspots`: limit rows to fit your terminal
|
|
36
37
|
- `--coverage.pageFit=true|false`: adapt output to terminal rows
|
|
@@ -51,6 +52,33 @@ npx headlamp --coverage
|
|
|
51
52
|
npx headlamp --coverage src/services/user.ts src/components/UserCard.tsx
|
|
52
53
|
```
|
|
53
54
|
|
|
55
|
+
## Coverage flags
|
|
56
|
+
|
|
57
|
+
- `--coverage`: enables coverage collection and prints merged coverage output after test execution. Uses your project's Jest/Vitest setup and reads coverage JSON from Jest.
|
|
58
|
+
- Prints a compact per-file table with hotspots and optionally detailed per-file breakdowns.
|
|
59
|
+
- Honors file selection and include/exclude globs when rendering coverage tables.
|
|
60
|
+
- `--coverage.abortOnFailure`: if tests fail, exit immediately with the test exit code and skip coverage printing. Useful in CI when failures should short-circuit.
|
|
61
|
+
- `--coverage.ui=jest|both`:
|
|
62
|
+
- `jest`: write Istanbul text report to `coverage/merged/coverage.txt` only.
|
|
63
|
+
- `both` (default): write both `coverage.txt` and `coverage-summary.txt`.
|
|
64
|
+
- Display and filtering options:
|
|
65
|
+
- `--coverage.mode=compact|full|auto` (default: `auto`): choose compact table-only or full per-file details.
|
|
66
|
+
- `--coverage.detail=<n>|all|auto` (default: `auto`): number of uncovered lines per file to show; `all` shows everything.
|
|
67
|
+
- `--coverage.showCode=true|false` (default: `true` when TTY): show code snippets for uncovered lines in full mode.
|
|
68
|
+
- `--coverage.maxFiles=<n>`: limit number of files in printed tables.
|
|
69
|
+
- `--coverage.maxHotspots=<n>`: limit hotspots per file in compact mode.
|
|
70
|
+
- `--coverage.pageFit=true|false` (default: `true` when TTY): fit output to terminal rows.
|
|
71
|
+
|
|
72
|
+
Examples:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Abort on failing tests without printing coverage
|
|
76
|
+
npx headlamp --coverage --coverage.abortOnFailure
|
|
77
|
+
|
|
78
|
+
# Show compact coverage limited to 50 files and 5 hotspots per file
|
|
79
|
+
npx headlamp --coverage --coverage.mode=compact --coverage.maxFiles=50 --coverage.maxHotspots=5
|
|
80
|
+
```
|
|
81
|
+
|
|
54
82
|
## Editor links
|
|
55
83
|
|
|
56
84
|
Headlamp prints clickable links (OSC 8) to open files at hotspots. Set `--coverage.editor` to override the default editor URL template if needed.
|
|
@@ -60,7 +88,7 @@ Headlamp prints clickable links (OSC 8) to open files at hotspots. Set `--covera
|
|
|
60
88
|
You can import pieces programmatically:
|
|
61
89
|
|
|
62
90
|
```ts
|
|
63
|
-
import { printCompactCoverage, resolveImportWithRoot } from
|
|
91
|
+
import { printCompactCoverage, resolveImportWithRoot } from 'headlamp';
|
|
64
92
|
```
|
|
65
93
|
|
|
66
94
|
## Status
|