diff --git a/.changes/pre.json b/.changes/pre.json index 429539b1..73c50026 100644 --- a/.changes/pre.json +++ b/.changes/pre.json @@ -8,8 +8,11 @@ ".changes/dialog-can-create-directories.md", ".changes/dialog-linux-freeze.md", ".changes/dialog-main-thread.md", + ".changes/dialog-path-return-mismatch.md", + ".changes/enhance-fs-scope-type.md", ".changes/enhance-http-scope.md", ".changes/file-autogen-fix.md", + ".changes/fix-autolaunch-macos.md", ".changes/fix-fs-watcher-basedir.md", ".changes/fix-http-scope-url-match.md", ".changes/fix-shutdown-timing.md", @@ -26,8 +29,11 @@ ".changes/public-with-store.md", ".changes/shell-fix-schema-command-property-name.md", ".changes/shell-shellexcute.md", + ".changes/single-instance.macos.md", + ".changes/tauri-beta-14.md", ".changes/tauri-beta-4.md", ".changes/tauri-beta-8.md", - ".changes/tauri-beta-9.md" + ".changes/tauri-beta-9.md", + ".changes/window-state-json.md" ] } diff --git a/.changes/single-instance.macos.md b/.changes/single-instance.macos.md new file mode 100644 index 00000000..7b8b33b4 --- /dev/null +++ b/.changes/single-instance.macos.md @@ -0,0 +1,5 @@ +--- +"single-instance": patch +--- + +Added implementation for MacOS. diff --git a/.changes/tauri-beta-14.md b/.changes/tauri-beta-14.md new file mode 100644 index 00000000..2f52ce32 --- /dev/null +++ b/.changes/tauri-beta-14.md @@ -0,0 +1,5 @@ +--- +"fs": patch +--- + +Update for tauri 2.0.0-beta.14. diff --git a/.changes/window-state-custom-filename.md b/.changes/window-state-custom-filename.md new file mode 100644 index 00000000..c03a0bf0 --- /dev/null +++ b/.changes/window-state-custom-filename.md @@ -0,0 +1,6 @@ +--- +"window-state": "patch" +"window-state-js": "patch" +--- + +Add `Builder::with_filename` to support using a custom filename. Also add `AppHandleExt::file_name` and a similar function in JS, to retrieve it later. diff --git a/.changes/window-state-default-filename.md b/.changes/window-state-default-filename.md new file mode 100644 index 00000000..415a6815 --- /dev/null +++ b/.changes/window-state-default-filename.md @@ -0,0 +1,5 @@ +--- +"window-state": "patch" +--- + +**Breaking change**: Renamed `STATE_FILENAME` const to `DEFAULT_FILENAME`. diff --git a/.changes/window-state-json.md b/.changes/window-state-json.md new file mode 100644 index 00000000..9da7561b --- /dev/null +++ b/.changes/window-state-json.md @@ -0,0 +1,5 @@ +--- +"window-state": patch +--- + +**Breaking change**: Changed the format of the state file from bincode to json. Also changed the filename to from `.window-state` to `.window-state.json`. \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 2f1aeeea..a6cf4d60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,7 +230,7 @@ checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "api" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" dependencies = [ "log", "serde", @@ -300,12 +300,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "as-raw-xcb-connection" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" - [[package]] name = "ascii" version = "1.1.0" @@ -829,20 +823,6 @@ name = "bytemuck" version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", -] [[package]] name = "byteorder" @@ -1698,48 +1678,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "drm" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" -dependencies = [ - "bitflags 2.4.2", - "bytemuck", - "drm-ffi", - "drm-fourcc", - "rustix", -] - -[[package]] -name = "drm-ffi" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" -dependencies = [ - "drm-sys", - "rustix", -] - -[[package]] -name = "drm-fourcc" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" - -[[package]] -name = "drm-sys" -version = "0.6.1" +name = "dpi" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" dependencies = [ - "libc", - "linux-raw-sys 0.6.4", + "serde", ] [[package]] @@ -1827,18 +1771,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" -[[package]] -name = "enum-as-inner" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.52", -] - [[package]] name = "enumflags2" version = "0.7.9" @@ -2684,16 +2616,16 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.12", + "http", "indexmap 2.2.5", "slab", "tokio", @@ -2701,36 +2633,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "h3" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b83e1915177ea624b5bbbdb16bc54f0c106c9664892c695f995e53f5c6793b80" -dependencies = [ - "bytes", - "fastrand", - "futures-util", - "http 0.2.12", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "h3-quinn" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9675014d703c3d516a121757bbc02e53f1ee838e0729fc7534b35024a81ae4" -dependencies = [ - "bytes", - "futures", - "h3", - "quinn", - "quinn-proto", - "tokio", - "tokio-util", -] - [[package]] name = "half" version = "2.4.0" @@ -2826,17 +2728,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi", -] - [[package]] name = "html5ever" version = "0.26.0" @@ -2853,9 +2744,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -2863,24 +2754,25 @@ dependencies = [ ] [[package]] -name = "http" -version = "1.1.0" +name = "http-body" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "fnv", - "itoa 1.0.10", + "http", ] [[package]] -name = "http-body" -version = "0.4.6" +name = "http-body-util" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes", - "http 0.2.12", + "futures-core", + "http", + "http-body", "pin-project-lite", ] @@ -2910,53 +2802,75 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", - "http 0.2.12", + "http", "http-body", "httparse", - "httpdate", "itoa 1.0.10", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", - "http 0.2.12", + "http", "hyper", - "rustls 0.21.10", + "hyper-util", + "rustls 0.22.2", + "rustls-pki-types", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", + "tower-service", ] [[package]] name = "hyper-tls" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", + "http-body-util", "hyper", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -3008,16 +2922,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.5.0" @@ -3168,18 +3072,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ipconfig" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" -dependencies = [ - "socket2", - "widestring", - "windows-sys 0.48.0", - "winreg 0.50.0", -] - [[package]] name = "ipnet" version = "2.9.0" @@ -3510,24 +3402,12 @@ dependencies = [ "safemem", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" -[[package]] -name = "linux-raw-sys" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b5399f6804fbab912acbd8878ed3532d506b7c951b8f9f164ef90fef39e3f4" - [[package]] name = "lock_api" version = "0.4.11" @@ -3562,15 +3442,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "mac" version = "0.1.1" @@ -3619,12 +3490,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - [[package]] name = "matchers" version = "0.1.0" @@ -3656,15 +3521,6 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" -[[package]] -name = "memmap2" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" -dependencies = [ - "libc", -] - [[package]] name = "memoffset" version = "0.6.5" @@ -3753,12 +3609,13 @@ dependencies = [ [[package]] name = "muda" -version = "0.12.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e27c56b8cb9b3214d196556227b0eaa12db8393b4f919a0a93ffb67ed17d185" +checksum = "f428b4e9db3d17e2f809dfb1ff9ddfbbf16c71790d1656d10aee320877e1392f" dependencies = [ "cocoa 0.25.0", "crossbeam-channel", + "dpi", "gtk", "keyboard-types 0.7.0", "objc", @@ -4400,6 +4257,26 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "pin-project-lite" version = "0.2.13" @@ -4680,54 +4557,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "quinn" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" -dependencies = [ - "bytes", - "futures-io", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls 0.21.10", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" -dependencies = [ - "bytes", - "rand 0.8.5", - "ring 0.16.20", - "rustc-hash", - "rustls 0.21.10", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - -[[package]] -name = "quinn-udp" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" -dependencies = [ - "bytes", - "libc", - "socket2", - "tracing", - "windows-sys 0.48.0", -] - [[package]] name = "quote" version = "1.0.35" @@ -4942,27 +4771,26 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.24" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "2d66674f2b6fb864665eea7a3c1ac4e3dfacd2fda83cf6f935a612e01b0e3338" dependencies = [ "async-compression", "base64 0.21.7", "bytes", "cookie", "cookie_store", - "encoding_rs", "futures-channel", "futures-core", "futures-util", "h2", - "h3", - "h3-quinn", - "http 0.2.12", + "http", "http-body", + "http-body-util", "hyper", "hyper-rustls", "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", @@ -4972,41 +4800,29 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "quinn", - "rustls 0.21.10", + "rustls 0.22.2", "rustls-native-certs", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", + "tokio-rustls", "tokio-socks", "tokio-util", "tower-service", - "trust-dns-resolver", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.25.4", + "webpki-roots 0.26.1", "winreg 0.50.0", ] -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", -] - [[package]] name = "rfd" version = "0.14.0" @@ -5031,21 +4847,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -5057,7 +4858,7 @@ dependencies = [ "getrandom 0.2.12", "libc", "spin 0.9.8", - "untrusted 0.9.0", + "untrusted", "windows-sys 0.52.0", ] @@ -5150,12 +4951,6 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc_version" version = "0.4.0" @@ -5174,7 +4969,7 @@ dependencies = [ "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -5184,8 +4979,7 @@ version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ - "log", - "ring 0.17.8", + "ring", "rustls-webpki 0.101.7", "sct", ] @@ -5197,7 +4991,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", - "ring 0.17.8", + "ring", "rustls-pki-types", "rustls-webpki 0.102.2", "subtle", @@ -5206,12 +5000,13 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 2.1.1", + "rustls-pki-types", "schannel", "security-framework", ] @@ -5225,6 +5020,16 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +dependencies = [ + "base64 0.21.7", + "rustls-pki-types", +] + [[package]] name = "rustls-pki-types" version = "1.3.1" @@ -5237,8 +5042,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -5247,9 +5052,9 @@ version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ - "ring 0.17.8", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -5344,8 +5149,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -5641,6 +5446,7 @@ dependencies = [ "serde_json", "tauri", "tauri-build", + "tauri-plugin-cli", "tauri-plugin-single-instance", ] @@ -5681,29 +5487,20 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071916a85d1db274b4ed57af3a14afb66bd836ae7f82ebb6f1fd3455107830d9" dependencies = [ - "as-raw-xcb-connection", "bytemuck", "cfg_aliases 0.2.0", "cocoa 0.25.0", "core-graphics 0.23.1", - "drm", - "fastrand", "foreign-types 0.5.0", "js-sys", "log", - "memmap2", "objc", "raw-window-handle 0.6.0", "redox_syscall", - "rustix", - "tiny-xlib", "wasm-bindgen", - "wayland-backend", - "wayland-client", "wayland-sys", "web-sys", "windows-sys 0.52.0", - "x11rb", ] [[package]] @@ -5810,7 +5607,7 @@ dependencies = [ "paste", "percent-encoding", "rustls 0.21.10", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "sha2 0.10.8", @@ -6166,27 +5963,6 @@ dependencies = [ "libc", ] -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "system-deps" version = "6.2.0" @@ -6202,9 +5978,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.26.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccba570365293ca309d60f30fdac2c5271b732dc762e6154e59c85d2c762a0a1" +checksum = "bd5b6ec2c43abd15155f040c765001098f50f425414b679225d471a1cd782753" dependencies = [ "bitflags 1.3.2", "cocoa 0.25.0", @@ -6213,10 +5989,10 @@ dependencies = [ "crossbeam-channel", "dispatch", "dlopen2", + "dpi", "gdkwayland-sys", "gdkx11-sys", "gtk", - "image", "instant", "jni", "lazy_static", @@ -6228,14 +6004,12 @@ dependencies = [ "objc", "once_cell", "parking_lot", - "png", "raw-window-handle 0.6.0", "scopeguard", "tao-macros", "unicode-segmentation", "url", - "windows 0.52.0", - "windows-implement", + "windows 0.54.0", "windows-version", "x11-dl", ] @@ -6276,9 +6050,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tauri" -version = "2.0.0-beta.12" +version = "2.0.0-beta.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33d0026c6146b73322833bc8e51fc4ee400a814c4cbfe489e3c2aa92cfedcec" +checksum = "a50fb0bdb687486415224f8be47c78993e9f3ea575ee0d5177c90d0c71842f4a" dependencies = [ "anyhow", "bytes", @@ -6290,7 +6064,7 @@ dependencies = [ "glob", "gtk", "heck", - "http 0.2.12", + "http", "http-range", "image", "jni", @@ -6322,14 +6096,14 @@ dependencies = [ "webkit2gtk", "webview2-com", "window-vibrancy", - "windows 0.52.0", + "windows 0.54.0", ] [[package]] name = "tauri-build" -version = "2.0.0-beta.10" +version = "2.0.0-beta.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e851a54f222a49babb6b8b94869307e0bf95be086ed92983c42a56d5ed92132" +checksum = "82a46303cc4bce0b17ad95965cbd8326e3511b9d2cb6fb13a4a4c98a11b0dcaf" dependencies = [ "anyhow", "cargo_toml", @@ -6351,9 +6125,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-beta.10" +version = "2.0.0-beta.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff9b1089989eecc839680cb6b52f6e7ee4733d09fa31861fc4a855996006fe5" +checksum = "f1665f6a986842061a67cb9dcbe2fa27076c1a616f6525fc06de9d6d52838d63" dependencies = [ "base64 0.22.0", "brotli", @@ -6378,9 +6152,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-beta.10" +version = "2.0.0-beta.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b56c7b752b2b70b74299ff5421795e0e287b6748dd7ec8d44ae8e1637216a7" +checksum = "b0c1558fc42cc2a1735cfd5edb2954c735d4516f8ba31c58b7180ba8a2bc18de" dependencies = [ "heck", "proc-macro2", @@ -6392,9 +6166,9 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.0.0-beta.10" +version = "2.0.0-beta.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d4ed7ba51ff398831204ed6c8971b9565c91077e3fdef4711fe7b7715b23a" +checksum = "31ab1ac6122bf2ca5fc4ebb8aadff619f3b172477d2baf8134cf1d7f0e249a12" dependencies = [ "anyhow", "glob", @@ -6412,7 +6186,7 @@ name = "tauri-plugin-authenticator" version = "2.0.0-beta.3" dependencies = [ "authenticator", - "base64 0.21.7", + "base64 0.22.0", "byteorder", "bytes", "chrono", @@ -6431,7 +6205,7 @@ dependencies = [ [[package]] name = "tauri-plugin-autostart" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" dependencies = [ "auto-launch", "log", @@ -6509,7 +6283,7 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" dependencies = [ "glib 0.16.9", "log", @@ -6525,7 +6299,7 @@ dependencies = [ [[package]] name = "tauri-plugin-fs" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" dependencies = [ "anyhow", "glob", @@ -6557,10 +6331,10 @@ dependencies = [ [[package]] name = "tauri-plugin-http" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" dependencies = [ "data-url", - "http 0.2.12", + "http", "regex", "reqwest", "schemars", @@ -6578,7 +6352,7 @@ dependencies = [ name = "tauri-plugin-localhost" version = "2.0.0-beta.3" dependencies = [ - "http 1.1.0", + "http", "log", "serde", "serde_json", @@ -6664,7 +6438,7 @@ dependencies = [ [[package]] name = "tauri-plugin-persisted-scope" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" dependencies = [ "aho-corasick", "bincode", @@ -6717,7 +6491,7 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" -version = "2.0.0-beta.4" +version = "2.0.0-beta.5" dependencies = [ "log", "serde", @@ -6781,14 +6555,13 @@ dependencies = [ name = "tauri-plugin-updater" version = "2.0.0-beta.3" dependencies = [ - "base64 0.21.7", + "base64 0.22.0", "dirs-next", "flate2", "futures-util", - "http 0.2.12", + "http", "minisign-verify", "mockito", - "percent-encoding", "reqwest", "semver", "serde", @@ -6827,7 +6600,7 @@ name = "tauri-plugin-websocket" version = "2.0.0-beta.3" dependencies = [ "futures-util", - "http 1.1.0", + "http", "log", "rand 0.8.5", "serde", @@ -6841,9 +6614,8 @@ dependencies = [ [[package]] name = "tauri-plugin-window-state" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" dependencies = [ - "bincode", "bitflags 2.4.2", "log", "serde", @@ -6855,12 +6627,13 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.0.0-beta.10" +version = "2.0.0-beta.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ddcf3c08632714e854e38105b39260ec239edd05a77ffcf5f4b3a51f97b119" +checksum = "612e05de1382575b32b5220b546861256f630f37ac64c29cab252592861b9bd4" dependencies = [ + "dpi", "gtk", - "http 0.2.12", + "http", "jni", "raw-window-handle 0.6.0", "serde", @@ -6868,18 +6641,18 @@ dependencies = [ "tauri-utils", "thiserror", "url", - "windows 0.52.0", + "windows 0.54.0", ] [[package]] name = "tauri-runtime-wry" -version = "2.0.0-beta.10" +version = "2.0.0-beta.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2694f090a001c55536bbafb45f813229f06e461b3878a5c8280a98e52abb501" +checksum = "2f73672897b5396cb05c2f21b12b66ecfd4b51fae619dd35387467660d6c00fb" dependencies = [ "cocoa 0.25.0", "gtk", - "http 0.2.12", + "http", "jni", "log", "percent-encoding", @@ -6891,15 +6664,15 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows 0.52.0", + "windows 0.54.0", "wry", ] [[package]] name = "tauri-utils" -version = "2.0.0-beta.10" +version = "2.0.0-beta.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6a9ec42c3429fac6d46f4af147c765963a6fca18062dd73833032d812231af" +checksum = "0a148adf8077e1891c8b7d1c2be90c1c8eb8c7a071c35bb8edbdfe7cd9d8e23c" dependencies = [ "aes-gcm 0.10.3", "brotli", @@ -7065,18 +6838,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tiny-xlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4098d49269baa034a8d1eae9bd63e9fa532148d772121dace3bcd6a6c98eb6d" -dependencies = [ - "as-raw-xcb-connection", - "ctor", - "libloading 0.8.3", - "tracing", -] - [[package]] name = "tiny_http" version = "0.11.0" @@ -7145,16 +6906,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.10", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.25.0" @@ -7202,7 +6953,7 @@ dependencies = [ "rustls-pki-types", "tokio", "tokio-native-tls", - "tokio-rustls 0.25.0", + "tokio-rustls", "tungstenite", "webpki-roots 0.26.1", ] @@ -7302,6 +7053,28 @@ dependencies = [ "winnow 0.6.5", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -7372,9 +7145,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.12.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "454035ff34b8430638c894e6197748578d6b4d449c6edaf8ea854d94e2dd862b" +checksum = "da36482ee1dbcedfddb038b3a0f6d27f04d9470dc99dabfa90b8d7cdc8b5f3d6" dependencies = [ "cocoa 0.25.0", "core-graphics 0.23.1", @@ -7399,52 +7172,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand 0.8.5", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot", - "rand 0.8.5", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -7460,7 +7187,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http", "httparse", "log", "native-tls", @@ -7593,12 +7320,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -7838,43 +7559,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wayland-backend" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" -dependencies = [ - "cc", - "downcast-rs", - "rustix", - "scoped-tls", - "smallvec", - "wayland-sys", -] - -[[package]] -name = "wayland-client" -version = "0.31.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" -dependencies = [ - "bitflags 2.4.2", - "rustix", - "wayland-backend", - "wayland-scanner", -] - -[[package]] -name = "wayland-scanner" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" -dependencies = [ - "proc-macro2", - "quick-xml 0.31.0", - "quote", -] - [[package]] name = "wayland-sys" version = "0.31.1" @@ -7883,7 +7567,6 @@ checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ "dlib", "log", - "once_cell", "pkg-config", ] @@ -7972,14 +7655,14 @@ dependencies = [ [[package]] name = "webview2-com" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ae9c7e420783826cf769d2c06ac9ba462f450eca5893bb8c6c6529a4e5dd33" +checksum = "38d5949fc3f537e90240c3e4f78dda2fa0431b671d50845a2f582173ef8a1201" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.52.0", - "windows-core 0.52.0", + "windows 0.54.0", + "windows-core 0.54.0", "windows-implement", "windows-interface", ] @@ -7997,13 +7680,13 @@ dependencies = [ [[package]] name = "webview2-com-sys" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ad85fceee6c42fa3d61239eba5a11401bf38407a849ed5ea1b407df08cca72" +checksum = "cd1eaa1be63d6fdcadf893c40d7d53c889a6342b3a94930d34e6964d5bb7e8db" dependencies = [ "thiserror", - "windows 0.52.0", - "windows-core 0.52.0", + "windows 0.54.0", + "windows-core 0.54.0", ] [[package]] @@ -8022,12 +7705,6 @@ dependencies = [ "wasite", ] -[[package]] -name = "widestring" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" - [[package]] name = "win7-notifications" version = "0.3.1" @@ -8128,11 +7805,11 @@ dependencies = [ [[package]] name = "windows" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core 0.52.0", + "windows-core 0.54.0", "windows-implement", "windows-interface", "windows-targets 0.52.4", @@ -8156,11 +7833,21 @@ dependencies = [ "windows-targets 0.52.4", ] +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.4", +] + [[package]] name = "windows-implement" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12168c33176773b86799be25e2a2ba07c7aab9968b37541f1094dbd7a60c8946" +checksum = "942ac266be9249c84ca862f0a164a39533dc2f6f33dc98ec89c8da99b82ea0bd" dependencies = [ "proc-macro2", "quote", @@ -8169,15 +7856,24 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8dc32e0095a7eeccebd0e3f09e9509365ecb3fc6ac4d6f5f14a3f6392942d1" +checksum = "da33557140a288fae4e1d5f8873aaf9eb6613a9cf82c3e070223ff177f598b60" dependencies = [ "proc-macro2", "quote", "syn 2.0.52", ] +[[package]] +name = "windows-result" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +dependencies = [ + "windows-targets 0.52.4", +] + [[package]] name = "windows-sys" version = "0.36.1" @@ -8477,9 +8173,9 @@ dependencies = [ [[package]] name = "wry" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b717040ba9771fd88eb428c6ea6b555f8e734ff8534f02c13e8f10d97f5935e" +checksum = "4eca9d50437c04fc67e82c196ddd31d8e35794150713ae2d647f3a58c7f45d1a" dependencies = [ "base64 0.21.7", "block", @@ -8487,16 +8183,16 @@ dependencies = [ "cocoa 0.25.0", "core-graphics 0.23.1", "crossbeam-channel", + "dpi", "dunce", "gdkx11", "gtk", "html5ever", - "http 0.2.12", + "http", "javascriptcore-rs", "jni", "kuchikiki", "libc", - "log", "ndk", "ndk-context", "ndk-sys", @@ -8505,8 +8201,6 @@ dependencies = [ "once_cell", "percent-encoding", "raw-window-handle 0.6.0", - "serde", - "serde_json", "sha2 0.10.8", "soup3", "tao-macros", @@ -8514,8 +8208,7 @@ dependencies = [ "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.52.0", - "windows-implement", + "windows 0.54.0", "windows-version", "x11-dl", ] @@ -8556,11 +8249,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" dependencies = [ - "as-raw-xcb-connection", "gethostname", - "libc", - "libloading 0.8.3", - "once_cell", "rustix", "x11rb-protocol", ] @@ -8589,7 +8278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "rustix", ] diff --git a/Cargo.toml b/Cargo.toml index b1db0153..56d6a375 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.12" -tauri-build = "2.0.0-beta.10" -tauri-plugin = "2.0.0-beta.10" +tauri = "2.0.0-beta.14" +tauri-build = "2.0.0-beta.11" +tauri-plugin = "2.0.0-beta.11" serde_json = "1" thiserror = "1" url = "2" @@ -23,6 +23,7 @@ edition = "2021" authors = ["Tauri Programme within The Commons Conservancy"] license = "Apache-2.0 OR MIT" rust-version = "1.75" +repository = "https://github.com/tauri-apps/plugins-workspace" # default to small, optimized release binaries [profile.release] diff --git a/examples/api/src-tauri/CHANGELOG.md b/examples/api/src-tauri/CHANGELOG.md index 20622335..5f6e98ec 100644 --- a/examples/api/src-tauri/CHANGELOG.md +++ b/examples/api/src-tauri/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## \[2.0.0-beta.4] + +### Dependencies + +- Upgraded to `dialog@2.0.0-beta.4` +- Upgraded to `fs@2.0.0-beta.4` +- Upgraded to `http@2.0.0-beta.4` + ## \[2.0.0-beta.3] ### Dependencies diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index a0abc758..c06ea11f 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "api" publish = false -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" description = "An example Tauri Application showcasing the api" edition = "2021" rust-version = { workspace = true } @@ -20,10 +20,10 @@ serde = { workspace = true } tiny_http = "0.11" log = { workspace = true } tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.3" } -tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.3", features = [ "watch" ] } +tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.4", features = [ "watch" ] } tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.1.0-beta.0" } -tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.3" } -tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.3" } +tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.4" } +tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.4" } tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.3", features = [ "windows7-compat" ] } tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.3" } tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.3" } diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index 117afa22..2891fa1d 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -36,7 +36,7 @@ }); } - getCurrentWebview().onFileDropEvent((event) => { + getCurrentWebview().onDragDropEvent((event) => { onMessage(`File drop: ${JSON.stringify(event.payload)}`); }); diff --git a/package.json b/package.json index 90d7d6de..de07cb1d 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "eslint-plugin-security": "2.1.0", "prettier": "3.2.2", "rollup": "4.9.6", + "tslib": "2.6.2", "typescript": "5.3.3" }, "resolutions": { diff --git a/plugins/authenticator/Cargo.toml b/plugins/authenticator/Cargo.toml index 8ce3ae08..37531f58 100644 --- a/plugins/authenticator/Cargo.toml +++ b/plugins/authenticator/Cargo.toml @@ -6,14 +6,15 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-authenticator" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -26,7 +27,7 @@ thiserror = { workspace = true } authenticator = "0.3.1" once_cell = "1" sha2 = "0.10" -base64 = "0.21" +base64 = "0.22" chrono = "0.4" bytes = "1" byteorder = "1" diff --git a/plugins/autostart/CHANGELOG.md b/plugins/autostart/CHANGELOG.md index 5b48ed78..9a7b9888 100644 --- a/plugins/autostart/CHANGELOG.md +++ b/plugins/autostart/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.0.0-beta.4] + +- [`a233919`](https://github.com/tauri-apps/plugins-workspace/commit/a2339195aa940bff86d76375fd05087595bf06ce)([#1118](https://github.com/tauri-apps/plugins-workspace/pull/1118)) Fix LaunchAgent-based autostart for macOS. + ## \[2.0.0-beta.3] - [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true. diff --git a/plugins/autostart/Cargo.toml b/plugins/autostart/Cargo.toml index d8d8c3bb..f83ed189 100644 --- a/plugins/autostart/Cargo.toml +++ b/plugins/autostart/Cargo.toml @@ -1,19 +1,20 @@ [package] name = "tauri-plugin-autostart" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" description = "Automatically launch your application at startup." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-autostart" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/barcode-scanner/Cargo.toml b/plugins/barcode-scanner/Cargo.toml index e3c0f881..b4fe6438 100644 --- a/plugins/barcode-scanner/Cargo.toml +++ b/plugins/barcode-scanner/Cargo.toml @@ -6,15 +6,16 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-barcode-scanner" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-linux-android"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/biometric/Cargo.toml b/plugins/biometric/Cargo.toml index bbf37021..c1519f29 100644 --- a/plugins/biometric/Cargo.toml +++ b/plugins/biometric/Cargo.toml @@ -5,14 +5,15 @@ description = "Prompt the user for biometric authentication on Android and iOS." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-biometric" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/biometric/package.json b/plugins/biometric/package.json index 9bcf246d..d9ebd7ec 100644 --- a/plugins/biometric/package.json +++ b/plugins/biometric/package.json @@ -23,9 +23,6 @@ "README.md", "LICENSE" ], - "devDependencies": { - "tslib": "2.6.0" - }, "dependencies": { "@tauri-apps/api": "2.0.0-beta.6" } diff --git a/plugins/cli/Cargo.toml b/plugins/cli/Cargo.toml index a2ef0621..43d23b86 100644 --- a/plugins/cli/Cargo.toml +++ b/plugins/cli/Cargo.toml @@ -6,14 +6,15 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-cli" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,4 +22,4 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -clap = { version = "4", features = [ "string" ] } +clap = { version = "4", features = ["string"] } diff --git a/plugins/clipboard-manager/Cargo.toml b/plugins/clipboard-manager/Cargo.toml index f67628c7..68add942 100644 --- a/plugins/clipboard-manager/Cargo.toml +++ b/plugins/clipboard-manager/Cargo.toml @@ -6,15 +6,16 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-clipboard-manager" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-unknown-linux-gnu", "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/deep-link/Cargo.toml b/plugins/deep-link/Cargo.toml index b16ffeb5..85955cdc 100644 --- a/plugins/deep-link/Cargo.toml +++ b/plugins/deep-link/Cargo.toml @@ -6,17 +6,18 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-deep-link" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-linux-android"] [build-dependencies] serde = { workspace = true } serde_json = { workspace = true } -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/dialog/CHANGELOG.md b/plugins/dialog/CHANGELOG.md index 6adc90da..aac54e10 100644 --- a/plugins/dialog/CHANGELOG.md +++ b/plugins/dialog/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## \[2.0.0-beta.4] + +- [`4cd8112`](https://github.com/tauri-apps/plugins-workspace/commit/4cd81126fdf25e1847546f8fdbd924aa4bfeabb5)([#1056](https://github.com/tauri-apps/plugins-workspace/pull/1056)) Fixed an issue where dialogs on android would return the Content URI instead of the file path + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.4` + ## \[2.0.0-beta.3] - [`35ea595`](https://github.com/tauri-apps/plugins-workspace/commit/35ea5956d060f0bdafd140f2541c607bb811805b)([#1073](https://github.com/tauri-apps/plugins-workspace/pull/1073)) Fixed an issue where the dialog apis panicked when they were called with no application windows open. diff --git a/plugins/dialog/Cargo.toml b/plugins/dialog/Cargo.toml index ced0d9b9..98527005 100644 --- a/plugins/dialog/Cargo.toml +++ b/plugins/dialog/Cargo.toml @@ -1,20 +1,21 @@ [package] name = "tauri-plugin-dialog" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-dialog" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-unknown-linux-gnu", "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -22,11 +23,15 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.3" } +tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.4" } [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] glib = "0.16" [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -rfd = { version = "0.14", default-features = false, features = [ "tokio", "gtk3", "common-controls-v6" ] } +rfd = { version = "0.14", default-features = false, features = [ + "tokio", + "gtk3", + "common-controls-v6", +] } raw-window-handle = "0.6" diff --git a/plugins/fs/CHANGELOG.md b/plugins/fs/CHANGELOG.md index ec480d11..4aeb8a3b 100644 --- a/plugins/fs/CHANGELOG.md +++ b/plugins/fs/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## \[2.0.0-beta.4] + +- [`9c2fb93`](https://github.com/tauri-apps/plugins-workspace/commit/9c2fb9306ecd3936a2aef56b3c012899036db098) Enhance the scope type to also allow a plain string representing the path to allow or deny. +- [`772f2bc`](https://github.com/tauri-apps/plugins-workspace/commit/772f2bc3495a4f83f1c3e538cbac6d29cbd7d5ef)([#1136](https://github.com/tauri-apps/plugins-workspace/pull/1136)) Update for tauri 2.0.0-beta.14. + ## \[2.0.0-beta.3] - [`cb96aa0`](https://github.com/tauri-apps/plugins-workspace/commit/cb96aa06277f7b864952827ec9fb1e74c8a1f761)([#1082](https://github.com/tauri-apps/plugins-workspace/pull/1082)) Fixes `watch` and `watchImmediate` which previously ignored the `baseDir` parameter. diff --git a/plugins/fs/Cargo.toml b/plugins/fs/Cargo.toml index e888482e..8bcdcf86 100644 --- a/plugins/fs/Cargo.toml +++ b/plugins/fs/Cargo.toml @@ -1,19 +1,20 @@ [package] name = "tauri-plugin-fs" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" description = "Access the file system." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-fs" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } schemars = { workspace = true } serde = { workspace = true } @@ -25,10 +26,10 @@ tauri = { workspace = true } thiserror = { workspace = true } url = { workspace = true } anyhow = "1" -uuid = { version = "1", features = [ "v4" ] } +uuid = { version = "1", features = ["v4"] } glob = "0.3" -notify = { version = "6", optional = true, features = [ "serde" ] } +notify = { version = "6", optional = true, features = ["serde"] } notify-debouncer-full = { version = "0.3", optional = true } [features] -watch = [ "notify", "notify-debouncer-full" ] +watch = ["notify", "notify-debouncer-full"] diff --git a/plugins/fs/src/lib.rs b/plugins/fs/src/lib.rs index b563c787..20419368 100644 --- a/plugins/fs/src/lib.rs +++ b/plugins/fs/src/lib.rs @@ -15,7 +15,7 @@ use tauri::{ ipc::ScopeObject, plugin::{Builder as PluginBuilder, TauriPlugin}, utils::acl::Value, - AppHandle, FileDropEvent, Manager, RunEvent, Runtime, WindowEvent, + AppHandle, DragDropEvent, Manager, RunEvent, Runtime, WindowEvent, }; mod commands; @@ -110,7 +110,7 @@ pub fn init() -> TauriPlugin> { .on_event(|app, event| { if let RunEvent::WindowEvent { label: _, - event: WindowEvent::FileDrop(FileDropEvent::Dropped { paths, position: _ }), + event: WindowEvent::DragDrop(DragDropEvent::Dropped { paths, position: _ }), .. } = event { diff --git a/plugins/global-shortcut/Cargo.toml b/plugins/global-shortcut/Cargo.toml index 682edac6..df757225 100644 --- a/plugins/global-shortcut/Cargo.toml +++ b/plugins/global-shortcut/Cargo.toml @@ -6,14 +6,15 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-global-shortcut" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/http/CHANGELOG.md b/plugins/http/CHANGELOG.md index 5efb6d00..3e4dc268 100644 --- a/plugins/http/CHANGELOG.md +++ b/plugins/http/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.0.0-beta.4] + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.4` + ## \[2.0.0-beta.3] - [`c873e4d`](https://github.com/tauri-apps/plugins-workspace/commit/c873e4d6c74e759742f7c9a88e35cff10a75122a)([#1059](https://github.com/tauri-apps/plugins-workspace/pull/1059)) Fixes scope not allowing subpaths, query parameters and hash when those values are empty. diff --git a/plugins/http/Cargo.toml b/plugins/http/Cargo.toml index 35a5d323..ee30b771 100644 --- a/plugins/http/Cargo.toml +++ b/plugins/http/Cargo.toml @@ -1,19 +1,20 @@ [package] name = "tauri-plugin-http" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" description = "Access an HTTP client written in Rust." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-http" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } schemars = { workspace = true } serde = { workspace = true } url = { workspace = true } @@ -25,32 +26,32 @@ serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } thiserror = { workspace = true } -tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.3" } +tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.4" } urlpattern = "0.2" regex = "1" -http = "0.2" -reqwest = { version = "0.11", default-features = false } +http = "1" +reqwest = { version = "0.12", default-features = false } url = { workspace = true } data-url = "0.3" [features] -multipart = [ "reqwest/multipart" ] -json = [ "reqwest/json" ] -stream = [ "reqwest/stream" ] -native-tls = [ "reqwest/native-tls" ] -native-tls-vendored = [ "reqwest/native-tls-vendored" ] -rustls-tls = [ "reqwest/rustls-tls" ] -default-tls = [ "reqwest/default-tls" ] -native-tls-alpn = [ "reqwest/native-tls-alpn" ] -rustls-tls-manual-roots = [ "reqwest/rustls-tls-manual-roots" ] -rustls-tls-webpki-roots = [ "reqwest/rustls-tls-webpki-roots" ] -rustls-tls-native-roots = [ "reqwest/rustls-tls-native-roots" ] -blocking = [ "reqwest/blocking" ] -cookies = [ "reqwest/cookies" ] -gzip = [ "reqwest/gzip" ] -brotli = [ "reqwest/brotli" ] -deflate = [ "reqwest/deflate" ] -trust-dns = [ "reqwest/trust-dns" ] -socks = [ "reqwest/socks" ] -http3 = [ "reqwest/http3" ] -unsafe-headers = [ ] +multipart = ["reqwest/multipart"] +json = ["reqwest/json"] +stream = ["reqwest/stream"] +native-tls = ["reqwest/native-tls"] +native-tls-vendored = ["reqwest/native-tls-vendored"] +rustls-tls = ["reqwest/rustls-tls"] +default-tls = ["reqwest/default-tls"] +native-tls-alpn = ["reqwest/native-tls-alpn"] +rustls-tls-manual-roots = ["reqwest/rustls-tls-manual-roots"] +rustls-tls-webpki-roots = ["reqwest/rustls-tls-webpki-roots"] +rustls-tls-native-roots = ["reqwest/rustls-tls-native-roots"] +blocking = ["reqwest/blocking"] +cookies = ["reqwest/cookies"] +gzip = ["reqwest/gzip"] +brotli = ["reqwest/brotli"] +deflate = ["reqwest/deflate"] +trust-dns = ["reqwest/trust-dns"] +socks = ["reqwest/socks"] +http2 = ["reqwest/http2"] +unsafe-headers = [] diff --git a/plugins/localhost/Cargo.toml b/plugins/localhost/Cargo.toml index 0b6181d9..6d16b072 100644 --- a/plugins/localhost/Cargo.toml +++ b/plugins/localhost/Cargo.toml @@ -6,6 +6,7 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } [package.metadata.docs.rs] rustc-args = [ "--cfg", "docsrs" ] diff --git a/plugins/log/Cargo.toml b/plugins/log/Cargo.toml index a7547809..27544993 100644 --- a/plugins/log/Cargo.toml +++ b/plugins/log/Cargo.toml @@ -6,14 +6,15 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-log" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,8 +22,8 @@ serde_json = { workspace = true } tauri = { workspace = true } serde_repr = "0.1" byte-unit = "5" -log = { workspace = true, features = [ "kv_unstable" ] } -time = { version = "0.3", features = [ "formatting", "local-offset" ] } +log = { workspace = true, features = ["kv_unstable"] } +time = { version = "0.3", features = ["formatting", "local-offset"] } fern = "0.6" [target."cfg(target_os = \"android\")".dependencies] @@ -34,4 +35,4 @@ objc = "0.2" cocoa = "0.24" [features] -colored = [ "fern/colored" ] +colored = ["fern/colored"] diff --git a/plugins/nfc/Cargo.toml b/plugins/nfc/Cargo.toml index f4402f7f..fcb210d7 100644 --- a/plugins/nfc/Cargo.toml +++ b/plugins/nfc/Cargo.toml @@ -5,14 +5,15 @@ description = "Read and write NFC tags on Android and iOS." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-nfc" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/nfc/package.json b/plugins/nfc/package.json index b6704607..06aafe8b 100644 --- a/plugins/nfc/package.json +++ b/plugins/nfc/package.json @@ -23,9 +23,6 @@ "README.md", "LICENSE" ], - "devDependencies": { - "tslib": "2.6.0" - }, "dependencies": { "@tauri-apps/api": "2.0.0-beta.6" } diff --git a/plugins/notification/Cargo.toml b/plugins/notification/Cargo.toml index 6ce5088b..ef75c6af 100644 --- a/plugins/notification/Cargo.toml +++ b/plugins/notification/Cargo.toml @@ -6,15 +6,16 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-notification" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-unknown-linux-gnu", "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -23,8 +24,8 @@ tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } rand = "0.8" -time = { version = "0.3", features = [ "serde", "parsing", "formatting" ] } -url = { version = "2", features = [ "serde" ] } +time = { version = "0.3", features = ["serde", "parsing", "formatting"] } +url = { version = "2", features = ["serde"] } serde_repr = "0.1" [target."cfg(windows)".dependencies] @@ -50,6 +51,6 @@ ctor = "0.2" maplit = "1.0" [features] -default = [ "zbus", "async" ] -async = [ ] -windows7-compat = [ "win7-notifications", "windows-version" ] +default = ["zbus", "async"] +async = [] +windows7-compat = ["win7-notifications", "windows-version"] diff --git a/plugins/os/Cargo.toml b/plugins/os/Cargo.toml index 4fe87c58..0fe1726a 100644 --- a/plugins/os/Cargo.toml +++ b/plugins/os/Cargo.toml @@ -6,14 +6,15 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-os" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/persisted-scope/CHANGELOG.md b/plugins/persisted-scope/CHANGELOG.md index 4ce437de..749a366e 100644 --- a/plugins/persisted-scope/CHANGELOG.md +++ b/plugins/persisted-scope/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.0.0-beta.4] + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.4` + ## \[2.0.0-beta.3] - [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true. diff --git a/plugins/persisted-scope/Cargo.toml b/plugins/persisted-scope/Cargo.toml index 8a73de99..7361d3a6 100644 --- a/plugins/persisted-scope/Cargo.toml +++ b/plugins/persisted-scope/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "tauri-plugin-persisted-scope" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" description = "Save filesystem and asset scopes and restore them when the app is reopened." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } [package.metadata.docs.rs] rustc-args = [ "--cfg", "docsrs" ] @@ -19,7 +20,7 @@ log = { workspace = true } thiserror = { workspace = true } aho-corasick = "1" bincode = "1" -tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.3" } +tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.4" } [features] protocol-asset = [ "tauri/protocol-asset" ] diff --git a/plugins/positioner/Cargo.toml b/plugins/positioner/Cargo.toml index 4d11df97..4e98fc81 100644 --- a/plugins/positioner/Cargo.toml +++ b/plugins/positioner/Cargo.toml @@ -6,14 +6,15 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-positioner" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -24,4 +25,4 @@ thiserror = { workspace = true } serde_repr = "0.1" [features] -tray-icon = [ "tauri/tray-icon" ] +tray-icon = ["tauri/tray-icon"] diff --git a/plugins/process/Cargo.toml b/plugins/process/Cargo.toml index 4410a64c..316d2f45 100644 --- a/plugins/process/Cargo.toml +++ b/plugins/process/Cargo.toml @@ -6,14 +6,15 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-process" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] tauri = { workspace = true } diff --git a/plugins/shell/Cargo.toml b/plugins/shell/Cargo.toml index 1428fed3..de34e23f 100644 --- a/plugins/shell/Cargo.toml +++ b/plugins/shell/Cargo.toml @@ -6,14 +6,15 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-shell" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } schemars = { workspace = true } serde = { workspace = true } @@ -26,6 +27,6 @@ log = { workspace = true } thiserror = { workspace = true } shared_child = "1" regex = "1" -open = { version = "5", features = [ "shellexecute-on-windows" ] } +open = { version = "5", features = ["shellexecute-on-windows"] } encoding_rs = "0.8" os_pipe = "1" diff --git a/plugins/single-instance/CHANGELOG.md b/plugins/single-instance/CHANGELOG.md index 81ab579c..93ec13b0 100644 --- a/plugins/single-instance/CHANGELOG.md +++ b/plugins/single-instance/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.0.0-beta.5] + +- [`dabac0e`](https://github.com/tauri-apps/plugins-workspace/commit/dabac0eedfd6e6d192c6c5a214e708b3c0223f6f)([#1035](https://github.com/tauri-apps/plugins-workspace/pull/1035)) Added implementation for MacOS. + ## \[2.0.0-beta.4] - [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true. diff --git a/plugins/single-instance/Cargo.toml b/plugins/single-instance/Cargo.toml index c5e9fb21..3abbeaf0 100644 --- a/plugins/single-instance/Cargo.toml +++ b/plugins/single-instance/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "tauri-plugin-single-instance" -version = "2.0.0-beta.4" +version = "2.0.0-beta.5" description = "Ensure a single instance of your tauri app is running." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } exclude = [ "/examples" ] [package.metadata.docs.rs] diff --git a/plugins/single-instance/examples/vanilla/package-lock.json b/plugins/single-instance/examples/vanilla/package-lock.json new file mode 100644 index 00000000..14980fb0 --- /dev/null +++ b/plugins/single-instance/examples/vanilla/package-lock.json @@ -0,0 +1,204 @@ +{ + "name": "app", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "app", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@tauri-apps/cli": "2.0.0-beta.3" + } + }, + "node_modules/@tauri-apps/cli": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.0.0-beta.3.tgz", + "integrity": "sha512-xLAL2DNNUJWqHBKvanc3V9bG9kkwtFwc40X/DrfgEKnkajEm79wqnkaT8LUnmbe0WZ8bzBRO1fLIgKlOH6GiCA==", + "dev": true, + "bin": { + "tauri": "tauri.js" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + }, + "optionalDependencies": { + "@tauri-apps/cli-darwin-arm64": "2.0.0-beta.3", + "@tauri-apps/cli-darwin-x64": "2.0.0-beta.3", + "@tauri-apps/cli-linux-arm-gnueabihf": "2.0.0-beta.3", + "@tauri-apps/cli-linux-arm64-gnu": "2.0.0-beta.3", + "@tauri-apps/cli-linux-arm64-musl": "2.0.0-beta.3", + "@tauri-apps/cli-linux-x64-gnu": "2.0.0-beta.3", + "@tauri-apps/cli-linux-x64-musl": "2.0.0-beta.3", + "@tauri-apps/cli-win32-arm64-msvc": "2.0.0-beta.3", + "@tauri-apps/cli-win32-ia32-msvc": "2.0.0-beta.3", + "@tauri-apps/cli-win32-x64-msvc": "2.0.0-beta.3" + } + }, + "node_modules/@tauri-apps/cli-darwin-arm64": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.0.0-beta.3.tgz", + "integrity": "sha512-gHcn3jI/4MDXDIlK/4Zz0ftTosgN3OimWlKxEz777QrA1hldrQweYIhdZXkqE9KgoE+u6w80vWIcr0InHAf7Iw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-darwin-x64": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.0.0-beta.3.tgz", + "integrity": "sha512-kRCaukT2IAGMmNuAOUBhdZRlKujTy2lSsdNKmgGEMnzQLKJwWO9Gpq1NmPY7ZVqyXK/X8QnGHuasDEQsSO6B4w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.0.0-beta.3.tgz", + "integrity": "sha512-cpNZOQDotNSdjoZT16s1JtZvnkM0wgLwU39AhKhRCco4KEH3/8G1ngKF9JKalWUN8zDTcuCigEAr37gEv4mLAA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-gnu": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.0.0-beta.3.tgz", + "integrity": "sha512-8q86V6P9bkeoFcnvSsnvOwmKY6ijIN4ueRVXCj5cVpsw392VF9vud1Nq7/l+QDgn9OWbZNNVDl30iyoSuaykBA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-musl": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.0.0-beta.3.tgz", + "integrity": "sha512-L7fokh4aqyV6yDPoeKwFN3Yt0pCAuZMWeP5tOeSBiom1pU7ppKH+4KHeTekNEIecZG+Ah250DkVCdmWS+aRFTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-gnu": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.0.0-beta.3.tgz", + "integrity": "sha512-/crp3K6PathqicVWPj8Kh1120NNVV7nagJ7oZW9OFch7nBS1tmDnSB5k5LgA4yYu+lDKNUREnATMWHL6i0gNeg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-musl": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.0.0-beta.3.tgz", + "integrity": "sha512-jX1ZT0UQwdBGbpCwlpv2bsLDO7KFMeDJQ/ZZVMfWyjuYrGBG5zhJ2NXwTMkHVnxfvE6BVmnybWcykeSqTATeOw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-arm64-msvc": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.0.0-beta.3.tgz", + "integrity": "sha512-UCEZNKocENLX3HYKid4FEbrCMjCX9e58klBIvJKxT8HTjvpgFYDoKccswDNfszLhmineKMlkUvm7j7U0sMh8MQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-ia32-msvc": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.0.0-beta.3.tgz", + "integrity": "sha512-O8syGXDHyKN/cv1ktD76dTcbkQ1nNEPhnT1Z+r0GKxNsw4/MyIVglzEcou3aPq0/1MQ0PEGVyG1x0JMaPw7oHQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-x64-msvc": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.0.0-beta.3.tgz", + "integrity": "sha512-YDdF3XWaptjKtKz33sZhC+uNAZwp6QtAmZSRCQQlC1W7uJwLD00/3QF4vO/c6Qm+BGFsazVh1+YmBF1p0kV0rg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + } + } +} diff --git a/plugins/single-instance/examples/vanilla/package.json b/plugins/single-instance/examples/vanilla/package.json index c44bd9c7..1b7ea034 100644 --- a/plugins/single-instance/examples/vanilla/package.json +++ b/plugins/single-instance/examples/vanilla/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "tauri": "tauri" }, "author": "", "license": "MIT", diff --git a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml index badede36..ae789acd 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml +++ b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml @@ -12,6 +12,7 @@ serde_json = { workspace = true } serde = { workspace = true } tauri = { workspace = true } tauri-plugin-single-instance = { path = "../../../" } +tauri-plugin-cli = { path = "../../../../cli" } [build-dependencies] tauri-build = { workspace = true } diff --git a/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs b/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs index 0b93460d..49b1a5a6 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs +++ b/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs @@ -9,6 +9,7 @@ fn main() { tauri::Builder::default() + .plugin(tauri_plugin_cli::init()) .plugin(tauri_plugin_single_instance::init(|app, argv, cwd| { println!("{}, {argv:?}, {cwd}", app.package_info().name); })) diff --git a/plugins/single-instance/examples/vanilla/src-tauri/tauri.conf.json b/plugins/single-instance/examples/vanilla/src-tauri/tauri.conf.json index 8f9a852d..41623cc5 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/tauri.conf.json +++ b/plugins/single-instance/examples/vanilla/src-tauri/tauri.conf.json @@ -29,5 +29,17 @@ "icons/icon.icns", "icons/icon.ico" ] + }, + "plugins": { + "cli": { + "description": "Testing single-instance on MacOS", + "args": [ + { + "name": "somearg", + "index": 1, + "takesValue": true + } + ] + } } } diff --git a/plugins/single-instance/src/platform_impl/macos.rs b/plugins/single-instance/src/platform_impl/macos.rs index 170ff0e0..680eca09 100644 --- a/plugins/single-instance/src/platform_impl/macos.rs +++ b/plugins/single-instance/src/platform_impl/macos.rs @@ -4,13 +4,119 @@ #![cfg(target_os = "macos")] +use std::{ + io::{BufWriter, Error, ErrorKind, Read, Write}, + os::unix::net::{UnixListener, UnixStream}, + path::PathBuf, +}; + use crate::SingleInstanceCallback; use tauri::{ plugin::{self, TauriPlugin}, - Manager, Runtime, + AppHandle, Config, Manager, RunEvent, Runtime, }; -pub fn init(_f: Box>) -> TauriPlugin { - plugin::Builder::new("single-instance").build() + +pub fn init(cb: Box>) -> TauriPlugin { + plugin::Builder::new("single-instance") + .setup(|app, _api| { + let socket = socket_path(app.config()); + + // Notify the singleton which may or may not exist. + match notify_singleton(&socket) { + Ok(_) => { + std::process::exit(0); + } + Err(e) => { + match e.kind() { + ErrorKind::NotFound | ErrorKind::ConnectionRefused => { + // This process claims itself as singleton as likely none exists + socket_cleanup(&socket); + listen_for_other_instances(&socket, app.clone(), cb); + } + _ => { + log::debug!( + "single_instance failed to notify - launching normally: {}", + e + ); + } + } + } + } + Ok(()) + }) + .on_event(|app, event| { + if let RunEvent::Exit = event { + destroy(app); + } + }) + .build() +} + +pub fn destroy>(manager: &M) { + let socket = socket_path(manager.config()); + socket_cleanup(&socket); +} + +fn socket_path(config: &Config) -> PathBuf { + let identifier = config.identifier.replace(['.', '-'].as_ref(), "_"); + // Use /tmp as socket path must be shorter than 100 chars. + PathBuf::from(format!("/tmp/{}_si.sock", identifier)) +} + +fn socket_cleanup(socket: &PathBuf) { + let _ = std::fs::remove_file(socket); } -pub fn destroy>(_manager: &M) {} +fn notify_singleton(socket: &PathBuf) -> Result<(), Error> { + let stream = UnixStream::connect(&socket)?; + let mut bf = BufWriter::new(&stream); + let args_joined = std::env::args().collect::>().join("\0"); + bf.write_all(args_joined.as_bytes())?; + bf.flush()?; + drop(bf); + Ok(()) +} + +fn listen_for_other_instances( + socket: &PathBuf, + app: AppHandle, + mut cb: Box>, +) { + match UnixListener::bind(&socket) { + Ok(listener) => { + let cwd = std::env::current_dir() + .unwrap_or_default() + .to_str() + .unwrap_or_default() + .to_string(); + + tauri::async_runtime::spawn(async move { + for stream in listener.incoming() { + match stream { + Ok(mut stream) => { + let mut s = String::new(); + match stream.read_to_string(&mut s) { + Ok(_) => { + let args: Vec = + s.split('\0').map(String::from).collect(); + cb(&app.clone().app_handle(), args, cwd.clone()); + } + Err(e) => log::debug!("single_instance failed to be notified: {e}"), + } + } + Err(err) => { + log::debug!("single_instance failed to be notified: {}", err); + continue; + } + } + } + }); + } + Err(err) => { + log::error!( + "single_instance failed to listen to other processes - launching normally: {}", + err + ); + } + } +} diff --git a/plugins/sql/Cargo.toml b/plugins/sql/Cargo.toml index c0376c8d..4f59bc80 100644 --- a/plugins/sql/Cargo.toml +++ b/plugins/sql/Cargo.toml @@ -6,15 +6,16 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-sql" [package.metadata.docs.rs] -features = [ "sqlite" ] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +features = ["sqlite"] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -23,11 +24,11 @@ tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } futures-core = "0.3" -sqlx = { version = "0.7", features = [ "json", "time" ] } +sqlx = { version = "0.7", features = ["json", "time"] } time = "0.3" -tokio = { version = "1", features = [ "sync" ] } +tokio = { version = "1", features = ["sync"] } [features] -sqlite = [ "sqlx/sqlite", "sqlx/runtime-tokio" ] -mysql = [ "sqlx/mysql", "sqlx/runtime-tokio-rustls" ] -postgres = [ "sqlx/postgres", "sqlx/runtime-tokio-rustls" ] +sqlite = ["sqlx/sqlite", "sqlx/runtime-tokio"] +mysql = ["sqlx/mysql", "sqlx/runtime-tokio-rustls"] +postgres = ["sqlx/postgres", "sqlx/runtime-tokio-rustls"] diff --git a/plugins/store/Cargo.toml b/plugins/store/Cargo.toml index edf18276..30b6c49d 100644 --- a/plugins/store/Cargo.toml +++ b/plugins/store/Cargo.toml @@ -6,14 +6,15 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-store" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/stronghold/Cargo.toml b/plugins/stronghold/Cargo.toml index bef2a0ca..05c25c4e 100644 --- a/plugins/stronghold/Cargo.toml +++ b/plugins/stronghold/Cargo.toml @@ -6,14 +6,15 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-stronghold" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -24,15 +25,15 @@ thiserror = { workspace = true } iota_stronghold = "1" iota-crypto = "0.23" hex = "0.4" -zeroize = { version = "1", features = [ "zeroize_derive" ] } +zeroize = { version = "1", features = ["zeroize_derive"] } rust-argon2 = { version = "1", optional = true } rand_chacha = { version = "0.3.1", optional = true } -rand_core = { version = "0.6.4", features = [ "getrandom" ], optional = true } +rand_core = { version = "0.6.4", features = ["getrandom"], optional = true } [dev-dependencies] rand = "0.8" rusty-fork = "0.3" [features] -default = [ "kdf" ] -kdf = [ "dep:rust-argon2", "dep:rand_chacha", "dep:rand_core" ] +default = ["kdf"] +kdf = ["dep:rust-argon2", "dep:rand_chacha", "dep:rand_core"] diff --git a/plugins/updater/Cargo.toml b/plugins/updater/Cargo.toml index 7f4416b6..c4194318 100644 --- a/plugins/updater/Cargo.toml +++ b/plugins/updater/Cargo.toml @@ -6,14 +6,15 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-updater" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] tauri = { workspace = true } @@ -21,31 +22,35 @@ serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } tokio = "1" -reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] } +reqwest = { version = "0.12", default-features = false, features = [ + "json", + "stream", +] } url = { workspace = true } -http = "0.2" +http = "1" dirs-next = "2" minisign-verify = "0.2" -time = { version = "0.3", features = [ "parsing", "formatting" ] } -base64 = "0.21" -percent-encoding = "2" -semver = { version = "1", features = [ "serde" ] } +time = { version = "0.3", features = ["parsing", "formatting"] } +base64 = "0.22" +semver = { version = "1", features = ["serde"] } futures-util = "0.3" tempfile = "3" zip = "0.6" -tar = "0.4" [target."cfg(target_os = \"windows\")".dependencies] -zip = { version = "0.6", default-features = false } -windows-sys = { version = "0.52.0", features = [ "Win32_Foundation", "Win32_UI_WindowsAndMessaging" ] } +windows-sys = { version = "0.52.0", features = [ + "Win32_Foundation", + "Win32_UI_WindowsAndMessaging", +] } [target."cfg(any(target_os = \"macos\", target_os = \"linux\"))".dependencies] +tar = "0.4" flate2 = "1.0.27" [dev-dependencies] mockito = "0.31" [features] -native-tls = [ "reqwest/native-tls" ] -native-tls-vendored = [ "reqwest/native-tls-vendored" ] -rustls-tls = [ "reqwest/rustls-tls" ] +native-tls = ["reqwest/native-tls"] +native-tls-vendored = ["reqwest/native-tls-vendored"] +rustls-tls = ["reqwest/rustls-tls"] diff --git a/plugins/upload/Cargo.toml b/plugins/upload/Cargo.toml index 3a657a3b..d4a1de71 100644 --- a/plugins/upload/Cargo.toml +++ b/plugins/upload/Cargo.toml @@ -6,14 +6,15 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-upload" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,13 +22,16 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -tokio = { version = "1", features = [ "fs" ] } -tokio-util = { version = "0.7", features = [ "codec" ] } -reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] } +tokio = { version = "1", features = ["fs"] } +tokio-util = { version = "0.7", features = ["codec"] } +reqwest = { version = "0.12", default-features = false, features = [ + "json", + "stream", +] } futures-util = "0.3" read-progress-stream = "1.0.0" [features] -native-tls = [ "reqwest/native-tls" ] -native-tls-vendored = [ "reqwest/native-tls-vendored" ] -rustls-tls = [ "reqwest/rustls-tls" ] +native-tls = ["reqwest/native-tls"] +native-tls-vendored = ["reqwest/native-tls-vendored"] +rustls-tls = ["reqwest/rustls-tls"] diff --git a/plugins/upload/README.md b/plugins/upload/README.md index d0c43078..821a407d 100644 --- a/plugins/upload/README.md +++ b/plugins/upload/README.md @@ -72,7 +72,7 @@ upload( ``` ```javascript -import { download } from "tauri-plugin-upload-api"; +import { download } from "@tauri-apps/plugin-upload"; download( "https://example.com/file-download-link", diff --git a/plugins/websocket/Cargo.toml b/plugins/websocket/Cargo.toml index a201bf57..ed8b7c98 100644 --- a/plugins/websocket/Cargo.toml +++ b/plugins/websocket/Cargo.toml @@ -6,15 +6,16 @@ authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-websocket" -exclude = [ "/examples" ] +exclude = ["/examples"] [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -25,10 +26,10 @@ thiserror = { workspace = true } http = "1" rand = "0.8" futures-util = "0.3" -tokio = { version = "1", features = [ "net", "sync" ] } +tokio = { version = "1", features = ["net", "sync"] } tokio-tungstenite = { version = "0.21" } [features] -native-tls = [ "tokio-tungstenite/native-tls" ] -native-tls-vendored = [ "tokio-tungstenite/native-tls-vendored" ] -rustls-tls-webpki-roots = [ "tokio-tungstenite/rustls-tls-webpki-roots" ] +native-tls = ["tokio-tungstenite/native-tls"] +native-tls-vendored = ["tokio-tungstenite/native-tls-vendored"] +rustls-tls-webpki-roots = ["tokio-tungstenite/rustls-tls-webpki-roots"] diff --git a/plugins/window-state/CHANGELOG.md b/plugins/window-state/CHANGELOG.md index 21438678..41bad562 100644 --- a/plugins/window-state/CHANGELOG.md +++ b/plugins/window-state/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.0.0-beta.4] + +- [`c013fa5`](https://github.com/tauri-apps/plugins-workspace/commit/c013fa52cd66885cf457a64e75373cb2066bc849)([#1078](https://github.com/tauri-apps/plugins-workspace/pull/1078)) **Breaking change**: Changed the format of the state file from bincode to json. Also changed the filename to from `.window-state` to `.window-state.json`. + ## \[2.0.0-beta.3] - [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true. diff --git a/plugins/window-state/Cargo.toml b/plugins/window-state/Cargo.toml index 99645547..d39bc836 100644 --- a/plugins/window-state/Cargo.toml +++ b/plugins/window-state/Cargo.toml @@ -1,19 +1,20 @@ [package] name = "tauri-plugin-window-state" -version = "2.0.0-beta.3" +version = "2.0.0-beta.4" description = "Save window positions and sizes and restore them when the app is reopened." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-window-state" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,5 +22,4 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -bincode = "1.3" bitflags = "2" diff --git a/plugins/window-state/api-iife.js b/plugins/window-state/api-iife.js index 28151518..ceacc20c 100644 --- a/plugins/window-state/api-iife.js +++ b/plugins/window-state/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOWSTATE__=function(e){"use strict";var t,i,n,a;function l(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function s(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,i,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?a.call(e,i):a?a.value=i:t.set(e,i)}(this,t,e,"f")}async close(){return s("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class o{constructor(e,t){this.type="Logical",this.width=e,this.height=t}}class u{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new o(this.width/e,this.height/e)}}class c{constructor(e,t){this.type="Logical",this.x=e,this.y=t}}class d{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new c(this.x/e,this.y/e)}}async function h(e,t){await s("plugin:event|unlisten",{event:e,eventId:t})}async function w(e,t,i){const n="string"==typeof i?.target?{kind:"AnyLabel",label:i.target}:i?.target??{kind:"Any"};return s("plugin:event|listen",{event:e,target:n,handler:l(t)}).then((t=>async()=>h(e,t)))}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WEBVIEW_CREATED="tauri://webview-created",e.FILE_DROP="tauri://file-drop",e.FILE_DROP_HOVER="tauri://file-drop-hover",e.FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(i||(i={}));class b extends r{constructor(e){super(e)}static async new(e,t,i){return s("plugin:image|new",{rgba:p(e),width:t,height:i}).then((e=>new b(e)))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:p(e)}).then((e=>new b(e)))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then((e=>new b(e)))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return s("plugin:image|size",{rid:this.rid})}}function p(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof b?e.rid:e}!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(n||(n={}));class y{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function g(){return new m(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function _(){return window.__TAURI_INTERNALS__.metadata.windows.map((e=>new m(e.label,{skip:!0})))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(a||(a={}));const f=["tauri://created","tauri://error"];class m{constructor(e,t={}){this.label=e,this.listeners=Object.create(null),t?.skip||s("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:t.parent?.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){return _().find((t=>t.label===e))??null}static getCurrent(){return g()}static getAll(){return _()}static async getFocusedWindow(){for(const e of _())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):w(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):async function(e,t,i){return w(e,(i=>{t(i),h(e,i.id).catch((()=>{}))}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(f.includes(e)){for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t});return Promise.resolve()}return async function(e,t){await s("plugin:event|emit",{event:e,payload:t})}(e,t)}async emitTo(e,t,i){if(f.includes(t)){for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i});return Promise.resolve()}return async function(e,t,i){const n="string"==typeof e?{kind:"AnyLabel",label:e}:e;await s("plugin:event|emit_to",{target:n,event:t,payload:i})}(e,t,i)}_handleTauriEvent(e,t){return!!f.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){return s("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return s("plugin:window|inner_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async outerPosition(){return s("plugin:window|outer_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async innerSize(){return s("plugin:window|inner_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async outerSize(){return s("plugin:window|outer_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async isFullscreen(){return s("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return s("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return s("plugin:window|is_maximized",{label:this.label})}async isFocused(){return s("plugin:window|is_focused",{label:this.label})}async isDecorated(){return s("plugin:window|is_decorated",{label:this.label})}async isResizable(){return s("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return s("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return s("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return s("plugin:window|is_closable",{label:this.label})}async isVisible(){return s("plugin:window|is_visible",{label:this.label})}async title(){return s("plugin:window|title",{label:this.label})}async theme(){return s("plugin:window|theme",{label:this.label})}async center(){return s("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===n.Critical?{type:"Critical"}:{type:"Informational"}),s("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return s("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return s("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return s("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return s("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return s("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return s("plugin:window|maximize",{label:this.label})}async unmaximize(){return s("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return s("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return s("plugin:window|minimize",{label:this.label})}async unminimize(){return s("plugin:window|unminimize",{label:this.label})}async show(){return s("plugin:window|show",{label:this.label})}async hide(){return s("plugin:window|hide",{label:this.label})}async close(){return s("plugin:window|close",{label:this.label})}async destroy(){return s("plugin:window|destroy",{label:this.label})}async setDecorations(e){return s("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return s("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return s("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return s("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return s("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return s("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return s("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return s("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return s("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return s("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return s("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return s("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return s("plugin:window|set_focus",{label:this.label})}async setIcon(e){return s("plugin:window|set_icon",{label:this.label,value:p(e)})}async setSkipTaskbar(e){return s("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return s("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return s("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return s("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return s("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return s("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return s("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return s("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setProgressBar(e){return s("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return s("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async onResized(e){return this.listen(i.WINDOW_RESIZED,(t=>{var i;t.payload=(i=t.payload,new u(i.width,i.height)),e(t)}))}async onMoved(e){return this.listen(i.WINDOW_MOVED,(t=>{t.payload=D(t.payload),e(t)}))}async onCloseRequested(e){return this.listen(i.WINDOW_CLOSE_REQUESTED,(t=>{const i=new y(t);Promise.resolve(e(i)).then((()=>{if(!i.isPreventDefault())return this.destroy()}))}))}async onFileDropEvent(e){const t=await this.listen(i.FILE_DROP,(t=>{e({...t,payload:{type:"drop",paths:t.payload.paths,position:D(t.payload.position)}})})),n=await this.listen(i.FILE_DROP_HOVER,(t=>{e({...t,payload:{type:"hover",paths:t.payload.paths,position:D(t.payload.position)}})})),a=await this.listen(i.FILE_DROP_CANCELLED,(t=>{e({...t,payload:{type:"cancel"}})}));return()=>{t(),n(),a()}}async onFocusChanged(e){const t=await this.listen(i.WINDOW_FOCUS,(t=>{e({...t,payload:!0})})),n=await this.listen(i.WINDOW_BLUR,(t=>{e({...t,payload:!1})}));return()=>{t(),n()}}async onScaleChanged(e){return this.listen(i.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(i.WINDOW_THEME_CHANGED,e)}}var v,E,I;function D(e){return new d(e.x,e.y)}async function S(e,t){return s("plugin:window-state|restore_state",{label:e,flags:t})}return function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(v||(v={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(E||(E={})),e.StateFlags=void 0,(I=e.StateFlags||(e.StateFlags={}))[I.SIZE=1]="SIZE",I[I.POSITION=2]="POSITION",I[I.MAXIMIZED=4]="MAXIMIZED",I[I.VISIBLE=8]="VISIBLE",I[I.DECORATIONS=16]="DECORATIONS",I[I.FULLSCREEN=32]="FULLSCREEN",I[I.ALL=63]="ALL",e.restoreState=S,e.restoreStateCurrent=async function(e){return S(g().label,e)},e.saveWindowState=async function(e){return s("plugin:window-state|save_window_state",{flags:e})},e}({});Object.defineProperty(window.__TAURI__,"windowState",{value:__TAURI_PLUGIN_WINDOWSTATE__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOWSTATE__=function(e){"use strict";var t,i,n,a;function l(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function s(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,i,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?a.call(e,i):a?a.value=i:t.set(e,i)}(this,t,e,"f")}async close(){return s("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class o{constructor(e,t){this.type="Logical",this.width=e,this.height=t}}class u{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new o(this.width/e,this.height/e)}}class c{constructor(e,t){this.type="Logical",this.x=e,this.y=t}}class d{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new c(this.x/e,this.y/e)}}async function h(e,t){await s("plugin:event|unlisten",{event:e,eventId:t})}async function w(e,t,i){const n="string"==typeof i?.target?{kind:"AnyLabel",label:i.target}:i?.target??{kind:"Any"};return s("plugin:event|listen",{event:e,target:n,handler:l(t)}).then((t=>async()=>h(e,t)))}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WEBVIEW_CREATED="tauri://webview-created",e.FILE_DROP="tauri://file-drop",e.FILE_DROP_HOVER="tauri://file-drop-hover",e.FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(i||(i={}));class b extends r{constructor(e){super(e)}static async new(e,t,i){return s("plugin:image|new",{rgba:p(e),width:t,height:i}).then((e=>new b(e)))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:p(e)}).then((e=>new b(e)))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then((e=>new b(e)))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return s("plugin:image|size",{rid:this.rid})}}function p(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof b?e.rid:e}!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(n||(n={}));class y{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function g(){return new m(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function _(){return window.__TAURI_INTERNALS__.metadata.windows.map((e=>new m(e.label,{skip:!0})))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(a||(a={}));const f=["tauri://created","tauri://error"];class m{constructor(e,t={}){this.label=e,this.listeners=Object.create(null),t?.skip||s("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:t.parent?.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){return _().find((t=>t.label===e))??null}static getCurrent(){return g()}static getAll(){return _()}static async getFocusedWindow(){for(const e of _())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):w(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):async function(e,t,i){return w(e,(i=>{t(i),h(e,i.id).catch((()=>{}))}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(f.includes(e)){for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t});return Promise.resolve()}return async function(e,t){await s("plugin:event|emit",{event:e,payload:t})}(e,t)}async emitTo(e,t,i){if(f.includes(t)){for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i});return Promise.resolve()}return async function(e,t,i){const n="string"==typeof e?{kind:"AnyLabel",label:e}:e;await s("plugin:event|emit_to",{target:n,event:t,payload:i})}(e,t,i)}_handleTauriEvent(e,t){return!!f.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){return s("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return s("plugin:window|inner_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async outerPosition(){return s("plugin:window|outer_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async innerSize(){return s("plugin:window|inner_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async outerSize(){return s("plugin:window|outer_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async isFullscreen(){return s("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return s("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return s("plugin:window|is_maximized",{label:this.label})}async isFocused(){return s("plugin:window|is_focused",{label:this.label})}async isDecorated(){return s("plugin:window|is_decorated",{label:this.label})}async isResizable(){return s("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return s("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return s("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return s("plugin:window|is_closable",{label:this.label})}async isVisible(){return s("plugin:window|is_visible",{label:this.label})}async title(){return s("plugin:window|title",{label:this.label})}async theme(){return s("plugin:window|theme",{label:this.label})}async center(){return s("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===n.Critical?{type:"Critical"}:{type:"Informational"}),s("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return s("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return s("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return s("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return s("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return s("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return s("plugin:window|maximize",{label:this.label})}async unmaximize(){return s("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return s("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return s("plugin:window|minimize",{label:this.label})}async unminimize(){return s("plugin:window|unminimize",{label:this.label})}async show(){return s("plugin:window|show",{label:this.label})}async hide(){return s("plugin:window|hide",{label:this.label})}async close(){return s("plugin:window|close",{label:this.label})}async destroy(){return s("plugin:window|destroy",{label:this.label})}async setDecorations(e){return s("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return s("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return s("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return s("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return s("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return s("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return s("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return s("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return s("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return s("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return s("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return s("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return s("plugin:window|set_focus",{label:this.label})}async setIcon(e){return s("plugin:window|set_icon",{label:this.label,value:p(e)})}async setSkipTaskbar(e){return s("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return s("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return s("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return s("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return s("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return s("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return s("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return s("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setProgressBar(e){return s("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return s("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async onResized(e){return this.listen(i.WINDOW_RESIZED,(t=>{var i;t.payload=(i=t.payload,new u(i.width,i.height)),e(t)}))}async onMoved(e){return this.listen(i.WINDOW_MOVED,(t=>{t.payload=D(t.payload),e(t)}))}async onCloseRequested(e){return this.listen(i.WINDOW_CLOSE_REQUESTED,(t=>{const i=new y(t);Promise.resolve(e(i)).then((()=>{if(!i.isPreventDefault())return this.destroy()}))}))}async onFileDropEvent(e){const t=await this.listen(i.FILE_DROP,(t=>{e({...t,payload:{type:"drop",paths:t.payload.paths,position:D(t.payload.position)}})})),n=await this.listen(i.FILE_DROP_HOVER,(t=>{e({...t,payload:{type:"hover",paths:t.payload.paths,position:D(t.payload.position)}})})),a=await this.listen(i.FILE_DROP_CANCELLED,(t=>{e({...t,payload:{type:"cancel"}})}));return()=>{t(),n(),a()}}async onFocusChanged(e){const t=await this.listen(i.WINDOW_FOCUS,(t=>{e({...t,payload:!0})})),n=await this.listen(i.WINDOW_BLUR,(t=>{e({...t,payload:!1})}));return()=>{t(),n()}}async onScaleChanged(e){return this.listen(i.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(i.WINDOW_THEME_CHANGED,e)}}var v,E,I;function D(e){return new d(e.x,e.y)}async function S(e,t){return s("plugin:window-state|restore_state",{label:e,flags:t})}return function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(v||(v={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(E||(E={})),e.StateFlags=void 0,(I=e.StateFlags||(e.StateFlags={}))[I.SIZE=1]="SIZE",I[I.POSITION=2]="POSITION",I[I.MAXIMIZED=4]="MAXIMIZED",I[I.VISIBLE=8]="VISIBLE",I[I.DECORATIONS=16]="DECORATIONS",I[I.FULLSCREEN=32]="FULLSCREEN",I[I.ALL=63]="ALL",e.filename=async function(){return s("plugin:window-state|filename")},e.restoreState=S,e.restoreStateCurrent=async function(e){return S(g().label,e)},e.saveWindowState=async function(e){return s("plugin:window-state|save_window_state",{flags:e})},e}({});Object.defineProperty(window.__TAURI__,"windowState",{value:__TAURI_PLUGIN_WINDOWSTATE__})} diff --git a/plugins/window-state/guest-js/index.ts b/plugins/window-state/guest-js/index.ts index 4800ecb9..c6577c12 100644 --- a/plugins/window-state/guest-js/index.ts +++ b/plugins/window-state/guest-js/index.ts @@ -38,5 +38,11 @@ async function restoreState( async function restoreStateCurrent(flags: StateFlags): Promise { return restoreState(getCurrent().label, flags); } +/** + * Get the name of the file used to store window state. + */ +async function filename(): Promise { + return invoke("plugin:window-state|filename"); +} -export { restoreState, restoreStateCurrent, saveWindowState }; +export { restoreState, restoreStateCurrent, saveWindowState, filename }; diff --git a/plugins/window-state/src/cmd.rs b/plugins/window-state/src/cmd.rs index 75a390b7..c88c95f3 100644 --- a/plugins/window-state/src/cmd.rs +++ b/plugins/window-state/src/cmd.rs @@ -32,3 +32,8 @@ pub async fn restore_state( .map_err(|e| e.to_string())?; Ok(()) } + +#[command] +pub fn filename(app: AppHandle) -> String { + app.filename() +} diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index ed9f10cf..7235a93a 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -23,13 +23,15 @@ use tauri::{ use std::{ collections::{HashMap, HashSet}, fs::{create_dir_all, File}, - io::Write, sync::{Arc, Mutex}, }; mod cmd; -pub const STATE_FILENAME: &str = ".window-state"; +/// Default filename used to store window state. +/// +/// If using a custom filename, you should probably use [`AppHandleExt::filename`] instead. +pub const DEFAULT_FILENAME: &str = ".window-state.json"; #[derive(Debug, thiserror::Error)] pub enum Error { @@ -38,7 +40,7 @@ pub enum Error { #[error(transparent)] Tauri(#[from] tauri::Error), #[error(transparent)] - Bincode(#[from] Box), + SerdeJson(#[from] serde_json::Error), } pub type Result = std::result::Result; @@ -61,6 +63,10 @@ impl Default for StateFlags { } } +struct PluginState { + filename: String, +} + #[derive(Debug, Deserialize, Serialize, PartialEq)] struct WindowState { width: f64, @@ -99,12 +105,15 @@ struct WindowStateCache(Arc>>); pub trait AppHandleExt { /// Saves all open windows state to disk fn save_window_state(&self, flags: StateFlags) -> Result<()>; + /// Get the name of the file used to store window state. + fn filename(&self) -> String; } impl AppHandleExt for tauri::AppHandle { fn save_window_state(&self, flags: StateFlags) -> Result<()> { if let Ok(app_dir) = self.path().app_config_dir() { - let state_path = app_dir.join(STATE_FILENAME); + let plugin_state = self.state::(); + let state_path = app_dir.join(&plugin_state.filename); let cache = self.state::(); let mut state = cache.0.lock().unwrap(); for (label, s) in state.iter_mut() { @@ -116,14 +125,15 @@ impl AppHandleExt for tauri::AppHandle { create_dir_all(&app_dir) .map_err(Error::Io) .and_then(|_| File::create(state_path).map_err(Into::into)) - .and_then(|mut f| { - f.write_all(&bincode::serialize(&*state).map_err(Error::Bincode)?) - .map_err(Into::into) - }) + .and_then(|mut f| serde_json::to_writer_pretty(&mut f, &*state).map_err(Into::into)) } else { Ok(()) } } + + fn filename(&self) -> String { + self.state::().filename.clone() + } } pub trait WindowExt { @@ -290,6 +300,7 @@ pub struct Builder { denylist: HashSet, skip_initial_state: HashSet, state_flags: StateFlags, + filename: Option, } impl Builder { @@ -303,6 +314,12 @@ impl Builder { self } + /// Sets a custom filename to use when saving and restoring window states from disk. + pub fn with_filename(mut self, filename: impl Into) -> Self { + self.filename.replace(filename.into()); + self + } + /// Sets a list of windows that shouldn't be tracked and managed by this plugin /// for example splash screen windows. pub fn with_denylist(mut self, denylist: &[&str]) -> Self { @@ -318,30 +335,35 @@ impl Builder { pub fn build(self) -> TauriPlugin { let flags = self.state_flags; + let filename = self.filename.unwrap_or_else(|| DEFAULT_FILENAME.into()); + PluginBuilder::new("window-state") .invoke_handler(tauri::generate_handler![ cmd::save_window_state, - cmd::restore_state + cmd::restore_state, + cmd::filename ]) .setup(|app, _api| { - let cache: Arc>> = if let Ok(app_dir) = - app.path().app_config_dir() - { - let state_path = app_dir.join(STATE_FILENAME); - if state_path.exists() { - Arc::new(Mutex::new( - std::fs::read(state_path) - .map_err(Error::from) - .and_then(|state| bincode::deserialize(&state).map_err(Into::into)) - .unwrap_or_default(), - )) + let cache: Arc>> = + if let Ok(app_dir) = app.path().app_config_dir() { + let state_path = app_dir.join(&filename); + if state_path.exists() { + Arc::new(Mutex::new( + std::fs::read(state_path) + .map_err(Error::from) + .and_then(|state| { + serde_json::from_slice(&state).map_err(Into::into) + }) + .unwrap_or_default(), + )) + } else { + Default::default() + } } else { Default::default() - } - } else { - Default::default() - }; + }; app.manage(WindowStateCache(cache)); + app.manage(PluginState { filename }); Ok(()) }) .on_window_ready(move |window| { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 26066b04..37b4c9e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,7 +20,7 @@ importers: version: 0.4.4(rollup@4.9.6) '@rollup/plugin-typescript': specifier: 11.1.6 - version: 11.1.6(rollup@4.9.6)(typescript@5.3.3) + version: 11.1.6(rollup@4.9.6)(tslib@2.6.2)(typescript@5.3.3) '@typescript-eslint/eslint-plugin': specifier: 6.20.0 version: 6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.56.0)(typescript@5.3.3) @@ -57,6 +57,9 @@ importers: rollup: specifier: 4.9.6 version: 4.9.6 + tslib: + specifier: 2.6.2 + version: 2.6.2 typescript: specifier: 5.3.3 version: 5.3.3 @@ -135,7 +138,7 @@ importers: version: 4.2.8 unocss: specifier: ^0.58.0 - version: 0.58.0(postcss@8.4.32)(vite@5.0.12) + version: 0.58.0(postcss@8.4.32)(rollup@4.9.6)(vite@5.0.12) vite: specifier: ^5.0.12 version: 5.0.12 @@ -163,10 +166,6 @@ importers: '@tauri-apps/api': specifier: 2.0.0-beta.6 version: 2.0.0-beta.6 - devDependencies: - tslib: - specifier: 2.6.0 - version: 2.6.0 plugins/cli: dependencies: @@ -243,10 +242,6 @@ importers: '@tauri-apps/api': specifier: 2.0.0-beta.6 version: 2.0.0-beta.6 - devDependencies: - tslib: - specifier: 2.6.0 - version: 2.6.0 plugins/notification: dependencies: @@ -395,7 +390,7 @@ packages: '@babel/traverse': 7.23.5 '@babel/types': 7.23.5 convert-source-map: 2.0.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 7.5.4 @@ -665,7 +660,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.5 '@babel/types': 7.23.5 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -799,7 +794,7 @@ packages: peerDependencies: mocha: ^10.0.0 dependencies: - effection: 2.0.8 + effection: 2.0.8(mocha@10.2.0) mocha: 10.2.0 dev: true @@ -1046,7 +1041,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 globals: 13.23.0 ignore: 5.3.0 @@ -1068,7 +1063,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 2.0.1 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -1109,7 +1104,7 @@ packages: '@antfu/install-pkg': 0.1.1 '@antfu/utils': 0.7.6 '@iconify/types': 2.0.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) kolorist: 1.8.0 local-pkg: 0.4.3 transitivePeerDependencies: @@ -1206,7 +1201,7 @@ packages: terser: 5.25.0 dev: true - /@rollup/plugin-typescript@11.1.6(rollup@4.9.6)(typescript@5.3.3): + /@rollup/plugin-typescript@11.1.6(rollup@4.9.6)(tslib@2.6.2)(typescript@5.3.3): resolution: {integrity: sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1222,23 +1217,10 @@ packages: '@rollup/pluginutils': 5.1.0(rollup@4.9.6) resolve: 1.22.8 rollup: 4.9.6 + tslib: 2.6.2 typescript: 5.3.3 dev: true - /@rollup/pluginutils@5.1.0: - resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@types/estree': 1.0.5 - estree-walker: 2.0.2 - picomatch: 2.3.1 - dev: true - /@rollup/pluginutils@5.1.0(rollup@4.9.6): resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} @@ -1463,7 +1445,7 @@ packages: vite: ^5.0.0 dependencies: '@sveltejs/vite-plugin-svelte': 3.0.1(svelte@4.2.8)(vite@5.0.12) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) svelte: 4.2.8 vite: 5.0.12 transitivePeerDependencies: @@ -1478,7 +1460,7 @@ packages: vite: ^5.0.0 dependencies: '@sveltejs/vite-plugin-svelte-inspector': 2.0.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.12) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.5 @@ -1652,7 +1634,7 @@ packages: '@typescript-eslint/type-utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.20.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.56.0 graphemer: 1.4.0 ignore: 5.3.0 @@ -1678,7 +1660,7 @@ packages: '@typescript-eslint/types': 6.20.0 '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.20.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.56.0 typescript: 5.3.3 transitivePeerDependencies: @@ -1705,7 +1687,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) '@typescript-eslint/utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.3.3) typescript: 5.3.3 @@ -1729,7 +1711,7 @@ packages: dependencies: '@typescript-eslint/types': 6.20.0 '@typescript-eslint/visitor-keys': 6.20.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -1771,7 +1753,7 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@unocss/astro@0.58.0(vite@5.0.12): + /@unocss/astro@0.58.0(rollup@4.9.6)(vite@5.0.12): resolution: {integrity: sha512-df+tEFO5eKXjQOwSWQhS9IdjD0sfLHLtn8U09sEKR2Nmh5CvpwyBxmvLQgOCilPou7ehmyKfsyGRLZg7IMp+Ew==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 @@ -1781,19 +1763,19 @@ packages: dependencies: '@unocss/core': 0.58.0 '@unocss/reset': 0.58.0 - '@unocss/vite': 0.58.0(vite@5.0.12) + '@unocss/vite': 0.58.0(rollup@4.9.6)(vite@5.0.12) vite: 5.0.12 transitivePeerDependencies: - rollup dev: true - /@unocss/cli@0.58.0: + /@unocss/cli@0.58.0(rollup@4.9.6): resolution: {integrity: sha512-rhsrDBxAVueygMcAbMkbuvsHbBL2rG6N96LllYwHn16FLgOE3Sf4JW1/LlNjQje3BtwMMtbSCCAeu2SryFhzbw==} engines: {node: '>=14'} hasBin: true dependencies: '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.1.0 + '@rollup/pluginutils': 5.1.0(rollup@4.9.6) '@unocss/config': 0.58.0 '@unocss/core': 0.58.0 '@unocss/preset-uno': 0.58.0 @@ -1969,13 +1951,13 @@ packages: '@unocss/core': 0.58.0 dev: true - /@unocss/vite@0.58.0(vite@5.0.12): + /@unocss/vite@0.58.0(rollup@4.9.6)(vite@5.0.12): resolution: {integrity: sha512-OCUOLMSOBEtXOEyBbAvMI3/xdR175BWRzmvV9Wc34ANZclEvCdVH8+WU725ibjY4VT0gVIuX68b13fhXdHV41A==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 dependencies: '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.1.0 + '@rollup/pluginutils': 5.1.0(rollup@4.9.6) '@unocss/config': 0.58.0 '@unocss/core': 0.58.0 '@unocss/inspector': 0.58.0 @@ -2478,18 +2460,6 @@ packages: ms: 2.1.3 dev: true - /debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true - /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -2590,18 +2560,6 @@ packages: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} dev: true - /effection@2.0.8: - resolution: {integrity: sha512-/v7cbPIXGGylInQgHHjJutzqUn6VIfcP13hh2X0hXf04wwAlSI+lVjUBKpr5TX3+v9dXV/JLHO/pqQ9Cp1QAnQ==} - dependencies: - '@effection/channel': 2.0.6 - '@effection/core': 2.2.3 - '@effection/events': 2.0.6 - '@effection/fetch': 2.0.7(mocha@10.2.0) - '@effection/main': 2.1.2 - '@effection/stream': 2.0.6 - '@effection/subscription': 2.0.6 - dev: true - /effection@2.0.8(mocha@10.2.0): resolution: {integrity: sha512-/v7cbPIXGGylInQgHHjJutzqUn6VIfcP13hh2X0hXf04wwAlSI+lVjUBKpr5TX3+v9dXV/JLHO/pqQ9Cp1QAnQ==} dependencies: @@ -2944,7 +2902,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -3866,7 +3824,7 @@ packages: /micromark@2.11.4: resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) parse-entities: 2.0.0 transitivePeerDependencies: - supports-color @@ -4425,7 +4383,7 @@ packages: /rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} dependencies: - tslib: 2.6.0 + tslib: 2.6.2 dev: true /safe-array-concat@1.0.1: @@ -4777,8 +4735,8 @@ packages: strip-bom: 3.0.0 dev: true - /tslib@2.6.0: - resolution: {integrity: sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==} + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true /type-check@0.4.0: @@ -4893,7 +4851,7 @@ packages: '@types/unist': 2.0.10 dev: true - /unocss@0.58.0(postcss@8.4.32)(vite@5.0.12): + /unocss@0.58.0(postcss@8.4.32)(rollup@4.9.6)(vite@5.0.12): resolution: {integrity: sha512-MSPRHxBqWN+1AHGV+J5uUy4//e6ZBK6O+ISzD0qrXcCD/GNtxk1+lYjOK2ltkUiKX539+/KF91vNxzhhwEf+xA==} engines: {node: '>=14'} peerDependencies: @@ -4905,8 +4863,8 @@ packages: vite: optional: true dependencies: - '@unocss/astro': 0.58.0(vite@5.0.12) - '@unocss/cli': 0.58.0 + '@unocss/astro': 0.58.0(rollup@4.9.6)(vite@5.0.12) + '@unocss/cli': 0.58.0(rollup@4.9.6) '@unocss/core': 0.58.0 '@unocss/extractor-arbitrary-variants': 0.58.0 '@unocss/postcss': 0.58.0(postcss@8.4.32) @@ -4924,7 +4882,7 @@ packages: '@unocss/transformer-compile-class': 0.58.0 '@unocss/transformer-directives': 0.58.0 '@unocss/transformer-variant-group': 0.58.0 - '@unocss/vite': 0.58.0(vite@5.0.12) + '@unocss/vite': 0.58.0(rollup@4.9.6)(vite@5.0.12) vite: 5.0.12 transitivePeerDependencies: - postcss diff --git a/shared/template/Cargo.toml b/shared/template/Cargo.toml index 1a2deb3f..97bc0481 100644 --- a/shared/template/Cargo.toml +++ b/shared/template/Cargo.toml @@ -4,14 +4,15 @@ version = "1.0.0" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-PLUGIN_NAME" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html