Make desktop fullstack work with the CLI (#2862)

* Make desktop fullstack work with the CLI
* Simplify desktop fullstack example
* move the profiles to the workspace
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-08-20 14:57:51 -07:00
1 parent 6a46a66c9a
commit 5a7a91323a
23 files changed
+239 -259

No files matched your search

+4 -2
View File
@@ -49,10 +49,10 @@ impl Builder {
}
/// Start a new build - killing the current one if it exists
pub fn build(&mut self) {
pub fn build(&mut self) -> Result<()> {
self.shutdown();
let build_requests =
BuildRequest::create(true, &self.config, self.serve.build_arguments.clone());
BuildRequest::create(true, &self.config, self.serve.build_arguments.clone())?;
let mut set = tokio::task::JoinSet::new();
@@ -85,6 +85,8 @@ impl Builder {
}
Ok(all_results)
}));
Ok(())
}
/// Wait for any new updates to the builder - either it completed or gave us a message etc
+3 -3
View File
@@ -57,7 +57,7 @@ pub async fn serve_all(
let mut builder = Builder::new(&dioxus_crate, &serve);
// Start the first build
builder.build();
builder.build()?;
let mut server = Server::start(&serve, &dioxus_crate);
let mut watcher = Watcher::start(&serve, &dioxus_crate);
@@ -94,7 +94,7 @@ pub async fn serve_all(
} else {
// If the change is not binary patchable, rebuild the project
// We're going to kick off a new build, interrupting the current build if it's ongoing
builder.build();
builder.build()?;
// Clear the hot reload changes
watcher.clear_hot_reload_changes();
@@ -196,7 +196,7 @@ pub async fn serve_all(
Ok(false) => {}
// Request a rebuild.
Ok(true) => {
builder.build();
builder.build()?;
server.start_build().await
},
// Shutdown the server.
-1
View File
@@ -57,7 +57,6 @@ impl Watcher {
"target",
"node_modules",
"dist",
".dioxus",
&out_dir_str,
];
for path in excluded_paths {