diff --git a/Bare-Bones/Cargo.toml b/Bare-Bones/Cargo.toml index 17656c6..e196d93 100644 --- a/Bare-Bones/Cargo.toml +++ b/Bare-Bones/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" dioxus = { {{ dioxus_dep_src }}, features = {{dioxus_dep_features}} } [features] -default = ["{{default_platform}}"] +default = [{% if is_fullstack == false -%}"{{default_platform}}"{%- endif %}] {%- for feature in features %} {{ feature }} {%- endfor %} diff --git a/Bare-Bones/README.md b/Bare-Bones/README.md index 055cdb9..db57930 100644 --- a/Bare-Bones/README.md +++ b/Bare-Bones/README.md @@ -17,9 +17,15 @@ npx tailwindcss -i ./input.css -o ./assets/tailwind.css --watch Run the following command in the root of your project to start developing with the default platform: +{% if is_fullstack -%} +```bash +dx serve --platform {{default_platform}} +``` +{%- else -%} ```bash dx serve ``` +{%- endif %} To run for a different platform, use the `--platform platform` flag. E.g. ```bash diff --git a/Jumpstart/Cargo.toml b/Jumpstart/Cargo.toml index 17656c6..e196d93 100644 --- a/Jumpstart/Cargo.toml +++ b/Jumpstart/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" dioxus = { {{ dioxus_dep_src }}, features = {{dioxus_dep_features}} } [features] -default = ["{{default_platform}}"] +default = [{% if is_fullstack == false -%}"{{default_platform}}"{%- endif %}] {%- for feature in features %} {{ feature }} {%- endfor %} diff --git a/Jumpstart/README.md b/Jumpstart/README.md index 6ce9a3a..330557f 100644 --- a/Jumpstart/README.md +++ b/Jumpstart/README.md @@ -18,9 +18,15 @@ npx tailwindcss -i ./input.css -o ./assets/styling/tailwind.css --watch Run the following command in the root of your project to start developing with the default platform: +{% if is_fullstack -%} +```bash +dx serve --platform {{default_platform}} +``` +{%- else -%} ```bash dx serve ``` +{%- endif %} To run for a different platform, use the `--platform platform` flag. E.g. ```bash diff --git a/Workspace/desktop/Cargo.toml b/Workspace/desktop/Cargo.toml index 7e24cf4..3ff0881 100644 --- a/Workspace/desktop/Cargo.toml +++ b/Workspace/desktop/Cargo.toml @@ -8,7 +8,7 @@ dioxus = { workspace = true, features = [{{- router_feature -}}] } ui = { workspace = true } [features] -default = ["desktop"] +default = [{% if is_fullstack == false -%}"desktop"{%- endif %}] desktop = ["dioxus/desktop"] {% if is_fullstack -%} server = ["dioxus/server"] diff --git a/Workspace/mobile/Cargo.toml b/Workspace/mobile/Cargo.toml index b420713..caf6648 100644 --- a/Workspace/mobile/Cargo.toml +++ b/Workspace/mobile/Cargo.toml @@ -8,7 +8,7 @@ dioxus = { workspace = true, features = [{{- router_feature -}}] } ui = { workspace = true } [features] -default = ["mobile"] +default = [{% if is_fullstack == false -%}"mobile"{%- endif %}] mobile = ["dioxus/mobile"] {% if is_fullstack -%} server = ["dioxus/server"] diff --git a/Workspace/web/Cargo.toml b/Workspace/web/Cargo.toml index aca9789..221baa9 100644 --- a/Workspace/web/Cargo.toml +++ b/Workspace/web/Cargo.toml @@ -8,7 +8,7 @@ dioxus = { workspace = true, features = [{{- router_feature -}}] } ui = { workspace = true } [features] -default = ["web"] +default = [{% if is_fullstack == false -%}"web"{%- endif %}] web = ["dioxus/web"] {% if is_fullstack -%} server = ["dioxus/server"] diff --git a/common.rhai b/common.rhai index 1b0621a..515e8b2 100644 --- a/common.rhai +++ b/common.rhai @@ -26,6 +26,7 @@ let platforms = [ "Desktop", "Mobile" ]; +let is_fullstack = variable::get(IS_FULLSTACK_VAR); // Do we need a default platform? if variable::get(NEEDS_DEFAULT_PLATFORM_VAR) { @@ -64,7 +65,6 @@ if variable::get(NEEDS_DEFAULT_PLATFORM_VAR) { let is_router = variable::get(IS_ROUTER_VAR); -let is_fullstack = variable::get(IS_FULLSTACK_VAR); switch [is_router, is_fullstack] { [true, true] => variable::set(DIOXUS_DEP_FEAT_VAR, "[\"router\", \"fullstack\"]"), [true, false] => variable::set(DIOXUS_DEP_FEAT_VAR, "[\"router\"]"),