mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-11 10:43:31 +02:00
Compare commits
7 Commits
cli.rs-v1
...
feat/comma
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83a9e6c572 | ||
|
|
f7e86798c2 | ||
|
|
936d46a41a | ||
|
|
a115f91c52 | ||
|
|
2624af9c24 | ||
|
|
b0485d0187 | ||
|
|
a2724b3e1c |
5
.changes/add-dylib-support-to-macos-frameworks.md
Normal file
5
.changes/add-dylib-support-to-macos-frameworks.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": patch
|
||||
---
|
||||
|
||||
Add dylib support to `tauri.bundle.macOS.frameworks`.
|
||||
5
.changes/additional-args-api.md
Normal file
5
.changes/additional-args-api.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"api": minor
|
||||
---
|
||||
|
||||
Added the `additionalBrowserArgs` option when creating a window.
|
||||
5
.changes/additional-args-config.md
Normal file
5
.changes/additional-args-config.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-utils": minor
|
||||
---
|
||||
|
||||
Added the `additional_browser_args` option to the window configuration.
|
||||
7
.changes/additional-args.md
Normal file
7
.changes/additional-args.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"tauri": minor
|
||||
"tauri-runtime-wry": minor
|
||||
"tauri-runtime": minor
|
||||
---
|
||||
|
||||
Added the `additional_browser_args` option when creating a window.
|
||||
6
.changes/cli-info.md
Normal file
6
.changes/cli-info.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"cli.rs": "patch"
|
||||
---
|
||||
|
||||
Fix `tauri info` panicking when parsing crates version on a newly created project without a `Cargo.lock` file.
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
"dependencies": ["tauri-codegen", "tauri-utils"],
|
||||
"postversion": [
|
||||
"node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"cargo build --manifest-path ../tauri-config-schema/Cargo.toml"
|
||||
"cargo build --manifest-path ../config-schema/Cargo.toml"
|
||||
],
|
||||
"assets": [
|
||||
{
|
||||
@@ -238,7 +238,7 @@
|
||||
"dependencies": ["cli.rs"],
|
||||
"postversion": [
|
||||
"node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"cargo build --manifest-path ../../../core/tauri-config-schema/Cargo.toml"
|
||||
"cargo build --manifest-path ../../../core/config-schema/Cargo.toml"
|
||||
],
|
||||
"prepublish": [],
|
||||
"publish": [],
|
||||
@@ -250,7 +250,7 @@
|
||||
"dependencies": ["tauri-bundler", "tauri-utils"],
|
||||
"postversion": [
|
||||
"cargo check",
|
||||
"cargo build --manifest-path ../../core/tauri-config-schema/Cargo.toml"
|
||||
"cargo build --manifest-path ../../core/config-schema/Cargo.toml"
|
||||
],
|
||||
"assets": [
|
||||
{
|
||||
|
||||
5
.changes/content-protection-api.md
Normal file
5
.changes/content-protection-api.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"api": "minor"
|
||||
---
|
||||
|
||||
Added the `WindowOptions::contentProtected` option and `WebviewWindow#setContentProtected` to change it at runtime.
|
||||
5
.changes/content-protection-utils.md
Normal file
5
.changes/content-protection-utils.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-utils": "patch"
|
||||
---
|
||||
|
||||
Added the `content_protected` option to the window configuration.
|
||||
7
.changes/content-protection.md
Normal file
7
.changes/content-protection.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"tauri": "minor"
|
||||
"tauri-runtime": "minor"
|
||||
"tauri-runtime-wry": "minor"
|
||||
---
|
||||
|
||||
Added the `content_protected` option when creating a window and `Window::set_content_protected` to change it at runtime.
|
||||
5
.changes/core-navigation-handler.md
Normal file
5
.changes/core-navigation-handler.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": minor
|
||||
---
|
||||
|
||||
Added `Window::on_navigation`.
|
||||
5
.changes/core-sync-windows-metadata.md
Normal file
5
.changes/core-sync-windows-metadata.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": "patch"
|
||||
---
|
||||
|
||||
Sync `__TAURI_METADATA__.__windows` across all windows.
|
||||
5
.changes/custom-buttons-api.md
Normal file
5
.changes/custom-buttons-api.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"api": minor
|
||||
---
|
||||
|
||||
Allow setting the text of the dialog buttons.
|
||||
5
.changes/custom-buttons.md
Normal file
5
.changes/custom-buttons.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": minor
|
||||
---
|
||||
|
||||
Added `OkWithLabel` and `OkCancelWithLabels` variants to the `api::dialog::MessageDialogButtons` enum to set the text of the dialog buttons.
|
||||
6
.changes/custom-icon.md
Normal file
6
.changes/custom-icon.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"cli.rs": minor
|
||||
"cli.js": minor
|
||||
---
|
||||
|
||||
Add `--png` option for the `icon` command to generate custom icon sizes.
|
||||
7
.changes/expose-set_device_event_filter-in-tauri-api.md
Normal file
7
.changes/expose-set_device_event_filter-in-tauri-api.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"tauri-runtime-wry": minor
|
||||
"tauri-runtime": minor
|
||||
"tauri": minor
|
||||
---
|
||||
|
||||
Added `Builder::device_event_filter` and `App::set_device_event_filter` methods.
|
||||
5
.changes/fix-2549.md
Normal file
5
.changes/fix-2549.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": "patch"
|
||||
---
|
||||
|
||||
Fix resize glitch when double clicking a custom titlebar in the top resize area.
|
||||
5
.changes/glob-match-require_literal_separator.md
Normal file
5
.changes/glob-match-require_literal_separator.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": "patch"
|
||||
---
|
||||
|
||||
Fix the filesystem scope allowing sub-directories of the directory picked by the dialog when `recursive` option was `false`.
|
||||
5
.changes/heck-unicode.md
Normal file
5
.changes/heck-unicode.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"cli.rs": "patch"
|
||||
---
|
||||
|
||||
Fix building apps with unicode characters in their `productName`.
|
||||
8
.changes/is-minimized.md
Normal file
8
.changes/is-minimized.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"tauri": minor
|
||||
"tauri-runtime": minor
|
||||
"tauri-runtime-wry": minor
|
||||
"api": minor
|
||||
---
|
||||
|
||||
Add `is_minimized()` window method.
|
||||
8
.changes/nsis.md
Normal file
8
.changes/nsis.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"tauri-bundler": minor
|
||||
"tauri-utils": minor
|
||||
"cli.rs": minor
|
||||
"cli.js": minor
|
||||
---
|
||||
|
||||
Add `nsis` bundle target
|
||||
5
.changes/open-links-mail-tel.md
Normal file
5
.changes/open-links-mail-tel.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": minor
|
||||
---
|
||||
|
||||
Added support to `mailto:` and `tel:` links on the shell API.
|
||||
5
.changes/runtime-navigation-handler.md
Normal file
5
.changes/runtime-navigation-handler.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-runtime": minor
|
||||
---
|
||||
|
||||
Added `navigation_handler` field on `PendingWindow`.
|
||||
5
.changes/tauri-build-windows-manifest.md
Normal file
5
.changes/tauri-build-windows-manifest.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-build": "minor"
|
||||
---
|
||||
|
||||
Add `WindowsAttributes::app_manifest` to specify the application manifest on Windows.
|
||||
8
.changes/title-getter.md
Normal file
8
.changes/title-getter.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"tauri": "minor"
|
||||
"api": "minor"
|
||||
"tauri-runtime": "minor"
|
||||
"tauri-runtime-wry": "minor"
|
||||
---
|
||||
|
||||
Add `title` getter on window.
|
||||
6
.changes/tray-tooltip-runtime.md
Normal file
6
.changes/tray-tooltip-runtime.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri-runtime": minor
|
||||
"tauri-runtime-wry": minor
|
||||
---
|
||||
|
||||
Added `TrayHandle::set_tooltip` and `SystemTray::with_tooltip`.
|
||||
5
.changes/tray-tooltip.md
Normal file
5
.changes/tray-tooltip.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Implement `SystemTray::with_tooltip` and `SystemTrayHandle::set_tooltip` for Windows and macOS.
|
||||
7
.changes/url-getter.md
Normal file
7
.changes/url-getter.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"tauri-runtime": minor
|
||||
"tauri-runtime-wry": minor
|
||||
"tauri": minor
|
||||
---
|
||||
|
||||
Added window's `url()` getter.
|
||||
5
.changes/version-inheritance.md
Normal file
5
.changes/version-inheritance.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'cli.rs': 'minor'
|
||||
---
|
||||
|
||||
Add support for Cargo's workspace inheritance for the package version.
|
||||
7
.changes/webview-theme.md
Normal file
7
.changes/webview-theme.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"tauri": "patch"
|
||||
"tauri-runtime": "patch"
|
||||
"tauri-runtime-wry": "patch"
|
||||
---
|
||||
|
||||
On Windows, change webview theme based on Window theme for more accurate `prefers-color-scheme` support.
|
||||
6
.changes/wix-launch-app-checked.md
Normal file
6
.changes/wix-launch-app-checked.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri-bundler": "patch"
|
||||
---
|
||||
|
||||
On Windows, the `msi` installer's `Launch App` checkbox will be checked by default.
|
||||
|
||||
5
.changes/wry-navigation-handler.md
Normal file
5
.changes/wry-navigation-handler.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-runtime-wry": minor
|
||||
---
|
||||
|
||||
Implement the webview navigation handler.
|
||||
6
.github/FUNDING.yml
vendored
6
.github/FUNDING.yml
vendored
@@ -1,10 +1,6 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: tauri-apps
|
||||
github: nothingismagick
|
||||
patreon: #
|
||||
open_collective: tauri
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
|
||||
16
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
16
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,7 +1,3 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: 🐞 Bug Report
|
||||
title: '[bug] '
|
||||
description: Report a bug
|
||||
@@ -30,10 +26,11 @@ body:
|
||||
id: reproduction
|
||||
attributes:
|
||||
label: Reproduction
|
||||
description: A link to a reproduction repo or steps to reproduce the behaviour.
|
||||
description: Steps to reproduce the behavior.
|
||||
placeholder: |
|
||||
Please provide a minimal reproduction or steps to reproduce, see this guide https://stackoverflow.com/help/minimal-reproducible-example
|
||||
Why reproduction is required? see this article https://antfu.me/posts/why-reproductions-are-required
|
||||
1. Go to ...
|
||||
2. Click on ...
|
||||
3. See error
|
||||
|
||||
- type: textarea
|
||||
id: expected-behavior
|
||||
@@ -46,7 +43,6 @@ body:
|
||||
attributes:
|
||||
label: Platform and versions
|
||||
description: "Output of `npm run tauri info` or `cargo tauri info`"
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -54,8 +50,8 @@ body:
|
||||
id: logs
|
||||
attributes:
|
||||
label: Stack trace
|
||||
render: text
|
||||
|
||||
render: shell
|
||||
|
||||
- type: textarea
|
||||
id: context
|
||||
attributes:
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,7 +1,3 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
contact_links:
|
||||
- name: 💬 Discord Chat
|
||||
url: https://discord.com/invite/tauri
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,7 +1,3 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: 💡 Feature Request
|
||||
title: '[feat] '
|
||||
description: Suggest an idea
|
||||
|
||||
3
.github/config.yml
vendored
3
.github/config.yml
vendored
@@ -1,3 +0,0 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
2
.github/workflows/artifacts-updater.yml
vendored
2
.github/workflows/artifacts-updater.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
2
.github/workflows/audit.yml
vendored
2
.github/workflows/audit.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
6
.github/workflows/bench.yml
vendored
6
.github/workflows/bench.yml
vendored
@@ -1,7 +1,3 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: benches
|
||||
|
||||
on:
|
||||
@@ -27,7 +23,7 @@ jobs:
|
||||
matrix:
|
||||
rust: [nightly]
|
||||
platform:
|
||||
- { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
|
||||
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
|
||||
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
|
||||
|
||||
2
.github/workflows/change-status-on-PR.yml
vendored
2
.github/workflows/change-status-on-PR.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
35
.github/workflows/check-generated-files.yml
vendored
35
.github/workflows/check-generated-files.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -12,17 +12,15 @@ on:
|
||||
- 'core/tauri/scripts/bundle.global.js'
|
||||
- 'core/tauri-utils/src/config.rs'
|
||||
- 'tooling/cli/schema.json'
|
||||
- 'core/tauri-config-schema/schema.json'
|
||||
- 'core/config-schema/schema.json'
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
paths:
|
||||
- '.github/workflows/check-generated-files.yml'
|
||||
- 'tooling/api/src/**'
|
||||
- 'core/tauri/scripts/bundle.global.js'
|
||||
- 'core/tauri-utils/src/config.rs'
|
||||
- 'tooling/cli/schema.json'
|
||||
- 'core/tauri-config-schema/schema.json'
|
||||
- 'core/config-schema/schema.json'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -32,44 +30,41 @@ jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
api: ${{ steps.filter.outputs.api }}
|
||||
bundle: ${{ steps.filter.outputs.bundle }}
|
||||
schema: ${{ steps.filter.outputs.schema }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
api:
|
||||
bundle:
|
||||
- 'tooling/api/src/**'
|
||||
- 'tooling/api/docs/js-api.json'
|
||||
- 'core/tauri/scripts/bundle.global.js'
|
||||
schema:
|
||||
- 'core/tauri-utils/src/config.rs'
|
||||
- 'tooling/cli/schema.json'
|
||||
- 'core/tauri-config-schema/schema.json'
|
||||
- 'core/config-schema/schema.json'
|
||||
|
||||
check-api:
|
||||
check-bundle:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.api == 'true'
|
||||
if: needs.changes.outputs.bundle == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: build api
|
||||
- name: generate bundle
|
||||
working-directory: tooling/api
|
||||
run: yarn && yarn build
|
||||
- name: check api
|
||||
run: |
|
||||
git restore tooling/api/docs/js-api.json
|
||||
./.scripts/ci/has-diff.sh
|
||||
- name: check bundle
|
||||
run: ./.scripts/ci/has-diff.sh
|
||||
|
||||
check-schema:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.schema == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
@@ -90,7 +85,7 @@ jobs:
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./core/tauri-config-schema/Cargo.toml
|
||||
args: --manifest-path ./core/config-schema/Cargo.toml
|
||||
|
||||
- name: check schema
|
||||
run: ./.scripts/ci/has-diff.sh
|
||||
|
||||
28
.github/workflows/check-license-header.yml
vendored
28
.github/workflows/check-license-header.yml
vendored
@@ -1,28 +0,0 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Check generated files
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
list-files: shell
|
||||
filters: |
|
||||
added:
|
||||
- added: '**'
|
||||
- name: check header license on new files
|
||||
if: ${{ steps.filter.outputs.added == 'true' }}
|
||||
run: node check-license-header.js ${{ steps.filter.outputs.added_files }}
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
@@ -1,7 +1,3 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: docker
|
||||
|
||||
on:
|
||||
|
||||
2
.github/workflows/lint-fmt-cli.yml
vendored
2
.github/workflows/lint-fmt-cli.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
2
.github/workflows/lint-fmt-core.yml
vendored
2
.github/workflows/lint-fmt-core.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
2
.github/workflows/lint-js.yml
vendored
2
.github/workflows/lint-js.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
38
.github/workflows/publish-cli-js.yml
vendored
38
.github/workflows/publish-cli-js.yml
vendored
@@ -1,7 +1,3 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: publish cli.js
|
||||
env:
|
||||
DEBUG: napi:*
|
||||
@@ -30,64 +26,64 @@ jobs:
|
||||
target: x86_64-apple-darwin
|
||||
architecture: x64
|
||||
build: |
|
||||
yarn build:release --features rustls
|
||||
yarn build:release
|
||||
strip -x *.node
|
||||
- host: windows-latest
|
||||
build: yarn build:release --features rustls
|
||||
build: yarn build:release
|
||||
target: x86_64-pc-windows-msvc
|
||||
architecture: x64
|
||||
- host: windows-latest
|
||||
build: yarn build:release --features rustls --target i686-pc-windows-msvc
|
||||
build: yarn build:release --target i686-pc-windows-msvc
|
||||
target: i686-pc-windows-msvc
|
||||
architecture: x64
|
||||
- host: ubuntu-20.04
|
||||
- host: ubuntu-18.04
|
||||
target: x86_64-unknown-linux-gnu
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
|
||||
build: |
|
||||
cd tooling/cli/node
|
||||
yarn build:release --features rustls --target x86_64-unknown-linux-gnu
|
||||
yarn build:release --target x86_64-unknown-linux-gnu
|
||||
strip *.node
|
||||
- host: ubuntu-20.04
|
||||
- host: ubuntu-18.04
|
||||
target: x86_64-unknown-linux-musl
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
||||
build: |
|
||||
cd tooling/cli/node
|
||||
yarn build:release --features rustls
|
||||
yarn build:release
|
||||
strip *.node
|
||||
- host: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
build: |
|
||||
yarn build:release --features rustls --target=aarch64-apple-darwin
|
||||
yarn build:release --target=aarch64-apple-darwin
|
||||
strip -x *.node
|
||||
- host: ubuntu-20.04
|
||||
- host: ubuntu-18.04
|
||||
target: aarch64-unknown-linux-gnu
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
|
||||
build: |
|
||||
cd tooling/cli/node
|
||||
yarn build:release --features rustls --target aarch64-unknown-linux-gnu
|
||||
yarn build:release --target aarch64-unknown-linux-gnu
|
||||
aarch64-unknown-linux-gnu-strip *.node
|
||||
- host: ubuntu-20.04
|
||||
- host: ubuntu-18.04
|
||||
architecture: x64
|
||||
target: armv7-unknown-linux-gnueabihf
|
||||
setup: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
|
||||
build: |
|
||||
yarn build:release --features rustls --target=armv7-unknown-linux-gnueabihf
|
||||
yarn build:release --target=armv7-unknown-linux-gnueabihf
|
||||
arm-linux-gnueabihf-strip *.node
|
||||
- host: ubuntu-20.04
|
||||
- host: ubuntu-18.04
|
||||
architecture: x64
|
||||
target: aarch64-unknown-linux-musl
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
||||
build: |
|
||||
cd tooling/cli/node
|
||||
rustup target add aarch64-unknown-linux-musl
|
||||
yarn build:release --features rustls --target aarch64-unknown-linux-musl
|
||||
yarn build:release --target aarch64-unknown-linux-musl
|
||||
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
|
||||
#- host: windows-latest
|
||||
# architecture: x64
|
||||
# target: aarch64-pc-windows-msvc
|
||||
# build: yarn build:release --features rustls --target aarch64-pc-windows-msvc
|
||||
# build: yarn build:release --target aarch64-pc-windows-msvc
|
||||
name: stable - ${{ matrix.settings.target }} - node@16
|
||||
runs-on: ${{ matrix.settings.host }}
|
||||
steps:
|
||||
@@ -179,7 +175,7 @@ jobs:
|
||||
# freebsd-version
|
||||
# cd ./tooling/cli/node/
|
||||
# yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
||||
# yarn build:release --features rustls
|
||||
# yarn build:release
|
||||
# strip -x *.node
|
||||
# rm -rf node_modules
|
||||
# rm -rf ../target
|
||||
@@ -299,7 +295,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apk add openssl-dev musl-dev glib-dev cairo-dev pkgconfig gdk-pixbuf-dev webkit2gtk-dev curl gtk+3.0-dev
|
||||
apk add openssl-dev musl-dev glib-dev cairo-dev pkgconfig gdk-pixbuf-dev webkit2gtk-dev curl libappindicator-dev gtk+3.0-dev
|
||||
- name: Setup and run tests
|
||||
run: |
|
||||
yarn tauri --help
|
||||
|
||||
49
.github/workflows/publish-cli-rs.yml
vendored
49
.github/workflows/publish-cli-rs.yml
vendored
@@ -1,7 +1,3 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: publish cli.rs
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
||||
@@ -12,45 +8,40 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
runs-on: ${{ matrix.target.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- os: ubuntu-20.04
|
||||
rust_target: x86_64-unknown-linux-gnu
|
||||
ext: ''
|
||||
- os: macos-latest
|
||||
rust_target: x86_64-apple-darwin
|
||||
ext: ''
|
||||
- os: macos-latest
|
||||
rust_target: aarch64-apple-darwin
|
||||
ext: ''
|
||||
- os: windows-latest
|
||||
rust_target: x86_64-pc-windows-msvc
|
||||
ext: '.exe'
|
||||
target:
|
||||
- {
|
||||
name: 'x86_64-unknown-linux-gnu',
|
||||
platform: 'ubuntu-18.04',
|
||||
ext: ''
|
||||
}
|
||||
- { name: 'x86_64-apple-darwin', platform: 'macos-latest', ext: '' }
|
||||
- {
|
||||
name: 'x86_64-pc-windows-msvc',
|
||||
platform: 'windows-latest',
|
||||
ext: '.exe'
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 'Setup Rust'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
targets: ${{ matrix.config.rust_target }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.config.rust_target }}
|
||||
toolchain: stable
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.config.os == 'ubuntu-latest'
|
||||
if: matrix.target.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: Build CLI
|
||||
- name: build CLI
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
@@ -59,8 +50,8 @@ jobs:
|
||||
- name: Upload CLI
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
|
||||
path: tooling/cli/target/release/cargo-tauri${{ matrix.config.ext }}
|
||||
name: cargo-tauri-${{ matrix.target.name }}${{ matrix.target.ext }}
|
||||
path: tooling/cli/target/release/cargo-tauri${{ matrix.target.ext }}
|
||||
if-no-files-found: error
|
||||
|
||||
upload:
|
||||
|
||||
2
.github/workflows/test-bundler.yml
vendored
2
.github/workflows/test-bundler.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
2
.github/workflows/test-cli-js.yml
vendored
2
.github/workflows/test-cli-js.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
2
.github/workflows/test-cli-rs.yml
vendored
2
.github/workflows/test-cli-rs.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
6
.github/workflows/test-core.yml
vendored
6
.github/workflows/test-core.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -39,12 +39,12 @@ jobs:
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
toolchain: '1.60.0'
|
||||
toolchain: '1.59.0'
|
||||
}
|
||||
- {
|
||||
target: x86_64-apple-darwin,
|
||||
os: macos-latest,
|
||||
toolchain: '1.60.0'
|
||||
toolchain: '1.59.0'
|
||||
}
|
||||
features:
|
||||
- {
|
||||
|
||||
2
.github/workflows/udeps.yml
vendored
2
.github/workflows/udeps.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -9,5 +9,4 @@ dist
|
||||
/tooling/cli/templates
|
||||
/tooling/cli/node
|
||||
/tooling/cli/schema.json
|
||||
/tooling/api/docs/js-api.json
|
||||
/core/tauri-config-schema/schema.json
|
||||
/core/config-schema/schema.json
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
module.exports = {
|
||||
singleQuote: true,
|
||||
semi: false,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -19,10 +19,10 @@ let url = null
|
||||
switch (kind) {
|
||||
case 'cargo':
|
||||
url = `https://crates.io/api/v1/crates/${packageName}`
|
||||
break
|
||||
break;
|
||||
case 'npm':
|
||||
url = `https://registry.npmjs.org/${packageName}`
|
||||
break
|
||||
break;
|
||||
default:
|
||||
throw new Error('unexpected kind ' + kind)
|
||||
}
|
||||
@@ -30,7 +30,7 @@ switch (kind) {
|
||||
const options = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'User-Agent': 'tauri (https://github.com/tauri-apps/tauri)'
|
||||
}
|
||||
}
|
||||
@@ -44,12 +44,10 @@ https.get(url, options, (response) => {
|
||||
response.on('end', function () {
|
||||
const data = JSON.parse(chunks.join(''))
|
||||
if (kind === 'cargo') {
|
||||
const versions = data.versions.filter((v) => v.num.startsWith(target))
|
||||
const versions = data.versions.filter(v => v.num.startsWith(target))
|
||||
console.log(versions.length ? versions[0].num : '0.0.0')
|
||||
} else if (kind === 'npm') {
|
||||
const versions = Object.keys(data.versions).filter((v) =>
|
||||
v.startsWith(target)
|
||||
)
|
||||
const versions = Object.keys(data.versions).filter(v => v.startsWith(target))
|
||||
console.log(versions[versions.length - 1] || '0.0.0')
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
REM Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
REM SPDX-License-Identifier: Apache-2.0
|
||||
REM SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ members = [
|
||||
"core/tauri-utils",
|
||||
"core/tauri-build",
|
||||
"core/tauri-codegen",
|
||||
"core/tauri-config-schema",
|
||||
"core/config-schema",
|
||||
|
||||
# integration tests
|
||||
"core/tests/restart",
|
||||
"core/tests/app-updater",
|
||||
"core/tests/app-updater"
|
||||
]
|
||||
|
||||
exclude = [
|
||||
@@ -22,7 +22,7 @@ exclude = [
|
||||
"examples/resources/src-tauri",
|
||||
"examples/sidecar/src-tauri",
|
||||
"examples/web/core",
|
||||
"examples/workspace",
|
||||
"examples/workspace"
|
||||
]
|
||||
|
||||
# default to small, optimized workspace release binaries
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const readline = require('readline')
|
||||
|
||||
const header = `Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
SPDX-License-Identifier: MIT`
|
||||
const bundlerLicense = '// Copyright 2016-2019 Cargo-Bundle developers <https://github.com/burtonageo/cargo-bundle>'
|
||||
|
||||
const extensions = ['.rs', '.js', '.ts', '.yml']
|
||||
const ignore = ['target', 'templates', 'node_modules', 'gen', 'dist', 'bundle.js', 'bundle.global.js']
|
||||
|
||||
async function checkFile(file) {
|
||||
if (extensions.some(e => file.endsWith(e))) {
|
||||
const fileStream = fs.createReadStream(file)
|
||||
const rl = readline.createInterface({
|
||||
input: fileStream,
|
||||
crlfDelay: Infinity
|
||||
})
|
||||
|
||||
let contents = ``
|
||||
let i = 0
|
||||
for await (let line of rl) {
|
||||
// ignore empty lines, allow shebang and bundler license
|
||||
if (line.length === 0 || line.startsWith("#!") || line === bundlerLicense) {
|
||||
continue
|
||||
}
|
||||
|
||||
// strip comment marker
|
||||
if (line.startsWith('// ')) {
|
||||
line = line.substring(3)
|
||||
} else if (line.startsWith('# ')) {
|
||||
line = line.substring(2)
|
||||
}
|
||||
|
||||
contents += line
|
||||
if (++i === 3) {
|
||||
break
|
||||
}
|
||||
contents += '\n'
|
||||
}
|
||||
if (contents !== header) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
async function check(src) {
|
||||
const missingHeader = []
|
||||
|
||||
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
||||
const p = path.join(src, entry.name)
|
||||
|
||||
if (entry.isSymbolicLink() || ignore.includes(entry.name)) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
const missing = await check(p)
|
||||
missingHeader.push(...missing)
|
||||
} else {
|
||||
const isMissing = await checkFile(p)
|
||||
if (isMissing) {
|
||||
missingHeader.push(p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return missingHeader
|
||||
}
|
||||
|
||||
const [_bin, _script, ...files] = process.argv
|
||||
|
||||
if (files.length > 0) {
|
||||
async function run() {
|
||||
const missing = []
|
||||
for (const f of files) {
|
||||
const isMissing = await checkFile(f)
|
||||
if (isMissing) {
|
||||
missing.push(f)
|
||||
}
|
||||
}
|
||||
if (missing.length > 0) {
|
||||
console.log(missing.join('\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
run()
|
||||
} else {
|
||||
check('.').then(missing => {
|
||||
if (missing.length > 0) {
|
||||
console.log(missing.join('\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
}
|
||||
13
core/config-schema/Cargo.toml
Normal file
13
core/config-schema/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "config-schema"
|
||||
version = "0.0.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[build-dependencies]
|
||||
tauri-utils = { version = "1.0.0", features = [ "schema" ], path = "../tauri-utils" }
|
||||
schemars = { version = "0.8", features = [ "url", "preserve_order" ] }
|
||||
serde = { version = "1.0", features = [ "derive" ] }
|
||||
serde_json = "1.0"
|
||||
serde_with = "1.12"
|
||||
url = { version = "2.3", features = [ "serde" ] }
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -163,7 +163,6 @@
|
||||
},
|
||||
"security": {
|
||||
"dangerousDisableAssetCspModification": false,
|
||||
"dangerousRemoteDomainIpcAccess": [],
|
||||
"freezePrototype": false
|
||||
},
|
||||
"updater": {
|
||||
@@ -209,7 +208,7 @@
|
||||
"additionalProperties": false,
|
||||
"definitions": {
|
||||
"PackageConfig": {
|
||||
"description": "The package configuration.\n\nSee more: https://tauri.app/v1/api/config#packageconfig",
|
||||
"description": "The package configuration.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"productName": {
|
||||
@@ -232,7 +231,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"TauriConfig": {
|
||||
"description": "The Tauri configuration object.\n\nSee more: https://tauri.app/v1/api/config#tauriconfig",
|
||||
"description": "The Tauri configuration object.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pattern": {
|
||||
@@ -416,7 +415,6 @@
|
||||
"description": "Security configuration.",
|
||||
"default": {
|
||||
"dangerousDisableAssetCspModification": false,
|
||||
"dangerousRemoteDomainIpcAccess": [],
|
||||
"freezePrototype": false
|
||||
},
|
||||
"allOf": [
|
||||
@@ -510,7 +508,7 @@
|
||||
]
|
||||
},
|
||||
"WindowConfig": {
|
||||
"description": "The window configuration object.\n\nSee more: https://tauri.app/v1/api/config#windowconfig",
|
||||
"description": "The window configuration object.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"label": {
|
||||
@@ -766,7 +764,7 @@
|
||||
]
|
||||
},
|
||||
"CliConfig": {
|
||||
"description": "describes a CLI configuration\n\nSee more: https://tauri.app/v1/api/config#cliconfig",
|
||||
"description": "describes a CLI configuration",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"description": {
|
||||
@@ -1012,7 +1010,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"BundleConfig": {
|
||||
"description": "Configuration for tauri-bundler.\n\nSee more: https://tauri.app/v1/api/config#bundleconfig",
|
||||
"description": "Configuration for tauri-bundler.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"identifier"
|
||||
@@ -1238,7 +1236,7 @@
|
||||
]
|
||||
},
|
||||
"AppImageConfig": {
|
||||
"description": "Configuration for AppImage bundles.\n\nSee more: https://tauri.app/v1/api/config#appimageconfig",
|
||||
"description": "Configuration for AppImage bundles.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bundleMediaFramework": {
|
||||
@@ -1250,7 +1248,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"DebConfig": {
|
||||
"description": "Configuration for Debian (.deb) bundles.\n\nSee more: https://tauri.app/v1/api/config#debconfig",
|
||||
"description": "Configuration for Debian (.deb) bundles.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"depends": {
|
||||
@@ -1275,7 +1273,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"MacConfig": {
|
||||
"description": "Configuration for the macOS bundles.\n\nSee more: https://tauri.app/v1/api/config#macconfig",
|
||||
"description": "Configuration for the macOS bundles.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"frameworks": {
|
||||
@@ -1335,7 +1333,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"WindowsConfig": {
|
||||
"description": "Windows bundler configuration.\n\nSee more: https://tauri.app/v1/api/config#windowsconfig",
|
||||
"description": "Windows bundler configuration.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"digestAlgorithm": {
|
||||
@@ -1433,7 +1431,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"description": "Download the bootstrapper and run it. Requires an internet connection. Results in a smaller installer size, but is not recommended on Windows 7.",
|
||||
"description": "Download the bootstrapper and run it. Requires internet connection. Results in a smaller installer size, but is not recommended on Windows 7.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type"
|
||||
@@ -1454,7 +1452,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"description": "Embed the bootstrapper and run it. Requires an internet connection. Increases the installer size by around 1.8MB, but offers better support on Windows 7.",
|
||||
"description": "Embed the bootstrapper and run it. Requires internet connection. Increases the installer size by around 1.8MB, but offers better support on Windows 7.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type"
|
||||
@@ -1475,7 +1473,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"description": "Embed the offline installer and run it. Does not require an internet connection. Increases the installer size by around 127MB.",
|
||||
"description": "Embed the offline installer and run it. Does not require internet connection. Increases the installer size by around 127MB.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type"
|
||||
@@ -1519,7 +1517,7 @@
|
||||
]
|
||||
},
|
||||
"WixConfig": {
|
||||
"description": "Configuration for the MSI bundle using WiX.\n\nSee more: https://tauri.app/v1/api/config#wixconfig",
|
||||
"description": "Configuration for the MSI bundle using WiX.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"language": {
|
||||
@@ -1644,7 +1642,7 @@
|
||||
]
|
||||
},
|
||||
"WixLanguageConfig": {
|
||||
"description": "Configuration for a target language for the WiX build.\n\nSee more: https://tauri.app/v1/api/config#wixlanguageconfig",
|
||||
"description": "Configuration for a target language for the WiX build.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"localePath": {
|
||||
@@ -1697,21 +1695,6 @@
|
||||
"$ref": "#/definitions/NSISInstallerMode"
|
||||
}
|
||||
]
|
||||
},
|
||||
"languages": {
|
||||
"description": "A list of installer languages. By default the OS language is used. If the OS language is not in the list of languages, the first language will be used. To allow the user to select the language, set `display_language_selector` to `true`.\n\nSee <https://github.com/kichik/nsis/tree/9465c08046f00ccb6eda985abbdbf52c275c6c4d/Contrib/Language%20files> for the complete list of languages.",
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"displayLanguageSelector": {
|
||||
"description": "Whether to display a language selector dialog before the installer and uninstaller windows are rendered or not. By default the OS language is selected, with a fallback to the first language in the `languages` array.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
@@ -1958,7 +1941,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"FsAllowlistConfig": {
|
||||
"description": "Allowlist for the file system APIs.\n\nSee more: https://tauri.app/v1/api/config#fsallowlistconfig",
|
||||
"description": "Allowlist for the file system APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"scope": {
|
||||
@@ -2058,7 +2041,7 @@
|
||||
]
|
||||
},
|
||||
"WindowAllowlistConfig": {
|
||||
"description": "Allowlist for the window APIs.\n\nSee more: https://tauri.app/v1/api/config#windowallowlistconfig",
|
||||
"description": "Allowlist for the window APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
@@ -2220,7 +2203,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ShellAllowlistConfig": {
|
||||
"description": "Allowlist for the shell APIs.\n\nSee more: https://tauri.app/v1/api/config#shellallowlistconfig",
|
||||
"description": "Allowlist for the shell APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"scope": {
|
||||
@@ -2351,7 +2334,7 @@
|
||||
]
|
||||
},
|
||||
"DialogAllowlistConfig": {
|
||||
"description": "Allowlist for the dialog APIs.\n\nSee more: https://tauri.app/v1/api/config#dialogallowlistconfig",
|
||||
"description": "Allowlist for the dialog APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
@@ -2388,7 +2371,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"HttpAllowlistConfig": {
|
||||
"description": "Allowlist for the HTTP APIs.\n\nSee more: https://tauri.app/v1/api/config#httpallowlistconfig",
|
||||
"description": "Allowlist for the HTTP APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"scope": {
|
||||
@@ -2422,7 +2405,7 @@
|
||||
}
|
||||
},
|
||||
"NotificationAllowlistConfig": {
|
||||
"description": "Allowlist for the notification APIs.\n\nSee more: https://tauri.app/v1/api/config#notificationallowlistconfig",
|
||||
"description": "Allowlist for the notification APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
@@ -2434,7 +2417,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"GlobalShortcutAllowlistConfig": {
|
||||
"description": "Allowlist for the global shortcut APIs.\n\nSee more: https://tauri.app/v1/api/config#globalshortcutallowlistconfig",
|
||||
"description": "Allowlist for the global shortcut APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
@@ -2446,7 +2429,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"OsAllowlistConfig": {
|
||||
"description": "Allowlist for the OS APIs.\n\nSee more: https://tauri.app/v1/api/config#osallowlistconfig",
|
||||
"description": "Allowlist for the OS APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
@@ -2458,7 +2441,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"PathAllowlistConfig": {
|
||||
"description": "Allowlist for the path APIs.\n\nSee more: https://tauri.app/v1/api/config#pathallowlistconfig",
|
||||
"description": "Allowlist for the path APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
@@ -2470,7 +2453,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ProtocolAllowlistConfig": {
|
||||
"description": "Allowlist for the custom protocols.\n\nSee more: https://tauri.app/v1/api/config#protocolallowlistconfig",
|
||||
"description": "Allowlist for the custom protocols.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"assetScope": {
|
||||
@@ -2496,7 +2479,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ProcessAllowlistConfig": {
|
||||
"description": "Allowlist for the process APIs.\n\nSee more: https://tauri.app/v1/api/config#processallowlistconfig",
|
||||
"description": "Allowlist for the process APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
@@ -2523,7 +2506,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ClipboardAllowlistConfig": {
|
||||
"description": "Allowlist for the clipboard APIs.\n\nSee more: https://tauri.app/v1/api/config#clipboardallowlistconfig",
|
||||
"description": "Allowlist for the clipboard APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
@@ -2545,7 +2528,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"AppAllowlistConfig": {
|
||||
"description": "Allowlist for the app APIs.\n\nSee more: https://tauri.app/v1/api/config#appallowlistconfig",
|
||||
"description": "Allowlist for the app APIs.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
@@ -2567,7 +2550,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"SecurityConfig": {
|
||||
"description": "Security configuration.\n\nSee more: https://tauri.app/v1/api/config#securityconfig",
|
||||
"description": "Security configuration.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"csp": {
|
||||
@@ -2605,14 +2588,6 @@
|
||||
"$ref": "#/definitions/DisabledCspModificationKind"
|
||||
}
|
||||
]
|
||||
},
|
||||
"dangerousRemoteDomainIpcAccess": {
|
||||
"description": "Allow external domains to send command to Tauri.\n\nBy default, external domains do not have access to `window.__TAURI__`, which means they cannot communicate with the commands defined in Rust. This prevents attacks where an externally loaded malicious or compromised sites could start executing commands on the user's device.\n\nThis configuration allows a set of external domains to have access to the Tauri commands. When you configure a domain to be allowed to access the IPC, all subpaths are allowed. Subdomains are not allowed.\n\n**WARNING:** Only use this option if you either have internal checks against malicious external sites or you can trust the allowed external sites. You application might be vulnerable to dangerous Tauri command related attacks otherwise.",
|
||||
"default": [],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/RemoteDomainAccessScope"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
@@ -2665,50 +2640,8 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"RemoteDomainAccessScope": {
|
||||
"description": "External command access definition.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"domain",
|
||||
"windows"
|
||||
],
|
||||
"properties": {
|
||||
"scheme": {
|
||||
"description": "The URL scheme to allow. By default, all schemas are allowed.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"domain": {
|
||||
"description": "The domain to allow.",
|
||||
"type": "string"
|
||||
},
|
||||
"windows": {
|
||||
"description": "The list of window labels this scope applies to.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"plugins": {
|
||||
"description": "The list of plugins that are allowed in this scope.",
|
||||
"default": [],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"enableTauriAPI": {
|
||||
"description": "Enables access to the Tauri API.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"UpdaterConfig": {
|
||||
"description": "The Updater configuration object.\n\nSee more: https://tauri.app/v1/api/config#updaterconfig",
|
||||
"description": "The Updater configuration object.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"active": {
|
||||
@@ -2757,7 +2690,7 @@
|
||||
"format": "uri"
|
||||
},
|
||||
"UpdaterWindowsConfig": {
|
||||
"description": "The updater configuration for Windows.\n\nSee more: https://tauri.app/v1/api/config#updaterwindowsconfig",
|
||||
"description": "The updater configuration for Windows.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"installerArgs": {
|
||||
@@ -2807,7 +2740,7 @@
|
||||
]
|
||||
},
|
||||
"SystemTrayConfig": {
|
||||
"description": "Configuration for application system tray icon.\n\nSee more: https://tauri.app/v1/api/config#systemtrayconfig",
|
||||
"description": "Configuration for application system tray icon.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"iconPath"
|
||||
@@ -2838,7 +2771,7 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"BuildConfig": {
|
||||
"description": "The Build configuration object.\n\nSee more: https://tauri.app/v1/api/config#buildconfig",
|
||||
"description": "The Build configuration object.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"runner": {
|
||||
@@ -3001,7 +2934,7 @@
|
||||
]
|
||||
},
|
||||
"PluginConfig": {
|
||||
"description": "The plugin configs holds a HashMap mapping a plugin name to its configuration object.\n\nSee more: https://tauri.app/v1/api/config#pluginconfig",
|
||||
"description": "The plugin configs holds a HashMap mapping a plugin name to its configuration object.",
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
1
core/config-schema/src/main.rs
Normal file
1
core/config-schema/src/main.rs
Normal file
@@ -0,0 +1 @@
|
||||
fn main() {}
|
||||
@@ -1,18 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## \[1.3.0]
|
||||
|
||||
- Bump minimum supported Rust version to 1.60.
|
||||
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
|
||||
- Add initial support for building `nsis` bundles on non-Windows platforms.
|
||||
- [60e6f6c3](https://www.github.com/tauri-apps/tauri/commit/60e6f6c3f1605f3064b5bb177992530ff788ccf0) feat(bundler): Add support for creating NSIS bundles on unix hosts ([#5788](https://www.github.com/tauri-apps/tauri/pull/5788)) on 2023-01-19
|
||||
- Add `WindowsAttributes::app_manifest` to specify the application manifest on Windows.
|
||||
- [bca09f7f](https://www.github.com/tauri-apps/tauri/commit/bca09f7f5ff1c9c5a4b51da043bdd5da668a179b) feat(tauri-build): add option to specify Windows manifest, closes [#5584](https://www.github.com/tauri-apps/tauri/pull/5584) ([#5730](https://www.github.com/tauri-apps/tauri/pull/5730)) on 2022-12-14
|
||||
- Added support for Cargo's workspace inheritance for package information. The cli now also detects inherited `tauri` and `tauri-build` dependencies and disables manifest rewrites accordingly.
|
||||
- [cd8c074a](https://www.github.com/tauri-apps/tauri/commit/cd8c074ae6592303d3f6844a4fb6d262eae913b2) feat(cli): add support for Cargo's workspace inheritance for the package version, closes [#5070](https://www.github.com/tauri-apps/tauri/pull/5070) ([#5775](https://www.github.com/tauri-apps/tauri/pull/5775)) on 2022-12-14
|
||||
- [d20a7288](https://www.github.com/tauri-apps/tauri/commit/d20a728892eee1858ab525ab6216cd721f473ab5) feat: Further improve workspace inheritance, closes [#6122](https://www.github.com/tauri-apps/tauri/pull/6122), [#5070](https://www.github.com/tauri-apps/tauri/pull/5070) ([#6144](https://www.github.com/tauri-apps/tauri/pull/6144)) on 2023-01-26
|
||||
- Pin `winnow` crate to 0.4.1 to keep the 1.60 MSRV.
|
||||
|
||||
## \[1.2.1]
|
||||
|
||||
- Fix `allowlist > app > show/hide` always disabled when `allowlist > app > all: false`.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-build"
|
||||
version = "1.3.0"
|
||||
version = "1.2.1"
|
||||
authors = [ "Tauri Programme within The Commons Conservancy" ]
|
||||
categories = [ "gui", "web-programming" ]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
@@ -8,7 +8,7 @@ homepage = "https://tauri.app"
|
||||
repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build"
|
||||
description = "build time code to pair with https://crates.io/crates/tauri"
|
||||
edition = "2021"
|
||||
rust-version = "1.60"
|
||||
rust-version = "1.59"
|
||||
exclude = [ "CHANGELOG.md", "/target" ]
|
||||
readme = "README.md"
|
||||
|
||||
@@ -19,15 +19,15 @@ rustdoc-args = [ "--cfg", "doc_cfg" ]
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
quote = { version = "1", optional = true }
|
||||
tauri-codegen = { version = "1.3.0", path = "../tauri-codegen", optional = true }
|
||||
tauri-utils = { version = "1.3.0", path = "../tauri-utils", features = [ "build", "resources" ] }
|
||||
cargo_toml = "0.15"
|
||||
winnow = "=0.4.1"
|
||||
serde = "1"
|
||||
tauri-codegen = { version = "1.2.1", path = "../tauri-codegen", optional = true }
|
||||
tauri-utils = { version = "1.2.1", path = "../tauri-utils", features = [ "build", "resources" ] }
|
||||
cargo_toml = "0.14"
|
||||
serde_json = "1"
|
||||
heck = "0.4"
|
||||
json-patch = "1.0"
|
||||
tauri-winres = "0.1"
|
||||
json-patch = "0.3"
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
winres = "0.1"
|
||||
semver = "1"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#![cfg_attr(doc_cfg, feature(doc_cfg))]
|
||||
|
||||
pub use anyhow::Result;
|
||||
use cargo_toml::{Dependency, Manifest};
|
||||
use heck::AsShoutySnakeCase;
|
||||
|
||||
use tauri_utils::{
|
||||
config::Config,
|
||||
resources::{external_binaries, resource_relpath, ResourcePaths},
|
||||
};
|
||||
use tauri_utils::resources::{external_binaries, resource_relpath, ResourcePaths};
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
#[cfg(feature = "codegen")]
|
||||
mod codegen;
|
||||
#[cfg(windows)]
|
||||
mod static_vcruntime;
|
||||
|
||||
#[cfg(feature = "codegen")]
|
||||
@@ -246,6 +243,8 @@ pub fn build() {
|
||||
#[allow(unused_variables)]
|
||||
pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
use anyhow::anyhow;
|
||||
use cargo_toml::{Dependency, Manifest};
|
||||
use tauri_utils::config::{Config, TauriConfig};
|
||||
|
||||
println!("cargo:rerun-if-env-changed=TAURI_CONFIG");
|
||||
println!("cargo:rerun-if-changed=tauri.conf.json");
|
||||
@@ -270,33 +269,50 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
|
||||
cfg_alias("dev", !has_feature("custom-protocol"));
|
||||
|
||||
let ws_path = get_workspace_dir()?;
|
||||
let mut manifest =
|
||||
Manifest::<cargo_toml::Value>::from_slice_with_metadata(&std::fs::read("Cargo.toml")?)?;
|
||||
|
||||
if let Ok(ws_manifest) = Manifest::from_path(ws_path.join("Cargo.toml")) {
|
||||
Manifest::complete_from_path_and_workspace(
|
||||
&mut manifest,
|
||||
Path::new("Cargo.toml"),
|
||||
Some((&ws_manifest, ws_path.as_path())),
|
||||
)?;
|
||||
} else {
|
||||
Manifest::complete_from_path(&mut manifest, Path::new("Cargo.toml"))?;
|
||||
}
|
||||
|
||||
if let Some(tauri_build) = manifest.build_dependencies.remove("tauri-build") {
|
||||
let error_message = check_features(&config, tauri_build, true);
|
||||
|
||||
if !error_message.is_empty() {
|
||||
return Err(anyhow!("
|
||||
The `tauri-build` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.
|
||||
Please run `tauri dev` or `tauri build` or {}.
|
||||
", error_message));
|
||||
}
|
||||
}
|
||||
|
||||
let mut manifest = Manifest::from_path("Cargo.toml")?;
|
||||
if let Some(tauri) = manifest.dependencies.remove("tauri") {
|
||||
let error_message = check_features(&config, tauri, false);
|
||||
let features = match tauri {
|
||||
Dependency::Simple(_) => Vec::new(),
|
||||
Dependency::Detailed(dep) => dep.features,
|
||||
Dependency::Inherited(dep) => dep.features,
|
||||
};
|
||||
|
||||
let all_cli_managed_features = TauriConfig::all_features();
|
||||
let diff = features_diff(
|
||||
&features
|
||||
.into_iter()
|
||||
.filter(|f| all_cli_managed_features.contains(&f.as_str()))
|
||||
.collect::<Vec<String>>(),
|
||||
&config
|
||||
.tauri
|
||||
.features()
|
||||
.into_iter()
|
||||
.map(|f| f.to_string())
|
||||
.collect::<Vec<String>>(),
|
||||
);
|
||||
|
||||
let mut error_message = String::new();
|
||||
if !diff.remove.is_empty() {
|
||||
error_message.push_str("remove the `");
|
||||
error_message.push_str(&diff.remove.join(", "));
|
||||
error_message.push_str(if diff.remove.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str(" and ");
|
||||
}
|
||||
}
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str("add the `");
|
||||
error_message.push_str(&diff.add.join(", "));
|
||||
error_message.push_str(if diff.add.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
}
|
||||
|
||||
if !error_message.is_empty() {
|
||||
return Err(anyhow!("
|
||||
@@ -328,25 +344,25 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
|
||||
#[allow(unused_mut, clippy::redundant_clone)]
|
||||
let mut resources = config.tauri.bundle.resources.clone().unwrap_or_default();
|
||||
if target_triple.contains("windows") {
|
||||
if let Some(fixed_webview2_runtime_path) =
|
||||
&config.tauri.bundle.windows.webview_fixed_runtime_path
|
||||
{
|
||||
resources.push(fixed_webview2_runtime_path.display().to_string());
|
||||
}
|
||||
#[cfg(windows)]
|
||||
if let Some(fixed_webview2_runtime_path) = &config.tauri.bundle.windows.webview_fixed_runtime_path
|
||||
{
|
||||
resources.push(fixed_webview2_runtime_path.display().to_string());
|
||||
}
|
||||
copy_resources(ResourcePaths::new(resources.as_slice(), true), target_dir)?;
|
||||
|
||||
if target_triple.contains("darwin") {
|
||||
if let Some(version) = &config.tauri.bundle.macos.minimum_system_version {
|
||||
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET={version}");
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
if let Some(version) = config.tauri.bundle.macos.minimum_system_version {
|
||||
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET={}", version);
|
||||
}
|
||||
}
|
||||
|
||||
if target_triple.contains("windows") {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use anyhow::Context;
|
||||
use semver::Version;
|
||||
use tauri_winres::{VersionInfo, WindowsResource};
|
||||
use winres::{VersionInfo, WindowsResource};
|
||||
|
||||
fn find_icon<F: Fn(&&String) -> bool>(config: &Config, predicate: F, default: &str) -> PathBuf {
|
||||
let icon_path = config
|
||||
@@ -470,89 +486,6 @@ fn features_diff(current: &[String], expected: &[String]) -> Diff {
|
||||
Diff { remove, add }
|
||||
}
|
||||
|
||||
fn check_features(config: &Config, dependency: Dependency, is_tauri_build: bool) -> String {
|
||||
use tauri_utils::config::{PatternKind, TauriConfig};
|
||||
|
||||
let features = match dependency {
|
||||
Dependency::Simple(_) => Vec::new(),
|
||||
Dependency::Detailed(dep) => dep.features,
|
||||
Dependency::Inherited(dep) => dep.features,
|
||||
};
|
||||
|
||||
let all_cli_managed_features = if is_tauri_build {
|
||||
vec!["isolation"]
|
||||
} else {
|
||||
TauriConfig::all_features()
|
||||
};
|
||||
|
||||
let expected = if is_tauri_build {
|
||||
match config.tauri.pattern {
|
||||
PatternKind::Isolation { .. } => vec!["isolation".to_string()],
|
||||
_ => vec![],
|
||||
}
|
||||
} else {
|
||||
config
|
||||
.tauri
|
||||
.features()
|
||||
.into_iter()
|
||||
.map(|f| f.to_string())
|
||||
.collect::<Vec<String>>()
|
||||
};
|
||||
|
||||
let diff = features_diff(
|
||||
&features
|
||||
.into_iter()
|
||||
.filter(|f| all_cli_managed_features.contains(&f.as_str()))
|
||||
.collect::<Vec<String>>(),
|
||||
&expected,
|
||||
);
|
||||
|
||||
let mut error_message = String::new();
|
||||
if !diff.remove.is_empty() {
|
||||
error_message.push_str("remove the `");
|
||||
error_message.push_str(&diff.remove.join(", "));
|
||||
error_message.push_str(if diff.remove.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str(" and ");
|
||||
}
|
||||
}
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str("add the `");
|
||||
error_message.push_str(&diff.add.join(", "));
|
||||
error_message.push_str(if diff.add.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
}
|
||||
|
||||
error_message
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
struct CargoMetadata {
|
||||
workspace_root: PathBuf,
|
||||
}
|
||||
|
||||
fn get_workspace_dir() -> Result<PathBuf> {
|
||||
let output = std::process::Command::new("cargo")
|
||||
.args(["metadata", "--no-deps", "--format-version", "1"])
|
||||
.output()?;
|
||||
|
||||
if !output.status.success() {
|
||||
return Err(anyhow::anyhow!(
|
||||
"cargo metadata command exited with a non zero exit code: {}",
|
||||
String::from_utf8(output.stderr)?
|
||||
));
|
||||
}
|
||||
|
||||
Ok(serde_json::from_slice::<CargoMetadata>(&output.stdout)?.workspace_root)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Diff;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -48,11 +48,11 @@ fn override_msvcrt_lib() {
|
||||
let f = fs::OpenOptions::new()
|
||||
.write(true)
|
||||
.create_new(true)
|
||||
.open(path);
|
||||
.open(&path);
|
||||
if let Ok(mut f) = f {
|
||||
f.write_all(machine).unwrap();
|
||||
f.write_all(bytes).unwrap();
|
||||
}
|
||||
// Add the output directory to the native library path.
|
||||
println!("cargo:rustc-link-search=native={out_dir}");
|
||||
println!("cargo:rustc-link-search=native={}", out_dir);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## \[1.3.0]
|
||||
|
||||
- Bump minimum supported Rust version to 1.60.
|
||||
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
|
||||
- Pin `time` to `0.3.15`.
|
||||
- [3d16461b](https://www.github.com/tauri-apps/tauri/commit/3d16461b68583ba7db037fbc217786e79b46ddf2) fix(core): pin time to 0.3.15 ([#6312](https://www.github.com/tauri-apps/tauri/pull/6312)) on 2023-02-19
|
||||
|
||||
## \[1.2.1]
|
||||
|
||||
- Fix `allowlist > app > show/hide` always disabled when `allowlist > app > all: false`.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-codegen"
|
||||
version = "1.3.0"
|
||||
version = "1.2.1"
|
||||
authors = [ "Tauri Programme within The Commons Conservancy" ]
|
||||
categories = [ "gui", "web-programming" ]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
@@ -8,31 +8,31 @@ homepage = "https://tauri.app"
|
||||
repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen"
|
||||
description = "code generation meant to be consumed inside of `tauri` through `tauri-build` or `tauri-macros`"
|
||||
edition = "2021"
|
||||
rust-version = "1.60"
|
||||
rust-version = "1.59"
|
||||
exclude = [ "CHANGELOG.md", "/target" ]
|
||||
readme = "README.md"
|
||||
|
||||
[dependencies]
|
||||
sha2 = "0.10"
|
||||
base64 = "0.21"
|
||||
base64 = "0.20"
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
serde = { version = "1", features = [ "derive" ] }
|
||||
serde_json = "1"
|
||||
tauri-utils = { version = "1.3.0", path = "../tauri-utils", features = [ "build" ] }
|
||||
tauri-utils = { version = "1.2.1", path = "../tauri-utils", features = [ "build" ] }
|
||||
thiserror = "1"
|
||||
walkdir = "2"
|
||||
brotli = { version = "3", optional = true, default-features = false, features = [ "std" ] }
|
||||
regex = { version = "1.7.1", optional = true }
|
||||
regex = { version = "1.7.0", optional = true }
|
||||
uuid = { version = "1", features = [ "v4" ] }
|
||||
semver = "1"
|
||||
ico = "0.3"
|
||||
png = "0.17"
|
||||
json-patch = "1.0"
|
||||
json-patch = "0.3"
|
||||
|
||||
[target."cfg(target_os = \"macos\")".dependencies]
|
||||
plist = "1"
|
||||
time = { version = "=0.3.15", features = [ "parsing", "formatting" ] }
|
||||
time = { version = "0.3", features = [ "parsing", "formatting" ] }
|
||||
|
||||
[features]
|
||||
default = [ "compression" ]
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{ffi::OsStr, str::FromStr};
|
||||
|
||||
use base64::Engine;
|
||||
use proc_macro2::TokenStream;
|
||||
use quote::quote;
|
||||
use proc_macro2::{Group, TokenStream, TokenTree};
|
||||
use quote::{quote, TokenStreamExt};
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
use tauri_utils::assets::AssetKey;
|
||||
@@ -58,10 +57,7 @@ fn map_core_assets(
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(&script);
|
||||
let hash = hasher.finalize();
|
||||
scripts.push(format!(
|
||||
"'sha256-{}'",
|
||||
base64::engine::general_purpose::STANDARD.encode(hash)
|
||||
));
|
||||
scripts.push(format!("'sha256-{}'", base64::encode(hash)));
|
||||
}
|
||||
csp_hashes
|
||||
.inline_scripts
|
||||
@@ -78,10 +74,9 @@ fn map_core_assets(
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(tauri_utils::pattern::isolation::IFRAME_STYLE);
|
||||
let hash = hasher.finalize();
|
||||
csp_hashes.styles.push(format!(
|
||||
"'sha256-{}'",
|
||||
base64::engine::general_purpose::STANDARD.encode(hash)
|
||||
));
|
||||
csp_hashes
|
||||
.styles
|
||||
.push(format!("'sha256-{}'", base64::encode(hash)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,7 +352,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
|
||||
let info_plist_path = out_path.display().to_string();
|
||||
quote!({
|
||||
tauri::embed_plist::embed_info_plist!(#info_plist_path);
|
||||
#root::embed_plist::embed_info_plist!(#info_plist_path);
|
||||
})
|
||||
} else {
|
||||
quote!(())
|
||||
@@ -401,7 +396,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
assets: ::std::sync::Arc::new(#assets),
|
||||
schema: #schema.into(),
|
||||
key: #key.into(),
|
||||
crypto_keys: std::boxed::Box::new(::tauri::utils::pattern::isolation::Keys::new().expect("unable to generate cryptographically secure keys for Tauri \"Isolation\" Pattern")),
|
||||
crypto_keys: std::boxed::Box::new(#root::utils::pattern::isolation::Keys::new().expect("unable to generate cryptographically secure keys for Tauri \"Isolation\" Pattern")),
|
||||
})
|
||||
}
|
||||
};
|
||||
@@ -440,7 +435,70 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
#[cfg(not(feature = "shell-scope"))]
|
||||
let shell_scope_config = quote!();
|
||||
|
||||
Ok(quote!(#root::Context::new(
|
||||
fn compare_token_stream(a: TokenStream, b: TokenStream) -> bool {
|
||||
if a.clone().into_iter().count() != b.clone().into_iter().count() {
|
||||
return false;
|
||||
}
|
||||
for (a, b) in a.into_iter().zip(b) {
|
||||
if !compare_token_tree(a, b) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
fn compare_token_tree(a: TokenTree, b: TokenTree) -> bool {
|
||||
match (a, b) {
|
||||
(TokenTree::Group(a), TokenTree::Group(b)) => compare_token_stream(a.stream(), b.stream()),
|
||||
(TokenTree::Ident(a), TokenTree::Ident(b)) => b == a,
|
||||
(TokenTree::Punct(a), TokenTree::Punct(b)) => a.to_string() == b.to_string(),
|
||||
(TokenTree::Literal(a), TokenTree::Literal(b)) => a.to_string() == b.to_string(),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
fn change_tree_tauri_root(
|
||||
token: TokenTree,
|
||||
previous: &Option<TokenTree>,
|
||||
new: &mut TokenStream,
|
||||
) -> bool {
|
||||
match token {
|
||||
TokenTree::Ident(i) if i == "utils" => {
|
||||
new.append_all(quote!(tauri_utils));
|
||||
false
|
||||
}
|
||||
TokenTree::Ident(i) => {
|
||||
let ignore = match previous {
|
||||
Some(TokenTree::Punct(p)) if p.as_char() == ':' => i == "tauri",
|
||||
_ => false,
|
||||
};
|
||||
if !ignore {
|
||||
new.append(i);
|
||||
}
|
||||
ignore
|
||||
}
|
||||
TokenTree::Group(g) => {
|
||||
let mut stream = TokenStream::new();
|
||||
let mut ignore = false;
|
||||
let mut previous_token = None;
|
||||
for token in g.stream() {
|
||||
if ignore && matches!(token, TokenTree::Punct(_)) {
|
||||
continue;
|
||||
}
|
||||
ignore = change_tree_tauri_root(token.clone(), &previous_token, &mut stream);
|
||||
previous_token.replace(token);
|
||||
}
|
||||
new.append(Group::new(g.delimiter(), stream));
|
||||
false
|
||||
}
|
||||
_ => {
|
||||
new.append(token);
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let context = quote!(#root::Context::new(
|
||||
#config,
|
||||
::std::sync::Arc::new(#assets),
|
||||
#default_window_icon,
|
||||
@@ -450,7 +508,23 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
#info_plist,
|
||||
#pattern,
|
||||
#shell_scope_config
|
||||
)))
|
||||
));
|
||||
|
||||
if compare_token_stream(root, quote!(crate)) {
|
||||
let mut stream = TokenStream::new();
|
||||
let mut ignore = false;
|
||||
let mut previous_token = None;
|
||||
for token in context {
|
||||
if ignore && matches!(token, TokenTree::Punct(_)) {
|
||||
continue;
|
||||
}
|
||||
ignore = change_tree_tauri_root(token.clone(), &previous_token, &mut stream);
|
||||
previous_token.replace(token);
|
||||
}
|
||||
Ok(stream)
|
||||
} else {
|
||||
Ok(context)
|
||||
}
|
||||
}
|
||||
|
||||
fn ico_icon<P: AsRef<Path>>(
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use base64::Engine;
|
||||
use proc_macro2::TokenStream;
|
||||
use quote::{quote, ToTokens, TokenStreamExt};
|
||||
use sha2::{Digest, Sha256};
|
||||
@@ -182,10 +181,9 @@ impl CspHashes {
|
||||
})?,
|
||||
);
|
||||
let hash = hasher.finalize();
|
||||
self.scripts.push(format!(
|
||||
"'sha256-{}'",
|
||||
base64::engine::general_purpose::STANDARD.encode(hash)
|
||||
));
|
||||
self
|
||||
.scripts
|
||||
.push(format!("'sha256-{}'", base64::encode(hash)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +431,6 @@ impl ToTokens for EmbeddedAssets {
|
||||
|
||||
// we expect phf related items to be in path when generating the path code
|
||||
tokens.append_all(quote! {{
|
||||
#[allow(unused)]
|
||||
use ::tauri::utils::assets::{CspHash, EmbeddedAssets, phf, phf::phf_map};
|
||||
EmbeddedAssets::new(phf_map! { #assets }, &[#global_hashes], phf_map! { #html_hashes })
|
||||
}});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
2
core/tauri-codegen/src/vendor/mod.rs
vendored
2
core/tauri-codegen/src/vendor/mod.rs
vendored
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
[package]
|
||||
name = "tauri-tauri-config-schema"
|
||||
version = "0.0.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[build-dependencies]
|
||||
tauri-utils = { version = "1.0.0", features = [
|
||||
"schema",
|
||||
], path = "../tauri-utils" }
|
||||
schemars = { version = "0.8", features = ["url", "preserve_order"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
serde_with = "1.12"
|
||||
url = { version = "2.3", features = ["serde"] }
|
||||
@@ -1,5 +0,0 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
fn main() {}
|
||||
@@ -1,10 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## \[1.3.0]
|
||||
|
||||
- Bump minimum supported Rust version to 1.60.
|
||||
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
|
||||
|
||||
## \[1.2.1]
|
||||
|
||||
- Fix `allowlist > app > show/hide` always disabled when `allowlist > app > all: false`.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-macros"
|
||||
version = "1.3.0"
|
||||
version = "1.2.1"
|
||||
authors = [ "Tauri Programme within The Commons Conservancy" ]
|
||||
categories = [ "gui", "os", "filesystem", "web-programming" ]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
@@ -8,7 +8,7 @@ homepage = "https://tauri.app"
|
||||
repository = "https://github.com/tauri-apps/tauri"
|
||||
description = "Macros for the tauri crate."
|
||||
edition = "2021"
|
||||
rust-version = "1.60"
|
||||
rust-version = "1.59"
|
||||
exclude = [ "CHANGELOG.md", "/target" ]
|
||||
readme = "README.md"
|
||||
|
||||
@@ -20,8 +20,8 @@ proc-macro2 = "1"
|
||||
quote = "1"
|
||||
syn = { version = "1", features = [ "full" ] }
|
||||
heck = "0.4"
|
||||
tauri-codegen = { version = "1.3.0", default-features = false, path = "../tauri-codegen" }
|
||||
tauri-utils = { version = "1.3.0", path = "../tauri-utils" }
|
||||
tauri-codegen = { version = "1.2.1", default-features = false, path = "../tauri-codegen" }
|
||||
tauri-utils = { version = "1.2.1", path = "../tauri-utils" }
|
||||
|
||||
[features]
|
||||
custom-protocol = [ ]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use heck::{ToLowerCamelCase, ToSnakeCase};
|
||||
use proc_macro::TokenStream;
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
use proc_macro2::{Ident, Span, TokenStream as TokenStream2};
|
||||
use quote::{format_ident, quote};
|
||||
use syn::{
|
||||
ext::IdentExt,
|
||||
parse::{Parse, ParseStream},
|
||||
parse_macro_input,
|
||||
spanned::Spanned,
|
||||
FnArg, Ident, ItemFn, Lit, Meta, Pat, Token, Visibility,
|
||||
FnArg, ItemFn, Lit, Meta, Pat, Token, Visibility,
|
||||
};
|
||||
|
||||
struct WrapperAttributes {
|
||||
root: TokenStream2,
|
||||
execution_context: ExecutionContext,
|
||||
argument_case: ArgumentCase,
|
||||
}
|
||||
@@ -22,6 +23,7 @@ struct WrapperAttributes {
|
||||
impl Parse for WrapperAttributes {
|
||||
fn parse(input: ParseStream) -> syn::Result<Self> {
|
||||
let mut wrapper_attributes = WrapperAttributes {
|
||||
root: quote!(::tauri),
|
||||
execution_context: ExecutionContext::Blocking,
|
||||
argument_case: ArgumentCase::Camel,
|
||||
};
|
||||
@@ -43,6 +45,11 @@ impl Parse for WrapperAttributes {
|
||||
}
|
||||
};
|
||||
}
|
||||
} else if v.path.is_ident("root") {
|
||||
if let Lit::Str(s) = v.lit {
|
||||
let ident = Ident::new(&s.value(), Span::call_site());
|
||||
wrapper_attributes.root = quote!(#ident);
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(Meta::Path(p)) => {
|
||||
@@ -104,21 +111,28 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
|
||||
};
|
||||
|
||||
// body to the command wrapper or a `compile_error!` of an error occurred while parsing it.
|
||||
let body = syn::parse::<WrapperAttributes>(attributes)
|
||||
let (body, attributes) = syn::parse::<WrapperAttributes>(attributes)
|
||||
.map(|mut attrs| {
|
||||
if function.sig.asyncness.is_some() {
|
||||
attrs.execution_context = ExecutionContext::Async;
|
||||
}
|
||||
attrs
|
||||
})
|
||||
.and_then(|attrs| match attrs.execution_context {
|
||||
ExecutionContext::Async => body_async(&function, &invoke, attrs.argument_case),
|
||||
ExecutionContext::Blocking => body_blocking(&function, &invoke, attrs.argument_case),
|
||||
.and_then(|attrs| {
|
||||
let body = match attrs.execution_context {
|
||||
ExecutionContext::Async => body_async(&function, &invoke, &attrs),
|
||||
ExecutionContext::Blocking => body_blocking(&function, &invoke, &attrs),
|
||||
};
|
||||
body.map(|b| (b, Some(attrs)))
|
||||
})
|
||||
.unwrap_or_else(syn::Error::into_compile_error);
|
||||
.unwrap_or_else(|e| (syn::Error::into_compile_error(e), None));
|
||||
|
||||
let Invoke { message, resolver } = invoke;
|
||||
|
||||
let root = attributes
|
||||
.map(|a| a.root)
|
||||
.unwrap_or_else(|| quote!(::tauri));
|
||||
|
||||
// Rely on rust 2018 edition to allow importing a macro from a path.
|
||||
quote!(
|
||||
#function
|
||||
@@ -129,10 +143,10 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
|
||||
// double braces because the item is expected to be a block expression
|
||||
($path:path, $invoke:ident) => {{
|
||||
#[allow(unused_imports)]
|
||||
use ::tauri::command::private::*;
|
||||
use #root::command::private::*;
|
||||
// prevent warnings when the body is a `compile_error!` or if the command has no arguments
|
||||
#[allow(unused_variables)]
|
||||
let ::tauri::Invoke { message: #message, resolver: #resolver } = $invoke;
|
||||
let #root::Invoke { message: #message, resolver: #resolver } = $invoke;
|
||||
|
||||
#body
|
||||
}};
|
||||
@@ -150,9 +164,13 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
|
||||
/// See the [`tauri::command`] module for all the items and traits that make this possible.
|
||||
///
|
||||
/// [`tauri::command`]: https://docs.rs/tauri/*/tauri/runtime/index.html
|
||||
fn body_async(function: &ItemFn, invoke: &Invoke, case: ArgumentCase) -> syn::Result<TokenStream2> {
|
||||
fn body_async(
|
||||
function: &ItemFn,
|
||||
invoke: &Invoke,
|
||||
attributes: &WrapperAttributes,
|
||||
) -> syn::Result<TokenStream2> {
|
||||
let Invoke { message, resolver } = invoke;
|
||||
parse_args(function, message, case).map(|args| {
|
||||
parse_args(function, message, attributes).map(|args| {
|
||||
quote! {
|
||||
#resolver.respond_async_serialized(async move {
|
||||
let result = $path(#(#args?),*);
|
||||
@@ -171,10 +189,10 @@ fn body_async(function: &ItemFn, invoke: &Invoke, case: ArgumentCase) -> syn::Re
|
||||
fn body_blocking(
|
||||
function: &ItemFn,
|
||||
invoke: &Invoke,
|
||||
case: ArgumentCase,
|
||||
attributes: &WrapperAttributes,
|
||||
) -> syn::Result<TokenStream2> {
|
||||
let Invoke { message, resolver } = invoke;
|
||||
let args = parse_args(function, message, case)?;
|
||||
let args = parse_args(function, message, attributes)?;
|
||||
|
||||
// the body of a `match` to early return any argument that wasn't successful in parsing.
|
||||
let match_body = quote!({
|
||||
@@ -193,13 +211,13 @@ fn body_blocking(
|
||||
fn parse_args(
|
||||
function: &ItemFn,
|
||||
message: &Ident,
|
||||
case: ArgumentCase,
|
||||
attributes: &WrapperAttributes,
|
||||
) -> syn::Result<Vec<TokenStream2>> {
|
||||
function
|
||||
.sig
|
||||
.inputs
|
||||
.iter()
|
||||
.map(|arg| parse_arg(&function.sig.ident, arg, message, case))
|
||||
.map(|arg| parse_arg(&function.sig.ident, arg, message, attributes))
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -208,7 +226,7 @@ fn parse_arg(
|
||||
command: &Ident,
|
||||
arg: &FnArg,
|
||||
message: &Ident,
|
||||
case: ArgumentCase,
|
||||
attributes: &WrapperAttributes,
|
||||
) -> syn::Result<TokenStream2> {
|
||||
// we have no use for self arguments
|
||||
let mut arg = match arg {
|
||||
@@ -243,7 +261,7 @@ fn parse_arg(
|
||||
));
|
||||
}
|
||||
|
||||
match case {
|
||||
match attributes.argument_case {
|
||||
ArgumentCase::Camel => {
|
||||
key = key.to_lower_camel_case();
|
||||
}
|
||||
@@ -252,8 +270,10 @@ fn parse_arg(
|
||||
}
|
||||
}
|
||||
|
||||
Ok(quote!(::tauri::command::CommandArg::from_command(
|
||||
::tauri::command::CommandItem {
|
||||
let root = &attributes.root;
|
||||
|
||||
Ok(quote!(#root::command::CommandArg::from_command(
|
||||
#root::command::CommandItem {
|
||||
name: stringify!(#command),
|
||||
key: #key,
|
||||
message: &#message,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,41 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## \[0.13.0]
|
||||
|
||||
- Added the `additional_browser_args` option when creating a window.
|
||||
- [3dc38b15](https://www.github.com/tauri-apps/tauri/commit/3dc38b150ea8c59c8ba67fd586f921016928f47c) feat(core): expose additional_browser_args to window config (fix: [#5757](https://www.github.com/tauri-apps/tauri/pull/5757)) ([#5799](https://www.github.com/tauri-apps/tauri/pull/5799)) on 2022-12-14
|
||||
- Added the `content_protected` option when creating a window and `Window::set_content_protected` to change it at runtime.
|
||||
- [4ab5545b](https://www.github.com/tauri-apps/tauri/commit/4ab5545b7a831c549f3c65e74de487ede3ab7ce5) feat: add content protection api, closes [#5132](https://www.github.com/tauri-apps/tauri/pull/5132) ([#5513](https://www.github.com/tauri-apps/tauri/pull/5513)) on 2022-12-13
|
||||
- Added `Builder::device_event_filter` and `App::set_device_event_filter` methods.
|
||||
- [73fd60ee](https://www.github.com/tauri-apps/tauri/commit/73fd60eef2b60f5dc84525ef9c315f4d80c4414f) expose set_device_event_filter in tauri ([#5562](https://www.github.com/tauri-apps/tauri/pull/5562)) on 2022-12-13
|
||||
- Fixes tray events not being delivered.
|
||||
- [138cb8d7](https://www.github.com/tauri-apps/tauri/commit/138cb8d739b15bccdb388e555c20f17ffe16318c) fix(tauri-runtime-wry): tray event listener not registered ([#6270](https://www.github.com/tauri-apps/tauri/pull/6270)) on 2023-02-14
|
||||
- Add `is_minimized()` window method.
|
||||
- [62144ef3](https://www.github.com/tauri-apps/tauri/commit/62144ef3be63b237869e511826edfb938e2c7174) feat: add is_minimized (fix [#3878](https://www.github.com/tauri-apps/tauri/pull/3878)) ([#5618](https://www.github.com/tauri-apps/tauri/pull/5618)) on 2022-12-13
|
||||
- Disable cursor mouse events on Linux.
|
||||
- [8c842a54](https://www.github.com/tauri-apps/tauri/commit/8c842a54a6f3dc5327b4d737df7123dcddaa5769) feature: disable mouse event when building windows on Linux, closes [#5913](https://www.github.com/tauri-apps/tauri/pull/5913) ([#6025](https://www.github.com/tauri-apps/tauri/pull/6025)) on 2023-01-16
|
||||
- Bump minimum supported Rust version to 1.60.
|
||||
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
|
||||
- Pin raw-window-handle to 0.5.0 to keep MSRV.
|
||||
- [c46c09f3](https://www.github.com/tauri-apps/tauri/commit/c46c09f31d9f5169ca8a7e62406a9ea170e3a5c5) fix(deps): pin raw-window-handle to 0.5.0 ([#6480](https://www.github.com/tauri-apps/tauri/pull/6480)) on 2023-03-17
|
||||
- Add `title` getter on window.
|
||||
- [233e43b0](https://www.github.com/tauri-apps/tauri/commit/233e43b0c34fada1ca025378533a0b76931a6540) feat: add `title` getter on window, closes [#5023](https://www.github.com/tauri-apps/tauri/pull/5023) ([#5515](https://www.github.com/tauri-apps/tauri/pull/5515)) on 2022-12-13
|
||||
- Added `TrayHandle::set_tooltip` and `SystemTray::with_tooltip`.
|
||||
- [2265e097](https://www.github.com/tauri-apps/tauri/commit/2265e09718f6ebfeb1d200f11e1e1e069075af6e) feat(windows): implement `with_tooltip` ([#5938](https://www.github.com/tauri-apps/tauri/pull/5938)) on 2023-01-01
|
||||
- Added window's `url()` getter.
|
||||
- [d17027e1](https://www.github.com/tauri-apps/tauri/commit/d17027e1a0db3e8c5ae81fc4f472c5918fbce611) feat: expose url method ([#5914](https://www.github.com/tauri-apps/tauri/pull/5914)) on 2022-12-26
|
||||
- On Windows, change webview theme based on Window theme for more accurate `prefers-color-scheme` support.
|
||||
- [7a8d570d](https://www.github.com/tauri-apps/tauri/commit/7a8d570db72667367eb24b75ddc5dd07a968f7c0) fix: sync webview theme with window theme on Windows, closes [#5802](https://www.github.com/tauri-apps/tauri/pull/5802) ([#5874](https://www.github.com/tauri-apps/tauri/pull/5874)) on 2022-12-27
|
||||
- On Windows, Fix missing `WindowEvent::Focused` in `App::run` callback.
|
||||
- [ff4ea1ea](https://www.github.com/tauri-apps/tauri/commit/ff4ea1eabbf2874b113c6b4698002929bbac737a) fix: dispatch focus event to app.run on Windows, closes [#6460](https://www.github.com/tauri-apps/tauri/pull/6460) ([#6504](https://www.github.com/tauri-apps/tauri/pull/6504)) on 2023-03-31
|
||||
- Implement the webview navigation handler.
|
||||
- [3f35b452](https://www.github.com/tauri-apps/tauri/commit/3f35b452637ef1c794a423f1eda62a15d2ddaf42) Expose wry navigation_handler via WindowBuilder closes [#4080](https://www.github.com/tauri-apps/tauri/pull/4080) ([#5686](https://www.github.com/tauri-apps/tauri/pull/5686)) on 2022-12-27
|
||||
|
||||
## \[0.12.3]
|
||||
|
||||
- Block remote URLs from accessing the IPC.
|
||||
- [9c0593c33](https://www.github.com/tauri-apps/tauri/commit/9c0593c33af52cd9e00ec784d15f63efebdf039c) feat(core): block remote URLs from accessing the IPC on 2023-04-12
|
||||
|
||||
## \[0.12.2]
|
||||
|
||||
- Fix compatibility with older Linux distributions.
|
||||
@@ -81,11 +45,6 @@
|
||||
- Added the `user_agent` option when creating a window.
|
||||
- [a6c94119](https://www.github.com/tauri-apps/tauri/commit/a6c94119d8545d509723b147c273ca5edfe3729f) feat(core): expose user_agent to window config ([#5317](https://www.github.com/tauri-apps/tauri/pull/5317)) on 2022-10-02
|
||||
|
||||
## \[0.11.2]
|
||||
|
||||
- Block remote URLs from accessing the IPC.
|
||||
- [58ea0b452](https://www.github.com/tauri-apps/tauri/commit/58ea0b45268dbd46cbac0ebb0887353d057ca767) feat(core): block remote URLs from accessing the IPC on 2023-04-12
|
||||
|
||||
## \[0.11.1]
|
||||
|
||||
- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs.
|
||||
@@ -105,11 +64,6 @@
|
||||
- Update windows to 0.39.0 and webview2-com to 0.19.1.
|
||||
- [e6d9b670](https://www.github.com/tauri-apps/tauri/commit/e6d9b670b0b314ed667b0e164f2c8d27048e678f) refactor: remove unneeded focus code ([#5065](https://www.github.com/tauri-apps/tauri/pull/5065)) on 2022-09-03
|
||||
|
||||
## \[0.10.3]
|
||||
|
||||
- Block remote URLs from accessing the IPC.
|
||||
- [fa90214b0](https://www.github.com/tauri-apps/tauri/commit/fa90214b052b1a5d38d54fbf1ca422b4c37cfd1f) feat(core): block remote URLs from accessing the IPC on 2023-04-12
|
||||
|
||||
## \[0.10.2]
|
||||
|
||||
- Disable drag-n-drop of tao based on `fileDropEnabled` value.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-runtime-wry"
|
||||
version = "0.13.0"
|
||||
version = "0.12.2"
|
||||
authors = [ "Tauri Programme within The Commons Conservancy" ]
|
||||
categories = [ "gui", "web-programming" ]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
@@ -8,17 +8,17 @@ homepage = "https://tauri.app"
|
||||
repository = "https://github.com/tauri-apps/tauri"
|
||||
description = "Wry bindings to the Tauri runtime"
|
||||
edition = "2021"
|
||||
rust-version = "1.60"
|
||||
rust-version = "1.59"
|
||||
exclude = [ "CHANGELOG.md", "/target" ]
|
||||
readme = "README.md"
|
||||
|
||||
[dependencies]
|
||||
wry = { version = "0.24.1", default-features = false, features = [ "file-drop", "protocol" ] }
|
||||
tauri-runtime = { version = "0.13.0", path = "../tauri-runtime" }
|
||||
tauri-utils = { version = "1.3.0", path = "../tauri-utils" }
|
||||
wry = { git = "https://github.com/tauri-apps/wry", default-features = false, features = [ "file-drop", "protocol" ] }
|
||||
tauri-runtime = { version = "0.12.1", path = "../tauri-runtime" }
|
||||
tauri-utils = { version = "1.2.1", path = "../tauri-utils" }
|
||||
uuid = { version = "1", features = [ "v4" ] }
|
||||
rand = "0.8"
|
||||
raw-window-handle = "=0.5.0"
|
||||
raw-window-handle = "0.5"
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
webview2-com = "0.19.1"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user