pull/1147/head
Tahmin Ahmed 1 year ago
commit 0bc5af4fec

@ -8,8 +8,11 @@
".changes/dialog-can-create-directories.md", ".changes/dialog-can-create-directories.md",
".changes/dialog-linux-freeze.md", ".changes/dialog-linux-freeze.md",
".changes/dialog-main-thread.md", ".changes/dialog-main-thread.md",
".changes/dialog-path-return-mismatch.md",
".changes/enhance-fs-scope-type.md",
".changes/enhance-http-scope.md", ".changes/enhance-http-scope.md",
".changes/file-autogen-fix.md", ".changes/file-autogen-fix.md",
".changes/fix-autolaunch-macos.md",
".changes/fix-fs-watcher-basedir.md", ".changes/fix-fs-watcher-basedir.md",
".changes/fix-http-scope-url-match.md", ".changes/fix-http-scope-url-match.md",
".changes/fix-shutdown-timing.md", ".changes/fix-shutdown-timing.md",
@ -26,8 +29,11 @@
".changes/public-with-store.md", ".changes/public-with-store.md",
".changes/shell-fix-schema-command-property-name.md", ".changes/shell-fix-schema-command-property-name.md",
".changes/shell-shellexcute.md", ".changes/shell-shellexcute.md",
".changes/single-instance.macos.md",
".changes/tauri-beta-14.md",
".changes/tauri-beta-4.md", ".changes/tauri-beta-4.md",
".changes/tauri-beta-8.md", ".changes/tauri-beta-8.md",
".changes/tauri-beta-9.md" ".changes/tauri-beta-9.md",
".changes/window-state-json.md"
] ]
} }

@ -0,0 +1,5 @@
---
"single-instance": patch
---
Added implementation for MacOS.

@ -0,0 +1,5 @@
---
"fs": patch
---
Update for tauri 2.0.0-beta.14.

@ -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.

@ -0,0 +1,5 @@
---
"window-state": "patch"
---
**Breaking change**: Renamed `STATE_FILENAME` const to `DEFAULT_FILENAME`.

@ -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`.

755
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -10,9 +10,9 @@ resolver = "2"
[workspace.dependencies] [workspace.dependencies]
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
log = "0.4" log = "0.4"
tauri = "2.0.0-beta.12" tauri = "2.0.0-beta.14"
tauri-build = "2.0.0-beta.10" tauri-build = "2.0.0-beta.11"
tauri-plugin = "2.0.0-beta.10" tauri-plugin = "2.0.0-beta.11"
serde_json = "1" serde_json = "1"
thiserror = "1" thiserror = "1"
url = "2" url = "2"
@ -23,6 +23,7 @@ edition = "2021"
authors = ["Tauri Programme within The Commons Conservancy"] authors = ["Tauri Programme within The Commons Conservancy"]
license = "Apache-2.0 OR MIT" license = "Apache-2.0 OR MIT"
rust-version = "1.75" rust-version = "1.75"
repository = "https://github.com/tauri-apps/plugins-workspace"
# default to small, optimized release binaries # default to small, optimized release binaries
[profile.release] [profile.release]

@ -1,5 +1,13 @@
# Changelog # 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] ## \[2.0.0-beta.3]
### Dependencies ### Dependencies

@ -1,7 +1,7 @@
[package] [package]
name = "api" name = "api"
publish = false publish = false
version = "2.0.0-beta.3" version = "2.0.0-beta.4"
description = "An example Tauri Application showcasing the api" description = "An example Tauri Application showcasing the api"
edition = "2021" edition = "2021"
rust-version = { workspace = true } rust-version = { workspace = true }
@ -20,10 +20,10 @@ serde = { workspace = true }
tiny_http = "0.11" tiny_http = "0.11"
log = { workspace = true } log = { workspace = true }
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.3" } 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-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-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.4" }
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.3" } 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-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-os = { path = "../../../plugins/os", version = "2.0.0-beta.3" }
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.3" } tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.3" }

@ -36,7 +36,7 @@
}); });
} }
getCurrentWebview().onFileDropEvent((event) => { getCurrentWebview().onDragDropEvent((event) => {
onMessage(`File drop: ${JSON.stringify(event.payload)}`); onMessage(`File drop: ${JSON.stringify(event.payload)}`);
}); });

@ -25,6 +25,7 @@
"eslint-plugin-security": "2.1.0", "eslint-plugin-security": "2.1.0",
"prettier": "3.2.2", "prettier": "3.2.2",
"rollup": "4.9.6", "rollup": "4.9.6",
"tslib": "2.6.2",
"typescript": "5.3.3" "typescript": "5.3.3"
}, },
"resolutions": { "resolutions": {

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-authenticator" links = "tauri-plugin-authenticator"
[package.metadata.docs.rs] [package.metadata.docs.rs]
@ -26,7 +27,7 @@ thiserror = { workspace = true }
authenticator = "0.3.1" authenticator = "0.3.1"
once_cell = "1" once_cell = "1"
sha2 = "0.10" sha2 = "0.10"
base64 = "0.21" base64 = "0.22"
chrono = "0.4" chrono = "0.4"
bytes = "1" bytes = "1"
byteorder = "1" byteorder = "1"

@ -1,5 +1,9 @@
# Changelog # 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] ## \[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. - [`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.

@ -1,11 +1,12 @@
[package] [package]
name = "tauri-plugin-autostart" name = "tauri-plugin-autostart"
version = "2.0.0-beta.3" version = "2.0.0-beta.4"
description = "Automatically launch your application at startup." description = "Automatically launch your application at startup."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-autostart" links = "tauri-plugin-autostart"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -6,6 +6,7 @@ edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-barcode-scanner" links = "tauri-plugin-barcode-scanner"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -5,6 +5,7 @@ description = "Prompt the user for biometric authentication on Android and iOS."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-biometric" links = "tauri-plugin-biometric"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -23,9 +23,6 @@
"README.md", "README.md",
"LICENSE" "LICENSE"
], ],
"devDependencies": {
"tslib": "2.6.0"
},
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.6" "@tauri-apps/api": "2.0.0-beta.6"
} }

@ -6,6 +6,7 @@ edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-cli" links = "tauri-plugin-cli"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -6,6 +6,7 @@ edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-clipboard-manager" links = "tauri-plugin-clipboard-manager"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-deep-link" links = "tauri-plugin-deep-link"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -1,5 +1,13 @@
# Changelog # 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] ## \[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. - [`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.

@ -1,11 +1,12 @@
[package] [package]
name = "tauri-plugin-dialog" 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." description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-dialog" links = "tauri-plugin-dialog"
[package.metadata.docs.rs] [package.metadata.docs.rs]
@ -22,11 +23,15 @@ serde_json = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
log = { workspace = true } log = { workspace = true }
thiserror = { 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] [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
glib = "0.16" 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] [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" raw-window-handle = "0.6"

@ -1,5 +1,10 @@
# Changelog # 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] ## \[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. - [`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.

@ -1,11 +1,12 @@
[package] [package]
name = "tauri-plugin-fs" name = "tauri-plugin-fs"
version = "2.0.0-beta.3" version = "2.0.0-beta.4"
description = "Access the file system." description = "Access the file system."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-fs" links = "tauri-plugin-fs"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -15,7 +15,7 @@ use tauri::{
ipc::ScopeObject, ipc::ScopeObject,
plugin::{Builder as PluginBuilder, TauriPlugin}, plugin::{Builder as PluginBuilder, TauriPlugin},
utils::acl::Value, utils::acl::Value,
AppHandle, FileDropEvent, Manager, RunEvent, Runtime, WindowEvent, AppHandle, DragDropEvent, Manager, RunEvent, Runtime, WindowEvent,
}; };
mod commands; mod commands;
@ -110,7 +110,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R, Option<config::Config>> {
.on_event(|app, event| { .on_event(|app, event| {
if let RunEvent::WindowEvent { if let RunEvent::WindowEvent {
label: _, label: _,
event: WindowEvent::FileDrop(FileDropEvent::Dropped { paths, position: _ }), event: WindowEvent::DragDrop(DragDropEvent::Dropped { paths, position: _ }),
.. ..
} = event } = event
{ {

@ -6,6 +6,7 @@ edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-global-shortcut" links = "tauri-plugin-global-shortcut"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -1,5 +1,11 @@
# Changelog # Changelog
## \[2.0.0-beta.4]
### Dependencies
- Upgraded to `fs@2.0.0-beta.4`
## \[2.0.0-beta.3] ## \[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. - [`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.

@ -1,11 +1,12 @@
[package] [package]
name = "tauri-plugin-http" name = "tauri-plugin-http"
version = "2.0.0-beta.3" version = "2.0.0-beta.4"
description = "Access an HTTP client written in Rust." description = "Access an HTTP client written in Rust."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-http" links = "tauri-plugin-http"
[package.metadata.docs.rs] [package.metadata.docs.rs]
@ -25,11 +26,11 @@ serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
thiserror = { 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" urlpattern = "0.2"
regex = "1" regex = "1"
http = "0.2" http = "1"
reqwest = { version = "0.11", default-features = false } reqwest = { version = "0.12", default-features = false }
url = { workspace = true } url = { workspace = true }
data-url = "0.3" data-url = "0.3"
@ -52,5 +53,5 @@ brotli = [ "reqwest/brotli" ]
deflate = ["reqwest/deflate"] deflate = ["reqwest/deflate"]
trust-dns = ["reqwest/trust-dns"] trust-dns = ["reqwest/trust-dns"]
socks = ["reqwest/socks"] socks = ["reqwest/socks"]
http3 = [ "reqwest/http3" ] http2 = ["reqwest/http2"]
unsafe-headers = [] unsafe-headers = []

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ] rustc-args = [ "--cfg", "docsrs" ]

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-log" links = "tauri-plugin-log"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -5,6 +5,7 @@ description = "Read and write NFC tags on Android and iOS."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-nfc" links = "tauri-plugin-nfc"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -23,9 +23,6 @@
"README.md", "README.md",
"LICENSE" "LICENSE"
], ],
"devDependencies": {
"tslib": "2.6.0"
},
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.6" "@tauri-apps/api": "2.0.0-beta.6"
} }

@ -6,6 +6,7 @@ edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-notification" links = "tauri-plugin-notification"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -6,6 +6,7 @@ edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-os" links = "tauri-plugin-os"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -1,5 +1,11 @@
# Changelog # Changelog
## \[2.0.0-beta.4]
### Dependencies
- Upgraded to `fs@2.0.0-beta.4`
## \[2.0.0-beta.3] ## \[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. - [`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.

@ -1,11 +1,12 @@
[package] [package]
name = "tauri-plugin-persisted-scope" 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." description = "Save filesystem and asset scopes and restore them when the app is reopened."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ] rustc-args = [ "--cfg", "docsrs" ]
@ -19,7 +20,7 @@ log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
aho-corasick = "1" aho-corasick = "1"
bincode = "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] [features]
protocol-asset = [ "tauri/protocol-asset" ] protocol-asset = [ "tauri/protocol-asset" ]

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-positioner" links = "tauri-plugin-positioner"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -6,6 +6,7 @@ edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-process" links = "tauri-plugin-process"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -6,6 +6,7 @@ edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-shell" links = "tauri-plugin-shell"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -1,5 +1,9 @@
# Changelog # 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] ## \[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. - [`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.

@ -1,11 +1,12 @@
[package] [package]
name = "tauri-plugin-single-instance" 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." description = "Ensure a single instance of your tauri app is running."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
exclude = [ "/examples" ] exclude = [ "/examples" ]
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -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"
}
}
}
}

@ -4,7 +4,7 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "tauri": "tauri"
}, },
"author": "", "author": "",
"license": "MIT", "license": "MIT",

@ -12,6 +12,7 @@ serde_json = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
tauri-plugin-single-instance = { path = "../../../" } tauri-plugin-single-instance = { path = "../../../" }
tauri-plugin-cli = { path = "../../../../cli" }
[build-dependencies] [build-dependencies]
tauri-build = { workspace = true } tauri-build = { workspace = true }

@ -9,6 +9,7 @@
fn main() { fn main() {
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_cli::init())
.plugin(tauri_plugin_single_instance::init(|app, argv, cwd| { .plugin(tauri_plugin_single_instance::init(|app, argv, cwd| {
println!("{}, {argv:?}, {cwd}", app.package_info().name); println!("{}, {argv:?}, {cwd}", app.package_info().name);
})) }))

@ -29,5 +29,17 @@
"icons/icon.icns", "icons/icon.icns",
"icons/icon.ico" "icons/icon.ico"
] ]
},
"plugins": {
"cli": {
"description": "Testing single-instance on MacOS",
"args": [
{
"name": "somearg",
"index": 1,
"takesValue": true
}
]
}
} }
} }

@ -4,13 +4,119 @@
#![cfg(target_os = "macos")] #![cfg(target_os = "macos")]
use std::{
io::{BufWriter, Error, ErrorKind, Read, Write},
os::unix::net::{UnixListener, UnixStream},
path::PathBuf,
};
use crate::SingleInstanceCallback; use crate::SingleInstanceCallback;
use tauri::{ use tauri::{
plugin::{self, TauriPlugin}, plugin::{self, TauriPlugin},
Manager, Runtime, AppHandle, Config, Manager, RunEvent, Runtime,
}; };
pub fn init<R: Runtime>(_f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
plugin::Builder::new("single-instance").build() pub fn init<R: Runtime>(cb: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
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<R: Runtime, M: Manager<R>>(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))
} }
pub fn destroy<R: Runtime, M: Manager<R>>(_manager: &M) {} fn socket_cleanup(socket: &PathBuf) {
let _ = std::fs::remove_file(socket);
}
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::<Vec<String>>().join("\0");
bf.write_all(args_joined.as_bytes())?;
bf.flush()?;
drop(bf);
Ok(())
}
fn listen_for_other_instances<A: Runtime>(
socket: &PathBuf,
app: AppHandle<A>,
mut cb: Box<SingleInstanceCallback<A>>,
) {
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<String> =
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
);
}
}
}

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-sql" links = "tauri-plugin-sql"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-store" links = "tauri-plugin-store"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-stronghold" links = "tauri-plugin-stronghold"
[package.metadata.docs.rs] [package.metadata.docs.rs]

@ -6,6 +6,7 @@ edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-updater" links = "tauri-plugin-updater"
[package.metadata.docs.rs] [package.metadata.docs.rs]
@ -21,25 +22,29 @@ serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tokio = "1" 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 } url = { workspace = true }
http = "0.2" http = "1"
dirs-next = "2" dirs-next = "2"
minisign-verify = "0.2" minisign-verify = "0.2"
time = { version = "0.3", features = ["parsing", "formatting"] } time = { version = "0.3", features = ["parsing", "formatting"] }
base64 = "0.21" base64 = "0.22"
percent-encoding = "2"
semver = { version = "1", features = ["serde"] } semver = { version = "1", features = ["serde"] }
futures-util = "0.3" futures-util = "0.3"
tempfile = "3" tempfile = "3"
zip = "0.6" zip = "0.6"
tar = "0.4"
[target."cfg(target_os = \"windows\")".dependencies] [target."cfg(target_os = \"windows\")".dependencies]
zip = { version = "0.6", default-features = false } windows-sys = { version = "0.52.0", features = [
windows-sys = { version = "0.52.0", features = [ "Win32_Foundation", "Win32_UI_WindowsAndMessaging" ] } "Win32_Foundation",
"Win32_UI_WindowsAndMessaging",
] }
[target."cfg(any(target_os = \"macos\", target_os = \"linux\"))".dependencies] [target."cfg(any(target_os = \"macos\", target_os = \"linux\"))".dependencies]
tar = "0.4"
flate2 = "1.0.27" flate2 = "1.0.27"
[dev-dependencies] [dev-dependencies]

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-upload" links = "tauri-plugin-upload"
[package.metadata.docs.rs] [package.metadata.docs.rs]
@ -23,7 +24,10 @@ log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tokio = { version = "1", features = ["fs"] } tokio = { version = "1", features = ["fs"] }
tokio-util = { version = "0.7", features = ["codec"] } tokio-util = { version = "0.7", features = ["codec"] }
reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] } reqwest = { version = "0.12", default-features = false, features = [
"json",
"stream",
] }
futures-util = "0.3" futures-util = "0.3"
read-progress-stream = "1.0.0" read-progress-stream = "1.0.0"

@ -72,7 +72,7 @@ upload(
``` ```
```javascript ```javascript
import { download } from "tauri-plugin-upload-api"; import { download } from "@tauri-apps/plugin-upload";
download( download(
"https://example.com/file-download-link", "https://example.com/file-download-link",

@ -6,6 +6,7 @@ authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-websocket" links = "tauri-plugin-websocket"
exclude = ["/examples"] exclude = ["/examples"]

@ -1,5 +1,9 @@
# Changelog # 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] ## \[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. - [`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.

@ -1,11 +1,12 @@
[package] [package]
name = "tauri-plugin-window-state" 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." description = "Save window positions and sizes and restore them when the app is reopened."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-window-state" links = "tauri-plugin-window-state"
[package.metadata.docs.rs] [package.metadata.docs.rs]
@ -21,5 +22,4 @@ serde_json = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
log = { workspace = true } log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
bincode = "1.3"
bitflags = "2" bitflags = "2"

File diff suppressed because one or more lines are too long

@ -38,5 +38,11 @@ async function restoreState(
async function restoreStateCurrent(flags: StateFlags): Promise<void> { async function restoreStateCurrent(flags: StateFlags): Promise<void> {
return restoreState(getCurrent().label, flags); return restoreState(getCurrent().label, flags);
} }
/**
* Get the name of the file used to store window state.
*/
async function filename(): Promise<string> {
return invoke("plugin:window-state|filename");
}
export { restoreState, restoreStateCurrent, saveWindowState }; export { restoreState, restoreStateCurrent, saveWindowState, filename };

@ -32,3 +32,8 @@ pub async fn restore_state<R: Runtime>(
.map_err(|e| e.to_string())?; .map_err(|e| e.to_string())?;
Ok(()) Ok(())
} }
#[command]
pub fn filename<R: Runtime>(app: AppHandle<R>) -> String {
app.filename()
}

@ -23,13 +23,15 @@ use tauri::{
use std::{ use std::{
collections::{HashMap, HashSet}, collections::{HashMap, HashSet},
fs::{create_dir_all, File}, fs::{create_dir_all, File},
io::Write,
sync::{Arc, Mutex}, sync::{Arc, Mutex},
}; };
mod cmd; 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)] #[derive(Debug, thiserror::Error)]
pub enum Error { pub enum Error {
@ -38,7 +40,7 @@ pub enum Error {
#[error(transparent)] #[error(transparent)]
Tauri(#[from] tauri::Error), Tauri(#[from] tauri::Error),
#[error(transparent)] #[error(transparent)]
Bincode(#[from] Box<bincode::ErrorKind>), SerdeJson(#[from] serde_json::Error),
} }
pub type Result<T> = std::result::Result<T, Error>; pub type Result<T> = std::result::Result<T, Error>;
@ -61,6 +63,10 @@ impl Default for StateFlags {
} }
} }
struct PluginState {
filename: String,
}
#[derive(Debug, Deserialize, Serialize, PartialEq)] #[derive(Debug, Deserialize, Serialize, PartialEq)]
struct WindowState { struct WindowState {
width: f64, width: f64,
@ -99,12 +105,15 @@ struct WindowStateCache(Arc<Mutex<HashMap<String, WindowState>>>);
pub trait AppHandleExt { pub trait AppHandleExt {
/// Saves all open windows state to disk /// Saves all open windows state to disk
fn save_window_state(&self, flags: StateFlags) -> Result<()>; fn save_window_state(&self, flags: StateFlags) -> Result<()>;
/// Get the name of the file used to store window state.
fn filename(&self) -> String;
} }
impl<R: Runtime> AppHandleExt for tauri::AppHandle<R> { impl<R: Runtime> AppHandleExt for tauri::AppHandle<R> {
fn save_window_state(&self, flags: StateFlags) -> Result<()> { fn save_window_state(&self, flags: StateFlags) -> Result<()> {
if let Ok(app_dir) = self.path().app_config_dir() { if let Ok(app_dir) = self.path().app_config_dir() {
let state_path = app_dir.join(STATE_FILENAME); let plugin_state = self.state::<PluginState>();
let state_path = app_dir.join(&plugin_state.filename);
let cache = self.state::<WindowStateCache>(); let cache = self.state::<WindowStateCache>();
let mut state = cache.0.lock().unwrap(); let mut state = cache.0.lock().unwrap();
for (label, s) in state.iter_mut() { for (label, s) in state.iter_mut() {
@ -116,14 +125,15 @@ impl<R: Runtime> AppHandleExt for tauri::AppHandle<R> {
create_dir_all(&app_dir) create_dir_all(&app_dir)
.map_err(Error::Io) .map_err(Error::Io)
.and_then(|_| File::create(state_path).map_err(Into::into)) .and_then(|_| File::create(state_path).map_err(Into::into))
.and_then(|mut f| { .and_then(|mut f| serde_json::to_writer_pretty(&mut f, &*state).map_err(Into::into))
f.write_all(&bincode::serialize(&*state).map_err(Error::Bincode)?)
.map_err(Into::into)
})
} else { } else {
Ok(()) Ok(())
} }
} }
fn filename(&self) -> String {
self.state::<PluginState>().filename.clone()
}
} }
pub trait WindowExt { pub trait WindowExt {
@ -290,6 +300,7 @@ pub struct Builder {
denylist: HashSet<String>, denylist: HashSet<String>,
skip_initial_state: HashSet<String>, skip_initial_state: HashSet<String>,
state_flags: StateFlags, state_flags: StateFlags,
filename: Option<String>,
} }
impl Builder { impl Builder {
@ -303,6 +314,12 @@ impl Builder {
self self
} }
/// Sets a custom filename to use when saving and restoring window states from disk.
pub fn with_filename(mut self, filename: impl Into<String>) -> Self {
self.filename.replace(filename.into());
self
}
/// Sets a list of windows that shouldn't be tracked and managed by this plugin /// Sets a list of windows that shouldn't be tracked and managed by this plugin
/// for example splash screen windows. /// for example splash screen windows.
pub fn with_denylist(mut self, denylist: &[&str]) -> Self { pub fn with_denylist(mut self, denylist: &[&str]) -> Self {
@ -318,21 +335,25 @@ impl Builder {
pub fn build<R: Runtime>(self) -> TauriPlugin<R> { pub fn build<R: Runtime>(self) -> TauriPlugin<R> {
let flags = self.state_flags; let flags = self.state_flags;
let filename = self.filename.unwrap_or_else(|| DEFAULT_FILENAME.into());
PluginBuilder::new("window-state") PluginBuilder::new("window-state")
.invoke_handler(tauri::generate_handler![ .invoke_handler(tauri::generate_handler![
cmd::save_window_state, cmd::save_window_state,
cmd::restore_state cmd::restore_state,
cmd::filename
]) ])
.setup(|app, _api| { .setup(|app, _api| {
let cache: Arc<Mutex<HashMap<String, WindowState>>> = if let Ok(app_dir) = let cache: Arc<Mutex<HashMap<String, WindowState>>> =
app.path().app_config_dir() if let Ok(app_dir) = app.path().app_config_dir() {
{ let state_path = app_dir.join(&filename);
let state_path = app_dir.join(STATE_FILENAME);
if state_path.exists() { if state_path.exists() {
Arc::new(Mutex::new( Arc::new(Mutex::new(
std::fs::read(state_path) std::fs::read(state_path)
.map_err(Error::from) .map_err(Error::from)
.and_then(|state| bincode::deserialize(&state).map_err(Into::into)) .and_then(|state| {
serde_json::from_slice(&state).map_err(Into::into)
})
.unwrap_or_default(), .unwrap_or_default(),
)) ))
} else { } else {
@ -342,6 +363,7 @@ impl Builder {
Default::default() Default::default()
}; };
app.manage(WindowStateCache(cache)); app.manage(WindowStateCache(cache));
app.manage(PluginState { filename });
Ok(()) Ok(())
}) })
.on_window_ready(move |window| { .on_window_ready(move |window| {

@ -20,7 +20,7 @@ importers:
version: 0.4.4(rollup@4.9.6) version: 0.4.4(rollup@4.9.6)
'@rollup/plugin-typescript': '@rollup/plugin-typescript':
specifier: 11.1.6 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': '@typescript-eslint/eslint-plugin':
specifier: 6.20.0 specifier: 6.20.0
version: 6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.56.0)(typescript@5.3.3) version: 6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.56.0)(typescript@5.3.3)
@ -57,6 +57,9 @@ importers:
rollup: rollup:
specifier: 4.9.6 specifier: 4.9.6
version: 4.9.6 version: 4.9.6
tslib:
specifier: 2.6.2
version: 2.6.2
typescript: typescript:
specifier: 5.3.3 specifier: 5.3.3
version: 5.3.3 version: 5.3.3
@ -135,7 +138,7 @@ importers:
version: 4.2.8 version: 4.2.8
unocss: unocss:
specifier: ^0.58.0 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: vite:
specifier: ^5.0.12 specifier: ^5.0.12
version: 5.0.12 version: 5.0.12
@ -163,10 +166,6 @@ importers:
'@tauri-apps/api': '@tauri-apps/api':
specifier: 2.0.0-beta.6 specifier: 2.0.0-beta.6
version: 2.0.0-beta.6 version: 2.0.0-beta.6
devDependencies:
tslib:
specifier: 2.6.0
version: 2.6.0
plugins/cli: plugins/cli:
dependencies: dependencies:
@ -243,10 +242,6 @@ importers:
'@tauri-apps/api': '@tauri-apps/api':
specifier: 2.0.0-beta.6 specifier: 2.0.0-beta.6
version: 2.0.0-beta.6 version: 2.0.0-beta.6
devDependencies:
tslib:
specifier: 2.6.0
version: 2.6.0
plugins/notification: plugins/notification:
dependencies: dependencies:
@ -395,7 +390,7 @@ packages:
'@babel/traverse': 7.23.5 '@babel/traverse': 7.23.5
'@babel/types': 7.23.5 '@babel/types': 7.23.5
convert-source-map: 2.0.0 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 gensync: 1.0.0-beta.2
json5: 2.2.3 json5: 2.2.3
semver: 7.5.4 semver: 7.5.4
@ -665,7 +660,7 @@ packages:
'@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-split-export-declaration': 7.22.6
'@babel/parser': 7.23.5 '@babel/parser': 7.23.5
'@babel/types': 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 globals: 11.12.0
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -799,7 +794,7 @@ packages:
peerDependencies: peerDependencies:
mocha: ^10.0.0 mocha: ^10.0.0
dependencies: dependencies:
effection: 2.0.8 effection: 2.0.8(mocha@10.2.0)
mocha: 10.2.0 mocha: 10.2.0
dev: true dev: true
@ -1046,7 +1041,7 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies: dependencies:
ajv: 6.12.6 ajv: 6.12.6
debug: 4.3.4 debug: 4.3.4(supports-color@8.1.1)
espree: 9.6.1 espree: 9.6.1
globals: 13.23.0 globals: 13.23.0
ignore: 5.3.0 ignore: 5.3.0
@ -1068,7 +1063,7 @@ packages:
engines: {node: '>=10.10.0'} engines: {node: '>=10.10.0'}
dependencies: dependencies:
'@humanwhocodes/object-schema': 2.0.1 '@humanwhocodes/object-schema': 2.0.1
debug: 4.3.4 debug: 4.3.4(supports-color@8.1.1)
minimatch: 3.1.2 minimatch: 3.1.2
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -1109,7 +1104,7 @@ packages:
'@antfu/install-pkg': 0.1.1 '@antfu/install-pkg': 0.1.1
'@antfu/utils': 0.7.6 '@antfu/utils': 0.7.6
'@iconify/types': 2.0.0 '@iconify/types': 2.0.0
debug: 4.3.4 debug: 4.3.4(supports-color@8.1.1)
kolorist: 1.8.0 kolorist: 1.8.0
local-pkg: 0.4.3 local-pkg: 0.4.3
transitivePeerDependencies: transitivePeerDependencies:
@ -1206,7 +1201,7 @@ packages:
terser: 5.25.0 terser: 5.25.0
dev: true 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==} resolution: {integrity: sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
peerDependencies: peerDependencies:
@ -1222,23 +1217,10 @@ packages:
'@rollup/pluginutils': 5.1.0(rollup@4.9.6) '@rollup/pluginutils': 5.1.0(rollup@4.9.6)
resolve: 1.22.8 resolve: 1.22.8
rollup: 4.9.6 rollup: 4.9.6
tslib: 2.6.2
typescript: 5.3.3 typescript: 5.3.3
dev: true 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): /@rollup/pluginutils@5.1.0(rollup@4.9.6):
resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
@ -1463,7 +1445,7 @@ packages:
vite: ^5.0.0 vite: ^5.0.0
dependencies: dependencies:
'@sveltejs/vite-plugin-svelte': 3.0.1(svelte@4.2.8)(vite@5.0.12) '@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 svelte: 4.2.8
vite: 5.0.12 vite: 5.0.12
transitivePeerDependencies: transitivePeerDependencies:
@ -1478,7 +1460,7 @@ packages:
vite: ^5.0.0 vite: ^5.0.0
dependencies: dependencies:
'@sveltejs/vite-plugin-svelte-inspector': 2.0.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.12) '@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 deepmerge: 4.3.1
kleur: 4.1.5 kleur: 4.1.5
magic-string: 0.30.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/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/utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3)
'@typescript-eslint/visitor-keys': 6.20.0 '@typescript-eslint/visitor-keys': 6.20.0
debug: 4.3.4 debug: 4.3.4(supports-color@8.1.1)
eslint: 8.56.0 eslint: 8.56.0
graphemer: 1.4.0 graphemer: 1.4.0
ignore: 5.3.0 ignore: 5.3.0
@ -1678,7 +1660,7 @@ packages:
'@typescript-eslint/types': 6.20.0 '@typescript-eslint/types': 6.20.0
'@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3)
'@typescript-eslint/visitor-keys': 6.20.0 '@typescript-eslint/visitor-keys': 6.20.0
debug: 4.3.4 debug: 4.3.4(supports-color@8.1.1)
eslint: 8.56.0 eslint: 8.56.0
typescript: 5.3.3 typescript: 5.3.3
transitivePeerDependencies: transitivePeerDependencies:
@ -1705,7 +1687,7 @@ packages:
dependencies: dependencies:
'@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) '@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) '@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 eslint: 8.56.0
ts-api-utils: 1.0.3(typescript@5.3.3) ts-api-utils: 1.0.3(typescript@5.3.3)
typescript: 5.3.3 typescript: 5.3.3
@ -1729,7 +1711,7 @@ packages:
dependencies: dependencies:
'@typescript-eslint/types': 6.20.0 '@typescript-eslint/types': 6.20.0
'@typescript-eslint/visitor-keys': 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 globby: 11.1.0
is-glob: 4.0.3 is-glob: 4.0.3
minimatch: 9.0.3 minimatch: 9.0.3
@ -1771,7 +1753,7 @@ packages:
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
dev: true 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==} resolution: {integrity: sha512-df+tEFO5eKXjQOwSWQhS9IdjD0sfLHLtn8U09sEKR2Nmh5CvpwyBxmvLQgOCilPou7ehmyKfsyGRLZg7IMp+Ew==}
peerDependencies: peerDependencies:
vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0
@ -1781,19 +1763,19 @@ packages:
dependencies: dependencies:
'@unocss/core': 0.58.0 '@unocss/core': 0.58.0
'@unocss/reset': 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 vite: 5.0.12
transitivePeerDependencies: transitivePeerDependencies:
- rollup - rollup
dev: true dev: true
/@unocss/cli@0.58.0: /@unocss/cli@0.58.0(rollup@4.9.6):
resolution: {integrity: sha512-rhsrDBxAVueygMcAbMkbuvsHbBL2rG6N96LllYwHn16FLgOE3Sf4JW1/LlNjQje3BtwMMtbSCCAeu2SryFhzbw==} resolution: {integrity: sha512-rhsrDBxAVueygMcAbMkbuvsHbBL2rG6N96LllYwHn16FLgOE3Sf4JW1/LlNjQje3BtwMMtbSCCAeu2SryFhzbw==}
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
dependencies: dependencies:
'@ampproject/remapping': 2.2.1 '@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/config': 0.58.0
'@unocss/core': 0.58.0 '@unocss/core': 0.58.0
'@unocss/preset-uno': 0.58.0 '@unocss/preset-uno': 0.58.0
@ -1969,13 +1951,13 @@ packages:
'@unocss/core': 0.58.0 '@unocss/core': 0.58.0
dev: true 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==} resolution: {integrity: sha512-OCUOLMSOBEtXOEyBbAvMI3/xdR175BWRzmvV9Wc34ANZclEvCdVH8+WU725ibjY4VT0gVIuX68b13fhXdHV41A==}
peerDependencies: peerDependencies:
vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0
dependencies: dependencies:
'@ampproject/remapping': 2.2.1 '@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/config': 0.58.0
'@unocss/core': 0.58.0 '@unocss/core': 0.58.0
'@unocss/inspector': 0.58.0 '@unocss/inspector': 0.58.0
@ -2478,18 +2460,6 @@ packages:
ms: 2.1.3 ms: 2.1.3
dev: true 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): /debug@4.3.4(supports-color@8.1.1):
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
engines: {node: '>=6.0'} engines: {node: '>=6.0'}
@ -2590,18 +2560,6 @@ packages:
resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}
dev: true 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): /effection@2.0.8(mocha@10.2.0):
resolution: {integrity: sha512-/v7cbPIXGGylInQgHHjJutzqUn6VIfcP13hh2X0hXf04wwAlSI+lVjUBKpr5TX3+v9dXV/JLHO/pqQ9Cp1QAnQ==} resolution: {integrity: sha512-/v7cbPIXGGylInQgHHjJutzqUn6VIfcP13hh2X0hXf04wwAlSI+lVjUBKpr5TX3+v9dXV/JLHO/pqQ9Cp1QAnQ==}
dependencies: dependencies:
@ -2944,7 +2902,7 @@ packages:
ajv: 6.12.6 ajv: 6.12.6
chalk: 4.1.2 chalk: 4.1.2
cross-spawn: 7.0.3 cross-spawn: 7.0.3
debug: 4.3.4 debug: 4.3.4(supports-color@8.1.1)
doctrine: 3.0.0 doctrine: 3.0.0
escape-string-regexp: 4.0.0 escape-string-regexp: 4.0.0
eslint-scope: 7.2.2 eslint-scope: 7.2.2
@ -3866,7 +3824,7 @@ packages:
/micromark@2.11.4: /micromark@2.11.4:
resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==}
dependencies: dependencies:
debug: 4.3.4 debug: 4.3.4(supports-color@8.1.1)
parse-entities: 2.0.0 parse-entities: 2.0.0
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -4425,7 +4383,7 @@ packages:
/rxjs@7.8.1: /rxjs@7.8.1:
resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==}
dependencies: dependencies:
tslib: 2.6.0 tslib: 2.6.2
dev: true dev: true
/safe-array-concat@1.0.1: /safe-array-concat@1.0.1:
@ -4777,8 +4735,8 @@ packages:
strip-bom: 3.0.0 strip-bom: 3.0.0
dev: true dev: true
/tslib@2.6.0: /tslib@2.6.2:
resolution: {integrity: sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==} resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
dev: true dev: true
/type-check@0.4.0: /type-check@0.4.0:
@ -4893,7 +4851,7 @@ packages:
'@types/unist': 2.0.10 '@types/unist': 2.0.10
dev: true 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==} resolution: {integrity: sha512-MSPRHxBqWN+1AHGV+J5uUy4//e6ZBK6O+ISzD0qrXcCD/GNtxk1+lYjOK2ltkUiKX539+/KF91vNxzhhwEf+xA==}
engines: {node: '>=14'} engines: {node: '>=14'}
peerDependencies: peerDependencies:
@ -4905,8 +4863,8 @@ packages:
vite: vite:
optional: true optional: true
dependencies: dependencies:
'@unocss/astro': 0.58.0(vite@5.0.12) '@unocss/astro': 0.58.0(rollup@4.9.6)(vite@5.0.12)
'@unocss/cli': 0.58.0 '@unocss/cli': 0.58.0(rollup@4.9.6)
'@unocss/core': 0.58.0 '@unocss/core': 0.58.0
'@unocss/extractor-arbitrary-variants': 0.58.0 '@unocss/extractor-arbitrary-variants': 0.58.0
'@unocss/postcss': 0.58.0(postcss@8.4.32) '@unocss/postcss': 0.58.0(postcss@8.4.32)
@ -4924,7 +4882,7 @@ packages:
'@unocss/transformer-compile-class': 0.58.0 '@unocss/transformer-compile-class': 0.58.0
'@unocss/transformer-directives': 0.58.0 '@unocss/transformer-directives': 0.58.0
'@unocss/transformer-variant-group': 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 vite: 5.0.12
transitivePeerDependencies: transitivePeerDependencies:
- postcss - postcss

@ -4,6 +4,7 @@ version = "1.0.0"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
repository = { workspace = true }
links = "tauri-plugin-PLUGIN_NAME" links = "tauri-plugin-PLUGIN_NAME"
[package.metadata.docs.rs] [package.metadata.docs.rs]

Loading…
Cancel
Save