cli-reporter: Add persistent option, and fix remote progress not having options
MODIFY
packages/@romejs/cli-diagnostics/DiagnosticsPrinter.ts
packages/@romejs/cli-diagnostics/DiagnosticsPrinter.ts
@@ -499,7 +499,7 @@ export default class DiagnosticsPrinter extends Error {
const {origins} = diag;
if (origins.length > 0) {
- reporter.spacer();
+ reporter.optionalSpacer();
reporter.info('Why are you seeing this diagnostic?');
reporter.spacer();
reporter.list(

MODIFY
packages/@romejs/cli-reporter/Progress.ts
packages/@romejs/cli-reporter/Progress.ts
@@ -22,13 +22,15 @@ export type ProgressOptions = {
initDelay?: number;
elapsed?: boolean;
eta?: boolean;
+ persistent?: boolean;
};
-const DEFAULT_PROGRESS_OPTIONS = {
+const DEFAULT_PROGRESS_OPTIONS: ProgressOptions = {
name: undefined,
initDelay: undefined,
elapsed: true,
eta: true,
+ persistent: false,
};
export default class Progress {
@@ -233,7 +235,11 @@ export default class Progress {
}
// Progress complete
- if (this.total !== undefined && this.current >= this.total) {
+ if (
+ this.total !== undefined &&
+ this.current >= this.total &&
+ !this.opts.persistent
+ ) {
this.end();
}
}

MODIFY
packages/@romejs/cli-reporter/Reporter.ts
packages/@romejs/cli-reporter/Reporter.ts
@@ -269,7 +269,7 @@ export default class Reporter {
if (msg.type === 'PROGRESS_CREATE') {
this.remoteClientProgressBars.set(
msg.id,
- this.progressLocal({}, () => {
+ this.progressLocal(msg.opts, () => {
this.sendRemoteServerMessage.call({
type: 'ENDED',
id: msg.id,

cli-reporter: Add persistent option, and fix remote progress not having options