Capture inside of Reporter#processedList
MODIFY
packages/@romejs/cli-diagnostics/printAdvice.ts
packages/@romejs/cli-diagnostics/printAdvice.ts
@@ -406,9 +406,6 @@ function printStacktrace(
}
}
- display(logParts.join(' '));
-
- // Push on frame
if (
shownCodeFrames < 2 &&
filename !== undefined &&
@@ -440,6 +437,8 @@ function printStacktrace(
shownCodeFrames++;
}
}
+
+ display(logParts.join(' '));
},
{
ordered: true,

MODIFY
packages/@romejs/cli-reporter/Reporter.ts
packages/@romejs/cli-reporter/Reporter.ts
@@ -217,10 +217,11 @@ export default class Reporter {
format: ReporterStream['format'] = 'none',
): {
read: () => string;
+ remove: () => void;
} {
let buff = '';
- this.addStream({
+ const stream: ReporterStream = {
format,
type: 'all',
columns: Reporter.DEFAULT_COLUMNS,
@@ -228,12 +229,17 @@ export default class Reporter {
write(chunk) {
buff += chunk;
},
- });
+ };
+
+ this.addStream(stream);
return {
read() {
return buff;
},
+ remove: () => {
+ this.removeStream(stream);
+ },
};
}
@@ -1106,13 +1112,14 @@ export default class Reporter {
let buff = '';
for (const item of items) {
+ const stream = this.attachCaptureStream('markup');
callback(
item,
(str) => {
- // TODO maybe set index + 1?
- buff += `<li>${str}</li>`;
+ buff += `<li>${str}${stream.read()}</li>`;
},
);
+ stream.remove();
}
if (opts.ordered) {

MODIFY
packages/@romejs/string-markup/Grid.ts
packages/@romejs/string-markup/Grid.ts
@@ -436,14 +436,11 @@ export default class Grid {
const reversed = tag.attributes.reversed === 'true';
const startOffset: number = Number(tag.attributes.start) || 0;
- if (reversed) {
- items = items.reverse();
- }
-
const highestNumSize = humanizeNumber(items.length + startOffset).length;
for (let i = 0; i < items.length; i++) {
const item = items[i];
+
let num = startOffset;
if (reversed) {
num += items.length - i;

Capture inside of Reporter#processedList