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

+21 -14
View File
@@ -37,25 +37,32 @@ pub(crate) use update::*;
/// - I want us to be able to detect a `server_fn` in the project and then upgrade from a static server
/// to a dynamic one on the fly.
pub(crate) async fn serve_all(args: ServeArgs, tracer: &mut TraceController) -> Result<()> {
// This is our default splash screen. We might want to make this a fancier splash screen in the future
// Also, these commands might not be the most important, but it's all we've got enabled right now
tracing::info!(
r#"-----------------------------------------------------------------
Serving your Dioxus app! 🚀
• Press {GLOW_STYLE}`ctrl+c`{GLOW_STYLE:#} to exit the server
• Press {GLOW_STYLE}`r`{GLOW_STYLE:#} to rebuild the app
• Press {GLOW_STYLE}`p`{GLOW_STYLE:#} to toggle automatic rebuilds
• Press {GLOW_STYLE}`v`{GLOW_STYLE:#} to toggle verbose logging
• Press {GLOW_STYLE}`/`{GLOW_STYLE:#} for more commands and shortcuts
Learn more at {LINK_STYLE}https://dioxuslabs.com/learn/0.7/getting_started{LINK_STYLE:#}
----------------------------------------------------------------"#,
);
// Load the args into a plan, resolving all tooling, build dirs, arguments, decoding the multi-target, etc
let mut builder = AppServer::start(args).await?;
let mut devserver = WebServer::start(&builder)?;
let mut screen = Output::start(builder.interactive).await?;
// This is our default splash screen. We might want to make this a fancier splash screen in the future
// Also, these commands might not be the most important, but it's all we've got enabled right now
tracing::info!(
r#"-----------------------------------------------------------------
Serving your app: {binname}! 🚀
• Press {GLOW_STYLE}`ctrl+c`{GLOW_STYLE:#} to exit the server
• Press {GLOW_STYLE}`r`{GLOW_STYLE:#} to rebuild the app
• Press {GLOW_STYLE}`p`{GLOW_STYLE:#} to toggle automatic rebuilds
• Press {GLOW_STYLE}`v`{GLOW_STYLE:#} to toggle verbose logging
• Press {GLOW_STYLE}`/`{GLOW_STYLE:#} for more commands and shortcuts{extra}
----------------------------------------------------------------"#,
binname = builder.client.build.executable_name(),
extra = if builder.client.build.using_dioxus_explicitly {
format!(
"\n Learn more at {LINK_STYLE}https://dioxuslabs.com/learn/0.7/getting_started{LINK_STYLE:#}"
)
} else {
String::new()
}
);
loop {
// Draw the state of the server to the screen
screen.render(&builder, &devserver);
+17 -15
View File
@@ -165,7 +165,7 @@ impl Output {
}
pub(crate) fn remote_shutdown(interactive: bool) -> io::Result<()> {
if interactive {
if interactive && crossterm::terminal::is_raw_mode_enabled().unwrap_or(true) {
stdout()
.execute(Show)?
.execute(DisableFocusChange)?
@@ -766,21 +766,23 @@ impl Output {
let links_list: [_; 2] =
Layout::vertical([Constraint::Length(1), Constraint::Length(1)]).areas(bottom);
frame.render_widget(
Paragraph::new(Line::from(vec![
"Read the docs: ".gray(),
"https://dioxuslabs.com/0.6/docs".blue(),
])),
links_list[0],
);
if state.runner.client.build.using_dioxus_explicitly {
frame.render_widget(
Paragraph::new(Line::from(vec![
"Read the docs: ".gray(),
"https://dioxuslabs.com/0.6/docs".blue(),
])),
links_list[0],
);
frame.render_widget(
Paragraph::new(Line::from(vec![
"Video tutorials: ".gray(),
"https://youtube.com/@DioxusLabs".blue(),
])),
links_list[1],
);
frame.render_widget(
Paragraph::new(Line::from(vec![
"Video tutorials: ".gray(),
"https://youtube.com/@DioxusLabs".blue(),
])),
links_list[1],
);
}
let cmds = [
"",