chore: Update tauri to stable
This commit is contained in:
parent
3745ed03ec
commit
b4b2d7f22f
6 changed files with 560 additions and 213 deletions
702
Cargo.lock
generated
702
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
41
Cargo.toml
41
Cargo.toml
|
|
@ -36,7 +36,7 @@ onelauncher_utils = { path = "./packages/utils" }
|
|||
|
||||
# # ============= TAURI ============= # #
|
||||
# tauri uses latest crates.io rc channel
|
||||
tauri = { version = "=2.0.0-rc.15", features = [
|
||||
tauri = { version = "2.0", features = [
|
||||
"rustls-tls",
|
||||
"tracing",
|
||||
"specta",
|
||||
|
|
@ -45,41 +45,24 @@ tauri = { version = "=2.0.0-rc.15", features = [
|
|||
] }
|
||||
|
||||
# tauri-build is the codegen utility for our tauri buildscript.
|
||||
tauri-build = { version = "=2.0.0-rc.12" }
|
||||
tauri-build = { version = "2.0" }
|
||||
# tauri-plugin-shell adds a bridge for opening urls and paths in the frontend.
|
||||
tauri-plugin-shell = { version = "=2.0.0-rc.3" }
|
||||
tauri-plugin-shell = { version = "2.0" }
|
||||
# tauri-plugin-window-state saves the window position and size to be restored.
|
||||
tauri-plugin-window-state = { version = "=2.0.0-rc.5" }
|
||||
tauri-plugin-window-state = { version = "2.0" }
|
||||
# tauri-plugin-single-instance ensures that only one instance of the app is running.
|
||||
tauri-plugin-single-instance = { version = "=2.0.0-rc.4" }
|
||||
tauri-plugin-single-instance = { version = "2.0" }
|
||||
# tauri-plugin-clipboard-manager adds a bridge for reading/writing to the clipboard.
|
||||
tauri-plugin-clipboard-manager = { version = "=2.0.0-rc.4" }
|
||||
tauri-plugin-clipboard-manager = { version = "2.0" }
|
||||
# tauri-plugin-updater allows for us to use it's functionality for in-app updates.
|
||||
tauri-plugin-updater = { version = "=2.0.0-rc.3" }
|
||||
tauri-plugin-updater = { version = "2.0" }
|
||||
# tauri-plugin-dialog adds a bridge for opening file manager and message dialogs.
|
||||
tauri-plugin-dialog = { version = "=2.0.0-rc.7" }
|
||||
tauri-plugin-dialog = { version = "2.0" }
|
||||
# tauri-plugin-deep-link adds a way to handle custom uri schemes (onelauncher://)
|
||||
tauri-plugin-deep-link = { version = "=2.0.0-rc.6" }
|
||||
tauri-plugin-deep-link = { version = "2.0" }
|
||||
|
||||
# # ============= CORE ============= # #
|
||||
# rspc is used as a faster and more intuitive replacement for tauri-specta
|
||||
# commands/apis that don't depend on tauri. rather than using the tauri
|
||||
# event and invoke apis for handling api calling, it creates a router which
|
||||
# we can easily use with tanstack solid query apis.
|
||||
# this means we don't have to redefine all our core apis as tauri commands.
|
||||
# features: "specta2" is for using the latest v2 rc of specta.
|
||||
# TODO: the api migration is blocked until rspc updates to a newer version of tauri v2.
|
||||
rspc = { version = "=0.2.0", features = [ "specta2", "tracing" ] }
|
||||
|
||||
# specta is used as a peer dependency for tauri-specta and rspc.
|
||||
# it generates rust code into other languages, in our case, typescript.
|
||||
# v2 is the latest/only version, and it is updated as a release candidate
|
||||
# on crates.io almost after every commit, so a git dep isn't necessary.
|
||||
# features: "derive" and "function" are core apis of specta we rely on.
|
||||
# the remaining features implements the specta::Type trait for their
|
||||
# respective dependencies of the same name. if we add a new dependency
|
||||
# and run into specta errors, adding the dependency as a feature will usually solve this.
|
||||
specta = { version = "=2.0.0-rc.20", features = [
|
||||
specta = { version = "2.0.0-rc.20", features = [
|
||||
"chrono",
|
||||
"uuid",
|
||||
"serde",
|
||||
|
|
@ -90,11 +73,9 @@ specta = { version = "=2.0.0-rc.20", features = [
|
|||
] }
|
||||
|
||||
# tauri-specta is the tauri adapter for specta.
|
||||
tauri-specta = { version = "=2.0.0-rc.20", features = [ "javascript", "typescript", "derive" ] }
|
||||
tauri-specta = { version = "2.0.0-rc.20", features = [ "javascript", "typescript", "derive" ] }
|
||||
# specta-typescript is the typescript adapter for specta.
|
||||
specta-typescript = { version = "=0.0.7" }
|
||||
# rspc-specta2 is the specta v2 (rc) adapter for rspc.
|
||||
rspc-tauri2 = { version = "=0.0.1" }
|
||||
# core utilities for minecraft and mod management with pulseflow apis
|
||||
interpulse = { version = "=1.2.0", features = [ "specta" ] }
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ macro_rules! collect_commands {
|
|||
get_provider_packages,
|
||||
get_all_provider_package_versions,
|
||||
get_provider_package_versions,
|
||||
get_provider_package_version,
|
||||
search_provider_packages,
|
||||
get_provider_authors,
|
||||
get_package_body,
|
||||
|
|
|
|||
|
|
@ -69,15 +69,6 @@ pub async fn get_provider_package_versions(
|
|||
Ok(provider.get_versions(versions).await?)
|
||||
}
|
||||
|
||||
#[specta::specta]
|
||||
#[tauri::command]
|
||||
pub async fn get_provider_package_version(
|
||||
provider: Providers,
|
||||
version: String,
|
||||
) -> Result<ManagedVersion, String> {
|
||||
Ok(provider.get_version("", &version).await?) // TODO
|
||||
}
|
||||
|
||||
#[derive(specta::Type, serde::Deserialize, serde::Serialize)]
|
||||
pub struct ProviderSearchQuery {
|
||||
query: Option<String>,
|
||||
|
|
|
|||
|
|
@ -176,15 +176,6 @@ impl Providers {
|
|||
})
|
||||
}
|
||||
|
||||
pub async fn get_version(&self, pkg_id: &str, version_id: &str) -> Result<ManagedVersion> {
|
||||
Ok(match self {
|
||||
Self::Modrinth => modrinth::get_version(version_id),
|
||||
Self::Curseforge => todo!(),
|
||||
}
|
||||
.await?
|
||||
.into())
|
||||
}
|
||||
|
||||
pub async fn get_authors(&self, author: &Author) -> Result<Vec<ManagedUser>> {
|
||||
Ok(match author {
|
||||
Author::Team { .. } => match self {
|
||||
|
|
|
|||
|
|
@ -510,14 +510,3 @@ pub async fn get_versions(versions: Vec<String>) -> Result<Vec<ModrinthVersion>>
|
|||
.await?,
|
||||
)?)
|
||||
}
|
||||
|
||||
pub async fn get_version(version_id: &str) -> Result<ModrinthVersion> {
|
||||
Ok(serde_json::from_slice(
|
||||
&fetch(
|
||||
format_url!("/version/{}", version_id).as_str(),
|
||||
None,
|
||||
&State::get().await?.fetch_semaphore,
|
||||
)
|
||||
.await?,
|
||||
)?)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue