Skip to content

Commit

Permalink
feat: migrate tauri to v1.0.0-rc5 and bump wikit-core to rust edition…
Browse files Browse the repository at this point in the history
… 2021
  • Loading branch information
ikey4u committed Feb 19, 2022
1 parent 354d71b commit 973291e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,24 @@ Everything is done, open `Wikit Desktop` and start to lookup.

If you add, delete or change the wikit dictionary, remember to restart `Wikit Desktop`.

# Developement

Install tauri-cli

cargo install --git https://github.com/tauri-apps/tauri --tag cli.rs-v1.0.0-rc.6 tauri-cli

and check the version

cargo tauri --version

Start web server using

npm run dev

In a new terminal, build the app

cargo tauri dev

# Building

To build wikit command line
Expand Down
6 changes: 3 additions & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "wikit-core"
version = "0.1.0"
version = "0.2.0"
authors = ["ikey4u <pwnkeeper@gmail.com>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -22,7 +22,7 @@ clap = "2"
regex = "1"
anyhow = "1.0.38"
dirs = "3.0.2"
once_cell = "1.7.2"
once_cell = "1.9.0"
minilzo-rs = "0.6.0"
encoding_rs = "0.8.28"
chrono = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ build = "src/build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "1.0.0-beta.4" }
tauri-build = { git = "https://github.com/tauri-apps/tauri", tag = "tauri-build-v1.0.0-rc.3", features = [] }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { git = "https://github.com/tauri-apps/tauri/", rev = "411618f0def040fc412a93e28bcd868180e2c29e", features = ["api-all"] }
tauri = { git = "https://github.com/tauri-apps/tauri/", tag = "v1.0.0-rc.5", features = ["api-all"] }
reqwest = { version = "0.11", features = ["blocking", "json"] }
wikit-core = { path = "../../core" }
once_cell = "1.8.0"
once_cell = "1.9.0"
opener = "0.5.0"

[features]
Expand Down
8 changes: 4 additions & 4 deletions desktop/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::sync::Arc;
use wikit_core::config;
use wikit_core::wikit;
use wikit_core::wikit::WikitDictionary;
use tauri::{CustomMenuItem, Menu, MenuItem, Submenu, Event, Manager, WindowUrl, WindowBuilder};
use tauri::{CustomMenuItem, Menu, MenuItem, Submenu, RunEvent, Manager, WindowUrl, WindowBuilder};
use tauri::api::dialog;
use once_cell::sync::Lazy;

Expand Down Expand Up @@ -160,9 +160,9 @@ fn main() {

app.run(|app_handle, e| match e {
// Application is ready (triggered only once)
Event::Ready => {
RunEvent::Ready => {
},
Event::CloseRequested { label, api, .. } => {
RunEvent::CloseRequested { label, api, .. } => {
let app_handle = app_handle.clone();
let window = app_handle.get_window(&label).unwrap();
// prevent the event loop to close
Expand All @@ -181,7 +181,7 @@ fn main() {
},
);
},
Event::ExitRequested { api, .. } => {
RunEvent::ExitRequested { api, .. } => {
// Keep the event loop running even if all windows are closed
// This allow us to catch system tray events when there is no window
api.prevent_exit();
Expand Down

0 comments on commit 973291e

Please sign in to comment.