Merge pull request #30 from mrxiaozhuox/master

Upgrade `axum` version
This commit is contained in:
YuKun Liu authored and GitHub committed 2022-04-18 09:03:30 +08:00
commit 10cd2ba59c
8 files changed
+14 -27

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ chrono = "0.4.19"
anyhow = "1.0.53" anyhow = "1.0.53"
hyper = "0.14.17" hyper = "0.14.17"
axum = { version = "0.4.5", features = ["ws", "headers"] } axum = { version = "0.5.1", features = ["ws", "headers"] }
tower-http = { version = "0.2.2", features = ["fs", "trace"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] }
headers = "0.3.7" headers = "0.3.7"
# tools download # tools download
+4 -7
View File
@@ -132,7 +132,7 @@ pub fn build(config: &CrateConfig) -> Result<()> {
); );
} }
} }
// this code will copy all public file to the output dir // this code will copy all public file to the output dir
let copy_options = fs_extra::dir::CopyOptions { let copy_options = fs_extra::dir::CopyOptions {
overwrite: true, overwrite: true,
@@ -204,18 +204,15 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> {
let mut res_path = match &config.executable { let mut res_path = match &config.executable {
crate::ExecutableType::Binary(name) | crate::ExecutableType::Lib(name) => { crate::ExecutableType::Binary(name) | crate::ExecutableType::Lib(name) => {
file_name = name.clone(); file_name = name.clone();
config config.target_dir.join(release_type).join(name)
.target_dir
.join(release_type.to_string())
.join(name.to_string())
} }
crate::ExecutableType::Example(name) => { crate::ExecutableType::Example(name) => {
file_name = name.clone(); file_name = name.clone();
config config
.target_dir .target_dir
.join(release_type.to_string()) .join(release_type)
.join("examples") .join("examples")
.join(name.to_string()) .join(name)
} }
}; };
-1
View File
@@ -12,7 +12,6 @@ impl Build {
pub fn build(self) -> Result<()> { pub fn build(self) -> Result<()> {
let mut crate_config = crate::CrateConfig::new()?; let mut crate_config = crate::CrateConfig::new()?;
// change the release state. // change the release state.
crate_config.with_release(self.build.release); crate_config.with_release(self.build.release);
+1 -1
View File
@@ -21,7 +21,7 @@ pub enum Config {
/// Format print Dioxus config. /// Format print Dioxus config.
FormatPrint {}, FormatPrint {},
/// Create a custom html file. /// Create a custom html file.
CustomHtml {} CustomHtml {},
} }
impl Config { impl Config {
+1 -1
View File
@@ -4,8 +4,8 @@ pub mod clean;
pub mod config; pub mod config;
pub mod create; pub mod create;
pub mod serve; pub mod serve;
pub mod translate;
pub mod tool; pub mod tool;
pub mod translate;
use crate::{ use crate::{
cfg::{ConfigOptsBuild, ConfigOptsServe}, cfg::{ConfigOptsBuild, ConfigOptsServe},
+4 -11
View File
@@ -1,9 +1,9 @@
use super::*;
use std::{ use std::{
io::Write, io::Write,
path::PathBuf, path::PathBuf,
process::{Command, Stdio}, process::{Command, Stdio},
}; };
use super::*;
/// Run the WASM project on dev-server /// Run the WASM project on dev-server
#[derive(Clone, Debug, Parser)] #[derive(Clone, Debug, Parser)]
@@ -47,16 +47,9 @@ impl Serve {
if cfg!(windows) { if cfg!(windows) {
file.set_extension("exe"); file.set_extension("exe");
} }
Command::new( Command::new(crate_config.out_dir.join(file).to_str().unwrap())
crate_config .stdout(Stdio::inherit())
.out_dir .output()?;
.join(file)
.to_str()
.unwrap()
.to_string(),
)
.stdout(Stdio::inherit())
.output()?;
} }
} }
return Ok(()); return Ok(());
+2 -4
View File
@@ -11,9 +11,7 @@ pub enum Tool {
/// Get default app install path. /// Get default app install path.
AppPath {}, AppPath {},
/// Install a new tool. /// Install a new tool.
Add { Add { name: String },
name: String
}
} }
impl Tool { impl Tool {
@@ -33,7 +31,7 @@ impl Tool {
} }
Tool::Add { name } => { Tool::Add { name } => {
let tool_list = tools::tool_list(); let tool_list = tools::tool_list();
if !tool_list.contains(&name.as_str()) { if !tool_list.contains(&name.as_str()) {
log::error!("Tool {name} not found."); log::error!("Tool {name} not found.");
return Ok(()); return Ok(());
+1 -1
View File
@@ -1,6 +1,6 @@
use crate::error::Result; use crate::error::Result;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{fs::File, io::Read, path::PathBuf, collections::HashMap}; use std::{collections::HashMap, fs::File, io::Read, path::PathBuf};
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DioxusConfig { pub struct DioxusConfig {