Skip to content

Commit

Permalink
Migrate tauri to v2 (beta)
Browse files Browse the repository at this point in the history
  • Loading branch information
OJFord committed Mar 15, 2024
1 parent 2dd5102 commit 28c34fe
Show file tree
Hide file tree
Showing 10 changed files with 1,848 additions and 580 deletions.
2,195 changes: 1,689 additions & 506 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion eml-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
"@spence1115/eslint-plugin-modules-newlines": "^1.0.1",
"@sveltejs/vite-plugin-svelte": "^2.5.3",
"@sveltestrap/sveltestrap": "^6.2.6",
"@tauri-apps/api": "^1.5.3",
"@tauri-apps/api": "^2.0.0-beta.5",
"@tauri-apps/cli": "^2.0.0-beta.9",
"@tauri-apps/plugin-dialog": "^2.0.0-beta.2",
"@tauri-apps/plugin-fs": "^2.0.0-beta.2",
"@tauri-apps/plugin-shell": "^2.0.0-beta.2",
"bootstrap-scss": "5.3.*",
"bootswatch": "^5.3.3",
"eslint": "^8.57.0",
Expand Down
8 changes: 6 additions & 2 deletions eml-client/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ edition = "2021"
build = "src/build.rs"

[build-dependencies]
tauri-build = { version = "^1.5.1", features = [] }
tauri-build = "^2.0.0-beta"

[dependencies]
ammonia = "^3.1.2"
anyhow = "^1.0"
notmuch-more = "^0.0.0"
tauri = { version = "^1.6.0", features = ["dialog-open", "dialog-save", "fs-write-file", "path-all", "shell-open"] }
serde_json = "^1.0"
tauri = "^2.0.0-beta"
tauri-plugin-dialog = "^2.0.0-beta.2"
tauri-plugin-fs = "^2.0.0-beta.2"
tauri-plugin-shell = "^2.0.0-beta.2"
thiserror = "^1.0.57"
whoami = "^1.5.1"

Expand Down
4 changes: 2 additions & 2 deletions eml-client/src-tauri/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pub enum AmailError {
Other(#[from] anyhow::Error),
}

impl From<AmailError> for tauri::InvokeError {
fn from(e: AmailError) -> tauri::InvokeError {
impl From<AmailError> for tauri::ipc::InvokeError {
fn from(e: AmailError) -> tauri::ipc::InvokeError {
Self::from(format!("{e}"))
}
}
3 changes: 3 additions & 0 deletions eml-client/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ fn main() {
);

tauri::Builder::default()
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_shell::init())
.manage(State { db, smtp })
.invoke_handler(tauri::generate_handler![
apply_tag,
Expand Down
104 changes: 43 additions & 61 deletions eml-client/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,50 @@
{
"package": {
"productName": "amail",
"version": "0.0.0"
"bundle": {
"active": true,
"targets": "all",
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
},
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
],
"resources": [],
"externalBin": [],
"copyright": "",
"category": "DeveloperTools",
"shortDescription": "",
"longDescription": "",
"macOS": {
"frameworks": [],
"minimumSystemVersion": "",
"exceptionDomain": "",
"signingIdentity": null,
"entitlements": null
},
"linux": {
"deb": {
"depends": []
}
}
},
"build": {
"beforeDevCommand": "DEBUG=true yarn --cwd=.. vite --clearScreen=false --port=42411",
"devPath": "http://localhost:42411",
"distDir": "../dist"
"frontendDist": "../dist",
"devUrl": "http://localhost:42411"
},
"tauri": {
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.ojford.amail.eml-client",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
],
"resources": [],
"externalBin": [],
"copyright": "",
"category": "DeveloperTools",
"shortDescription": "",
"longDescription": "",
"deb": {
"depends": []
},
"macOS": {
"frameworks": [],
"minimumSystemVersion": "",
"exceptionDomain": "",
"signingIdentity": null,
"entitlements": null
},
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"updater": {
"active": false
},
"allowlist": {
"dialog": {
"open": true,
"save": true
},
"fs": {
"writeFile": true,
"scope": ["$HOME/*"]
},
"path": {
"all": true
},
"shell": {
"open": true
}
"productName": "amail",
"version": "0.0.0",
"identifier": "com.ojford.amail.eml-client",
"plugins": {},
"app": {
"security": {
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'; connect-src ipc: http://ipc.localhost"
},
"windows": [
{
Expand All @@ -69,9 +54,6 @@
"resizable": true,
"fullscreen": false
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
}
]
}
}
2 changes: 1 addition & 1 deletion eml-client/src/api.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tauri from "@tauri-apps/api/tauri"
import * as tauri from "@tauri-apps/api/core"

export const applyTag = (query, tag) => tauri
.invoke("apply_tag", {
Expand Down
4 changes: 2 additions & 2 deletions eml-client/src/components/EmlAttachment.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import * as dialog from "@tauri-apps/api/dialog"
import * as fs from "@tauri-apps/api/fs"
import * as dialog from "@tauri-apps/plugin-dialog"
import * as fs from "@tauri-apps/plugin-fs"
import * as path from "@tauri-apps/api/path"
import {
FontAwesomeIcon,
Expand Down
2 changes: 1 addition & 1 deletion eml-client/src/components/EmlCompose.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Input,
Row,
} from "@sveltestrap/sveltestrap"
import * as dialog from "@tauri-apps/api/dialog"
import * as dialog from "@tauri-apps/plugin-dialog"
import * as api from "../api.js"
import EmlAddresses from "./EmlAddresses.svelte"
Expand Down
100 changes: 96 additions & 4 deletions eml-client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,102 @@
dependencies:
"@popperjs/core" "^2.11.8"

"@tauri-apps/api@^1.5.3":
version "1.5.3"
resolved "https://registry.yarnpkg.com/@tauri-apps/api/-/api-1.5.3.tgz#f7b362b1f30aadb0a8bbeb7ae111755c0ed33d73"
integrity sha512-zxnDjHHKjOsrIzZm6nO5Xapb/BxqUq1tc7cGkFXsFkGTsSWgCPH1D8mm0XS9weJY2OaR73I3k3S+b7eSzJDfqA==
"@tauri-apps/[email protected]":
version "2.0.0-beta.4"
resolved "https://registry.yarnpkg.com/@tauri-apps/api/-/api-2.0.0-beta.4.tgz#7688950f6e03f38b3bac73585f8f4cdd61be6aa6"
integrity sha512-Nxtj28NYUo5iwYkpYslxmOPkdI2WkELU2e3UH9nbJm9Ydki2CQwJVGQxx4EANtdZcMNsEsUzRqaDTvEUYH1l6w==

"@tauri-apps/api@^2.0.0-beta.5":
version "2.0.0-beta.5"
resolved "https://registry.yarnpkg.com/@tauri-apps/api/-/api-2.0.0-beta.5.tgz#0999501a1de039edba696c41f9f20b5e7a36fea9"
integrity sha512-lKRdV3adcNN8N+XLrnhGgWFrHsb7/I1VgweLjqTdOpEU7PKZcKvn1j3WOQGNNGSTD/RPSYBaGuXeE0Nk8eW3jw==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.0.0-beta.9.tgz#cf2b76416810cfd6ad4e2e3a52ef955877368d9e"
integrity sha512-7OthLcko0Z2FUpP6fqJQhjaVKmxgXW6tWOi+X67HDjP1Iixquhh/vP5JqdSi7gYK8bphcegPp9UETuAgHx7MtA==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.0.0-beta.9.tgz#b09a442a000bcb93b1976efbe1f3c733e411879f"
integrity sha512-Pwf6GBGZuV9y7PEtaLQlzS3x91hFPkA0Ro8vaUxTirYkFiJFTgoigXDHjMsjfjy+E/8oAAHr7Z0zeA6ijR5t1w==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.0.0-beta.9.tgz#e47cc04d591acee7c9b5055149fbbafe13612efd"
integrity sha512-daAXSac82vbYlwxbRT0DwFr4gP4v1XnHEwA72EeKRiKGw7GeHwzqoY/URVolBGY7sIBwwL+0qc1hqPde9dsm1g==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.0.0-beta.9.tgz#f85a4e835801b0cb10b663e89e2f4d38647e49b5"
integrity sha512-qHyACvFWIAbcl1C7cq64ciIXxaLOnZAgGXIEE48JLc5VeXkpYUF5sNLPjafidY/CxYoFoE453lh3dLc3DjNhuw==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.0.0-beta.9.tgz#0d72bae81427554de17697b29efb7f60dec8c794"
integrity sha512-DkrkxGKlQ1Sonvo4ltv6XqNxNuNxDyxfdZdvx3CEecKomMyFV6xTxp0/IcqF9fIRPL2Gp2PaPBWOuj+K8v95vw==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.0.0-beta.9.tgz#2122133edc32f434c277f7c1aedee8f51f0855e8"
integrity sha512-pY0DOrWAwSkIkhw7UdRK0VNVFLwP+yltqCoQ+Zji5Vwk/x98mBo0L2bF3nSOLhYPAaW41v3AIOIZY1sBYWSq/w==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.0.0-beta.9.tgz#08fbb1d7374d824f10179fdb9f2ee672ee2cd911"
integrity sha512-GYQy1bKWbrRyr4X2epbltq82k4Vhr9TzNFky/fflOyDXlMP36IqBOjQ6PEzvKTajNglciIdTPQfdoUKX4+PA/Q==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.0.0-beta.9.tgz#c698acd7217316b1e3e2b4e01827415953ae7a0e"
integrity sha512-0DTM06N/x57+vV/itT3l/34ZHjXIxPc315OWHE9MmY+vE37t/QFp9FNZDN/VdveZ1ZgmEn3rSQNchqcMaMdD3w==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.0.0-beta.9.tgz#98912f78eba0db34f92600a6522d6332122c73c0"
integrity sha512-HxrSAVjYRjPGm97lf18BvuoirgrE5uyvpALvGO98m8ZO9Y9CHklEadYi19nCVlr5d4mmP2GUbxCCx1Mc8XRAuA==

"@tauri-apps/[email protected]":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.0.0-beta.9.tgz#45c317db992617624044ef5d4e38a58338b2372f"
integrity sha512-abdCoiMjit9sSXziRCEf9VdEFbqqbEqg3ySOQmNAQTCsenr33iWjIoCMv/ThORtXKJ209yGyXlxBZY7Muxfi3A==

"@tauri-apps/cli@^2.0.0-beta.9":
version "2.0.0-beta.9"
resolved "https://registry.yarnpkg.com/@tauri-apps/cli/-/cli-2.0.0-beta.9.tgz#2261789a1fadb9aa24bd17f1274542527c4969fb"
integrity sha512-QYBuCAAdV10tGOTMWGLbt6d+2+Tq8K9bb4oiinChUV/JmCNe9SaTlG6VW1cCJDf+/F0AuGOTgjyBNw8DOiTrow==
optionalDependencies:
"@tauri-apps/cli-darwin-arm64" "2.0.0-beta.9"
"@tauri-apps/cli-darwin-x64" "2.0.0-beta.9"
"@tauri-apps/cli-linux-arm-gnueabihf" "2.0.0-beta.9"
"@tauri-apps/cli-linux-arm64-gnu" "2.0.0-beta.9"
"@tauri-apps/cli-linux-arm64-musl" "2.0.0-beta.9"
"@tauri-apps/cli-linux-x64-gnu" "2.0.0-beta.9"
"@tauri-apps/cli-linux-x64-musl" "2.0.0-beta.9"
"@tauri-apps/cli-win32-arm64-msvc" "2.0.0-beta.9"
"@tauri-apps/cli-win32-ia32-msvc" "2.0.0-beta.9"
"@tauri-apps/cli-win32-x64-msvc" "2.0.0-beta.9"

"@tauri-apps/plugin-dialog@^2.0.0-beta.2":
version "2.0.0-beta.2"
resolved "https://registry.yarnpkg.com/@tauri-apps/plugin-dialog/-/plugin-dialog-2.0.0-beta.2.tgz#64028104c51f018acfce96221a41f6389b9707b5"
integrity sha512-WugTn/8d5jYA0GL1JRIJgA1OSxG0h2V4PSZZzehgA3v7rPlIU6w9s2+dSRqj55aMj6hm3Az9YbQqC18nuaHkpw==
dependencies:
"@tauri-apps/api" "2.0.0-beta.4"

"@tauri-apps/plugin-fs@^2.0.0-beta.2":
version "2.0.0-beta.2"
resolved "https://registry.yarnpkg.com/@tauri-apps/plugin-fs/-/plugin-fs-2.0.0-beta.2.tgz#b2dfcd72422f778e4c32edcfad24c1e96299c760"
integrity sha512-jqeRBrm0h9QUoep5OzHx5R0vgFCYVAmZIy45jJpR7hHvnEgUwDU8JLUUVPvWniq6tUtxjwr1V/a0Hm9pE9V+NQ==
dependencies:
"@tauri-apps/api" "2.0.0-beta.4"

"@tauri-apps/plugin-shell@^2.0.0-beta.2":
version "2.0.0-beta.2"
resolved "https://registry.yarnpkg.com/@tauri-apps/plugin-shell/-/plugin-shell-2.0.0-beta.2.tgz#1eff697246140f17478527b0d947d76d3403a226"
integrity sha512-9rWsfN7Wt+EuWmpmNnK8bCs+04fzhEYrHtWyLIAYxb9diFdcJrEoctCP9YM2v+Uf8/y8qFC7VCbZ/9VQHANymQ==
dependencies:
"@tauri-apps/api" "2.0.0-beta.4"

"@types/estree@*", "@types/estree@^1.0.0", "@types/estree@^1.0.1":
version "1.0.5"
Expand Down

0 comments on commit 28c34fe

Please sign in to comment.