Skip to content

Commit

Permalink
feat: TS migrated to Tauri V2
Browse files Browse the repository at this point in the history
Signed-off-by: Martichou <m@rtin.fyi>
  • Loading branch information
Martichou committed Jun 24, 2024
1 parent a3226fc commit a286591
Show file tree
Hide file tree
Showing 11 changed files with 256 additions and 72 deletions.
8 changes: 5 additions & 3 deletions app/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
},
"dependencies": {
"@martichou/core_lib": "link:../../core_lib",
"@tauri-apps/api": "1.5.6",
"tauri-plugin-autostart-api": "github:tauri-apps/tauri-plugin-autostart#v1",
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store#v1",
"@tauri-apps/api": "^2.0.0-beta.13",
"@tauri-apps/plugin-autostart": "2.0.0-beta.5",
"@tauri-apps/plugin-dialog": "2.0.0-beta.5",
"@tauri-apps/plugin-notification": "^2.0.0-beta.5",
"@tauri-apps/plugin-store": "^2.0.0-beta.5",
"vue": "3.4.27",
"vue_lib": "link:../common/vue_lib"
},
Expand Down
74 changes: 46 additions & 28 deletions app/main/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/main/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tauri-plugin-process = "2.0.0-beta"
tauri-plugin-notification = "2.0.0-beta"
tauri-plugin-single-instance = "2.0.0-beta"
tauri-plugin-store = "2.0.0-beta"
tauri-plugin-dialog = "2.0.0-beta"
time = { version = "0.3", features = ["formatting"] }
tokio = { version = "1.25", features = ["macros", "rt", "rt-multi-thread", "net", "sync", "time", "io-util"] }
tokio-util = { version = "0.7", features = ["rt"] }
Expand Down
13 changes: 12 additions & 1 deletion app/main/src-tauri/capabilities/migrated.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
"app:default",
"resources:default",
"menu:default",
"tray:default"
"tray:default",
"store:default",
"dialog:default",
"notification:default",
"store:allow-get",
"store:allow-has",
"store:allow-set",
"store:allow-save",
"autostart:allow-enable",
"autostart:allow-disable",
"autostart:allow-is-enabled",
"dialog:allow-open"
]
}
2 changes: 1 addition & 1 deletion app/main/src-tauri/gen/schemas/acl-manifests.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/main/src-tauri/gen/schemas/capabilities.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["path:default","event:default","window:default","app:default","resources:default","menu:default","tray:default"]}}
{"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["path:default","event:default","window:default","app:default","resources:default","menu:default","tray:default","store:default","dialog:default","notification:default","store:allow-get","store:allow-has","store:allow-set","store:allow-save","autostart:allow-enable","autostart:allow-disable","autostart:allow-is-enabled","dialog:allow-open"]}}
76 changes: 76 additions & 0 deletions app/main/src-tauri/gen/schemas/desktop-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,82 @@
"autostart:deny-is-enabled"
]
},
{
"type": "string",
"enum": [
"dialog:default"
]
},
{
"description": "dialog:allow-ask -> Enables the ask command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-ask"
]
},
{
"description": "dialog:allow-confirm -> Enables the confirm command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-confirm"
]
},
{
"description": "dialog:allow-message -> Enables the message command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-message"
]
},
{
"description": "dialog:allow-open -> Enables the open command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-open"
]
},
{
"description": "dialog:allow-save -> Enables the save command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-save"
]
},
{
"description": "dialog:deny-ask -> Denies the ask command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-ask"
]
},
{
"description": "dialog:deny-confirm -> Denies the confirm command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-confirm"
]
},
{
"description": "dialog:deny-message -> Denies the message command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-message"
]
},
{
"description": "dialog:deny-open -> Denies the open command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-open"
]
},
{
"description": "dialog:deny-save -> Denies the save command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-save"
]
},
{
"description": "event:default -> Default permissions for the plugin.",
"type": "string",
Expand Down
76 changes: 76 additions & 0 deletions app/main/src-tauri/gen/schemas/linux-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,82 @@
"autostart:deny-is-enabled"
]
},
{
"type": "string",
"enum": [
"dialog:default"
]
},
{
"description": "dialog:allow-ask -> Enables the ask command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-ask"
]
},
{
"description": "dialog:allow-confirm -> Enables the confirm command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-confirm"
]
},
{
"description": "dialog:allow-message -> Enables the message command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-message"
]
},
{
"description": "dialog:allow-open -> Enables the open command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-open"
]
},
{
"description": "dialog:allow-save -> Enables the save command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:allow-save"
]
},
{
"description": "dialog:deny-ask -> Denies the ask command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-ask"
]
},
{
"description": "dialog:deny-confirm -> Denies the confirm command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-confirm"
]
},
{
"description": "dialog:deny-message -> Denies the message command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-message"
]
},
{
"description": "dialog:deny-open -> Denies the open command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-open"
]
},
{
"description": "dialog:deny-save -> Denies the save command without any pre-configured scope.",
"type": "string",
"enum": [
"dialog:deny-save"
]
},
{
"description": "event:default -> Default permissions for the plugin.",
"type": "string",
Expand Down
1 change: 1 addition & 0 deletions app/main/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ async fn main() -> Result<(), anyhow::Error> {
println!("{}, {argv:?}, {cwd}", app.package_info().name);
}))
.plugin(tauri_plugin_store::Builder::default().build())
.plugin(tauri_plugin_dialog::init())
.invoke_handler(tauri::generate_handler![
cmds::change_download_path,
cmds::change_visibility,
Expand Down
Loading

0 comments on commit a286591

Please # to comment.