Merge branch 'v2' into feat/http/persist-cookies

pull/1978/head
Lucas Nogueira 4 months ago
commit dbf5695c62
No known key found for this signature in database
GPG Key ID: A05EE2227C581CD7

@ -14,10 +14,20 @@
"command": "pnpm build", "command": "pnpm build",
"dryRunCommand": "pnpm build" "dryRunCommand": "pnpm build"
}, },
{
"command": "echo '<details>\n<summary><em><h4>PNPM Publish</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
{ {
"command": "npm publish --provenance --access public", "command": "npm publish --provenance --access public",
"dryRunCommand": "npm publish --provenance --access public --dry-run", "dryRunCommand": "npm publish --provenance --access public --dry-run",
"pipe": true "pipe": true
},
{
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
} }
] ]
}, },

@ -1,6 +0,0 @@
---
"log": patch
"log-js": patch
---
Make log functions omit caller location when failed to parse it instead of throwing

@ -46,7 +46,7 @@ jobs:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 9.x.x version: 10.x.x
run_install: true run_install: true
- name: audit - name: audit
run: pnpm audit run: pnpm audit

@ -8,6 +8,7 @@ on:
pull_request: pull_request:
paths: paths:
- '.github/workflows/check-generated-files.yml' - '.github/workflows/check-generated-files.yml'
- pnpm-lock.yaml
- '**/guest-js/**' - '**/guest-js/**'
concurrency: concurrency:
@ -27,94 +28,117 @@ jobs:
filters: | filters: |
autostart: autostart:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/autostart/guest-js/** - plugins/autostart/guest-js/**
- plugins/autostart/src/api-iife.js - plugins/autostart/src/api-iife.js
cli: cli:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/cli/guest-js/** - plugins/cli/guest-js/**
- plugins/cli/src/api-iife.js - plugins/cli/src/api-iife.js
clipboard-manager: clipboard-manager:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/clipboard-manager/guest-js/** - plugins/clipboard-manager/guest-js/**
- plugins/clipboard-manager/src/api-iife.js - plugins/clipboard-manager/src/api-iife.js
dialog: dialog:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/dialog/guest-js/** - plugins/dialog/guest-js/**
- plugins/dialog/src/api-iife.js - plugins/dialog/src/api-iife.js
fs: fs:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/fs/guest-js/** - plugins/fs/guest-js/**
- plugins/fs/src/api-iife.js - plugins/fs/src/api-iife.js
geolocation: geolocation:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/geolocation/guest-js/** - plugins/geolocation/guest-js/**
- plugins/geolocation/src/api-iife.js - plugins/geolocation/src/api-iife.js
global-shortcut: global-shortcut:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/global-shortcut/guest-js/** - plugins/global-shortcut/guest-js/**
- plugins/global-shortcut/src/api-iife.js - plugins/global-shortcut/src/api-iife.js
opener: opener:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/opener/guest-js/** - plugins/opener/guest-js/**
- plugins/opener/src/api-iife.js - plugins/opener/src/api-iife.js
haptics: haptics:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/haptics/guest-js/** - plugins/haptics/guest-js/**
- plugins/haptics/src/api-iife.js - plugins/haptics/src/api-iife.js
http: http:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/http/guest-js/** - plugins/http/guest-js/**
- plugins/http/src/api-iife.js - plugins/http/src/api-iife.js
log: log:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/log/guest-js/** - plugins/log/guest-js/**
- plugins/log/src/api-iife.js - plugins/log/src/api-iife.js
notification: notification:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/notification/guest-js/** - plugins/notification/guest-js/**
- plugins/notification/src/api-iife.js - plugins/notification/src/api-iife.js
os: os:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/os/guest-js/** - plugins/os/guest-js/**
- plugins/os/src/api-iife.js - plugins/os/src/api-iife.js
positioner: positioner:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/positioner/guest-js/** - plugins/positioner/guest-js/**
- plugins/positioner/src/api-iife.js - plugins/positioner/src/api-iife.js
process: process:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/process/guest-js/** - plugins/process/guest-js/**
- plugins/process/src/api-iife.js - plugins/process/src/api-iife.js
shell: shell:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/shell/guest-js/** - plugins/shell/guest-js/**
- plugins/shell/src/api-iife.js - plugins/shell/src/api-iife.js
sql: sql:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/sql/guest-js/** - plugins/sql/guest-js/**
- plugins/sql/src/api-iife.js - plugins/sql/src/api-iife.js
store: store:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/store/guest-js/** - plugins/store/guest-js/**
- plugins/store/src/api-iife.js - plugins/store/src/api-iife.js
stronghold: stronghold:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/stronghold/guest-js/** - plugins/stronghold/guest-js/**
- plugins/stronghold/src/api-iife.js - plugins/stronghold/src/api-iife.js
updater: updater:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/updater/guest-js/** - plugins/updater/guest-js/**
- plugins/updater/src/api-iife.js - plugins/updater/src/api-iife.js
upload: upload:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/upload/guest-js/** - plugins/upload/guest-js/**
- plugins/upload/src/api-iife.js - plugins/upload/src/api-iife.js
websocket: websocket:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/websocket/guest-js/** - plugins/websocket/guest-js/**
- plugins/websocket/src/api-iife.js - plugins/websocket/src/api-iife.js
window-state: window-state:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/window-state/guest-js/** - plugins/window-state/guest-js/**
- plugins/window-state/src/api-iife.js - plugins/window-state/src/api-iife.js
@ -143,7 +167,7 @@ jobs:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 9.x.x version: 10.x.x
run_install: true run_install: true
- name: build api - name: build api

@ -39,7 +39,7 @@ jobs:
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 9.x.x version: 10.x.x
run_install: true run_install: true
- name: cargo login - name: cargo login
@ -75,7 +75,7 @@ jobs:
- name: Create Pull Request With Versions Bumped - name: Create Pull Request With Versions Bumped
id: cpr id: cpr
uses: tauri-apps/create-pull-request@v3 uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # 7.0.7
if: steps.covector.outputs.commandRan == 'version' if: steps.covector.outputs.commandRan == 'version'
with: with:
title: 'Publish New Versions (${{ github.ref_name }})' title: 'Publish New Versions (${{ github.ref_name }})'

@ -38,7 +38,7 @@ jobs:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 9.x.x version: 10.x.x
run_install: true run_install: true
- run: pnpm format:check - run: pnpm format:check

@ -49,7 +49,7 @@ jobs:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 9.x.x version: 10.x.x
run_install: true run_install: true
- name: eslint - name: eslint
run: pnpm lint run: pnpm lint

@ -38,7 +38,7 @@ jobs:
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 9.x.x version: 10.x.x
run_install: true run_install: true
- name: Build packages - name: Build packages

2
.gitignore vendored

@ -14,6 +14,8 @@ target/
# .vscode workspace settings file # .vscode workspace settings file
.vscode/settings.json .vscode/settings.json
.vscode/launch.json
.vscode/tasks.json
# npm, yarn and bun lock files # npm, yarn and bun lock files
package-lock.json package-lock.json

@ -1,5 +1,6 @@
{ {
"singleQuote": true, "singleQuote": true,
"semi": false, "semi": false,
"trailingComma": "none" "trailingComma": "none",
"experimentalOperatorPosition": "start"
} }

@ -14,7 +14,7 @@ import { join } from 'path'
'deep-link-example-js' 'deep-link-example-js'
] */ ] */
const rsOnly = ['localhost', 'persisted-scope'] const rsOnly = ['localhost', 'persisted-scope', 'single-instance']
function checkChangeFiles(changeFiles) { function checkChangeFiles(changeFiles) {
let code = 0 let code = 0

@ -32,8 +32,8 @@ const ignore = [
async function checkFile(file) { async function checkFile(file) {
if ( if (
extensions.some((e) => file.endsWith(e)) && extensions.some((e) => file.endsWith(e))
!ignore.some((i) => file.includes(`${path.sep}${i}`)) && !ignore.some((i) => file.includes(`${path.sep}${i}`))
) { ) {
const fileStream = fs.createReadStream(file) const fileStream = fs.createReadStream(file)
const rl = readline.createInterface({ const rl = readline.createInterface({
@ -46,10 +46,10 @@ async function checkFile(file) {
for await (let line of rl) { for await (let line of rl) {
// ignore empty lines, allow shebang, swift-tools-version and bundler license // ignore empty lines, allow shebang, swift-tools-version and bundler license
if ( if (
line.length === 0 || line.length === 0
line.startsWith('#!') || || line.startsWith('#!')
line.startsWith('// swift-tools-version:') || || line.startsWith('// swift-tools-version:')
ignoredLicenses.includes(line) || ignoredLicenses.includes(line)
) { ) {
continue continue
} }

@ -1 +1,2 @@
plugins/*/permissions/autogenerated/ plugins/*/permissions/autogenerated/
plugins/*/android/.tauri/tauri-api/build/

1201
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -21,10 +21,9 @@ thiserror = "2"
url = "2" url = "2"
schemars = "0.8" schemars = "0.8"
dunce = "1" dunce = "1"
specta = "=2.0.0-rc.20" specta = "^2.0.0-rc.16"
glob = "0.3" glob = "0.3"
zbus = "4" zbus = "5"
#tauri-specta = "=2.0.0-rc.11"
[workspace.package] [workspace.package]
edition = "2021" edition = "2021"

@ -29,7 +29,7 @@ This repo and all plugins require a Rust version of at least **1.77.2**
| [process](plugins/process) | This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. | ✅ | ✅ | ✅ | ? | ? | | [process](plugins/process) | This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. | ✅ | ✅ | ✅ | ? | ? |
| [shell](plugins/shell) | Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? | | [shell](plugins/shell) | Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? |
| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ✅ | ✅ | ❌ | ❌ | | [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ✅ | ✅ | ❌ | ❌ |
| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ✅ | | [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | | ✅ |
| [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ✅ | ✅ | | [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ✅ | ✅ |
| [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? | | [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? |
| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ❌ | ❌ | | [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ❌ | ❌ |

@ -1,5 +1,126 @@
# Changelog # Changelog
## \[2.0.18]
### Dependencies
- Upgraded to `http-js@2.4.1`
## \[2.0.17]
### Dependencies
- Upgraded to `log-js@2.3.1`
## \[2.0.16]
### Dependencies
- Upgraded to `clipboard-manager-js@2.2.2`
- Upgraded to `notification-js@2.2.2`
- Upgraded to `os-js@2.2.1`
- Upgraded to `http-js@2.4.0`
- Upgraded to `log-js@2.3.0`
- Upgraded to `updater-js@2.6.0`
## \[2.0.15]
### Dependencies
- Upgraded to `log-js@2.2.3`
- Upgraded to `opener-js@2.2.6`
## \[2.0.14]
### Dependencies
- Upgraded to `log-js@2.2.2`
- Upgraded to `updater-js@2.5.1`
## \[2.0.13]
### Dependencies
- Upgraded to `updater-js@2.5.0`
## \[2.0.12]
### Dependencies
- Upgraded to `clipboard-manager-js@2.2.1`
- Upgraded to `http-js@2.3.0`
- Upgraded to `log-js@2.2.1`
- Upgraded to `updater-js@2.4.0`
## \[2.0.11]
### Dependencies
- Upgraded to `opener-js@2.2.5`
## \[2.0.10]
### Dependencies
- Upgraded to `notification-js@2.2.1`
- Upgraded to `opener-js@2.2.4`
## \[2.0.9]
### Dependencies
- Upgraded to `opener-js@2.2.3`
- Upgraded to `updater-js@2.3.1`
## \[2.0.8]
### Dependencies
- Upgraded to `opener-js@2.2.2`
## \[2.0.7]
### Dependencies
- Upgraded to `updater-js@2.3.0`
- Upgraded to `opener-js@2.2.1`
## \[2.0.6]
### Dependencies
- Upgraded to `barcode-scanner-js@2.1.0`
- Upgraded to `biometric-js@2.1.0`
- Upgraded to `cli-js@2.1.0`
- Upgraded to `clipboard-manager-js@2.1.0`
- Upgraded to `dialog-js@2.1.0`
- Upgraded to `fs-js@2.1.0`
- Upgraded to `global-shortcut-js@2.1.0`
- Upgraded to `http-js@2.1.0`
- Upgraded to `log-js@2.1.0`
- Upgraded to `nfc-js@2.1.0`
- Upgraded to `notification-js@2.1.0`
- Upgraded to `opener-js@2.1.0`
- Upgraded to `os-js@2.1.0`
- Upgraded to `process-js@2.1.0`
- Upgraded to `shell-js@2.1.0`
- Upgraded to `store-js@2.2.0`
- Upgraded to `updater-js@2.1.0`
## \[2.0.5]
### Dependencies
- Upgraded to `fs-js@2.0.4`
- Upgraded to `dialog-js@2.0.2`
- Upgraded to `http-js@2.0.2`
## \[2.0.4]
### Dependencies
- Upgraded to `log-js@2.0.2`
## \[2.0.3] ## \[2.0.3]
### Dependencies ### Dependencies

@ -1,7 +1,7 @@
{ {
"name": "api", "name": "api",
"private": true, "private": true,
"version": "2.0.3", "version": "2.0.18",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --clearScreen false", "dev": "vite --clearScreen false",
@ -10,35 +10,35 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.1.1", "@tauri-apps/api": "2.3.0",
"@tauri-apps/plugin-barcode-scanner": "2.0.0", "@tauri-apps/plugin-barcode-scanner": "^2.2.0",
"@tauri-apps/plugin-biometric": "2.0.0", "@tauri-apps/plugin-biometric": "^2.2.0",
"@tauri-apps/plugin-cli": "2.0.0", "@tauri-apps/plugin-cli": "^2.2.0",
"@tauri-apps/plugin-clipboard-manager": "2.0.1", "@tauri-apps/plugin-clipboard-manager": "^2.2.2",
"@tauri-apps/plugin-dialog": "2.0.1", "@tauri-apps/plugin-dialog": "^2.2.0",
"@tauri-apps/plugin-fs": "2.0.3", "@tauri-apps/plugin-fs": "^2.2.0",
"@tauri-apps/plugin-geolocation": "2.0.0", "@tauri-apps/plugin-geolocation": "^2.2.0",
"@tauri-apps/plugin-global-shortcut": "2.0.0", "@tauri-apps/plugin-global-shortcut": "^2.2.0",
"@tauri-apps/plugin-opener": "2.0.0", "@tauri-apps/plugin-haptics": "^2.2.0",
"@tauri-apps/plugin-haptics": "2.0.0", "@tauri-apps/plugin-http": "^2.4.1",
"@tauri-apps/plugin-http": "2.0.1", "@tauri-apps/plugin-nfc": "^2.2.0",
"@tauri-apps/plugin-nfc": "2.0.0", "@tauri-apps/plugin-notification": "^2.2.2",
"@tauri-apps/plugin-notification": "2.0.0", "@tauri-apps/plugin-opener": "^2.2.6",
"@tauri-apps/plugin-os": "2.0.0", "@tauri-apps/plugin-os": "^2.2.1",
"@tauri-apps/plugin-process": "2.0.0", "@tauri-apps/plugin-process": "^2.2.0",
"@tauri-apps/plugin-shell": "2.0.1", "@tauri-apps/plugin-shell": "^2.2.0",
"@tauri-apps/plugin-store": "2.1.0", "@tauri-apps/plugin-store": "^2.2.0",
"@tauri-apps/plugin-updater": "2.0.0", "@tauri-apps/plugin-updater": "^2.6.0",
"@zerodevx/svelte-json-view": "1.0.11" "@zerodevx/svelte-json-view": "1.0.11"
}, },
"devDependencies": { "devDependencies": {
"@iconify-json/codicon": "^1.1.37", "@iconify-json/codicon": "^1.2.12",
"@iconify-json/ph": "^1.1.8", "@iconify-json/ph": "^1.2.2",
"@sveltejs/vite-plugin-svelte": "^5.0.0", "@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tauri-apps/cli": "2.1.0", "@tauri-apps/cli": "2.3.1",
"@unocss/extractor-svelte": "^0.65.0", "@unocss/extractor-svelte": "^66.0.0",
"svelte": "^5.0.0", "svelte": "^5.20.4",
"unocss": "^0.65.0", "unocss": "^66.0.0",
"vite": "^6.0.0" "vite": "^6.2.0"
} }
} }

@ -1,5 +1,141 @@
# Changelog # Changelog
## \[2.0.22]
### Dependencies
- Upgraded to `http@2.4.1`
## \[2.0.21]
### Dependencies
- Upgraded to `log@2.3.1`
## \[2.0.20]
### Dependencies
- Upgraded to `clipboard-manager@2.2.2`
- Upgraded to `geolocation@2.2.4`
- Upgraded to `haptics@2.2.4`
- Upgraded to `notification@2.2.2`
- Upgraded to `os@2.2.1`
- Upgraded to `http@2.4.0`
- Upgraded to `log@2.3.0`
- Upgraded to `updater@2.6.0`
## \[2.0.19]
### Dependencies
- Upgraded to `log@2.2.3`
- Upgraded to `opener@2.2.6`
## \[2.0.18]
### Dependencies
- Upgraded to `log@2.2.2`
- Upgraded to `updater@2.5.1`
## \[2.0.17]
### Dependencies
- Upgraded to `updater@2.5.0`
## \[2.0.16]
### Dependencies
- Upgraded to `clipboard-manager@2.2.1`
- Upgraded to `http@2.3.0`
- Upgraded to `log@2.2.1`
- Upgraded to `updater@2.4.0`
## \[2.0.15]
### Dependencies
- Upgraded to `haptics@2.2.3`
- Upgraded to `geolocation@2.2.3`
- Upgraded to `opener@2.2.5`
## \[2.0.14]
### Dependencies
- Upgraded to `geolocation@2.2.2`
- Upgraded to `haptics@2.2.2`
- Upgraded to `notification@2.2.1`
- Upgraded to `opener@2.2.4`
## \[2.0.13]
### Dependencies
- Upgraded to `geolocation@2.2.1`
- Upgraded to `haptics@2.2.1`
## \[2.0.12]
### Dependencies
- Upgraded to `opener@2.2.3`
- Upgraded to `updater@2.3.1`
## \[2.0.11]
### Dependencies
- Upgraded to `opener@2.2.2`
## \[2.0.10]
### Dependencies
- Upgraded to `updater@2.3.0`
- Upgraded to `opener@2.2.1`
## \[2.0.9]
### Dependencies
- Upgraded to `barcode-scanner@2.1.0`
- Upgraded to `biometric@2.1.0`
- Upgraded to `cli@2.1.0`
- Upgraded to `clipboard-manager@2.1.0`
- Upgraded to `dialog@2.1.0`
- Upgraded to `fs@2.2.0`
- Upgraded to `geolocation@2.1.0`
- Upgraded to `global-shortcut@2.1.0`
- Upgraded to `haptics@2.1.0`
- Upgraded to `http@2.1.0`
- Upgraded to `log@2.1.0`
- Upgraded to `nfc@2.1.0`
- Upgraded to `notification@2.1.0`
- Upgraded to `opener@2.1.0`
- Upgraded to `os@2.1.0`
- Upgraded to `process@2.1.0`
- Upgraded to `shell@2.1.0`
- Upgraded to `store@2.2.0`
- Upgraded to `updater@2.2.0`
## \[2.0.8]
### Dependencies
- Upgraded to `fs@2.1.1`
- Upgraded to `dialog@2.0.5`
- Upgraded to `http@2.0.5`
## \[2.0.7]
### Dependencies
- Upgraded to `log@2.0.4`
## \[2.0.6] ## \[2.0.6]
### Dependencies ### Dependencies

@ -1,7 +1,7 @@
[package] [package]
name = "api" name = "api"
publish = false publish = false
version = "2.0.6" version = "2.0.22"
description = "An example Tauri Application showcasing the api" description = "An example Tauri Application showcasing the api"
edition = "2021" edition = "2021"
rust-version = { workspace = true } rust-version = { workspace = true }
@ -19,23 +19,23 @@ serde_json = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
tiny_http = "0.12" tiny_http = "0.12"
log = { workspace = true } log = { workspace = true }
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.3" } tauri-plugin-log = { path = "../../../plugins/log", version = "2.3.1" }
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.1.0", features = [ tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.2.0", features = [
"watch", "watch",
] } ] }
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.2" } tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.2.2" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.4" } tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.2.0" }
tauri-plugin-http = { path = "../../../plugins/http", features = [ tauri-plugin-http = { path = "../../../plugins/http", features = [
"multipart", "multipart",
], version = "2.0.4" } ], version = "2.4.1" }
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.1", features = [ tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.2.2", features = [
"windows7-compat", "windows7-compat",
] } ] }
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.1" } tauri-plugin-os = { path = "../../../plugins/os", version = "2.2.1" }
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.1" } tauri-plugin-process = { path = "../../../plugins/process", version = "2.2.0" }
tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.0.0" } tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.2.6" }
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.2" } tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.2.0" }
tauri-plugin-store = { path = "../../../plugins/store", version = "2.1.0" } tauri-plugin-store = { path = "../../../plugins/store", version = "2.2.0" }
[dependencies.tauri] [dependencies.tauri]
workspace = true workspace = true
@ -51,17 +51,17 @@ features = [
] ]
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.1" } tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.2.0" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.1" } tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.2.0" }
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.1.0" } tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.6.0" }
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.0" } tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" }
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] [target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.1" } tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.2.0" }
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.1" } tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.2.0" }
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.1" } tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.2.0" }
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.1" } tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.2.4" }
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.1" } tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.2.4" }
[features] [features]
prod = ["tauri/custom-protocol"] prod = ["tauri/custom-protocol"]

@ -45,7 +45,7 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
.tooltip("Tauri") .tooltip("Tauri")
.icon(app.default_window_icon().unwrap().clone()) .icon(app.default_window_icon().unwrap().clone())
.menu(&menu1) .menu(&menu1)
.menu_on_left_click(false) .show_menu_on_left_click(false)
.on_menu_event(move |app, event| match event.id.as_ref() { .on_menu_event(move |app, event| match event.id.as_ref() {
"quit" => { "quit" => {
app.exit(0); app.exit(0);

@ -11,26 +11,29 @@
"example:api:dev": "pnpm run --filter \"api\" tauri dev" "example:api:dev": "pnpm run --filter \"api\" tauri dev"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "9.16.0", "@eslint/js": "9.22.0",
"@rollup/plugin-node-resolve": "15.3.0", "@rollup/plugin-node-resolve": "16.0.1",
"@rollup/plugin-terser": "0.4.4", "@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "11.1.6", "@rollup/plugin-typescript": "12.1.2",
"@types/eslint__js": "8.42.3", "covector": "^0.12.4",
"covector": "^0.12.3", "eslint": "9.22.0",
"eslint": "9.16.0", "eslint-config-prettier": "10.1.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-security": "3.0.1", "eslint-plugin-security": "3.0.1",
"prettier": "3.4.2", "prettier": "3.5.3",
"rollup": "4.28.1", "rollup": "4.35.0",
"tslib": "2.8.1", "tslib": "2.8.1",
"typescript": "5.7.2", "typescript": "5.8.2",
"typescript-eslint": "8.17.0" "typescript-eslint": "8.26.1"
}, },
"resolutions": { "pnpm": {
"semver": ">=7.5.2", "overrides": {
"optionator": ">=0.9.3" "esbuild@<0.25.0": ">=0.25.0"
},
"onlyBuiltDependencies": [
"esbuild"
]
}, },
"engines": { "engines": {
"pnpm": "^9.0.0" "pnpm": "^10.0.0"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
@ -88,11 +92,3 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-autostart" name = "tauri-plugin-autostart"
version = "2.0.1" version = "2.2.0"
description = "Automatically launch your application at startup." description = "Automatically launch your application at startup."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-autostart", "name": "@tauri-apps/plugin-autostart",
"version": "2.0.0", "version": "2.2.0",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-barcode-scanner" name = "tauri-plugin-barcode-scanner"
version = "2.0.1" version = "2.2.0"
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS" description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-barcode-scanner", "name": "@tauri-apps/plugin-barcode-scanner",
"version": "2.0.0", "version": "2.2.0",
"description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS", "description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-biometric" name = "tauri-plugin-biometric"
version = "2.0.1" version = "2.2.0"
description = "Prompt the user for biometric authentication on Android and iOS." description = "Prompt the user for biometric authentication on Android and iOS."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-biometric", "name": "@tauri-apps/plugin-biometric",
"version": "2.0.0", "version": "2.2.0",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
@ -89,10 +93,3 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11. te to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-cli" name = "tauri-plugin-cli"
version = "2.0.1" version = "2.2.0"
description = "Parse arguments from your Tauri application's command line interface." description = "Parse arguments from your Tauri application's command line interface."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-cli", "name": "@tauri-apps/plugin-cli",
"version": "2.0.0", "version": "2.2.0",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -1,5 +1,19 @@
# Changelog # Changelog
## \[2.2.2]
### bug
- [`d37bbdef`](https://github.com/tauri-apps/plugins-workspace/commit/d37bbdef8dc70e61e59f9fe0bb8b2a48999d0aa1) ([#2507](https://github.com/tauri-apps/plugins-workspace/pull/2507) by [@SquitchYT](https://github.com/tauri-apps/plugins-workspace/../../SquitchYT)) Fix clipboard-manager Wayland support.
## \[2.2.1]
- [`ce11079f`](https://github.com/tauri-apps/plugins-workspace/commit/ce11079f19852fbefdecf0e4c7d947af3624fee0) ([#2280](https://github.com/tauri-apps/plugins-workspace/pull/2280) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Explicitly drop `arboard::Clipboard` on exit. Add recommendation to not use read methods on the mainthread.
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`3fa0fc09`](https://github.com/tauri-apps/plugins-workspace/commit/3fa0fc09bbee0d619801e5757af9fb3c09883c97) ([#2099](https://github.com/tauri-apps/plugins-workspace/pull/2099) by [@rasteiner](https://github.com/tauri-apps/plugins-workspace/../../rasteiner)) Fix clipboard manager client side api not copying fallback alternative text when calling `writeHtml`. - [`3fa0fc09`](https://github.com/tauri-apps/plugins-workspace/commit/3fa0fc09bbee0d619801e5757af9fb3c09883c97) ([#2099](https://github.com/tauri-apps/plugins-workspace/pull/2099) by [@rasteiner](https://github.com/tauri-apps/plugins-workspace/../../rasteiner)) Fix clipboard manager client side api not copying fallback alternative text when calling `writeHtml`.
@ -116,38 +130,3 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
hub.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-clipboard-manager" name = "tauri-plugin-clipboard-manager"
version = "2.0.2" version = "2.2.2"
description = "Read and write to the system clipboard." description = "Read and write to the system clipboard."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@ -36,4 +36,4 @@ thiserror = { workspace = true }
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true, features = ["wry"] }
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
arboard = "3" arboard = { version = "3", features = ["wayland-data-control"] }

@ -72,7 +72,6 @@ import {
writeText, writeText,
readText, readText,
writeHtml, writeHtml,
readHtml,
clear clear
} from '@tauri-apps/plugin-clipboard-manager' } from '@tauri-apps/plugin-clipboard-manager'
await writeText('Tauri is awesome!') await writeText('Tauri is awesome!')

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var t;async function r(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,r,n,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,r)}(this,t,e)}async close(){return r("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class a extends n{constructor(e){super(e)}static async new(e,t,n){return r("plugin:image|new",{rgba:i(e),width:t,height:n}).then((e=>new a(e)))}static async fromBytes(e){return r("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return r("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return r("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return r("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof a?e.rid:e}return e.clear=async function(){await r("plugin:clipboard-manager|clear")},e.readImage=async function(){return await r("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await r("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,t){await r("plugin:clipboard-manager|write_html",{html:e,altText:t})},e.writeImage=async function(e){await r("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,t){await r("plugin:clipboard-manager|write_text",{label:t?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})} if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var n;async function t(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,n,t,r){if("function"==typeof n||!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(e):r?r.value:n.get(e)}(this,n,"f")}constructor(e){n.set(this,void 0),function(e,n,t){if("function"==typeof n||!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");n.set(e,t)}(this,n,e)}async close(){return t("plugin:resources|close",{rid:this.rid})}}n=new WeakMap;class a extends r{constructor(e){super(e)}static async new(e,n,r){return t("plugin:image|new",{rgba:i(e),width:n,height:r}).then((e=>new a(e)))}static async fromBytes(e){return t("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return t("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return t("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return t("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof a?e.rid:e}return e.clear=async function(){await t("plugin:clipboard-manager|clear")},e.readImage=async function(){return await t("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await t("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,n){await t("plugin:clipboard-manager|write_html",{html:e,altText:n})},e.writeImage=async function(e){await t("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,n){await t("plugin:clipboard-manager|write_text",{label:n?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})}

@ -91,7 +91,7 @@ async function writeImage(
* import { readImage } from '@tauri-apps/plugin-clipboard-manager'; * import { readImage } from '@tauri-apps/plugin-clipboard-manager';
* *
* const clipboardImage = await readImage(); * const clipboardImage = await readImage();
* const blob = new Blob([await clipboardImage.rbga()], { type: 'image' }) * const blob = new Blob([await clipboardImage.rgba()], { type: 'image' })
* const url = URL.createObjectURL(blob) * const url = URL.createObjectURL(blob)
* ``` * ```
* @since 2.0.0 * @since 2.0.0
@ -111,9 +111,11 @@ async function readImage(): Promise<Image> {
* *
* @example * @example
* ```typescript * ```typescript
* import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager'; * import { writeHtml } from '@tauri-apps/plugin-clipboard-manager';
* await writeHtml('<h1>Tauri is awesome!</h1>', 'plaintext'); * await writeHtml('<h1>Tauri is awesome!</h1>', 'plaintext');
* await writeHtml('<h1>Tauri is awesome!</h1>', '<h1>Tauri is awesome</h1>'); // Will write "<h1>Tauri is awesome</h1>" as plain text * // The following will write "<h1>Tauri is awesome</h1>" as plain text
* await writeHtml('<h1>Tauri is awesome!</h1>', '<h1>Tauri is awesome</h1>');
* // we can read html data only as a string so there's just readText(), no readHtml()
* assert(await readText(), '<h1>Tauri is awesome!</h1>'); * assert(await readText(), '<h1>Tauri is awesome!</h1>');
* ``` * ```
* *

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-clipboard-manager", "name": "@tauri-apps/plugin-clipboard-manager",
"version": "2.0.1", "version": "2.2.2",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -14,7 +14,7 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
) -> crate::Result<Clipboard<R>> { ) -> crate::Result<Clipboard<R>> {
Ok(Clipboard { Ok(Clipboard {
app: app.clone(), app: app.clone(),
clipboard: arboard::Clipboard::new().map(Mutex::new), clipboard: arboard::Clipboard::new().map(|c| Mutex::new(Some(c))),
}) })
} }
@ -22,13 +22,21 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
pub struct Clipboard<R: Runtime> { pub struct Clipboard<R: Runtime> {
#[allow(dead_code)] #[allow(dead_code)]
app: AppHandle<R>, app: AppHandle<R>,
clipboard: Result<Mutex<arboard::Clipboard>, arboard::Error>, // According to arboard docs the clipboard must be dropped before exit.
// Since tauri doesn't call drop on exit we'll use an Option to take() on RunEvent::Exit.
clipboard: Result<Mutex<Option<arboard::Clipboard>>, arboard::Error>,
} }
impl<R: Runtime> Clipboard<R> { impl<R: Runtime> Clipboard<R> {
pub fn write_text<'a, T: Into<Cow<'a, str>>>(&self, text: T) -> crate::Result<()> { pub fn write_text<'a, T: Into<Cow<'a, str>>>(&self, text: T) -> crate::Result<()> {
match &self.clipboard { match &self.clipboard {
Ok(clipboard) => clipboard.lock().unwrap().set_text(text).map_err(Into::into), Ok(clipboard) => clipboard
.lock()
.unwrap()
.as_mut()
.unwrap()
.set_text(text)
.map_err(Into::into),
Err(e) => Err(crate::Error::Clipboard(e.to_string())), Err(e) => Err(crate::Error::Clipboard(e.to_string())),
} }
} }
@ -38,6 +46,8 @@ impl<R: Runtime> Clipboard<R> {
Ok(clipboard) => clipboard Ok(clipboard) => clipboard
.lock() .lock()
.unwrap() .unwrap()
.as_mut()
.unwrap()
.set_image(ImageData { .set_image(ImageData {
bytes: Cow::Borrowed(image.rgba()), bytes: Cow::Borrowed(image.rgba()),
width: image.width() as usize, width: image.width() as usize,
@ -48,10 +58,11 @@ impl<R: Runtime> Clipboard<R> {
} }
} }
/// Warning: This method should not be used on the main thread! Otherwise the underlying libraries may deadlock on Linux, freezing the whole app, when trying to copy data copied from this app, for example if the user copies text from the WebView.
pub fn read_text(&self) -> crate::Result<String> { pub fn read_text(&self) -> crate::Result<String> {
match &self.clipboard { match &self.clipboard {
Ok(clipboard) => { Ok(clipboard) => {
let text = clipboard.lock().unwrap().get_text()?; let text = clipboard.lock().unwrap().as_mut().unwrap().get_text()?;
Ok(text) Ok(text)
} }
Err(e) => Err(crate::Error::Clipboard(e.to_string())), Err(e) => Err(crate::Error::Clipboard(e.to_string())),
@ -67,6 +78,8 @@ impl<R: Runtime> Clipboard<R> {
Ok(clipboard) => clipboard Ok(clipboard) => clipboard
.lock() .lock()
.unwrap() .unwrap()
.as_mut()
.unwrap()
.set_html(html, alt_text) .set_html(html, alt_text)
.map_err(Into::into), .map_err(Into::into),
Err(e) => Err(crate::Error::Clipboard(e.to_string())), Err(e) => Err(crate::Error::Clipboard(e.to_string())),
@ -75,15 +88,22 @@ impl<R: Runtime> Clipboard<R> {
pub fn clear(&self) -> crate::Result<()> { pub fn clear(&self) -> crate::Result<()> {
match &self.clipboard { match &self.clipboard {
Ok(clipboard) => clipboard.lock().unwrap().clear().map_err(Into::into), Ok(clipboard) => clipboard
.lock()
.unwrap()
.as_mut()
.unwrap()
.clear()
.map_err(Into::into),
Err(e) => Err(crate::Error::Clipboard(e.to_string())), Err(e) => Err(crate::Error::Clipboard(e.to_string())),
} }
} }
/// Warning: This method should not be used on the main thread! Otherwise the underlying libraries may deadlock on Linux, freezing the whole app, when trying to copy data copied from this app, for example if the user copies text from the WebView.
pub fn read_image(&self) -> crate::Result<Image<'_>> { pub fn read_image(&self) -> crate::Result<Image<'_>> {
match &self.clipboard { match &self.clipboard {
Ok(clipboard) => { Ok(clipboard) => {
let image = clipboard.lock().unwrap().get_image()?; let image = clipboard.lock().unwrap().as_mut().unwrap().get_image()?;
let image = Image::new_owned( let image = Image::new_owned(
image.bytes.to_vec(), image.bytes.to_vec(),
image.width as u32, image.width as u32,
@ -94,4 +114,10 @@ impl<R: Runtime> Clipboard<R> {
Err(e) => Err(crate::Error::Clipboard(e.to_string())), Err(e) => Err(crate::Error::Clipboard(e.to_string())),
} }
} }
pub(crate) fn cleanup(&self) {
if let Ok(clipboard) = &self.clipboard {
clipboard.lock().unwrap().take();
}
}
} }

@ -11,7 +11,7 @@
use tauri::{ use tauri::{
plugin::{Builder, TauriPlugin}, plugin::{Builder, TauriPlugin},
Manager, Runtime, Manager, RunEvent, Runtime,
}; };
#[cfg(desktop)] #[cfg(desktop)]
@ -59,5 +59,11 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
app.manage(clipboard); app.manage(clipboard);
Ok(()) Ok(())
}) })
.on_event(|_app, _event| {
#[cfg(desktop)]
if let RunEvent::Exit = _event {
_app.clipboard().cleanup();
}
})
.build() .build()
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`b2aea045`](https://github.com/tauri-apps/plugins-workspace/commit/b2aea0456799775a7243706fdd7a5abf9a193992) ([#2008](https://github.com/tauri-apps/plugins-workspace/pull/2008) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) `onOpenUrl()` will now not call `getCurrent()` anymore, matching the documented behavior. - [`b2aea045`](https://github.com/tauri-apps/plugins-workspace/commit/b2aea0456799775a7243706fdd7a5abf9a193992) ([#2008](https://github.com/tauri-apps/plugins-workspace/pull/2008) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) `onOpenUrl()` will now not call `getCurrent()` anymore, matching the documented behavior.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-deep-link" name = "tauri-plugin-deep-link"
version = "2.0.2" version = "2.2.0"
description = "Set your Tauri application as the default handler for an URL" description = "Set your Tauri application as the default handler for an URL"
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@ -38,8 +38,8 @@ url = { workspace = true }
[target."cfg(windows)".dependencies] [target."cfg(windows)".dependencies]
dunce = "1" dunce = "1"
windows-registry = "0.3" windows-registry = "0.5"
windows-result = "0.2" windows-result = "0.3"
[target."cfg(target_os = \"linux\")".dependencies] [target."cfg(target_os = \"linux\")".dependencies]
rust-ini = "0.21" rust-ini = "0.21"

@ -1,5 +1,11 @@
# Changelog # Changelog
## \[2.2.0]
### Dependencies
- Upgraded to `deep-link-js@2.1.0`
## \[2.0.1] ## \[2.0.1]
### Dependencies ### Dependencies

@ -1,7 +1,7 @@
{ {
"name": "deep-link-example", "name": "deep-link-example",
"private": true, "private": true,
"version": "2.0.1", "version": "2.2.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@ -10,12 +10,12 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.1.1", "@tauri-apps/api": "2.3.0",
"@tauri-apps/plugin-deep-link": "2.0.1" "@tauri-apps/plugin-deep-link": "2.2.0"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "2.1.0", "@tauri-apps/cli": "2.3.1",
"typescript": "^5.2.2", "typescript": "^5.7.3",
"vite": "^6.0.0" "vite": "^6.2.0"
} }
} }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-deep-link", "name": "@tauri-apps/plugin-deep-link",
"version": "2.0.1", "version": "2.2.0",
"description": "Set your Tauri application as the default handler for an URL", "description": "Set your Tauri application as the default handler for an URL",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [

@ -265,18 +265,15 @@ mod imp {
.to_string(); .to_string();
let key_reg = CURRENT_USER.create(&key_base)?; let key_reg = CURRENT_USER.create(&key_base)?;
key_reg.set_string( key_reg.set_string("", format!("URL:{} protocol", self.app.config().identifier))?;
"",
&format!("URL:{} protocol", self.app.config().identifier),
)?;
key_reg.set_string("URL Protocol", "")?; key_reg.set_string("URL Protocol", "")?;
let icon_reg = CURRENT_USER.create(format!("{key_base}\\DefaultIcon"))?; let icon_reg = CURRENT_USER.create(format!("{key_base}\\DefaultIcon"))?;
icon_reg.set_string("", &format!("{exe},0"))?; icon_reg.set_string("", format!("{exe},0"))?;
let cmd_reg = CURRENT_USER.create(format!("{key_base}\\shell\\open\\command"))?; let cmd_reg = CURRENT_USER.create(format!("{key_base}\\shell\\open\\command"))?;
cmd_reg.set_string("", &format!("\"{exe}\" \"%1\""))?; cmd_reg.set_string("", format!("\"{exe}\" \"%1\""))?;
Ok(()) Ok(())
} }

@ -1,5 +1,19 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
### Dependencies
- Upgraded to `fs-js@2.1.0`
## \[2.0.2]
### Dependencies
- Upgraded to `fs-js@2.0.4`
## \[2.0.4] ## \[2.0.4]
- [`76f99ce9`](https://github.com/tauri-apps/plugins-workspace/commit/76f99ce999a2ff9e40235c1675e3eb6570b5e1e2) ([#2108](https://github.com/tauri-apps/plugins-workspace/pull/2108) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The `Dialog` struct is now correctly exported, primarily to fix the documentation on `docs.rs`. - [`76f99ce9`](https://github.com/tauri-apps/plugins-workspace/commit/76f99ce999a2ff9e40235c1675e3eb6570b5e1e2) ([#2108](https://github.com/tauri-apps/plugins-workspace/pull/2108) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The `Dialog` struct is now correctly exported, primarily to fix the documentation on `docs.rs`.
@ -224,88 +238,3 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
d6e80b)([#545](https://github.com/tauri-apps/plugins-workspace/pull/545)) Fixes docs.rs build by enabling the `tauri/dox` feature flag. d6e80b)([#545](https://github.com/tauri-apps/plugins-workspace/pull/545)) Fixes docs.rs build by enabling the `tauri/dox` feature flag.
- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
### Dependencies
- Upgraded to `fs@2.0.0-alpha.1`
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
\`
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
ri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
\`
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
hub.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
ri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
\`
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
alpha release!
pull/371)) First v2 alpha release!
ri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
\`
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
71]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
7ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
71]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lpha release!
pull/371)) First v2 alpha release!
lease!
pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-dialog" name = "tauri-plugin-dialog"
version = "2.0.4" version = "2.2.0"
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application." description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@ -34,7 +34,7 @@ tauri = { workspace = true }
log = { workspace = true } log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
url = { workspace = true } url = { workspace = true }
tauri-plugin-fs = { path = "../fs", version = "2.1.0" } tauri-plugin-fs = { path = "../fs", version = "2.2.0" }
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true, features = ["wry"] }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-dialog", "name": "@tauri-apps/plugin-dialog",
"version": "2.0.1", "version": "2.2.0",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -1,5 +1,13 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.4]
- [`77b85507`](https://github.com/tauri-apps/plugins-workspace/commit/77b855074aad612f2b28e6a3b5881fac767a05ae) ([#2171](https://github.com/tauri-apps/plugins-workspace/pull/2171) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed docs.rs build.
## \[2.0.3] ## \[2.0.3]
- [`ed981027`](https://github.com/tauri-apps/plugins-workspace/commit/ed981027dd4fba7d0e2f836eb5db34d344388d73) ([#1962](https://github.com/tauri-apps/plugins-workspace/pull/1962) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Improve performance of `readTextFile` and `readTextFileLines` APIs - [`ed981027`](https://github.com/tauri-apps/plugins-workspace/commit/ed981027dd4fba7d0e2f836eb5db34d344388d73) ([#1962](https://github.com/tauri-apps/plugins-workspace/pull/1962) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Improve performance of `readTextFile` and `readTextFileLines` APIs
@ -167,41 +175,3 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
/pull/454)) Fix `writeBinaryFile` crashing with `command 'write_binary_file' not found`
- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
s/plugins-workspace/pull/371)) First v2 alpha release!
ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
kspace/pull/371)) First v2 alpha release!
s/plugins-workspace/pull/371)) First v2 alpha release!
ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
uri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
kspace/pull/371)) First v2 alpha release!
s/plugins-workspace/pull/371)) First v2 alpha release!
ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
kspace/pull/371)) First v2 alpha release!
s/plugins-workspace/pull/371)) First v2 alpha release!
ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-fs" name = "tauri-plugin-fs"
version = "2.1.0" version = "2.2.0"
description = "Access the file system." description = "Access the file system."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@ -38,11 +38,11 @@ anyhow = "1"
uuid = { version = "1", features = ["v4"] } uuid = { version = "1", features = ["v4"] }
glob = { workspace = true } glob = { workspace = true }
# TODO: Remove `serialization-compat-6` in v3 # TODO: Remove `serialization-compat-6` in v3
notify = { version = "7", optional = true, features = [ notify = { version = "8", optional = true, features = [
"serde", "serde",
"serialization-compat-6", "serialization-compat-6",
] } ] }
notify-debouncer-full = { version = "0.4", optional = true } notify-debouncer-full = { version = "0.5", optional = true }
dunce = { workspace = true } dunce = { workspace = true }
percent-encoding = "2" percent-encoding = "2"

File diff suppressed because one or more lines are too long

@ -208,11 +208,18 @@ permissions = [
} }
} }
tauri_plugin::Builder::new(&COMMANDS.iter().map(|c| c.0).collect::<Vec<_>>()) tauri_plugin::Builder::new(
.global_api_script_path("./api-iife.js") &COMMANDS
.global_scope_schema(schemars::schema_for!(FsScopeEntry)) .iter()
.android_path("android") // FIXME: https://docs.rs/crate/tauri-plugin-fs/2.1.0/builds/1571296
.build(); .filter(|c| c.1.is_empty())
.map(|c| c.0)
.collect::<Vec<_>>(),
)
.global_api_script_path("./api-iife.js")
.global_scope_schema(schemars::schema_for!(FsScopeEntry))
.android_path("android")
.build();
// workaround to include nested permissions as `tauri_plugin` doesn't support it // workaround to include nested permissions as `tauri_plugin` doesn't support it
let permissions_dir = autogenerated.join("commands"); let permissions_dir = autogenerated.join("commands");
@ -234,9 +241,11 @@ permissions = [
.iter_mut() .iter_mut()
.filter(|p| p.identifier.starts_with("allow")) .filter(|p| p.identifier.starts_with("allow"))
{ {
p.commands for c in nested_commands.iter().map(|s| s.to_string()) {
.allow if !p.commands.allow.contains(&c) {
.extend(nested_commands.iter().map(|s| s.to_string())); p.commands.allow.push(c);
}
}
} }
let out = toml::to_string_pretty(&permission_file) let out = toml::to_string_pretty(&permission_file)
@ -248,7 +257,10 @@ permissions = [
{out}"# {out}"#
); );
std::fs::write(permission_path, out)
.unwrap_or_else(|_| panic!("failed to write {command}.toml")); if content != out {
std::fs::write(permission_path, out)
.unwrap_or_else(|_| panic!("failed to write {command}.toml"));
}
} }
} }

@ -10,7 +10,7 @@
* This module prevents path traversal, not allowing parent directory accessors to be used * This module prevents path traversal, not allowing parent directory accessors to be used
* (i.e. "/usr/path/to/../file" or "../path/to/file" paths are not allowed). * (i.e. "/usr/path/to/../file" or "../path/to/file" paths are not allowed).
* Paths accessed with this API must be either relative to one of the {@link BaseDirectory | base directories} * Paths accessed with this API must be either relative to one of the {@link BaseDirectory | base directories}
* or created with the {@link https://v2.tauri.app/reference/javascript/api/namespacepath | path API}. * or created with the {@link https://v2.tauri.app/reference/javascript/api/namespacepath/ | path API}.
* *
* The API has a scope configuration that forces you to restrict the paths that can be accessed using glob patterns. * The API has a scope configuration that forces you to restrict the paths that can be accessed using glob patterns.
* *
@ -604,8 +604,8 @@ async function copyFile(
options?: CopyFileOptions options?: CopyFileOptions
): Promise<void> { ): Promise<void> {
if ( if (
(fromPath instanceof URL && fromPath.protocol !== 'file:') || (fromPath instanceof URL && fromPath.protocol !== 'file:')
(toPath instanceof URL && toPath.protocol !== 'file:') || (toPath instanceof URL && toPath.protocol !== 'file:')
) { ) {
throw new TypeError('Must be a file URL.') throw new TypeError('Must be a file URL.')
} }
@ -919,8 +919,8 @@ async function rename(
options?: RenameOptions options?: RenameOptions
): Promise<void> { ): Promise<void> {
if ( if (
(oldPath instanceof URL && oldPath.protocol !== 'file:') || (oldPath instanceof URL && oldPath.protocol !== 'file:')
(newPath instanceof URL && newPath.protocol !== 'file:') || (newPath instanceof URL && newPath.protocol !== 'file:')
) { ) {
throw new TypeError('Must be a file URL.') throw new TypeError('Must be a file URL.')
} }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-fs", "name": "@tauri-apps/plugin-fs",
"version": "2.0.3", "version": "2.2.0",
"description": "Access the file system.", "description": "Access the file system.",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [

@ -53,10 +53,7 @@ impl FilePath {
#[inline] #[inline]
pub fn into_path(self) -> Result<PathBuf> { pub fn into_path(self) -> Result<PathBuf> {
match self { match self {
Self::Url(url) => url Self::Url(url) => url.to_file_path().map_err(|_| Error::InvalidPathUrl),
.to_file_path()
.map(PathBuf::from)
.map_err(|_| Error::InvalidPathUrl),
Self::Path(p) => Ok(p), Self::Path(p) => Ok(p),
} }
} }
@ -91,10 +88,7 @@ impl SafeFilePath {
#[inline] #[inline]
pub fn into_path(self) -> Result<PathBuf> { pub fn into_path(self) -> Result<PathBuf> {
match self { match self {
Self::Url(url) => url Self::Url(url) => url.to_file_path().map_err(|_| Error::InvalidPathUrl),
.to_file_path()
.map(PathBuf::from)
.map_err(|_| Error::InvalidPathUrl),
Self::Path(p) => Ok(p.as_ref().to_owned()), Self::Path(p) => Ok(p.as_ref().to_owned()),
} }
} }

@ -1,5 +1,26 @@
# Changelog # Changelog
## \[2.2.4]
- [`a1b3fa27`](https://github.com/tauri-apps/plugins-workspace/commit/a1b3fa27f11022c9b6622b4fab12d93239eb05de) ([#2515](https://github.com/tauri-apps/plugins-workspace/pull/2515) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Re-exported the `Geolocation`, `Haptics`, `Notification`, and `Os` structs so that they show up on docs.rs.
## \[2.2.3]
- [`406e6f48`](https://github.com/tauri-apps/plugins-workspace/commit/406e6f484cdc13d35c50fb949f7489ca9eeccc44) ([#2323](https://github.com/tauri-apps/plugins-workspace/pull/2323) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused build failures when the `haptics` or `geolocation` plugin was used without their `specta` feature flag enabled.
## \[2.2.2]
- [`c9c13a0f`](https://github.com/tauri-apps/plugins-workspace/commit/c9c13a0fe7cdaac223843f5ba33176252f8e22f5) ([#2316](https://github.com/tauri-apps/plugins-workspace/pull/2316) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) **Breaking change:** `specta` integration is now behind a `specta` feature flag like in Tauri.
- [`c9c13a0f`](https://github.com/tauri-apps/plugins-workspace/commit/c9c13a0fe7cdaac223843f5ba33176252f8e22f5) ([#2316](https://github.com/tauri-apps/plugins-workspace/pull/2316) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Unlock and widen `specta` version range to match Tauri. No API changes.
## \[2.2.1]
- [`fb67ab2b`](https://github.com/tauri-apps/plugins-workspace/commit/fb67ab2b926502bfc20d6b43fbdd156691ea8526) ([#2281](https://github.com/tauri-apps/plugins-workspace/pull/2281) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Added `specta-util` to fix a "dependency not found" compilation error.
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.

@ -1,7 +1,7 @@
[package] [package]
name = "tauri-plugin-geolocation" name = "tauri-plugin-geolocation"
description = "Get and track the device's current position" description = "Get and track the device's current position"
version = "2.0.1" version = "2.2.4"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@ -26,10 +26,13 @@ tauri-plugin = { workspace = true, features = ["build"] }
[dependencies] [dependencies]
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
tauri = { workspace = true, features = ["specta"] } tauri = { workspace = true }
log = { workspace = true } log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
specta = { workspace = true } specta = { workspace = true, optional = true }
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true, features = ["wry"] }
[features]
specta = ["dep:specta", "tauri/specta"]

@ -118,8 +118,8 @@ import {
let permissions = await checkPermissions() let permissions = await checkPermissions()
if ( if (
permissions.location === 'prompt' || permissions.location === 'prompt'
permissions.location === 'prompt-with-rationale' || permissions.location === 'prompt-with-rationale'
) { ) {
permissions = await requestPermissions(['location']) permissions = await requestPermissions(['location'])
} }

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_GEOLOCATION__=function(t){"use strict";function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,o){if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var i,o,s;"function"==typeof SuppressedError&&SuppressedError;const r="__TAURI_TO_IPC_KEY__";class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),o.set(this,0),s.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:r})=>{if(r===e(this,o,"f")){n(this,o,r+1),e(this,i,"f").call(this,t);const a=Object.keys(e(this,s,"f"));if(a.length>0){let t=r+1;for(const n of a.sort()){if(parseInt(n)!==t)break;{const o=e(this,s,"f")[n];delete e(this,s,"f")[n],e(this,i,"f").call(this,o),t+=1}}n(this,o,t)}}else e(this,s,"f")[r.toString()]=t}))}set onmessage(t){n(this,i,t)}get onmessage(){return e(this,i,"f")}[(i=new WeakMap,o=new WeakMap,s=new WeakMap,r)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[r]()}}async function c(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}return t.checkPermissions=async function(){return await async function(t){return c(`plugin:${t}|check_permissions`)}("geolocation")},t.clearWatch=async function(t){await c("plugin:geolocation|clear_watch",{channelId:t})},t.getCurrentPosition=async function(t){return await c("plugin:geolocation|get_current_position",{options:t})},t.requestPermissions=async function(t){return await c("plugin:geolocation|request_permissions",{permissions:t})},t.watchPosition=async function(t,e){const n=new a;return n.onmessage=t=>{"string"==typeof t?e(null,t):e(t)},await c("plugin:geolocation|watch_position",{options:t,channel:n}),n.id},t}({});Object.defineProperty(window.__TAURI__,"geolocation",{value:__TAURI_PLUGIN_GEOLOCATION__})} if("__TAURI__"in window){var __TAURI_PLUGIN_GEOLOCATION__=function(t){"use strict";function n(t,n,e,i){if("function"==typeof n||!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?i:"a"===e?i.call(t):i?i.value:n.get(t)}function e(t,n,e,i,s){if("function"==typeof n||!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(t,e),e}var i,s,o;"function"==typeof SuppressedError&&SuppressedError;const r="__TAURI_TO_IPC_KEY__";class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),s.set(this,0),o.set(this,[]),this.id=function(t,n=!1){return window.__TAURI_INTERNALS__.transformCallback(t,n)}((({message:t,id:r})=>{if(r==n(this,s,"f"))for(n(this,i,"f").call(this,t),e(this,s,n(this,s,"f")+1);n(this,s,"f")in n(this,o,"f");){const t=n(this,o,"f")[n(this,s,"f")];n(this,i,"f").call(this,t),delete n(this,o,"f")[n(this,s,"f")],e(this,s,n(this,s,"f")+1)}else n(this,o,"f")[r]=t}))}set onmessage(t){e(this,i,t)}get onmessage(){return n(this,i,"f")}[(i=new WeakMap,s=new WeakMap,o=new WeakMap,r)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[r]()}}async function c(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return t.checkPermissions=async function(){return await async function(t){return c(`plugin:${t}|check_permissions`)}("geolocation")},t.clearWatch=async function(t){await c("plugin:geolocation|clear_watch",{channelId:t})},t.getCurrentPosition=async function(t){return await c("plugin:geolocation|get_current_position",{options:t})},t.requestPermissions=async function(t){return await c("plugin:geolocation|request_permissions",{permissions:t})},t.watchPosition=async function(t,n){const e=new a;return e.onmessage=t=>{"string"==typeof t?n(null,t):n(t)},await c("plugin:geolocation|watch_position",{options:t,channel:e}),e.id},t}({});Object.defineProperty(window.__TAURI__,"geolocation",{value:__TAURI_PLUGIN_GEOLOCATION__})}

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-geolocation", "name": "@tauri-apps/plugin-geolocation",
"version": "2.0.0", "version": "2.2.4",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -7,7 +7,6 @@ use tauri::{command, ipc::Channel, AppHandle, Runtime};
use crate::{GeolocationExt, PermissionStatus, PermissionType, Position, PositionOptions, Result}; use crate::{GeolocationExt, PermissionStatus, PermissionType, Position, PositionOptions, Result};
#[command] #[command]
#[specta::specta]
pub(crate) async fn get_current_position<R: Runtime>( pub(crate) async fn get_current_position<R: Runtime>(
app: AppHandle<R>, app: AppHandle<R>,
options: Option<PositionOptions>, options: Option<PositionOptions>,
@ -16,7 +15,6 @@ pub(crate) async fn get_current_position<R: Runtime>(
} }
#[command] #[command]
#[specta::specta]
pub(crate) async fn watch_position<R: Runtime>( pub(crate) async fn watch_position<R: Runtime>(
app: AppHandle<R>, app: AppHandle<R>,
options: PositionOptions, options: PositionOptions,
@ -26,19 +24,16 @@ pub(crate) async fn watch_position<R: Runtime>(
} }
#[command] #[command]
#[specta::specta]
pub(crate) async fn clear_watch<R: Runtime>(app: AppHandle<R>, channel_id: u32) -> Result<()> { pub(crate) async fn clear_watch<R: Runtime>(app: AppHandle<R>, channel_id: u32) -> Result<()> {
app.geolocation().clear_watch(channel_id) app.geolocation().clear_watch(channel_id)
} }
#[command] #[command]
#[specta::specta]
pub(crate) async fn check_permissions<R: Runtime>(app: AppHandle<R>) -> Result<PermissionStatus> { pub(crate) async fn check_permissions<R: Runtime>(app: AppHandle<R>) -> Result<PermissionStatus> {
app.geolocation().check_permissions() app.geolocation().check_permissions()
} }
#[command] #[command]
#[specta::specta]
pub(crate) async fn request_permissions<R: Runtime>( pub(crate) async fn request_permissions<R: Runtime>(
app: AppHandle<R>, app: AppHandle<R>,
permissions: Option<Vec<PermissionType>>, permissions: Option<Vec<PermissionType>>,

@ -3,18 +3,18 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use serde::{ser::Serializer, Serialize}; use serde::{ser::Serializer, Serialize};
use specta::Type;
pub type Result<T> = std::result::Result<T, Error>; pub type Result<T> = std::result::Result<T, Error>;
// TODO: Improve Error handling (different typed errors instead of one (stringified) PluginInvokeError for all mobile errors) // TODO: Improve Error handling (different typed errors instead of one (stringified) PluginInvokeError for all mobile errors)
#[derive(Debug, thiserror::Error, Type)] #[derive(Debug, thiserror::Error)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
pub enum Error { pub enum Error {
#[cfg(mobile)] #[cfg(mobile)]
#[error(transparent)] #[error(transparent)]
PluginInvoke( PluginInvoke(
#[serde(skip)] #[cfg_attr(feature = "specta", serde(skip))]
#[from] #[from]
tauri::plugin::mobile::PluginInvokeError, tauri::plugin::mobile::PluginInvokeError,
), ),

@ -7,8 +7,6 @@ use tauri::{
Manager, Runtime, Manager, Runtime,
}; };
//use tauri_specta::*;
pub use models::*; pub use models::*;
#[cfg(desktop)] #[cfg(desktop)]
@ -23,27 +21,9 @@ mod models;
pub use error::{Error, Result}; pub use error::{Error, Result};
#[cfg(desktop)] #[cfg(desktop)]
use desktop::Geolocation; pub use desktop::Geolocation;
#[cfg(mobile)] #[cfg(mobile)]
use mobile::Geolocation; pub use mobile::Geolocation;
/* macro_rules! specta_builder {
() => {
ts::builder()
.commands(collect_commands![
commands::get_current_position,
commands::watch_position,
commands::clear_watch,
commands::check_permissions,
commands::request_permissions
])
.header("// @ts-nocheck")
.config(
specta::ts::ExportConfig::default()
.bigint(specta::ts::BigIntExportBehavior::Number),
)
};
} */
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the geolocation APIs. /// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the geolocation APIs.
pub trait GeolocationExt<R: Runtime> { pub trait GeolocationExt<R: Runtime> {
@ -58,9 +38,6 @@ impl<R: Runtime, T: Manager<R>> crate::GeolocationExt<R> for T {
/// Initializes the plugin. /// Initializes the plugin.
pub fn init<R: Runtime>() -> TauriPlugin<R> { pub fn init<R: Runtime>() -> TauriPlugin<R> {
/* let (invoke_handler, register_events) =
specta_builder!().build_plugin_utils("geolocation").unwrap(); */
Builder::new("geolocation") Builder::new("geolocation")
.invoke_handler(tauri::generate_handler![ .invoke_handler(tauri::generate_handler![
commands::get_current_position, commands::get_current_position,
@ -79,22 +56,3 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
}) })
.build() .build()
} }
/* #[cfg(test)]
mod test {
use super::*;
#[test]
fn export_types() {
specta_builder!()
.path("./guest-js/bindings.ts")
.config(
specta::ts::ExportConfig::default()
.formatter(specta::ts::formatter::prettier)
.bigint(specta::ts::BigIntExportBehavior::Number),
)
.export_for_plugin("geolocation")
.expect("failed to export specta types");
}
}
*/

@ -3,10 +3,10 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use specta::Type;
use tauri::plugin::PermissionState; use tauri::plugin::PermissionState;
#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] #[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PermissionStatus { pub struct PermissionStatus {
/// Permission state for the location alias. /// Permission state for the location alias.
@ -25,7 +25,8 @@ pub struct PermissionStatus {
pub coarse_location: PermissionState, pub coarse_location: PermissionState,
} }
#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] #[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PositionOptions { pub struct PositionOptions {
/// High accuracy mode (such as GPS, if available) /// High accuracy mode (such as GPS, if available)
@ -46,14 +47,16 @@ pub struct PositionOptions {
pub maximum_age: u32, pub maximum_age: u32,
} }
#[derive(Debug, Clone, Serialize, Deserialize, Type)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum PermissionType { pub enum PermissionType {
Location, Location,
CoarseLocation, CoarseLocation,
} }
#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] #[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Coordinates { pub struct Coordinates {
/// Latitude in decimal degrees. /// Latitude in decimal degrees.
@ -73,7 +76,8 @@ pub struct Coordinates {
pub heading: Option<f64>, pub heading: Option<f64>,
} }
#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] #[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Position { pub struct Position {
/// Creation time for these coordinates. /// Creation time for these coordinates.
@ -83,7 +87,8 @@ pub struct Position {
pub coords: Coordinates, pub coords: Coordinates,
} }
#[derive(Debug, Clone, Serialize, Deserialize, Type)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(untagged)] #[serde(untagged)]
pub enum WatchEvent { pub enum WatchEvent {
Position(Position), Position(Position),

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
@ -104,22 +108,3 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
\-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
st v2 alpha release!
]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-global-shortcut" name = "tauri-plugin-global-shortcut"
version = "2.0.1" version = "2.2.0"
description = "Register global hotkeys listeners on your Tauri application." description = "Register global hotkeys listeners on your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBAL_SHORTCUT__=function(t){"use strict";function e(t,e,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)}function r(t,e,r,s,n){if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var s,n,i;"function"==typeof SuppressedError&&SuppressedError;const o="__TAURI_TO_IPC_KEY__";class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),i.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:o})=>{if(o===e(this,n,"f")){r(this,n,o+1),e(this,s,"f").call(this,t);const a=Object.keys(e(this,i,"f"));if(a.length>0){let t=o+1;for(const r of a.sort()){if(parseInt(r)!==t)break;{const n=e(this,i,"f")[r];delete e(this,i,"f")[r],e(this,s,"f").call(this,n),t+=1}}r(this,n,t)}}else e(this,i,"f")[o.toString()]=t}))}set onmessage(t){r(this,s,t)}get onmessage(){return e(this,s,"f")}[(s=new WeakMap,n=new WeakMap,i=new WeakMap,o)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[o]()}}async function _(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return t.isRegistered=async function(t){return await _("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new a;return r.onmessage=e,await _("plugin:global-shortcut|register",{shortcuts:Array.isArray(t)?t:[t],handler:r})},t.unregister=async function(t){return await _("plugin:global-shortcut|unregister",{shortcuts:Array.isArray(t)?t:[t]})},t.unregisterAll=async function(){return await _("plugin:global-shortcut|unregister_all",{})},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBAL_SHORTCUT__})} if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBAL_SHORTCUT__=function(t){"use strict";function e(t,e,r,s){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)}function r(t,e,r,s,i){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var s,i,n;"function"==typeof SuppressedError&&SuppressedError;const o="__TAURI_TO_IPC_KEY__";class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),i.set(this,0),n.set(this,[]),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:o})=>{if(o==e(this,i,"f"))for(e(this,s,"f").call(this,t),r(this,i,e(this,i,"f")+1);e(this,i,"f")in e(this,n,"f");){const t=e(this,n,"f")[e(this,i,"f")];e(this,s,"f").call(this,t),delete e(this,n,"f")[e(this,i,"f")],r(this,i,e(this,i,"f")+1)}else e(this,n,"f")[o]=t}))}set onmessage(t){r(this,s,t)}get onmessage(){return e(this,s,"f")}[(s=new WeakMap,i=new WeakMap,n=new WeakMap,o)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[o]()}}async function _(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return t.isRegistered=async function(t){return await _("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new a;return r.onmessage=e,await _("plugin:global-shortcut|register",{shortcuts:Array.isArray(t)?t:[t],handler:r})},t.unregister=async function(t){return await _("plugin:global-shortcut|unregister",{shortcuts:Array.isArray(t)?t:[t]})},t.unregisterAll=async function(){return await _("plugin:global-shortcut|unregister_all",{})},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBAL_SHORTCUT__})}

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-global-shortcut", "name": "@tauri-apps/plugin-global-shortcut",
"version": "2.0.0", "version": "2.2.0",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -1,5 +1,26 @@
# Changelog # Changelog
## \[2.2.4]
- [`a1b3fa27`](https://github.com/tauri-apps/plugins-workspace/commit/a1b3fa27f11022c9b6622b4fab12d93239eb05de) ([#2515](https://github.com/tauri-apps/plugins-workspace/pull/2515) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Re-exported the `Geolocation`, `Haptics`, `Notification`, and `Os` structs so that they show up on docs.rs.
## \[2.2.3]
- [`406e6f48`](https://github.com/tauri-apps/plugins-workspace/commit/406e6f484cdc13d35c50fb949f7489ca9eeccc44) ([#2323](https://github.com/tauri-apps/plugins-workspace/pull/2323) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused build failures when the `haptics` or `geolocation` plugin was used without their `specta` feature flag enabled.
## \[2.2.2]
- [`c9c13a0f`](https://github.com/tauri-apps/plugins-workspace/commit/c9c13a0fe7cdaac223843f5ba33176252f8e22f5) ([#2316](https://github.com/tauri-apps/plugins-workspace/pull/2316) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) **Breaking change:** `specta` integration is now behind a `specta` feature flag like in Tauri.
- [`c9c13a0f`](https://github.com/tauri-apps/plugins-workspace/commit/c9c13a0fe7cdaac223843f5ba33176252f8e22f5) ([#2316](https://github.com/tauri-apps/plugins-workspace/pull/2316) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Unlock and widen `specta` version range to match Tauri. No API changes.
## \[2.2.1]
- [`fb67ab2b`](https://github.com/tauri-apps/plugins-workspace/commit/fb67ab2b926502bfc20d6b43fbdd156691ea8526) ([#2281](https://github.com/tauri-apps/plugins-workspace/pull/2281) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Added `specta-util` to fix a "dependency not found" compilation error.
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.

@ -1,7 +1,7 @@
[package] [package]
name = "tauri-plugin-haptics" name = "tauri-plugin-haptics"
description = "Haptic feedback and vibrations on Android and iOS" description = "Haptic feedback and vibrations on Android and iOS"
version = "2.0.1" version = "2.2.4"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@ -26,10 +26,13 @@ tauri-plugin = { workspace = true, features = ["build"] }
[dependencies] [dependencies]
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
tauri = { workspace = true, features = ["specta"] } tauri = { workspace = true }
log = { workspace = true } log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
specta = { workspace = true } specta = { workspace = true, optional = true }
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true, features = ["wry"] }
[features]
specta = ["dep:specta", "tauri/specta"]

@ -69,6 +69,19 @@ fn main() {
} }
``` ```
Second, add the required permissions in the project:
`src-tauri/capabilities/default.json`
```json
"permissions": [
"haptics:allow-impact-feedback",
"haptics:allow-notification-feedback",
"haptics:allow-selection-feedback",
"haptics:allow-vibrate"
]
```
Afterwards all the plugin's APIs are available through the JavaScript guest bindings: Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
```javascript ```javascript

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-haptics", "name": "@tauri-apps/plugin-haptics",
"version": "2.0.0", "version": "2.2.4",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -7,13 +7,11 @@ use tauri::{command, AppHandle, Runtime};
use crate::{HapticsExt, ImpactFeedbackStyle, NotificationFeedbackType, Result}; use crate::{HapticsExt, ImpactFeedbackStyle, NotificationFeedbackType, Result};
#[command] #[command]
#[specta::specta]
pub(crate) async fn vibrate<R: Runtime>(app: AppHandle<R>, duration: u32) -> Result<()> { pub(crate) async fn vibrate<R: Runtime>(app: AppHandle<R>, duration: u32) -> Result<()> {
app.haptics().vibrate(duration) app.haptics().vibrate(duration)
} }
#[command] #[command]
#[specta::specta]
pub(crate) async fn impact_feedback<R: Runtime>( pub(crate) async fn impact_feedback<R: Runtime>(
app: AppHandle<R>, app: AppHandle<R>,
style: ImpactFeedbackStyle, style: ImpactFeedbackStyle,
@ -22,7 +20,6 @@ pub(crate) async fn impact_feedback<R: Runtime>(
} }
#[command] #[command]
#[specta::specta]
pub(crate) async fn notification_feedback<R: Runtime>( pub(crate) async fn notification_feedback<R: Runtime>(
app: AppHandle<R>, app: AppHandle<R>,
r#type: NotificationFeedbackType, r#type: NotificationFeedbackType,
@ -31,7 +28,6 @@ pub(crate) async fn notification_feedback<R: Runtime>(
} }
#[command] #[command]
#[specta::specta]
pub(crate) async fn selection_feedback<R: Runtime>(app: AppHandle<R>) -> Result<()> { pub(crate) async fn selection_feedback<R: Runtime>(app: AppHandle<R>) -> Result<()> {
app.haptics().selection_feedback() app.haptics().selection_feedback()
} }

@ -3,18 +3,18 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use serde::{ser::Serializer, Serialize}; use serde::{ser::Serializer, Serialize};
use specta::Type;
pub type Result<T> = std::result::Result<T, Error>; pub type Result<T> = std::result::Result<T, Error>;
// TODO: Improve Error handling (different typed errors instead of one (stringified) PluginInvokeError for all mobile errors) // TODO: Improve Error handling (different typed errors instead of one (stringified) PluginInvokeError for all mobile errors)
#[derive(Debug, thiserror::Error, Type)] #[derive(Debug, thiserror::Error)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
pub enum Error { pub enum Error {
#[cfg(mobile)] #[cfg(mobile)]
#[error(transparent)] #[error(transparent)]
PluginInvoke( PluginInvoke(
#[serde(skip)] #[cfg_attr(feature = "specta", serde(skip))]
#[from] #[from]
tauri::plugin::mobile::PluginInvokeError, tauri::plugin::mobile::PluginInvokeError,
), ),

@ -7,8 +7,6 @@ use tauri::{
Manager, Runtime, Manager, Runtime,
}; };
//use tauri_specta::*;
pub use models::*; pub use models::*;
#[cfg(desktop)] #[cfg(desktop)]
@ -23,26 +21,9 @@ mod models;
pub use error::{Error, Result}; pub use error::{Error, Result};
#[cfg(desktop)] #[cfg(desktop)]
use desktop::Haptics; pub use desktop::Haptics;
#[cfg(mobile)] #[cfg(mobile)]
use mobile::Haptics; pub use mobile::Haptics;
/* macro_rules! specta_builder {
() => {
ts::builder()
.commands(collect_commands![
commands::vibrate,
commands::impact_feedback,
commands::notification_feedback,
commands::selection_feedback
])
.header("// @ts-nocheck")
.config(
specta::ts::ExportConfig::default()
.bigint(specta::ts::BigIntExportBehavior::Number),
)
};
} */
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the haptics APIs. /// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the haptics APIs.
pub trait HapticsExt<R: Runtime> { pub trait HapticsExt<R: Runtime> {
@ -57,9 +38,6 @@ impl<R: Runtime, T: Manager<R>> crate::HapticsExt<R> for T {
/// Initializes the plugin. /// Initializes the plugin.
pub fn init<R: Runtime>() -> TauriPlugin<R> { pub fn init<R: Runtime>() -> TauriPlugin<R> {
/* let (invoke_handler, register_events) =
specta_builder!().build_plugin_utils("haptics").unwrap(); */
Builder::new("haptics") Builder::new("haptics")
.invoke_handler(tauri::generate_handler![ .invoke_handler(tauri::generate_handler![
commands::vibrate, commands::vibrate,
@ -77,22 +55,3 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
}) })
.build() .build()
} }
/* #[cfg(test)]
mod test {
use super::*;
#[test]
fn export_types() {
specta_builder!()
.path("./guest-js/bindings.ts")
.config(
specta::ts::ExportConfig::default()
.formatter(specta::ts::formatter::prettier)
.bigint(specta::ts::BigIntExportBehavior::Number),
)
.export_for_plugin("haptics")
.expect("failed to export specta types");
}
}
*/

@ -3,9 +3,9 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use specta::Type;
/* /*
#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] #[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct HapticsOptions { pub struct HapticsOptions {
// TODO: support array to match web api // TODO: support array to match web api
@ -13,7 +13,8 @@ pub struct HapticsOptions {
} }
*/ */
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, Type)] #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum ImpactFeedbackStyle { pub enum ImpactFeedbackStyle {
Light, Light,
@ -24,7 +25,8 @@ pub enum ImpactFeedbackStyle {
Rigid, Rigid,
} }
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, Type)] #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum NotificationFeedbackType { pub enum NotificationFeedbackType {
#[default] #[default]

@ -1,5 +1,31 @@
# Changelog # Changelog
## \[2.4.1]
- [`d3183aa9`](https://github.com/tauri-apps/plugins-workspace/commit/d3183aa99da7ca67e627394132ddeb3b85ccef06) ([#2522](https://github.com/tauri-apps/plugins-workspace/pull/2522) by [@adrieljss](https://github.com/tauri-apps/plugins-workspace/../../adrieljss)) Fix `fetch` blocking until the whole response is read even if it was a streaming response.
## \[2.4.0]
- [`cb38f54f`](https://github.com/tauri-apps/plugins-workspace/commit/cb38f54f4a4ef30995283cd82166c62da17bac44) ([#2479](https://github.com/tauri-apps/plugins-workspace/pull/2479) by [@adrieljss](https://github.com/tauri-apps/plugins-workspace/../../adrieljss)) Add stream support for HTTP stream responses.
## \[2.3.0]
- [`10513649`](https://github.com/tauri-apps/plugins-workspace/commit/105136494c5a5bf4b1f1cc06cc71815412d17ec8) ([#2204](https://github.com/tauri-apps/plugins-workspace/pull/2204) by [@RickeyWard](https://github.com/tauri-apps/plugins-workspace/../../RickeyWard)) Add `dangerous-settings` feature flag and new JS `danger` option to disable tls hostname/certificate validation.
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
### Dependencies
- Upgraded to `fs@2.2.0`
## \[2.0.2]
### Dependencies
- Upgraded to `fs-js@2.0.4`
## \[2.0.4] ## \[2.0.4]
- [`a3b553dd`](https://github.com/tauri-apps/plugins-workspace/commit/a3b553ddb403771aa699362c4e69a064b7731da5) ([#2079](https://github.com/tauri-apps/plugins-workspace/pull/2079) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add tracing logs for requestes and responses behind `tracing` feature flag. - [`a3b553dd`](https://github.com/tauri-apps/plugins-workspace/commit/a3b553ddb403771aa699362c4e69a064b7731da5) ([#2079](https://github.com/tauri-apps/plugins-workspace/pull/2079) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add tracing logs for requestes and responses behind `tracing` feature flag.
@ -208,103 +234,3 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
ace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
2 alpha release!
!
371\)) First v2 alpha release!
/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
ace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
lpha release!
!
371\)) First v2 alpha release!
ub.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
ace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
lpha release!
!
371\)) First v2 alpha release!
lpha release!
!
371\)) First v2 alpha release!
t v2 alpha release!
!
371\)) First v2 alpha release!
ace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
lpha release!
!
371\)) First v2 alpha release!
lpha release!
!
371\)) First v2 alpha release!
lpha release!
!
371\)) First v2 alpha release!
lpha release!
lpha release!
!
371\)) First v2 alpha release!
lpha release!
!
371\)) First v2 alpha release!
ha release!
!
371\)) First v2 alpha release!
lease!
!
371\)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-http" name = "tauri-plugin-http"
version = "2.0.4" version = "2.4.1"
description = "Access an HTTP client written in Rust." description = "Access an HTTP client written in Rust."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@ -34,7 +34,7 @@ serde_json = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tokio = { version = "1", features = ["sync", "macros"] } tokio = { version = "1", features = ["sync", "macros"] }
tauri-plugin-fs = { path = "../fs", version = "2.1.0" } tauri-plugin-fs = { path = "../fs", version = "2.2.0" }
urlpattern = "0.3" urlpattern = "0.3"
regex = "1" regex = "1"
http = "1" http = "1"
@ -75,3 +75,4 @@ charset = ["reqwest/charset"]
macos-system-configuration = ["reqwest/macos-system-configuration"] macos-system-configuration = ["reqwest/macos-system-configuration"]
unsafe-headers = [] unsafe-headers = []
tracing = ["dep:tracing"] tracing = ["dep:tracing"]
dangerous-settings = []

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_HTTP__=function(e){"use strict";async function t(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;const r="Request canceled";return e.fetch=async function(e,n){const a=n?.signal;if(a?.aborted)throw new Error(r);const o=n?.maxRedirections,s=n?.connectTimeout,i=n?.proxy;n&&(delete n.maxRedirections,delete n.connectTimeout,delete n.proxy);const d=n?.headers?n.headers instanceof Headers?n.headers:new Headers(n.headers):new Headers,c=new Request(e,n),u=await c.arrayBuffer(),f=0!==u.byteLength?Array.from(new Uint8Array(u)):null;for(const[e,t]of c.headers)d.get(e)||d.set(e,t);const _=(d instanceof Headers?Array.from(d.entries()):Array.isArray(d)?d:Object.entries(d)).map((([e,t])=>[e,"string"==typeof t?t:t.toString()]));if(a?.aborted)throw new Error(r);const h=await t("plugin:http|fetch",{clientConfig:{method:c.method,url:c.url,headers:_,data:f,maxRedirections:o,connectTimeout:s,proxy:i}}),l=()=>t("plugin:http|fetch_cancel",{rid:h});if(a?.aborted)throw l(),new Error(r);a?.addEventListener("abort",(()=>{l()}));const{status:p,statusText:w,url:y,headers:T,rid:A}=await t("plugin:http|fetch_send",{rid:h}),g=await t("plugin:http|fetch_read_body",{rid:A}),R=new Response(g instanceof ArrayBuffer&&0!==g.byteLength?g:g instanceof Array&&g.length>0?new Uint8Array(g):null,{status:p,statusText:w});return Object.defineProperty(R,"url",{value:y}),Object.defineProperty(R,"headers",{value:new Headers(T)}),R},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_PLUGIN_HTTP__})} if("__TAURI__"in window){var __TAURI_PLUGIN_HTTP__=function(e){"use strict";function t(e,t,r,n){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function r(e,t,r,n,s){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var n,s,a;"function"==typeof SuppressedError&&SuppressedError;const i="__TAURI_TO_IPC_KEY__";class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),s.set(this,0),a.set(this,[]),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:i})=>{if(i==t(this,s,"f"))for(t(this,n,"f").call(this,e),r(this,s,t(this,s,"f")+1);t(this,s,"f")in t(this,a,"f");){const e=t(this,a,"f")[t(this,s,"f")];t(this,n,"f").call(this,e),delete t(this,a,"f")[t(this,s,"f")],r(this,s,t(this,s,"f")+1)}else t(this,a,"f")[i]=e}))}set onmessage(e){r(this,n,e)}get onmessage(){return t(this,n,"f")}[(n=new WeakMap,s=new WeakMap,a=new WeakMap,i)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[i]()}}async function c(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}const d="Request cancelled";return e.fetch=async function(e,t){const r=t?.signal;if(r?.aborted)throw new Error(d);const n=t?.maxRedirections,s=t?.connectTimeout,a=t?.proxy,i=t?.danger;t&&(delete t.maxRedirections,delete t.connectTimeout,delete t.proxy,delete t.danger);const h=t?.headers?t.headers instanceof Headers?t.headers:new Headers(t.headers):new Headers,f=new Request(e,t),_=await f.arrayBuffer(),u=0!==_.byteLength?Array.from(new Uint8Array(_)):null;for(const[e,t]of f.headers)h.get(e)||h.set(e,t);const l=(h instanceof Headers?Array.from(h.entries()):Array.isArray(h)?h:Object.entries(h)).map((([e,t])=>[e,"string"==typeof t?t:t.toString()]));if(r?.aborted)throw new Error(d);const w=await c("plugin:http|fetch",{clientConfig:{method:f.method,url:f.url,headers:l,data:u,maxRedirections:n,connectTimeout:s,proxy:a,danger:i}}),p=()=>c("plugin:http|fetch_cancel",{rid:w});if(r?.aborted)throw p(),new Error(d);r?.addEventListener("abort",(()=>{p()}));const{status:y,statusText:m,url:T,headers:g,rid:A}=await c("plugin:http|fetch_send",{rid:w}),R=new ReadableStream({start:e=>{const t=new o;t.onmessage=t=>{r?.aborted?e.error(d):(t instanceof ArrayBuffer?0!=t.byteLength:0!=t.length)?e.enqueue(new Uint8Array(t)):e.close()},c("plugin:http|fetch_read_body",{rid:A,streamChannel:t}).catch((t=>{e.error(t)}))}}),b=new Response(R,{status:y,statusText:m});return Object.defineProperty(b,"url",{value:T}),Object.defineProperty(b,"headers",{value:new Headers(g)}),b},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_PLUGIN_HTTP__})}

@ -26,7 +26,7 @@
* @module * @module
*/ */
import { invoke } from '@tauri-apps/api/core' import { Channel, invoke } from '@tauri-apps/api/core'
/** /**
* Configuration of a proxy that a Client should pass requests to. * Configuration of a proxy that a Client should pass requests to.
@ -84,9 +84,29 @@ export interface ClientOptions {
* Configuration of a proxy that a Client should pass requests to. * Configuration of a proxy that a Client should pass requests to.
*/ */
proxy?: Proxy proxy?: Proxy
/**
* Configuration for dangerous settings on the client such as disabling SSL verification.
*/
danger?: DangerousSettings
}
/**
* Configuration for dangerous settings on the client such as disabling SSL verification.
*
* @since 2.3.0
*/
export interface DangerousSettings {
/**
* Disables SSL verification.
*/
acceptInvalidCerts?: boolean
/**
* Disables hostname verification.
*/
acceptInvalidHostnames?: boolean
} }
const ERROR_REQUEST_CANCELLED = 'Request canceled' const ERROR_REQUEST_CANCELLED = 'Request cancelled'
/** /**
* Fetch a resource from the network. It returns a `Promise` that resolves to the * Fetch a resource from the network. It returns a `Promise` that resolves to the
@ -115,12 +135,14 @@ export async function fetch(
const maxRedirections = init?.maxRedirections const maxRedirections = init?.maxRedirections
const connectTimeout = init?.connectTimeout const connectTimeout = init?.connectTimeout
const proxy = init?.proxy const proxy = init?.proxy
const danger = init?.danger
// Remove these fields before creating the request // Remove these fields before creating the request
if (init) { if (init) {
delete init.maxRedirections delete init.maxRedirections
delete init.connectTimeout delete init.connectTimeout
delete init.proxy delete init.proxy
delete init.danger
} }
const headers = init?.headers const headers = init?.headers
@ -172,7 +194,8 @@ export async function fetch(
data, data,
maxRedirections, maxRedirections,
connectTimeout, connectTimeout,
proxy proxy,
danger
} }
}) })
@ -206,24 +229,45 @@ export async function fetch(
rid rid
}) })
const body = await invoke<ArrayBuffer | number[]>( const readableStreamBody = new ReadableStream({
'plugin:http|fetch_read_body', start: (controller) => {
{ const streamChannel = new Channel<ArrayBuffer | number[]>()
rid: responseRid streamChannel.onmessage = (res: ArrayBuffer | number[]) => {
} // close early if aborted
) if (signal?.aborted) {
controller.error(ERROR_REQUEST_CANCELLED)
return
}
// close when the signal to close (an empty chunk)
// is sent from the IPC.
if (
res instanceof ArrayBuffer ? res.byteLength == 0 : res.length == 0
) {
controller.close()
return
}
// the content conversion (like .text(), .json(), etc.) in Response
// must have Uint8Array as its content, else it will
// have untraceable error that's hard to debug.
controller.enqueue(new Uint8Array(res))
}
const res = new Response( // run a non-blocking body stream fetch
body instanceof ArrayBuffer && body.byteLength !== 0 invoke('plugin:http|fetch_read_body', {
? body rid: responseRid,
: body instanceof Array && body.length > 0 streamChannel
? new Uint8Array(body) }).catch((e) => {
: null, controller.error(e)
{ })
status,
statusText
} }
) })
const res = new Response(readableStreamBody, {
status,
statusText
})
// url and headers are read only properties // url and headers are read only properties
// but seems like we can set them like this // but seems like we can set them like this

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-http", "name": "@tauri-apps/plugin-http",
"version": "2.0.1", "version": "2.4.1",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
use tauri::{ use tauri::{
async_runtime::Mutex, async_runtime::Mutex,
command, command,
ipc::{CommandScope, GlobalScope}, ipc::{Channel, CommandScope, GlobalScope},
Manager, ResourceId, ResourceTable, Runtime, State, Webview, Manager, ResourceId, ResourceTable, Runtime, State, Webview,
}; };
use tokio::sync::oneshot::{channel, Receiver, Sender}; use tokio::sync::oneshot::{channel, Receiver, Sender};
@ -75,6 +75,14 @@ pub struct FetchResponse {
rid: ResourceId, rid: ResourceId,
} }
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
#[allow(dead_code)] //feature flags shoudln't affect api
pub struct DangerousSettings {
accept_invalid_certs: bool,
accept_invalid_hostnames: bool,
}
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ClientConfig { pub struct ClientConfig {
@ -85,6 +93,7 @@ pub struct ClientConfig {
connect_timeout: Option<u64>, connect_timeout: Option<u64>,
max_redirections: Option<usize>, max_redirections: Option<usize>,
proxy: Option<Proxy>, proxy: Option<Proxy>,
danger: Option<DangerousSettings>,
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
@ -181,6 +190,7 @@ pub async fn fetch<R: Runtime>(
connect_timeout, connect_timeout,
max_redirections, max_redirections,
proxy, proxy,
danger,
} = client_config; } = client_config;
let scheme = url.scheme(); let scheme = url.scheme();
@ -220,6 +230,24 @@ pub async fn fetch<R: Runtime>(
{ {
let mut builder = reqwest::ClientBuilder::new(); let mut builder = reqwest::ClientBuilder::new();
if let Some(danger_config) = danger {
#[cfg(not(feature = "dangerous-settings"))]
{
#[cfg(debug_assertions)]
{
eprintln!("[\x1b[33mWARNING\x1b[0m] using dangerous settings requires `dangerous-settings` feature flag in your Cargo.toml");
}
let _ = danger_config;
return Err(Error::DangerousSettings);
}
#[cfg(feature = "dangerous-settings")]
{
builder = builder
.danger_accept_invalid_certs(danger_config.accept_invalid_certs)
.danger_accept_invalid_hostnames(danger_config.accept_invalid_hostnames)
}
}
if let Some(timeout) = connect_timeout { if let Some(timeout) = connect_timeout {
builder = builder.connect_timeout(Duration::from_millis(timeout)); builder = builder.connect_timeout(Duration::from_millis(timeout));
} }
@ -287,6 +315,7 @@ pub async fn fetch<R: Runtime>(
tracing::trace!("{:?}", request); tracing::trace!("{:?}", request);
let fut = async move { request.send().await.map_err(Into::into) }; let fut = async move { request.send().await.map_err(Into::into) };
let mut resources_table = webview.resources_table(); let mut resources_table = webview.resources_table();
let rid = resources_table.add_request(Box::pin(fut)); let rid = resources_table.add_request(Box::pin(fut));
@ -330,7 +359,7 @@ pub fn fetch_cancel<R: Runtime>(webview: Webview<R>, rid: ResourceId) -> crate::
Ok(()) Ok(())
} }
#[tauri::command] #[command]
pub async fn fetch_send<R: Runtime>( pub async fn fetch_send<R: Runtime>(
webview: Webview<R>, webview: Webview<R>,
rid: ResourceId, rid: ResourceId,
@ -382,17 +411,28 @@ pub async fn fetch_send<R: Runtime>(
}) })
} }
#[tauri::command] #[command]
pub(crate) async fn fetch_read_body<R: Runtime>( pub async fn fetch_read_body<R: Runtime>(
webview: Webview<R>, webview: Webview<R>,
rid: ResourceId, rid: ResourceId,
) -> crate::Result<tauri::ipc::Response> { stream_channel: Channel<tauri::ipc::InvokeResponseBody>,
) -> crate::Result<()> {
let res = { let res = {
let mut resources_table = webview.resources_table(); let mut resources_table = webview.resources_table();
resources_table.take::<ReqwestResponse>(rid)? resources_table.take::<ReqwestResponse>(rid)?
}; };
let res = Arc::into_inner(res).unwrap().0;
Ok(tauri::ipc::Response::new(res.bytes().await?.to_vec())) let mut res = Arc::into_inner(res).unwrap().0;
// send response through IPC channel
while let Some(chunk) = res.chunk().await? {
stream_channel.send(tauri::ipc::InvokeResponseBody::Raw(chunk.to_vec()))?;
}
// send empty vector when done
stream_channel.send(tauri::ipc::InvokeResponseBody::Raw(Vec::new()))?;
Ok(())
} }
// forbidden headers per fetch spec https://fetch.spec.whatwg.org/#terminology-headers // forbidden headers per fetch spec https://fetch.spec.whatwg.org/#terminology-headers

@ -41,6 +41,8 @@ pub enum Error {
Tauri(#[from] tauri::Error), Tauri(#[from] tauri::Error),
#[error(transparent)] #[error(transparent)]
Utf8(#[from] std::string::FromUtf8Error), Utf8(#[from] std::string::FromUtf8Error),
#[error("dangerous settings used but are not enabled")]
DangerousSettings,
} }
impl Serialize for Error { impl Serialize for Error {

@ -80,7 +80,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
commands::fetch, commands::fetch,
commands::fetch_cancel, commands::fetch_cancel,
commands::fetch_send, commands::fetch_send,
commands::fetch_read_body, commands::fetch_read_body
]) ])
.build() .build()
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.1.0] ## \[2.1.0]
- [`3449dd5a`](https://github.com/tauri-apps/plugins-workspace/commit/3449dd5a8f6d12fee8d6389c034fe47e19d72bcd) ([#1982](https://github.com/tauri-apps/plugins-workspace/pull/1982) by [@arihav](https://github.com/tauri-apps/plugins-workspace/../../arihav)) Add custom host binding to allow external access - [`3449dd5a`](https://github.com/tauri-apps/plugins-workspace/commit/3449dd5a8f6d12fee8d6389c034fe47e19d72bcd) ([#1982](https://github.com/tauri-apps/plugins-workspace/pull/1982) by [@arihav](https://github.com/tauri-apps/plugins-workspace/../../arihav)) Add custom host binding to allow external access

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-localhost" name = "tauri-plugin-localhost"
version = "2.1.0" version = "2.2.0"
description = "Expose your apps assets through a localhost server instead of the default custom protocol." description = "Expose your apps assets through a localhost server instead of the default custom protocol."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -1,5 +1,35 @@
# Changelog # Changelog
## \[2.3.1]
- [`1bb1ced5`](https://github.com/tauri-apps/plugins-workspace/commit/1bb1ced53820127204aa7adf57510c1cbce55e12) ([#2524](https://github.com/tauri-apps/plugins-workspace/pull/2524) by [@elwerene](https://github.com/tauri-apps/plugins-workspace/../../elwerene)) enable TargetKind::LogDir on mobile
## \[2.3.0]
### feat
- [`02481501`](https://github.com/tauri-apps/plugins-workspace/commit/024815018fbc63a37afc716796a454925aa7d25e) ([#2377](https://github.com/tauri-apps/plugins-workspace/pull/2377) by [@3lpsy](https://github.com/tauri-apps/plugins-workspace/../../3lpsy)) Add a `is_skip_logger` flag to the Log Plugin `Builder` struct, a `skip_logger()` method to the Builder, and logic to avoid acquiring (creating) a logger and attaching it to the global logger. Since acquire_logger is pub, a `LoggerNotInitialized` is added and returned if it's called when the `is_skip_looger` flag is set. Overall, this feature permits a user to avoid calling `attach_logger` which can only be called once in a program's lifetime and allows the user to control the logger returned from `logger()`. Additionally, it also will allow users to generate multiple Tauri Mock apps in test suites that run and parallel and have the `log` plugin attached (assuming they use `skip_logger()`).
## \[2.2.3]
- [`1a984659`](https://github.com/tauri-apps/plugins-workspace/commit/1a9846599b6a71faf330845847a30f6bf9735898) ([#2469](https://github.com/tauri-apps/plugins-workspace/pull/2469) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Update `objc2` crate to 0.6. No user facing changes.
## \[2.2.2]
- [`6b4c3917`](https://github.com/tauri-apps/plugins-workspace/commit/6b4c3917389f4bc489d03b48a837557ac0584175) ([#2401](https://github.com/tauri-apps/plugins-workspace/pull/2401) by [@Seishiin](https://github.com/tauri-apps/plugins-workspace/../../Seishiin)) Fix timezone_strategy overwriting previously set LogLevels.
## \[2.2.1]
- [`784a54a3`](https://github.com/tauri-apps/plugins-workspace/commit/784a54a39094dfbaaa8dd123eb083c04dc6c3bb2) ([#2344](https://github.com/tauri-apps/plugins-workspace/pull/2344) by [@madsmtm](https://github.com/tauri-apps/plugins-workspace/../../madsmtm)) Use `objc2` instead of `objc`.
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.2]
- [`69d508ee`](https://github.com/tauri-apps/plugins-workspace/commit/69d508ee6910ae4064f2398fbacb803b3944d6a8) ([#2157](https://github.com/tauri-apps/plugins-workspace/pull/2157) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Make log functions omit caller location when failed to parse it instead of throwing
## \[2.0.1] ## \[2.0.1]
- [`371a2f73`](https://github.com/tauri-apps/plugins-workspace/commit/371a2f7361e0b91cf66f1287ffb18b34414a6cb8) ([#2021](https://github.com/tauri-apps/plugins-workspace/pull/2021) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Make webview log target more consistent that it always starts with `webview` - [`371a2f73`](https://github.com/tauri-apps/plugins-workspace/commit/371a2f7361e0b91cf66f1287ffb18b34414a6cb8) ([#2021](https://github.com/tauri-apps/plugins-workspace/pull/2021) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Make webview log target more consistent that it always starts with `webview`
@ -104,15 +134,3 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
v2 alpha release!
https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ase!
https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-log" name = "tauri-plugin-log"
version = "2.0.3" version = "2.3.1"
description = "Configurable logging for your Tauri app." description = "Configurable logging for your Tauri app."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@ -17,8 +17,8 @@ rustdoc-args = ["--cfg", "docsrs"]
windows = { level = "full", notes = "" } windows = { level = "full", notes = "" }
linux = { level = "full", notes = "" } linux = { level = "full", notes = "" }
macos = { level = "full", notes = "" } macos = { level = "full", notes = "" }
android = { level = "unknown", notes = "" } android = { level = "full", notes = "" }
ios = { level = "unknown", notes = "" } ios = { level = "full", notes = "" }
[build-dependencies] [build-dependencies]
tauri-plugin = { workspace = true, features = ["build"] } tauri-plugin = { workspace = true, features = ["build"] }
@ -35,12 +35,15 @@ time = { version = "0.3", features = ["formatting", "local-offset"] }
fern = "0.7" fern = "0.7"
[target."cfg(target_os = \"android\")".dependencies] [target."cfg(target_os = \"android\")".dependencies]
android_logger = "0.14" android_logger = "0.15"
[target."cfg(target_os = \"ios\")".dependencies] [target."cfg(target_os = \"ios\")".dependencies]
swift-rs = "1" swift-rs = "1"
objc = "0.2" objc2 = "0.6"
cocoa = "0.26" objc2-foundation = { version = "0.3", default-features = false, features = [
"std",
"NSString",
] }
[features] [features]
colored = ["fern/colored"] colored = ["fern/colored"]

@ -54,7 +54,23 @@ yarn add https://github.com/tauri-apps/tauri-plugin-log#v2
## Usage ## Usage
First you need to register the core plugin with Tauri: First, you should enable the `log:default` capability:
```json
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": [
"core:default",
"opener:default",
"log:default" # add this!
]
}
```
Then, you need to register the core plugin with Tauri:
`src-tauri/src/lib.rs` `src-tauri/src/lib.rs`

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-log", "name": "@tauri-apps/plugin-log",
"version": "2.0.1", "version": "2.3.1",
"description": "Configurable logging for your Tauri app.", "description": "Configurable logging for your Tauri app.",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [

@ -35,31 +35,6 @@ pub const WEBVIEW_TARGET: &str = "webview";
#[cfg(target_os = "ios")] #[cfg(target_os = "ios")]
mod ios { mod ios {
use cocoa::base::id;
use objc::*;
const UTF8_ENCODING: usize = 4;
pub struct NSString(pub id);
impl NSString {
pub fn new(s: &str) -> Self {
// Safety: objc runtime calls are unsafe
NSString(unsafe {
let ns_string: id = msg_send![class!(NSString), alloc];
let ns_string: id = msg_send![ns_string,
initWithBytes:s.as_ptr()
length:s.len()
encoding:UTF8_ENCODING];
// The thing is allocated in rust, the thing must be set to autorelease in rust to relinquish control
// or it can not be released correctly in OC runtime
let _: () = msg_send![ns_string, autorelease];
ns_string
})
}
}
swift_rs::swift!(pub fn tauri_log( swift_rs::swift!(pub fn tauri_log(
level: u8, message: *const std::ffi::c_void level: u8, message: *const std::ffi::c_void
)); ));
@ -83,6 +58,8 @@ pub enum Error {
TimeFormat(#[from] time::error::Format), TimeFormat(#[from] time::error::Format),
#[error(transparent)] #[error(transparent)]
InvalidFormatDescription(#[from] time::error::InvalidFormatDescription), InvalidFormatDescription(#[from] time::error::InvalidFormatDescription),
#[error("Internal logger disabled and cannot be acquired or attached")]
LoggerNotInitialized,
} }
/// An enum representing the available verbosity levels of the logger. /// An enum representing the available verbosity levels of the logger.
@ -182,11 +159,12 @@ pub enum TargetKind {
/// ///
/// ### Platform-specific /// ### Platform-specific
/// ///
/// |Platform | Value | Example | /// |Platform | Value | Example |
/// | ------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------- | /// | --------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
/// | Linux | `$XDG_DATA_HOME/{bundleIdentifier}/logs` or `$HOME/.local/share/{bundleIdentifier}/logs` | `/home/alice/.local/share/com.tauri.dev/logs` | /// | Linux | `$XDG_DATA_HOME/{bundleIdentifier}/logs` or `$HOME/.local/share/{bundleIdentifier}/logs` | `/home/alice/.local/share/com.tauri.dev/logs` |
/// | macOS | `{homeDir}/Library/Logs/{bundleIdentifier}` | `/Users/Alice/Library/Logs/com.tauri.dev` | /// | macOS/iOS | `{homeDir}/Library/Logs/{bundleIdentifier}` | `/Users/Alice/Library/Logs/com.tauri.dev` |
/// | Windows | `{FOLDERID_LocalAppData}/{bundleIdentifier}/logs` | `C:\Users\Alice\AppData\Local\com.tauri.dev\logs` | /// | Windows | `{FOLDERID_LocalAppData}/{bundleIdentifier}/logs` | `C:\Users\Alice\AppData\Local\com.tauri.dev\logs` |
/// | Android | `{ConfigDir}/logs` | `/data/data/com.tauri.dev/files/logs` |
LogDir { file_name: Option<String> }, LogDir { file_name: Option<String> },
/// Forward logs to the webview (via the `log://log` event). /// Forward logs to the webview (via the `log://log` event).
/// ///
@ -255,6 +233,7 @@ pub struct Builder {
timezone_strategy: TimezoneStrategy, timezone_strategy: TimezoneStrategy,
max_file_size: u128, max_file_size: u128,
targets: Vec<Target>, targets: Vec<Target>,
is_skip_logger: bool,
} }
impl Default for Builder { impl Default for Builder {
@ -283,6 +262,7 @@ impl Default for Builder {
timezone_strategy: DEFAULT_TIMEZONE_STRATEGY, timezone_strategy: DEFAULT_TIMEZONE_STRATEGY,
max_file_size: DEFAULT_MAX_FILE_SIZE, max_file_size: DEFAULT_MAX_FILE_SIZE,
targets: DEFAULT_LOG_TARGETS.into(), targets: DEFAULT_LOG_TARGETS.into(),
is_skip_logger: false,
} }
} }
} }
@ -303,7 +283,7 @@ impl Builder {
let format = let format =
time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]") time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]")
.unwrap(); .unwrap();
self.dispatch = fern::Dispatch::new().format(move |out, message, record| { self.dispatch = self.dispatch.format(move |out, message, record| {
out.finish(format_args!( out.finish(format_args!(
"{}[{}][{}] {}", "{}[{}][{}] {}",
timezone_strategy.get_now().format(&format).unwrap(), timezone_strategy.get_now().format(&format).unwrap(),
@ -364,6 +344,22 @@ impl Builder {
self self
} }
/// Skip the creation and global registration of a logger
///
/// If you wish to use your own global logger, you must call `skip_logger` so that the plugin does not attempt to set a second global logger. In this configuration, no logger will be created and the plugin's `log` command will rely on the result of `log::logger()`. You will be responsible for configuring the logger yourself and any included targets will be ignored. This can also be used with `tracing-log` or if running tests in parallel that require the plugin to be registered.
/// ```rust
/// static LOGGER: SimpleLogger = SimpleLogger;
///
/// log::set_logger(&SimpleLogger)?;
/// log::set_max_level(LevelFilter::Info);
/// tauri_plugin_log::Builder::new()
/// .skip_logger();
/// ```
pub fn skip_logger(mut self) -> Self {
self.is_skip_logger = true;
self
}
/// Adds a collection of targets to the logger. /// Adds a collection of targets to the logger.
/// ///
/// ```rust /// ```rust
@ -429,7 +425,12 @@ impl Builder {
log::Level::Info => 2, log::Level::Info => 2,
log::Level::Warn | log::Level::Error => 3, log::Level::Warn | log::Level::Error => 3,
}, },
ios::NSString::new(message.as_str()).0 as _, // The string is allocated in rust, so we must
// autorelease it rust to give it to the Swift
// runtime.
objc2::rc::Retained::autorelease_ptr(
objc2_foundation::NSString::from_str(message.as_str()),
) as _,
); );
} }
}), }),
@ -451,9 +452,6 @@ impl Builder {
)?)? )?)?
.into() .into()
} }
#[cfg(mobile)]
TargetKind::LogDir { .. } => continue,
#[cfg(desktop)]
TargetKind::LogDir { file_name } => { TargetKind::LogDir { file_name } => {
let path = app_handle.path().app_log_dir()?; let path = app_handle.path().app_log_dir()?;
if !path.exists() { if !path.exists() {
@ -501,6 +499,9 @@ impl Builder {
self, self,
app_handle: &AppHandle<R>, app_handle: &AppHandle<R>,
) -> Result<(TauriPlugin<R>, log::LevelFilter, Box<dyn log::Log>), Error> { ) -> Result<(TauriPlugin<R>, log::LevelFilter, Box<dyn log::Log>), Error> {
if self.is_skip_logger {
return Err(Error::LoggerNotInitialized);
}
let plugin = Self::plugin_builder(); let plugin = Self::plugin_builder();
let (max_level, log) = Self::acquire_logger( let (max_level, log) = Self::acquire_logger(
app_handle, app_handle,
@ -517,17 +518,17 @@ impl Builder {
pub fn build<R: Runtime>(self) -> TauriPlugin<R> { pub fn build<R: Runtime>(self) -> TauriPlugin<R> {
Self::plugin_builder() Self::plugin_builder()
.setup(move |app_handle, _api| { .setup(move |app_handle, _api| {
let (max_level, log) = Self::acquire_logger( if !self.is_skip_logger {
app_handle, let (max_level, log) = Self::acquire_logger(
self.dispatch, app_handle,
self.rotation_strategy, self.dispatch,
self.timezone_strategy, self.rotation_strategy,
self.max_file_size, self.timezone_strategy,
self.targets, self.max_file_size,
)?; self.targets,
)?;
attach_logger(max_level, log)?; attach_logger(max_level, log)?;
}
Ok(()) Ok(())
}) })
.build() .build()

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-nfc" name = "tauri-plugin-nfc"
version = "2.0.1" version = "2.2.0"
description = "Read and write NFC tags on Android and iOS." description = "Read and write NFC tags on Android and iOS."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }

@ -181,8 +181,8 @@ function encodeURI(uri: string): number[] {
protocols.slice(1).forEach(function (protocol) { protocols.slice(1).forEach(function (protocol) {
if ( if (
(prefix.length === 0 || prefix === 'urn:') && (prefix.length === 0 || prefix === 'urn:')
uri.indexOf(protocol) === 0 && uri.indexOf(protocol) === 0
) { ) {
prefix = protocol prefix = protocol
} }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-nfc", "name": "@tauri-apps/plugin-nfc",
"version": "2.0.0", "version": "2.2.0",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"

@ -1,5 +1,17 @@
# Changelog # Changelog
## \[2.2.2]
- [`a1b3fa27`](https://github.com/tauri-apps/plugins-workspace/commit/a1b3fa27f11022c9b6622b4fab12d93239eb05de) ([#2515](https://github.com/tauri-apps/plugins-workspace/pull/2515) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Re-exported the `Geolocation`, `Haptics`, `Notification`, and `Os` structs so that they show up on docs.rs.
## \[2.2.1]
- [`da5c59e2`](https://github.com/tauri-apps/plugins-workspace/commit/da5c59e2fe879d177e3cfd52fcacce85440423cb) ([#2271](https://github.com/tauri-apps/plugins-workspace/pull/2271) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated `zbus` dependency to version 5. No API changes.
## \[2.2.0]
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
## \[2.0.1] ## \[2.0.1]
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
@ -124,25 +136,3 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ub.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
## \[2.0.0-alpha.1]
- [`d8b4aca`](https://github.com/tauri-apps/plugins-workspace/commit/d8b4aca69f628b170804ecb982e2c319d026ef47)([#414](https://github.com/tauri-apps/plugins-workspace/pull/414)) Use `window.__TAURI_INVOKE__` instead of `window.__TAURI__` in init.js, fixes usage in apps without `withGlobalTauri` enabled.
- [`7d71ad4`](https://github.com/tauri-apps/plugins-workspace/commit/7d71ad4e587bcf47ea34645f5b226945e487b765) Play a default sound when showing a notification on Windows.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ithub.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ithub.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-notification" name = "tauri-plugin-notification"
version = "2.0.1" version = "2.2.2"
description = "Send desktop and mobile notifications on your Tauri application." description = "Send desktop and mobile notifications on your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@ -46,7 +46,7 @@ windows-version = { version = "0.1", optional = true }
notify-rust = "4.11" notify-rust = "4.11"
[dev-dependencies] [dev-dependencies]
color-backtrace = "0.6" color-backtrace = "0.7"
ctor = "0.2" ctor = "0.2"
maplit = "1" maplit = "1"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save