Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config docs for desktop and TUI #123

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions docs-src/0.4/en/CLI/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,100 @@ script = []
[[web.proxy]]
backend = "http://localhost:8000/api/"
```

## Desktop and TUI

For the desktop and TUI (terminal user interface) renderers,
Dioxus bundles your app using `dx bundle` and the [tauri-bundler](https://docs.rs/crate/tauri-bundler/latest).

You can check out the [tauri-bundler docs.rs](https://docs.rs/tauri-bundler/latest/tauri_bundler/bundle/index.html).
This covers all the different settings. Keep in mind that `FooSettings` becomes just `foo` in the TOML.

Tauri uses a JSON file for the configuration, but Dioxus uses TOML. So this tauri-bundler example:
```json
{
"package": {
"productName": "Your Awesome App",
"version": "0.1.0"
},
"tauri": {
"bundle": {
"active": true,
"identifier": "com.my.app",
"shortDescription": "",
"longDescription": "",
"copyright": "Copyright (c) You 2021. All rights reserved.",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"resources": ["./assets/**/*.png"],
"deb": {
"depends": ["debian-dependency1", "debian-dependency2"]
},
"macOS": {
"frameworks": [],
"minimumSystemVersion": "10.11",
"license": "./LICENSE"
},
"externalBin": ["./sidecar-app"]
}
}
}
```

needs to be translated to TOML.

However, Dioxus has Dioxus-specific mandatory TOML fields that we need to include as well.
Copy link
Author

@tigerros tigerros Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is required with dx bundle. I can't run dx build without the mandatory fields, so I assume it is required.

We can see what fields are mandatory from the documentation above.

Additionally, we also need to remove `tauri` from the TOML headers.

This is our final `Dioxus.toml`:

```toml
# From Dioxus
[application]
name = "Your Awesome App"
default_platform = "desktop"

# You might only be running on desktop, but the following "web" values are still required.
Copy link
Author

@tigerros tigerros Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is required either. I can't run dx build without the web-specific fields, so I assume it is required.

[web.app]
title = "Awesome"

[web.watcher]

[web.resource.dev]

# From the tauri-bundler.
[package]
productName = "Your Awesome App"
version = "0.1.0"

[bundle]
active = true
identifier = "com.my.app"
shortDescription = ""
longDescription = ""
copyright = "Copyright (c) You 2021. All rights reserved."
icon = [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
resources = [ "./assets/**/*.png" ]
externalBin = [ "./sidecar-app" ]

[bundle.deb]
depends = [ "debian-dependency1", "debian-dependency2" ]

[bundle.macOS]
frameworks = [ ]
minimumSystemVersion = "10.11"
license = "./LICENSE"
```