feat: use tauri next branch, fix tests, MSRV 1.65 (#354)

This commit is contained in:
Lucas Fernandes Nogueira
2023-05-12 13:16:50 -07:00
committed by GitHub
parent e0e7b4fc71
commit 937e6a5be6
64 changed files with 867 additions and 463 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
## Install
_This plugin requires a Rust version of at least **1.64**_
_This plugin requires a Rust version of at least **1.65**_
There are three general methods of installation that we can recommend.
+21 -19
View File
@@ -72,15 +72,16 @@ mod imp {
///
/// # Examples
/// ```rust,no_run
/// use tauri::api::notification::Notification;
/// use tauri_plugin_notification::NotificationExt;
/// // first we build the application to access the Tauri configuration
/// let app = tauri::Builder::default()
/// // on an actual app, remove the string argument
/// .build(tauri::generate_context!("test/fixture/src-tauri/tauri.conf.json"))
/// .build(tauri::generate_context!("test/tauri.conf.json"))
/// .expect("error while building tauri application");
///
/// // shows a notification with the given title and body
/// Notification::new(&app.config().tauri.bundle.identifier)
/// app.notification()
/// .builder()
/// .title("New message")
/// .body("You've got a new message.")
/// .show();
@@ -136,15 +137,20 @@ mod imp {
/// # Examples
///
/// ```no_run
/// use tauri::api::notification::Notification;
/// use tauri_plugin_notification::NotificationExt;
///
/// // on an actual app, remove the string argument
/// let context = tauri::generate_context!("test/fixture/src-tauri/tauri.conf.json");
/// Notification::new(&context.config().tauri.bundle.identifier)
/// .title("Tauri")
/// .body("Tauri is awesome!")
/// .show()
/// .unwrap();
/// tauri::Builder::default()
/// .setup(|app| {
/// app.notification()
/// .builder()
/// .title("Tauri")
/// .body("Tauri is awesome!")
/// .show()
/// .unwrap();
/// Ok(())
/// })
/// .run(tauri::generate_context!("test/tauri.conf.json"))
/// .expect("error while running tauri application");
/// ```
///
/// ## Platform-specific
@@ -200,22 +206,18 @@ mod imp {
/// # Examples
///
/// ```no_run
/// use tauri::api::notification::Notification;
///
/// // on an actual app, remove the string argument
/// let context = tauri::generate_context!("test/fixture/src-tauri/tauri.conf.json");
/// let identifier = context.config().tauri.bundle.identifier.clone();
/// use tauri_plugin_notification::NotificationExt;
///
/// tauri::Builder::default()
/// .setup(move |app| {
/// Notification::new(&identifier)
/// app.notification().builder()
/// .title("Tauri")
/// .body("Tauri is awesome!")
/// .notify(&app.handle())
/// .show()
/// .unwrap();
/// Ok(())
/// })
/// .run(context)
/// .run(tauri::generate_context!("test/tauri.conf.json"))
/// .expect("error while running tauri application");
/// ```
#[cfg(feature = "windows7-compat")]
+22
View File
@@ -0,0 +1,22 @@
{
"$schema": "../../../node_modules/.pnpm/@tauri-apps+cli@2.0.0-alpha.8/node_modules/@tauri-apps/cli/schema.json",
"build": {
"distDir": ".",
"devPath": "http://localhost:4000"
},
"tauri": {
"bundle": {
"identifier": "studio.tauri.example",
"active": true,
"icon": ["../../../examples/api/src-tauri/icons/icon.png"]
},
"windows": [
{
"title": "Tauri App"
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}
}
}