add --offline, --locked, remove dioxus branding if dioxus is not being used explicitly (#4155)

* wip: add some spin logging

* wipe dioxus branding if not being used by dioxus

* add --locked, --offline, --frozen

* properly git init with `dx new` and `dx init`

* dont panic in verbosity

* Move build-assets to "tools"

* change ui for dx new offline

* pin tauri-bundle

* pin tauri

* run tailwind once
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-06-24 18:21:25 -07:00
1 parent a899f9f08e
commit dd53ce72a7
14 files changed
+279 -93

No files matched your search

+22
View File
@@ -390,6 +390,7 @@ pub(crate) struct BuildRequest {
pub(crate) link_err_file: Arc<NamedTempFile>,
pub(crate) rustc_wrapper_args_file: Arc<NamedTempFile>,
pub(crate) base_path: Option<String>,
pub(crate) using_dioxus_explicitly: bool,
}
/// dx can produce different "modes" of a build. A "regular" build is a "base" build. The Fat and Thin
@@ -757,6 +758,7 @@ impl BuildRequest {
package,
main_target,
rustflags,
using_dioxus_explicitly,
skip_assets: args.skip_assets,
base_path: args.base_path.clone(),
wasm_split: args.wasm_split,
@@ -1132,6 +1134,14 @@ impl BuildRequest {
return Ok(());
}
// Run the tailwind build before bundling anything else
crate::TailwindCli::run_once(
self.package_manifest_dir(),
self.config.application.tailwind_input.clone(),
self.config.application.tailwind_output.clone(),
)
.await?;
let asset_dir = self.asset_dir();
// First, clear the asset dir of any files that don't exist in the new manifest
@@ -2147,6 +2157,18 @@ impl BuildRequest {
};
cargo_args.push(self.executable_name().to_string());
// Set offline/locked/frozen
let lock_opts = crate::VERBOSITY.get().cloned().unwrap_or_default();
if lock_opts.frozen {
cargo_args.push("--frozen".to_string());
}
if lock_opts.locked {
cargo_args.push("--locked".to_string());
}
if lock_opts.offline {
cargo_args.push("--offline".to_string());
}
// Merge in extra args. Order shouldn't really matter.
cargo_args.extend(self.extra_cargo_args.clone());
cargo_args.push("--".to_string());