Rename Reporter#spacer to Reporter#br
MODIFY
packages/@romejs/cli-diagnostics/DiagnosticsPrinter.ts
packages/@romejs/cli-diagnostics/DiagnosticsPrinter.ts
@@ -503,7 +503,7 @@ export default class DiagnosticsPrinter extends Error {
},
);
if (res.printed) {
- reporter.spacer();
+ reporter.br();
}
if (res.truncated) {
this.hasTruncatedDiagnostics = true;
@@ -515,9 +515,9 @@ export default class DiagnosticsPrinter extends Error {
const {origins} = diag;
if (origins !== undefined && origins.length > 0) {
- reporter.spacer();
+ reporter.br();
reporter.info('Why are you seeing this diagnostic?');
- reporter.spacer();
+ reporter.br();
reporter.list(
origins.map((origin) => {
let res = `<emphasis>${origin.category}</emphasis>`;

MODIFY
packages/@romejs/cli-diagnostics/printAdvice.ts
packages/@romejs/cli-diagnostics/printAdvice.ts
@@ -207,17 +207,17 @@ function printDiff(
const {legend} = item;
if (legend !== undefined) {
- opts.reporter.spacer();
+ opts.reporter.br();
opts.reporter.logAll(`<error>- ${escapeMarkup(legend.delete)}</error>`);
opts.reporter.logAll(`<success>+ ${escapeMarkup(legend.add)}</success>`);
- opts.reporter.spacer();
+ opts.reporter.br();
}
const hint = generateDiffHint(item.diff);
if (hint !== undefined) {
- opts.reporter.spacer();
+ opts.reporter.br();
printAdvice(hint, opts);
- opts.reporter.spacer();
+ opts.reporter.br();
}
return {
@@ -350,7 +350,7 @@ function printStacktrace(
const {title} = item;
if (title !== undefined) {
opts.reporter.info(escapeMarkup(title));
- opts.reporter.forceSpacer();
+ opts.reporter.br(true);
}
}
@@ -441,7 +441,7 @@ function printStacktrace(
opts,
);
if (!skipped) {
- opts.reporter.forceSpacer();
+ opts.reporter.br(true);
shownCodeFrames++;
}
}

MODIFY
packages/@romejs/cli-flags/Parser.ts
packages/@romejs/cli-flags/Parser.ts
@@ -519,7 +519,7 @@ export default class Parser<T> {
() => {
if (description !== undefined) {
reporter.logAll(description);
- reporter.forceSpacer();
+ reporter.br(true);
}
const commandParts = [programName];
@@ -543,7 +543,7 @@ export default class Parser<T> {
const {reporter} = this;
const {name, usage, description, examples} = command;
- reporter.forceSpacer();
+ reporter.br(true);
this.showUsageHelp(description, usage, name);
this.showHelpExamples(examples, name);
@@ -657,7 +657,7 @@ export default class Parser<T> {
: cmd.description}`;
}),
);
- reporter.spacer();
+ reporter.br();
}
reporter.info('To view help for a specific command run');
@@ -691,7 +691,7 @@ export default class Parser<T> {
const builtCommand = commandParts.join(' ');
- reporter.spacer();
+ reporter.br();
if (description !== undefined) {
reporter.logAll(description);
}

MODIFY
packages/@romejs/cli-reporter/Reporter.ts
packages/@romejs/cli-reporter/Reporter.ts
@@ -766,28 +766,28 @@ export default class Reporter {
//# SECTIONS
heading(text: string) {
- this.spacer();
+ this.br();
this.logAll(
`<inverse><emphasis>${text}</emphasis></inverse>`,
{
nonTTY: `# ${text}`,
},
);
- this.spacer();
+ this.br();
}
section(title: undefined | string, callback: () => void) {
this.hr(title === undefined ? undefined : `<emphasis>${title}</emphasis>`);
this.indent(() => {
callback();
- this.spacer();
+ this.br();
});
}
hr(text?: string) {
const {hasClearScreen} = this;
- this.spacer();
+ this.br();
if (hasClearScreen && text === undefined) {
return;
@@ -804,7 +804,7 @@ export default class Reporter {
this.logOneNoMarkup(stream, prefix + '\u2501'.repeat(barLength));
}
- this.spacer();
+ this.br();
}
async steps(
@@ -849,18 +849,14 @@ export default class Reporter {
this.logAll(`<dim>[${current}/${total}]</dim> ${msg}`);
}
- spacer() {
+ br(force: boolean = false) {
for (const stream of this.getStreams(false)) {
- if (!this.streamHasSpacer.has(stream)) {
+ if (!this.streamHasSpacer.has(stream) || force) {
this.logOne(stream, '');
}
}
}
- forceSpacer() {
- this.logAll('');
- }
-
wrapCallback: WrapperFactory = (callback) => {
const {wrapperFactory} = this;
if (wrapperFactory === undefined) {

MODIFY
packages/@romejs/cli-reporter/select.ts
packages/@romejs/cli-reporter/select.ts
@@ -206,7 +206,7 @@ export default async function select<Options extends SelectOptions>(
case 'c': {
if (key.ctrl) {
- reporter.forceSpacer();
+ reporter.br(true);
reporter.warn('Cancelled by user');
process.exit(1);
}
@@ -214,7 +214,7 @@ export default async function select<Options extends SelectOptions>(
}
case 'escape': {
- reporter.forceSpacer();
+ reporter.br(true);
reporter.warn('Cancelled by user');
process.exit(1);
return;

MODIFY
packages/@romejs/core/master/testing/TestRunner.ts
packages/@romejs/core/master/testing/TestRunner.ts
@@ -803,7 +803,7 @@ export default class TestRunner {
reporter.table(['File', '% Functions', '% Branches', '% Lines'], rows);
if (!showAllCoverage) {
- reporter.spacer();
+ reporter.br();
reporter.info(
'Additional coverage information available. Refine the executed tests or add the <emphasis>--show-all-coverage</emphasis> flag',
);

Rename Reporter#spacer to Reporter#br