diff --git a/plugins/app/README.md b/plugins/app/README.md index 9b4bace2..94ba0287 100644 --- a/plugins/app/README.md +++ b/plugins/app/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-app = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-app = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-app +# or +npm add @tauri-apps/plugin-app +# or +yarn add @tauri-apps/plugin-app + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-app#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-app#v2 @@ -51,7 +60,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import * as app from "@tauri-apps/plugin-app"; +import { getVersion, hide } from '@tauri-apps/plugin-app'; +const appVersion = await getVersion(); +await hide(); ``` ## Contributing diff --git a/plugins/authenticator/README.md b/plugins/authenticator/README.md index c902bc23..ed18fae7 100644 --- a/plugins/authenticator/README.md +++ b/plugins/authenticator/README.md @@ -18,8 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-authenticator = "0.1" -# or through git +tauri-plugin-authenticator = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-authenticator = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -27,6 +27,16 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. +```sh +pnpm add @tauri-apps/plugin-authenticator +# or +npm add @tauri-apps/plugin-authenticator +# or +yarn add @tauri-apps/plugin-authenticator +``` + +Alternatively with Git: + ```sh pnpm add https://github.com/tauri-apps/tauri-plugin-authenticator#v2 # or diff --git a/plugins/autostart/README.md b/plugins/autostart/README.md index d62d4c26..f14fd2c2 100644 --- a/plugins/autostart/README.md +++ b/plugins/autostart/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-autostart = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-autostart +# or +npm add @tauri-apps/plugin-autostart +# or +yarn add @tauri-apps/plugin-autostart + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-autostart#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-autostart#v2 diff --git a/plugins/cli/README.md b/plugins/cli/README.md index 983cf803..cfe24c64 100644 --- a/plugins/cli/README.md +++ b/plugins/cli/README.md @@ -1,6 +1,6 @@ -![plugin-cli](banner.jpg) +![CLI](banner.jpg) - +Parse arguments from your Command Line Interface. ## Install @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-cli = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-cli +# or +npm add @tauri-apps/plugin-cli +# or +yarn add @tauri-apps/plugin-cli + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-cli#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-cli#v2 @@ -51,7 +60,18 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript - +import { getMatches } from '@tauri-apps/plugin-cli'; +const matches = await getMatches(); +if (matches.subcommand?.name === 'run') { + // `./your-app run $ARGS` was executed + const args = matches.subcommand?.matches.args + if ('debug' in args) { + // `./your-app run --debug` was executed + } +} else { + const args = matches.args + // `./your-app $ARGS` was executed +} ``` ## Contributing diff --git a/plugins/clipboard/README.md b/plugins/clipboard/README.md index 2b5df3e4..d71dc606 100644 --- a/plugins/clipboard/README.md +++ b/plugins/clipboard/README.md @@ -1,6 +1,6 @@ ![plugin-clipboard](banner.jpg) - +Read and write to the system clipboard. ## Install @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-clipboard = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-clipboard = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-clipboard +# or +npm add @tauri-apps/plugin-clipboard +# or +yarn add @tauri-apps/plugin-clipboard + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-clipboard#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-clipboard#v2 @@ -51,7 +60,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript - +import { writeText, readText } from '@tauri-apps/plugin-clipboard'; +await writeText('Tauri is awesome!'); +assert(await readText(), 'Tauri is awesome!'); ``` ## Contributing diff --git a/plugins/dialog/README.md b/plugins/dialog/README.md index 172ed55e..1b707296 100644 --- a/plugins/dialog/README.md +++ b/plugins/dialog/README.md @@ -1,6 +1,6 @@ ![Dialog](banner.jpg) - +Native system dialogs for opening and saving files along with message dialogs. ## Install @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-dialog = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -31,6 +33,13 @@ pnpm add @tauri-apps/plugin-dialog npm add @tauri-apps/plugin-dialog # or yarn add @tauri-apps/plugin-dialog + +# alternatively with Git: +pnpm add https://github.com/tauri-apps/tauri-plugin-dialog#v2 +# or +npm add https://github.com/tauri-apps/tauri-plugin-dialog#v2 +# or +yarn add https://github.com/tauri-apps/tauri-plugin-dialog#v2 ``` ## Usage diff --git a/plugins/fs/README.md b/plugins/fs/README.md index f411ca25..64d557d1 100644 --- a/plugins/fs/README.md +++ b/plugins/fs/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-fs = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-fs = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-fs +# or +npm add @tauri-apps/plugin-fs +# or +yarn add @tauri-apps/plugin-fs + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-fs#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-fs#v2 diff --git a/plugins/global-shortcut/README.md b/plugins/global-shortcut/README.md index c2362ae4..4ebe5cc4 100644 --- a/plugins/global-shortcut/README.md +++ b/plugins/global-shortcut/README.md @@ -1,6 +1,6 @@ ![plugin-shortcut](banner.jpg) - +Register global shortcuts. ## Install @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-global-shortcut = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-shortcut = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,11 +28,18 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh -pnpm add https://github.com/tauri-apps/tauri-plugin-shortcut#v2 +pnpm add @tauri-apps/plugin-global-shortcut # or -npm add https://github.com/tauri-apps/tauri-plugin-shortcut#v2 +npm add @tauri-apps/plugin-global-shortcut # or -yarn add https://github.com/tauri-apps/tauri-plugin-shortcut#v2 +yarn add @tauri-apps/plugin-global-shortcut + +# alternatively with Git: +pnpm add https://github.com/tauri-apps/tauri-plugin-global-shortcut#v2 +# or +npm add https://github.com/tauri-apps/tauri-plugin-global-shortcut#v2 +# or +yarn add https://github.com/tauri-apps/tauri-plugin-global-shortcut#v2 ``` ## Usage diff --git a/plugins/http/README.md b/plugins/http/README.md index 729cedfa..17d45ba1 100644 --- a/plugins/http/README.md +++ b/plugins/http/README.md @@ -1,6 +1,6 @@ -![plugin-http](banner.jpg) +![HTTP](banner.jpg) - +Access the HTTP client written in Rust. ## Install @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-http = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-http = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-http +# or +npm add @tauri-apps/plugin-http +# or +yarn add @tauri-apps/plugin-http + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-http#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-http#v2 @@ -51,7 +60,11 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript - +import { fetch } from '@tauri-apps/plugin-http'; +const response = await fetch('http://localhost:3003/users/2', { + method: 'GET', + timeout: 30, +}); ``` ## Contributing diff --git a/plugins/localhost/README.md b/plugins/localhost/README.md index 87919843..79bb0905 100644 --- a/plugins/localhost/README.md +++ b/plugins/localhost/README.md @@ -20,8 +20,10 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } portpicker = "0.1" # used in the example to pick a random free port +tauri-plugin-localhost = "2.0.0-alpha" +# alternatively with Git: +tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` ## Usage @@ -31,27 +33,26 @@ First you need to register the core plugin with Tauri: `src-tauri/src/main.rs` ```rust -use tauri::{utils::config::AppUrl, window::WindowBuilder, WindowUrl}; +use tauri::{Manager, window::WindowBuilder, WindowUrl}; fn main() { let port = portpicker::pick_unused_port().expect("failed to find unused port"); - let mut context = tauri::generate_context!(); - let url = format!("http://localhost:{}", port).parse().unwrap(); - let window_url = WindowUrl::External(url); - // rewrite the config so the IPC is enabled on this URL - context.config_mut().build.dist_dir = AppUrl::Url(window_url.clone()); - context.config_mut().build.dev_path = AppUrl::Url(window_url.clone()); - tauri::Builder::default() .plugin(tauri_plugin_localhost::Builder::new(port).build()) .setup(move |app| { - WindowBuilder::new(app, "main".to_string(), window_url) + app.ipc_scope().configure_remote_access( + RemoteDomainAccessScope::new(format!("localhost:{}", port)) + .add_window("main") + ); + + let url = format!("http://localhost:{}", port).parse().unwrap(); + WindowBuilder::new(app, "main".to_string(), WindowUrl::External(url)) .title("Localhost Example") .build()?; Ok(()) }) - .run(context) + .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` diff --git a/plugins/log/README.md b/plugins/log/README.md index b3cb6e8a..50aaecbf 100644 --- a/plugins/log/README.md +++ b/plugins/log/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-log = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-log +# or +npm add @tauri-apps/plugin-log +# or +yarn add @tauri-apps/plugin-log + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-log#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-log#v2 diff --git a/plugins/notification/README.md b/plugins/notification/README.md index 1387df60..f55bc18f 100644 --- a/plugins/notification/README.md +++ b/plugins/notification/README.md @@ -1,6 +1,6 @@ -![{{plugin name}}](banner.jpg) +![Notification](banner.jpg) - +Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. ## Install @@ -18,7 +18,9 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] - = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-notification = "2.0.0-alpha" +# alternatively with Git: +tauri-plugin-notification = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: @@ -26,11 +28,18 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh -pnpm add +pnpm add @tauri-apps/plugin-notification # or -npm add +npm add @tauri-apps/plugin-notification # or -yarn add +yarn add @tauri-apps/plugin-notification + +# alternatively with Git: +pnpm add https://github.com/tauri-apps/tauri-plugin-notification#v2 +# or +npm add https://github.com/tauri-apps/tauri-plugin-notification#v2 +# or +yarn add https://github.com/tauri-apps/tauri-plugin-notification#v2 ``` ## Usage @@ -42,7 +51,7 @@ First you need to register the core plugin with Tauri: ```rust fn main() { tauri::Builder::default() - .plugin() + .plugin(tauri_plugin_notification::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/plugins/os/README.md b/plugins/os/README.md index b16ea49f..244ffc77 100644 --- a/plugins/os/README.md +++ b/plugins/os/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-os = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-os = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-os +# or +npm add @tauri-apps/plugin-os +# or +yarn add @tauri-apps/plugin-os + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-os#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-os#v2 @@ -51,7 +60,8 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import * as os from "@tauri-apps/plugin-os"; +import { version } from '@tauri-apps/plugin-os'; +const osVersion = await version(); ``` ## Contributing diff --git a/plugins/persisted-scope/README.md b/plugins/persisted-scope/README.md index 01ac82b4..1a7e19bf 100644 --- a/plugins/persisted-scope/README.md +++ b/plugins/persisted-scope/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-persisted-scope = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-persisted-scope = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` diff --git a/plugins/positioner/README.md b/plugins/positioner/README.md index 0da5aaa9..e80eb516 100644 --- a/plugins/positioner/README.md +++ b/plugins/positioner/README.md @@ -20,8 +20,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-positioner = "1.0" -# or through git +tauri-plugin-positioner = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-positioner = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -35,11 +35,8 @@ pnpm add @tauri-apps/plugin-positioner npm add @tauri-apps/plugin-positioner # or yarn add @tauri-apps/plugin-positioner -``` - -Or through git: -```sh +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-positioner#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-positioner#v2 diff --git a/plugins/process/README.md b/plugins/process/README.md index 01fc5d61..d712b4f7 100644 --- a/plugins/process/README.md +++ b/plugins/process/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-process = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-process = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-process +# or +npm add @tauri-apps/plugin-process +# or +yarn add @tauri-apps/plugin-process + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-process#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-process#v2 @@ -51,7 +60,11 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import * as process from "@tauri-apps/plugin-process"; +import { exit, relaunch } from '@tauri-apps/plugin-process'; +// exit the app with the given status code +await exit(0); +// restart the app +await relaunch(); ``` ## Contributing diff --git a/plugins/shell/README.md b/plugins/shell/README.md index 80400eaa..de442b5d 100644 --- a/plugins/shell/README.md +++ b/plugins/shell/README.md @@ -1,6 +1,6 @@ -![plugin-shell](banner.jpg) +![Shell](banner.jpg) - +Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. ## Install @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-shell = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-shell = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-shell +# or +npm add @tauri-apps/plugin-shell +# or +yarn add @tauri-apps/plugin-shell + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-shell#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-shell#v2 @@ -51,7 +60,8 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript - +import { Command } from '@tauri-apps/plugin-shell' +Command.create('git', ['commit', '-m', 'the commit message']) ``` ## Contributing diff --git a/plugins/single-instance/README.md b/plugins/single-instance/README.md index 6c72dc4e..2cb2d88e 100644 --- a/plugins/single-instance/README.md +++ b/plugins/single-instance/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-single-instance = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` diff --git a/plugins/sql/README.md b/plugins/sql/README.md index f6658668..3901405e 100644 --- a/plugins/sql/README.md +++ b/plugins/sql/README.md @@ -18,9 +18,11 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies.tauri-plugin-sql] +features = ["sqlite"] # or "postgres", or "mysql" +version = "2.0.0-alpha" +# alternatively with Git git = "https://github.com/tauri-apps/plugins-workspace" branch = "v2" -features = ["sqlite"] # or "postgres", or "mysql" ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: @@ -28,6 +30,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-sql +# or +npm add @tauri-apps/plugin-sql +# or +yarn add @tauri-apps/plugin-sql + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-sql#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-sql#v2 diff --git a/plugins/store/README.md b/plugins/store/README.md index c8411112..90b0b7ef 100644 --- a/plugins/store/README.md +++ b/plugins/store/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-store = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-store +# or +npm add @tauri-apps/plugin-store +# or +yarn add @tauri-apps/plugin-store + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-store#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-store#v2 diff --git a/plugins/stronghold/README.md b/plugins/stronghold/README.md index 52b22a87..7254b857 100644 --- a/plugins/stronghold/README.md +++ b/plugins/stronghold/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-stronghold = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-stronghold = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-stronghold +# or +npm add @tauri-apps/plugin-stronghold +# or +yarn add @tauri-apps/plugin-stronghold + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-stronghold#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-stronghold#v2 diff --git a/plugins/updater/README.md b/plugins/updater/README.md index 842af4d9..e96edac6 100644 --- a/plugins/updater/README.md +++ b/plugins/updater/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-updater = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-updater = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-updater +# or +npm add @tauri-apps/plugin-updater +# or +yarn add @tauri-apps/plugin-updater + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-updater#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-updater#v2 @@ -51,7 +60,13 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import * as updater from "@tauri-apps/plugin-updater"; +import { check } from "@tauri-apps/plugin-updater"; +import { relaunch } from "@tauri-apps/plugin-process"; +const update = await check(); +if (update.response.available) { + await update.downloadAndInstall(); + await relaunch(); +} ``` ## Contributing diff --git a/plugins/upload/README.md b/plugins/upload/README.md index d451a8d6..9796aa8a 100644 --- a/plugins/upload/README.md +++ b/plugins/upload/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-upload = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-upload = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-upload +# or +npm add @tauri-apps/plugin-upload +# or +yarn add @tauri-apps/plugin-upload + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-upload#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-upload#v2 diff --git a/plugins/websocket/README.md b/plugins/websocket/README.md index 0971d6ff..56943465 100644 --- a/plugins/websocket/README.md +++ b/plugins/websocket/README.md @@ -1,6 +1,6 @@ ![plugin-websocket](banner.png) - +Expose a WebSocket server to your Tauri frontend. ## Install @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-websocket = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-websocket = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-websocket +# or +npm add @tauri-apps/plugin-websocket +# or +yarn add @tauri-apps/plugin-websocket + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-websocket#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-websocket#v2 diff --git a/plugins/window-state/README.md b/plugins/window-state/README.md index 97848cd2..ea03f8e2 100644 --- a/plugins/window-state/README.md +++ b/plugins/window-state/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-window-state = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-window-state +# or +npm add @tauri-apps/plugin-window-state +# or +yarn add @tauri-apps/plugin-window-state + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-window-state#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-window-state#v2 diff --git a/plugins/window/README.md b/plugins/window/README.md index 1a47b706..70efd3ae 100644 --- a/plugins/window/README.md +++ b/plugins/window/README.md @@ -18,6 +18,8 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] +tauri-plugin-window = "2.0.0-alpha" +# alternatively with Git: tauri-plugin-window = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -26,6 +28,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh +pnpm add @tauri-apps/plugin-window +# or +npm add @tauri-apps/plugin-window +# or +yarn add @tauri-apps/plugin-window + +# alternatively with Git: pnpm add https://github.com/tauri-apps/tauri-plugin-window#v2 # or npm add https://github.com/tauri-apps/tauri-plugin-window#v2 @@ -51,7 +60,20 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import * as tauriWindow from "@tauri-apps/plugin-window"; +import { appWindow, WebviewWindow } from "@tauri-apps/plugin-window"; + +// manipulating this window +await appWindow.setResizable(false); + +// Creating new windows: +// loading embedded asset: +const webview = new WebviewWindow('theUniqueLabel', { + url: 'path/to/page.html' +}); +// alternatively, load a remote URL: +const webview = new WebviewWindow('theUniqueLabel', { + url: 'https://github.com/tauri-apps/tauri' +}); ``` ## Contributing diff --git a/shared/template/README.md b/shared/template/README.md index f1641d84..ee326dd2 100644 --- a/shared/template/README.md +++ b/shared/template/README.md @@ -1,4 +1,4 @@ -![{{plugin name}}](banner.jpg) +![{{plugin-name}}](banner.jpg) @@ -18,7 +18,9 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] - = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +tauri-plugin-{{plugin-name}} = "2.0.0-alpha" +# alternatively with Git: +tauri-plugin-{{plugin-name}} = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: @@ -26,11 +28,18 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh -pnpm add +pnpm add @tauri-apps/plugin-{{plugin-name}} # or -npm add +npm add @tauri-apps/plugin-{{plugin-name}} # or -yarn add +yarn add @tauri-apps/plugin-{{plugin-name}} + +# alternatively with Git: +pnpm add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +# or +npm add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +# or +yarn add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 ``` ## Usage @@ -42,7 +51,7 @@ First you need to register the core plugin with Tauri: ```rust fn main() { tauri::Builder::default() - .plugin() + .plugin(tauri_plugin_{{plugin-name}}::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); }