mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 14:18:27 +00:00
feat: commit prettier_build
This commit is contained in:
parent
526a88cab1
commit
78c78548e8
2 changed files with 26 additions and 18 deletions
|
@ -368,7 +368,7 @@ fn prettier_build(mut cmd: Command) -> anyhow::Result<Vec<Diagnostic>> {
|
|||
Message::BuildFinished(finished) => {
|
||||
if finished.success {
|
||||
pb.finish_and_clear();
|
||||
println!("Done in");
|
||||
log::info!("Build done.");
|
||||
} else {
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
|
|
@ -342,7 +342,7 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> {
|
|||
elapsed_time: first_build_result.elapsed_time,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
let file_service_config = config.clone();
|
||||
let file_service = ServiceBuilder::new()
|
||||
.and_then(
|
||||
|
@ -434,18 +434,6 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions)
|
|||
profile = config.custom_profile.as_ref().unwrap().to_string();
|
||||
}
|
||||
let hot_reload = if config.hot_reload { "RSX" } else { "Normal" };
|
||||
let tools_str = format!(
|
||||
"{:?}",
|
||||
config
|
||||
.dioxus_config
|
||||
.application
|
||||
.tools
|
||||
.clone()
|
||||
.unwrap_or_default()
|
||||
.iter()
|
||||
.map(|d| d.0.clone())
|
||||
.collect::<Vec<String>>()
|
||||
);
|
||||
let crate_root = crate::cargo::crate_root().unwrap();
|
||||
let custom_html_file = if crate_root.join("index.html").is_file() {
|
||||
"Custom [index.html]"
|
||||
|
@ -494,15 +482,35 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions)
|
|||
println!("");
|
||||
println!("\t> Profile : {}", profile.green());
|
||||
println!("\t> Hot Reload : {}", hot_reload.cyan());
|
||||
println!("\t> Enabled Tools : {}", tools_str.yellow());
|
||||
println!("\t> Index Template : {}", custom_html_file.green());
|
||||
println!("\t> URL Rewrite [index_on_404] : {}", url_rewrite.purple());
|
||||
println!("");
|
||||
println!(
|
||||
"\t> Build Time Use : {} millis",
|
||||
options.elapsed_time.to_string().green().bold()
|
||||
);
|
||||
println!("");
|
||||
|
||||
if options.changed.len() <= 0 {
|
||||
log::info!("{}", "Server startup completed.".green().bold());
|
||||
if options.warnings.len() == 0 {
|
||||
log::info!("{}\n", "A perfect compilation!".green().bold());
|
||||
} else {
|
||||
log::info!("{}", "Project rebuild completed.".green().bold());
|
||||
log::warn!(
|
||||
"{}\n",
|
||||
format!(
|
||||
"There were {} warning messages during the build: ",
|
||||
options.warnings.len() - 1
|
||||
)
|
||||
.yellow()
|
||||
.bold()
|
||||
);
|
||||
for info in &options.warnings {
|
||||
if info.message == format!("{} warnings emitted", options.warnings.len() - 1) {
|
||||
continue;
|
||||
}
|
||||
if let Some(val) = info.rendered.clone() {
|
||||
log::warn!("{}", val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue