@lewishowles/cli-style 0.3.0 → 0.4.0
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/CHANGELOG.md +11 -0
- package/README.md +3 -1
- package/package.json +1 -1
- package/src/gallery/render-gallery.js +1 -1
- package/src/index.js +1 -0
- package/src/reporters/create-reporter.js +42 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 - 2026-06-30
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added `reporter.divider()` for compact phase headings in grouped CLI output.
|
|
8
|
+
- Added `renderReporterDivider()` for rendering reporter phase dividers without a reporter instance.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Updated reporter docs and gallery examples to use dividers for major phases and reserve panels for framed content blocks.
|
|
13
|
+
|
|
3
14
|
## 0.3.0 - 2026-06-29
|
|
4
15
|
|
|
5
16
|
### Added
|
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ const reporter = createReporter({
|
|
|
52
52
|
colour: false,
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
reporter.
|
|
55
|
+
reporter.divider("Project setup", "Claude + Codex");
|
|
56
56
|
reporter.group("Agent scripts", [
|
|
57
57
|
{
|
|
58
58
|
label: "project-diagnostics.py",
|
|
@@ -70,6 +70,8 @@ reporter.status("success", "Done.");
|
|
|
70
70
|
console.log(reporter.render());
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
Use `reporter.divider()` for major phases. Use `reporter.section()` when you want a normal `info` status row inside a phase. Panels are for framed content blocks, not headings.
|
|
74
|
+
|
|
73
75
|
Groups can include verbose detail rows when a caller opts in:
|
|
74
76
|
|
|
75
77
|
```js
|
package/package.json
CHANGED
|
@@ -439,7 +439,7 @@ function renderPatterns(options, fixture) {
|
|
|
439
439
|
}, options);
|
|
440
440
|
const reporter = createReporter(options);
|
|
441
441
|
|
|
442
|
-
reporter.
|
|
442
|
+
reporter.divider("Project setup", "Claude + Codex");
|
|
443
443
|
reporter.group("Project files", [
|
|
444
444
|
{
|
|
445
445
|
detail: "already exists",
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isNonEmptyString } from "../patterns/helpers.js";
|
|
2
|
+
import { divider } from "../primitives/divider.js";
|
|
2
3
|
import { status as renderStatus } from "../primitives/status.js";
|
|
3
4
|
import {
|
|
4
5
|
getHighestSeverityResult,
|
|
@@ -32,6 +33,10 @@ export function createReporter(options = {}) {
|
|
|
32
33
|
const lines = [];
|
|
33
34
|
|
|
34
35
|
return {
|
|
36
|
+
divider: (label, detail = "", dividerOptions = {}) => append(lines, renderReporterDivider(label, detail, {
|
|
37
|
+
...reporterOptions,
|
|
38
|
+
...dividerOptions,
|
|
39
|
+
})),
|
|
35
40
|
group: (label, items = [], groupOptions = {}) => append(lines, renderGroup(label, items, {
|
|
36
41
|
...reporterOptions,
|
|
37
42
|
...groupOptions,
|
|
@@ -49,6 +54,25 @@ export function createReporter(options = {}) {
|
|
|
49
54
|
};
|
|
50
55
|
}
|
|
51
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Render a reporter phase divider.
|
|
59
|
+
*
|
|
60
|
+
* @param {string} label
|
|
61
|
+
* Divider label.
|
|
62
|
+
* @param {string} detail
|
|
63
|
+
* Optional supporting detail.
|
|
64
|
+
* @param {object} options
|
|
65
|
+
* Rendering options.
|
|
66
|
+
* @returns {string}
|
|
67
|
+
* Rendered divider.
|
|
68
|
+
*/
|
|
69
|
+
export function renderReporterDivider(label, detail = "", options = {}) {
|
|
70
|
+
return divider({
|
|
71
|
+
...options,
|
|
72
|
+
label: formatLabel(label, detail),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
52
76
|
/**
|
|
53
77
|
* Render a reporter group without mutating a reporter instance.
|
|
54
78
|
*
|
|
@@ -133,6 +157,24 @@ function append(lines, value) {
|
|
|
133
157
|
return value;
|
|
134
158
|
}
|
|
135
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Combine a label and optional detail for compact phase dividers.
|
|
162
|
+
*
|
|
163
|
+
* @param {string} label
|
|
164
|
+
* Main label.
|
|
165
|
+
* @param {string} detail
|
|
166
|
+
* Optional supporting detail.
|
|
167
|
+
* @returns {string}
|
|
168
|
+
* Combined label.
|
|
169
|
+
*/
|
|
170
|
+
function formatLabel(label, detail) {
|
|
171
|
+
if (!isNonEmptyString(detail)) {
|
|
172
|
+
return label;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return `${label} · ${detail}`;
|
|
176
|
+
}
|
|
177
|
+
|
|
136
178
|
/**
|
|
137
179
|
* Keep only rows that can render useful output.
|
|
138
180
|
*
|