Skip to content

Commit

Permalink
feat: Improve console output
Browse files Browse the repository at this point in the history
* Make output more consistent.
* Show shorter, relative destination path.
* Don’t start with a finish flag. :-)
  • Loading branch information
ddeboer committed Jun 10, 2024
1 parent b8cdc88 commit 5102930
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/lib/Pipeline.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ class Pipeline {
this.startTime = performance.now();
if (!(this.opts?.silent === true))
console.info(
chalk.cyan(`🏁 starting pipeline "${chalk.bold(this.name)}"`)
chalk.cyan(`▶ Starting pipeline ${chalk.bold(this.name)}`)
);
spinner = ora('validating pipeline');
spinner = ora('Validating pipeline');
if (!(this.opts?.silent === true)) spinner.start();
let startFromStage = 0;
try {
Expand Down Expand Up @@ -203,11 +203,11 @@ class Pipeline {
stage.on('end', (iris, statements) => {
if (!(this.opts?.silent === true))
spinner.succeed(
`stage "${chalk.bold(
`Stage “${chalk.bold(
stage.name
)}" resulted in ${statements.toLocaleString()} statement${
)} resulted in ${statements.toLocaleString()} statement${
statements === 1 ? '' : 's'
} in ${iris.toLocaleString()} iteration${iris === 1 ? '' : 's'}.`
} in ${iris.toLocaleString()} iteration${iris === 1 ? '' : 's'} (took ${prettyMilliseconds(performance.now() - startTime)})`

Check failure on line 210 in src/lib/Pipeline.class.ts

View workflow job for this annotation

GitHub Actions / test (lts/*)

Replace `iris·===·1·?·''·:·'s'` with `⏎··············iris·===·1·?·''·:·'s'⏎············`
);
resolve();
});
Expand All @@ -229,11 +229,11 @@ class Pipeline {
if (!(this.opts?.silent === true))
console.info(
chalk.green(
`✔ your pipeline "${chalk.bold(
`✔ Your pipeline ${chalk.bold(
this.name
)}" was completed in ${prettyMilliseconds(
)} was completed in ${prettyMilliseconds(
performance.now() - this.startTime
)} using ${memoryConsumption()} MB of memory.`
)} using ${memoryConsumption()} MB of memory`
)
);
}
Expand All @@ -243,7 +243,7 @@ class Pipeline {
if (!(this.opts?.silent === true)) spinner.start();
await this.destination.write(this, spinner);
if (!(this.opts?.silent === true))
spinner.suffixText = this.destination.path;
spinner.suffixText = `${chalk.bold(path.relative(process.cwd(), this.destination.path))}`;

Check failure on line 246 in src/lib/Pipeline.class.ts

View workflow job for this annotation

GitHub Actions / test (lts/*)

Replace `path.relative(process.cwd(),·this.destination.path)` with `⏎········path.relative(process.cwd(),·this.destination.path)⏎······`
if (!(this.opts?.silent === true)) spinner.succeed();
}

Expand All @@ -265,7 +265,7 @@ class Pipeline {
return;
}

spinner.text = `Running ${stage.name}:\n\n Processed elements: ${millify(
spinner.text = `Running stage “${chalk.bold(stage.name)}:\n\n Processed elements: ${millify(

Check failure on line 268 in src/lib/Pipeline.class.ts

View workflow job for this annotation

GitHub Actions / test (lts/*)

Replace `stage.name` with `⏎······stage.name⏎····`
iterationsProcessed
)}\n Generated quads: ${millify(
quadsGenerated
Expand Down

0 comments on commit 5102930

Please sign in to comment.