diff --git a/Cargo.lock b/Cargo.lock index 5d6c4f8d..bd60ca39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,7 +23,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher", "cpufeatures", "opaque-debug", @@ -186,9 +186,9 @@ dependencies = [ [[package]] name = "async-recursion" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cda8f4bcc10624c4e85bc66b3f452cca98cfa5ca002dc83a16aad2367641bea" +checksum = "3b015a331cc64ebd1774ba119538573603427eaace0a1950c423ab971f903796" dependencies = [ "proc-macro2", "quote", @@ -203,9 +203,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.61" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", @@ -268,7 +268,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi 0.1.19", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -285,7 +285,7 @@ dependencies = [ "log", "rand 0.7.3", "runloop", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -401,9 +401,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.2" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -421,9 +421,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byte-unit" @@ -437,9 +437,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.12.3" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa3a8d9a1ca92e282c96a32d6511b695d7d994d1d102ba85d279f9b2756947f" +checksum = "c041d3eab048880cb0b86b256447da3f18859a163c3b8d8893f4e6368abe6393" [[package]] name = "byteorder" @@ -459,9 +459,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cairo-rs" @@ -489,9 +489,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cesu8" @@ -527,12 +527,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -545,7 +539,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher", "cpufeatures", "zeroize", @@ -576,7 +570,7 @@ dependencies = [ "num-traits", "time 0.1.45", "wasm-bindgen", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -649,7 +643,7 @@ checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59" dependencies = [ "atty", "lazy_static", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -658,15 +652,15 @@ version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" dependencies = [ - "bytes 1.3.0", + "bytes 1.4.0", "memchr", ] [[package]] name = "concurrent-queue" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b" +checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" dependencies = [ "crossbeam-utils", ] @@ -741,9 +735,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ "crc-catalog", ] @@ -760,7 +754,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -769,7 +763,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -779,7 +773,7 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -789,7 +783,7 @@ version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -879,9 +873,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579" +checksum = "322296e2f2e5af4270b54df9e85a02ff037e271af20ba3e7fe1575515dc840b8" dependencies = [ "cc", "cxxbridge-flags", @@ -891,9 +885,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70" +checksum = "017a1385b05d631e7875b1f151c9f012d37b53491e2a87f65bff5c262b2111d8" dependencies = [ "cc", "codespan-reporting", @@ -906,15 +900,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c" +checksum = "c26bbb078acf09bc1ecda02d4223f03bdd28bd4874edcb0379138efc499ce971" [[package]] name = "cxxbridge-macro" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5" +checksum = "357f40d1f06a24b60ae1fe122542c1fb05d28d32acb2aed064e84bc2ad1e252e" dependencies = [ "proc-macro2", "quote", @@ -962,7 +956,7 @@ version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown", "lock_api", "once_cell", @@ -1049,7 +1043,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -1061,7 +1055,7 @@ checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1072,7 +1066,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1124,9 +1118,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "embed_plist" @@ -1140,7 +1134,7 @@ version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1215,7 +1209,7 @@ version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "windows-sys", @@ -1273,41 +1267,15 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fsevent" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" -dependencies = [ - "bitflags", - "fsevent-sys", -] - [[package]] name = "fsevent-sys" -version = "2.0.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" dependencies = [ "libc", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "futf" version = "0.1.5" @@ -1320,9 +1288,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" dependencies = [ "futures-channel", "futures-core", @@ -1335,9 +1303,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" dependencies = [ "futures-core", "futures-sink", @@ -1345,15 +1313,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" dependencies = [ "futures-core", "futures-task", @@ -1373,9 +1341,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" [[package]] name = "futures-lite" @@ -1394,9 +1362,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2", "quote", @@ -1405,21 +1373,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" dependencies = [ "futures-channel", "futures-core", @@ -1543,7 +1511,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -1554,7 +1522,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -1598,7 +1566,7 @@ dependencies = [ "gobject-sys", "libc", "system-deps 6.0.3", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1737,7 +1705,7 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ - "bytes 1.3.0", + "bytes 1.4.0", "fnv", "futures-core", "futures-sink", @@ -1848,7 +1816,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ - "bytes 1.3.0", + "bytes 1.4.0", "fnv", "itoa 1.0.5", ] @@ -1859,7 +1827,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.3.0", + "bytes 1.4.0", "http", "pin-project-lite", ] @@ -1888,7 +1856,7 @@ version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ - "bytes 1.3.0", + "bytes 1.4.0", "futures-channel", "futures-core", "futures-util", @@ -1912,7 +1880,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.3.0", + "bytes 1.4.0", "hyper", "native-tls", "tokio", @@ -1930,7 +1898,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2021,9 +1989,9 @@ dependencies = [ [[package]] name = "inotify" -version = "0.7.1" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" dependencies = [ "bitflags", "inotify-sys", @@ -2045,7 +2013,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -2192,13 +2160,23 @@ dependencies = [ ] [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "kqueue" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "2c8fc60ba15bf51257aa9807a48a61013db043fcf3a78cb0d916e8e396dcad98" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" +dependencies = [ + "bitflags", + "libc", ] [[package]] @@ -2222,12 +2200,6 @@ dependencies = [ "spin 0.5.2", ] -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libappindicator" version = "0.7.1" @@ -2264,8 +2236,8 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "cfg-if 1.0.0", - "winapi 0.3.9", + "cfg-if", + "winapi", ] [[package]] @@ -2351,7 +2323,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "value-bag", ] @@ -2361,7 +2333,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "generator", "scoped-tls", "serde", @@ -2410,9 +2382,9 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "md-5" @@ -2459,25 +2431,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.8.5" @@ -2490,30 +2443,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio 0.6.23", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - [[package]] name = "native-tls" version = "0.2.11" @@ -2560,17 +2489,6 @@ dependencies = [ "jni-sys", ] -[[package]] -name = "net2" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "new_debug_unreachable" version = "1.0.4" @@ -2584,7 +2502,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] @@ -2597,7 +2515,7 @@ checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", "bitflags", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", "pin-utils", @@ -2611,30 +2529,51 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "nom" -version = "7.1.2" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", ] +[[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + [[package]] name = "notify" -version = "4.0.17" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" +checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9" dependencies = [ "bitflags", + "crossbeam-channel", "filetime", - "fsevent", "fsevent-sys", "inotify", + "kqueue", "libc", - "mio 0.6.23", - "mio-extras", + "mio", + "serde", "walkdir", - "winapi 0.3.9", + "windows-sys", +] + +[[package]] +name = "notify-debouncer-mini" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e23e9fa24f094b143c1eb61f90ac6457de87be6987bc70746e0179f7dbc9007b" +dependencies = [ + "crossbeam-channel", + "notify", + "serde", ] [[package]] @@ -2644,7 +2583,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ "overload", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2729,18 +2668,18 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.7" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +checksum = "8d829733185c1ca374f17e52b762f24f535ec625d2cc1f070e34c8a9068f341b" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.7" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +checksum = "2be1598bf1c313dcdd12092e3f1920f463462525a21b7b4e11b4168353d0123e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2795,7 +2734,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -2835,9 +2774,9 @@ dependencies = [ [[package]] name = "ordered-stream" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4eb9ba3f3e42dbdd3b7b122de5ca169c81e93d561eb900da3a8c99bcfcf381a" +checksum = "360a24bdacdb7801a1a6af8500392864791c130ebe8bd9a063158cab00040c90" dependencies = [ "futures-core", "pin-project-lite", @@ -2918,12 +2857,12 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2932,7 +2871,7 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -2971,9 +2910,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4257b4a04d91f7e9e6290be5d3da4804dd5784fafde3a497d73eb2b4a158c30a" +checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" dependencies = [ "thiserror", "ucd-trie", @@ -3139,16 +3078,16 @@ checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "plist" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" +checksum = "5329b8f106a176ab0dce4aae5da86bfcb139bb74fb00882859e03745011f3635" dependencies = [ "base64 0.13.1", "indexmap", "line-wrap", + "quick-xml", "serde", "time 0.3.17", - "xml-rs", ] [[package]] @@ -3170,7 +3109,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "libc", "log", "wepoll-ffi", @@ -3194,7 +3133,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug", "universal-hash", @@ -3214,13 +3153,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34" dependencies = [ "once_cell", - "thiserror", - "toml", + "toml_edit", ] [[package]] @@ -3255,9 +3193,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" dependencies = [ "unicode-ident", ] @@ -3268,6 +3206,15 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-xml" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f50b1c63b38611e7d4d7f68b82d3ad0cc71a2ad2e7f61fc10f1328d917c93cd" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.23" @@ -3373,7 +3320,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6435842fc2fea44b528719eb8c32203bbc1bb2f5b619fbe0c0a3d8350fd8d2a8" dependencies = [ - "bytes 1.3.0", + "bytes 1.4.0", "futures", "pin-project-lite", ] @@ -3430,17 +3377,17 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" dependencies = [ - "base64 0.13.1", - "bytes 1.3.0", + "base64 0.21.0", + "bytes 1.4.0", "encoding_rs", "futures-core", "futures-util", @@ -3467,6 +3414,7 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "winreg", ] @@ -3483,7 +3431,7 @@ dependencies = [ "spin 0.5.2", "untrusted", "web-sys", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3544,9 +3492,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -3641,9 +3589,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags", "core-foundation", @@ -3654,9 +3602,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -3823,7 +3771,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.6", ] @@ -3835,7 +3783,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -3847,7 +3795,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.6", ] @@ -3889,7 +3837,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3947,9 +3895,9 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87e292b4291f154971a43c3774364e2cbcaec599d3f5bf6fa9d122885dbc38a" +checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" dependencies = [ "itertools", "nom", @@ -3977,7 +3925,7 @@ dependencies = [ "base64 0.13.1", "bitflags", "byteorder", - "bytes 1.3.0", + "bytes 1.4.0", "crc", "crossbeam-queue", "digest 0.10.6", @@ -4275,7 +4223,7 @@ dependencies = [ "serde", "tao-macros", "unicode-segmentation", - "uuid 1.2.2", + "uuid 1.3.0", "windows 0.39.0", "windows-implement", "x11-dl", @@ -4345,7 +4293,7 @@ dependencies = [ "thiserror", "tokio", "url", - "uuid 1.2.2", + "uuid 1.3.0", "webkit2gtk", "webview2-com", "windows 0.39.0", @@ -4372,7 +4320,7 @@ dependencies = [ "thiserror", "time 0.3.17", "url", - "uuid 1.2.2", + "uuid 1.3.0", "walkdir", ] @@ -4437,6 +4385,7 @@ version = "0.1.0" dependencies = [ "log", "notify", + "notify-debouncer-mini", "serde", "serde_json", "tauri", @@ -4555,7 +4504,7 @@ dependencies = [ name = "tauri-plugin-upload" version = "0.1.0" dependencies = [ - "futures", + "futures-util", "log", "read-progress-stream", "reqwest", @@ -4587,6 +4536,7 @@ name = "tauri-plugin-window-state" version = "0.1.0" dependencies = [ "bincode", + "bitflags", "log", "serde", "serde_json", @@ -4608,7 +4558,7 @@ dependencies = [ "serde_json", "tauri-utils", "thiserror", - "uuid 1.2.2", + "uuid 1.3.0", "webview2-com", "windows 0.39.0", ] @@ -4625,7 +4575,7 @@ dependencies = [ "raw-window-handle", "tauri-runtime", "tauri-utils", - "uuid 1.2.2", + "uuid 1.3.0", "webkit2gtk", "webview2-com", "windows 0.39.0", @@ -4665,12 +4615,12 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "libc", "redox_syscall", "remove_dir_all", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4686,9 +4636,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] @@ -4736,7 +4686,7 @@ checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4795,15 +4745,15 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.24.1" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" dependencies = [ "autocfg", - "bytes 1.3.0", + "bytes 1.4.0", "libc", "memchr", - "mio 0.8.5", + "mio", "num_cpus", "pin-project-lite", "socket2", @@ -4862,7 +4812,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ - "bytes 1.3.0", + "bytes 1.4.0", "futures-core", "futures-sink", "pin-project-lite", @@ -4872,13 +4822,30 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" + +[[package]] +name = "toml_edit" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b" +dependencies = [ + "indexmap", + "nom8", + "toml_datetime", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -4891,7 +4858,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4970,7 +4937,7 @@ checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" dependencies = [ "base64 0.13.1", "byteorder", - "bytes 1.3.0", + "bytes 1.4.0", "http", "httparse", "log", @@ -5018,14 +4985,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" dependencies = [ "tempfile", - "winapi 0.3.9", + "winapi", ] [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] name = "unicode-ident" @@ -5044,9 +5011,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" @@ -5114,9 +5081,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" dependencies = [ "getrandom 0.2.8", ] @@ -5183,7 +5150,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", - "winapi 0.3.9", + "winapi", "winapi-util", ] @@ -5221,7 +5188,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -5246,7 +5213,7 @@ version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -5281,6 +5248,19 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +[[package]] +name = "wasm-streams" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" version = "0.3.60" @@ -5414,12 +5394,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -5430,12 +5404,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -5448,7 +5416,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -5517,12 +5485,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_x86_64_msvc 0.42.1", ] [[package]] @@ -5533,9 +5501,9 @@ checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" [[package]] name = "windows_aarch64_msvc" @@ -5551,9 +5519,9 @@ checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" [[package]] name = "windows_i686_gnu" @@ -5569,9 +5537,9 @@ checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" [[package]] name = "windows_i686_msvc" @@ -5587,9 +5555,9 @@ checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" [[package]] name = "windows_x86_64_gnu" @@ -5605,15 +5573,15 @@ checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" [[package]] name = "windows_x86_64_msvc" @@ -5629,9 +5597,9 @@ checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "winreg" @@ -5639,7 +5607,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -5679,21 +5647,11 @@ dependencies = [ "windows-implement", ] -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "x11" -version = "2.20.1" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2638d5b9c17ac40575fb54bb461a4b1d2a8d1b4ffcc4ff237d254ec59ddeb82" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" dependencies = [ "libc", "pkg-config", @@ -5701,12 +5659,12 @@ dependencies = [ [[package]] name = "x11-dl" -version = "2.20.1" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1536d6965a5d4e573c7ef73a2c15ebcd0b2de3347bdf526c34c297c00ac40f0" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" dependencies = [ - "lazy_static", "libc", + "once_cell", "pkg-config", ] @@ -5730,17 +5688,11 @@ dependencies = [ "libc", ] -[[package]] -name = "xml-rs" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" - [[package]] name = "zbus" -version = "3.7.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379d587c0ccb632d1179cf44082653f682842f0535f0fdfaefffc34849cc855e" +checksum = "23eaeb1859a3cd5c5f780b101dfe626bf250a5f34873c3c0226d6d9f7a4d107c" dependencies = [ "async-broadcast", "async-executor", @@ -5768,7 +5720,7 @@ dependencies = [ "static_assertions", "tracing", "uds_windows", - "winapi 0.3.9", + "winapi", "zbus_macros", "zbus_names", "zvariant", @@ -5776,9 +5728,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.7.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66492a2e90c0df7190583eccb8424aa12eb7ff06edea415a4fff6688fae18cf8" +checksum = "e83c1c6d669caa4773ebe8cb2ebea2a8d0c6ea27fc6c5c8916c7308cbf1db3b1" dependencies = [ "proc-macro-crate", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index bb83a7be..46b0ee6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,4 +14,4 @@ thiserror = "1" edition = "2021" authors = [ "Tauri Programme within The Commons Conservancy" ] license = "Apache-2.0 OR MIT" -rust-version = "1.59" +rust-version = "1.64" diff --git a/README.md b/README.md index 215d2d1a..cc7541ae 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,15 @@ | [fs-extra](plugins/fs-extra) | File system methods that aren't included in the core API. | ✅ | ✅ | ✅ | ? | ? | | [fs-watch](plugins/fs-watch) | Watch the filesystem for changes. | ✅ | ✅ | ✅ | ? | ? | | [localhost](plugins/localhost) | Use a localhost server in production apps. | ✅ | ✅ | ✅ | ? | ? | -| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ? | ? | +| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ | | [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? | | [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ? | ? | +| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ? | ✅ | ? | ? | | [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ? | | [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ? | ? | | [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? | | [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? | -| [websocket](plugins/websocket) | | ✅ | ✅ | ✅ | ? | ? | +| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? | | [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ? | ? | + +_This repo and all plugins require a Rust version of at least **1.64**_ diff --git a/package.json b/package.json index be7cfb05..9ad65f84 100644 --- a/package.json +++ b/package.json @@ -11,13 +11,13 @@ }, "devDependencies": { "@rollup/plugin-node-resolve": "^15.0.1", - "@rollup/plugin-terser": "^0.3.0", + "@rollup/plugin-terser": "^0.4.0", "@rollup/plugin-typescript": "^11.0.0", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.46.1", "eslint": "^8.0.1", "eslint-config-prettier": "^8.5.0", - "eslint-config-standard-with-typescript": "^27.0.0", + "eslint-config-standard-with-typescript": "^34.0.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-n": "^15.0.0", "eslint-plugin-promise": "^6.0.0", diff --git a/plugins/authenticator/README.md b/plugins/authenticator/README.md index 884d81b9..0e700f6a 100644 --- a/plugins/authenticator/README.md +++ b/plugins/authenticator/README.md @@ -4,6 +4,8 @@ Use hardware security-keys in your Tauri App. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/authenticator/src/auth.rs b/plugins/authenticator/src/auth.rs index 3241ef72..d7508478 100644 --- a/plugins/authenticator/src/auth.rs +++ b/plugins/authenticator/src/auth.rs @@ -154,7 +154,7 @@ pub fn sign( let sig = encode_config(sign_data, URL_SAFE_NO_PAD); - println!("Sign result: {}", sig); + println!("Sign result: {sig}"); println!( "Key handle used: {}", encode_config(&handle_used, URL_SAFE_NO_PAD) @@ -173,10 +173,8 @@ pub fn sign( } fn format_client_data(application: &str, challenge: &str) -> (Vec, Vec, String) { - let d = format!( - r#"{{"challenge": "{}", "version": "U2F_V2", "appId": "{}"}}"#, - challenge, application - ); + let d = + format!(r#"{{"challenge": "{challenge}", "version": "U2F_V2", "appId": "{application}"}}"#); let mut challenge = Sha256::new(); challenge.update(d.as_bytes()); let chall_bytes = challenge.finalize().to_vec(); diff --git a/plugins/authenticator/src/u2f.rs b/plugins/authenticator/src/u2f.rs index 80eb9497..026917ca 100644 --- a/plugins/authenticator/src/u2f.rs +++ b/plugins/authenticator/src/u2f.rs @@ -16,7 +16,7 @@ pub fn make_challenge(app_id: &str, challenge_bytes: Vec) -> Challenge { let utc: DateTime = Utc::now(); Challenge { challenge: encode_config(challenge_bytes, URL_SAFE_NO_PAD), - timestamp: format!("{:?}", utc), + timestamp: format!("{utc:?}"), app_id: app_id.to_string(), } } diff --git a/plugins/autostart/README.md b/plugins/autostart/README.md index 78859423..419907c3 100644 --- a/plugins/autostart/README.md +++ b/plugins/autostart/README.md @@ -4,6 +4,8 @@ Automatically launch your application at startup. Supports Windows, Mac (via App ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/autostart/src/lib.rs b/plugins/autostart/src/lib.rs index 509e6b3f..91dcfa27 100644 --- a/plugins/autostart/src/lib.rs +++ b/plugins/autostart/src/lib.rs @@ -3,6 +3,7 @@ // SPDX-License-Identifier: MIT use auto_launch::{AutoLaunch, AutoLaunchBuilder}; +use log::info; use serde::{ser::Serializer, Serialize}; use tauri::{ command, @@ -98,7 +99,6 @@ pub fn init( .invoke_handler(tauri::generate_handler![enable, disable, is_enabled]) .setup(move |app| { let mut builder = AutoLaunchBuilder::new(); - builder.set_app_name(&app.package_info().name); if let Some(args) = args { builder.set_args(&args); @@ -110,7 +110,26 @@ pub fn init( #[cfg(windows)] builder.set_app_path(¤t_exe.display().to_string()); #[cfg(target_os = "macos")] - builder.set_app_path(¤t_exe.canonicalize()?.display().to_string()); + { + // on macOS, current_exe gives path to /Applications/Example.app/MacOS/Example + // but this results in seeing a Unix Executable in macOS login items + // It must be: /Applications/Example.app + // If it didn't find exactly a single occurance of .app, it will default to + // exe path to not break it. + let exe_path = current_exe.canonicalize()?.display().to_string(); + let parts: Vec<&str> = exe_path.split(".app/").collect(); + let app_path = if parts.len() == 2 { + format!( + "{}{}", + parts.get(0).unwrap().to_string(), + ".app" + ) + } else { + exe_path + }; + info!("auto_start path {}", &app_path); + builder.set_app_path(&app_path); + } #[cfg(target_os = "linux")] if let Some(appimage) = app .env() diff --git a/plugins/fs-extra/README.md b/plugins/fs-extra/README.md index 6ea6ea1c..98d311fe 100644 --- a/plugins/fs-extra/README.md +++ b/plugins/fs-extra/README.md @@ -4,6 +4,8 @@ Additional file system methods not included in the core API. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/fs-watch/Cargo.toml b/plugins/fs-watch/Cargo.toml index 89501ac8..f939dd2b 100644 --- a/plugins/fs-watch/Cargo.toml +++ b/plugins/fs-watch/Cargo.toml @@ -15,4 +15,5 @@ serde_json.workspace = true tauri.workspace = true log.workspace = true thiserror.workspace = true -notify = "4.0" \ No newline at end of file +notify = { version = "5" , features = ["serde"] } +notify-debouncer-mini = { version = "0.2.1" , features = ["serde"] } diff --git a/plugins/fs-watch/README.md b/plugins/fs-watch/README.md index 26ee5bfc..8162d1fe 100644 --- a/plugins/fs-watch/README.md +++ b/plugins/fs-watch/README.md @@ -4,6 +4,8 @@ Watch files and directories for changes using [notify](https://github.com/notify ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/fs-watch/guest-js/index.ts b/plugins/fs-watch/guest-js/index.ts index bb16c2c9..31d333b2 100644 --- a/plugins/fs-watch/guest-js/index.ts +++ b/plugins/fs-watch/guest-js/index.ts @@ -12,22 +12,31 @@ export interface DebouncedWatchOptions extends WatchOptions { delayMs?: number; } -export interface RawEvent { - path: string | null; - operation: number; - cookie: number | null; -} +export type RawEvent = { + type: RawEventKind; + paths: string[]; + attrs: unknown; +}; + +type RawEventKind = + | "any " + | { + access?: unknown; + } + | { + create?: unknown; + } + | { + modify?: unknown; + } + | { + remove?: unknown; + } + | "other"; export type DebouncedEvent = - | { type: "NoticeWrite"; payload: string } - | { type: "NoticeRemove"; payload: string } - | { type: "Create"; payload: string } - | { type: "Write"; payload: string } - | { type: "Chmod"; payload: string } - | { type: "Remove"; payload: string } - | { type: "Rename"; payload: string } - | { type: "Rescan"; payload: null } - | { type: "Error"; payload: { error: string; path: string | null } }; + | { kind: "any"; path: string } + | { kind: "AnyContinous"; path: string }; async function unwatch(id: number): Promise { await invoke("plugin:fs-watch|unwatch", { id }); diff --git a/plugins/fs-watch/src/lib.rs b/plugins/fs-watch/src/lib.rs index 790507b7..3ff8457b 100644 --- a/plugins/fs-watch/src/lib.rs +++ b/plugins/fs-watch/src/lib.rs @@ -1,7 +1,5 @@ -use notify::{ - raw_watcher, watcher, DebouncedEvent, Op, RawEvent, RecommendedWatcher, RecursiveMode, - Watcher as _, -}; +use notify::{Config, Event, RecommendedWatcher, RecursiveMode, Watcher}; +use notify_debouncer_mini::{new_debouncer, DebounceEventResult, Debouncer}; use serde::{ser::Serializer, Deserialize, Serialize}; use tauri::{ command, @@ -39,72 +37,33 @@ impl Serialize for Error { } #[derive(Default)] -struct WatcherCollection(Mutex)>>); +struct WatcherCollection(Mutex)>>); -#[derive(Clone, Serialize)] -struct RawEventWrapper { - path: Option, - operation: u32, - cookie: Option, +enum WatcherKind { + Debouncer(Debouncer), + Watcher(RecommendedWatcher), } -#[derive(Clone, Serialize)] -#[serde(tag = "type", content = "payload")] -enum DebouncedEventWrapper { - NoticeWrite(PathBuf), - NoticeRemove(PathBuf), - Create(PathBuf), - Write(PathBuf), - Chmod(PathBuf), - Remove(PathBuf), - Rename(PathBuf, PathBuf), - Rescan, - Error { - error: String, - path: Option, - }, -} - -impl From for DebouncedEventWrapper { - fn from(event: DebouncedEvent) -> Self { - match event { - DebouncedEvent::NoticeWrite(path) => Self::NoticeWrite(path), - DebouncedEvent::NoticeRemove(path) => Self::NoticeRemove(path), - DebouncedEvent::Create(path) => Self::Create(path), - DebouncedEvent::Write(path) => Self::Write(path), - DebouncedEvent::Chmod(path) => Self::Chmod(path), - DebouncedEvent::Remove(path) => Self::Remove(path), - DebouncedEvent::Rename(from, to) => Self::Rename(from, to), - DebouncedEvent::Rescan => Self::Rescan, - DebouncedEvent::Error(error, path) => Self::Error { - error: error.to_string(), - path, - }, - } - } -} - -fn watch_raw(window: Window, rx: Receiver, id: Id) { +fn watch_raw(window: Window, rx: Receiver>, id: Id) { spawn(move || { - let event_name = format!("watcher://raw-event/{}", id); + let event_name = format!("watcher://raw-event/{id}"); while let Ok(event) = rx.recv() { - let _ = window.emit( - &event_name, - RawEventWrapper { - path: event.path, - operation: event.op.unwrap_or_else(|_| Op::empty()).bits(), - cookie: event.cookie, - }, - ); + if let Ok(event) = event { + // TODO: Should errors be emitted too? + let _ = window.emit(&event_name, event); + } } }); } -fn watch_debounced(window: Window, rx: Receiver, id: Id) { +fn watch_debounced(window: Window, rx: Receiver, id: Id) { spawn(move || { - let event_name = format!("watcher://debounced-event/{}", id); + let event_name = format!("watcher://debounced-event/{id}"); while let Ok(event) = rx.recv() { - let _ = window.emit(&event_name, DebouncedEventWrapper::from(event)); + if let Ok(event) = event { + // TODO: Should errors be emitted too? + let _ = window.emit(&event_name, event); + } } }); } @@ -132,20 +91,21 @@ async fn watch( let watcher = if let Some(delay) = options.delay_ms { let (tx, rx) = channel(); - let mut watcher = watcher(tx, Duration::from_millis(delay))?; + let mut debouncer = new_debouncer(Duration::from_millis(delay), None, tx)?; + let watcher = debouncer.watcher(); for path in &paths { watcher.watch(path, mode)?; } watch_debounced(window, rx, id); - watcher + WatcherKind::Debouncer(debouncer) } else { let (tx, rx) = channel(); - let mut watcher = raw_watcher(tx)?; + let mut watcher = RecommendedWatcher::new(tx, Config::default())?; for path in &paths { watcher.watch(path, mode)?; } watch_raw(window, rx, id); - watcher + WatcherKind::Watcher(watcher) }; watchers.0.lock().unwrap().insert(id, (watcher, paths)); @@ -155,10 +115,19 @@ async fn watch( #[command] async fn unwatch(watchers: State<'_, WatcherCollection>, id: Id) -> Result<()> { - if let Some((mut watcher, paths)) = watchers.0.lock().unwrap().remove(&id) { - for path in paths { - watcher.unwatch(path)?; - } + if let Some((watcher, paths)) = watchers.0.lock().unwrap().remove(&id) { + match watcher { + WatcherKind::Debouncer(mut debouncer) => { + for path in paths { + debouncer.watcher().unwatch(&path)? + } + } + WatcherKind::Watcher(mut watcher) => { + for path in paths { + watcher.unwatch(&path)? + } + } + }; } Ok(()) } diff --git a/plugins/localhost/README.md b/plugins/localhost/README.md index 23b07577..50665f66 100644 --- a/plugins/localhost/README.md +++ b/plugins/localhost/README.md @@ -6,6 +6,8 @@ Expose your apps assets through a localhost server instead of the default custom ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/localhost/src/lib.rs b/plugins/localhost/src/lib.rs index b358956c..4a11a84e 100644 --- a/plugins/localhost/src/lib.rs +++ b/plugins/localhost/src/lib.rs @@ -62,8 +62,8 @@ impl Builder { .setup(move |app| { let asset_resolver = app.asset_resolver(); std::thread::spawn(move || { - let server = Server::http(&format!("localhost:{}", port)) - .expect("Unable to spawn server"); + let server = + Server::http(&format!("localhost:{port}")).expect("Unable to spawn server"); for req in server.incoming_requests() { let path = req .url() diff --git a/plugins/log/README.md b/plugins/log/README.md index f49c2c7b..fca43611 100644 --- a/plugins/log/README.md +++ b/plugins/log/README.md @@ -4,6 +4,8 @@ Configurable logging for your Tauri app. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index 70a140fd..3945c7d9 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -351,7 +351,7 @@ fn get_log_file_path( rotation_strategy: &RotationStrategy, max_file_size: u128, ) -> plugin::Result { - let path = dir.as_ref().join(format!("{}.log", app_name)); + let path = dir.as_ref().join(format!("{app_name}.log")); if path.exists() { let log_size = File::open(&path)?.metadata()?.len() as u128; diff --git a/plugins/persisted-scope/README.md b/plugins/persisted-scope/README.md index 43dd5909..26888b59 100644 --- a/plugins/persisted-scope/README.md +++ b/plugins/persisted-scope/README.md @@ -4,6 +4,8 @@ Save filesystem and asset scopes and restore them when the app is reopened. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/positioner/README.md b/plugins/positioner/README.md index 54332ddc..ebac8500 100644 --- a/plugins/positioner/README.md +++ b/plugins/positioner/README.md @@ -6,6 +6,8 @@ This plugin is a port of [electron-positioner](https://github.com/jenslind/elect ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/single-instance/README.md b/plugins/single-instance/README.md index 75d985e9..1efbba90 100644 --- a/plugins/single-instance/README.md +++ b/plugins/single-instance/README.md @@ -4,6 +4,8 @@ Ensure a single instance of your tauri app is running. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/single-instance/src/platform_impl/linux.rs b/plugins/single-instance/src/platform_impl/linux.rs index bfefcc66..513526d4 100644 --- a/plugins/single-instance/src/platform_impl/linux.rs +++ b/plugins/single-instance/src/platform_impl/linux.rs @@ -38,8 +38,8 @@ pub fn init(f: Box>) -> TauriPlugin { callback: f, app_handle: app.clone(), }; - let dbus_name = format!("org.{}.SingleInstance", id); - let dbus_path = format!("/org/{}/SingleInstance", id); + let dbus_name = format!("org.{id}.SingleInstance"); + let dbus_path = format!("/org/{id}/SingleInstance"); match ConnectionBuilder::session() .unwrap() diff --git a/plugins/single-instance/src/platform_impl/windows.rs b/plugins/single-instance/src/platform_impl/windows.rs index a4eadab4..5919d3e1 100644 --- a/plugins/single-instance/src/platform_impl/windows.rs +++ b/plugins/single-instance/src/platform_impl/windows.rs @@ -31,9 +31,9 @@ pub fn init(f: Box>) -> TauriPlugin { .setup(|app| { let id = &app.config().tauri.bundle.identifier; - let class_name = encode_wide(format!("{}-sic", id)); - let window_name = encode_wide(format!("{}-siw", id)); - let mutex_name = encode_wide(format!("{}-sim", id)); + let class_name = encode_wide(format!("{id}-sic")); + let window_name = encode_wide(format!("{id}-siw")); + let mutex_name = encode_wide(format!("{id}-sim")); let hmutex = unsafe { CreateMutexW(std::ptr::null(), true.into(), mutex_name.as_ptr()) }; @@ -113,10 +113,10 @@ unsafe extern "system" fn single_instance_window_proc( let cds_ptr = lparam as *const COPYDATASTRUCT; if (*cds_ptr).dwData == WMCOPYDATA_SINGLE_INSTANCE_DATA { let data = CStr::from_ptr((*cds_ptr).lpData as _).to_string_lossy(); - let mut s = data.split("|"); + let mut s = data.split('|'); let cwd = s.next().unwrap(); let args = s.into_iter().map(|s| s.to_string()).collect(); - callback(&app_handle, args, cwd.to_string()); + callback(app_handle, args, cwd.to_string()); } 1 } diff --git a/plugins/sql/README.md b/plugins/sql/README.md index 2b7c6f9b..7ec807b1 100644 --- a/plugins/sql/README.md +++ b/plugins/sql/README.md @@ -4,6 +4,8 @@ Interface with SQL databases through [sqlx](https://github.com/launchbadge/sqlx) ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -42,7 +44,7 @@ First you need to register the core plugin with Tauri: ```rust fn main() { tauri::Builder::default() - .plugin(tauri_plugin_sql::Builder::default()) + .plugin(tauri_plugin_sql::Builder::default().build()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/plugins/sql/src/plugin.rs b/plugins/sql/src/plugin.rs index 48d2e241..c33e81e6 100644 --- a/plugins/sql/src/plugin.rs +++ b/plugins/sql/src/plugin.rs @@ -10,7 +10,7 @@ use sqlx::{ migrate::{ MigrateDatabase, Migration as SqlxMigration, MigrationSource, MigrationType, Migrator, }, - Column, Pool, Row, TypeInfo, + Column, Pool, Row, TypeInfo, ValueRef, }; use tauri::{ command, @@ -44,6 +44,8 @@ pub enum Error { Migration(#[from] sqlx::migrate::MigrateError), #[error("database {0} not loaded")] DatabaseNotLoaded(String), + #[error("unsupported datatype: {0}")] + UnsupportedDatatype(String), } impl Serialize for Error { @@ -246,12 +248,16 @@ async fn select( for row in rows { let mut value = HashMap::default(); for (i, column) in row.columns().iter().enumerate() { - let info = column.type_info(); - let v = if info.is_null() { + let v = row.try_get_raw(i)?; + + let v = if v.is_null() { JsonValue::Null } else { - match info.name() { - "VARCHAR" | "STRING" | "TEXT" | "DATETIME" => { + // TODO: postgresql's JSON type + match v.type_info().name() { + "VARCHAR" | "STRING" | "TEXT" | "TINYTEXT" | "LONGTEXT" | "NVARCHAR" + | "BIGVARCHAR" | "CHAR" | "BIGCHAR" | "NCHAR" | "DATETIME" | "DATE" + | "TIME" | "YEAR" | "TIMESTAMP" => { if let Ok(s) = row.try_get(i) { JsonValue::String(s) } else { @@ -266,22 +272,25 @@ async fn select( JsonValue::Bool(x.to_lowercase() == "true") } } - "INT" | "NUMBER" | "INTEGER" | "BIGINT" | "INT8" => { + "INT" | "NUMBER" | "INTEGER" | "BIGINT" | "INT2" | "INT4" | "INT8" + | "NUMERIC" | "TINYINT" | "SMALLINT" | "MEDIUMINT" | "TINYINT UNSINGED" + | "SMALLINT UNSINGED" | "INT UNSINGED" | "MEDIUMINT UNSINGED" + | "BIGINT UNSINGED" => { if let Ok(n) = row.try_get::(i) { JsonValue::Number(n.into()) } else { JsonValue::Null } } - "REAL" => { + "REAL" | "FLOAT" | "DOUBLE" | "FLOAT4" | "FLOAT8" => { if let Ok(n) = row.try_get::(i) { JsonValue::from(n) } else { JsonValue::Null } } - // "JSON" => JsonValue::Object(row.get(i)), - "BLOB" => { + "BLOB" | "TINYBLOB" | "MEDIUMBLOB" | "LONGBLOB" | "BINARY" | "VARBINARY" + | "BYTEA" => { if let Ok(n) = row.try_get::, usize>(i) { JsonValue::Array( n.into_iter().map(|n| JsonValue::Number(n.into())).collect(), @@ -290,13 +299,16 @@ async fn select( JsonValue::Null } } - _ => JsonValue::Null, + _ => return Err(Error::UnsupportedDatatype(v.type_info().name().to_string())), } }; + value.insert(column.name().to_string(), v); } + values.push(value); } + Ok(values) } diff --git a/plugins/store/README.md b/plugins/store/README.md index 0e1eb29a..3c3f7c7e 100644 --- a/plugins/store/README.md +++ b/plugins/store/README.md @@ -4,6 +4,8 @@ Simple, persistent key-value store. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/stronghold/README.md b/plugins/stronghold/README.md index bc79b46c..2b5b2790 100644 --- a/plugins/stronghold/README.md +++ b/plugins/stronghold/README.md @@ -4,6 +4,8 @@ Store secrets and keys using the [IOTA Stronghold](https://github.com/iotaledger ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/upload/Cargo.toml b/plugins/upload/Cargo.toml index 26ec517e..985645d6 100644 --- a/plugins/upload/Cargo.toml +++ b/plugins/upload/Cargo.toml @@ -18,5 +18,5 @@ thiserror.workspace = true tokio = { version = "1", features = [ "fs" ] } tokio-util = { version = "0.7", features = [ "codec" ] } reqwest = { version = "0.11", features = [ "json", "stream" ] } -futures = "0.3" +futures-util = "0.3" read-progress-stream = "1.0.0" \ No newline at end of file diff --git a/plugins/upload/README.md b/plugins/upload/README.md index 1168a362..cd24a9d5 100644 --- a/plugins/upload/README.md +++ b/plugins/upload/README.md @@ -4,6 +4,8 @@ Upload files from disk to a remote server over HTTP. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/upload/guest-js/index.ts b/plugins/upload/guest-js/index.ts index 88f5202e..7b4a94c7 100644 --- a/plugins/upload/guest-js/index.ts +++ b/plugins/upload/guest-js/index.ts @@ -11,12 +11,12 @@ type ProgressHandler = (progress: number, total: number) => void; const handlers: Map = new Map(); let listening = false; -async function listenToUploadEventIfNeeded(): Promise { +async function listenToEventIfNeeded(event: string): Promise { if (listening) { return await Promise.resolve(); } return await appWindow - .listen("upload://progress", ({ payload }) => { + .listen(event, ({ payload }) => { const handler = handlers.get(payload.id); if (handler != null) { handler(payload.progress, payload.total); @@ -27,7 +27,7 @@ async function listenToUploadEventIfNeeded(): Promise { }); } -export default async function upload( +async function upload( url: string, filePath: string, progressHandler?: ProgressHandler, @@ -41,7 +41,7 @@ export default async function upload( handlers.set(id, progressHandler); } - await listenToUploadEventIfNeeded(); + await listenToEventIfNeeded("upload://progress"); await invoke("plugin:upload|upload", { id, @@ -50,3 +50,30 @@ export default async function upload( headers: headers ?? {}, }); } + +async function download( + url: string, + filePath: string, + progressHandler?: ProgressHandler, + headers?: Map +): Promise { + const ids = new Uint32Array(1); + window.crypto.getRandomValues(ids); + const id = ids[0]; + + if (progressHandler != null) { + handlers.set(id, progressHandler); + } + + await listenToEventIfNeeded("download://progress"); + + await invoke("plugin:upload|upload", { + id, + url, + filePath, + headers: headers ?? {}, + }); +} + +export default upload; +export { download, upload }; diff --git a/plugins/upload/src/lib.rs b/plugins/upload/src/lib.rs index a83a87ff..f57683c6 100644 --- a/plugins/upload/src/lib.rs +++ b/plugins/upload/src/lib.rs @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use futures::TryStreamExt; +use futures_util::TryStreamExt; use serde::{ser::Serializer, Serialize}; use tauri::{ command, plugin::{Builder as PluginBuilder, TauriPlugin}, Runtime, Window, }; -use tokio::fs::File; +use tokio::{fs::File, io::AsyncWriteExt}; use tokio_util::codec::{BytesCodec, FramedRead}; use read_progress_stream::ReadProgressStream; @@ -24,6 +24,8 @@ pub enum Error { Io(#[from] std::io::Error), #[error(transparent)] Request(#[from] reqwest::Error), + #[error("{0}")] + ContentLength(String), } impl Serialize for Error { @@ -42,6 +44,46 @@ struct ProgressPayload { total: u64, } +#[command] +async fn download( + window: Window, + id: u32, + url: &str, + file_path: &str, + headers: HashMap, +) -> Result { + let client = reqwest::Client::new(); + + let mut request = client.get(url); + // Loop trought the headers keys and values + // and add them to the request object. + for (key, value) in headers { + request = request.header(&key, value); + } + + let response = request.send().await?; + let total = response.content_length().ok_or_else(|| { + Error::ContentLength(format!("Failed to get content length from '{}'", url)) + })?; + + let mut file = File::create(file_path).await?; + let mut stream = response.bytes_stream(); + + while let Some(chunk) = stream.try_next().await? { + file.write_all(&chunk).await?; + let _ = window.emit( + "download://progress", + ProgressPayload { + id, + progress: chunk.len() as u64, + total, + }, + ); + } + + Ok(id) +} + #[command] async fn upload( window: Window, @@ -88,6 +130,6 @@ fn file_to_body(id: u32, window: Window, file: File) -> reqwest:: pub fn init() -> TauriPlugin { PluginBuilder::new("upload") - .invoke_handler(tauri::generate_handler![upload]) + .invoke_handler(tauri::generate_handler![download, upload]) .build() } diff --git a/plugins/websocket/README.md b/plugins/websocket/README.md index 954a650f..96c5c324 100644 --- a/plugins/websocket/README.md +++ b/plugins/websocket/README.md @@ -4,6 +4,8 @@ ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) diff --git a/plugins/window-state/Cargo.toml b/plugins/window-state/Cargo.toml index 00d15f97..16535398 100644 --- a/plugins/window-state/Cargo.toml +++ b/plugins/window-state/Cargo.toml @@ -15,4 +15,5 @@ serde_json.workspace = true tauri.workspace = true log.workspace = true thiserror.workspace = true -bincode = "1.3" \ No newline at end of file +bincode = "1.3" +bitflags = "1" \ No newline at end of file diff --git a/plugins/window-state/README.md b/plugins/window-state/README.md index de309e73..303d54a5 100644 --- a/plugins/window-state/README.md +++ b/plugins/window-state/README.md @@ -1,9 +1,11 @@ ![plugin-window-state](banner.png) -Save window positions and sizse and restore them when the app is reopened. +Save window positions and sizes and restore them when the app is reopened. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -39,19 +41,19 @@ Afterwards all windows will remember their state when the app is being closed an Optionally you can also tell the plugin to save the state of all open window to disk my using the `save_window_state()` method exposed by the `AppHandleExt` trait: ```rust -use tauri_plugin_window_state::AppHandleExt; +use tauri_plugin_window_state::{AppHandleExt, StateFlags}; // `tauri::AppHandle` now has the following additional method -app.save_window_state(); // will save the state of all open windows to disk +app.save_window_state(StateFlags::all()); // will save the state of all open windows to disk ``` To manually restore a windows state from disk you can call the `restore_state()` method exposed by the `WindowExt` trait: ```rust -use tauri_plugin_window_state::{WindowExt, ShowMode}; +use tauri_plugin_window_state::{WindowExt, StateFlags}; // all `Window` types now have the following additional method -window.restore_state(ShowMode::LastSaved); // will restore the windows state from disk +window.restore_state(StateFlags::all()); // will restore the windows state from disk ``` ## Contributing diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index 05157317..2c82c1a3 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use bitflags::bitflags; use serde::{Deserialize, Serialize}; use tauri::{ plugin::{Builder as PluginBuilder, TauriPlugin}, @@ -30,27 +31,27 @@ pub enum Error { Bincode(#[from] Box), } -/// Defines how the window visibility should be restored. -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum ShowMode { - /// The window will always be shown, regardless of what the last stored state was. - Always, - /// The window will be automatically shown if the last stored state for visibility was `true`. - LastSaved, - /// The window will not be automatically shown by this plugin. - Never, +pub type Result = std::result::Result; + +bitflags! { + pub struct StateFlags: u32 { + const SIZE = 1 << 0; + const POSITION = 1 << 1; + const MAXIMIZED = 1 << 2; + const VISIBLE = 1 << 3; + const DECORATIONS = 1 << 4; + const FULLSCREEN = 1 << 5; + } } -impl Default for ShowMode { +impl Default for StateFlags { fn default() -> Self { - Self::LastSaved + Self::all() } } -pub type Result = std::result::Result; - #[derive(Debug, Default, Deserialize, Serialize)] -struct WindowMetadata { +struct WindowState { width: f64, height: f64, x: i32, @@ -61,17 +62,23 @@ struct WindowMetadata { fullscreen: bool, } -struct WindowStateCache(Arc>>); +struct WindowStateCache(Arc>>); pub trait AppHandleExt { - fn save_window_state(&self) -> Result<()>; + fn save_window_state(&self, flags: StateFlags) -> Result<()>; } impl AppHandleExt for tauri::AppHandle { - fn save_window_state(&self) -> Result<()> { + fn save_window_state(&self, flags: StateFlags) -> Result<()> { if let Some(app_dir) = self.path_resolver().app_config_dir() { let state_path = app_dir.join(STATE_FILENAME); let cache = self.state::(); - let state = cache.0.lock().unwrap(); + let mut state = cache.0.lock().unwrap(); + for (label, s) in state.iter_mut() { + if let Some(window) = self.get_window(label) { + window.update_state(s, flags)?; + } + } + create_dir_all(&app_dir) .map_err(Error::Io) .and_then(|_| File::create(state_path).map_err(Into::into)) @@ -86,68 +93,146 @@ impl AppHandleExt for tauri::AppHandle { } pub trait WindowExt { - fn restore_state(&self, show_mode: ShowMode) -> tauri::Result<()>; + fn restore_state(&self, flags: StateFlags) -> tauri::Result<()>; } impl WindowExt for Window { - fn restore_state(&self, show_mode: ShowMode) -> tauri::Result<()> { + fn restore_state(&self, flags: StateFlags) -> tauri::Result<()> { let cache = self.state::(); let mut c = cache.0.lock().unwrap(); let mut should_show = true; + if let Some(state) = c.get(self.label()) { - self.set_decorations(state.decorated)?; - - self.set_size(LogicalSize { - width: state.width, - height: state.height, - })?; - - // restore position to saved value if saved monitor exists - // otherwise, let the OS decide where to place the window - for m in self.available_monitors()? { - if m.contains((state.x, state.y).into()) { - self.set_position(PhysicalPosition { - x: state.x, - y: state.y, - })?; + if flags.contains(StateFlags::DECORATIONS) { + self.set_decorations(state.decorated)?; + } + + if flags.contains(StateFlags::SIZE) { + self.set_size(LogicalSize { + width: state.width, + height: state.height, + })?; + } + + if flags.contains(StateFlags::POSITION) { + // restore position to saved value if saved monitor exists + // otherwise, let the OS decide where to place the window + for m in self.available_monitors()? { + if m.contains((state.x, state.y).into()) { + self.set_position(PhysicalPosition { + x: state.x, + y: state.y, + })?; + } } } - if state.maximized { + if flags.contains(StateFlags::MAXIMIZED) && state.maximized { self.maximize()?; } - self.set_fullscreen(state.fullscreen)?; + + if flags.contains(StateFlags::FULLSCREEN) { + self.set_fullscreen(state.fullscreen)?; + } should_show = state.visible; } else { + let mut metadata = WindowState::default(); + + if flags.contains(StateFlags::SIZE) { + let scale_factor = self + .current_monitor()? + .map(|m| m.scale_factor()) + .unwrap_or(1.); + let size = self.inner_size()?.to_logical(scale_factor); + metadata.width = size.width; + metadata.height = size.height; + } + + if flags.contains(StateFlags::POSITION) { + let pos = self.outer_position()?; + metadata.x = pos.x; + metadata.y = pos.y; + } + + if flags.contains(StateFlags::MAXIMIZED) { + metadata.maximized = self.is_maximized()?; + } + + if flags.contains(StateFlags::VISIBLE) { + metadata.visible = self.is_visible()?; + } + + if flags.contains(StateFlags::DECORATIONS) { + metadata.visible = self.is_visible()?; + } + + if flags.contains(StateFlags::FULLSCREEN) { + metadata.fullscreen = self.is_fullscreen()?; + } + + c.insert(self.label().into(), metadata); + } + + if flags.contains(StateFlags::VISIBLE) && should_show { + self.show()?; + self.set_focus()?; + } + + Ok(()) + } +} + +trait WindowExtInternal { + fn update_state(&self, state: &mut WindowState, flags: StateFlags) -> tauri::Result<()>; +} + +impl WindowExtInternal for Window { + fn update_state(&self, state: &mut WindowState, flags: StateFlags) -> tauri::Result<()> { + let is_maximized = match flags.intersects(StateFlags::MAXIMIZED | StateFlags::SIZE) { + true => self.is_maximized()?, + false => false, + }; + + if flags.contains(StateFlags::MAXIMIZED) { + state.maximized = is_maximized; + } + + if flags.contains(StateFlags::FULLSCREEN) { + state.fullscreen = self.is_fullscreen()?; + } + + if flags.contains(StateFlags::DECORATIONS) { + state.decorated = self.is_decorated()?; + } + + if flags.contains(StateFlags::VISIBLE) { + state.visible = self.is_visible()?; + } + + if flags.contains(StateFlags::SIZE) { let scale_factor = self .current_monitor()? .map(|m| m.scale_factor()) .unwrap_or(1.); - let LogicalSize { width, height } = self.inner_size()?.to_logical(scale_factor); - let PhysicalPosition { x, y } = self.outer_position()?; - let maximized = self.is_maximized().unwrap_or(false); - let visible = self.is_visible().unwrap_or(true); - let decorated = self.is_decorated().unwrap_or(true); - let fullscreen = self.is_fullscreen().unwrap_or(false); - c.insert( - self.label().into(), - WindowMetadata { - width, - height, - x, - y, - maximized, - visible, - decorated, - fullscreen, - }, - ); + let size = self.inner_size()?.to_logical(scale_factor); + + // It doesn't make sense to save a self with 0 height or width + if size.width > 0. && size.height > 0. && !is_maximized { + state.width = size.width; + state.height = size.height; + } } - if show_mode == ShowMode::Always || (show_mode == ShowMode::LastSaved && should_show) { - self.show()?; - self.set_focus()?; + if flags.contains(StateFlags::POSITION) { + let position = self.inner_position()?; + if let Ok(Some(monitor)) = self.current_monitor() { + // save only window positions that are inside the current monitor + if monitor.contains(position) && !is_maximized { + state.x = position.x; + state.y = position.y; + } + } } Ok(()) @@ -156,17 +241,15 @@ impl WindowExt for Window { #[derive(Default)] pub struct Builder { - show_mode: ShowMode, denylist: HashSet, skip_initial_state: HashSet, + state_flags: StateFlags, } impl Builder { - /// Sets how the window visibility should be restored. - /// - /// The default is [`ShowMode::LastSaved`] - pub fn with_show_mode(mut self, show_mode: ShowMode) -> Self { - self.show_mode = show_mode; + /// Sets the state flags to control what state gets restored and saved. + pub fn with_state_flags(mut self, flags: StateFlags) -> Self { + self.state_flags = flags; self } @@ -184,9 +267,10 @@ impl Builder { } pub fn build(self) -> TauriPlugin { + let flags = self.state_flags; PluginBuilder::new("window-state") .setup(|app| { - let cache: Arc>> = if let Some(app_dir) = + let cache: Arc>> = if let Some(app_dir) = app.path_resolver().app_config_dir() { let state_path = app_dir.join(STATE_FILENAME); @@ -212,67 +296,26 @@ impl Builder { } if !self.skip_initial_state.contains(window.label()) { - let _ = window.restore_state(self.show_mode); + let _ = window.restore_state(self.state_flags); } let cache = window.state::(); let cache = cache.0.clone(); let label = window.label().to_string(); let window_clone = window.clone(); - window.on_window_event(move |e| match e { - WindowEvent::Moved(position) => { - let mut c = cache.lock().unwrap(); - if let Some(state) = c.get_mut(&label) { - let is_maximized = window_clone.is_maximized().unwrap_or(false); - state.maximized = is_maximized; - - if let Some(monitor) = window_clone.current_monitor().unwrap() { - let monitor_position = monitor.position(); - // save only window positions that are inside the current monitor - if position.x > monitor_position.x - && position.y > monitor_position.y - && !is_maximized - { - state.x = position.x; - state.y = position.y; - }; - }; - } - } - WindowEvent::Resized(size) => { - let scale_factor = window_clone - .current_monitor() - .ok() - .map(|m| m.map(|m| m.scale_factor()).unwrap_or(1.)) - .unwrap_or(1.); - let size = size.to_logical(scale_factor); - let mut c = cache.lock().unwrap(); - if let Some(state) = c.get_mut(&label) { - let is_maximized = window_clone.is_maximized().unwrap_or(false); - let is_fullscreen = window_clone.is_fullscreen().unwrap_or(false); - state.decorated = window_clone.is_decorated().unwrap_or(true); - state.maximized = is_maximized; - state.fullscreen = is_fullscreen; - - // It doesn't make sense to save a window with 0 height or width - if size.width > 0. && size.height > 0. && !is_maximized { - state.width = size.width; - state.height = size.height; - } - } - } - WindowEvent::CloseRequested { .. } => { + let flags = self.state_flags; + window.on_window_event(move |e| { + if let WindowEvent::CloseRequested { .. } = e { let mut c = cache.lock().unwrap(); if let Some(state) = c.get_mut(&label) { - state.visible = window_clone.is_visible().unwrap_or(true); + let _ = window_clone.update_state(state, flags); } } - _ => {} }); }) - .on_event(|app, event| { + .on_event(move |app, event| { if let RunEvent::Exit = event { - let _ = app.save_window_state(); + let _ = app.save_window_state(flags); } }) .build() diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a60ce9c8..a8fb00f2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,13 +5,13 @@ importers: .: specifiers: '@rollup/plugin-node-resolve': ^15.0.1 - '@rollup/plugin-terser': ^0.3.0 + '@rollup/plugin-terser': ^0.4.0 '@rollup/plugin-typescript': ^11.0.0 '@typescript-eslint/eslint-plugin': ^5.0.0 '@typescript-eslint/parser': ^5.46.1 eslint: ^8.0.1 eslint-config-prettier: ^8.5.0 - eslint-config-standard-with-typescript: ^27.0.0 + eslint-config-standard-with-typescript: ^34.0.0 eslint-plugin-import: ^2.25.2 eslint-plugin-n: ^15.0.0 eslint-plugin-promise: ^6.0.0 @@ -20,13 +20,13 @@ importers: typescript: ^4.9.4 devDependencies: '@rollup/plugin-node-resolve': 15.0.1_rollup@3.7.4 - '@rollup/plugin-terser': 0.3.0_rollup@3.7.4 + '@rollup/plugin-terser': 0.4.0_rollup@3.7.4 '@rollup/plugin-typescript': 11.0.0_fhibmf72xnv5tve6nwed265eae '@typescript-eslint/eslint-plugin': 5.46.1_imrg37k3svwu377c6q7gkarwmi '@typescript-eslint/parser': 5.46.1_ha6vam6werchizxrnqvarmz2zu eslint: 8.29.0 eslint-config-prettier: 8.5.0_eslint@8.29.0 - eslint-config-standard-with-typescript: 27.0.1_f7skxvi3ubnnb5utlsc5vholvm + eslint-config-standard-with-typescript: 34.0.0_f7skxvi3ubnnb5utlsc5vholvm eslint-plugin-import: 2.26.0_z7hwuz3w5sq2sbhy7d4iqrnsvq eslint-plugin-n: 15.6.0_eslint@8.29.0 eslint-plugin-promise: 6.1.1_eslint@8.29.0 @@ -479,8 +479,8 @@ packages: rollup: 3.7.4 dev: true - /@rollup/plugin-terser/0.3.0_rollup@3.7.4: - resolution: {integrity: sha512-mYTkNW9KjOscS/3QWU5LfOKsR3/fAAVDaqcAe2TZ7ng6pN46f+C7FOZbITuIW/neA+PhcjoKl7yMyB3XcmA4gw==} + /@rollup/plugin-terser/0.4.0_rollup@3.7.4: + resolution: {integrity: sha512-Ipcf3LPNerey1q9ZMjiaWHlNPEHNU/B5/uh9zXLltfEQ1lVSLLeZSgAtTPWGyw8Ip1guOeq+mDtdOlEj/wNxQw==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.x || ^3.x @@ -1218,8 +1218,8 @@ packages: eslint: 8.29.0 dev: true - /eslint-config-standard-with-typescript/27.0.1_f7skxvi3ubnnb5utlsc5vholvm: - resolution: {integrity: sha512-jJVyJldqqiCu3uSA/FP0x9jCDMG+Bbl73twTSnp0aysumJrz4iaVqLl+tGgmPrv0R829GVs117Nmn47M1DDDXA==} + /eslint-config-standard-with-typescript/34.0.0_f7skxvi3ubnnb5utlsc5vholvm: + resolution: {integrity: sha512-zhCsI4/A0rJ1ma8sf3RLXYc0gc7yPmdTWRVXMh9dtqeUx3yBQyALH0wosHhk1uQ9QyItynLdNOtcHKNw8G7lQw==} peerDependencies: '@typescript-eslint/eslint-plugin': ^5.0.0 eslint: ^8.0.1 diff --git a/renovate.json b/renovate.json index 4dac52b1..a7360f17 100644 --- a/renovate.json +++ b/renovate.json @@ -1,4 +1,12 @@ { "extends": ["config:base"], - "enabledManagers": ["cargo", "npm"] + "enabledManagers": ["cargo", "npm"], + "packageRules": [ + { + "description": "Disable node/pnpm version updates", + "matchPackageNames": ["node", "pnpm"], + "matchDepTypes": ["engines", "packageManager"], + "enabled": false + } + ] } diff --git a/shared/template/README.md b/shared/template/README.md index 0a059e4f..ed5545a2 100644 --- a/shared/template/README.md +++ b/shared/template/README.md @@ -4,6 +4,8 @@ ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)