toastdotdev/toast

0/max int sources compiled

Closed this issue · 2 comments

when compiling sources, the progress is set to 0/MAX_INT. That is both incorrect and confusing, although it doesn't affect actual behavior.

The offending progress bar is this one:

let pb2 = Arc::new(ProgressBar::new_spinner());
pb2.enable_steady_tick(120);
pb2.set_style(
ProgressStyle::default_spinner()
// For more spinners check out the cli-spinners project:
// https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json
.tick_strings(&["▹▹▹", "▸▹▹", "▹▸▹", "▹▹▸", "▪▪▪"])
.template("{spinner:.blue} [{elapsed}] {pos}/{len} {wide_msg}"),
);
pb2.set_message("compiling...");
pb2.tick();
for x in v.clone() {
match x {
Event::CreatePage(CreatePage { slug, .. }) => {
pb2.inc(1);
pb2.set_message(slug.as_str());
compile_js(
&slug,
&OutputFile {
dest: format!("{}.js", slug.trim_matches('/')),
},
IncrementalOpts {
debug,
project_root_dir: &project_root_dir,
output_dir: output_dir.clone(),
npm_bin_dir: npm_bin_dir.clone(),
import_map: import_map.clone(),
},
&mut cache,
&tmp_dir,
)?;
}
}
}
pb2.abandon_with_message("sources compiled");
and it should be changed to either be like pb1 or if we have the total list we should display 0/N instead of 0/MAX_INT

@ChristopherBiscardi I'll take a stab at this :)

This was resolved in 0.3.14 for me