From 1d520cce124a875445614ccad46735de798a5bb6 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Sun, 28 Jan 2024 14:54:32 -0600 Subject: [PATCH] make fullstack and liveview lowercase everywhere --- Cargo.toml | 6 +++--- README.md | 2 +- cargo-generate.toml | 8 ++++---- src/main.rs | 18 +++++++++--------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 05c0eed..33def9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -{% if platform == "Liveview" %} +{% if platform == "liveview" %} dioxus = { version = "0.4" } tokio = { version = "1.27.0", features = ["full"] } {% if backend == "Axum" %} @@ -35,7 +35,7 @@ dioxus = { version = "0.4" } dioxus-tui = { version = "0.4" } dioxus = { version = "0.4" } {% endif %} -{% if platform == "Fullstack" %} +{% if platform == "fullstack" %} {% if router %} dioxus-fullstack = { version = "0.4", features = ["router"] } {% else %} @@ -59,7 +59,7 @@ dioxus-logger = "0.4.1" console_error_panic_hook = "0.1.7" {% endif %} -{% if platform == "Fullstack" %} +{% if platform == "fullstack" %} [features] default = [] {% if backend == "Axum" %} diff --git a/README.md b/README.md index 6ccb594..680f30b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ dx serve --hot-reload - Open the browser to http://localhost:8080 {% else %} -{% if platform == "Fullstack" %} +{% if platform == "fullstack" %} Launch the Dioxus Fullstack app: ```bash diff --git a/cargo-generate.toml b/cargo-generate.toml index 826bea8..f0e269d 100644 --- a/cargo-generate.toml +++ b/cargo-generate.toml @@ -12,13 +12,13 @@ prompt = "What platform are you targeting?" choices = ["web", "fullstack", "desktop", "liveview", "TUI"] default = "web" -[conditional.'platform == "Liveview"'.placeholders.backend] +[conditional.'platform == "liveview"'.placeholders.backend] type = "string" prompt = "What backend framework are you using?" choices = ["Axum", "Warp", "Salvo"] default = "Axum" -[conditional.'platform == "Fullstack"'.placeholders.backend] +[conditional.'platform == "fullstack"'.placeholders.backend] type = "string" prompt = "What backend framework are you using?" choices = ["Axum", "Warp", "Salvo"] @@ -34,7 +34,7 @@ type = "string" prompt = "How do you want to create CSS?" choices = ["Tailwind", "Vanilla"] default = "Vanilla" -[conditional.'platform == "Fullstack"'.placeholders.styling] +[conditional.'platform == "fullstack"'.placeholders.styling] type = "string" prompt = "How do you want to create CSS?" choices = ["Tailwind", "Vanilla"] @@ -42,7 +42,7 @@ default = "Vanilla" [conditional.'platform == "TUI"'] ignore = [ "tailwind.config.js", "input.css", "public" ] -[conditional.'platform == "Liveview"'] +[conditional.'platform == "liveview"'] ignore = [ "tailwind.config.js", "input.css", "public" ] [conditional.'platform == "desktop"'] ignore = [ "public" ] diff --git a/src/main.rs b/src/main.rs index eee02cc..a931b7c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ #![allow(non_snake_case)] -{% if platform == "Fullstack" %} +{% if platform == "fullstack" %} #![allow(unused)] use dioxus_fullstack::prelude::*; {% endif %} @@ -9,7 +9,7 @@ use dioxus_router::prelude::*; use dioxus::prelude::*; use log::LevelFilter; -{% if platform == "Liveview" %} +{% if platform == "liveview" %} {% if backend == "Axum" %} #[tokio::main] async fn main() { @@ -179,7 +179,7 @@ fn main() { dioxus_tui::launch(app); } {% endif %} -{% if platform == "Fullstack" %} +{% if platform == "fullstack" %} fn main() { // Init debug dioxus_logger::init(LevelFilter::Info).expect("failed to init logger"); @@ -192,7 +192,7 @@ fn main() { {% endif %} {% if router %} -{% if platform != "Fullstack" %} +{% if platform != "fullstack" %} fn app(cx: Scope) -> Element { render!{ Router:: {} @@ -200,7 +200,7 @@ fn app(cx: Scope) -> Element { } {% endif %} -{% if platform != "Fullstack" %} +{% if platform != "fullstack" %} #[derive(Clone, Routable, Debug, PartialEq)] enum Route { #[route("/")] @@ -209,7 +209,7 @@ enum Route { Blog { id: i32 }, } {% endif %} -{% if platform == "Fullstack" %} +{% if platform == "fullstack" %} #[derive(Clone, Routable, Debug, PartialEq, serde::Serialize, serde::Deserialize)] enum Route { #[route("/")] @@ -230,7 +230,7 @@ fn Blog(cx: Scope, id: i32) -> Element { #[component] fn Home(cx: Scope) -> Element { let mut count = use_state(cx, || 0); - {% if platform == "Fullstack" %} + {% if platform == "fullstack" %} let text = use_state(cx, || "...".to_string()); {% endif %} @@ -245,7 +245,7 @@ fn Home(cx: Scope) -> Element { h1 { "High-Five counter: {count}" } button { onclick: move |_| count += 1, "Up high!" } button { onclick: move |_| count -= 1, "Down low!" } - {% if platform == "Fullstack" %} + {% if platform == "fullstack" %} button { onclick: move |_| { to_owned![text]; @@ -277,7 +277,7 @@ fn app(cx: Scope) -> Element { } {% endif %} -{% if platform == "Fullstack" %} +{% if platform == "fullstack" %} #[server(PostServerData)] async fn post_server_data(data: String) -> Result<(), ServerFnError> { println!("Server received: {}", data);