feat: add deep linking support

This commit is contained in:
Alice Carroll
2024-09-05 02:09:51 +03:00
parent c8c0c86c96
commit a643dc0956
7 changed files with 106 additions and 3 deletions

92
Cargo.lock generated
View File

@@ -379,6 +379,26 @@ dependencies = [
"memchr",
]
[[package]]
name = "const-random"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359"
dependencies = [
"const-random-macro",
]
[[package]]
name = "const-random-macro"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e"
dependencies = [
"getrandom 0.2.15",
"once_cell",
"tiny-keccak",
]
[[package]]
name = "convert_case"
version = "0.4.0"
@@ -492,6 +512,12 @@ version = "0.8.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
[[package]]
name = "crunchy"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "crypto-common"
version = "0.1.6"
@@ -657,6 +683,15 @@ dependencies = [
"syn 2.0.77",
]
[[package]]
name = "dlv-list"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f"
dependencies = [
"const-random",
]
[[package]]
name = "dpi"
version = "0.1.1"
@@ -1619,6 +1654,7 @@ dependencies = [
"serde_json",
"tauri",
"tauri-build",
"tauri-plugin-deep-link",
"tauri-plugin-fs",
]
@@ -2102,6 +2138,16 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "ordered-multimap"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79"
dependencies = [
"dlv-list",
"hashbrown 0.14.5",
]
[[package]]
name = "overload"
version = "0.1.1"
@@ -2646,6 +2692,17 @@ dependencies = [
"windows-registry",
]
[[package]]
name = "rust-ini"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e310ef0e1b6eeb79169a1171daf9abcb87a2e17c03bee2c4bb100b55c75409f"
dependencies = [
"cfg-if",
"ordered-multimap",
"trim-in-place",
]
[[package]]
name = "rustc-demangle"
version = "0.1.24"
@@ -3296,6 +3353,26 @@ dependencies = [
"walkdir",
]
[[package]]
name = "tauri-plugin-deep-link"
version = "2.0.0-rc.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "694ba1e772040fcc3728ad16744ae851059e09394e3bc33353d80d9a945cf974"
dependencies = [
"dunce",
"log",
"rust-ini",
"serde",
"serde_json",
"tauri",
"tauri-plugin",
"tauri-utils",
"thiserror",
"url",
"windows-registry",
"windows-result",
]
[[package]]
name = "tauri-plugin-fs"
version = "2.0.0-rc.1"
@@ -3483,6 +3560,15 @@ dependencies = [
"time-core",
]
[[package]]
name = "tiny-keccak"
version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237"
dependencies = [
"crunchy",
]
[[package]]
name = "tinyvec"
version = "1.8.0"
@@ -3694,6 +3780,12 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "trim-in-place"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc"
[[package]]
name = "try-lock"
version = "0.2.5"

View File

@@ -18,4 +18,5 @@ tauri-build = { version = "2.0.0-rc.6", features = [] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tauri = { version = "2.0.0-rc.6", features = [] }
tauri-plugin-deep-link = "2.0.0-rc"
tauri-plugin-fs = { version = "2.0.0-rc.1", features = ["watch"] }

View File

@@ -6,6 +6,7 @@
"main"
],
"permissions": [
"core:default"
"core:default",
"deep-link:default"
]
}
}

View File

@@ -1,6 +1,7 @@
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_deep_link::init())
.plugin(tauri_plugin_fs::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");

View File

@@ -6,7 +6,7 @@
"frontendDist": "../out",
"devUrl": "http://localhost:3000",
"beforeDevCommand": "bun dev",
"beforeBuildCommand": "bun build"
"beforeBuildCommand": "bun web:build"
},
"app": {
"windows": [
@@ -27,5 +27,12 @@
"active": true,
"targets": "all",
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"]
},
"plugins": {
"deep-link": {
"desktop": {
"schemes": ["learn-anything"]
}
}
}
}

BIN
bun.lockb

Binary file not shown.

View File

@@ -13,6 +13,7 @@
],
"dependencies": {
"@tauri-apps/cli": "^2.0.0-rc.6",
"@tauri-apps/plugin-deep-link": "^2.0.0-rc",
"@tauri-apps/plugin-fs": "^2.0.0-rc.2",
"jazz-nodejs": "^0.7.34",
"react-icons": "^5.3.0"