From d27af03e3f4fb697bb3f9ce2d03f78c270dad368 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Fri, 14 Jul 2023 13:52:54 -0700 Subject: [PATCH 1/4] Remove the dioxus bin from the cli --- packages/cli/Cargo.toml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/cli/Cargo.toml b/packages/cli/Cargo.toml index c947baa63..3aa741615 100644 --- a/packages/cli/Cargo.toml +++ b/packages/cli/Cargo.toml @@ -86,13 +86,6 @@ dioxus-core = { workspace = true, features = ["serialize"] } default = [] plugin = ["mlua"] -# install path dx and dioxus as the same command -# so, they're not really aliases -# eventually dx will defer to the right version of dioxus -[[bin]] -path = "src/main.rs" -name = "dioxus" - [[bin]] path = "src/main.rs" name = "dx" From 16763c065bf1d0a0d6a3c4a9e72f91d3e1c81de9 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Fri, 14 Jul 2023 13:53:06 -0700 Subject: [PATCH 2/4] Rename dioxus to dx in examples and fullstack --- docs/guide/src/en/fullstack/getting_started.md | 4 ++-- docs/guide/src/en/fullstack/server_functions.md | 2 +- examples/PWA-example/README.md | 6 +++--- notes/FAQ.md | 2 +- packages/cli/Dioxus.toml | 4 ++-- packages/cli/README.md | 4 ++-- packages/cli/docs/src/cmd/README.md | 6 +++--- packages/cli/docs/src/cmd/build.md | 16 ++++++++-------- packages/cli/docs/src/cmd/clean.md | 4 ++-- packages/cli/docs/src/cmd/serve.md | 6 +++--- packages/cli/docs/src/cmd/translate.md | 6 +++--- packages/cli/docs/src/configure.md | 4 ++-- packages/cli/docs/src/creating.md | 2 +- packages/cli/docs/src/plugin/README.md | 4 ++-- packages/cli/src/assets/dioxus.toml | 2 +- packages/cli/src/builder.rs | 4 ++-- packages/cli/src/cli/plugin/mod.rs | 2 +- .../examples/axum-hello-world/src/main.rs | 4 ++-- .../fullstack/examples/axum-router/src/main.rs | 4 ++-- .../examples/salvo-hello-world/src/main.rs | 4 ++-- .../examples/warp-hello-world/src/main.rs | 4 ++-- playwrite-tests/fullstack/src/main.rs | 2 +- 22 files changed, 48 insertions(+), 48 deletions(-) diff --git a/docs/guide/src/en/fullstack/getting_started.md b/docs/guide/src/en/fullstack/getting_started.md index 9511b8a6c..401af1d43 100644 --- a/docs/guide/src/en/fullstack/getting_started.md +++ b/docs/guide/src/en/fullstack/getting_started.md @@ -76,7 +76,7 @@ Next, we need to modify our `main.rs` to use either hydrate on the client or ren {{#include ../../../examples/hydration.rs}} ``` -Now, build your client-side bundle with `dioxus build --features web` and run your server with `cargo run --features ssr`. You should see the same page as before, but now you can interact with the buttons! +Now, build your client-side bundle with `dx build --features web` and run your server with `cargo run --features ssr`. You should see the same page as before, but now you can interact with the buttons! ## Sycronizing props between the server and client @@ -99,4 +99,4 @@ The only thing we need to change on the client is the props. `dioxus-fullstack` {{#include ../../../examples/hydration_props.rs}} ``` -Now, build your client-side bundle with `dioxus build --features web` and run your server with `cargo run --features ssr`. Navigate to `http://localhost:8080/1` and you should see the counter start at 1. Navigate to `http://localhost:8080/2` and you should see the counter start at 2. +Now, build your client-side bundle with `dx build --features web` and run your server with `cargo run --features ssr`. Navigate to `http://localhost:8080/1` and you should see the counter start at 1. Navigate to `http://localhost:8080/2` and you should see the counter start at 2. diff --git a/docs/guide/src/en/fullstack/server_functions.md b/docs/guide/src/en/fullstack/server_functions.md index 57883885a..581aa382a 100644 --- a/docs/guide/src/en/fullstack/server_functions.md +++ b/docs/guide/src/en/fullstack/server_functions.md @@ -24,7 +24,7 @@ Next, add the server function to your `main.rs`: {{#include ../../../examples/server_function.rs}} ``` -Now, build your client-side bundle with `dioxus build --features web` and run your server with `cargo run --features ssr`. You should see a new button that multiplies the count by 2. +Now, build your client-side bundle with `dx build --features web` and run your server with `cargo run --features ssr`. You should see a new button that multiplies the count by 2. ## Conclusion diff --git a/examples/PWA-example/README.md b/examples/PWA-example/README.md index dfd986302..d42a61311 100644 --- a/examples/PWA-example/README.md +++ b/examples/PWA-example/README.md @@ -9,8 +9,8 @@ It is also very much usable as a template for your projects, if you're aiming to Make sure you have Dioxus CLI installed (if you're unsure, run `cargo install dioxus-cli`). -You can run `dioxus serve` in this directory to start the web server locally, or run -`dioxus build --release` to build the project so you can deploy it on a separate web-server. +You can run `dx serve` in this directory to start the web server locally, or run +`dx build --release` to build the project so you can deploy it on a separate web-server. ## Project Structure ``` @@ -41,4 +41,4 @@ For service worker scripting (in JavaScript): * [Service worker guide from PWABuilder](https://docs.pwabuilder.com/#/home/sw-intro) * [Service worker examples, also from PWABuilder](https://github.com/pwa-builder/pwabuilder-serviceworkers) -If you want to stay as close to 100% Rust as possible, you can try using [wasi-worker](https://github.com/dunnock/wasi-worker) to replace the JS service worker file. The JSON manifest will still be required though. \ No newline at end of file +If you want to stay as close to 100% Rust as possible, you can try using [wasi-worker](https://github.com/dunnock/wasi-worker) to replace the JS service worker file. The JSON manifest will still be required though. diff --git a/notes/FAQ.md b/notes/FAQ.md index 4e9ea00e4..a94071130 100644 --- a/notes/FAQ.md +++ b/notes/FAQ.md @@ -18,7 +18,7 @@ There are plenty Rust Elm-like frameworks in the world - we were not interested The `RSX` DSL is _barely_ a DSL. Rustaceans will find the DSL very similar to simply assembling nested structs, but without the syntactical overhead of "Default" everywhere or having to jump through hoops with the builder pattern. Between RSX, HTML, the Raw Factory API, and the NodeBuilder syntax, there's plenty of options to choose from. ### What are the build times like? Why on earth would I choose Rust instead of JS/TS/Elm? -Dioxus builds as roughly as fast as a complex WebPack-TypeScript site. Compile times will be slower than an equivalent TypeScript site, but not unbearably slow. The Wasm compiler backend for Rust is very fast. Iterating on small components is basically instant and larger apps takes a few seconds. In practice, the compiler guarantees of Rust balance out the rebuild times. +dx builds as roughly as fast as a complex WebPack-TypeScript site. Compile times will be slower than an equivalent TypeScript site, but not unbearably slow. The Wasm compiler backend for Rust is very fast. Iterating on small components is basically instant and larger apps takes a few seconds. In practice, the compiler guarantees of Rust balance out the rebuild times. ### What about Yew/Seed/Sycamore/Dominator/Dodrio/Percy? - Yew and Seed use an Elm-like pattern and don't support SSR or any alternate rendering platforms diff --git a/packages/cli/Dioxus.toml b/packages/cli/Dioxus.toml index c3e0dd8a0..792a15165 100644 --- a/packages/cli/Dioxus.toml +++ b/packages/cli/Dioxus.toml @@ -4,7 +4,7 @@ name = "dioxus-cli" # default platfrom -# you can also use `dioxus serve/build --platform XXX` to use other platform +# you can also use `dx serve/build --platform XXX` to use other platform # value: web | desktop default_platform = "desktop" @@ -42,4 +42,4 @@ script = [] # use binaryen.wasm-opt for output Wasm file # binaryen just will trigger in `web` platform -binaryen = { wasm_opt = true } \ No newline at end of file +binaryen = { wasm_opt = true } diff --git a/packages/cli/README.md b/packages/cli/README.md index 6f0826e10..3167a6746 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -24,7 +24,7 @@ cargo install --path . --debug ## Get Started -Use `dioxus create project-name` to initialize a new Dioxus project.
+Use `dx create project-name` to initialize a new Dioxus project.
It will be cloned from the [dioxus-template](https://github.com/DioxusLabs/dioxus-template) repository. @@ -33,7 +33,7 @@ It will be cloned from the [dioxus-template](https://github.com/DioxusLabs/dioxu Alternatively, you can specify the template path: ``` -dioxus create hello --template gh:dioxuslabs/dioxus-template +dx create hello --template gh:dioxuslabs/dioxus-template ``` ## Dioxus Config File diff --git a/packages/cli/docs/src/cmd/README.md b/packages/cli/docs/src/cmd/README.md index dae226577..30586d73a 100644 --- a/packages/cli/docs/src/cmd/README.md +++ b/packages/cli/docs/src/cmd/README.md @@ -2,10 +2,10 @@ In this chapter we will introduce all `dioxus-cli` commands. -> You can also use `dioxus --help` to get cli help info. +> You can also use `dx --help` to get cli help info. ``` -dioxus +dioxus Build, bundle, & ship your Dioxus app USAGE: @@ -23,4 +23,4 @@ SUBCOMMANDS: help Print this message or the help of the given subcommand(s) serve Build, watch & serve the Rust WASM app and all of its assets translate Translate some html file into a Dioxus component -``` \ No newline at end of file +``` diff --git a/packages/cli/docs/src/cmd/build.md b/packages/cli/docs/src/cmd/build.md index 1fb892475..d0444721e 100644 --- a/packages/cli/docs/src/cmd/build.md +++ b/packages/cli/docs/src/cmd/build.md @@ -1,13 +1,13 @@ # Build -The `dioxus build` command can help you `pack & build` a dioxus project. +The `dx build` command can help you `pack & build` a dioxus project. ``` -dioxus-build +dioxus-build Build the Rust WASM app and all of its assets USAGE: - dioxus build [OPTIONS] + dx build [OPTIONS] OPTIONS: --example [default: ""] @@ -18,7 +18,7 @@ OPTIONS: You can use this command to build a project: ``` -dioxus build --release +dx build --release ``` ## Target platform @@ -27,14 +27,14 @@ Use the `platform` option to choose your target platform: ``` # for desktop project -dioxus build --platform desktop +dx build --platform desktop ``` `platform` currently only supports `desktop` & `web`. ``` # for web project -dioxus build --platform web +dx build --platform web ``` ## Build Example @@ -43,5 +43,5 @@ You can use the `example` option to select a example to build: ``` # build the `test` example -dioxus build --exmaple test -``` \ No newline at end of file +dx build --exmaple test +``` diff --git a/packages/cli/docs/src/cmd/clean.md b/packages/cli/docs/src/cmd/clean.md index bbb3a132e..eef83a2a9 100644 --- a/packages/cli/docs/src/cmd/clean.md +++ b/packages/cli/docs/src/cmd/clean.md @@ -1,9 +1,9 @@ # Clean -`dioxus clean` will clear the build artifacts (the out_dir and the cargo cache) +`dx clean` will clear the build artifacts (the out_dir and the cargo cache) ``` -dioxus-clean +dioxus-clean Clean build artifacts USAGE: diff --git a/packages/cli/docs/src/cmd/serve.md b/packages/cli/docs/src/cmd/serve.md index 41abf5350..5b1f411dd 100644 --- a/packages/cli/docs/src/cmd/serve.md +++ b/packages/cli/docs/src/cmd/serve.md @@ -1,9 +1,9 @@ # Serve -The `dioxus serve` can start a dev server with hot-reloading +The `dx serve` can start a dev server with hot-reloading ``` -dioxus-serve +dioxus-serve Build, watch & serve the Rust WASM app and all of its assets USAGE: @@ -58,4 +58,4 @@ You can add the `cross-origin-policy` option to change cross-origin header to: ``` dioxus serve --corss-origin-policy -``` \ No newline at end of file +``` diff --git a/packages/cli/docs/src/cmd/translate.md b/packages/cli/docs/src/cmd/translate.md index 7237e1dcf..0fb3ed8c9 100644 --- a/packages/cli/docs/src/cmd/translate.md +++ b/packages/cli/docs/src/cmd/translate.md @@ -1,9 +1,9 @@ # Translate -`dioxus translate` can translate some `html` file into a Dioxus compoent +`dx translate` can translate some `html` file into a Dioxus compoent ``` -dioxus-translate +dioxus-translate Translate some source file into a Dioxus component USAGE: @@ -65,4 +65,4 @@ fn component(cx: Scope) -> Element { } }) } -``` \ No newline at end of file +``` diff --git a/packages/cli/docs/src/configure.md b/packages/cli/docs/src/configure.md index 35904caae..8da66d9ec 100644 --- a/packages/cli/docs/src/configure.md +++ b/packages/cli/docs/src/configure.md @@ -29,8 +29,8 @@ General application confiration: # default: web default_platform = "web" ``` - if you change this to `desktop`, the `dioxus build` will default building a desktop app -3. ***out_dir*** - The directory to place the build artifacts from `dioxus build` or `dioxus service` into. This is also where the `assets` directory will be copied to + if you change this to `desktop`, the `dx build` will default building a desktop app +3. ***out_dir*** - The directory to place the build artifacts from `dx build` or `dx service` into. This is also where the `assets` directory will be copied to ``` out_dir = "dist" ``` diff --git a/packages/cli/docs/src/creating.md b/packages/cli/docs/src/creating.md index 5bb98fd10..c5d791013 100644 --- a/packages/cli/docs/src/creating.md +++ b/packages/cli/docs/src/creating.md @@ -4,7 +4,7 @@ Once you have the Dioxus CLI tool installed, you can use it to create dioxus pro ## Initializing a default project -First, run the `dioxus create` command to create a new project ready to be used with Dioxus and the Dioxus CLI: +First, run the `dx create` command to create a new project ready to be used with Dioxus and the Dioxus CLI: ``` dioxus create hello-dioxus diff --git a/packages/cli/docs/src/plugin/README.md b/packages/cli/docs/src/plugin/README.md index 9983f024b..0a1a7b606 100644 --- a/packages/cli/docs/src/plugin/README.md +++ b/packages/cli/docs/src/plugin/README.md @@ -2,7 +2,7 @@ > For Cli 0.2.0 we will add `plugin-develop` support. -Before the 0.2.0 we use `dioxus tool` to use & install some plugin, but we think that is not good for extend cli program, some people want tailwind support, some people want sass support, we can't add all this thing in to the cli source code and we don't have time to maintain a lot of tools that user request, so maybe user make plugin by themself is a good choice. +Before the 0.2.0 we use `dx tool` to use & install some plugin, but we think that is not good for extend cli program, some people want tailwind support, some people want sass support, we can't add all this thing in to the cli source code and we don't have time to maintain a lot of tools that user request, so maybe user make plugin by themself is a good choice. ### Why Lua ? @@ -76,4 +76,4 @@ end manager.serve.interval = 1000 return manager -``` \ No newline at end of file +``` diff --git a/packages/cli/src/assets/dioxus.toml b/packages/cli/src/assets/dioxus.toml index 3827d0f8f..dfdeb9f92 100644 --- a/packages/cli/src/assets/dioxus.toml +++ b/packages/cli/src/assets/dioxus.toml @@ -4,7 +4,7 @@ name = "{{project-name}}" # default platfrom -# you can also use `dioxus serve/build --platform XXX` to use other platform +# you can also use `dx serve/build --platform XXX` to use other platform # value: web | desktop default_platform = "{{default-platform}}" diff --git a/packages/cli/src/builder.rs b/packages/cli/src/builder.rs index 6f50fc49d..cf7ccd7b3 100644 --- a/packages/cli/src/builder.rs +++ b/packages/cli/src/builder.rs @@ -161,7 +161,7 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result { } } else { log::warn!( - "Binaryen tool not found, you can use `dioxus tool add binaryen` to install it." + "Binaryen tool not found, you can use `dx tool add binaryen` to install it." ); } } @@ -200,7 +200,7 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result { } } else { log::warn!( - "Tailwind tool not found, you can use `dioxus tool add tailwindcss` to install it." + "Tailwind tool not found, you can use `dx tool add tailwindcss` to install it." ); } } diff --git a/packages/cli/src/cli/plugin/mod.rs b/packages/cli/src/cli/plugin/mod.rs index 812c3ae1c..9f514edec 100644 --- a/packages/cli/src/cli/plugin/mod.rs +++ b/packages/cli/src/cli/plugin/mod.rs @@ -31,7 +31,7 @@ impl Plugin { } } Plugin::Add { name: _ } => { - log::info!("You can use `dioxus plugin app-path` to get Installation position"); + log::info!("You can use `dx plugin app-path` to get Installation position"); } } Ok(()) diff --git a/packages/fullstack/examples/axum-hello-world/src/main.rs b/packages/fullstack/examples/axum-hello-world/src/main.rs index 5ded85070..6b919aa42 100644 --- a/packages/fullstack/examples/axum-hello-world/src/main.rs +++ b/packages/fullstack/examples/axum-hello-world/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr --no-default-features //! ``` @@ -21,7 +21,7 @@ fn main() { { // Start hot reloading hot_reload_init!(dioxus_hot_reload::Config::new().with_rebuild_callback(|| { - execute::shell("dioxus build --features web") + execute::shell("dx build --features web") .spawn() .unwrap() .wait() diff --git a/packages/fullstack/examples/axum-router/src/main.rs b/packages/fullstack/examples/axum-router/src/main.rs index 2b98ad842..dd95e2f8a 100644 --- a/packages/fullstack/examples/axum-router/src/main.rs +++ b/packages/fullstack/examples/axum-router/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr --no-default-features //! ``` @@ -22,7 +22,7 @@ fn main() { { // Start hot reloading hot_reload_init!(dioxus_hot_reload::Config::new().with_rebuild_callback(|| { - execute::shell("dioxus build --features web") + execute::shell("dx build --features web") .spawn() .unwrap() .wait() diff --git a/packages/fullstack/examples/salvo-hello-world/src/main.rs b/packages/fullstack/examples/salvo-hello-world/src/main.rs index 01b67ff99..c1d128103 100644 --- a/packages/fullstack/examples/salvo-hello-world/src/main.rs +++ b/packages/fullstack/examples/salvo-hello-world/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr --no-default-features //! ``` @@ -21,7 +21,7 @@ fn main() { { // Start hot reloading hot_reload_init!(dioxus_hot_reload::Config::new().with_rebuild_callback(|| { - execute::shell("dioxus build --features web") + execute::shell("dx build --features web") .spawn() .unwrap() .wait() diff --git a/packages/fullstack/examples/warp-hello-world/src/main.rs b/packages/fullstack/examples/warp-hello-world/src/main.rs index 34fc24c77..cd0170363 100644 --- a/packages/fullstack/examples/warp-hello-world/src/main.rs +++ b/packages/fullstack/examples/warp-hello-world/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr --no-default-features //! ``` @@ -21,7 +21,7 @@ fn main() { { // Start hot reloading hot_reload_init!(dioxus_hot_reload::Config::new().with_rebuild_callback(|| { - execute::shell("dioxus build --features web") + execute::shell("dx build --features web") .spawn() .unwrap() .wait() diff --git a/playwrite-tests/fullstack/src/main.rs b/playwrite-tests/fullstack/src/main.rs index 98caadbb6..3152458f2 100644 --- a/playwrite-tests/fullstack/src/main.rs +++ b/playwrite-tests/fullstack/src/main.rs @@ -20,7 +20,7 @@ fn main() { { // Start hot reloading hot_reload_init!(dioxus_hot_reload::Config::new().with_rebuild_callback(|| { - execute::shell("dioxus build --features web") + execute::shell("dx build --features web") .spawn() .unwrap() .wait() From df23c3c6518351cea872065e4100f543bc89e9a0 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Fri, 14 Jul 2023 13:58:49 -0700 Subject: [PATCH 3/4] Update more docs --- .../guide/src/en/__unused/advanced-guides/testing.md | 2 +- docs/guide/src/en/getting_started/hot_reload.md | 2 +- docs/guide/src/en/getting_started/web.md | 2 +- docs/guide/src/pt-br/getting_started/hot_reload.md | 2 +- docs/reference/src/guide/hot_reloading_pt-br.md | 2 +- docs/reference/src/platforms/desktop.md | 6 +++--- docs/router/src/guide/getting-started.md | 2 +- examples/tailwind/README.md | 2 +- packages/cli/docs/src/cmd/README.md | 4 ++-- packages/cli/docs/src/cmd/clean.md | 4 ++-- packages/cli/docs/src/cmd/serve.md | 12 ++++++------ packages/cli/docs/src/cmd/translate.md | 8 ++++---- packages/cli/docs/src/creating.md | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/guide/src/en/__unused/advanced-guides/testing.md b/docs/guide/src/en/__unused/advanced-guides/testing.md index 87e72309c..405c929a9 100644 --- a/docs/guide/src/en/__unused/advanced-guides/testing.md +++ b/docs/guide/src/en/__unused/advanced-guides/testing.md @@ -21,7 +21,7 @@ fn runs_in_browser() { Then, when you run ```console -dioxus test --chrome +dx test --chrome ``` Dioxus will build and test your code using the Chrome browser as a harness. diff --git a/docs/guide/src/en/getting_started/hot_reload.md b/docs/guide/src/en/getting_started/hot_reload.md index b14de30a4..d207f361a 100644 --- a/docs/guide/src/en/getting_started/hot_reload.md +++ b/docs/guide/src/en/getting_started/hot_reload.md @@ -18,7 +18,7 @@ Hot reloading is automatically enabled when using the web renderer on debug buil 1. Run: ```bash -dioxus serve --hot-reload +dx serve --hot-reload ``` 2. Change some code within a rsx or render macro diff --git a/docs/guide/src/en/getting_started/web.md b/docs/guide/src/en/getting_started/web.md index 7f3d04848..48818bf8f 100644 --- a/docs/guide/src/en/getting_started/web.md +++ b/docs/guide/src/en/getting_started/web.md @@ -59,5 +59,5 @@ Edit your `main.rs`: And to serve our app: ```bash -dioxus serve +dx serve ``` diff --git a/docs/guide/src/pt-br/getting_started/hot_reload.md b/docs/guide/src/pt-br/getting_started/hot_reload.md index 2dabde536..447169055 100644 --- a/docs/guide/src/pt-br/getting_started/hot_reload.md +++ b/docs/guide/src/pt-br/getting_started/hot_reload.md @@ -18,7 +18,7 @@ dioxus = { version = "*", features = ["hot-reload"] } 1. Execute: ``` -dioxus serve --hot-reload +dx serve --hot-reload ``` 2. alterar algum código dentro de uma macro `rsx` diff --git a/docs/reference/src/guide/hot_reloading_pt-br.md b/docs/reference/src/guide/hot_reloading_pt-br.md index 475cc38e9..6878c1522 100644 --- a/docs/reference/src/guide/hot_reloading_pt-br.md +++ b/docs/reference/src/guide/hot_reloading_pt-br.md @@ -18,7 +18,7 @@ dioxus = { version = "*", features = ["web", "hot_reload"] } 1. run: ``` -dioxus serve --hot-reload +dx serve --hot-reload ``` 2. alterar algum código dentro de uma macro rsx diff --git a/docs/reference/src/platforms/desktop.md b/docs/reference/src/platforms/desktop.md index 30fe698ff..98aafaf21 100644 --- a/docs/reference/src/platforms/desktop.md +++ b/docs/reference/src/platforms/desktop.md @@ -13,10 +13,10 @@ $ cargo new --bin demo $ cd demo ``` -Add Dioxus with the `desktop` feature: +Add Dioxus-desktop: ```shell -$ cargo add dioxus --features desktop +$ cargo add dioxus_desktop ``` Edit your `main.rs`: @@ -26,7 +26,7 @@ Edit your `main.rs`: use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(app); + dioxus_desktop::launch(app); } fn app(cx: Scope) -> Element { diff --git a/docs/router/src/guide/getting-started.md b/docs/router/src/guide/getting-started.md index 7bce3c30a..793511535 100644 --- a/docs/router/src/guide/getting-started.md +++ b/docs/router/src/guide/getting-started.md @@ -60,7 +60,7 @@ fn app(cx: Scope) -> Element { Our project is now setup! To make sure everything is running correctly, in the root of your project run: ``` -dioxus serve --platform web +dx serve --platform web ``` Then head to [http://localhost:8080](http://localhost:8080) in your browser, and you should see ``Hello, wasm!`` on your screen. diff --git a/examples/tailwind/README.md b/examples/tailwind/README.md index 0498ecbd3..f2a08eba9 100644 --- a/examples/tailwind/README.md +++ b/examples/tailwind/README.md @@ -122,7 +122,7 @@ npx tailwindcss -i ./input.css -o ./public/tailwind.css --watch - Run the following command in the root of the project to start the dioxus dev server: ```bash -dioxus serve --hot-reload +dx serve --hot-reload ``` - Open the browser to http://localhost:8080 diff --git a/packages/cli/docs/src/cmd/README.md b/packages/cli/docs/src/cmd/README.md index 30586d73a..2de7cc138 100644 --- a/packages/cli/docs/src/cmd/README.md +++ b/packages/cli/docs/src/cmd/README.md @@ -5,11 +5,11 @@ In this chapter we will introduce all `dioxus-cli` commands. > You can also use `dx --help` to get cli help info. ``` -dioxus +dx Build, bundle, & ship your Dioxus app USAGE: - dioxus [OPTIONS] + dx [OPTIONS] OPTIONS: -h, --help Print help information diff --git a/packages/cli/docs/src/cmd/clean.md b/packages/cli/docs/src/cmd/clean.md index eef83a2a9..effb166ba 100644 --- a/packages/cli/docs/src/cmd/clean.md +++ b/packages/cli/docs/src/cmd/clean.md @@ -7,12 +7,12 @@ dioxus-clean Clean build artifacts USAGE: - dioxus clean + dx clean ``` # Example ``` -dioxus clean +dx clean ``` diff --git a/packages/cli/docs/src/cmd/serve.md b/packages/cli/docs/src/cmd/serve.md index 5b1f411dd..175168485 100644 --- a/packages/cli/docs/src/cmd/serve.md +++ b/packages/cli/docs/src/cmd/serve.md @@ -7,7 +7,7 @@ dioxus-serve Build, watch & serve the Rust WASM app and all of its assets USAGE: - dioxus serve [OPTIONS] + dx serve [OPTIONS] OPTIONS: --example [default: ""] @@ -19,7 +19,7 @@ OPTIONS: You can use this command to build project and start a dev server: ``` -dioxus serve +dx serve ``` ## Serve Example @@ -28,7 +28,7 @@ You can use the `example` option to serve a example: ``` # serve the `test` example -dioxus serve --exmaple test +dx serve --exmaple test ``` ## Open Browser @@ -36,7 +36,7 @@ dioxus serve --exmaple test You can add the `--open` option to open system default browser when server startup: ``` -dioxus serve --open +dx serve --open ``` ## RSX Hot Reloading @@ -44,7 +44,7 @@ dioxus serve --open You can add the `--hot-reload` flag to enable [rsx hot reloading](https://dioxuslabs.com/docs/0.3/guide/en/getting_started/hot_reload.html). This will allow you to reload some rsx changes without a full recompile: ``` -dioxus serve --open +dx serve --open ``` ## Cross Origin Policy @@ -57,5 +57,5 @@ You can add the `cross-origin-policy` option to change cross-origin header to: ``` ``` -dioxus serve --corss-origin-policy +dx serve --corss-origin-policy ``` diff --git a/packages/cli/docs/src/cmd/translate.md b/packages/cli/docs/src/cmd/translate.md index 0fb3ed8c9..b03b4422c 100644 --- a/packages/cli/docs/src/cmd/translate.md +++ b/packages/cli/docs/src/cmd/translate.md @@ -7,7 +7,7 @@ dioxus-translate Translate some source file into a Dioxus component USAGE: - dioxus translate [OPTIONS] [OUTPUT] + dx translate [OPTIONS] [OUTPUT] ARGS: Output file, defaults to stdout if not present @@ -22,7 +22,7 @@ OPTIONS: You can use the `file` option to set path to the `html` file to translate: ``` -dioxus transtale --file ./index.html +dx transtale --file ./index.html ``` ## Output rsx to a file @@ -30,7 +30,7 @@ dioxus transtale --file ./index.html You can pass a file to the traslate command to set the path to write the output of the command to: ``` -dioxus translate --file ./index.html component.rsx +dx translate --file ./index.html component.rsx ``` ## Output rsx to a file @@ -38,7 +38,7 @@ dioxus translate --file ./index.html component.rsx Setting the `component` option will create a compoent from the HTML: ``` -dioxus translate --file ./index.html --component +dx translate --file ./index.html --component ``` ## Example diff --git a/packages/cli/docs/src/creating.md b/packages/cli/docs/src/creating.md index c5d791013..95470827f 100644 --- a/packages/cli/docs/src/creating.md +++ b/packages/cli/docs/src/creating.md @@ -15,7 +15,7 @@ dioxus create hello-dioxus > > You can choose to create your project from a different template by passing the `template` argument: > ``` -> dioxus init hello-dioxus --template=gh:dioxuslabs/dioxus-template +> dx init hello-dioxus --template=gh:dioxuslabs/dioxus-template > ``` Next, move the current directory into your new project: @@ -33,7 +33,7 @@ cd hello-dioxus Finally, create serve your project with the Dioxus CLI: ``` -dioxus serve +dx serve ``` By default, the CLI serve your site at: [`http://127.0.0.1:8080/`](http://127.0.0.1:8080/) From 31a68a9743351677dd32ca41998305dc96c68ad0 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 18 Jul 2023 18:33:14 -0700 Subject: [PATCH 4/4] Rename dioxus to dx --- packages/cli/docs/src/cmd/build.md | 2 +- packages/cli/docs/src/cmd/clean.md | 2 +- packages/cli/docs/src/cmd/serve.md | 2 +- packages/cli/docs/src/creating.md | 2 +- packages/fullstack/examples/axum-auth/src/main.rs | 2 +- packages/fullstack/examples/axum-hello-world/src/main.rs | 2 +- packages/fullstack/examples/axum-router/src/main.rs | 2 +- packages/fullstack/examples/salvo-hello-world/src/main.rs | 2 +- packages/fullstack/examples/static-hydrated/src/main.rs | 2 +- packages/fullstack/examples/warp-hello-world/src/main.rs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/cli/docs/src/cmd/build.md b/packages/cli/docs/src/cmd/build.md index ec067c774..6109d14f1 100644 --- a/packages/cli/docs/src/cmd/build.md +++ b/packages/cli/docs/src/cmd/build.md @@ -43,7 +43,7 @@ dx build --platform web You can add the `--bin` option to select which crate you want Dioxus to build: ``` -dioxus build --bin app +dx build --bin app ``` ## Build Example diff --git a/packages/cli/docs/src/cmd/clean.md b/packages/cli/docs/src/cmd/clean.md index c81f352e5..ef938d245 100644 --- a/packages/cli/docs/src/cmd/clean.md +++ b/packages/cli/docs/src/cmd/clean.md @@ -23,5 +23,5 @@ dx clean You can add the `--bin` option to select which crate you want Dioxus to clean artifacts from: ``` -dioxus clean --bin app +dx clean --bin app ``` diff --git a/packages/cli/docs/src/cmd/serve.md b/packages/cli/docs/src/cmd/serve.md index ccf70d310..d8b4e0d42 100644 --- a/packages/cli/docs/src/cmd/serve.md +++ b/packages/cli/docs/src/cmd/serve.md @@ -37,7 +37,7 @@ dx serve --exmaple test You can add the `--bin` option to select which crate you want Dioxus to build and serve: ``` -dioxus serve --bin app +dx serve --bin app ``` ## Open Browser diff --git a/packages/cli/docs/src/creating.md b/packages/cli/docs/src/creating.md index 95470827f..6c2d5754c 100644 --- a/packages/cli/docs/src/creating.md +++ b/packages/cli/docs/src/creating.md @@ -7,7 +7,7 @@ Once you have the Dioxus CLI tool installed, you can use it to create dioxus pro First, run the `dx create` command to create a new project ready to be used with Dioxus and the Dioxus CLI: ``` -dioxus create hello-dioxus +dx create hello-dioxus ``` > It will clone a default template from github template: [DioxusLabs/dioxus-template](https://github.com/DioxusLabs/dioxus-template) diff --git a/packages/fullstack/examples/axum-auth/src/main.rs b/packages/fullstack/examples/axum-auth/src/main.rs index 00ddb95f9..fe94c9628 100644 --- a/packages/fullstack/examples/axum-auth/src/main.rs +++ b/packages/fullstack/examples/axum-auth/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr //! ``` diff --git a/packages/fullstack/examples/axum-hello-world/src/main.rs b/packages/fullstack/examples/axum-hello-world/src/main.rs index 739a24b1c..e00b9ae05 100644 --- a/packages/fullstack/examples/axum-hello-world/src/main.rs +++ b/packages/fullstack/examples/axum-hello-world/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr //! ``` diff --git a/packages/fullstack/examples/axum-router/src/main.rs b/packages/fullstack/examples/axum-router/src/main.rs index f78904277..54ce11769 100644 --- a/packages/fullstack/examples/axum-router/src/main.rs +++ b/packages/fullstack/examples/axum-router/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr //! ``` diff --git a/packages/fullstack/examples/salvo-hello-world/src/main.rs b/packages/fullstack/examples/salvo-hello-world/src/main.rs index 9e5649efc..bf6c2872a 100644 --- a/packages/fullstack/examples/salvo-hello-world/src/main.rs +++ b/packages/fullstack/examples/salvo-hello-world/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr //! ``` diff --git a/packages/fullstack/examples/static-hydrated/src/main.rs b/packages/fullstack/examples/static-hydrated/src/main.rs index eedc0187e..f89b01cce 100644 --- a/packages/fullstack/examples/static-hydrated/src/main.rs +++ b/packages/fullstack/examples/static-hydrated/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr //! ``` diff --git a/packages/fullstack/examples/warp-hello-world/src/main.rs b/packages/fullstack/examples/warp-hello-world/src/main.rs index 9e5649efc..bf6c2872a 100644 --- a/packages/fullstack/examples/warp-hello-world/src/main.rs +++ b/packages/fullstack/examples/warp-hello-world/src/main.rs @@ -1,7 +1,7 @@ //! Run with: //! //! ```sh -//! dioxus build --features web +//! dx build --features web //! cargo run --features ssr //! ```