diff --git a/examples/api/README.md b/examples/api/README.md index b64d070a..5b73895a 100644 --- a/examples/api/README.md +++ b/examples/api/README.md @@ -7,24 +7,19 @@ In the future, this app will be used on Tauri's integration tests. ## Running the example -- Install dependencies (Run inside of this folder `examples/api/`) +- Install dependencies and build packages (Run inside of the repository root) ```bash -# with yarn -$ yarn -# with npm -$ npm install +$ pnpm install +$ pnpm build ``` - Run the app in development mode (Run inside of this folder `examples/api/`) ```bash -# with yarn -$ yarn tauri dev -# with npm -$ npm run tauri dev +$ pnpm tauri dev ``` - Build an run the release app (Run inside of this folder `examples/api/`) ```bash -$ yarn tauri build +$ pnpm tauri build $ ./src-tauri/target/release/app ``` diff --git a/examples/api/package.json b/examples/api/package.json index a3f68cb4..ff4fb51a 100644 --- a/examples/api/package.json +++ b/examples/api/package.json @@ -13,8 +13,12 @@ "@zerodevx/svelte-json-view": "0.2.1", "tauri-plugin-cli-api": "0.0.0", "tauri-plugin-clipboard-api": "0.0.0", + "tauri-plugin-dialog-api": "0.0.0", "tauri-plugin-fs-api": "0.0.0", - "tauri-plugin-global-shortcut-api": "0.0.0" + "tauri-plugin-global-shortcut-api": "0.0.0", + "tauri-plugin-http-api": "0.0.0", + "tauri-plugin-notification-api": "0.0.0", + "tauri-plugin-shell-api": "0.0.0" }, "devDependencies": { "@iconify-json/codicon": "^1.1.10", diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index f553d3b2..3e52a758 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -151,9 +151,13 @@ dependencies = [ "tauri-build", "tauri-plugin-cli", "tauri-plugin-clipboard", + "tauri-plugin-dialog", "tauri-plugin-fs", "tauri-plugin-global-shortcut", + "tauri-plugin-http", "tauri-plugin-log", + "tauri-plugin-notification", + "tauri-plugin-shell", "tiny_http", "window-shadows", ] @@ -1776,6 +1780,15 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + [[package]] name = "is-terminal" version = "0.4.7" @@ -1788,6 +1801,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "itoa" version = "0.4.8" @@ -2271,6 +2294,15 @@ dependencies = [ "syn", ] +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + [[package]] name = "objc" version = "0.2.7" @@ -2324,12 +2356,12 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "open" -version = "3.2.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2078c0039e6a54a0c42c28faa984e115fb4c2d5bf2208f77d1961002df8576f8" +checksum = "d16814a067484415fda653868c9be0ac5f2abd2ef5d951082a5f2fe1b3662944" dependencies = [ + "is-wsl", "pathdiff", - "windows-sys 0.42.0", ] [[package]] @@ -3355,9 +3387,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d16138f5d521fcde40580e1a34df784b063dd9ac05c7cbe344bf01f02a23be" +checksum = "389820c5cd5279ffdde7729baa9cf4db20e9936e11b1e171a20fb74babe3a6d3" dependencies = [ "bitflags", "cairo-rs", @@ -3427,7 +3459,7 @@ dependencies = [ [[package]] name = "tauri" version = "2.0.0-alpha.8" -source = "git+https://github.com/tauri-apps/tauri?branch=next#e6e586ad75453e99216fd0d1070ba0696bb0a4a6" +source = "git+https://github.com/tauri-apps/tauri?branch=next#bb2a8ccf1356e59b98947d827d61e4e99533f2bc" dependencies = [ "anyhow", "base64 0.21.0", @@ -3450,25 +3482,19 @@ dependencies = [ "libc", "log", "minisign-verify", - "notify-rust", "objc", "once_cell", - "open", "os_info", - "os_pipe", "percent-encoding", "png", "rand 0.8.5", "raw-window-handle", - "regex", "reqwest", - "rfd", "semver 1.0.16", "serde", "serde_json", "serde_repr", "serialize-to-javascript", - "shared_child", "state", "swift-rs", "tar", @@ -3485,7 +3511,6 @@ dependencies = [ "uuid", "webkit2gtk", "webview2-com", - "win7-notifications", "windows 0.44.0", "zip", ] @@ -3493,7 +3518,7 @@ dependencies = [ [[package]] name = "tauri-build" version = "2.0.0-alpha.4" -source = "git+https://github.com/tauri-apps/tauri?branch=next#e6e586ad75453e99216fd0d1070ba0696bb0a4a6" +source = "git+https://github.com/tauri-apps/tauri?branch=next#bb2a8ccf1356e59b98947d827d61e4e99533f2bc" dependencies = [ "anyhow", "cargo_toml", @@ -3514,7 +3539,7 @@ dependencies = [ [[package]] name = "tauri-codegen" version = "2.0.0-alpha.4" -source = "git+https://github.com/tauri-apps/tauri?branch=next#e6e586ad75453e99216fd0d1070ba0696bb0a4a6" +source = "git+https://github.com/tauri-apps/tauri?branch=next#bb2a8ccf1356e59b98947d827d61e4e99533f2bc" dependencies = [ "base64 0.21.0", "brotli", @@ -3524,7 +3549,6 @@ dependencies = [ "png", "proc-macro2", "quote", - "regex", "semver 1.0.16", "serde", "serde_json", @@ -3540,7 +3564,7 @@ dependencies = [ [[package]] name = "tauri-macros" version = "2.0.0-alpha.4" -source = "git+https://github.com/tauri-apps/tauri?branch=next#e6e586ad75453e99216fd0d1070ba0696bb0a4a6" +source = "git+https://github.com/tauri-apps/tauri?branch=next#bb2a8ccf1356e59b98947d827d61e4e99533f2bc" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -3552,7 +3576,7 @@ dependencies = [ [[package]] name = "tauri-plugin-cli" -version = "0.1.0" +version = "0.0.0" dependencies = [ "clap", "log", @@ -3564,7 +3588,7 @@ dependencies = [ [[package]] name = "tauri-plugin-clipboard" -version = "0.1.0" +version = "0.0.0" dependencies = [ "arboard", "log", @@ -3575,9 +3599,24 @@ dependencies = [ "thiserror", ] +[[package]] +name = "tauri-plugin-dialog" +version = "0.0.0" +dependencies = [ + "glib", + "log", + "raw-window-handle", + "rfd", + "serde", + "serde_json", + "tauri", + "tauri-build", + "thiserror", +] + [[package]] name = "tauri-plugin-fs" -version = "0.1.0" +version = "0.0.0" dependencies = [ "anyhow", "serde", @@ -3587,7 +3626,7 @@ dependencies = [ [[package]] name = "tauri-plugin-global-shortcut" -version = "0.1.0" +version = "0.0.0" dependencies = [ "global-hotkey", "log", @@ -3597,9 +3636,25 @@ dependencies = [ "thiserror", ] +[[package]] +name = "tauri-plugin-http" +version = "0.0.0" +dependencies = [ + "bytes", + "glob", + "http", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "tauri", + "thiserror", +] + [[package]] name = "tauri-plugin-log" -version = "0.1.0" +version = "0.0.0" dependencies = [ "android_logger", "byte-unit", @@ -3616,10 +3671,40 @@ dependencies = [ "time", ] +[[package]] +name = "tauri-plugin-notification" +version = "0.1.0" +dependencies = [ + "log", + "notify-rust", + "serde", + "serde_json", + "tauri", + "tauri-build", + "thiserror", + "win7-notifications", +] + +[[package]] +name = "tauri-plugin-shell" +version = "0.0.0" +dependencies = [ + "encoding_rs", + "log", + "open", + "os_pipe", + "regex", + "serde", + "serde_json", + "shared_child", + "tauri", + "thiserror", +] + [[package]] name = "tauri-runtime" version = "0.13.0-alpha.4" -source = "git+https://github.com/tauri-apps/tauri?branch=next#e6e586ad75453e99216fd0d1070ba0696bb0a4a6" +source = "git+https://github.com/tauri-apps/tauri?branch=next#bb2a8ccf1356e59b98947d827d61e4e99533f2bc" dependencies = [ "gtk", "http", @@ -3640,7 +3725,7 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" version = "0.13.0-alpha.4" -source = "git+https://github.com/tauri-apps/tauri?branch=next#e6e586ad75453e99216fd0d1070ba0696bb0a4a6" +source = "git+https://github.com/tauri-apps/tauri?branch=next#bb2a8ccf1356e59b98947d827d61e4e99533f2bc" dependencies = [ "cocoa", "gtk", @@ -3660,7 +3745,7 @@ dependencies = [ [[package]] name = "tauri-utils" version = "2.0.0-alpha.4" -source = "git+https://github.com/tauri-apps/tauri?branch=next#e6e586ad75453e99216fd0d1070ba0696bb0a4a6" +source = "git+https://github.com/tauri-apps/tauri?branch=next#bb2a8ccf1356e59b98947d827d61e4e99533f2bc" dependencies = [ "aes-gcm", "brotli", @@ -3786,6 +3871,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ "itoa 1.0.5", + "libc", + "num_threads", "serde", "time-core", "time-macros", @@ -4686,9 +4773,9 @@ dependencies = [ [[package]] name = "wry" -version = "0.27.3" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8cf0dbfa7ccbd2e3832a3098b19d4b552360ea00a40b244a99caef46bffd84f" +checksum = "7d15f9f827d537cefe6d047be3930f5d89b238dfb85e08ba6a319153217635aa" dependencies = [ "base64 0.13.1", "block", diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index 0dc56357..775067cd 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -20,6 +20,10 @@ log = "0.4" tauri-plugin-log = { path = "../../../plugins/log" } tauri-plugin-fs = { path = "../../../plugins/fs" } tauri-plugin-clipboard = { path = "../../../plugins/clipboard" } +tauri-plugin-dialog = { path = "../../../plugins/dialog" } +tauri-plugin-http = { path = "../../../plugins/http", features = [ "http-multipart" ] } +tauri-plugin-notification = { path = "../../../plugins/notification", features = [ "windows7-compat" ] } +tauri-plugin-shell = { path = "../../../plugins/shell" } [patch.crates-io] tauri = { git = "https://github.com/tauri-apps/tauri", branch = "next" } @@ -29,13 +33,10 @@ tauri-build = { git = "https://github.com/tauri-apps/tauri", branch = "next" } version = "2.0.0-alpha.8" features = [ "api-all", - "global-shortcut", - "http-multipart", "icon-ico", "icon-png", "isolation", "macos-private-api", - "windows7-compat", "system-tray", "updater" ] diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index c3f652f8..ba75c55e 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -33,6 +33,10 @@ pub fn run() { ) .plugin(tauri_plugin_fs::init()) .plugin(tauri_plugin_clipboard::init()) + .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_http::init()) + .plugin(tauri_plugin_notification::init()) + .plugin(tauri_plugin_shell::init()) .setup(move |app| { #[cfg(desktop)] { diff --git a/examples/api/src-tauri/src/tray.rs b/examples/api/src-tauri/src/tray.rs index 5a1fce63..fdd815d0 100644 --- a/examples/api/src-tauri/src/tray.rs +++ b/examples/api/src-tauri/src/tray.rs @@ -4,12 +4,10 @@ use std::sync::atomic::{AtomicBool, Ordering}; use tauri::{ - api::{ - dialog::{MessageDialogBuilder, MessageDialogButtons}, - shell, - }, CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, WindowBuilder, WindowUrl, }; +use tauri_plugin_dialog::DialogExt; +use tauri_plugin_shell::ShellExt; pub fn create_tray(app: &tauri::App) -> tauri::Result<()> { let mut tray_menu1 = SystemTrayMenu::new() @@ -121,20 +119,16 @@ pub fn create_tray(app: &tauri::App) -> tauri::Result<()> { } "about" => { let window = handle.get_window("main").unwrap(); - MessageDialogBuilder::new("About app", "Tauri demo app") + window + .dialog() + .message("Tauri demo app") + .title("About app") .parent(&window) - .buttons(MessageDialogButtons::OkCancelWithLabels( - "Homepage".into(), - "know it".into(), - )) + .ok_button_label("Homepage") + .cancel_button_label("Cancel") .show(move |ok| { if ok { - shell::open( - &window.shell_scope(), - "https://tauri.app/", - None, - ) - .unwrap(); + window.shell().open("https://tauri.app/", None).unwrap(); } }); } diff --git a/examples/api/src-tauri/tauri.conf.json b/examples/api/src-tauri/tauri.conf.json index 90c8e29b..25e1c058 100644 --- a/examples/api/src-tauri/tauri.conf.json +++ b/examples/api/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "Tauri API", - "version": "1.0.0" + "version": "2.0.0" }, "plugins": { "cli": { @@ -83,7 +83,6 @@ }, "updater": { "active": true, - "dialog": false, "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE5QzMxNjYwNTM5OEUwNTgKUldSWTRKaFRZQmJER1h4d1ZMYVA3dnluSjdpN2RmMldJR09hUFFlZDY0SlFqckkvRUJhZDJVZXAK", "endpoints": [ "https://tauri-update-server.vercel.app/update/{{target}}/{{current_version}}" diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index ae4298a2..b955ee61 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -1,6 +1,6 @@