From 9d259b6073620f784da783bfe8f50c80334b59ef Mon Sep 17 00:00:00 2001 From: Miles Murgaw Date: Fri, 14 Jul 2023 18:30:27 -0400 Subject: [PATCH 1/7] revision: remove nestedness --- packages/cli/src/cli/{autoformat/mod.rs => autoformat.rs} | 0 packages/cli/src/cli/{build/mod.rs => build.rs} | 0 packages/cli/src/cli/{clean/mod.rs => clean.rs} | 0 packages/cli/src/cli/{config/mod.rs => config.rs} | 4 ++-- packages/cli/src/cli/{create/mod.rs => create.rs} | 0 packages/cli/src/cli/{plugin/mod.rs => plugin.rs} | 0 packages/cli/src/cli/{serve/mod.rs => serve.rs} | 0 packages/cli/src/cli/{tool/mod.rs => tool.rs} | 0 packages/cli/src/cli/{translate/mod.rs => translate.rs} | 2 +- 9 files changed, 3 insertions(+), 3 deletions(-) rename packages/cli/src/cli/{autoformat/mod.rs => autoformat.rs} (100%) rename packages/cli/src/cli/{build/mod.rs => build.rs} (100%) rename packages/cli/src/cli/{clean/mod.rs => clean.rs} (100%) rename packages/cli/src/cli/{config/mod.rs => config.rs} (92%) rename packages/cli/src/cli/{create/mod.rs => create.rs} (100%) rename packages/cli/src/cli/{plugin/mod.rs => plugin.rs} (100%) rename packages/cli/src/cli/{serve/mod.rs => serve.rs} (100%) rename packages/cli/src/cli/{tool/mod.rs => tool.rs} (100%) rename packages/cli/src/cli/{translate/mod.rs => translate.rs} (98%) diff --git a/packages/cli/src/cli/autoformat/mod.rs b/packages/cli/src/cli/autoformat.rs similarity index 100% rename from packages/cli/src/cli/autoformat/mod.rs rename to packages/cli/src/cli/autoformat.rs diff --git a/packages/cli/src/cli/build/mod.rs b/packages/cli/src/cli/build.rs similarity index 100% rename from packages/cli/src/cli/build/mod.rs rename to packages/cli/src/cli/build.rs diff --git a/packages/cli/src/cli/clean/mod.rs b/packages/cli/src/cli/clean.rs similarity index 100% rename from packages/cli/src/cli/clean/mod.rs rename to packages/cli/src/cli/clean.rs diff --git a/packages/cli/src/cli/config/mod.rs b/packages/cli/src/cli/config.rs similarity index 92% rename from packages/cli/src/cli/config/mod.rs rename to packages/cli/src/cli/config.rs index 5f9fa20d0..49d369802 100644 --- a/packages/cli/src/cli/config/mod.rs +++ b/packages/cli/src/cli/config.rs @@ -41,7 +41,7 @@ impl Config { return Ok(()); } let mut file = File::create(conf_path)?; - let content = String::from(include_str!("../../assets/dioxus.toml")) + let content = String::from(include_str!("../assets/dioxus.toml")) .replace("{{project-name}}", &name) .replace("{{default-platform}}", &platform); file.write_all(content.as_bytes())?; @@ -53,7 +53,7 @@ impl Config { Config::CustomHtml {} => { let html_path = crate_root.join("index.html"); let mut file = File::create(html_path)?; - let content = include_str!("../../assets/index.html"); + let content = include_str!("../assets/index.html"); file.write_all(content.as_bytes())?; log::info!("🚩 Create custom html file done."); } diff --git a/packages/cli/src/cli/create/mod.rs b/packages/cli/src/cli/create.rs similarity index 100% rename from packages/cli/src/cli/create/mod.rs rename to packages/cli/src/cli/create.rs diff --git a/packages/cli/src/cli/plugin/mod.rs b/packages/cli/src/cli/plugin.rs similarity index 100% rename from packages/cli/src/cli/plugin/mod.rs rename to packages/cli/src/cli/plugin.rs diff --git a/packages/cli/src/cli/serve/mod.rs b/packages/cli/src/cli/serve.rs similarity index 100% rename from packages/cli/src/cli/serve/mod.rs rename to packages/cli/src/cli/serve.rs diff --git a/packages/cli/src/cli/tool/mod.rs b/packages/cli/src/cli/tool.rs similarity index 100% rename from packages/cli/src/cli/tool/mod.rs rename to packages/cli/src/cli/tool.rs diff --git a/packages/cli/src/cli/translate/mod.rs b/packages/cli/src/cli/translate.rs similarity index 98% rename from packages/cli/src/cli/translate/mod.rs rename to packages/cli/src/cli/translate.rs index 81f0da3e6..a922d428d 100644 --- a/packages/cli/src/cli/translate/mod.rs +++ b/packages/cli/src/cli/translate.rs @@ -130,7 +130,7 @@ fn determine_input(file: Option, raw: Option) -> Result #[test] fn generates_svgs() { - let st = include_str!("../../../tests/svg.html"); + let st = include_str!("../../tests/svg.html"); let out = convert_html_to_formatted_rsx(&html_parser::Dom::parse(st).unwrap(), true); From fa97f5450fbec15513d735b4ba7cbace23b54474 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 14 Jul 2023 16:16:13 -0700 Subject: [PATCH 2/7] add nicer debug messaging in trace level for hydration --- packages/web/src/rehydrate.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/web/src/rehydrate.rs b/packages/web/src/rehydrate.rs index 9af23534b..8af7da16d 100644 --- a/packages/web/src/rehydrate.rs +++ b/packages/web/src/rehydrate.rs @@ -115,6 +115,12 @@ impl WebsysDom { node: &TemplateNode, last_node_was_static_text: &mut bool, ) -> Result<(), RehydrationError> { + log::trace!("rehydrate template node: {:?}", node); + if let Ok(current_child) = current_child { + if log::log_enabled!(log::Level::Trace) { + web_sys::console::log_1(¤t_child.clone().into()); + } + } match node { TemplateNode::Element { children, attrs, .. @@ -198,6 +204,12 @@ impl WebsysDom { dynamic: &DynamicNode, last_node_was_static_text: &mut bool, ) -> Result<(), RehydrationError> { + log::trace!("rehydrate dynamic node: {:?}", dynamic); + if let Ok(current_child) = current_child { + if log::log_enabled!(log::Level::Trace) { + web_sys::console::log_1(¤t_child.clone().into()); + } + } match dynamic { dioxus_core::DynamicNode::Text(VText { id, .. }) => { // skip comment separator before node From 41fd7a10402b0e8ac7c8400e4d158f5684f3350b Mon Sep 17 00:00:00 2001 From: Miles Murgaw Date: Fri, 14 Jul 2023 20:06:54 -0400 Subject: [PATCH 3/7] feat: bin flag for serve and build --- packages/cli/src/cli/autoformat.rs | 2 +- packages/cli/src/cli/build.rs | 2 +- packages/cli/src/cli/cfg.rs | 8 ++++++++ packages/cli/src/cli/clean.rs | 2 +- packages/cli/src/cli/config.rs | 2 +- packages/cli/src/cli/serve.rs | 2 +- packages/cli/src/config.rs | 23 +++++++++++++++-------- 7 files changed, 28 insertions(+), 13 deletions(-) diff --git a/packages/cli/src/cli/autoformat.rs b/packages/cli/src/cli/autoformat.rs index 257e237f2..fbc34402b 100644 --- a/packages/cli/src/cli/autoformat.rs +++ b/packages/cli/src/cli/autoformat.rs @@ -78,7 +78,7 @@ impl Autoformat { /// /// Doesn't do mod-descending, so it will still try to format unreachable files. TODO. async fn autoformat_project(check: bool) -> Result<()> { - let crate_config = crate::CrateConfig::new()?; + let crate_config = crate::CrateConfig::new(None)?; let mut files_to_format = vec![]; collect_rs_files(&crate_config.crate_dir, &mut files_to_format); diff --git a/packages/cli/src/cli/build.rs b/packages/cli/src/cli/build.rs index b4df33a42..9e5ff414b 100644 --- a/packages/cli/src/cli/build.rs +++ b/packages/cli/src/cli/build.rs @@ -13,7 +13,7 @@ pub struct Build { impl Build { pub fn build(self) -> Result<()> { - let mut crate_config = crate::CrateConfig::new()?; + let mut crate_config = crate::CrateConfig::new(self.build.bin)?; // change the release state. crate_config.with_release(self.build.release); diff --git a/packages/cli/src/cli/cfg.rs b/packages/cli/src/cli/cfg.rs index 30ca89ce9..dcadc7ba4 100644 --- a/packages/cli/src/cli/cfg.rs +++ b/packages/cli/src/cli/cfg.rs @@ -32,6 +32,10 @@ pub struct ConfigOptsBuild { /// Space separated list of features to activate #[clap(long)] pub features: Option>, + + /// The binary to serve + #[clap(long)] + pub bin: Option, } #[derive(Clone, Debug, Default, Deserialize, Parser)] @@ -86,6 +90,10 @@ pub struct ConfigOptsServe { /// Space separated list of features to activate #[clap(long)] pub features: Option>, + + /// The binary to serve + #[clap(long)] + pub bin: Option, } /// Ensure the given value for `--public-url` is formatted correctly. diff --git a/packages/cli/src/cli/clean.rs b/packages/cli/src/cli/clean.rs index d380f5265..5c51a37ad 100644 --- a/packages/cli/src/cli/clean.rs +++ b/packages/cli/src/cli/clean.rs @@ -7,7 +7,7 @@ pub struct Clean {} impl Clean { pub fn clean(self) -> Result<()> { - let crate_config = crate::CrateConfig::new()?; + let crate_config = crate::CrateConfig::new(None)?; let output = Command::new("cargo") .arg("clean") diff --git a/packages/cli/src/cli/config.rs b/packages/cli/src/cli/config.rs index 49d369802..cde29ef6a 100644 --- a/packages/cli/src/cli/config.rs +++ b/packages/cli/src/cli/config.rs @@ -48,7 +48,7 @@ impl Config { log::info!("🚩 Init config file completed."); } Config::FormatPrint {} => { - println!("{:#?}", crate::CrateConfig::new()?.dioxus_config); + println!("{:#?}", crate::CrateConfig::new(None)?.dioxus_config); } Config::CustomHtml {} => { let html_path = crate_root.join("index.html"); diff --git a/packages/cli/src/cli/serve.rs b/packages/cli/src/cli/serve.rs index 2e0477d42..e1d7f4be4 100644 --- a/packages/cli/src/cli/serve.rs +++ b/packages/cli/src/cli/serve.rs @@ -16,7 +16,7 @@ pub struct Serve { impl Serve { pub async fn serve(self) -> Result<()> { - let mut crate_config = crate::CrateConfig::new()?; + let mut crate_config = crate::CrateConfig::new(self.serve.bin)?; // change the relase state. crate_config.with_hot_reload(self.serve.hot_reload); diff --git a/packages/cli/src/config.rs b/packages/cli/src/config.rs index f9117f6e5..db752b509 100644 --- a/packages/cli/src/config.rs +++ b/packages/cli/src/config.rs @@ -176,14 +176,19 @@ pub enum ExecutableType { } impl CrateConfig { - pub fn new() -> Result { + pub fn new(bin: Option) -> Result { let dioxus_config = DioxusConfig::load()?.unwrap_or_default(); + let crate_root = crate::cargo::crate_root()?; + let crate_dir = if let Some(package) = &dioxus_config.application.sub_package { - crate::cargo::crate_root()?.join(package) + crate_root.join(package) + } else if let Some(bin) = bin { + crate_root.join(bin) } else { - crate::cargo::crate_root()? + crate_root }; + let meta = crate::cargo::Metadata::get()?; let workspace_dir = meta.workspace_root; let target_dir = meta.target_directory; @@ -202,8 +207,9 @@ impl CrateConfig { let manifest = cargo_toml::Manifest::from_path(cargo_def).unwrap(); - let output_filename = { - match &manifest.package.as_ref().unwrap().default_run { + let mut output_filename = String::from("dioxus_app"); + if let Some(package) = &manifest.package.as_ref() { + output_filename = match &package.default_run { Some(default_run_target) => default_run_target.to_owned(), None => manifest .bin @@ -216,9 +222,10 @@ impl CrateConfig { .or(manifest.bin.first()) .or(manifest.lib.as_ref()) .and_then(|prod| prod.name.clone()) - .expect("No executable or library found from cargo metadata."), - } - }; + .unwrap_or(String::from("dioxus_app")), + }; + } + let executable = ExecutableType::Binary(output_filename); let release = false; From d710b92696975918cc5be9ded6053623bde98306 Mon Sep 17 00:00:00 2001 From: Miles Murgaw Date: Fri, 14 Jul 2023 20:41:27 -0400 Subject: [PATCH 4/7] fix: do it correctly --- packages/cli/src/cli/build.rs | 4 ++-- packages/cli/src/cli/cfg.rs | 8 -------- packages/cli/src/cli/clean.rs | 4 ++-- packages/cli/src/cli/mod.rs | 4 ++++ packages/cli/src/cli/serve.rs | 4 ++-- packages/cli/src/config.rs | 17 ++++++++++++++--- packages/cli/src/main.rs | 8 ++++---- 7 files changed, 28 insertions(+), 21 deletions(-) diff --git a/packages/cli/src/cli/build.rs b/packages/cli/src/cli/build.rs index 9e5ff414b..148a4ab76 100644 --- a/packages/cli/src/cli/build.rs +++ b/packages/cli/src/cli/build.rs @@ -12,8 +12,8 @@ pub struct Build { } impl Build { - pub fn build(self) -> Result<()> { - let mut crate_config = crate::CrateConfig::new(self.build.bin)?; + pub fn build(self, bin: Option) -> Result<()> { + let mut crate_config = crate::CrateConfig::new(bin)?; // change the release state. crate_config.with_release(self.build.release); diff --git a/packages/cli/src/cli/cfg.rs b/packages/cli/src/cli/cfg.rs index dcadc7ba4..30ca89ce9 100644 --- a/packages/cli/src/cli/cfg.rs +++ b/packages/cli/src/cli/cfg.rs @@ -32,10 +32,6 @@ pub struct ConfigOptsBuild { /// Space separated list of features to activate #[clap(long)] pub features: Option>, - - /// The binary to serve - #[clap(long)] - pub bin: Option, } #[derive(Clone, Debug, Default, Deserialize, Parser)] @@ -90,10 +86,6 @@ pub struct ConfigOptsServe { /// Space separated list of features to activate #[clap(long)] pub features: Option>, - - /// The binary to serve - #[clap(long)] - pub bin: Option, } /// Ensure the given value for `--public-url` is formatted correctly. diff --git a/packages/cli/src/cli/clean.rs b/packages/cli/src/cli/clean.rs index 5c51a37ad..a1e29127f 100644 --- a/packages/cli/src/cli/clean.rs +++ b/packages/cli/src/cli/clean.rs @@ -6,8 +6,8 @@ use super::*; pub struct Clean {} impl Clean { - pub fn clean(self) -> Result<()> { - let crate_config = crate::CrateConfig::new(None)?; + pub fn clean(self, bin: Option) -> Result<()> { + let crate_config = crate::CrateConfig::new(bin)?; let output = Command::new("cargo") .arg("clean") diff --git a/packages/cli/src/cli/mod.rs b/packages/cli/src/cli/mod.rs index 0dff0feff..59db99d3a 100644 --- a/packages/cli/src/cli/mod.rs +++ b/packages/cli/src/cli/mod.rs @@ -36,6 +36,10 @@ pub struct Cli { /// Enable verbose logging. #[clap(short)] pub v: bool, + + /// Specify bin target + #[clap(global = true, long)] + pub bin: Option, } #[derive(Parser)] diff --git a/packages/cli/src/cli/serve.rs b/packages/cli/src/cli/serve.rs index e1d7f4be4..e50eb0f38 100644 --- a/packages/cli/src/cli/serve.rs +++ b/packages/cli/src/cli/serve.rs @@ -15,8 +15,8 @@ pub struct Serve { } impl Serve { - pub async fn serve(self) -> Result<()> { - let mut crate_config = crate::CrateConfig::new(self.serve.bin)?; + pub async fn serve(self, bin: Option) -> Result<()> { + let mut crate_config = crate::CrateConfig::new(bin)?; // change the relase state. crate_config.with_hot_reload(self.serve.hot_reload); diff --git a/packages/cli/src/config.rs b/packages/cli/src/config.rs index db752b509..53c1c7723 100644 --- a/packages/cli/src/config.rs +++ b/packages/cli/src/config.rs @@ -17,8 +17,19 @@ fn default_plugin() -> toml::Value { } impl DioxusConfig { - pub fn load() -> crate::error::Result> { - let Ok(crate_dir) = crate::cargo::crate_root() else { return Ok(None); }; + pub fn load(bin: Option) -> crate::error::Result> { + let crate_dir = crate::cargo::crate_root(); + + let crate_dir = match crate_dir { + Ok(dir) => { + if let Some(bin) = bin { + dir.join(bin) + } else { + dir + } + } + Err(_) => return Ok(None), + }; // we support either `Dioxus.toml` or `Cargo.toml` let Some(dioxus_conf_file) = acquire_dioxus_toml(crate_dir) else { @@ -177,7 +188,7 @@ pub enum ExecutableType { impl CrateConfig { pub fn new(bin: Option) -> Result { - let dioxus_config = DioxusConfig::load()?.unwrap_or_default(); + let dioxus_config = DioxusConfig::load(bin.clone())?.unwrap_or_default(); let crate_root = crate::cargo::crate_root()?; diff --git a/packages/cli/src/main.rs b/packages/cli/src/main.rs index f2007aa43..7f4058826 100644 --- a/packages/cli/src/main.rs +++ b/packages/cli/src/main.rs @@ -13,7 +13,7 @@ async fn main() -> anyhow::Result<()> { set_up_logging(); - let _dioxus_config = DioxusConfig::load() + let _dioxus_config = DioxusConfig::load(args.bin.clone()) .map_err(|e| anyhow!("Failed to load `Dioxus.toml` because: {e}"))? .unwrap_or_else(|| { log::warn!("You appear to be creating a Dioxus project from scratch; we will use the default config"); @@ -30,15 +30,15 @@ async fn main() -> anyhow::Result<()> { .map_err(|e| anyhow!("🚫 Translation of HTML into RSX failed: {}", e)), Build(opts) => opts - .build() + .build(args.bin.clone()) .map_err(|e| anyhow!("🚫 Building project failed: {}", e)), Clean(opts) => opts - .clean() + .clean(args.bin.clone()) .map_err(|e| anyhow!("🚫 Cleaning project failed: {}", e)), Serve(opts) => opts - .serve() + .serve(args.bin.clone()) .await .map_err(|e| anyhow!("🚫 Serving project failed: {}", e)), From 4b70b1ce96248700c8399736af01d0ba2ae48660 Mon Sep 17 00:00:00 2001 From: Miles Murgaw Date: Mon, 17 Jul 2023 14:30:05 -0400 Subject: [PATCH 5/7] revision: find bin from workspace Cargo.toml --- packages/cli/src/cli/mod.rs | 2 +- packages/cli/src/main.rs | 50 ++++++++++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/cli/mod.rs b/packages/cli/src/cli/mod.rs index 59db99d3a..55f79e7eb 100644 --- a/packages/cli/src/cli/mod.rs +++ b/packages/cli/src/cli/mod.rs @@ -39,7 +39,7 @@ pub struct Cli { /// Specify bin target #[clap(global = true, long)] - pub bin: Option, + pub bin: Option, } #[derive(Parser)] diff --git a/packages/cli/src/main.rs b/packages/cli/src/main.rs index 9085c619b..45881f906 100644 --- a/packages/cli/src/main.rs +++ b/packages/cli/src/main.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use anyhow::anyhow; use clap::Parser; use dioxus_cli::*; @@ -7,13 +9,53 @@ use dioxus_cli::plugin::PluginManager; use Commands::*; +fn get_bin(bin: Option) -> Result> { + const ERR_MESSAGE: &str = "The `--bin` flag has to be ran in a Cargo workspace."; + + if let Some(ref bin) = bin { + let manifest = cargo_toml::Manifest::from_path("./Cargo.toml") + .map_err(|_| Error::CargoError(ERR_MESSAGE.to_string()))?; + + if let Some(workspace) = manifest.workspace { + for item in workspace.members.iter() { + let path = PathBuf::from(item); + + if !path.exists() { + continue; + } + + if !path.is_dir() { + continue; + } + + if path.ends_with(bin.clone()) { + return Ok(Some(path)); + } + } + } else { + return Err(Error::CargoError(ERR_MESSAGE.to_string())); + } + } + + // If the bin exists but we couldn't find it + if bin.is_some() { + return Err(Error::CargoError( + "The specified bin does not exist.".to_string(), + )); + } + + Ok(None) +} + #[tokio::main] async fn main() -> anyhow::Result<()> { let args = Cli::parse(); set_up_logging(); - let _dioxus_config = DioxusConfig::load(args.bin.clone()) + let bin = get_bin(args.bin)?; + + let _dioxus_config = DioxusConfig::load(bin.clone()) .map_err(|e| anyhow!("Failed to load Dioxus config because: {e}"))? .unwrap_or_else(|| { log::warn!("You appear to be creating a Dioxus project from scratch; we will use the default config"); @@ -30,15 +72,15 @@ async fn main() -> anyhow::Result<()> { .map_err(|e| anyhow!("🚫 Translation of HTML into RSX failed: {}", e)), Build(opts) => opts - .build(args.bin.clone()) + .build(bin.clone()) .map_err(|e| anyhow!("🚫 Building project failed: {}", e)), Clean(opts) => opts - .clean(args.bin.clone()) + .clean(bin.clone()) .map_err(|e| anyhow!("🚫 Cleaning project failed: {}", e)), Serve(opts) => opts - .serve(args.bin.clone()) + .serve(bin.clone()) .await .map_err(|e| anyhow!("🚫 Serving project failed: {}", e)), From f2a3e104d43c2714ab6297debd7f294bddecee25 Mon Sep 17 00:00:00 2001 From: leahiel <71794961+leahiel@users.noreply.github.com> Date: Mon, 17 Jul 2023 18:18:11 -0400 Subject: [PATCH 6/7] Fixed typo in Router guide getting-started.md (#1208) --- docs/router/src/guide/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/router/src/guide/getting-started.md b/docs/router/src/guide/getting-started.md index 7bce3c30a..dbecf8a7a 100644 --- a/docs/router/src/guide/getting-started.md +++ b/docs/router/src/guide/getting-started.md @@ -6,7 +6,7 @@ If you haven't already, make sure you install the [dioxus-cli](https://dioxuslab ``` $ cargo install dioxus-cli ... -$ rustup target add wasm32-unkown-unknown +$ rustup target add wasm32-unknown-unknown ... ``` From 056effb87cde37d335d6ba0cc32967c867b694b9 Mon Sep 17 00:00:00 2001 From: Miles Murgaw Date: Mon, 17 Jul 2023 18:24:03 -0400 Subject: [PATCH 7/7] feat: --bin docs --- packages/cli/docs/src/cmd/build.md | 9 +++++++++ packages/cli/docs/src/cmd/clean.md | 11 ++++++++++- packages/cli/docs/src/cmd/serve.md | 11 ++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/cli/docs/src/cmd/build.md b/packages/cli/docs/src/cmd/build.md index 1fb892475..5fde77ef2 100644 --- a/packages/cli/docs/src/cmd/build.md +++ b/packages/cli/docs/src/cmd/build.md @@ -13,6 +13,7 @@ OPTIONS: --example [default: ""] --platform [default: "default_platform"] --release [default: false] + --bin [default: None] ``` You can use this command to build a project: @@ -37,6 +38,14 @@ dioxus build --platform desktop dioxus build --platform web ``` +## Specify workspace bin + +You can add the `--bin` option to select which crate you want Dioxus to build: + +``` +dioxus build --bin app +``` + ## Build Example You can use the `example` option to select a example to build: diff --git a/packages/cli/docs/src/cmd/clean.md b/packages/cli/docs/src/cmd/clean.md index bbb3a132e..72f2342a6 100644 --- a/packages/cli/docs/src/cmd/clean.md +++ b/packages/cli/docs/src/cmd/clean.md @@ -7,7 +7,10 @@ dioxus-clean Clean build artifacts USAGE: - dioxus clean + dioxus clean [OPTIONS] + +OPTIONS: + --bin [default: None] ``` # Example @@ -16,3 +19,9 @@ USAGE: dioxus clean ``` +# Specify workspace bin +You can add the `--bin` option to select which crate you want Dioxus to clean artifacts from: + +``` +dioxus clean --bin app +``` \ No newline at end of file diff --git a/packages/cli/docs/src/cmd/serve.md b/packages/cli/docs/src/cmd/serve.md index 41abf5350..695f153bb 100644 --- a/packages/cli/docs/src/cmd/serve.md +++ b/packages/cli/docs/src/cmd/serve.md @@ -13,7 +13,8 @@ OPTIONS: --example [default: ""] --platform [default: "default_platform"] --release [default: false] - --hot-reload [default: false]ß + --hot-reload [default: false] + --bin [default: None] ``` You can use this command to build project and start a dev server: @@ -31,6 +32,14 @@ You can use the `example` option to serve a example: dioxus serve --exmaple test ``` +## Specify workspace bin + +You can add the `--bin` option to select which crate you want Dioxus to build and serve: + +``` +dioxus serve --bin app +``` + ## Open Browser You can add the `--open` option to open system default browser when server startup: