From caa2a91a12843d8bf3455905cf5c0dbd07e6e2de Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Tue, 12 Mar 2024 12:02:53 -0300 Subject: [PATCH 1/3] refactor: only inject API IIFE script when withGlobalTauri is true --- .changes/global-api-script-refactor.md | 32 +++++ Cargo.lock | 55 ++++----- Cargo.toml | 11 +- .../src-tauri/gen/schemas/desktop-schema.json | 43 +------ .../src-tauri/gen/schemas/mobile-schema.json | 113 ++++++++++++++++-- examples/api/src-tauri/src/tray.rs | 4 +- plugins/authenticator/{src => }/api-iife.js | 0 plugins/authenticator/build.rs | 4 +- .../permissions/schemas/schema.json | 10 +- plugins/authenticator/src/lib.rs | 1 - plugins/autostart/{src => }/api-iife.js | 0 plugins/autostart/build.rs | 4 +- .../autostart/permissions/schemas/schema.json | 10 +- plugins/autostart/src/lib.rs | 1 - plugins/barcode-scanner/{src => }/api-iife.js | 0 plugins/barcode-scanner/build.rs | 1 + .../permissions/schemas/schema.json | 10 +- plugins/biometric/{src => }/api-iife.js | 0 plugins/biometric/build.rs | 1 + .../biometric/permissions/schemas/schema.json | 10 +- plugins/biometric/src/lib.rs | 1 - plugins/cli/{src => }/api-iife.js | 0 plugins/cli/build.rs | 4 +- plugins/cli/permissions/schemas/schema.json | 10 +- plugins/cli/src/lib.rs | 1 - .../clipboard-manager/{src => }/api-iife.js | 0 plugins/clipboard-manager/build.rs | 1 + .../permissions/schemas/schema.json | 10 +- plugins/clipboard-manager/src/lib.rs | 1 - plugins/deep-link/{src => }/api-iife.js | 0 plugins/deep-link/build.rs | 1 + .../deep-link/permissions/schemas/schema.json | 10 +- plugins/deep-link/src/lib.rs | 1 - plugins/dialog/{src => }/api-iife.js | 0 plugins/dialog/build.rs | 1 + .../dialog/permissions/schemas/schema.json | 10 +- plugins/dialog/src/lib.rs | 8 +- plugins/fs/{src => }/api-iife.js | 0 plugins/fs/build.rs | 1 + plugins/fs/permissions/schemas/schema.json | 10 +- plugins/fs/src/lib.rs | 1 - plugins/global-shortcut/{src => }/api-iife.js | 0 plugins/global-shortcut/build.rs | 4 +- .../permissions/schemas/schema.json | 10 +- plugins/global-shortcut/src/lib.rs | 1 - plugins/http/{src => }/api-iife.js | 0 plugins/http/build.rs | 1 + plugins/http/permissions/schemas/schema.json | 10 +- plugins/http/src/lib.rs | 1 - plugins/log/{src => }/api-iife.js | 0 plugins/log/build.rs | 5 +- plugins/log/permissions/schemas/schema.json | 10 +- plugins/log/src/lib.rs | 1 - plugins/nfc/{src => }/api-iife.js | 0 plugins/nfc/build.rs | 1 + plugins/nfc/permissions/schemas/schema.json | 10 +- plugins/nfc/src/lib.rs | 1 - plugins/notification/{src => }/api-iife.js | 0 plugins/notification/build.rs | 1 + .../permissions/schemas/schema.json | 10 +- plugins/notification/src/lib.rs | 4 +- plugins/os/{src => }/api-iife.js | 0 plugins/os/build.rs | 4 +- plugins/os/permissions/schemas/schema.json | 10 +- plugins/os/src/init.js | 2 - plugins/os/src/lib.rs | 3 - plugins/positioner/{src => }/api-iife.js | 0 plugins/positioner/build.rs | 4 +- .../permissions/schemas/schema.json | 10 +- plugins/positioner/src/lib.rs | 5 +- plugins/process/{src => }/api-iife.js | 0 plugins/process/build.rs | 4 +- .../process/permissions/schemas/schema.json | 10 +- plugins/process/src/lib.rs | 1 - plugins/shell/{src => }/api-iife.js | 0 plugins/shell/build.rs | 1 + plugins/shell/permissions/schemas/schema.json | 10 +- plugins/shell/src/lib.rs | 5 +- plugins/sql/{src => }/api-iife.js | 0 plugins/sql/build.rs | 4 +- plugins/sql/permissions/schemas/schema.json | 10 +- plugins/sql/src/plugin.rs | 1 - plugins/store/{src => }/api-iife.js | 0 plugins/store/build.rs | 1 + plugins/store/permissions/schemas/schema.json | 10 +- plugins/store/src/lib.rs | 1 - plugins/stronghold/{src => }/api-iife.js | 0 plugins/stronghold/build.rs | 4 +- .../permissions/schemas/schema.json | 10 +- plugins/stronghold/src/lib.rs | 24 ++-- plugins/updater/{src => }/api-iife.js | 0 plugins/updater/build.rs | 4 +- .../updater/permissions/schemas/schema.json | 10 +- plugins/updater/src/lib.rs | 1 - plugins/upload/{src => }/api-iife.js | 0 plugins/upload/build.rs | 4 +- .../upload/permissions/schemas/schema.json | 10 +- plugins/upload/src/lib.rs | 1 - plugins/websocket/{src => }/api-iife.js | 0 plugins/websocket/build.rs | 4 +- .../websocket/permissions/schemas/schema.json | 10 +- plugins/websocket/src/lib.rs | 1 - plugins/window-state/{src => }/api-iife.js | 0 plugins/window-state/build.rs | 4 +- .../permissions/schemas/schema.json | 10 +- plugins/window-state/src/lib.rs | 1 - shared/rollup.config.js | 2 +- shared/template/build.rs | 1 + shared/template/src/lib.rs | 1 - 109 files changed, 321 insertions(+), 328 deletions(-) create mode 100644 .changes/global-api-script-refactor.md rename plugins/authenticator/{src => }/api-iife.js (100%) rename plugins/autostart/{src => }/api-iife.js (100%) rename plugins/barcode-scanner/{src => }/api-iife.js (100%) rename plugins/biometric/{src => }/api-iife.js (100%) rename plugins/cli/{src => }/api-iife.js (100%) rename plugins/clipboard-manager/{src => }/api-iife.js (100%) rename plugins/deep-link/{src => }/api-iife.js (100%) rename plugins/dialog/{src => }/api-iife.js (100%) rename plugins/fs/{src => }/api-iife.js (100%) rename plugins/global-shortcut/{src => }/api-iife.js (100%) rename plugins/http/{src => }/api-iife.js (100%) rename plugins/log/{src => }/api-iife.js (100%) rename plugins/nfc/{src => }/api-iife.js (100%) rename plugins/notification/{src => }/api-iife.js (100%) rename plugins/os/{src => }/api-iife.js (100%) rename plugins/positioner/{src => }/api-iife.js (100%) rename plugins/process/{src => }/api-iife.js (100%) rename plugins/shell/{src => }/api-iife.js (100%) rename plugins/sql/{src => }/api-iife.js (100%) rename plugins/store/{src => }/api-iife.js (100%) rename plugins/stronghold/{src => }/api-iife.js (100%) rename plugins/updater/{src => }/api-iife.js (100%) rename plugins/upload/{src => }/api-iife.js (100%) rename plugins/websocket/{src => }/api-iife.js (100%) rename plugins/window-state/{src => }/api-iife.js (100%) diff --git a/.changes/global-api-script-refactor.md b/.changes/global-api-script-refactor.md new file mode 100644 index 000000000..40f2427e7 --- /dev/null +++ b/.changes/global-api-script-refactor.md @@ -0,0 +1,32 @@ +--- +"authenticator": patch +"autostart": patch +"barcode-scanner": patch +"biometric": patch +"cli": patch +"clipboard-manager": patch +"deep-link": patch +"dialog": patch +"fs": patch +"global-shortcut": patch +"http": patch +"localhost": patch +"log-plugin": patch +"nfc": patch +"notification": patch +"os": patch +"persisted-scope": patch +"positioner": patch +"process": patch +"shell": patch +"single-instance": patch +"sql": patch +"store": patch +"stronghold": patch +"updater": patch +"upload": patch +"websocket": patch +"window-state": patch +--- + +The global API script is now only added to the binary when the `withGlobalTauri` config is true. \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index fad46e8b5..f71f243b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3753,9 +3753,9 @@ dependencies = [ [[package]] name = "muda" -version = "0.11.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c47e7625990fc1af2226ea4f34fb2412b03c12639fcb91868581eb3a6893453" +checksum = "3e27c56b8cb9b3214d196556227b0eaa12db8393b4f919a0a93ffb67ed17d185" dependencies = [ "cocoa 0.25.0", "crossbeam-channel", @@ -6267,9 +6267,8 @@ checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tauri" -version = "2.0.0-beta.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353a521566bd41164a05887f40fe93b375c82b82000726f63c66237955dfb4f5" +version = "2.0.0-beta.11" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" dependencies = [ "anyhow", "bytes", @@ -6283,8 +6282,7 @@ dependencies = [ "heck", "http 0.2.11", "http-range", - "ico", - "infer", + "image", "jni", "libc", "log", @@ -6292,7 +6290,6 @@ dependencies = [ "muda", "objc", "percent-encoding", - "png", "raw-window-handle 0.6.0", "reqwest", "serde", @@ -6310,6 +6307,7 @@ dependencies = [ "tokio", "tray-icon", "url", + "urlpattern", "uuid", "webkit2gtk", "webview2-com", @@ -6319,9 +6317,8 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50887f06d343b6ede0260d29abb4edd57f40d8aac538f6e34d801c9a4fa1c6b8" +version = "2.0.0-beta.9" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" dependencies = [ "anyhow", "cargo_toml", @@ -6343,9 +6340,8 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c676621ba42f97d349ee1a835cfac8a268d8843c8b81fa7663ebac2854786a" +version = "2.0.0-beta.9" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" dependencies = [ "base64 0.22.0", "brotli", @@ -6370,9 +6366,8 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5e87dc692a359ee99662616639fe35681e3ce9929e1ec2447b2e3853b6bda6" +version = "2.0.0-beta.9" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" dependencies = [ "heck", "proc-macro2", @@ -6384,9 +6379,8 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.0.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84ccc2181a81c66f2b203775b6b67590cc357bc477c57f0fac844c31dd5c474" +version = "2.0.0-beta.9" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" dependencies = [ "anyhow", "glob", @@ -6846,9 +6840,8 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.0.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fc1ebe2a720c1b62a9980ebf44f27db4f8a475e1465917959ce3940d6903307" +version = "2.0.0-beta.9" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" dependencies = [ "gtk", "http 0.2.11", @@ -6864,9 +6857,8 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.0.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e853c02137e908589e9f0c684f10bb49d0dedf9e86ad734a18e42ce9bbd2ab" +version = "2.0.0-beta.9" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" dependencies = [ "cocoa 0.25.0", "gtk", @@ -6888,9 +6880,8 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.0.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1973b15065cb63868f5fba789d54ef04232d7e0229fb2230d1f557480a5ceea" +version = "2.0.0-beta.9" +source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" dependencies = [ "aes-gcm 0.10.3", "brotli", @@ -6909,6 +6900,7 @@ dependencies = [ "phf 0.11.2", "proc-macro2", "quote", + "regex", "schemars", "semver", "serde", @@ -6919,6 +6911,7 @@ dependencies = [ "thiserror", "toml 0.8.2", "url", + "urlpattern", "walkdir", ] @@ -7339,9 +7332,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.11.3" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4d9ddd4a7c0f3b6862af1c4911b529a49db4ee89310d3a258859c2f5053fdd" +checksum = "454035ff34b8430638c894e6197748578d6b4d449c6edaf8ea854d94e2dd862b" dependencies = [ "cocoa 0.25.0", "core-graphics 0.23.1", diff --git a/Cargo.toml b/Cargo.toml index 5f2dae3bc..6ee05eb11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,9 @@ resolver = "2" [workspace.dependencies] serde = { version = "1", features = ["derive"] } log = "0.4" -tauri = "2.0.0-beta.9" -tauri-build = "2.0.0-beta.7" -tauri-plugin = "2.0.0-beta.7" +tauri = "2.0.0-beta.11" +tauri-build = "2.0.0-beta.9" +tauri-plugin = "2.0.0-beta.9" serde_json = "1" thiserror = "1" url = "2" @@ -31,3 +31,8 @@ codegen-units = 1 lto = true incremental = false opt-level = "s" + +[patch.crates-io] +tauri = { git = "https://github.com/tauri-apps/tauri", branch = "dev" } +tauri-build = { git = "https://github.com/tauri-apps/tauri", branch = "dev" } +tauri-plugin = { git = "https://github.com/tauri-apps/tauri", branch = "dev" } \ No newline at end of file diff --git a/examples/api/src-tauri/gen/schemas/desktop-schema.json b/examples/api/src-tauri/gen/schemas/desktop-schema.json index 52ed8e229..22d809a45 100644 --- a/examples/api/src-tauri/gen/schemas/desktop-schema.json +++ b/examples/api/src-tauri/gen/schemas/desktop-schema.json @@ -41,8 +41,7 @@ "type": "object", "required": [ "identifier", - "permissions", - "windows" + "permissions" ], "properties": { "identifier": { @@ -93,14 +92,10 @@ }, "platforms": { "description": "Target platforms this capability applies. By default all platforms are affected by this capability.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } @@ -115,7 +110,7 @@ ], "properties": { "urls": { - "description": "Remote domains this capability refers to. Can use glob patterns.", + "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", "type": "array", "items": { "type": "string" @@ -4827,13 +4822,6 @@ "image:allow-from-bytes" ] }, - { - "description": "image:allow-from-ico-bytes -> Enables the from_ico_bytes command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:allow-from-ico-bytes" - ] - }, { "description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.", "type": "string", @@ -4841,13 +4829,6 @@ "image:allow-from-path" ] }, - { - "description": "image:allow-from-png-bytes -> Enables the from_png_bytes command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:allow-from-png-bytes" - ] - }, { "description": "image:allow-height -> Enables the height command without any pre-configured scope.", "type": "string", @@ -4883,13 +4864,6 @@ "image:deny-from-bytes" ] }, - { - "description": "image:deny-from-ico-bytes -> Denies the from_ico_bytes command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:deny-from-ico-bytes" - ] - }, { "description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.", "type": "string", @@ -4897,13 +4871,6 @@ "image:deny-from-path" ] }, - { - "description": "image:deny-from-png-bytes -> Denies the from_png_bytes command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:deny-from-png-bytes" - ] - }, { "description": "image:deny-height -> Denies the height command without any pre-configured scope.", "type": "string", diff --git a/examples/api/src-tauri/gen/schemas/mobile-schema.json b/examples/api/src-tauri/gen/schemas/mobile-schema.json index 6262fabb9..02217d8e6 100644 --- a/examples/api/src-tauri/gen/schemas/mobile-schema.json +++ b/examples/api/src-tauri/gen/schemas/mobile-schema.json @@ -11,6 +11,13 @@ } ] }, + { + "description": "A list of capabilities.", + "type": "array", + "items": { + "$ref": "#/definitions/Capability" + } + }, { "description": "A list of capabilities.", "type": "object", @@ -34,8 +41,7 @@ "type": "object", "required": [ "identifier", - "permissions", - "windows" + "permissions" ], "properties": { "identifier": { @@ -86,14 +92,10 @@ }, "platforms": { "description": "Target platforms this capability applies. By default all platforms are affected by this capability.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } @@ -108,7 +110,7 @@ ], "properties": { "urls": { - "description": "Remote domains this capability refers to. Can use glob patterns.", + "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", "type": "array", "items": { "type": "string" @@ -4827,6 +4829,97 @@ "http:deny-fetch-send" ] }, + { + "description": "image:default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "image:default" + ] + }, + { + "description": "image:allow-from-bytes -> Enables the from_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-from-bytes" + ] + }, + { + "description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-from-path" + ] + }, + { + "description": "image:allow-height -> Enables the height command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-height" + ] + }, + { + "description": "image:allow-new -> Enables the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-new" + ] + }, + { + "description": "image:allow-rgba -> Enables the rgba command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-rgba" + ] + }, + { + "description": "image:allow-width -> Enables the width command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-width" + ] + }, + { + "description": "image:deny-from-bytes -> Denies the from_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-from-bytes" + ] + }, + { + "description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-from-path" + ] + }, + { + "description": "image:deny-height -> Denies the height command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-height" + ] + }, + { + "description": "image:deny-new -> Denies the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-new" + ] + }, + { + "description": "image:deny-rgba -> Denies the rgba command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-rgba" + ] + }, + { + "description": "image:deny-width -> Denies the width command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-width" + ] + }, { "description": "log:default -> Allows the log command", "type": "string", diff --git a/examples/api/src-tauri/src/tray.rs b/examples/api/src-tauri/src/tray.rs index 74863c0ae..ab9f6af88 100644 --- a/examples/api/src-tauri/src/tray.rs +++ b/examples/api/src-tauri/src/tray.rs @@ -80,9 +80,9 @@ pub fn create_tray(app: &tauri::AppHandle) -> tauri::Result<()> { i @ "icon-1" | i @ "icon-2" => { if let Some(tray) = app.tray_by_id("tray-1") { let _ = tray.set_icon(Some(if i == "icon-1" { - tauri::Image::from_ico_bytes(include_bytes!("../icons/icon.ico")).unwrap() + tauri::image::Image::from_bytes(include_bytes!("../icons/icon.ico")).unwrap() } else { - tauri::Image::from_png_bytes(include_bytes!( + tauri::image::Image::from_bytes(include_bytes!( "../icons/tray_icon_with_transparency.png" )) .unwrap() diff --git a/plugins/authenticator/src/api-iife.js b/plugins/authenticator/api-iife.js similarity index 100% rename from plugins/authenticator/src/api-iife.js rename to plugins/authenticator/api-iife.js diff --git a/plugins/authenticator/build.rs b/plugins/authenticator/build.rs index 993df57a9..8b4c860e3 100644 --- a/plugins/authenticator/build.rs +++ b/plugins/authenticator/build.rs @@ -11,5 +11,7 @@ const COMMANDS: &[&str] = &[ ]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/authenticator/permissions/schemas/schema.json b/plugins/authenticator/permissions/schemas/schema.json index 3d8711b95..427c3f5a3 100644 --- a/plugins/authenticator/permissions/schemas/schema.json +++ b/plugins/authenticator/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/authenticator/src/lib.rs b/plugins/authenticator/src/lib.rs index b9979b7ff..0e3e9f057 100644 --- a/plugins/authenticator/src/lib.rs +++ b/plugins/authenticator/src/lib.rs @@ -78,7 +78,6 @@ fn verify_signature( pub fn init() -> TauriPlugin { PluginBuilder::new("authenticator") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ init_auth, register, diff --git a/plugins/autostart/src/api-iife.js b/plugins/autostart/api-iife.js similarity index 100% rename from plugins/autostart/src/api-iife.js rename to plugins/autostart/api-iife.js diff --git a/plugins/autostart/build.rs b/plugins/autostart/build.rs index 2b27eff07..1460469b5 100644 --- a/plugins/autostart/build.rs +++ b/plugins/autostart/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/autostart/permissions/schemas/schema.json b/plugins/autostart/permissions/schemas/schema.json index 5fcdb1543..901d274c9 100644 --- a/plugins/autostart/permissions/schemas/schema.json +++ b/plugins/autostart/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/autostart/src/lib.rs b/plugins/autostart/src/lib.rs index b4338208c..264185a95 100644 --- a/plugins/autostart/src/lib.rs +++ b/plugins/autostart/src/lib.rs @@ -107,7 +107,6 @@ pub fn init( args: Option>, ) -> TauriPlugin { Builder::new("autostart") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![enable, disable, is_enabled]) .setup(move |app, _api| { let mut builder = AutoLaunchBuilder::new(); diff --git a/plugins/barcode-scanner/src/api-iife.js b/plugins/barcode-scanner/api-iife.js similarity index 100% rename from plugins/barcode-scanner/src/api-iife.js rename to plugins/barcode-scanner/api-iife.js diff --git a/plugins/barcode-scanner/build.rs b/plugins/barcode-scanner/build.rs index 9239a4046..6326c23da 100644 --- a/plugins/barcode-scanner/build.rs +++ b/plugins/barcode-scanner/build.rs @@ -13,6 +13,7 @@ const COMMANDS: &[&str] = &[ fn main() { if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") .try_build() diff --git a/plugins/barcode-scanner/permissions/schemas/schema.json b/plugins/barcode-scanner/permissions/schemas/schema.json index 200c6a3e3..433df113b 100644 --- a/plugins/barcode-scanner/permissions/schemas/schema.json +++ b/plugins/barcode-scanner/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/biometric/src/api-iife.js b/plugins/biometric/api-iife.js similarity index 100% rename from plugins/biometric/src/api-iife.js rename to plugins/biometric/api-iife.js diff --git a/plugins/biometric/build.rs b/plugins/biometric/build.rs index 3df01ac9e..8099044f8 100644 --- a/plugins/biometric/build.rs +++ b/plugins/biometric/build.rs @@ -6,6 +6,7 @@ const COMMANDS: &[&str] = &["authenticate", "status"]; fn main() { tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") .build(); diff --git a/plugins/biometric/permissions/schemas/schema.json b/plugins/biometric/permissions/schemas/schema.json index 600610a42..d134e66ec 100644 --- a/plugins/biometric/permissions/schemas/schema.json +++ b/plugins/biometric/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/biometric/src/lib.rs b/plugins/biometric/src/lib.rs index 8b0d472db..4f7ffd1ee 100644 --- a/plugins/biometric/src/lib.rs +++ b/plugins/biometric/src/lib.rs @@ -59,7 +59,6 @@ impl> crate::BiometricExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { Builder::new("biometric") - .js_init_script(include_str!("api-iife.js").to_string()) .setup(|app, api| { #[cfg(target_os = "android")] let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "BiometricPlugin")?; diff --git a/plugins/cli/src/api-iife.js b/plugins/cli/api-iife.js similarity index 100% rename from plugins/cli/src/api-iife.js rename to plugins/cli/api-iife.js diff --git a/plugins/cli/build.rs b/plugins/cli/build.rs index 15ff656f8..50d888497 100644 --- a/plugins/cli/build.rs +++ b/plugins/cli/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["cli_matches"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/cli/permissions/schemas/schema.json b/plugins/cli/permissions/schemas/schema.json index 4552dc240..00a7a1151 100644 --- a/plugins/cli/permissions/schemas/schema.json +++ b/plugins/cli/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/cli/src/lib.rs b/plugins/cli/src/lib.rs index c666874c9..0e65409ef 100644 --- a/plugins/cli/src/lib.rs +++ b/plugins/cli/src/lib.rs @@ -51,7 +51,6 @@ fn cli_matches(_app: AppHandle, cli: State<'_, Cli>) -> Result pub fn init() -> TauriPlugin { Builder::new("cli") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![cli_matches]) .setup(|app, api| { app.manage(Cli(api)); diff --git a/plugins/clipboard-manager/src/api-iife.js b/plugins/clipboard-manager/api-iife.js similarity index 100% rename from plugins/clipboard-manager/src/api-iife.js rename to plugins/clipboard-manager/api-iife.js diff --git a/plugins/clipboard-manager/build.rs b/plugins/clipboard-manager/build.rs index 758d64f30..d87eabfcd 100644 --- a/plugins/clipboard-manager/build.rs +++ b/plugins/clipboard-manager/build.rs @@ -6,6 +6,7 @@ const COMMANDS: &[&str] = &["write", "read"]; fn main() { if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") .try_build() diff --git a/plugins/clipboard-manager/permissions/schemas/schema.json b/plugins/clipboard-manager/permissions/schemas/schema.json index b96f7829c..a1a7446d4 100644 --- a/plugins/clipboard-manager/permissions/schemas/schema.json +++ b/plugins/clipboard-manager/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/clipboard-manager/src/lib.rs b/plugins/clipboard-manager/src/lib.rs index bbfe59189..0188e6826 100644 --- a/plugins/clipboard-manager/src/lib.rs +++ b/plugins/clipboard-manager/src/lib.rs @@ -48,7 +48,6 @@ impl> crate::ClipboardExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { Builder::new("clipboard-manager") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ commands::write, commands::read, diff --git a/plugins/deep-link/src/api-iife.js b/plugins/deep-link/api-iife.js similarity index 100% rename from plugins/deep-link/src/api-iife.js rename to plugins/deep-link/api-iife.js diff --git a/plugins/deep-link/build.rs b/plugins/deep-link/build.rs index bffa4675a..4e66abe65 100644 --- a/plugins/deep-link/build.rs +++ b/plugins/deep-link/build.rs @@ -33,6 +33,7 @@ fn intent_filter(domain: &AssociatedDomain) -> String { fn main() { if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .try_build() { diff --git a/plugins/deep-link/permissions/schemas/schema.json b/plugins/deep-link/permissions/schemas/schema.json index fc7a2d412..b9ca74380 100644 --- a/plugins/deep-link/permissions/schemas/schema.json +++ b/plugins/deep-link/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/deep-link/src/lib.rs b/plugins/deep-link/src/lib.rs index 5fa4b9075..7dde3dd36 100644 --- a/plugins/deep-link/src/lib.rs +++ b/plugins/deep-link/src/lib.rs @@ -128,7 +128,6 @@ impl> crate::DeepLinkExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin> { Builder::new("deep-link") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![commands::get_current]) .setup(|app, api| { app.manage(init_deep_link(app, api)?); diff --git a/plugins/dialog/src/api-iife.js b/plugins/dialog/api-iife.js similarity index 100% rename from plugins/dialog/src/api-iife.js rename to plugins/dialog/api-iife.js diff --git a/plugins/dialog/build.rs b/plugins/dialog/build.rs index d692f66d7..89592ce1c 100644 --- a/plugins/dialog/build.rs +++ b/plugins/dialog/build.rs @@ -6,6 +6,7 @@ const COMMANDS: &[&str] = &["open", "save", "message", "ask", "confirm"]; fn main() { if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") .try_build() diff --git a/plugins/dialog/permissions/schemas/schema.json b/plugins/dialog/permissions/schemas/schema.json index 2b944e3e8..b8940d26e 100644 --- a/plugins/dialog/permissions/schemas/schema.json +++ b/plugins/dialog/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/dialog/src/lib.rs b/plugins/dialog/src/lib.rs index 0e9aa9dbd..7f58168cf 100644 --- a/plugins/dialog/src/lib.rs +++ b/plugins/dialog/src/lib.rs @@ -84,13 +84,7 @@ pub fn init() -> TauriPlugin { // Dialogs are implemented natively on Android #[cfg(not(target_os = "android"))] { - let mut init_script = include_str!("init-iife.js").to_string(); - init_script.push_str(include_str!("api-iife.js")); - builder = builder.js_init_script(init_script); - } - #[cfg(target_os = "android")] - { - builder = builder.js_init_script(include_str!("api-iife.js").to_string()); + builder = builder.js_init_script(include_str!("init-iife.js").to_string()); } builder diff --git a/plugins/fs/src/api-iife.js b/plugins/fs/api-iife.js similarity index 100% rename from plugins/fs/src/api-iife.js rename to plugins/fs/api-iife.js diff --git a/plugins/fs/build.rs b/plugins/fs/build.rs index dcfefd294..056c0e61d 100644 --- a/plugins/fs/build.rs +++ b/plugins/fs/build.rs @@ -162,6 +162,7 @@ permissions = [ } tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .global_scope_schema(schemars::schema_for!(scope::Entry)) .build(); } diff --git a/plugins/fs/permissions/schemas/schema.json b/plugins/fs/permissions/schemas/schema.json index fadb22ae8..7f8fe82b7 100644 --- a/plugins/fs/permissions/schemas/schema.json +++ b/plugins/fs/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/fs/src/lib.rs b/plugins/fs/src/lib.rs index 2c8843ffd..c4568808a 100644 --- a/plugins/fs/src/lib.rs +++ b/plugins/fs/src/lib.rs @@ -69,7 +69,6 @@ impl ScopeObject for scope::Entry { pub fn init() -> TauriPlugin> { PluginBuilder::>::new("fs") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ commands::create, commands::open, diff --git a/plugins/global-shortcut/src/api-iife.js b/plugins/global-shortcut/api-iife.js similarity index 100% rename from plugins/global-shortcut/src/api-iife.js rename to plugins/global-shortcut/api-iife.js diff --git a/plugins/global-shortcut/build.rs b/plugins/global-shortcut/build.rs index 8c5c71dfd..cc5ade7d2 100644 --- a/plugins/global-shortcut/build.rs +++ b/plugins/global-shortcut/build.rs @@ -11,5 +11,7 @@ const COMMANDS: &[&str] = &[ ]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/global-shortcut/permissions/schemas/schema.json b/plugins/global-shortcut/permissions/schemas/schema.json index 1dadf863b..55b9b02bf 100644 --- a/plugins/global-shortcut/permissions/schemas/schema.json +++ b/plugins/global-shortcut/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/global-shortcut/src/lib.rs b/plugins/global-shortcut/src/lib.rs index b1f3b83ec..6680c78d4 100644 --- a/plugins/global-shortcut/src/lib.rs +++ b/plugins/global-shortcut/src/lib.rs @@ -353,7 +353,6 @@ impl Builder { let handler = self.handler; let shortcuts = self.shortcuts; PluginBuilder::new("global-shortcut") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ register, register_all, diff --git a/plugins/http/src/api-iife.js b/plugins/http/api-iife.js similarity index 100% rename from plugins/http/src/api-iife.js rename to plugins/http/api-iife.js diff --git a/plugins/http/build.rs b/plugins/http/build.rs index 7811cffc1..13a44c2cc 100644 --- a/plugins/http/build.rs +++ b/plugins/http/build.rs @@ -68,6 +68,7 @@ impl From for scope::Entry { fn main() { tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .global_scope_schema(schemars::schema_for!(ScopeEntry)) .build(); } diff --git a/plugins/http/permissions/schemas/schema.json b/plugins/http/permissions/schemas/schema.json index 3462ddcd0..7480bb2a5 100644 --- a/plugins/http/permissions/schemas/schema.json +++ b/plugins/http/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/http/src/lib.rs b/plugins/http/src/lib.rs index e4aa7ba1e..9e6e39082 100644 --- a/plugins/http/src/lib.rs +++ b/plugins/http/src/lib.rs @@ -35,7 +35,6 @@ impl> HttpExt for T { pub fn init() -> TauriPlugin { Builder::::new("http") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ commands::fetch, commands::fetch_cancel, diff --git a/plugins/log/src/api-iife.js b/plugins/log/api-iife.js similarity index 100% rename from plugins/log/src/api-iife.js rename to plugins/log/api-iife.js diff --git a/plugins/log/build.rs b/plugins/log/build.rs index f413529a1..5969c1e97 100644 --- a/plugins/log/build.rs +++ b/plugins/log/build.rs @@ -5,5 +5,8 @@ const COMMANDS: &[&str] = &["log"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).ios_path("ios").build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .ios_path("ios") + .build(); } diff --git a/plugins/log/permissions/schemas/schema.json b/plugins/log/permissions/schemas/schema.json index 9001f8def..1eb694d3c 100644 --- a/plugins/log/permissions/schemas/schema.json +++ b/plugins/log/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index 5f564b2d9..2cf190065 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -396,7 +396,6 @@ impl Builder { pub fn build(mut self) -> TauriPlugin { plugin::Builder::new("log") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![log]) .setup(move |app_handle, _api| { let app_name = &app_handle.package_info().name; diff --git a/plugins/nfc/src/api-iife.js b/plugins/nfc/api-iife.js similarity index 100% rename from plugins/nfc/src/api-iife.js rename to plugins/nfc/api-iife.js diff --git a/plugins/nfc/build.rs b/plugins/nfc/build.rs index 1d2343712..725512d0c 100644 --- a/plugins/nfc/build.rs +++ b/plugins/nfc/build.rs @@ -6,6 +6,7 @@ const COMMANDS: &[&str] = &["is_available", "write", "scan"]; fn main() { tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") .build(); diff --git a/plugins/nfc/permissions/schemas/schema.json b/plugins/nfc/permissions/schemas/schema.json index 802bc48c4..3ca96fd37 100644 --- a/plugins/nfc/permissions/schemas/schema.json +++ b/plugins/nfc/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/nfc/src/lib.rs b/plugins/nfc/src/lib.rs index 28d5160d4..2e3dc9dd9 100644 --- a/plugins/nfc/src/lib.rs +++ b/plugins/nfc/src/lib.rs @@ -71,7 +71,6 @@ impl> crate::NfcExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { Builder::new("nfc") - .js_init_script(include_str!("api-iife.js").to_string()) .setup(|app, api| { #[cfg(target_os = "android")] let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "NfcPlugin")?; diff --git a/plugins/notification/src/api-iife.js b/plugins/notification/api-iife.js similarity index 100% rename from plugins/notification/src/api-iife.js rename to plugins/notification/api-iife.js diff --git a/plugins/notification/build.rs b/plugins/notification/build.rs index 26d1f96e9..916d0f10a 100644 --- a/plugins/notification/build.rs +++ b/plugins/notification/build.rs @@ -6,6 +6,7 @@ const COMMANDS: &[&str] = &["notify", "request_permission", "is_permission_grant fn main() { if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") .try_build() diff --git a/plugins/notification/permissions/schemas/schema.json b/plugins/notification/permissions/schemas/schema.json index c3101b5c6..d3701600f 100644 --- a/plugins/notification/permissions/schemas/schema.json +++ b/plugins/notification/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/notification/src/lib.rs b/plugins/notification/src/lib.rs index 408a0f790..37d9d6da3 100644 --- a/plugins/notification/src/lib.rs +++ b/plugins/notification/src/lib.rs @@ -224,15 +224,13 @@ impl> crate::NotificationExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { - let mut init_script = include_str!("init-iife.js").to_string(); - init_script.push_str(include_str!("api-iife.js")); Builder::new("notification") .invoke_handler(tauri::generate_handler![ commands::notify, commands::request_permission, commands::is_permission_granted ]) - .js_init_script(init_script) + .js_init_script(include_str!("init-iife.js").to_string()) .setup(|app, api| { #[cfg(mobile)] let notification = mobile::init(app, api)?; diff --git a/plugins/os/src/api-iife.js b/plugins/os/api-iife.js similarity index 100% rename from plugins/os/src/api-iife.js rename to plugins/os/api-iife.js diff --git a/plugins/os/build.rs b/plugins/os/build.rs index 91dca73ef..f108f9656 100644 --- a/plugins/os/build.rs +++ b/plugins/os/build.rs @@ -14,5 +14,7 @@ const COMMANDS: &[&str] = &[ ]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/os/permissions/schemas/schema.json b/plugins/os/permissions/schemas/schema.json index 053f783d1..c325e3830 100644 --- a/plugins/os/permissions/schemas/schema.json +++ b/plugins/os/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/os/src/init.js b/plugins/os/src/init.js index a26d35aaf..5d2f3d1cf 100644 --- a/plugins/os/src/init.js +++ b/plugins/os/src/init.js @@ -8,5 +8,3 @@ Object.defineProperty(window, "__TAURI_OS_PLUGIN_INTERNALS__", { eol: __TEMPLATE_eol__, }, }); - -__RAW_global_os_api__; diff --git a/plugins/os/src/lib.rs b/plugins/os/src/lib.rs index fab629d59..3297f4fc3 100644 --- a/plugins/os/src/lib.rs +++ b/plugins/os/src/lib.rs @@ -103,14 +103,11 @@ pub fn hostname() -> String { #[derive(Template)] #[default_template("./init.js")] struct InitJavascript { - #[raw] - global_os_api: &'static str, eol: &'static str, } pub fn init() -> TauriPlugin { let init_js = InitJavascript { - global_os_api: include_str!("api-iife.js"), #[cfg(windows)] eol: "\r\n", #[cfg(not(windows))] diff --git a/plugins/positioner/src/api-iife.js b/plugins/positioner/api-iife.js similarity index 100% rename from plugins/positioner/src/api-iife.js rename to plugins/positioner/api-iife.js diff --git a/plugins/positioner/build.rs b/plugins/positioner/build.rs index 1fc5acfb8..52d333761 100644 --- a/plugins/positioner/build.rs +++ b/plugins/positioner/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["move_window"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/positioner/permissions/schemas/schema.json b/plugins/positioner/permissions/schemas/schema.json index d887b33f3..7cf674b95 100644 --- a/plugins/positioner/permissions/schemas/schema.json +++ b/plugins/positioner/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/positioner/src/lib.rs b/plugins/positioner/src/lib.rs index 6c5b735e7..3db88bf26 100644 --- a/plugins/positioner/src/lib.rs +++ b/plugins/positioner/src/lib.rs @@ -57,9 +57,8 @@ async fn move_window(window: tauri::Window, position: Position) - /// The Tauri plugin that exposes [`WindowExt::move_window`] to the webview. pub fn init() -> TauriPlugin { - let plugin = plugin::Builder::new("positioner") - .js_init_script(include_str!("api-iife.js").to_string()) - .invoke_handler(tauri::generate_handler![move_window]); + let plugin = + plugin::Builder::new("positioner").invoke_handler(tauri::generate_handler![move_window]); #[cfg(feature = "tray-icon")] let plugin = plugin.setup(|app_handle, _api| { diff --git a/plugins/process/src/api-iife.js b/plugins/process/api-iife.js similarity index 100% rename from plugins/process/src/api-iife.js rename to plugins/process/api-iife.js diff --git a/plugins/process/build.rs b/plugins/process/build.rs index e9d6cfda1..e412b34eb 100644 --- a/plugins/process/build.rs +++ b/plugins/process/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["exit", "restart"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/process/permissions/schemas/schema.json b/plugins/process/permissions/schemas/schema.json index a8fbdcc6e..98a1b344c 100644 --- a/plugins/process/permissions/schemas/schema.json +++ b/plugins/process/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/process/src/lib.rs b/plugins/process/src/lib.rs index 2de829140..e0e948fc8 100644 --- a/plugins/process/src/lib.rs +++ b/plugins/process/src/lib.rs @@ -20,7 +20,6 @@ mod commands; pub fn init() -> TauriPlugin { Builder::new("process") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![commands::exit, commands::restart]) .build() } diff --git a/plugins/shell/src/api-iife.js b/plugins/shell/api-iife.js similarity index 100% rename from plugins/shell/src/api-iife.js rename to plugins/shell/api-iife.js diff --git a/plugins/shell/build.rs b/plugins/shell/build.rs index f3ff751de..6814fbbc7 100644 --- a/plugins/shell/build.rs +++ b/plugins/shell/build.rs @@ -9,6 +9,7 @@ const COMMANDS: &[&str] = &["execute", "stdin_write", "kill", "open"]; fn main() { tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .global_scope_schema(schemars::schema_for!(scope_entry::Entry)) .build(); } diff --git a/plugins/shell/permissions/schemas/schema.json b/plugins/shell/permissions/schemas/schema.json index 1e1cd012c..788f5fedd 100644 --- a/plugins/shell/permissions/schemas/schema.json +++ b/plugins/shell/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/shell/src/lib.rs b/plugins/shell/src/lib.rs index b01f3e30c..012d9e96e 100644 --- a/plugins/shell/src/lib.rs +++ b/plugins/shell/src/lib.rs @@ -77,11 +77,8 @@ impl> ShellExt for T { } pub fn init() -> TauriPlugin> { - let mut init_script = include_str!("init-iife.js").to_string(); - init_script.push_str(include_str!("api-iife.js")); - Builder::>::new("shell") - .js_init_script(init_script) + .js_init_script(include_str!("init-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ commands::execute, commands::stdin_write, diff --git a/plugins/sql/src/api-iife.js b/plugins/sql/api-iife.js similarity index 100% rename from plugins/sql/src/api-iife.js rename to plugins/sql/api-iife.js diff --git a/plugins/sql/build.rs b/plugins/sql/build.rs index e74fdb42e..fbbca422c 100644 --- a/plugins/sql/build.rs +++ b/plugins/sql/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["load", "execute", "select", "close"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/sql/permissions/schemas/schema.json b/plugins/sql/permissions/schemas/schema.json index 62db780da..3001321e4 100644 --- a/plugins/sql/permissions/schemas/schema.json +++ b/plugins/sql/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/sql/src/plugin.rs b/plugins/sql/src/plugin.rs index f2a952799..59fdf024d 100644 --- a/plugins/sql/src/plugin.rs +++ b/plugins/sql/src/plugin.rs @@ -288,7 +288,6 @@ impl Builder { pub fn build(mut self) -> TauriPlugin> { PluginBuilder::>::new("sql") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![load, execute, select, close]) .setup(|app, api| { let config = api.config().clone().unwrap_or_default(); diff --git a/plugins/store/src/api-iife.js b/plugins/store/api-iife.js similarity index 100% rename from plugins/store/src/api-iife.js rename to plugins/store/api-iife.js diff --git a/plugins/store/build.rs b/plugins/store/build.rs index 140b4a85b..d9bac3bfe 100644 --- a/plugins/store/build.rs +++ b/plugins/store/build.rs @@ -9,6 +9,7 @@ const COMMANDS: &[&str] = &[ fn main() { tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") .build(); diff --git a/plugins/store/permissions/schemas/schema.json b/plugins/store/permissions/schemas/schema.json index de5b1580f..33cd778e6 100644 --- a/plugins/store/permissions/schemas/schema.json +++ b/plugins/store/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/store/src/lib.rs b/plugins/store/src/lib.rs index 2b923fdee..f7c9eb0d3 100644 --- a/plugins/store/src/lib.rs +++ b/plugins/store/src/lib.rs @@ -315,7 +315,6 @@ impl Builder { /// ``` pub fn build(mut self) -> TauriPlugin { plugin::Builder::new("store") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ set, get, has, delete, clear, reset, keys, values, length, entries, load, save ]) diff --git a/plugins/stronghold/src/api-iife.js b/plugins/stronghold/api-iife.js similarity index 100% rename from plugins/stronghold/src/api-iife.js rename to plugins/stronghold/api-iife.js diff --git a/plugins/stronghold/build.rs b/plugins/stronghold/build.rs index 05404a1be..e9550e252 100644 --- a/plugins/stronghold/build.rs +++ b/plugins/stronghold/build.rs @@ -17,5 +17,7 @@ const COMMANDS: &[&str] = &[ ]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/stronghold/permissions/schemas/schema.json b/plugins/stronghold/permissions/schemas/schema.json index 54d7da982..a8d598ad1 100644 --- a/plugins/stronghold/permissions/schemas/schema.json +++ b/plugins/stronghold/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/stronghold/src/lib.rs b/plugins/stronghold/src/lib.rs index 9c09decdc..fe4b91fbc 100644 --- a/plugins/stronghold/src/lib.rs +++ b/plugins/stronghold/src/lib.rs @@ -456,19 +456,17 @@ impl Builder { pub fn build(self) -> TauriPlugin { let password_hash_function = self.password_hash_function; - let plugin_builder = PluginBuilder::new("stronghold") - .js_init_script(include_str!("api-iife.js").to_string()) - .setup(move |app, _api| { - app.manage(StrongholdCollection::default()); - app.manage(PasswordHashFunction(match password_hash_function { - #[cfg(feature = "kdf")] - PasswordHashFunctionKind::Argon2(path) => { - Box::new(move |p| kdf::KeyDerivation::argon2(p, &path)) - } - PasswordHashFunctionKind::Custom(f) => f, - })); - Ok(()) - }); + let plugin_builder = PluginBuilder::new("stronghold").setup(move |app, _api| { + app.manage(StrongholdCollection::default()); + app.manage(PasswordHashFunction(match password_hash_function { + #[cfg(feature = "kdf")] + PasswordHashFunctionKind::Argon2(path) => { + Box::new(move |p| kdf::KeyDerivation::argon2(p, &path)) + } + PasswordHashFunctionKind::Custom(f) => f, + })); + Ok(()) + }); Builder::invoke_stronghold_handlers_and_build(plugin_builder) } diff --git a/plugins/updater/src/api-iife.js b/plugins/updater/api-iife.js similarity index 100% rename from plugins/updater/src/api-iife.js rename to plugins/updater/api-iife.js diff --git a/plugins/updater/build.rs b/plugins/updater/build.rs index 6ba1a7d91..8e3c3859e 100644 --- a/plugins/updater/build.rs +++ b/plugins/updater/build.rs @@ -5,7 +5,9 @@ const COMMANDS: &[&str] = &["check", "download_and_install"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); let mobile = target_os == "ios" || target_os == "android"; diff --git a/plugins/updater/permissions/schemas/schema.json b/plugins/updater/permissions/schemas/schema.json index 6d6a3c211..691359767 100644 --- a/plugins/updater/permissions/schemas/schema.json +++ b/plugins/updater/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/updater/src/lib.rs b/plugins/updater/src/lib.rs index e060827d2..9853c2f45 100644 --- a/plugins/updater/src/lib.rs +++ b/plugins/updater/src/lib.rs @@ -161,7 +161,6 @@ impl Builder { let target = self.target; let installer_args = self.installer_args; PluginBuilder::::new("updater") - .js_init_script(include_str!("api-iife.js").to_string()) .setup(move |app, api| { let mut config = api.config().clone(); if let Some(pubkey) = pubkey { diff --git a/plugins/upload/src/api-iife.js b/plugins/upload/api-iife.js similarity index 100% rename from plugins/upload/src/api-iife.js rename to plugins/upload/api-iife.js diff --git a/plugins/upload/build.rs b/plugins/upload/build.rs index bfdf48b9c..96b5a90a5 100644 --- a/plugins/upload/build.rs +++ b/plugins/upload/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["download", "upload"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/upload/permissions/schemas/schema.json b/plugins/upload/permissions/schemas/schema.json index d7eeb35ff..7d544d353 100644 --- a/plugins/upload/permissions/schemas/schema.json +++ b/plugins/upload/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/upload/src/lib.rs b/plugins/upload/src/lib.rs index 12106d802..bf63d1e1b 100644 --- a/plugins/upload/src/lib.rs +++ b/plugins/upload/src/lib.rs @@ -130,7 +130,6 @@ fn file_to_body(channel: Channel, file: File) -> reqwest::Body { pub fn init() -> TauriPlugin { PluginBuilder::new("upload") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![download, upload]) .build() } diff --git a/plugins/websocket/src/api-iife.js b/plugins/websocket/api-iife.js similarity index 100% rename from plugins/websocket/src/api-iife.js rename to plugins/websocket/api-iife.js diff --git a/plugins/websocket/build.rs b/plugins/websocket/build.rs index b7bf848cb..deadb78f4 100644 --- a/plugins/websocket/build.rs +++ b/plugins/websocket/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["connect", "send"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/websocket/permissions/schemas/schema.json b/plugins/websocket/permissions/schemas/schema.json index 4a773ccb1..35fb7fb7e 100644 --- a/plugins/websocket/permissions/schemas/schema.json +++ b/plugins/websocket/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/websocket/src/lib.rs b/plugins/websocket/src/lib.rs index f4a95b8e1..8697c676c 100644 --- a/plugins/websocket/src/lib.rs +++ b/plugins/websocket/src/lib.rs @@ -200,7 +200,6 @@ async fn send( pub fn init() -> TauriPlugin { PluginBuilder::new("websocket") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![connect, send]) .setup(|app, _api| { app.manage(ConnectionManager::default()); diff --git a/plugins/window-state/src/api-iife.js b/plugins/window-state/api-iife.js similarity index 100% rename from plugins/window-state/src/api-iife.js rename to plugins/window-state/api-iife.js diff --git a/plugins/window-state/build.rs b/plugins/window-state/build.rs index 9d9a160a3..5940f6802 100644 --- a/plugins/window-state/build.rs +++ b/plugins/window-state/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["save_window_state", "restore_window_state"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/window-state/permissions/schemas/schema.json b/plugins/window-state/permissions/schemas/schema.json index 37dcf652d..dfac5b522 100644 --- a/plugins/window-state/permissions/schemas/schema.json +++ b/plugins/window-state/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index 16ad75e58..ed9f10cfe 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -319,7 +319,6 @@ impl Builder { pub fn build(self) -> TauriPlugin { let flags = self.state_flags; PluginBuilder::new("window-state") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ cmd::save_window_state, cmd::restore_state diff --git a/shared/rollup.config.js b/shared/rollup.config.js index c44e7fd11..3b8741c16 100644 --- a/shared/rollup.config.js +++ b/shared/rollup.config.js @@ -73,7 +73,7 @@ export function createConfig(options = {}) { banner: "if ('__TAURI__' in window) {", // the last `}` closes the if in the banner footer: `Object.defineProperty(window.__TAURI__, '${pluginJsName}', { value: ${iifeVarName} }) }`, - file: "src/api-iife.js", + file: "api-iife.js", }, // and var is not guaranteed to assign to the global `window` object so we make sure to assign it plugins: [typescript(), terser(), nodeResolve()], diff --git a/shared/template/build.rs b/shared/template/build.rs index 121f3b740..415deddc4 100644 --- a/shared/template/build.rs +++ b/shared/template/build.rs @@ -6,6 +6,7 @@ const COMMANDS: &[&str] = &["execute"]; fn main() { if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") .run() diff --git a/shared/template/src/lib.rs b/shared/template/src/lib.rs index 3e0f76181..77861b7f0 100644 --- a/shared/template/src/lib.rs +++ b/shared/template/src/lib.rs @@ -39,7 +39,6 @@ impl> crate::{{ plugin_name_pascal_case }}Ext for T /// Initializes the plugin. pub fn init() -> TauriPlugin { Builder::new("{{ plugin_name }}") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![commands::execute]) .setup(|app, api| { #[cfg(mobile)] From 4fa4243d3054a011d77227645c0f7b7c72f2ad08 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Tue, 12 Mar 2024 12:07:20 -0300 Subject: [PATCH 2/3] fmt --- examples/api/src-tauri/src/tray.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/api/src-tauri/src/tray.rs b/examples/api/src-tauri/src/tray.rs index ab9f6af88..bd700fdb3 100644 --- a/examples/api/src-tauri/src/tray.rs +++ b/examples/api/src-tauri/src/tray.rs @@ -80,7 +80,8 @@ pub fn create_tray(app: &tauri::AppHandle) -> tauri::Result<()> { i @ "icon-1" | i @ "icon-2" => { if let Some(tray) = app.tray_by_id("tray-1") { let _ = tray.set_icon(Some(if i == "icon-1" { - tauri::image::Image::from_bytes(include_bytes!("../icons/icon.ico")).unwrap() + tauri::image::Image::from_bytes(include_bytes!("../icons/icon.ico")) + .unwrap() } else { tauri::image::Image::from_bytes(include_bytes!( "../icons/tray_icon_with_transparency.png" From c9c8c33103503ff387424bd96f99adae648a4165 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Mon, 18 Mar 2024 13:08:04 -0300 Subject: [PATCH 3/3] update tauri --- Cargo.lock | 40 ++++++++++++++++++++++++---------------- Cargo.toml | 11 +++-------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f71f243b8..dffa6fb68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6267,8 +6267,9 @@ checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tauri" -version = "2.0.0-beta.11" -source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" +version = "2.0.0-beta.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33d0026c6146b73322833bc8e51fc4ee400a814c4cbfe489e3c2aa92cfedcec" dependencies = [ "anyhow", "bytes", @@ -6317,8 +6318,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.0-beta.9" -source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" +version = "2.0.0-beta.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e851a54f222a49babb6b8b94869307e0bf95be086ed92983c42a56d5ed92132" dependencies = [ "anyhow", "cargo_toml", @@ -6340,8 +6342,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-beta.9" -source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" +version = "2.0.0-beta.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff9b1089989eecc839680cb6b52f6e7ee4733d09fa31861fc4a855996006fe5" dependencies = [ "base64 0.22.0", "brotli", @@ -6366,8 +6369,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-beta.9" -source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" +version = "2.0.0-beta.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b56c7b752b2b70b74299ff5421795e0e287b6748dd7ec8d44ae8e1637216a7" dependencies = [ "heck", "proc-macro2", @@ -6379,8 +6383,9 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.0.0-beta.9" -source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" +version = "2.0.0-beta.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d4ed7ba51ff398831204ed6c8971b9565c91077e3fdef4711fe7b7715b23a" dependencies = [ "anyhow", "glob", @@ -6840,8 +6845,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.0.0-beta.9" -source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" +version = "2.0.0-beta.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ddcf3c08632714e854e38105b39260ec239edd05a77ffcf5f4b3a51f97b119" dependencies = [ "gtk", "http 0.2.11", @@ -6857,8 +6863,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.0.0-beta.9" -source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" +version = "2.0.0-beta.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2694f090a001c55536bbafb45f813229f06e461b3878a5c8280a98e52abb501" dependencies = [ "cocoa 0.25.0", "gtk", @@ -6880,8 +6887,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.0.0-beta.9" -source = "git+https://github.com/tauri-apps/tauri?branch=dev#e227fe02f986e145c0731a64693e1c830a9eb5b0" +version = "2.0.0-beta.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef6a9ec42c3429fac6d46f4af147c765963a6fca18062dd73833032d812231af" dependencies = [ "aes-gcm 0.10.3", "brotli", diff --git a/Cargo.toml b/Cargo.toml index 6ee05eb11..b1db0153e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,9 @@ resolver = "2" [workspace.dependencies] serde = { version = "1", features = ["derive"] } log = "0.4" -tauri = "2.0.0-beta.11" -tauri-build = "2.0.0-beta.9" -tauri-plugin = "2.0.0-beta.9" +tauri = "2.0.0-beta.12" +tauri-build = "2.0.0-beta.10" +tauri-plugin = "2.0.0-beta.10" serde_json = "1" thiserror = "1" url = "2" @@ -31,8 +31,3 @@ codegen-units = 1 lto = true incremental = false opt-level = "s" - -[patch.crates-io] -tauri = { git = "https://github.com/tauri-apps/tauri", branch = "dev" } -tauri-build = { git = "https://github.com/tauri-apps/tauri", branch = "dev" } -tauri-plugin = { git = "https://github.com/tauri-apps/tauri", branch = "dev" } \ No newline at end of file