Compare commits

..

14 Commits

Author SHA1 Message Date
amrbashir c61b224564 try with sudo 2024-11-21 14:23:49 +02:00
amrbashir 719cd9398e try with /NS 2024-11-19 03:24:59 +02:00
amrbashir 84bfcea116 quiet 2024-11-19 02:23:36 +02:00
amrbashir 021547be1c skip uninstalling in CI 2024-11-19 01:43:28 +02:00
amrbashir eb5c600eda try with passive one more time 2024-11-19 01:42:08 +02:00
amrbashir ee5332fa84 enabe nsis 2024-11-17 17:09:21 +02:00
amrbashir 802e416a51 try with slient and longer wait between runs 2024-11-17 17:07:26 +02:00
amrbashir e0da7a8b8d try with passive 2024-11-17 16:46:57 +02:00
amrbashir e9937b2220 fix appimage 2024-11-17 16:14:16 +02:00
amrbashir 4dfbb13520 fix compilation 2024-11-17 04:54:07 +02:00
amrbashir 60728ea22a fix appimage 2024-11-17 04:48:40 +02:00
amrbashir 7dee8ab6e2 appimage test 2024-11-17 04:38:08 +02:00
amrbashir 30dd3f8b45 fix tests in CI 2024-11-17 02:12:56 +02:00
amrbashir 49a4f78806 refactor: simplify updater tests 2024-11-16 03:14:34 +02:00
483 changed files with 7554 additions and 17295 deletions
+6
View File
@@ -0,0 +1,6 @@
---
"upload": "minor"
"upload-js": "minor"
---
Added a new field `progressTotal` to track the total amount of data transferred during the upload/download process.
@@ -1,6 +0,0 @@
---
"dialog-js": minor:feat
"dialog": minor:feat
---
Add `xdg-portal` as an optional feature for `rfd`
@@ -1,6 +0,0 @@
---
"log": "minor"
"log-js": "minor"
---
Allow specifying a log formatter per target using the `format` method on `Target`.
+4 -36
View File
@@ -14,20 +14,10 @@
"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
} }
] ]
}, },
@@ -66,19 +56,17 @@
"dependencies": [ "dependencies": [
"barcode-scanner", "barcode-scanner",
"biometric", "biometric",
"log", "log-plugin",
"cli", "cli",
"clipboard-manager", "clipboard-manager",
"dialog", "dialog",
"fs", "fs",
"global-shortcut", "global-shortcut",
"opener",
"http", "http",
"nfc", "nfc",
"notification", "notification",
"os", "os",
"process", "process",
"secure-storage",
"shell", "shell",
"store", "store",
"updater", "updater",
@@ -99,13 +87,11 @@
"dialog-js", "dialog-js",
"fs-js", "fs-js",
"global-shortcut-js", "global-shortcut-js",
"opener-js",
"http-js", "http-js",
"nfc-js", "nfc-js",
"notification-js", "notification-js",
"os-js", "os-js",
"process-js", "process-js",
"secure-storage-js",
"shell-js", "shell-js",
"store-js", "store-js",
"updater-js" "updater-js"
@@ -182,8 +168,7 @@
}, },
"dialog-js": { "dialog-js": {
"path": "./plugins/dialog", "path": "./plugins/dialog",
"manager": "javascript", "manager": "javascript"
"dependencies": ["fs-js"]
}, },
"geolocation": { "geolocation": {
"path": "./plugins/geolocation", "path": "./plugins/geolocation",
@@ -201,14 +186,6 @@
"path": "./plugins/global-shortcut", "path": "./plugins/global-shortcut",
"manager": "javascript" "manager": "javascript"
}, },
"opener": {
"path": "./plugins/opener",
"manager": "rust"
},
"opener-js": {
"path": "./plugins/opener",
"manager": "javascript"
},
"haptics": { "haptics": {
"path": "./plugins/haptics", "path": "./plugins/haptics",
"manager": "rust" "manager": "rust"
@@ -224,14 +201,13 @@
}, },
"http-js": { "http-js": {
"path": "./plugins/http", "path": "./plugins/http",
"manager": "javascript", "manager": "javascript"
"dependencies": ["fs-js"]
}, },
"localhost": { "localhost": {
"path": "./plugins/localhost", "path": "./plugins/localhost",
"manager": "rust" "manager": "rust"
}, },
"log": { "log-plugin": {
"path": "./plugins/log", "path": "./plugins/log",
"manager": "rust" "manager": "rust"
}, },
@@ -284,14 +260,6 @@
"path": "./plugins/process", "path": "./plugins/process",
"manager": "javascript" "manager": "javascript"
}, },
"secure-storage": {
"path": "./plugins/secure-storage",
"manager": "rust"
},
"secure-storage-js": {
"path": "./plugins/secure-storage",
"manager": "javascript"
},
"shell": { "shell": {
"path": "./plugins/shell", "path": "./plugins/shell",
"manager": "rust" "manager": "rust"
-6
View File
@@ -1,6 +0,0 @@
---
stronghold: patch
stronghold-js: patch
---
The `stronghold` plugin is now deprecated and will be removed in v3. The `secure-storage` plugin should be a replacement for most use-cases.
-6
View File
@@ -1,6 +0,0 @@
---
"dialog": minor
"dialog-js": minor
---
Add `pickerMode` option to file picker (currently only used on iOS)
@@ -1,5 +0,0 @@
---
"localhost": patch
---
Disable caching on responses.
@@ -0,0 +1,6 @@
---
deep-link: patch
deep-link-js: patch
---
`onOpenUrl()` will now not call `getCurrent()` anymore, matching the documented behavior.
@@ -0,0 +1,6 @@
---
'log-plugin': 'patch'
'log-js': 'patch'
---
Make webview log target more consistent that it always starts with `webview`
@@ -1,6 +0,0 @@
---
"barcode-scanner": patch
"barcode-scanner-js": patch
---
Fix the `cameraView` is not removed after scanning in iOS.
-6
View File
@@ -1,6 +0,0 @@
---
"log": patch
"log-js": patch
---
Fix log file rotation when exceeding `max_file_size`.
+7
View File
@@ -0,0 +1,7 @@
---
"fs": "patch"
"fs-js": "patch"
---
Fix `readDir` function failing to read directories that contain broken symlinks.
@@ -0,0 +1,5 @@
---
'localhost': 'minor'
---
Add custom host binding to allow external access
-6
View File
@@ -1,6 +0,0 @@
---
"nfc": "patch"
"nfc-js": "patch"
---
Update return value of `isAvailable` to match TypeScript function signature
-2
View File
@@ -6,8 +6,6 @@ As you create PRs and make changes that require a version bump, please add a new
When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process. When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.
**Note, that in this repository, even if only the Rust code or only the JavaScript code of a plugin changed, both packages need to be bumped with the same increment!**
Use the following format: Use the following format:
```md ```md
@@ -0,0 +1,5 @@
---
"sql": "patch"
---
Allow blocking on async code without creating a nested runtime.
-6
View File
@@ -1,6 +0,0 @@
---
"updater": minor
"updater-js": minor
---
Updater plugin now supports all bundle types: Deb, Rpm and AppImage for Linux; NSiS, MSI for Windows. This was added in https://github.com/tauri-apps/plugins-workspace/pull/2624
-6
View File
@@ -1,6 +0,0 @@
---
"upload": minor
"upload-js": minor
---
Upload plugin now supports specifying an HTTP method i.e. POST, PUT etc.
-62
View File
@@ -1,62 +0,0 @@
# Tauri Contributing Guide
Hi! We, the maintainers, are really excited that you are interested in contributing to Tauri. Before submitting your contribution though, please make sure to take a moment and read through the [Code of Conduct](CODE_OF_CONDUCT.md), as well as the appropriate section for the contribution you intend to make:
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
- [Pull Request Guidelines](#pull-request-guidelines)
- [Development Guide](#development-guide)
## Issue Reporting Guidelines
- The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be closed immediately.
- If you have a question, you can get quick answers from the [Tauri Discord chat](https://discord.com/invite/tauri).
- Try to search for your issue, it may have already been answered or even fixed in the development branch (`v2`).
- Check if the issue is reproducible with the latest stable version of Tauri. If you are using a pre-release, please indicate the specific version you are using.
- It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable.
- Use only the minimum amount of code necessary to reproduce the unexpected behavior. A good bug report should isolate specific methods that exhibit unexpected behavior and precisely define how expectations were violated. What did you expect the method or methods to do, and how did the observed behavior differ? The more precisely you isolate the issue, the faster we can investigate.
- Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
- If your issue is resolved but still open, don't hesitate to close it. In case you found a solution by yourself, it could be helpful for others to explain how you fixed it.
- Most importantly, we beg your patience: the team must balance your request against many other responsibilities — fixing other bugs, answering other questions, new features, new documentation, etc. The issue list is not paid support and we cannot make guarantees about how fast your issue can be resolved.
## Pull Request Guidelines
- You have to [sign your commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).
- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
- If adding new feature:
- Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
- If fixing a bug:
- If you are resolving a special issue, add `(fix: #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `fix: update entities encoding/decoding (fix #3899)`.
- Provide detailed description of the bug in the PR, or link to an issue that does.
- If the PR is meant to be released, follow the instructions in `.changes/readme.md` to log your changes. ie. [readme.md](https://github.com/tauri-apps/plugins-workspace/blob/v2/.changes/readme.md)
## Development Guide
**NOTE: If you have any question don't hesitate to ask in our Discord server. We try to keep this guide to up guide, but if something doesn't work let us know.**
### General Setup
First, [join our Discord server](https://discord.com/invite/tauri) and let us know that you want to contribute. This way we can point you in the right direction and help ensure your contribution will be as helpful as possible.
To set up your machine for development, follow the [Tauri setup guide](https://v2.tauri.app/start/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [PNPM](https://pnpm.io/).
Next, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and clone [this repository](https://github.com/tauri-apps/plugins-workspace/tree/v2).
### Developing and testing
The easiest way to test your changes is to use the [example app](https://github.com/tauri-apps/plugins-workspace/tree/v2/examples/api) example app. It automatically rebuilds and uses your local copy of the plugins. To run it follow the instructions inside [README.md](https://github.com/tauri-apps/plugins-workspace/blob/v2/examples/api/README.md).
To test local changes against your own application simply point the plugin create to your local repository, for example:
`tauri-plugin-sample = { path = "path/to/local/tauri-plugin-sample/" }`
+1 -1
View File
@@ -46,7 +46,7 @@ jobs:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x version: 9.x.x
run_install: true run_install: true
- name: audit - name: audit
run: pnpm audit run: pnpm audit
-44
View File
@@ -1,44 +0,0 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: check change files
on:
pull_request:
paths:
- '.changes/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check change files end with .md
run: |
for file in .changes/*
do
if [[ ! "$file" =~ \.(md|json)$ ]]; then
echo ".changes directory should only contain files that end with .md"
echo "found an invalid file in .changes directory:"
echo "$file"
exit 1
fi
done
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
changes:
- added|modified: '.changes/*.md'
- name: check
run: node ./.scripts/ci/check-change-files.js ${{ steps.filter.outputs.changes_files }}
if: ${{ steps.filter.outputs.changes == 'true' }}
+1 -34
View File
@@ -8,7 +8,6 @@ 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:
@@ -28,122 +27,90 @@ 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:
- .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/opener/guest-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
secure-storage:
- .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/secure-storage/guest-js/**
- plugins/secure-storage/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
@@ -172,7 +139,7 @@ jobs:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x version: 9.x.x
run_install: true run_install: true
- name: build api - name: build api
@@ -11,7 +11,7 @@ on:
- v2 - v2
permissions: permissions:
# required for oidc token # required for npm provenance
id-token: write id-token: write
# required to create the GitHub Release # required to create the GitHub Release
contents: write contents: write
@@ -39,7 +39,7 @@ jobs:
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x version: 9.x.x
run_install: true run_install: true
- name: cargo login - name: cargo login
@@ -62,6 +62,7 @@ jobs:
id: covector id: covector
env: env:
CARGO_TARGET_DIR: /mnt/target CARGO_TARGET_DIR: /mnt/target
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
command: 'version-or-publish' command: 'version-or-publish'
@@ -74,7 +75,7 @@ jobs:
- name: Create Pull Request With Versions Bumped - name: Create Pull Request With Versions Bumped
id: cpr id: cpr
uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # 7.0.7 uses: tauri-apps/create-pull-request@v3
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 }})'
@@ -82,4 +83,3 @@ jobs:
labels: 'version updates' labels: 'version updates'
branch: 'ci/release-${{ github.ref_name }}' branch: 'ci/release-${{ github.ref_name }}'
body: ${{ steps.covector.outputs.change }} body: ${{ steps.covector.outputs.change }}
sign-commits: true
+1 -1
View File
@@ -38,7 +38,7 @@ jobs:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x version: 9.x.x
run_install: true run_install: true
- run: pnpm format:check - run: pnpm format:check
+1 -1
View File
@@ -49,7 +49,7 @@ jobs:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x version: 9.x.x
run_install: true run_install: true
- name: eslint - name: eslint
run: pnpm lint run: pnpm lint
-7
View File
@@ -66,9 +66,6 @@ jobs:
tauri-plugin-global-shortcut: tauri-plugin-global-shortcut:
- .github/workflows/lint-rust.yml - .github/workflows/lint-rust.yml
- plugins/global-shortcut/** - plugins/global-shortcut/**
tauri-plugin-opener:
- .github/workflows/lint-rust.yml
- plugins/opener/**
tauri-plugin-haptics: tauri-plugin-haptics:
- .github/workflows/lint-rust.yml - .github/workflows/lint-rust.yml
- plugins/haptics/** - plugins/haptics/**
@@ -98,9 +95,6 @@ jobs:
tauri-plugin-process: tauri-plugin-process:
- .github/workflows/lint-rust.yml - .github/workflows/lint-rust.yml
- plugins/process/** - plugins/process/**
tauri-plugin-secure-storage:
- .github/workflows/lint-rust.yml
- plugins/secure-storage/**
tauri-plugin-shell: tauri-plugin-shell:
- .github/workflows/lint-rust.yml - .github/workflows/lint-rust.yml
- plugins/shell/** - plugins/shell/**
@@ -157,5 +151,4 @@ jobs:
run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings
- name: clippy ${{ matrix.package }} --all-features - name: clippy ${{ matrix.package }} --all-features
if: matrix.package != 'tauri-plugin-dialog'
run: cargo clippy --package ${{ matrix.package }} --all-targets --all-features -- -D warnings run: cargo clippy --package ${{ matrix.package }} --all-targets --all-features -- -D warnings
+1 -1
View File
@@ -38,7 +38,7 @@ jobs:
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x version: 9.x.x
run_install: true run_install: true
- name: Build packages - name: Build packages
+4 -40
View File
@@ -47,145 +47,109 @@ jobs:
tauri-plugin-autostart: tauri-plugin-autostart:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/autostart/** - plugins/autostart/**
tauri-plugin-cli: tauri-plugin-cli:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/cli/** - plugins/cli/**
tauri-plugin-clipboard-manager: tauri-plugin-clipboard-manager:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/clipboard-manager/** - plugins/clipboard-manager/**
tauri-plugin-deep-link: tauri-plugin-deep-link:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/deep-link/** - plugins/deep-link/**
tauri-plugin-dialog: tauri-plugin-dialog:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/dialog/** - plugins/dialog/**
- plugins/fs/** - plugins/fs/**
tauri-plugin-fs: tauri-plugin-fs:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/fs/** - plugins/fs/**
tauri-plugin-geolocation: tauri-plugin-geolocation:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/geolocation/** - plugins/geolocation/**
tauri-plugin-global-shortcut: tauri-plugin-global-shortcut:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/global-shortcut/** - plugins/global-shortcut/**
tauri-plugin-opener:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/opener/**
tauri-plugin-haptics: tauri-plugin-haptics:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/haptics/** - plugins/haptics/**
tauri-plugin-http: tauri-plugin-http:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/http/** - plugins/http/**
- plugins/fs/** - plugins/fs/**
tauri-plugin-localhost: tauri-plugin-localhost:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/localhost/** - plugins/localhost/**
tauri-plugin-log: tauri-plugin-log:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/log/** - plugins/log/**
tauri-plugin-notification: tauri-plugin-notification:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/notification/** - plugins/notification/**
tauri-plugin-os: tauri-plugin-os:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/os/** - plugins/os/**
tauri-plugin-persisted-scope: tauri-plugin-persisted-scope:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/persisted-scope/** - plugins/persisted-scope/**
- plugins/fs/** - plugins/fs/**
tauri-plugin-positioner: tauri-plugin-positioner:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/positioner/** - plugins/positioner/**
tauri-plugin-process: tauri-plugin-process:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/process/** - plugins/process/**
tauri-plugin-secure-storage:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/secure-storage/**
tauri-plugin-shell: tauri-plugin-shell:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/shell/** - plugins/shell/**
tauri-plugin-single-instance: tauri-plugin-single-instance:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/single-instance/** - plugins/single-instance/**
tauri-plugin-sql: tauri-plugin-sql:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/sql/** - plugins/sql/**
tauri-plugin-store: tauri-plugin-store:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/store/** - plugins/store/**
tauri-plugin-stronghold: tauri-plugin-stronghold:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/stronghold/** - plugins/stronghold/**
tauri-plugin-updater: tauri-plugin-updater:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/updater/** - plugins/updater/**
tauri-plugin-upload: tauri-plugin-upload:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/upload/** - plugins/upload/**
tauri-plugin-websocket: tauri-plugin-websocket:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/websocket/** - plugins/websocket/**
tauri-plugin-window-state: tauri-plugin-window-state:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
- Cargo.lock
- plugins/window-state/** - plugins/window-state/**
test: test:
@@ -224,7 +188,7 @@ jobs:
target: aarch64-linux-android, target: aarch64-linux-android,
os: ubuntu-latest, os: ubuntu-latest,
runner: 'cross', runner: 'cross',
command: 'build --verbose' command: 'build'
} }
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
@@ -238,7 +202,7 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev
- uses: dtolnay/rust-toolchain@1.85 - uses: dtolnay/rust-toolchain@1.77.2
with: with:
targets: ${{ matrix.platform.target }} targets: ${{ matrix.platform.target }}
@@ -251,9 +215,9 @@ jobs:
run: cargo +stable install cross --git https://github.com/cross-rs/cross run: cargo +stable install cross --git https://github.com/cross-rs/cross
- name: test ${{ matrix.package }} - name: test ${{ matrix.package }}
if: matrix.package != 'tauri-plugin-http' && matrix.package != 'tauri-plugin-secure-storage' && matrix.package != 'tauri-plugin-dialog' if: matrix.package != 'tauri-plugin-http'
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --all-features run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --all-features
- name: test ${{ matrix.package }} - name: test ${{ matrix.package }}
if: ${{ matrix.package == 'tauri-plugin-http' || matrix.package == 'tauri-plugin-dialog' }} if: matrix.package == 'tauri-plugin-http'
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets
-3
View File
@@ -14,8 +14,6 @@ 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
@@ -58,4 +56,3 @@ pids
.idea .idea
debug.log debug.log
TODO.md TODO.md
.aider.*
+1 -2
View File
@@ -1,6 +1,5 @@
{ {
"singleQuote": true, "singleQuote": true,
"semi": false, "semi": false,
"trailingComma": "none", "trailingComma": "none"
"experimentalOperatorPosition": "start"
} }
-86
View File
@@ -1,86 +0,0 @@
#!/usr/bin/env node
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { readFileSync, readdirSync } from 'fs'
import { join } from 'path'
/* const ignorePackages = [
'api-example',
'api-example-js',
'deep-link-example',
'deep-link-example-js'
] */
const rsOnly = ['localhost', 'persisted-scope', 'single-instance']
function checkChangeFiles(changeFiles) {
let code = 0
for (const file of changeFiles) {
const content = readFileSync(file, 'utf8')
const [frontMatter] = /^---[\s\S.]*---\n/i.exec(content)
const packages = frontMatter
.split('\n')
.filter((l) => !(l === '---' || !l))
.map((l) => l.replace(/('|")/g, '').split(':'))
const rsPackages = Object.fromEntries(
packages
.filter((v) => !v[0].endsWith('-js'))
.map((v) => [v[0], v[1].trim()])
)
const jsPackages = Object.fromEntries(
packages
.filter((v) => v[0].endsWith('-js'))
.map((v) => [v[0].slice(0, -3), v[1].trim()])
)
for (const pkg in rsPackages) {
if (rsOnly.includes(pkg)) continue
if (!jsPackages[pkg]) {
console.error(
`Missing "${rsPackages[pkg]}" bump for JS package "${pkg}-js" in ${file}.`
)
code = 1
} else if (rsPackages[pkg] != jsPackages[pkg]) {
console.error(
`"${pkg}" and "${pkg}-js" have different version bumps in ${file}.`
)
code = 1
}
}
for (const pkg in jsPackages) {
if (!rsPackages[pkg]) {
console.error(
`Missing "${jsPackages[pkg]}" bump for Rust package "${pkg}" in ${file}.`
)
code = 1
} else if (rsPackages[pkg] != jsPackages[pkg]) {
console.error(
`"${pkg}" and "${pkg}-js" have different version bumps in ${file}.`
)
code = 1
}
}
}
process.exit(code)
}
const [_bin, _script, ...files] = process.argv
if (files.length > 0) {
checkChangeFiles(
files.filter((f) => f.toLowerCase() !== '.changes/readme.md')
)
} else {
const changeFiles = readdirSync('.changes')
.filter((f) => f.endsWith('.md') && f.toLowerCase() !== 'readme.md')
.map((p) => join('.changes', p))
checkChangeFiles(changeFiles)
}
+6 -6
View File
@@ -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
} }
-3
View File
@@ -1,3 +0,0 @@
plugins/*/permissions/autogenerated/
plugins/*/android/.tauri/tauri-api/build/
plugins/*/android/build/intermediates/
Generated
+1406 -2125
View File
File diff suppressed because it is too large Load Diff
+6 -8
View File
@@ -10,20 +10,18 @@ resolver = "2"
[workspace.dependencies] [workspace.dependencies]
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
tracing = "0.1"
log = "0.4" log = "0.4"
tauri = { version = "2.8.2", default-features = false } tauri = { version = "2", default-features = false }
tauri-build = "2.4" tauri-build = "2"
tauri-plugin = "2.4" tauri-plugin = "2"
tauri-utils = "2.7" tauri-utils = "2"
serde_json = "1" serde_json = "1"
thiserror = "2" thiserror = "2"
url = "2" url = "2"
schemars = "0.8" schemars = "0.8"
dunce = "1" dunce = "1"
specta = "^2.0.0-rc.16" specta = "=2.0.0-rc.20"
glob = "0.3" #tauri-specta = "=2.0.0-rc.11"
zbus = "5.9"
[workspace.package] [workspace.package]
edition = "2021" edition = "2021"
+2 -3
View File
@@ -22,18 +22,17 @@ This repo and all plugins require a Rust version of at least **1.77.2**
| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ | | [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ |
| [nfc](plugins/nfc) | Read and write NFC tags on Android and iOS. | ? | ? | ? | ✅ | ✅ | | [nfc](plugins/nfc) | Read and write NFC tags on Android and iOS. | ? | ? | ? | ✅ | ✅ |
| [notification](plugins/notification) | Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. | ✅ | ✅ | ✅ | ✅ | ✅ | | [notification](plugins/notification) | Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. | ✅ | ✅ | ✅ | ✅ | ✅ |
| [opener](plugins/opener) | Open files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? |
| [os](plugins/os) | Read information about the operating system. | ✅ | ✅ | ✅ | ✅ | ✅ | | [os](plugins/os) | Read information about the operating system. | ✅ | ✅ | ✅ | ✅ | ✅ |
| [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? | | [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? |
| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ❌ | ❌ | | [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ❌ | ❌ |
| [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. | ✅ | ✅ | ✅ | ❌ | ❌ |
| [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | | | | [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? |
| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? | | [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? |
| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ❌ | ❌ | | [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ❌ | ❌ |
+1 -2
View File
@@ -3,12 +3,11 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
import eslint from '@eslint/js' import eslint from '@eslint/js'
import { defineConfig } from 'eslint/config'
import eslintConfigPrettier from 'eslint-config-prettier' import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginSecurity from 'eslint-plugin-security' import eslintPluginSecurity from 'eslint-plugin-security'
import tseslint from 'typescript-eslint' import tseslint from 'typescript-eslint'
export default defineConfig( export default tseslint.config(
{ {
ignores: [ ignores: [
'**/target', '**/target',
-302
View File
@@ -1,307 +1,5 @@
# Changelog # Changelog
## \[2.0.34]
### Dependencies
- Upgraded to `barcode-scanner-js@2.4.2`
- Upgraded to `biometric-js@2.3.2`
- Upgraded to `cli-js@2.4.1`
- Upgraded to `clipboard-manager-js@2.3.2`
- Upgraded to `dialog-js@2.4.2`
- Upgraded to `fs-js@2.4.4`
- Upgraded to `global-shortcut-js@2.3.1`
- Upgraded to `http-js@2.5.4`
- Upgraded to `log-js@2.7.1`
- Upgraded to `nfc-js@2.3.3`
- Upgraded to `notification-js@2.3.3`
- Upgraded to `opener-js@2.5.2`
- Upgraded to `os-js@2.3.2`
- Upgraded to `process-js@2.3.1`
- Upgraded to `shell-js@2.3.3`
- Upgraded to `store-js@2.4.1`
## \[2.0.33]
### Dependencies
- Upgraded to `barcode-scanner-js@2.4.1`
- Upgraded to `biometric-js@2.3.1`
- Upgraded to `clipboard-manager-js@2.3.1`
- Upgraded to `dialog-js@2.4.1`
- Upgraded to `fs-js@2.4.3`
- Upgraded to `nfc-js@2.3.2`
- Upgraded to `notification-js@2.3.2`
- Upgraded to `opener-js@2.5.1`
- Upgraded to `shell-js@2.3.2`
- Upgraded to `http-js@2.5.3`
## \[2.0.32]
### Dependencies
- Upgraded to `dialog-js@2.4.0`
- Upgraded to `log-js@2.7.0`
## \[2.0.31]
### Dependencies
- Upgraded to `shell-js@2.3.1`
## \[2.0.30]
### Dependencies
- Upgraded to `notification-js@2.3.1`
## \[2.0.29]
### Dependencies
- Upgraded to `fs-js@2.4.2`
- Upgraded to `nfc-js@2.3.1`
- Upgraded to `opener-js@2.5.0`
- Upgraded to `os-js@2.3.1`
- Upgraded to `store-js@2.4.0`
- Upgraded to `dialog-js@2.3.3`
- Upgraded to `http-js@2.5.2`
## \[2.0.28]
### Dependencies
- Upgraded to `dialog-js@2.3.2`
## \[2.0.27]
### Dependencies
- Upgraded to `barcode-scanner-js@2.4.0`
- Upgraded to `fs-js@2.4.1`
- Upgraded to `dialog-js@2.3.1`
- Upgraded to `http-js@2.5.1`
## \[2.0.26]
### Dependencies
- Upgraded to `barcode-scanner-js@2.3.0`
- Upgraded to `biometric-js@2.3.0`
- Upgraded to `cli-js@2.4.0`
- Upgraded to `clipboard-manager-js@2.3.0`
- Upgraded to `fs-js@2.4.0`
- Upgraded to `dialog-js@2.3.0`
- Upgraded to `global-shortcut-js@2.3.0`
- Upgraded to `opener-js@2.4.0`
- Upgraded to `http-js@2.5.0`
- Upgraded to `log-js@2.6.0`
- Upgraded to `nfc-js@2.3.0`
- Upgraded to `notification-js@2.3.0`
- Upgraded to `os-js@2.3.0`
- Upgraded to `process-js@2.3.0`
- Upgraded to `shell-js@2.3.0`
- Upgraded to `store-js@2.3.0`
- Upgraded to `updater-js@2.9.0`
## \[2.0.25]
### Dependencies
- Upgraded to `cli-js@2.3.0`
- Upgraded to `log-js@2.5.1`
- Upgraded to `opener-js@2.3.1`
## \[2.0.24]
### Dependencies
- Upgraded to `updater-js@2.8.1`
## \[2.0.23]
### Dependencies
- Upgraded to `updater-js@2.8.0`
- Upgraded to `barcode-scanner-js@2.2.1`
- Upgraded to `biometric-js@2.2.2`
- Upgraded to `cli-js@2.2.1`
- Upgraded to `clipboard-manager-js@2.2.3`
- Upgraded to `nfc-js@2.2.1`
- Upgraded to `notification-js@2.2.3`
- Upgraded to `os-js@2.2.2`
- Upgraded to `process-js@2.2.2`
- Upgraded to `shell-js@2.2.2`
- Upgraded to `store-js@2.2.1`
- Upgraded to `log-js@2.5.0`
- Upgraded to `opener-js@2.3.0`
## \[2.0.22]
### Dependencies
- Upgraded to `fs-js@2.3.0`
- Upgraded to `global-shortcut-js@2.2.1`
- Upgraded to `http-js@2.4.4`
- Upgraded to `opener-js@2.2.7`
- Upgraded to `dialog-js@2.2.2`
## \[2.0.21]
### Dependencies
- Upgraded to `log-js@2.4.0`
- Upgraded to `biometric-js@2.2.1`
- Upgraded to `updater-js@2.7.1`
## \[2.0.20]
### Dependencies
- Upgraded to `http-js@2.4.3`
- Upgraded to `shell-js@2.2.1`
- Upgraded to `fs-js@2.2.1`
- Upgraded to `process-js@2.2.1`
- Upgraded to `updater-js@2.7.0`
- Upgraded to `dialog-js@2.2.1`
## \[2.0.19]
### Dependencies
- Upgraded to `http-js@2.4.2`
- Upgraded to `updater-js@2.6.1`
## \[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]
### Dependencies
- Upgraded to `clipboard-manager-js@2.0.1`
- Upgraded to `log-js@2.0.1`
- Upgraded to `fs-js@2.0.3`
- Upgraded to `opener-js@2.0.0`
## \[2.0.2] ## \[2.0.2]
### Dependencies ### Dependencies
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta <meta
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=0" content="width=device-width, initial-scale=1.0, viewport-fit=cover"
/> />
<title>Svelte + Vite App</title> <title>Svelte + Vite App</title>
</head> </head>
+27 -30
View File
@@ -1,7 +1,7 @@
{ {
"name": "api", "name": "api",
"private": true, "private": true,
"version": "2.0.34", "version": "2.0.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --clearScreen false", "dev": "vite --clearScreen false",
@@ -10,37 +10,34 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.9.0", "@tauri-apps/api": "2.1.1",
"@tauri-apps/plugin-barcode-scanner": "^2.4.2", "@tauri-apps/plugin-barcode-scanner": "2.0.0",
"@tauri-apps/plugin-biometric": "^2.3.2", "@tauri-apps/plugin-biometric": "2.0.0",
"@tauri-apps/plugin-cli": "^2.4.1", "@tauri-apps/plugin-cli": "2.0.0",
"@tauri-apps/plugin-clipboard-manager": "^2.3.2", "@tauri-apps/plugin-clipboard-manager": "2.0.0",
"@tauri-apps/plugin-dialog": "^2.4.2", "@tauri-apps/plugin-dialog": "2.0.1",
"@tauri-apps/plugin-fs": "^2.4.4", "@tauri-apps/plugin-fs": "2.0.2",
"@tauri-apps/plugin-geolocation": "^2.2.0", "@tauri-apps/plugin-geolocation": "2.0.0",
"@tauri-apps/plugin-global-shortcut": "^2.3.1", "@tauri-apps/plugin-global-shortcut": "2.0.0",
"@tauri-apps/plugin-haptics": "^2.2.0", "@tauri-apps/plugin-haptics": "2.0.0",
"@tauri-apps/plugin-http": "^2.5.4", "@tauri-apps/plugin-http": "2.0.1",
"@tauri-apps/plugin-nfc": "^2.3.3", "@tauri-apps/plugin-nfc": "2.0.0",
"@tauri-apps/plugin-notification": "^2.3.3", "@tauri-apps/plugin-notification": "2.0.0",
"@tauri-apps/plugin-opener": "^2.5.2", "@tauri-apps/plugin-os": "2.0.0",
"@tauri-apps/plugin-os": "^2.3.2", "@tauri-apps/plugin-process": "2.0.0",
"@tauri-apps/plugin-process": "^2.3.1", "@tauri-apps/plugin-shell": "2.0.1",
"@tauri-apps/plugin-secure-storage": "file:../../plugins/secure-storage", "@tauri-apps/plugin-store": "2.1.0",
"@tauri-apps/plugin-shell": "^2.3.3", "@tauri-apps/plugin-updater": "2.0.0",
"@tauri-apps/plugin-store": "^2.4.1",
"@tauri-apps/plugin-updater": "^2.9.0",
"@tauri-apps/plugin-upload": "^2.3.0",
"@zerodevx/svelte-json-view": "1.0.11" "@zerodevx/svelte-json-view": "1.0.11"
}, },
"devDependencies": { "devDependencies": {
"@iconify-json/codicon": "^1.2.12", "@iconify-json/codicon": "^1.1.37",
"@iconify-json/ph": "^1.2.2", "@iconify-json/ph": "^1.1.8",
"@sveltejs/vite-plugin-svelte": "^6.0.0", "@sveltejs/vite-plugin-svelte": "^4.0.0",
"@tauri-apps/cli": "2.9.4", "@tauri-apps/cli": "2.1.0",
"@unocss/extractor-svelte": "^66.3.3", "@unocss/extractor-svelte": "^0.64.0",
"svelte": "^5.20.4", "svelte": "^5.0.0",
"unocss": "^66.3.3", "unocss": "^0.64.0",
"vite": "^7.0.7" "vite": "^5.4.7"
} }
} }
-327
View File
@@ -1,332 +1,5 @@
# Changelog # Changelog
## \[2.0.38]
### Dependencies
- Upgraded to `barcode-scanner@2.4.2`
- Upgraded to `biometric@2.3.2`
- Upgraded to `cli@2.4.1`
- Upgraded to `clipboard-manager@2.3.2`
- Upgraded to `dialog@2.4.2`
- Upgraded to `fs@2.4.4`
- Upgraded to `geolocation@2.3.2`
- Upgraded to `global-shortcut@2.3.1`
- Upgraded to `haptics@2.3.2`
- Upgraded to `http@2.5.4`
- Upgraded to `log@2.7.1`
- Upgraded to `nfc@2.3.3`
- Upgraded to `notification@2.3.3`
- Upgraded to `opener@2.5.2`
- Upgraded to `os@2.3.2`
- Upgraded to `process@2.3.1`
- Upgraded to `shell@2.3.3`
- Upgraded to `store@2.4.1`
## \[2.0.37]
### Dependencies
- Upgraded to `barcode-scanner@2.4.1`
- Upgraded to `biometric@2.3.1`
- Upgraded to `clipboard-manager@2.3.1`
- Upgraded to `dialog@2.4.1`
- Upgraded to `fs@2.4.3`
- Upgraded to `geolocation@2.3.1`
- Upgraded to `haptics@2.3.1`
- Upgraded to `nfc@2.3.2`
- Upgraded to `notification@2.3.2`
- Upgraded to `opener@2.5.1`
- Upgraded to `shell@2.3.2`
- Upgraded to `http@2.5.3`
## \[2.0.36]
### Dependencies
- Upgraded to `dialog@2.4.0`
- Upgraded to `log@2.7.0`
## \[2.0.35]
### Dependencies
- Upgraded to `shell@2.3.1`
## \[2.0.34]
### Dependencies
- Upgraded to `notification@2.3.1`
## \[2.0.33]
### Dependencies
- Upgraded to `fs@2.4.2`
- Upgraded to `nfc@2.3.1`
- Upgraded to `opener@2.5.0`
- Upgraded to `os@2.3.1`
- Upgraded to `store@2.4.0`
- Upgraded to `dialog@2.3.3`
- Upgraded to `http@2.5.2`
## \[2.0.32]
### Dependencies
- Upgraded to `dialog@2.3.2`
## \[2.0.31]
### Dependencies
- Upgraded to `barcode-scanner@2.4.0`
- Upgraded to `fs@2.4.1`
- Upgraded to `dialog@2.3.1`
- Upgraded to `http@2.5.1`
## \[2.0.30]
### Dependencies
- Upgraded to `barcode-scanner@2.3.0`
- Upgraded to `biometric@2.3.0`
- Upgraded to `cli@2.4.0`
- Upgraded to `clipboard-manager@2.3.0`
- Upgraded to `fs@2.4.0`
- Upgraded to `dialog@2.3.0`
- Upgraded to `geolocation@2.3.0`
- Upgraded to `global-shortcut@2.3.0`
- Upgraded to `opener@2.4.0`
- Upgraded to `haptics@2.3.0`
- Upgraded to `http@2.5.0`
- Upgraded to `log@2.6.0`
- Upgraded to `nfc@2.3.0`
- Upgraded to `notification@2.3.0`
- Upgraded to `os@2.3.0`
- Upgraded to `process@2.3.0`
- Upgraded to `shell@2.3.0`
- Upgraded to `store@2.3.0`
- Upgraded to `updater@2.9.0`
## \[2.0.29]
### Dependencies
- Upgraded to `cli@2.3.0`
- Upgraded to `log@2.5.1`
- Upgraded to `opener@2.3.1`
## \[2.0.28]
### Dependencies
- Upgraded to `updater@2.8.1`
## \[2.0.27]
### Dependencies
- Upgraded to `updater@2.8.0`
- Upgraded to `barcode-scanner@2.2.1`
- Upgraded to `biometric@2.2.2`
- Upgraded to `cli@2.2.1`
- Upgraded to `clipboard-manager@2.2.3`
- Upgraded to `geolocation@2.2.5`
- Upgraded to `haptics@2.2.5`
- Upgraded to `nfc@2.2.1`
- Upgraded to `notification@2.2.3`
- Upgraded to `os@2.2.2`
- Upgraded to `process@2.2.2`
- Upgraded to `shell@2.2.2`
- Upgraded to `store@2.2.1`
- Upgraded to `log@2.5.0`
- Upgraded to `opener@2.3.0`
## \[2.0.26]
### Dependencies
- Upgraded to `fs@2.3.0`
- Upgraded to `global-shortcut@2.2.1`
- Upgraded to `http@2.4.4`
- Upgraded to `opener@2.2.7`
- Upgraded to `dialog@2.2.2`
## \[2.0.25]
### Dependencies
- Upgraded to `log@2.4.0`
- Upgraded to `biometric@2.2.1`
- Upgraded to `updater@2.7.1`
## \[2.0.24]
### Dependencies
- Upgraded to `http@2.4.3`
- Upgraded to `shell@2.2.1`
- Upgraded to `fs@2.2.1`
- Upgraded to `process@2.2.1`
- Upgraded to `updater@2.7.0`
- Upgraded to `dialog@2.2.1`
## \[2.0.23]
### Dependencies
- Upgraded to `http@2.4.2`
- Upgraded to `updater@2.6.1`
## \[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]
### Dependencies
- Upgraded to `fs@2.1.0`
- Upgraded to `updater@2.1.0`
- Upgraded to `dialog@2.0.4`
- Upgraded to `log-plugin@2.0.3`
- Upgraded to `http@2.0.4`
- Upgraded to `opener@2.0.0`
## \[2.0.5] ## \[2.0.5]
### Dependencies ### Dependencies
+21 -27
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "api" name = "api"
publish = false publish = false
version = "2.0.38" version = "2.0.5"
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 }
@@ -18,35 +18,29 @@ tauri-build = { workspace = true, features = ["codegen", "isolation"] }
serde_json = { workspace = true } serde_json = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
tiny_http = "0.12" tiny_http = "0.12"
time = "0.3"
log = { workspace = true } log = { workspace = true }
tauri-plugin-log = { path = "../../../plugins/log", version = "2.7.1" } tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.2" }
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.4.4", features = [ tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.3", features = [
"watch", "watch",
] } ] }
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.3.2" } tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.2" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.4.2" } tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.3" }
tauri-plugin-http = { path = "../../../plugins/http", features = [ tauri-plugin-http = { path = "../../../plugins/http", features = [
"multipart", "multipart",
"cookies", ], version = "2.0.3" }
], version = "2.5.4" } tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.1", features = [
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.3.3", features = [
"windows7-compat", "windows7-compat",
] } ] }
tauri-plugin-os = { path = "../../../plugins/os", version = "2.3.2" } tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.1" }
tauri-plugin-process = { path = "../../../plugins/process", version = "2.3.1" } tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.1" }
tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.2" } tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.2" }
tauri-plugin-secure-storage = { path = "../../../plugins/secure-storage" } tauri-plugin-store = { path = "../../../plugins/store", version = "2.1.0" }
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.3" }
tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.1" }
tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" }
[dependencies.tauri] [dependencies.tauri]
workspace = true workspace = true
features = [ features = [
"wry", "wry",
"common-controls-v6", "compression",
"x11",
"image-ico", "image-ico",
"image-png", "image-png",
"isolation", "isolation",
@@ -56,17 +50,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.4.1" } tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.1" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.1" } tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.1" }
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.9.0" } tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.2" }
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" } tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.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.4.2" } tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.1" }
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.3" } tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.1" }
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.3.2" } tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.1" }
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.3.2" } tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.1" }
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.2" } tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.1" }
[features] [features]
prod = ["tauri/custom-protocol"] prod = ["tauri/custom-protocol"]
+2 -28
View File
@@ -53,7 +53,7 @@
} }
] ]
}, },
"shell:default", "shell:allow-open",
"shell:allow-kill", "shell:allow-kill",
"shell:allow-stdin-write", "shell:allow-stdin-write",
"process:allow-exit", "process:allow-exit",
@@ -68,44 +68,18 @@
"fs:allow-rename", "fs:allow-rename",
"fs:allow-mkdir", "fs:allow-mkdir",
"fs:allow-remove", "fs:allow-remove",
"fs:allow-stat",
"fs:allow-fstat",
"fs:allow-lstat",
"fs:allow-write-text-file", "fs:allow-write-text-file",
"fs:read-meta",
"fs:scope-download-recursive", "fs:scope-download-recursive",
"fs:scope-resource-recursive", "fs:scope-resource-recursive",
{ {
"identifier": "fs:scope-appdata-recursive", "identifier": "fs:scope-appdata-recursive",
"allow": [ "allow": [
{
"path": "$APPDATA/db/"
},
{ {
"path": "$APPDATA/db/**" "path": "$APPDATA/db/**"
} }
], ],
"deny": ["$APPDATA/db/*.stronghold"] "deny": ["$APPDATA/db/*.stronghold"]
}, },
"store:default", "store:default"
"opener:default",
{
"identifier": "opener:allow-open-url",
"allow": [
{
"url": "https://*",
"app": "inAppBrowser"
}
]
},
{
"identifier": "opener:allow-open-path",
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
},
"upload:default",
"secure-storage:allow-get-string",
"secure-storage:allow-set-string",
"secure-storage:allow-get-binary",
"secure-storage:allow-set-binary"
] ]
} }
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" /> <bytecodeTargetLevel target="17" />
</component> </component>
</project> </project>
+2 -3
View File
@@ -15,12 +15,11 @@
</builds> </builds>
</compositeBuild> </compositeBuild>
</compositeConfiguration> </compositeConfiguration>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$USER_HOME$/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-2.5.0/mobile/android" /> <option value="$USER_HOME$/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-2.0.2/mobile/android" />
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" /> <option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/buildSrc" /> <option value="$PROJECT_DIR$/buildSrc" />
@@ -33,10 +32,10 @@
<option value="$PROJECT_DIR$/../../../../../plugins/haptics/android" /> <option value="$PROJECT_DIR$/../../../../../plugins/haptics/android" />
<option value="$PROJECT_DIR$/../../../../../plugins/nfc/android" /> <option value="$PROJECT_DIR$/../../../../../plugins/nfc/android" />
<option value="$PROJECT_DIR$/../../../../../plugins/notification/android" /> <option value="$PROJECT_DIR$/../../../../../plugins/notification/android" />
<option value="$PROJECT_DIR$/../../../../../plugins/opener/android" />
<option value="$PROJECT_DIR$/../../../../../plugins/shell/android" /> <option value="$PROJECT_DIR$/../../../../../plugins/shell/android" />
</set> </set>
</option> </option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>
</component> </component>
+1 -2
View File
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
@@ -14,13 +14,13 @@ val tauriProperties = Properties().apply {
} }
android { android {
compileSdk = 36 compileSdk = 34
namespace = "com.tauri.api" namespace = "com.tauri.api"
defaultConfig { defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false" manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "com.tauri.api" applicationId = "com.tauri.api"
minSdk = 24 minSdk = 24
targetSdk = 36 targetSdk = 34
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt() versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0") versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
} }
@@ -4,7 +4,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:8.11.0") classpath("com.android.tools.build:gradle:8.5.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25")
} }
} }
@@ -18,6 +18,6 @@ repositories {
dependencies { dependencies {
compileOnly(gradleApi()) compileOnly(gradleApi())
implementation("com.android.tools.build:gradle:8.11.0") implementation("com.android.tools.build:gradle:8.5.1")
} }
@@ -1,116 +1,116 @@
{ {
"images" : [ "images": [
{ {
"size" : "20x20", "size": "20x20",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "AppIcon-20x20@2x.png", "filename": "AppIcon-20x20@2x.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "20x20", "size": "20x20",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "AppIcon-20x20@3x.png", "filename": "AppIcon-20x20@3x.png",
"scale" : "3x" "scale": "3x"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "AppIcon-29x29@2x-1.png", "filename": "AppIcon-29x29@2x-1.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "AppIcon-29x29@3x.png", "filename": "AppIcon-29x29@3x.png",
"scale" : "3x" "scale": "3x"
}, },
{ {
"size" : "40x40", "size": "40x40",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "AppIcon-40x40@2x.png", "filename": "AppIcon-40x40@2x.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "40x40", "size": "40x40",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "AppIcon-40x40@3x.png", "filename": "AppIcon-40x40@3x.png",
"scale" : "3x" "scale": "3x"
}, },
{ {
"size" : "60x60", "size": "60x60",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "AppIcon-60x60@2x.png", "filename": "AppIcon-60x60@2x.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "60x60", "size": "60x60",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "AppIcon-60x60@3x.png", "filename": "AppIcon-60x60@3x.png",
"scale" : "3x" "scale": "3x"
}, },
{ {
"size" : "20x20", "size": "20x20",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "AppIcon-20x20@1x.png", "filename": "AppIcon-20x20@1x.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "20x20", "size": "20x20",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "AppIcon-20x20@2x-1.png", "filename": "AppIcon-20x20@2x-1.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "AppIcon-29x29@1x.png", "filename": "AppIcon-29x29@1x.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "AppIcon-29x29@2x.png", "filename": "AppIcon-29x29@2x.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "40x40", "size": "40x40",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "AppIcon-40x40@1x.png", "filename": "AppIcon-40x40@1x.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "40x40", "size": "40x40",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "AppIcon-40x40@2x-1.png", "filename": "AppIcon-40x40@2x-1.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "76x76", "size": "76x76",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "AppIcon-76x76@1x.png", "filename": "AppIcon-76x76@1x.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "76x76", "size": "76x76",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "AppIcon-76x76@2x.png", "filename": "AppIcon-76x76@2x.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "83.5x83.5", "size": "83.5x83.5",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "AppIcon-83.5x83.5@2x.png", "filename": "AppIcon-83.5x83.5@2x.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "1024x1024", "size": "1024x1024",
"idiom" : "ios-marketing", "idiom": "ios-marketing",
"filename" : "AppIcon-512@2x.png", "filename": "AppIcon-512@2x.png",
"scale" : "1x" "scale": "1x"
} }
], ],
"info" : { "info": {
"version" : 1, "version": 1,
"author" : "xcode" "author": "xcode"
} }
} }
@@ -1,6 +1,6 @@
{ {
"info" : { "info": {
"version" : 1, "version": 1,
"author" : "xcode" "author": "xcode"
} }
} }
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17150" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17150" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17122"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17122"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+1 -1
View File
@@ -1,7 +1,7 @@
# Uncomment the next line to define a global platform for your project # Uncomment the next line to define a global platform for your project
target 'api_iOS' do target 'api_iOS' do
platform :ios, '14.0' platform :ios, '13.0'
# Pods for api_iOS # Pods for api_iOS
end end
@@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 54; objectVersion = 56;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@@ -22,26 +22,26 @@
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
0E96CE07CD20273DD46BF325 /* main.rs */ = {isa = PBXFileReference; path = main.rs; sourceTree = "<group>"; }; 0E96CE07CD20273DD46BF325 /* main.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = main.rs; sourceTree = "<group>"; };
1C1AB1B414CA2795AFBEDDB9 /* tray.rs */ = {isa = PBXFileReference; path = tray.rs; sourceTree = "<group>"; }; 1C1AB1B414CA2795AFBEDDB9 /* tray.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = tray.rs; sourceTree = "<group>"; };
248286BAA086BB1A5F98B2B2 /* libapp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libapp.a; sourceTree = "<group>"; }; 248286BAA086BB1A5F98B2B2 /* libapp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libapp.a; sourceTree = "<group>"; };
2F63E2AA460089BB58D40C79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; 2F63E2AA460089BB58D40C79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
338E66700FD330B99D434DD7 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; }; 338E66700FD330B99D434DD7 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; };
384966E551417F94A02D2706 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 384966E551417F94A02D2706 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
4B2D1B108AE002010BDEC6D2 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; }; 4B2D1B108AE002010BDEC6D2 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
59CFE20DCF760BE67D9CE3D6 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 59CFE20DCF760BE67D9CE3D6 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
5AC703CEBA41A121596066F3 /* api_iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = api_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5AC703CEBA41A121596066F3 /* Tauri API.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tauri API.app"; sourceTree = BUILT_PRODUCTS_DIR; };
62601E25FA39E62BE119B74D /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; }; 62601E25FA39E62BE119B74D /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
6B7E79E23E646BA7968B457C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 6B7E79E23E646BA7968B457C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
71EB788DE4662CFC0D97F567 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 71EB788DE4662CFC0D97F567 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
74A8FDFB350B966F5AAD4A24 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = assets; sourceTree = SOURCE_ROOT; }; 74A8FDFB350B966F5AAD4A24 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = assets; sourceTree = SOURCE_ROOT; };
785D025E9542F7E098BF22B5 /* lib.rs */ = {isa = PBXFileReference; path = lib.rs; sourceTree = "<group>"; }; 785D025E9542F7E098BF22B5 /* lib.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = lib.rs; sourceTree = "<group>"; };
879941AE3DAA14534BBC6391 /* api_iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = api_iOS.entitlements; sourceTree = "<group>"; }; 879941AE3DAA14534BBC6391 /* api_iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = api_iOS.entitlements; sourceTree = "<group>"; };
90D3B673AFAB8D8AB561F616 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; }; 90D3B673AFAB8D8AB561F616 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
B6082E363D51372A7658C351 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; B6082E363D51372A7658C351 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
DC377692DC31A070A0188C9D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; DC377692DC31A070A0188C9D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
EC8C7948C50C3C9B5D96CB61 /* bindings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bindings.h; sourceTree = "<group>"; }; EC8C7948C50C3C9B5D96CB61 /* bindings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bindings.h; sourceTree = "<group>"; };
F835F52713CE8F029D5D252C /* cmd.rs */ = {isa = PBXFileReference; path = cmd.rs; sourceTree = "<group>"; }; F835F52713CE8F029D5D252C /* cmd.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = cmd.rs; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@@ -104,7 +104,7 @@
4AC51E67B71E27F15B02C5CD /* Products */ = { 4AC51E67B71E27F15B02C5CD /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5AC703CEBA41A121596066F3 /* api_iOS.app */, 5AC703CEBA41A121596066F3 /* Tauri API.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -171,10 +171,8 @@
dependencies = ( dependencies = (
); );
name = api_iOS; name = api_iOS;
packageProductDependencies = (
);
productName = api_iOS; productName = api_iOS;
productReference = 5AC703CEBA41A121596066F3 /* api_iOS.app */; productReference = 5AC703CEBA41A121596066F3 /* Tauri API.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
@@ -200,8 +198,6 @@
en, en,
); );
mainGroup = 0677CEAF1F282F38CBA0F140; mainGroup = 0677CEAF1F282F38CBA0F140;
minimizedProjectReferenceProxies = 1;
preferredProjectObjectVersion = 54;
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
@@ -240,6 +236,7 @@
outputPaths = ( outputPaths = (
"$(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a", "$(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a",
"$(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a", "$(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a",
"$(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
@@ -304,7 +301,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@@ -366,7 +363,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
@@ -384,29 +381,52 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ARCHS = ( ARCHS = (
arm64, arm64,
"arm64-sim",
); );
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements; CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "Q93MBH6S2F"; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = Q93MBH6S2F;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphoneos*]" = x86_64; "EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\".\"", "\".\"",
); );
INFOPLIST_FILE = api_iOS/Info.plist; INFOPLIST_FILE = api_iOS/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
"LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = (
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; "$(inherited)",
"$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)",
"$(SDKROOT)/usr/lib/swift",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
);
"LIBRARY_SEARCH_PATHS[arch=arm64]" = (
"$(inherited)",
"$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)",
"$(SDKROOT)/usr/lib/swift",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
);
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = (
"$(inherited)",
"$(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION)",
"$(SDKROOT)/usr/lib/swift",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
);
PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api; PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api;
PRODUCT_NAME = "Tauri API"; PRODUCT_NAME = "Tauri API";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = arm64; VALID_ARCHS = "arm64 arm64-sim";
}; };
name = debug; name = debug;
}; };
@@ -416,29 +436,52 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ARCHS = ( ARCHS = (
arm64, arm64,
"arm64-sim",
); );
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements; CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "Q93MBH6S2F"; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = Q93MBH6S2F;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphoneos*]" = x86_64; "EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\".\"", "\".\"",
); );
INFOPLIST_FILE = api_iOS/Info.plist; INFOPLIST_FILE = api_iOS/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
"LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = (
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; "$(inherited)",
"$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)",
"$(SDKROOT)/usr/lib/swift",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
);
"LIBRARY_SEARCH_PATHS[arch=arm64]" = (
"$(inherited)",
"$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)",
"$(SDKROOT)/usr/lib/swift",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
);
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = (
"$(inherited)",
"$(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION)",
"$(SDKROOT)/usr/lib/swift",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
);
PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api; PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api;
PRODUCT_NAME = "Tauri API"; PRODUCT_NAME = "Tauri API";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = arm64; VALID_ARCHS = "arm64 arm64-sim";
}; };
name = release; name = release;
}; };
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -40,12 +40,12 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>NSFaceIDUsageDescription</key>
<string>Authenticate with biometrics</string>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>Request camera access for WebRTC</string> <string>Request camera access for WebRTC</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>Request microphone access for WebRTC</string> <string>Request microphone access for WebRTC</string>
<key>NSFaceIDUsageDescription</key>
<string>Authenticate with biometrics</string>
<key>NFCReaderUsageDescription</key> <key>NFCReaderUsageDescription</key>
<string>Read and write to NFC tags for testing</string> <string>Read and write to NFC tags for testing</string>
</dict> </dict>
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict/> <dict>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
</dict>
</plist> </plist>
+6 -3
View File
@@ -63,12 +63,14 @@ targets:
settings: settings:
base: base:
ENABLE_BITCODE: false ENABLE_BITCODE: false
ARCHS: [arm64] ARCHS: [arm64, arm64-sim]
VALID_ARCHS: arm64 VALID_ARCHS: arm64 arm64-sim
LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: true ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: true
EXCLUDED_ARCHS[sdk=iphoneos*]: x86_64 EXCLUDED_ARCHS[sdk=iphonesimulator*]: arm64
EXCLUDED_ARCHS[sdk=iphoneos*]: arm64-sim x86_64
groups: [app] groups: [app]
dependencies: dependencies:
- framework: libapp.a - framework: libapp.a
@@ -87,3 +89,4 @@ targets:
outputFiles: outputFiles:
- $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a - $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a
- $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a - $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a
- $(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a
+2 -2
View File
@@ -14,11 +14,11 @@ pub struct RequestBody {
#[command] #[command]
pub fn log_operation(event: String, payload: Option<String>) { pub fn log_operation(event: String, payload: Option<String>) {
log::info!("{event} {payload:?}"); log::info!("{} {:?}", event, payload);
} }
#[command] #[command]
pub fn perform_request(endpoint: String, body: RequestBody) -> String { pub fn perform_request(endpoint: String, body: RequestBody) -> String {
println!("{endpoint} {body:?}"); println!("{} {:?}", endpoint, body);
"message response".into() "message response".into()
} }
+1 -23
View File
@@ -36,11 +36,8 @@ pub fn run() {
.plugin(tauri_plugin_notification::init()) .plugin(tauri_plugin_notification::init())
.plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_process::init()) .plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_secure_storage::init())
.plugin(tauri_plugin_store::Builder::default().build()) .plugin(tauri_plugin_store::Builder::default().build())
.plugin(tauri_plugin_upload::init())
.setup(move |app| { .setup(move |app| {
#[cfg(desktop)] #[cfg(desktop)]
{ {
@@ -104,28 +101,9 @@ pub fn run() {
if let Ok(mut request) = server.recv() { if let Ok(mut request) = server.recv() {
let mut body = Vec::new(); let mut body = Vec::new();
let _ = request.as_reader().read_to_end(&mut body); let _ = request.as_reader().read_to_end(&mut body);
let mut headers = request.headers().to_vec();
if !headers.iter().any(|header| header.field == tiny_http::HeaderField::from_bytes(b"Cookie").unwrap()) {
let expires = time::OffsetDateTime::now_utc() + time::Duration::days(1);
// RFC 1123 format
let format = time::macros::format_description!(
"[weekday repr:short], [day] [month repr:short] [year] [hour]:[minute]:[second] GMT"
);
let expires_str = expires.format(format).unwrap();
headers.push(
tiny_http::Header::from_bytes(
&b"Set-Cookie"[..],
format!("session-token=test-value; Secure; Path=/; Expires={expires_str}")
.as_bytes(),
)
.unwrap(),
);
}
let response = tiny_http::Response::new( let response = tiny_http::Response::new(
tiny_http::StatusCode(200), tiny_http::StatusCode(200),
headers, request.headers().to_vec(),
std::io::Cursor::new(body), std::io::Cursor::new(body),
request.body_length(), request.body_length(),
None, None,
+1 -1
View File
@@ -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)
.show_menu_on_left_click(false) .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);
+7 -24
View File
@@ -1,5 +1,6 @@
<script> <script>
import { writable } from 'svelte/store' import { writable } from 'svelte/store'
import { open } from '@tauri-apps/plugin-shell'
import { getCurrentWindow } from '@tauri-apps/api/window' import { getCurrentWindow } from '@tauri-apps/api/window'
import { getCurrentWebview } from '@tauri-apps/api/webview' import { getCurrentWebview } from '@tauri-apps/api/webview'
import * as os from '@tauri-apps/plugin-os' import * as os from '@tauri-apps/plugin-os'
@@ -13,17 +14,14 @@
import Notifications from './views/Notifications.svelte' import Notifications from './views/Notifications.svelte'
import Shortcuts from './views/Shortcuts.svelte' import Shortcuts from './views/Shortcuts.svelte'
import Shell from './views/Shell.svelte' import Shell from './views/Shell.svelte'
import Opener from './views/Opener.svelte'
import Store from './views/Store.svelte' import Store from './views/Store.svelte'
import Updater from './views/Updater.svelte' import Updater from './views/Updater.svelte'
import Upload from './views/Upload.svelte'
import Clipboard from './views/Clipboard.svelte' import Clipboard from './views/Clipboard.svelte'
import WebRTC from './views/WebRTC.svelte' import WebRTC from './views/WebRTC.svelte'
import Scanner from './views/Scanner.svelte' import Scanner from './views/Scanner.svelte'
import Biometric from './views/Biometric.svelte' import Biometric from './views/Biometric.svelte'
import Geolocation from './views/Geolocation.svelte' import Geolocation from './views/Geolocation.svelte'
import Haptics from './views/Haptics.svelte' import Haptics from './views/Haptics.svelte'
import SecureStorage from './views/SecureStorage.svelte'
import { onMount, tick } from 'svelte' import { onMount, tick } from 'svelte'
import { ask } from '@tauri-apps/plugin-dialog' import { ask } from '@tauri-apps/plugin-dialog'
@@ -94,31 +92,16 @@
component: Shell, component: Shell,
icon: 'i-codicon-terminal-bash' icon: 'i-codicon-terminal-bash'
}, },
{
label: 'Opener',
component: Opener,
icon: 'i-codicon-link-external'
},
{ {
label: 'Store', label: 'Store',
component: Store, component: Store,
icon: 'i-codicon-file-code' icon: 'i-codicon-file-code'
}, },
{
label: 'SecureStorage',
component: SecureStorage,
icon: 'i-codicon-file-code'
},
!isMobile && { !isMobile && {
label: 'Updater', label: 'Updater',
component: Updater, component: Updater,
icon: 'i-codicon-cloud-download' icon: 'i-codicon-cloud-download'
}, },
{
label: 'Upload',
component: Upload,
icon: 'i-codicon-cloud-upload'
},
{ {
label: 'Clipboard', label: 'Clipboard',
component: Clipboard, component: Clipboard,
@@ -219,9 +202,9 @@
...r, ...r,
{ {
html: html:
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` `<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` +
+ (typeof value === 'string' ? value : JSON.stringify(value, null, 1)) (typeof value === 'string' ? value : JSON.stringify(value, null, 1)) +
+ '</pre>' '</pre>'
} }
]) ])
await tick() await tick()
@@ -235,9 +218,9 @@
...r, ...r,
{ {
html: html:
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` `<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` +
+ html html +
+ '</pre>' '</pre>'
} }
]) ])
await tick() await tick()
+11 -35
View File
@@ -8,7 +8,6 @@
let filter = null; let filter = null;
let multiple = false; let multiple = false;
let directory = false; let directory = false;
let pickerMode = "";
function arrayBufferToBase64(buffer, callback) { function arrayBufferToBase64(buffer, callback) {
var blob = new Blob([buffer], { var blob = new Blob([buffer], {
@@ -45,13 +44,6 @@
await message("Tauri is awesome!"); await message("Tauri is awesome!");
} }
async function msgCustom(result) {
const buttons = { yes: "awesome", no: "amazing", cancel: "stunning" };
await message(`Tauri is: `, { buttons })
.then((res) => onMessage(`Tauri is ${res}`))
.catch(onMessage);
}
function openDialog() { function openDialog() {
open({ open({
title: "My wonderful open dialog", title: "My wonderful open dialog",
@@ -66,7 +58,6 @@
: [], : [],
multiple, multiple,
directory, directory,
pickerMode: pickerMode === "" ? undefined : pickerMode,
}) })
.then(function (res) { .then(function (res) {
if (Array.isArray(res)) { if (Array.isArray(res)) {
@@ -96,7 +87,7 @@
onMessage(res); onMessage(res);
} }
}) })
.catch(onMessage); .catch(onMessage(res));
} }
}) })
.catch(onMessage); .catch(onMessage);
@@ -114,7 +105,7 @@
}, },
] ]
: [], : [],
}) })
.then(onMessage) .then(onMessage)
.catch(onMessage); .catch(onMessage);
} }
@@ -144,28 +135,13 @@
<input type="checkbox" id="dialog-directory" bind:checked={directory} /> <input type="checkbox" id="dialog-directory" bind:checked={directory} />
<label for="dialog-directory">Directory</label> <label for="dialog-directory">Directory</label>
</div> </div>
<div>
<label for="dialog-picker-mode">Picker Mode:</label>
<select id="dialog-picker-mode" bind:value={pickerMode}>
<option value="">None</option>
<option value="media">Media</option>
<option value="image">Image</option>
<option value="video">Video</option>
<option value="document">Document</option>
</select>
</div>
<br /> <br />
<button class="btn" id="open-dialog" on:click={openDialog}>Open dialog</button>
<div class="flex flex-wrap flex-col md:flex-row gap-2 children:flex-shrink-0"> <button class="btn" id="save-dialog" on:click={saveDialog}
<button class="btn" id="open-dialog" on:click={openDialog}>Open dialog</button> >Open save dialog</button
<button class="btn" id="save-dialog" on:click={saveDialog} >
>Open save dialog</button <button class="btn" id="prompt-dialog" on:click={prompt}>Prompt</button>
> <button class="btn" id="custom-prompt-dialog" on:click={promptCustom}
<button class="btn" id="prompt-dialog" on:click={prompt}>Prompt</button> >Prompt (custom)</button
<button class="btn" id="custom-prompt-dialog" on:click={promptCustom} >
>Prompt (custom)</button <button class="btn" id="message-dialog" on:click={msg}>Message</button>
>
<button class="btn" id="message-dialog" on:click={msg}>Message</button>
<button class="btn" id="message-dialog" on:click={msgCustom}>Message (custom)</button>
</div>
+90 -122
View File
@@ -1,214 +1,183 @@
<script> <script>
import * as fs from '@tauri-apps/plugin-fs' import * as fs from "@tauri-apps/plugin-fs";
import * as os from '@tauri-apps/plugin-os' import { convertFileSrc } from "@tauri-apps/api/core";
import { convertFileSrc } from '@tauri-apps/api/core' import { arrayBufferToBase64 } from "../lib/utils";
import { arrayBufferToBase64 } from '../lib/utils'
import { onDestroy, onMount } from 'svelte'
const { onMessage, insecureRenderHtml } = $props() export let onMessage;
export let insecureRenderHtml;
let path = $state('') let path = "";
let img let img;
/** @type {fs.FileHandle} */ let file;
let file = $state() let renameTo;
let renameTo = $state() let watchPath = "";
let watchPath = $state('') let watchDebounceDelay = 0;
let watchDebounceDelay = $state(0) let watchRecursive = false;
let watchRecursive = $state(false) let unwatchFn;
/** @type {fs.BaseDirectory | undefined} */ let unwatchPath = "";
let baseDir = $state()
let unwatchFn
let unwatchPath = ''
let isMobile = $state(false)
onMount(() => { function getDir() {
let platform = os.platform() const dirSelect = document.getElementById("dir");
isMobile = platform === 'android' || platform === 'ios' return dirSelect.value ? parseInt(dir.value) : null;
}) }
const dirOptions = Object.keys(fs.BaseDirectory).filter((key) => const DirOptions = Object.keys(fs.BaseDirectory)
isNaN(parseInt(key)) .filter((key) => isNaN(parseInt(key)))
) .map((dir) => [dir, fs.BaseDirectory[dir]]);
function open() { function open() {
fs.open(path, { fs.open(path, {
baseDir, baseDir: getDir(),
read: true, read: true,
write: true, write: true,
create: true create: true,
}) })
.then((f) => { .then((f) => {
file = f file = f;
onMessage(`Opened ${path}`) onMessage(`Opened ${path}`);
}) })
.catch(onMessage) .catch(onMessage);
} }
function mkdir() { function mkdir() {
fs.mkdir(path, { baseDir, recursive: true }) fs.mkdir(path, { baseDir: getDir() })
.then(() => { .then(() => {
onMessage(`Created dir ${path}`) onMessage(`Created dir ${path}`);
}) })
.catch(onMessage) .catch(onMessage);
} }
function remove() { function remove() {
fs.remove(path, { baseDir }) fs.remove(path, { baseDir: getDir() })
.then(() => { .then(() => {
onMessage(`Removed ${path}`) onMessage(`Removed ${path}`);
}) })
.catch(onMessage) .catch(onMessage);
} }
function rename() { function rename() {
fs.rename(path, renameTo, { fs.rename(path, renameTo, {
oldPathBaseDir, oldPathBaseDir: getDir(),
newPathBaseDir newPathBaseDir: getDir(),
}) })
.then(() => { .then(() => {
onMessage(`Renamed ${path} to ${renameTo}`) onMessage(`Renamed ${path} to ${renameTo}`);
}) })
.catch(onMessage) .catch(onMessage);
} }
function truncate() { function truncate() {
file file
.truncate(0) .truncate(0)
.then(() => { .then(() => {
onMessage(`Truncated file`) onMessage(`Truncated file`);
}) })
.catch(onMessage) .catch(onMessage);
}
function write() {
const encoder = new TextEncoder()
file
.write(encoder.encode('Hello from Tauri :)'))
.then(() => {
onMessage(`wrote to file`)
})
.catch(onMessage)
} }
function stat() { function stat() {
file file
.stat() .stat()
.then((stat) => { .then((stat) => {
onMessage(`File stat ${JSON.stringify(stat)}`) onMessage(`File stat ${JSON.stringify(stat)}`);
}) })
.catch(onMessage) .catch(onMessage);
} }
function read() { function read() {
const opts = { const opts = {
baseDir baseDir: getDir(),
} };
fs.stat(path, opts) fs.stat(path, opts)
.then((stat) => { .then((stat) => {
const isFile = stat.isFile const isFile = stat.isFile;
const promise = isFile const promise = isFile
? fs.readFile(path, opts) ? fs.readFile(path, opts)
: fs.readDir(path, opts) : fs.readDir(path, opts);
promise promise
.then(function (response) { .then(function (response) {
if (isFile) { if (isFile) {
if (path.includes('.png') || path.includes('.jpg')) { if (path.includes(".png") || path.includes(".jpg")) {
arrayBufferToBase64( arrayBufferToBase64(
new Uint8Array(response), new Uint8Array(response),
function (base64) { function (base64) {
const src = 'data:image/png;base64,' + base64 const src = "data:image/png;base64," + base64;
insecureRenderHtml('<img src="' + src + '"></img>') insecureRenderHtml('<img src="' + src + '"></img>');
} }
) );
} else { } else {
const value = String.fromCharCode.apply(null, response) const value = String.fromCharCode.apply(null, response);
insecureRenderHtml( insecureRenderHtml(
'<textarea id="file-response"></textarea><button id="file-save">Save</button>' '<textarea id="file-response"></textarea><button id="file-save">Save</button>'
) );
setTimeout(() => { setTimeout(() => {
const fileInput = document.getElementById('file-response') const fileInput = document.getElementById("file-response");
fileInput.value = value fileInput.value = value;
document document
.getElementById('file-save') .getElementById("file-save")
.addEventListener('click', function () { .addEventListener("click", function () {
fs.writeTextFile(path, fileInput.value, { fs.writeTextFile(path, fileInput.value, {
baseDir dir: getDir(),
}).catch(onMessage) }).catch(onMessage);
}) });
}) });
} }
} else { } else {
onMessage(response) onMessage(response);
} }
}) })
.catch(onMessage) .catch(onMessage);
}) })
.catch(onMessage) .catch(onMessage);
} }
function setSrc() { function setSrc() {
img.src = convertFileSrc(path) img.src = convertFileSrc(path);
} }
function watch() { function watch() {
unwatch() unwatch();
if (watchPath) { if (watchPath) {
onMessage(`Watching ${watchPath} for changes`) onMessage(`Watching ${watchPath} for changes`);
let options = { let options = {
recursive: watchRecursive, recursive: watchRecursive,
delayMs: watchDebounceDelay delayMs: parseInt(watchDebounceDelay),
} };
if (options.delayMs === 0) { if (options.delayMs === 0) {
fs.watchImmediate(watchPath, onMessage, options) fs.watchImmediate(watchPath, onMessage, options)
.then((fn) => { .then((fn) => {
unwatchFn = fn unwatchFn = fn;
unwatchPath = watchPath unwatchPath = watchPath;
}) })
.catch(onMessage) .catch(onMessage);
} else { } else {
fs.watch(watchPath, onMessage, options) fs.watch(watchPath, onMessage, options)
.then((fn) => { .then((fn) => {
unwatchFn = fn unwatchFn = fn;
unwatchPath = watchPath unwatchPath = watchPath;
}) })
.catch(onMessage) .catch(onMessage);
} }
} }
} }
function unwatch() { function unwatch() {
if (unwatchFn) { if (unwatchFn) {
onMessage(`Stopped watching ${unwatchPath} for changes`) onMessage(`Stopped watching ${unwatchPath} for changes`);
unwatchFn() unwatchFn();
} }
unwatchFn = undefined unwatchFn = undefined;
unwatchPath = undefined unwatchPath = undefined;
} }
onDestroy(() => {
if (file) {
file.close()
}
if (unwatchFn) {
unwatchFn()
}
})
</script> </script>
<div class="flex flex-col"> <div class="flex flex-col">
{#if isMobile}
<div>
On mobile, paths outside of App* paths require the use of dialogs
regardless of Tauri's scope mechanism.
</div>
<br />
{/if}
<div class="flex gap-1"> <div class="flex gap-1">
<select class="input" bind:value={baseDir}> <select class="input" id="dir">
<option value={undefined} selected>None</option> <option value="">None</option>
{#each dirOptions as dir} {#each DirOptions as dir}
<option value={fs.BaseDirectory[dir]}>{dir}</option> <option value={dir[1]}>{dir[0]}</option>
{/each} {/each}
</select> </select>
<input <input
@@ -219,21 +188,20 @@
</div> </div>
<br /> <br />
<div> <div>
<button class="btn" onclick={open}>Open</button> <button class="btn" on:click={open}>Open</button>
<button class="btn" onclick={read}>Read</button> <button class="btn" on:click={read}>Read</button>
<button class="btn" onclick={mkdir}>Mkdir</button> <button class="btn" on:click={mkdir}>Mkdir</button>
<button class="btn" onclick={remove}>Remove</button> <button class="btn" on:click={remove}>Remove</button>
<div class="flex flex-row"> <div class="flex flex-row">
<button class="btn" onclick={rename}>Rename</button> <button class="btn" on:click={rename}>Rename</button>
<input class="input" bind:value={renameTo} placeholder="To" /> <input class="input" bind:value={renameTo} placeholder="To" />
</div> </div>
<button class="btn" type="button" onclick={setSrc}>Use as img src</button> <button class="btn" type="button" on:click={setSrc}>Use as img src</button>
</div> </div>
{#if file} {#if file}
<div> <div>
<button class="btn" onclick={write}>Write</button> <button class="btn" on:click={truncate}>Truncate</button>
<button class="btn" onclick={truncate}>Truncate</button> <button class="btn" on:click={stat}>Stat</button>
<button class="btn" onclick={stat}>Stat</button>
</div> </div>
{/if} {/if}
@@ -262,8 +230,8 @@
</div> </div>
<br /> <br />
<div> <div>
<button class="btn" onclick={watch}>Watch</button> <button class="btn" on:click={watch}>Watch</button>
<button class="btn" onclick={unwatch}>Unwatch</button> <button class="btn" on:click={unwatch}>Unwatch</button>
</div> </div>
</div> </div>
+4 -14
View File
@@ -1,21 +1,16 @@
<script> <script>
import { sendNotification } from '@tauri-apps/plugin-notification'
export let onMessage export let onMessage
let sound = ''
// send the notification directly // send the notification directly
// the backend is responsible for checking the permission // the backend is responsible for checking the permission
function _sendNotification() { function _sendNotification() {
sendNotification({ new Notification('Notification title', {
title: 'Notification title', body: 'This is the notification body'
body: 'This is the notification body',
sound: sound || null
}) })
} }
// alternatively, check the permission ourselves // alternatively, check the permission ourselves
function triggerNotification() { function sendNotification() {
if (Notification.permission === 'default') { if (Notification.permission === 'default') {
Notification.requestPermission() Notification.requestPermission()
.then(function (response) { .then(function (response) {
@@ -34,11 +29,6 @@
} }
</script> </script>
<input <button class="btn" id="notification" on:click={sendNotification}>
class="input grow"
placeholder="Notification sound..."
bind:value={sound}
/>
<button class="btn" id="notification" on:click={triggerNotification}>
Send test notification Send test notification
</button> </button>
-68
View File
@@ -1,68 +0,0 @@
<script>
import * as opener from '@tauri-apps/plugin-opener'
import { platform } from '@tauri-apps/plugin-os'
export let onMessage
let url = 'https://tauri.app'
let urlProgram =
platform() === 'ios' || platform() === 'android' ? 'inAppBrowser' : ''
function openUrl() {
opener.openUrl(url, urlProgram ? urlProgram : undefined).catch(onMessage)
}
let path = ''
let pathProgram = ''
function openPath() {
opener
.openPath(path, pathProgram ? pathProgram : undefined)
.catch(onMessage)
}
let revealPath = ''
function revealItemInDir() {
opener.revealItemInDir(revealPath).catch(onMessage)
}
</script>
<div class="flex flex-col gap-2">
<form
class="flex flex-row gap-2 items-center"
on:submit|preventDefault={openUrl}
>
<button class="btn" type="submit">Open URL</button>
<input
class="input grow"
placeholder="Type the URL to open..."
bind:value={url}
/>
<span> with </span>
<input class="input" bind:value={urlProgram} />
</form>
<form
class="flex flex-row gap-2 items-center"
on:submit|preventDefault={openPath}
>
<button class="btn" type="submit">Open Path</button>
<input
class="input grow"
placeholder="Type the path to open..."
bind:value={path}
/>
<span> with </span>
<input class="input" bind:value={pathProgram} />
</form>
<form
class="flex flex-row gap-2 items-center"
on:submit|preventDefault={revealItemInDir}
>
<button class="btn" type="submit">Reveal</button>
<input
class="input grow"
placeholder="Type the path to reveal..."
bind:value={revealPath}
/>
</form>
</div>
@@ -1,54 +0,0 @@
<script>
import { onMount } from 'svelte'
import { getString, setString } from '@tauri-apps/plugin-secure-storage'
export let onMessage
let key
let value
let output
async function read(key) {
try {
output = await getString(key)
} catch (error) {
onMessage(error)
}
}
async function write(key, value) {
try {
await setString(key, value)
} catch (error) {
onMessage(error)
}
}
function reset() {
output = ''
}
</script>
<div class="flex flex-col childre:grow gap-1">
<div class="flex flex-col flex-row-md gap-4">
<div class="flex items-center gap-1">
Key:
<input class="grow input" bind:value={key} />
</div>
<div class="flex items-center gap-1">
Value:
<input class="grow input" bind:value />
</div>
<div>
<button class="btn" on:click={() => write(key, value)}>Write</button>
<button class="btn" on:click={() => read(key)}>Read</button>
<button class="btn" on:click={() => reset()}>Reset Output</button>
</div>
</div>
<div>
Output: {output}
</div>
</div>
+32 -49
View File
@@ -1,85 +1,71 @@
<script> <script>
import { appDataDir, resolve } from '@tauri-apps/api/path' import { LazyStore } from "@tauri-apps/plugin-store";
import { LazyStore } from '@tauri-apps/plugin-store' import { onMount } from "svelte";
import { onMount } from 'svelte'
let { onMessage } = $props() export let onMessage;
let key = $state() let key;
let value = $state() let value;
const storeName = 'cache.json' let store = new LazyStore("cache.json");
let cache = {};
let store = new LazyStore(storeName)
let path = $state('')
let cache = $state({})
async function refreshEntries() { async function refreshEntries() {
try { try {
const values = await store.entries() const values = await store.entries();
cache = {} cache = {};
for (const [key, value] of values) { for (const [key, value] of values) {
cache[key] = value cache[key] = value;
} }
} catch (error) { } catch (error) {
onMessage(error) onMessage(error);
} }
} }
onMount(async () => { onMount(async () => {
path = await resolve(await appDataDir(), storeName) await refreshEntries();
await refreshEntries() });
})
async function write(key, value) { async function write(key, value) {
try { try {
if (value) { if (value) {
await store.set(key, value) await store.set(key, value);
} else { } else {
await store.delete(key) await store.delete(key);
} }
const v = await store.get(key) const v = await store.get(key);
if (v === undefined) { if (v === undefined) {
delete cache[key] delete cache[key];
cache = cache cache = cache;
} else { } else {
cache[key] = v cache[key] = v;
} }
} catch (error) { } catch (error) {
onMessage(error) onMessage(error);
} }
} }
async function reset() { async function reset() {
try { try {
await store.reset() await store.reset();
} catch (error) { } catch (error) {
onMessage(error) onMessage(error);
} }
await refreshEntries() await refreshEntries();
}
async function reload() {
try {
await store.reload({ overrideDefaults: true })
} catch (error) {
onMessage(error)
}
await refreshEntries()
} }
async function close() { async function close() {
try { try {
await store.close() await store.close();
onMessage('Store is now closed, any new operations will error out') onMessage("Store is now closed, any new operations will error out");
} catch (error) { } catch (error) {
onMessage(error) onMessage(error);
} }
} }
function reopen() { function reopen() {
store = new LazyStore(storeName) store = new LazyStore("cache.json");
onMessage('We made a new `LazyStore` instance, operations will now work') onMessage("We made a new `LazyStore` instance, operations will now work");
} }
</script> </script>
@@ -96,17 +82,14 @@
</div> </div>
<div> <div>
<button class="btn" onclick={() => write(key, value)}>Write</button> <button class="btn" on:click={() => write(key, value)}>Write</button>
<button class="btn" onclick={() => reset()}>Reset</button> <button class="btn" on:click={() => reset()}>Reset</button>
<button class="btn" onclick={() => reload()}>Reload</button> <button class="btn" on:click={() => close()}>Close</button>
<button class="btn" onclick={() => close()}>Close</button> <button class="btn" on:click={() => reopen()}>Re-open</button>
<button class="btn" onclick={() => reopen()}>Re-open</button>
</div> </div>
<div>Store at <code>{path}</code> on disk</div>
</div> </div>
<div> <div>
<h2>Store Values</h2>
{#each Object.entries(cache) as [k, v]} {#each Object.entries(cache) as [k, v]}
<div>{k} = {v}</div> <div>{k} = {v}</div>
{/each} {/each}
+3 -7
View File
@@ -12,14 +12,10 @@
isChecking = true isChecking = true
try { try {
const update = await check() const update = await check()
if (update) { onMessage(`Should update: ${update.available}`)
onMessage(`Should update: ${update.available}`) onMessage(update)
onMessage(update)
newUpdate = update newUpdate = update
} else {
onMessage('No update available')
}
} catch (e) { } catch (e) {
onMessage(e) onMessage(e)
} finally { } finally {
-417
View File
@@ -1,417 +0,0 @@
<script>
import { download, upload, HttpMethod } from '@tauri-apps/plugin-upload'
import { open } from '@tauri-apps/plugin-dialog'
import { JsonView } from '@zerodevx/svelte-json-view'
import { appDataDir } from '@tauri-apps/api/path'
import { onMount } from 'svelte'
export let onMessage
let downloadUrl = 'https://httpbin.org/json'
let downloadFolder = ''
let downloadPath = ''
let downloadProgress = null
let downloadResult = null
let isDownloading = false
let uploadUrl = 'https://httpbin.org/post'
let uploadFilePath = ''
let uploadMethod = HttpMethod.Post
// Update URL when method changes
$: {
switch (uploadMethod) {
case HttpMethod.Post:
uploadUrl = 'https://httpbin.org/post'
break
case HttpMethod.Put:
uploadUrl = 'https://httpbin.org/put'
break
case HttpMethod.Patch:
uploadUrl = 'https://httpbin.org/patch'
break
}
}
let uploadProgress = null
let uploadResult = null
let isUploading = false
onMount(async () => {
try {
const defaultDir = await appDataDir()
if (!downloadFolder) {
downloadFolder = defaultDir
updateDownloadPath()
}
} catch (error) {
onMessage({ error: `Failed to get default directory: ${error.toString()}` })
}
})
async function selectDownloadFolder() {
try {
const selected = await open({
directory: true,
multiple: false,
defaultPath: downloadFolder || undefined
})
if (selected) {
downloadFolder = selected
updateDownloadPath()
}
} catch (error) {
onMessage({ error: error.toString() })
}
}
function getFilenameFromUrl(url) {
try {
const urlObj = new URL(url)
let pathname = urlObj.pathname
// Remove leading slash
if (pathname.startsWith('/')) {
pathname = pathname.substring(1)
}
// If pathname is empty or ends with slash, use a default name
if (!pathname || pathname.endsWith('/')) {
return 'downloaded-file.json'
}
// Extract filename from pathname
const segments = pathname.split('/')
let filename = segments[segments.length - 1]
// If no extension, try to infer from URL or use default
if (!filename.includes('.')) {
// Check if URL suggests a file type
if (url.includes('json') || urlObj.searchParams.has('format') && urlObj.searchParams.get('format') === 'json') {
filename += '.json'
} else if (url.includes('xml')) {
filename += '.xml'
} else if (url.includes('csv')) {
filename += '.csv'
} else {
filename += '.txt'
}
}
return filename
} catch (error) {
return 'downloaded-file.json'
}
}
function updateDownloadPath() {
if (downloadFolder && downloadUrl) {
const filename = getFilenameFromUrl(downloadUrl)
downloadPath = `${downloadFolder}/${filename}`
} else {
downloadPath = ''
}
}
// Update download path when URL changes
$: if (downloadUrl) {
updateDownloadPath()
}
async function selectUploadFile() {
try {
const selected = await open({
directory: false,
multiple: false
})
if (selected) {
uploadFilePath = selected
}
} catch (error) {
onMessage({ error: error.toString() })
}
}
async function startDownload() {
if (!downloadUrl || !downloadFolder) {
onMessage({ error: 'Please provide both URL and download folder' })
return
}
// Ensure download path is updated
updateDownloadPath()
if (!downloadPath) {
onMessage({ error: 'Could not generate download path' })
return
}
isDownloading = true
downloadProgress = null
downloadResult = null
try {
await download(
downloadUrl,
downloadPath,
(progress) => {
downloadProgress = {
progress: progress.progress,
progressTotal: progress.progressTotal,
total: progress.total,
transferSpeed: progress.transferSpeed,
percentage: progress.total > 0 ? Math.round((progress.progressTotal / progress.total) * 100) : 0
}
},
new Map([
['User-Agent', 'Tauri Upload Plugin Demo']
])
)
downloadResult = {
success: true,
message: `File downloaded successfully to: ${downloadPath}`,
finalProgress: downloadProgress
}
onMessage({
type: 'download',
result: downloadResult
})
} catch (error) {
downloadResult = {
success: false,
error: error.toString()
}
onMessage({ error: error.toString() })
} finally {
isDownloading = false
}
}
async function startUpload() {
if (!uploadUrl || !uploadFilePath) {
onMessage({ error: 'Please provide both URL and file path' })
return
}
isUploading = true
uploadProgress = null
uploadResult = null
try {
const response = await upload(
uploadUrl,
uploadFilePath,
(progress) => {
uploadProgress = {
progress: progress.progress,
progressTotal: progress.progressTotal,
total: progress.total,
transferSpeed: progress.transferSpeed,
percentage: progress.total > 0 ? Math.round((progress.progressTotal / progress.total) * 100) : 0
}
},
new Map([
['User-Agent', 'Tauri Upload Plugin Demo']
]),
uploadMethod
)
uploadResult = {
success: true,
response: response,
finalProgress: uploadProgress
}
onMessage({
type: 'upload',
result: uploadResult
})
} catch (error) {
uploadResult = {
success: false,
error: error.toString()
}
onMessage({ error: error.toString() })
} finally {
isUploading = false
}
}
</script>
<div class="space-y-6">
<div class="bg-gray-50 p-4 rounded-lg">
<h3 class="text-lg font-semibold mb-4 text-gray-800">File Download</h3>
<div class="space-y-3">
<div>
<label for="download-url" class="block text-sm font-medium text-gray-700 mb-1">Download URL:</label>
<input
id="download-url"
bind:value={downloadUrl}
type="url"
placeholder="https://example.com/file.json"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
disabled={isDownloading}
/>
</div>
<div>
<label for="download-folder" class="block text-sm font-medium text-gray-700 mb-1">Download folder:</label>
<div class="flex gap-2">
<input
id="download-folder"
bind:value={downloadFolder}
type="text"
placeholder="Select download folder..."
class="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
disabled={isDownloading}
/>
<button
on:click={selectDownloadFolder}
class="px-4 py-2 bg-gray-500 text-white rounded-md hover:bg-gray-600 disabled:opacity-50"
disabled={isDownloading}
>
Browse
</button>
</div>
</div>
{#if downloadPath}
<div class="bg-blue-50 border border-blue-200 p-3 rounded-md">
<div class="text-sm text-blue-800">
<strong>File will be saved as:</strong>
<div class="font-mono text-xs mt-1 break-all">{downloadPath}</div>
</div>
</div>
{/if}
<button
on:click={startDownload}
class="w-full px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed"
disabled={isDownloading || !downloadUrl || !downloadFolder}
>
{isDownloading ? 'Downloading...' : 'Download File'}
</button>
{#if downloadProgress}
<div class="bg-white p-3 rounded border">
<div class="flex justify-between text-sm text-gray-600 mb-1">
<span>Progress: {downloadProgress.percentage}%</span>
<span>Speed: {Math.round(downloadProgress.transferSpeed / 1024)} KB/s</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2">
<div
class="bg-blue-500 h-2 rounded-full transition-all duration-300"
style="width: {downloadProgress.percentage}%"
></div>
</div>
<div class="text-xs text-gray-500 mt-1">
{Math.round(downloadProgress.progressTotal / 1024)} KB / {Math.round(downloadProgress.total / 1024)} KB
</div>
</div>
{/if}
{#if downloadResult}
<div class="bg-white p-3 rounded border">
<JsonView json={downloadResult} />
</div>
{/if}
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<h3 class="text-lg font-semibold mb-4 text-gray-800">File Upload</h3>
<div class="space-y-3">
<div>
<label for="upload-url" class="block text-sm font-medium text-gray-700 mb-1">Upload URL:</label>
<input
id="upload-url"
bind:value={uploadUrl}
type="url"
placeholder="https://httpbin.org/post"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
disabled={isUploading}
/>
</div>
<div>
<label for="upload-file" class="block text-sm font-medium text-gray-700 mb-1">File to upload:</label>
<div class="flex gap-2">
<input
id="upload-file"
bind:value={uploadFilePath}
type="text"
placeholder="Select file to upload..."
class="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
disabled={isUploading}
/>
<button
on:click={selectUploadFile}
class="px-4 py-2 bg-gray-500 text-white rounded-md hover:bg-gray-600 disabled:opacity-50"
disabled={isUploading}
>
Browse
</button>
</div>
</div>
<div>
<label for="upload-method" class="block text-sm font-medium text-gray-700 mb-1">HTTP Method:</label>
<select
id="upload-method"
bind:value={uploadMethod}
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
disabled={isUploading}
>
<option value={HttpMethod.Post}>POST</option>
<option value={HttpMethod.Put}>PUT</option>
<option value={HttpMethod.Patch}>PATCH</option>
</select>
<p class="text-xs text-gray-500 mt-1">Choose the HTTP method for the upload request</p>
</div>
<div class="bg-blue-50 border border-blue-200 p-3 rounded-md">
<div class="text-sm text-blue-800">
<strong>Upload Configuration:</strong>
<div class="font-mono text-xs mt-1">
Method: {uploadMethod} | URL: {uploadUrl || 'Not set'}
</div>
</div>
</div>
<button
on:click={startUpload}
class="w-full px-4 py-2 bg-green-500 text-white rounded-md hover:bg-green-600 disabled:opacity-50 disabled:cursor-not-allowed"
disabled={isUploading || !uploadUrl || !uploadFilePath}
>
{isUploading ? `Uploading (${uploadMethod})...` : `Upload File (${uploadMethod})`}
</button>
{#if uploadProgress}
<div class="bg-white p-3 rounded border">
<div class="flex justify-between text-sm text-gray-600 mb-1">
<span>Progress: {uploadProgress.percentage}%</span>
<span>Speed: {Math.round(uploadProgress.transferSpeed / 1024)} KB/s</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2">
<div
class="bg-green-500 h-2 rounded-full transition-all duration-300"
style="width: {uploadProgress.percentage}%"
></div>
</div>
<div class="text-xs text-gray-500 mt-1">
{Math.round(uploadProgress.progressTotal / 1024)} KB / {Math.round(uploadProgress.total / 1024)} KB
</div>
</div>
{/if}
{#if uploadResult}
<div class="bg-white p-3 rounded border">
<JsonView json={uploadResult} />
</div>
{/if}
</div>
</div>
</div>
+15 -19
View File
@@ -11,30 +11,26 @@
"example:api:dev": "pnpm run --filter \"api\" tauri dev" "example:api:dev": "pnpm run --filter \"api\" tauri dev"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "9.39.1", "@eslint/js": "9.14.0",
"@rollup/plugin-node-resolve": "16.0.3", "@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-terser": "0.4.4", "@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.3.0", "@rollup/plugin-typescript": "11.1.6",
"covector": "^0.12.4", "@types/eslint__js": "8.42.3",
"eslint": "9.39.1", "covector": "^0.12.3",
"eslint-config-prettier": "10.1.8", "eslint": "9.14.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-security": "3.0.1", "eslint-plugin-security": "3.0.1",
"prettier": "3.6.2", "prettier": "3.3.3",
"rollup": "4.53.2", "rollup": "4.27.0",
"tslib": "2.8.1", "tslib": "2.8.1",
"typescript": "5.9.3", "typescript": "5.6.3",
"typescript-eslint": "8.47.0" "typescript-eslint": "8.14.0"
}, },
"minimumReleaseAge": 4320, "resolutions": {
"pnpm": { "semver": ">=7.5.2",
"overrides": { "optionator": ">=0.9.3"
"esbuild@<0.25.0": ">=0.25.0"
},
"onlyBuiltDependencies": [
"esbuild"
]
}, },
"engines": { "engines": {
"pnpm": "^10.16.0" "pnpm": "^9.0.0"
} }
} }
+8 -20
View File
@@ -1,25 +1,5 @@
# Changelog # Changelog
## \[2.5.1]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.5.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
## \[2.4.0]
- [`764e8f77`](https://github.com/tauri-apps/plugins-workspace/commit/764e8f7719247da515243d9c9cafa6d087d21769) ([#2707](https://github.com/tauri-apps/plugins-workspace/pull/2707)) Added a new builder method app_name() to allow customizing the application name in the autostart entry.
## \[2.3.0]
- [`8ecb418a`](https://github.com/tauri-apps/plugins-workspace/commit/8ecb418a1a35d7f234dc5d833746ac2d8e062aec) ([#2569](https://github.com/tauri-apps/plugins-workspace/pull/2569)) Add a `Builder` for more flexible settings
## \[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.
@@ -108,3 +88,11 @@
## \[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!
+6 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-autostart" name = "tauri-plugin-autostart"
version = "2.5.1" version = "2.0.1"
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 }
@@ -9,6 +9,10 @@ rust-version = { workspace = true }
repository = { workspace = true } repository = { workspace = true }
links = "tauri-plugin-autostart" links = "tauri-plugin-autostart"
[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
windows = { level = "full", notes = "" } windows = { level = "full", notes = "" }
linux = { level = "full", notes = "" } linux = { level = "full", notes = "" }
@@ -23,5 +27,6 @@ tauri-plugin = { workspace = true, features = ["build"] }
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
auto-launch = "0.5" auto-launch = "0.5"
+13 -5
View File
@@ -33,27 +33,35 @@ tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspac
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh ```sh
pnpm add @tauri-apps/plugin-autostart pnpm add @tauri-apps/plugin-autostart
# or # or
npm add @tauri-apps/plugin-autostart npm add @tauri-apps/plugin-autostart
# or # or
yarn add @tauri-apps/plugin-autostart yarn add @tauri-apps/plugin-autostart
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-autostart#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-autostart#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-autostart#v2
``` ```
## Usage ## Usage
First you need to register the core plugin with Tauri: First you need to register the core plugin with Tauri:
`src-tauri/src/lib.rs` `src-tauri/src/main.rs`
```rust ```rust
use tauri_plugin_autostart::MacosLauncher;
fn main() { fn main() {
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_autostart::Builder::new() .plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]) /* arbitrary number of args to pass to your app */))
.args(["--flag1", "--flag2"])
.app_name("My Custom Name")
.build())
.run(tauri::generate_context!()) .run(tauri::generate_context!())
.expect("error while running tauri application"); .expect("error while running tauri application");
} }
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-autostart", "name": "@tauri-apps/plugin-autostart",
"version": "2.5.1", "version": "2.0.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"
@@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.8.0" "@tauri-apps/api": "^2.0.0"
} }
} }
@@ -9,7 +9,7 @@ starting the application on boot.
It allows all to check, enable and It allows all to check, enable and
disable the automatic start on boot. disable the automatic start on boot.
#### This default permission set includes the following:
- `allow-enable` - `allow-enable`
- `allow-disable` - `allow-disable`
@@ -49,7 +49,7 @@
"minimum": 1.0 "minimum": 1.0
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -111,7 +111,7 @@
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -297,44 +297,37 @@
{ {
"description": "Enables the disable command without any pre-configured scope.", "description": "Enables the disable command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-disable", "const": "allow-disable"
"markdownDescription": "Enables the disable command without any pre-configured scope."
}, },
{ {
"description": "Denies the disable command without any pre-configured scope.", "description": "Denies the disable command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-disable", "const": "deny-disable"
"markdownDescription": "Denies the disable command without any pre-configured scope."
}, },
{ {
"description": "Enables the enable command without any pre-configured scope.", "description": "Enables the enable command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-enable", "const": "allow-enable"
"markdownDescription": "Enables the enable command without any pre-configured scope."
}, },
{ {
"description": "Denies the enable command without any pre-configured scope.", "description": "Denies the enable command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-enable", "const": "deny-enable"
"markdownDescription": "Denies the enable command without any pre-configured scope."
}, },
{ {
"description": "Enables the is_enabled command without any pre-configured scope.", "description": "Enables the is_enabled command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-is-enabled", "const": "allow-is-enabled"
"markdownDescription": "Enables the is_enabled command without any pre-configured scope."
}, },
{ {
"description": "Denies the is_enabled command without any pre-configured scope.", "description": "Denies the is_enabled command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-is-enabled", "const": "deny-is-enabled"
"markdownDescription": "Denies the is_enabled command without any pre-configured scope."
}, },
{ {
"description": "This permission set configures if your\r\napplication can enable or disable auto\r\nstarting the application on boot.\r\n\r\n#### Granted Permissions\r\n\r\nIt allows all to check, enable and\r\ndisable the automatic start on boot.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`", "description": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n",
"type": "string", "type": "string",
"const": "default", "const": "default"
"markdownDescription": "This permission set configures if your\r\napplication can enable or disable auto\r\nstarting the application on boot.\r\n\r\n#### Granted Permissions\r\n\r\nIt allows all to check, enable and\r\ndisable the automatic start on boot.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`"
} }
] ]
} }
+54 -148
View File
@@ -11,10 +11,12 @@
#![cfg(not(any(target_os = "android", target_os = "ios")))] #![cfg(not(any(target_os = "android", target_os = "ios")))]
use auto_launch::{AutoLaunch, AutoLaunchBuilder}; use auto_launch::{AutoLaunch, AutoLaunchBuilder};
#[cfg(target_os = "macos")]
use log::info;
use serde::{ser::Serializer, Serialize}; use serde::{ser::Serializer, Serialize};
use tauri::{ use tauri::{
command, command,
plugin::{Builder as PluginBuilder, TauriPlugin}, plugin::{Builder, TauriPlugin},
Manager, Runtime, State, Manager, Runtime, State,
}; };
@@ -22,9 +24,8 @@ use std::env::current_exe;
type Result<T> = std::result::Result<T, Error>; type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Default, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub enum MacosLauncher { pub enum MacosLauncher {
#[default]
LaunchAgent, LaunchAgent,
AppleScript, AppleScript,
} }
@@ -72,12 +73,10 @@ impl AutoLaunchManager {
} }
pub trait ManagerExt<R: Runtime> { pub trait ManagerExt<R: Runtime> {
/// TODO: Rename these to `autostart` or `auto_start` in v3
fn autolaunch(&self) -> State<'_, AutoLaunchManager>; fn autolaunch(&self) -> State<'_, AutoLaunchManager>;
} }
impl<R: Runtime, T: Manager<R>> ManagerExt<R> for T { impl<R: Runtime, T: Manager<R>> ManagerExt<R> for T {
/// TODO: Rename these to `autostart` or `auto_start` in v3
fn autolaunch(&self) -> State<'_, AutoLaunchManager> { fn autolaunch(&self) -> State<'_, AutoLaunchManager> {
self.state::<AutoLaunchManager>() self.state::<AutoLaunchManager>()
} }
@@ -98,153 +97,60 @@ async fn is_enabled(manager: State<'_, AutoLaunchManager>) -> Result<bool> {
manager.is_enabled() manager.is_enabled()
} }
#[derive(Default)]
pub struct Builder {
#[cfg(target_os = "macos")]
macos_launcher: MacosLauncher,
args: Vec<String>,
app_name: Option<String>,
}
impl Builder {
/// Create a new auto start builder with default settings
pub fn new() -> Self {
Self::default()
}
/// Adds an argument to pass to your app on startup.
///
/// ## Examples
///
/// ```no_run
/// Builder::new()
/// .arg("--from-autostart")
/// .arg("--hey")
/// .build();
/// ```
pub fn arg<S: Into<String>>(mut self, arg: S) -> Self {
self.args.push(arg.into());
self
}
/// Adds multiple arguments to pass to your app on startup.
///
/// ## Examples
///
/// ```no_run
/// Builder::new()
/// .args(["--from-autostart", "--hey"])
/// .build();
/// ```
pub fn args<I, S>(mut self, args: I) -> Self
where
I: IntoIterator<Item = S>,
S: Into<String>,
{
for arg in args {
self = self.arg(arg);
}
self
}
/// Sets whether to use launch agent or apple script to be used to enable auto start,
/// the builder's default is [`MacosLauncher::LaunchAgent`]
#[cfg(target_os = "macos")]
pub fn macos_launcher(mut self, macos_launcher: MacosLauncher) -> Self {
self.macos_launcher = macos_launcher;
self
}
/// Sets the app name to be used for the auto start entry.
///
/// ## Examples
///
/// ```no_run
/// Builder::new()
/// .app_name("My Custom Name"))
/// .build();
/// ```
pub fn app_name<S: Into<String>>(mut self, app_name: S) -> Self {
self.app_name = Some(app_name.into());
self
}
pub fn build<R: Runtime>(self) -> TauriPlugin<R> {
PluginBuilder::new("autostart")
.invoke_handler(tauri::generate_handler![enable, disable, is_enabled])
.setup(move |app, _api| {
let mut builder = AutoLaunchBuilder::new();
let app_name = self
.app_name
.as_ref()
.unwrap_or_else(|| &app.package_info().name);
builder.set_app_name(app_name);
builder.set_args(&self.args);
let current_exe = current_exe()?;
#[cfg(windows)]
builder.set_app_path(&current_exe.display().to_string());
#[cfg(target_os = "macos")]
{
builder.set_use_launch_agent(matches!(
self.macos_launcher,
MacosLauncher::LaunchAgent
));
// on macOS, current_exe gives path to /Applications/Example.app/MacOS/Example
// but this results in seeing a Unix Executable in macOS login items
// It must be: /Applications/Example.app
// If it didn't find exactly a single occurance of .app, it will default to
// exe path to not break it.
let exe_path = current_exe.canonicalize()?.display().to_string();
let parts: Vec<&str> = exe_path.split(".app/").collect();
let app_path = if parts.len() == 2
&& matches!(self.macos_launcher, MacosLauncher::AppleScript)
{
format!("{}.app", parts.first().unwrap())
} else {
exe_path
};
builder.set_app_path(&app_path);
}
#[cfg(target_os = "linux")]
if let Some(appimage) = app
.env()
.appimage
.and_then(|p| p.to_str().map(|s| s.to_string()))
{
builder.set_app_path(&appimage);
} else {
builder.set_app_path(&current_exe.display().to_string());
}
app.manage(AutoLaunchManager(
builder.build().map_err(|e| e.to_string())?,
));
Ok(())
})
.build()
}
}
/// Initializes the plugin. /// Initializes the plugin.
/// ///
/// `args` - are passed to your app on startup. /// `args` - are passed to your app on startup.
pub fn init<R: Runtime>( pub fn init<R: Runtime>(
#[allow(unused)] macos_launcher: MacosLauncher, macos_launcher: MacosLauncher,
args: Option<Vec<&'static str>>, args: Option<Vec<&'static str>>,
) -> TauriPlugin<R> { ) -> TauriPlugin<R> {
let mut builder = Builder::new(); Builder::new("autostart")
if let Some(args) = args { .invoke_handler(tauri::generate_handler![enable, disable, is_enabled])
builder = builder.args(args) .setup(move |app, _api| {
} let mut builder = AutoLaunchBuilder::new();
#[cfg(target_os = "macos")] builder.set_app_name(&app.package_info().name);
{ if let Some(args) = args {
builder = builder.macos_launcher(macos_launcher); builder.set_args(&args);
} }
builder.build() builder.set_use_launch_agent(matches!(macos_launcher, MacosLauncher::LaunchAgent));
let current_exe = current_exe()?;
#[cfg(windows)]
builder.set_app_path(&current_exe.display().to_string());
#[cfg(target_os = "macos")]
{
// on macOS, current_exe gives path to /Applications/Example.app/MacOS/Example
// but this results in seeing a Unix Executable in macOS login items
// It must be: /Applications/Example.app
// If it didn't find exactly a single occurance of .app, it will default to
// exe path to not break it.
let exe_path = current_exe.canonicalize()?.display().to_string();
let parts: Vec<&str> = exe_path.split(".app/").collect();
let app_path =
if parts.len() == 2 && matches!(macos_launcher, MacosLauncher::AppleScript) {
format!("{}.app", parts.first().unwrap())
} else {
exe_path
};
info!("auto_start path {}", &app_path);
builder.set_app_path(&app_path);
}
#[cfg(target_os = "linux")]
if let Some(appimage) = app
.env()
.appimage
.and_then(|p| p.to_str().map(|s| s.to_string()))
{
builder.set_app_path(&appimage);
} else {
builder.set_app_path(&current_exe.display().to_string());
}
app.manage(AutoLaunchManager(
builder.build().map_err(|e| e.to_string())?,
));
Ok(())
})
.build()
} }
-25
View File
@@ -1,30 +1,5 @@
# Changelog # Changelog
## \[2.4.2]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.4.1]
- [`654bf489`](https://github.com/tauri-apps/plugins-workspace/commit/654bf4891a35769f7e82971641d3ad99974b2dfe) ([#3038](https://github.com/tauri-apps/plugins-workspace/pull/3038) by [@daniel-mader](https://github.com/tauri-apps/plugins-workspace/../../daniel-mader)) Update `androidx.camera` from `1.1.0` to `1.5.1` to support 16 KB memory page sizes.
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
## \[2.4.0]
- [`aa9140e1`](https://github.com/tauri-apps/plugins-workspace/commit/aa9140e1ac239ab9f015f92b2ed52bbf0eda7c12) ([#2437](https://github.com/tauri-apps/plugins-workspace/pull/2437) by [@enkhjile](https://github.com/tauri-apps/plugins-workspace/../../enkhjile)) Added support for GS1 DataBar on iOS 15.4+
## \[2.3.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
## \[2.2.1]
- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
## \[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.
+3 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-barcode-scanner" name = "tauri-plugin-barcode-scanner"
version = "2.4.2" version = "2.0.1"
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 }
@@ -10,6 +10,8 @@ repository = { workspace = true }
links = "tauri-plugin-barcode-scanner" links = "tauri-plugin-barcode-scanner"
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-linux-android"] targets = ["x86_64-linux-android"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
+10 -1
View File
@@ -33,19 +33,28 @@ tauri-plugin-barcode-scanner = { git = "https://github.com/tauri-apps/plugins-wo
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh ```sh
pnpm add @tauri-apps/plugin-barcode-scanner pnpm add @tauri-apps/plugin-barcode-scanner
# or # or
npm add @tauri-apps/plugin-barcode-scanner npm add @tauri-apps/plugin-barcode-scanner
# or # or
yarn add @tauri-apps/plugin-barcode-scanner yarn add @tauri-apps/plugin-barcode-scanner
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2
``` ```
## Usage ## Usage
First you need to register the core plugin with Tauri: First you need to register the core plugin with Tauri:
`src-tauri/src/lib.rs` `src-tauri/src/main.rs`
```rust ```rust
fn main() { fn main() {
@@ -5,7 +5,7 @@ plugins {
android { android {
namespace = "app.tauri.barcodescanner" namespace = "app.tauri.barcodescanner"
compileSdk = 36 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24
@@ -33,14 +33,16 @@ android {
} }
dependencies { dependencies {
val camerax_version = "1.5.1"
implementation("androidx.core:core-ktx:1.9.0") implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.0") implementation("androidx.appcompat:appcompat:1.6.0")
implementation("com.google.android.material:material:1.7.0") implementation("com.google.android.material:material:1.7.0")
implementation("androidx.camera:camera-core:${camerax_version}") implementation("androidx.camera:camera-core:1.1.0")
implementation("androidx.camera:camera-camera2:${camerax_version}") implementation("androidx.camera:camera-view:1.1.0")
implementation("androidx.camera:camera-lifecycle:${camerax_version}") implementation("androidx.camera:camera-lifecycle:1.1.0")
implementation("androidx.camera:camera-view:${camerax_version}") implementation("androidx.camera:camera-camera2:1.1.0")
implementation("androidx.camera:camera-lifecycle:1.1.0")
implementation("androidx.camera:camera-view:1.1.0")
implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.1.0") implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.1.0")
testImplementation("junit:junit:4.13.2") testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.ext:junit:1.1.5")
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODE_SCANNER__=function(n){"use strict";async function a(n,a={},e){return window.__TAURI_INTERNALS__.invoke(n,a,e)}var e;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(e=n.Format||(n.Format={})).QRCode="QR_CODE",e.UPC_A="UPC_A",e.UPC_E="UPC_E",e.EAN8="EAN_8",e.EAN13="EAN_13",e.Code39="CODE_39",e.Code93="CODE_93",e.Code128="CODE_128",e.Codabar="CODABAR",e.ITF="ITF",e.Aztec="AZTEC",e.DataMatrix="DATA_MATRIX",e.PDF417="PDF_417",e.GS1DataBar="GS1_DATA_BAR",e.GS1DataBarLimited="GS1_DATA_BAR_LIMITED",e.GS1DataBarExpanded="GS1_DATA_BAR_EXPANDED",n.cancel=async function(){await a("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await async function(n){return a(`plugin:${n}|check_permissions`)}("barcode-scanner").then((n=>n.camera))},n.openAppSettings=async function(){await a("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await async function(n){return a(`plugin:${n}|request_permissions`)}("barcode-scanner").then((n=>n.camera))},n.scan=async function(n){return await a("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODE_SCANNER__})} if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODE_SCANNER__=function(n){"use strict";async function e(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}var r;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(r=n.Format||(n.Format={})).QRCode="QR_CODE",r.UPC_A="UPC_A",r.UPC_E="UPC_E",r.EAN8="EAN_8",r.EAN13="EAN_13",r.Code39="CODE_39",r.Code93="CODE_93",r.Code128="CODE_128",r.Codabar="CODABAR",r.ITF="ITF",r.Aztec="AZTEC",r.DataMatrix="DATA_MATRIX",r.PDF417="PDF_417",n.cancel=async function(){await e("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await async function(n){return e(`plugin:${n}|check_permissions`)}("barcode-scanner").then((n=>n.camera))},n.openAppSettings=async function(){await e("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await async function(n){return e(`plugin:${n}|request_permissions`)}("barcode-scanner").then((n=>n.camera))},n.scan=async function(n){return await e("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODE_SCANNER__})}
+1 -19
View File
@@ -12,9 +12,6 @@ export type { PermissionState } from '@tauri-apps/api/core'
export enum Format { export enum Format {
QRCode = 'QR_CODE', QRCode = 'QR_CODE',
/**
* Not supported on iOS.
*/
UPC_A = 'UPC_A', UPC_A = 'UPC_A',
UPC_E = 'UPC_E', UPC_E = 'UPC_E',
EAN8 = 'EAN_8', EAN8 = 'EAN_8',
@@ -22,26 +19,11 @@ export enum Format {
Code39 = 'CODE_39', Code39 = 'CODE_39',
Code93 = 'CODE_93', Code93 = 'CODE_93',
Code128 = 'CODE_128', Code128 = 'CODE_128',
/**
* Not supported on iOS.
*/
Codabar = 'CODABAR', Codabar = 'CODABAR',
ITF = 'ITF', ITF = 'ITF',
Aztec = 'AZTEC', Aztec = 'AZTEC',
DataMatrix = 'DATA_MATRIX', DataMatrix = 'DATA_MATRIX',
PDF417 = 'PDF_417', PDF417 = 'PDF_417'
/**
* Not supported on Android. Requires iOS 15.4+
*/
GS1DataBar = 'GS1_DATA_BAR',
/**
* Not supported on Android. Requires iOS 15.4+
*/
GS1DataBarLimited = 'GS1_DATA_BAR_LIMITED',
/**
* Not supported on Android. Requires iOS 15.4+
*/
GS1DataBarExpanded = 'GS1_DATA_BAR_EXPANDED'
} }
export interface ScanOptions { export interface ScanOptions {
@@ -27,11 +27,8 @@ enum SupportedFormat: String, CaseIterable, Decodable {
case DATA_MATRIX case DATA_MATRIX
case PDF_417 case PDF_417
case QR_CODE case QR_CODE
case GS1_DATA_BAR
case GS1_DATA_BAR_LIMITED
case GS1_DATA_BAR_EXPANDED
var value: AVMetadataObject.ObjectType? { var value: AVMetadataObject.ObjectType {
switch self { switch self {
case .UPC_E: return AVMetadataObject.ObjectType.upce case .UPC_E: return AVMetadataObject.ObjectType.upce
case .EAN_8: return AVMetadataObject.ObjectType.ean8 case .EAN_8: return AVMetadataObject.ObjectType.ean8
@@ -44,24 +41,6 @@ enum SupportedFormat: String, CaseIterable, Decodable {
case .DATA_MATRIX: return AVMetadataObject.ObjectType.dataMatrix case .DATA_MATRIX: return AVMetadataObject.ObjectType.dataMatrix
case .PDF_417: return AVMetadataObject.ObjectType.pdf417 case .PDF_417: return AVMetadataObject.ObjectType.pdf417
case .QR_CODE: return AVMetadataObject.ObjectType.qr case .QR_CODE: return AVMetadataObject.ObjectType.qr
case .GS1_DATA_BAR:
if #available(iOS 15.4, *) {
return AVMetadataObject.ObjectType.gs1DataBar
} else {
return nil
}
case .GS1_DATA_BAR_LIMITED:
if #available(iOS 15.4, *) {
return AVMetadataObject.ObjectType.gs1DataBarLimited
} else {
return nil
}
case .GS1_DATA_BAR_EXPANDED:
if #available(iOS 15.4, *) {
return AVMetadataObject.ObjectType.gs1DataBarExpanded
} else {
return nil
}
} }
} }
} }
@@ -191,7 +170,6 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
if self.captureSession != nil { if self.captureSession != nil {
self.captureSession!.stopRunning() self.captureSession!.stopRunning()
self.cameraView.removePreviewLayer() self.cameraView.removePreviewLayer()
self.cameraView.removeFromSuperview()
self.captureVideoPreviewLayer = nil self.captureVideoPreviewLayer = nil
self.metaOutput = nil self.metaOutput = nil
self.captureSession = nil self.captureSession = nil
@@ -264,20 +242,13 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
scanFormats = [AVMetadataObject.ObjectType]() scanFormats = [AVMetadataObject.ObjectType]()
(args.formats ?? []).forEach { format in (args.formats ?? []).forEach { format in
if let formatValue = format.value { scanFormats.append(format.value)
scanFormats.append(formatValue)
} else {
invoke.reject("Unsupported barcode format on this iOS version: \(format)")
return
}
} }
if scanFormats.isEmpty { if scanFormats.count == 0 {
for supportedFormat in SupportedFormat.allCases { for supportedFormat in SupportedFormat.allCases {
if let formatValue = supportedFormat.value { scanFormats.append(supportedFormat.value)
scanFormats.append(formatValue) }
}
}
} }
self.metaOutput!.metadataObjectTypes = self.scanFormats self.metaOutput!.metadataObjectTypes = self.scanFormats
@@ -52,15 +52,6 @@ func discoverCaptureDevices() -> [AVCaptureDevice] {
} }
func formatStringFromMetadata(_ type: AVMetadataObject.ObjectType) -> String { func formatStringFromMetadata(_ type: AVMetadataObject.ObjectType) -> String {
if #available(iOS 15.4, *) {
if type == .gs1DataBar {
return "GS1_DATA_BAR"
} else if type == .gs1DataBarLimited {
return "GS1_DATA_BAR_LIMITED"
} else if type == .gs1DataBarExpanded {
return "GS1_DATA_BAR_EXPANDED"
}
}
switch type { switch type {
case AVMetadataObject.ObjectType.upce: case AVMetadataObject.ObjectType.upce:
return "UPC_E" return "UPC_E"
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-barcode-scanner", "name": "@tauri-apps/plugin-barcode-scanner",
"version": "2.4.2", "version": "2.0.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": [
@@ -25,6 +25,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.8.0" "@tauri-apps/api": "^2.0.0"
} }
} }
@@ -7,7 +7,7 @@ barcode scanning features are by default exposed.
It allows all barcode related features. It allows all barcode related features.
#### This default permission set includes the following:
- `allow-cancel` - `allow-cancel`
- `allow-check-permissions` - `allow-check-permissions`
@@ -49,7 +49,7 @@
"minimum": 1.0 "minimum": 1.0
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -111,7 +111,7 @@
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -297,80 +297,67 @@
{ {
"description": "Enables the cancel command without any pre-configured scope.", "description": "Enables the cancel command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-cancel", "const": "allow-cancel"
"markdownDescription": "Enables the cancel command without any pre-configured scope."
}, },
{ {
"description": "Denies the cancel command without any pre-configured scope.", "description": "Denies the cancel command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-cancel", "const": "deny-cancel"
"markdownDescription": "Denies the cancel command without any pre-configured scope."
}, },
{ {
"description": "Enables the check_permissions command without any pre-configured scope.", "description": "Enables the check_permissions command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-check-permissions", "const": "allow-check-permissions"
"markdownDescription": "Enables the check_permissions command without any pre-configured scope."
}, },
{ {
"description": "Denies the check_permissions command without any pre-configured scope.", "description": "Denies the check_permissions command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-check-permissions", "const": "deny-check-permissions"
"markdownDescription": "Denies the check_permissions command without any pre-configured scope."
}, },
{ {
"description": "Enables the open_app_settings command without any pre-configured scope.", "description": "Enables the open_app_settings command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-open-app-settings", "const": "allow-open-app-settings"
"markdownDescription": "Enables the open_app_settings command without any pre-configured scope."
}, },
{ {
"description": "Denies the open_app_settings command without any pre-configured scope.", "description": "Denies the open_app_settings command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-open-app-settings", "const": "deny-open-app-settings"
"markdownDescription": "Denies the open_app_settings command without any pre-configured scope."
}, },
{ {
"description": "Enables the request_permissions command without any pre-configured scope.", "description": "Enables the request_permissions command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-request-permissions", "const": "allow-request-permissions"
"markdownDescription": "Enables the request_permissions command without any pre-configured scope."
}, },
{ {
"description": "Denies the request_permissions command without any pre-configured scope.", "description": "Denies the request_permissions command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-request-permissions", "const": "deny-request-permissions"
"markdownDescription": "Denies the request_permissions command without any pre-configured scope."
}, },
{ {
"description": "Enables the scan command without any pre-configured scope.", "description": "Enables the scan command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-scan", "const": "allow-scan"
"markdownDescription": "Enables the scan command without any pre-configured scope."
}, },
{ {
"description": "Denies the scan command without any pre-configured scope.", "description": "Denies the scan command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-scan", "const": "deny-scan"
"markdownDescription": "Denies the scan command without any pre-configured scope."
}, },
{ {
"description": "Enables the vibrate command without any pre-configured scope.", "description": "Enables the vibrate command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-vibrate", "const": "allow-vibrate"
"markdownDescription": "Enables the vibrate command without any pre-configured scope."
}, },
{ {
"description": "Denies the vibrate command without any pre-configured scope.", "description": "Denies the vibrate command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-vibrate", "const": "deny-vibrate"
"markdownDescription": "Denies the vibrate command without any pre-configured scope."
}, },
{ {
"description": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n\n#### This default permission set includes:\n\n- `allow-cancel`\n- `allow-check-permissions`\n- `allow-open-app-settings`\n- `allow-request-permissions`\n- `allow-scan`\n- `allow-vibrate`", "description": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n",
"type": "string", "type": "string",
"const": "default", "const": "default"
"markdownDescription": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n\n#### This default permission set includes:\n\n- `allow-cancel`\n- `allow-check-permissions`\n- `allow-open-app-settings`\n- `allow-request-permissions`\n- `allow-scan`\n- `allow-vibrate`"
} }
] ]
} }
-26
View File
@@ -1,31 +1,5 @@
# Changelog # Changelog
## \[2.3.2]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.3.1]
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
## \[2.3.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
## \[2.2.2]
- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
## \[2.2.1]
### bug
- [`10f9e66e`](https://github.com/tauri-apps/plugins-workspace/commit/10f9e66e32141dd35f4bf884fbf9102691187e92) ([#2633](https://github.com/tauri-apps/plugins-workspace/pull/2633) by [@pjf-dev](https://github.com/tauri-apps/plugins-workspace/../../pjf-dev)) Fix biometric plugin ignoring fallback logic when biometry status is unavailable or not enrolled on iOS.
## \[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.
+3 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-biometric" name = "tauri-plugin-biometric"
version = "2.3.2" version = "2.0.1"
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 }
@@ -9,6 +9,8 @@ repository = { workspace = true }
links = "tauri-plugin-biometric" links = "tauri-plugin-biometric"
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-linux-android"] targets = ["x86_64-linux-android"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
+10 -1
View File
@@ -33,6 +33,8 @@ tauri-plugin-biometric = { git = "https://github.com/tauri-apps/plugins-workspac
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
<!-- Add the branch for installations using git! --> <!-- Add the branch for installations using git! -->
```sh ```sh
@@ -41,13 +43,20 @@ pnpm add @tauri-apps/plugin-biometric
npm add @tauri-apps/plugin-biometric npm add @tauri-apps/plugin-biometric
# or # or
yarn add @tauri-apps/plugin-biometric yarn add @tauri-apps/plugin-biometric
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-biometric#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-biometric#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-biometric#v2
``` ```
## Usage ## Usage
First you need to register the core plugin with Tauri: First you need to register the core plugin with Tauri:
`src-tauri/src/lib.rs` `src-tauri/src/main.rs`
```rust ```rust
fn main() { fn main() {
+1 -1
View File
@@ -5,7 +5,7 @@ plugins {
android { android {
namespace = "app.tauri.biometric" namespace = "app.tauri.biometric"
compileSdk = 36 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24
@@ -98,12 +98,7 @@ class BiometricPlugin: Plugin {
} }
@objc func authenticate(_ invoke: Invoke) throws { @objc func authenticate(_ invoke: Invoke) throws {
let args = try invoke.parseArgs(AuthOptions.self) guard self.status.available else {
let allowDeviceCredential = args.allowDeviceCredential ?? false
guard self.status.available || allowDeviceCredential else {
// Biometry unavailable, fallback disabled
invoke.reject( invoke.reject(
self.status.errorReason ?? "", self.status.errorReason ?? "",
code: self.status.errorCode ?? "" code: self.status.errorCode ?? ""
@@ -111,11 +106,15 @@ class BiometricPlugin: Plugin {
return return
} }
let args = try invoke.parseArgs(AuthOptions.self)
let context = LAContext() let context = LAContext()
context.localizedFallbackTitle = args.fallbackTitle context.localizedFallbackTitle = args.fallbackTitle
context.localizedCancelTitle = args.cancelTitle context.localizedCancelTitle = args.cancelTitle
context.touchIDAuthenticationAllowableReuseDuration = 0 context.touchIDAuthenticationAllowableReuseDuration = 0
let allowDeviceCredential = args.allowDeviceCredential ?? false
// force system default fallback title if an empty string is provided (the OS hides the fallback button in this case) // force system default fallback title if an empty string is provided (the OS hides the fallback button in this case)
if allowDeviceCredential, if allowDeviceCredential,
let fallbackTitle = context.localizedFallbackTitle, let fallbackTitle = context.localizedFallbackTitle,
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-biometric", "name": "@tauri-apps/plugin-biometric",
"version": "2.3.2", "version": "2.0.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"
@@ -25,6 +25,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.8.0" "@tauri-apps/api": "^2.0.0"
} }
} }
@@ -7,7 +7,7 @@ biometric features are by default exposed.
It allows acccess to all biometric commands. It allows acccess to all biometric commands.
#### This default permission set includes the following:
- `allow-authenticate` - `allow-authenticate`
- `allow-status` - `allow-status`
@@ -49,7 +49,7 @@
"minimum": 1.0 "minimum": 1.0
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -111,7 +111,7 @@
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -297,32 +297,27 @@
{ {
"description": "Enables the authenticate command without any pre-configured scope.", "description": "Enables the authenticate command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-authenticate", "const": "allow-authenticate"
"markdownDescription": "Enables the authenticate command without any pre-configured scope."
}, },
{ {
"description": "Denies the authenticate command without any pre-configured scope.", "description": "Denies the authenticate command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-authenticate", "const": "deny-authenticate"
"markdownDescription": "Denies the authenticate command without any pre-configured scope."
}, },
{ {
"description": "Enables the status command without any pre-configured scope.", "description": "Enables the status command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-status", "const": "allow-status"
"markdownDescription": "Enables the status command without any pre-configured scope."
}, },
{ {
"description": "Denies the status command without any pre-configured scope.", "description": "Denies the status command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-status", "const": "deny-status"
"markdownDescription": "Denies the status command without any pre-configured scope."
}, },
{ {
"description": "This permission set configures which\r\nbiometric features are by default exposed.\r\n\r\n#### Granted Permissions\r\n\r\nIt allows acccess to all biometric commands.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`", "description": "This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n",
"type": "string", "type": "string",
"const": "default", "const": "default"
"markdownDescription": "This permission set configures which\r\nbiometric features are by default exposed.\r\n\r\n#### Granted Permissions\r\n\r\nIt allows acccess to all biometric commands.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`"
} }
] ]
} }
+7 -23
View File
@@ -1,28 +1,5 @@
# Changelog # Changelog
## \[2.4.1]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.4.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
## \[2.3.0]
- [`f6e11282`](https://github.com/tauri-apps/plugins-workspace/commit/f6e11282a7f4036dd6d1dbb8f100e777e9e42f11) ([#2787](https://github.com/tauri-apps/plugins-workspace/pull/2787) by [@mikew](https://github.com/tauri-apps/plugins-workspace/../../mikew)) Added `Cli.matches_from(args)`. This can be combined with the `args` passed to the callback of `tauri_plugin_single_instance::init` to parse the command line arguments passed to subsequent instances of the application.
- [`37c2fb41`](https://github.com/tauri-apps/plugins-workspace/commit/37c2fb41201160e85c8dc3ad40f462cd4e17a304) ([#2772](https://github.com/tauri-apps/plugins-workspace/pull/2772) by [@floriskn](https://github.com/tauri-apps/plugins-workspace/../../floriskn)) Added a new `global` boolean flag to the `CliArg` struct to support global CLI arguments. This flag allows arguments like `--verbose` to be marked as global and automatically propagated to all subcommands, enabling consistent availability throughout the CLI.
The new field is optional and defaults to false.
## \[2.2.1]
- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
## \[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.
@@ -112,3 +89,10 @@
- [`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!
+5 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-cli" name = "tauri-plugin-cli"
version = "2.4.1" version = "2.0.1"
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 }
@@ -9,6 +9,10 @@ rust-version = { workspace = true }
repository = { workspace = true } repository = { workspace = true }
links = "tauri-plugin-cli" links = "tauri-plugin-cli"
[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
windows = { level = "full", notes = "" } windows = { level = "full", notes = "" }
linux = { level = "full", notes = "" } linux = { level = "full", notes = "" }
+10 -1
View File
@@ -34,19 +34,28 @@ tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", br
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh ```sh
pnpm add @tauri-apps/plugin-cli pnpm add @tauri-apps/plugin-cli
# or # or
npm add @tauri-apps/plugin-cli npm add @tauri-apps/plugin-cli
# or # or
yarn add @tauri-apps/plugin-cli yarn add @tauri-apps/plugin-cli
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-cli#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-cli#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-cli#v2
``` ```
## Usage ## Usage
First you need to register the core plugin with Tauri: First you need to register the core plugin with Tauri:
`src-tauri/src/lib.rs` `src-tauri/src/main.rs`
```rust ```rust
fn main() { fn main() {

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