mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-24 19:25:12 +03:00
feat: config schema generator (#5193)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
parent
cc186c7a0e
commit
a178f95d68
@ -232,7 +232,10 @@
|
||||
"path": "./tooling/cli/node",
|
||||
"manager": "javascript",
|
||||
"dependencies": ["cli.rs"],
|
||||
"postversion": "node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"postversion": [
|
||||
"node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"cargo build --manifest-path ../../core/config-schema/Cargo.toml"
|
||||
],
|
||||
"prepublish": [],
|
||||
"publish": [],
|
||||
"postpublish": []
|
||||
|
5
.changes/isolation-pattern-config.md
Normal file
5
.changes/isolation-pattern-config.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-utils": minor
|
||||
---
|
||||
|
||||
`PatternKind::Isolation` is now defined even without the `isolation` feature.
|
2
.github/workflows/artifacts-updater.yml
vendored
2
.github/workflows/artifacts-updater.yml
vendored
@ -128,6 +128,7 @@ jobs:
|
||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
# Updater signature is exposed here to make sure it works in PR's
|
||||
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
TAURI_KEY_PASSWORD:
|
||||
# run on PRs and forks
|
||||
- name: build sample artifacts (updater)
|
||||
if: steps.enablecodesigning.outputs.enabled != 'true'
|
||||
@ -137,6 +138,7 @@ jobs:
|
||||
cargo tauri build --verbose
|
||||
env:
|
||||
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
TAURI_KEY_PASSWORD:
|
||||
# upload assets
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
|
36
.github/workflows/check-generated-files.yml
vendored
36
.github/workflows/check-generated-files.yml
vendored
@ -12,6 +12,7 @@ on:
|
||||
- 'core/tauri/scripts/bundle.global.js'
|
||||
- 'core/tauri-utils/src/config.rs'
|
||||
- 'tooling/cli/schema.json'
|
||||
- 'core/config-schema/schema.json'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@ -35,6 +36,7 @@ jobs:
|
||||
schema:
|
||||
- 'core/tauri-utils/src/config.rs'
|
||||
- 'tooling/cli/schema.json'
|
||||
- 'core/config-schema/schema.json'
|
||||
|
||||
check-bundle:
|
||||
runs-on: ubuntu-latest
|
||||
@ -63,18 +65,12 @@ jobs:
|
||||
override: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
@ -85,33 +81,33 @@ jobs:
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
cache-name: cargo-core
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: generate schema.json
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
args: --manifest-path ./core/config-schema/Cargo.toml
|
||||
|
||||
- name: check schema
|
||||
run: ./.scripts/ci/has-diff.sh
|
||||
|
@ -8,6 +8,7 @@ members = [
|
||||
"core/tauri-utils",
|
||||
"core/tauri-build",
|
||||
"core/tauri-codegen",
|
||||
"core/config-schema",
|
||||
|
||||
# integration tests
|
||||
"core/tests/restart",
|
||||
|
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" ] }
|
25
core/config-schema/build.rs
Normal file
25
core/config-schema/build.rs
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use std::{
|
||||
error::Error,
|
||||
fs::File,
|
||||
io::{BufWriter, Write},
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
pub fn main() -> Result<(), Box<dyn Error>> {
|
||||
let schema = schemars::schema_for!(tauri_utils::config::Config);
|
||||
let schema_str = serde_json::to_string_pretty(&schema).unwrap();
|
||||
let crate_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR")?);
|
||||
for file in [
|
||||
crate_dir.join("schema.json"),
|
||||
crate_dir.join("../../tooling/cli/schema.json"),
|
||||
] {
|
||||
let mut schema_file = BufWriter::new(File::create(&file)?);
|
||||
write!(schema_file, "{}", schema_str)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
2820
core/config-schema/schema.json
Normal file
2820
core/config-schema/schema.json
Normal file
File diff suppressed because it is too large
Load Diff
1
core/config-schema/src/main.rs
Normal file
1
core/config-schema/src/main.rs
Normal file
@ -0,0 +1 @@
|
||||
fn main() {}
|
@ -362,6 +362,10 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
|
||||
let pattern = match &options.pattern {
|
||||
PatternKind::Brownfield => quote!(#root::Pattern::Brownfield(std::marker::PhantomData)),
|
||||
#[cfg(not(feature = "isolation"))]
|
||||
PatternKind::Isolation { dir: _ } => {
|
||||
quote!(#root::Pattern::Brownfield(std::marker::PhantomData))
|
||||
}
|
||||
#[cfg(feature = "isolation")]
|
||||
PatternKind::Isolation { dir } => {
|
||||
let dir = config_parent.join(dir);
|
||||
|
@ -2161,7 +2161,6 @@ pub enum PatternKind {
|
||||
/// Brownfield pattern.
|
||||
Brownfield,
|
||||
/// Isolation pattern. Recommended for security purposes.
|
||||
#[cfg(feature = "isolation")]
|
||||
Isolation {
|
||||
/// The dir containing the index.html file that contains the secure isolation application.
|
||||
dir: PathBuf,
|
||||
@ -2239,7 +2238,6 @@ impl TauriConfig {
|
||||
if self.macos_private_api {
|
||||
features.push("macos-private-api");
|
||||
}
|
||||
#[cfg(feature = "isolation")]
|
||||
if let PatternKind::Isolation { .. } = self.pattern {
|
||||
features.push("isolation");
|
||||
}
|
||||
@ -3186,6 +3184,8 @@ mod build {
|
||||
|
||||
tokens.append_all(match self {
|
||||
Self::Brownfield => quote! { #prefix::Brownfield },
|
||||
#[cfg(not(feature = "isolation"))]
|
||||
Self::Isolation { dir: _ } => quote! { #prefix::Brownfield },
|
||||
#[cfg(feature = "isolation")]
|
||||
Self::Isolation { dir } => {
|
||||
let dir = path_buf_lit(dir);
|
||||
|
@ -212,7 +212,6 @@ impl From<&PatternKind> for PatternObject {
|
||||
fn from(pattern_kind: &PatternKind) -> Self {
|
||||
match pattern_kind {
|
||||
PatternKind::Brownfield => Self::Brownfield,
|
||||
#[cfg(feature = "isolation")]
|
||||
PatternKind::Isolation { .. } => Self::Isolation {
|
||||
side: IsolationSide::default(),
|
||||
},
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": "../dist",
|
||||
"devPath": "http://localhost:4000"
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": [],
|
||||
"devPath": []
|
||||
@ -30,7 +30,9 @@
|
||||
"active": true,
|
||||
"dialog": false,
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE5QzMxNjYwNTM5OEUwNTgKUldSWTRKaFRZQmJER1h4d1ZMYVA3dnluSjdpN2RmMldJR09hUFFlZDY0SlFqckkvRUJhZDJVZXAK",
|
||||
"endpoints": ["http://localhost:3007"],
|
||||
"endpoints": [
|
||||
"http://localhost:3007"
|
||||
],
|
||||
"windows": {
|
||||
"installMode": "quiet"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": "../dist",
|
||||
"devPath": "http://localhost:5173",
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"$schema": "../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["index.html"],
|
||||
"devPath": ["index.html"],
|
||||
"distDir": [
|
||||
"index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"index.html"
|
||||
],
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"$schema": "../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["index.html"],
|
||||
"devPath": ["index.html"],
|
||||
"distDir": [
|
||||
"index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"index.html"
|
||||
],
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
},
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"$schema": "../../core/config-schema/schema.json",
|
||||
"package": {
|
||||
"productName": "Isolation",
|
||||
"version": "0.1.0"
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"$schema": "../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["index.html"],
|
||||
"devPath": ["index.html"],
|
||||
"distDir": [
|
||||
"index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"index.html"
|
||||
],
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"$schema": "../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": "public",
|
||||
"devPath": "public",
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"$schema": "../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["index.html"],
|
||||
"devPath": ["index.html"],
|
||||
"distDir": [
|
||||
"index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"index.html"
|
||||
],
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["../index.html"],
|
||||
"devPath": ["../index.html"],
|
||||
"distDir": [
|
||||
"../index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"../index.html"
|
||||
],
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
@ -23,7 +27,9 @@
|
||||
"../../.icons/icon.icns",
|
||||
"../../.icons/icon.ico"
|
||||
],
|
||||
"resources": ["assets/*"],
|
||||
"resources": [
|
||||
"assets/*"
|
||||
],
|
||||
"externalBin": [],
|
||||
"copyright": "",
|
||||
"category": "DeveloperTool",
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["../index.html"],
|
||||
"devPath": ["../index.html"],
|
||||
"distDir": [
|
||||
"../index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"../index.html"
|
||||
],
|
||||
"beforeDevCommand": "yarn package",
|
||||
"beforeBuildCommand": "yarn package",
|
||||
"withGlobalTauri": true
|
||||
@ -24,7 +28,9 @@
|
||||
"../../.icons/icon.ico"
|
||||
],
|
||||
"resources": [],
|
||||
"externalBin": ["binaries/app"],
|
||||
"externalBin": [
|
||||
"binaries/app"
|
||||
],
|
||||
"copyright": "",
|
||||
"category": "DeveloperTool",
|
||||
"shortDescription": "",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"$schema": "../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": "dist",
|
||||
"devPath": "dist",
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"$schema": "../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["index.html"],
|
||||
"devPath": ["index.html"],
|
||||
"distDir": [
|
||||
"index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"index.html"
|
||||
],
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"$schema": "../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["index.html"],
|
||||
"devPath": ["index.html"],
|
||||
"distDir": [
|
||||
"index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"index.html"
|
||||
],
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["src/index.html"],
|
||||
"devPath": ["src/index.html"],
|
||||
"distDir": [
|
||||
"src/index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"src/index.html"
|
||||
],
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
},
|
||||
|
75
examples/updater/src-tauri/Cargo.lock
generated
75
examples/updater/src-tauri/Cargo.lock
generated
@ -206,12 +206,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cargo_toml"
|
||||
version = "0.11.5"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5809dd3e6444651fd1cdd3dbec71eca438c439a0fcc8081674a14da0afe50185"
|
||||
checksum = "aa0e3586af56b3bfa51fca452bd56e8dbbbd5d8d81cbf0b7e4e35b695b537eb8"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"toml",
|
||||
]
|
||||
|
||||
@ -565,6 +564,12 @@ dependencies = [
|
||||
"dtoa",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dunce"
|
||||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c"
|
||||
|
||||
[[package]]
|
||||
name = "embed_plist"
|
||||
version = "1.2.2"
|
||||
@ -1564,9 +1569,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.14.0"
|
||||
version = "1.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0"
|
||||
checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1"
|
||||
|
||||
[[package]]
|
||||
name = "openssl"
|
||||
@ -1669,9 +1674,9 @@ checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc"
|
||||
|
||||
[[package]]
|
||||
name = "percent-encoding"
|
||||
version = "2.1.0"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
|
||||
checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
|
||||
|
||||
[[package]]
|
||||
name = "pest"
|
||||
@ -2214,18 +2219,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.137"
|
||||
version = "1.0.147"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1"
|
||||
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.137"
|
||||
version = "1.0.147"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be"
|
||||
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2473,8 +2478,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "tao"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "43336f5d1793543ba96e2a1e75f3a5c7dcd592743be06a0ab3a190f4fcb4b934"
|
||||
source = "git+https://github.com/tauri-apps/tao?branch=dev#d72b1e1a0cb7757bdc67008d70c8d25596ad393d"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cairo-rs",
|
||||
@ -2510,7 +2514,7 @@ dependencies = [
|
||||
"scopeguard",
|
||||
"serde",
|
||||
"unicode-segmentation",
|
||||
"uuid 1.1.2",
|
||||
"uuid 1.2.1",
|
||||
"windows 0.39.0",
|
||||
"windows-implement",
|
||||
"x11-dl",
|
||||
@ -2529,7 +2533,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri"
|
||||
version = "1.0.5"
|
||||
version = "1.1.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"attohttpc",
|
||||
@ -2569,7 +2573,7 @@ dependencies = [
|
||||
"time",
|
||||
"tokio",
|
||||
"url",
|
||||
"uuid 1.1.2",
|
||||
"uuid 1.2.1",
|
||||
"webkit2gtk",
|
||||
"webview2-com",
|
||||
"windows 0.39.0",
|
||||
@ -2578,7 +2582,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-build"
|
||||
version = "1.0.4"
|
||||
version = "1.1.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cargo_toml",
|
||||
@ -2594,7 +2598,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-codegen"
|
||||
version = "1.0.4"
|
||||
version = "1.1.1"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"brotli",
|
||||
@ -2611,13 +2615,13 @@ dependencies = [
|
||||
"tauri-utils",
|
||||
"thiserror",
|
||||
"time",
|
||||
"uuid 1.1.2",
|
||||
"uuid 1.2.1",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-macros"
|
||||
version = "1.0.4"
|
||||
version = "1.1.1"
|
||||
dependencies = [
|
||||
"heck 0.4.0",
|
||||
"proc-macro2",
|
||||
@ -2629,26 +2633,25 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "0.10.2"
|
||||
version = "0.11.1"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
"http-range",
|
||||
"infer",
|
||||
"rand 0.8.5",
|
||||
"raw-window-handle",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tauri-utils",
|
||||
"thiserror",
|
||||
"uuid 1.1.2",
|
||||
"uuid 1.2.1",
|
||||
"webview2-com",
|
||||
"windows 0.39.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime-wry"
|
||||
version = "0.10.2"
|
||||
version = "0.11.1"
|
||||
dependencies = [
|
||||
"cocoa",
|
||||
"gtk",
|
||||
@ -2657,7 +2660,7 @@ dependencies = [
|
||||
"raw-window-handle",
|
||||
"tauri-runtime",
|
||||
"tauri-utils",
|
||||
"uuid 1.1.2",
|
||||
"uuid 1.2.1",
|
||||
"webkit2gtk",
|
||||
"webview2-com",
|
||||
"windows 0.39.0",
|
||||
@ -2666,13 +2669,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-utils"
|
||||
version = "1.0.3"
|
||||
version = "1.1.1"
|
||||
dependencies = [
|
||||
"brotli",
|
||||
"ctor",
|
||||
"glob",
|
||||
"heck 0.4.0",
|
||||
"html5ever",
|
||||
"infer",
|
||||
"json-patch",
|
||||
"kuchiki",
|
||||
"memchr",
|
||||
@ -2903,9 +2907,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "unicode-segmentation"
|
||||
version = "1.9.0"
|
||||
version = "1.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99"
|
||||
checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a"
|
||||
|
||||
[[package]]
|
||||
name = "updater-example"
|
||||
@ -2943,9 +2947,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.1.2"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f"
|
||||
checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83"
|
||||
dependencies = [
|
||||
"getrandom 0.2.7",
|
||||
]
|
||||
@ -3081,9 +3085,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "webkit2gtk"
|
||||
version = "0.18.0"
|
||||
version = "0.18.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29952969fb5e10fe834a52eb29ad0814ccdfd8387159b0933edf1344a1c9cdcc"
|
||||
checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cairo-rs",
|
||||
@ -3368,15 +3372,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wry"
|
||||
version = "0.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "844db9289224ed80d186fa4a094365a6639c5790bb4b120e7a14a72d4c82e8fd"
|
||||
version = "0.21.1"
|
||||
source = "git+https://github.com/tauri-apps/wry?branch=dev#fea0638d9ad100c00b95468aa16fc44d6517ac0d"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"block",
|
||||
"cocoa",
|
||||
"core-graphics",
|
||||
"crossbeam-channel",
|
||||
"dunce",
|
||||
"gdk",
|
||||
"gio",
|
||||
"glib",
|
||||
@ -3392,6 +3396,7 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"soup2",
|
||||
"tao",
|
||||
"thiserror",
|
||||
"url",
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"$schema": "../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": ["../index.html"],
|
||||
"devPath": ["../index.html"],
|
||||
"distDir": [
|
||||
"../index.html"
|
||||
],
|
||||
"devPath": [
|
||||
"../index.html"
|
||||
],
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
},
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": "../public",
|
||||
"devPath": "../public",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": "../public",
|
||||
"devPath": "../public",
|
||||
@ -37,7 +37,9 @@
|
||||
"all": false,
|
||||
"fs": {
|
||||
"readFile": true,
|
||||
"scope": ["$HOME/.tauri_3mb.json"]
|
||||
"scope": [
|
||||
"$HOME/.tauri_3mb.json"
|
||||
]
|
||||
}
|
||||
},
|
||||
"windows": [
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"distDir": "../public",
|
||||
"devPath": "../public",
|
||||
|
2
tooling/cli/Cargo.lock
generated
2
tooling/cli/Cargo.lock
generated
@ -2736,7 +2736,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1847b767a3d62d95cbf3d8a9f0e421cf57a0d8aa4f411d4b16525afb0284d4ed"
|
||||
dependencies = [
|
||||
"dyn-clone",
|
||||
"indexmap",
|
||||
"schemars_derive",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@ -3273,7 +3272,6 @@ dependencies = [
|
||||
"os_info",
|
||||
"os_pipe",
|
||||
"regex",
|
||||
"schemars",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
@ -94,12 +94,5 @@ libc = "0.2"
|
||||
[target."cfg(target_os = \"linux\")".build-dependencies]
|
||||
heck = "0.4"
|
||||
|
||||
[build-dependencies]
|
||||
tauri-utils = { version = "1.0.0", features = [ "schema", "isolation" ], path = "../../core/tauri-utils" }
|
||||
schemars = { version = "0.8", features = [ "url", "preserve_order" ] }
|
||||
serde = { version = "1.0", features = [ "derive" ] }
|
||||
serde_json = "1.0"
|
||||
url = { version = "2.3", features = [ "serde" ] }
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use std::{
|
||||
env::current_dir,
|
||||
error::Error,
|
||||
fs::File,
|
||||
io::{BufWriter, Write},
|
||||
};
|
||||
|
||||
pub fn main() -> Result<(), Box<dyn Error>> {
|
||||
let schema = schemars::schema_for!(tauri_utils::config::Config);
|
||||
let schema_file_path = current_dir()?.join("schema.json");
|
||||
let mut schema_file = BufWriter::new(File::create(&schema_file_path)?);
|
||||
write!(
|
||||
schema_file,
|
||||
"{}",
|
||||
serde_json::to_string_pretty(&schema).unwrap()
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../../../../../../../tooling/cli/schema.json",
|
||||
"$schema": "../../../../../../../../core/config-schema/schema.json",
|
||||
"build": {
|
||||
"devPath": "../dist",
|
||||
"distDir": "../dist",
|
||||
|
@ -702,19 +702,47 @@
|
||||
},
|
||||
"Theme": {
|
||||
"description": "System theme.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Light",
|
||||
"Dark"
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Light theme.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Light"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Dark theme.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Dark"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"TitleBarStyle": {
|
||||
"description": "How the window title bar should be displayed.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Visible",
|
||||
"Transparent",
|
||||
"Overlay"
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A normal title bar.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Visible"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Makes the title bar transparent, so the window background color is shown instead.\n\nUseful if you don't need to have actual HTML under the title bar. This lets you avoid the caveats of using `TitleBarStyle::Overlay`. Will be more useful when Tauri lets you set a custom window background color.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Transparent"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Shows the title bar as a transparent overlay over the window's content.\n\nKeep in mind: - The height of the title bar is different on different OS versions, which can lead to window the controls and title not being where you don't expect. - You need to define a custom drag region to make your window draggable, however due to a limitation you can't drag the window when it's not in focus (https://github.com/tauri-apps/tauri/issues/4316). - The color of the window title depends on the system theme.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Overlay"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"CliConfig": {
|
||||
@ -1136,14 +1164,49 @@
|
||||
},
|
||||
"BundleType": {
|
||||
"description": "A bundle referenced by tauri-bundler.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deb",
|
||||
"appimage",
|
||||
"msi",
|
||||
"app",
|
||||
"dmg",
|
||||
"updater"
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "The debian bundle (.deb).",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deb"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "The AppImage bundle (.appimage).",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"appimage"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "The Microsoft Installer bundle (.msi).",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"msi"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "The macOS application bundle (.app).",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"app"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "The Apple Disk Image bundle (.dmg).",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"dmg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "The Tauri updater bundle.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"updater"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"AppImageConfig": {
|
||||
@ -2530,11 +2593,28 @@
|
||||
},
|
||||
"WindowsUpdateInstallMode": {
|
||||
"description": "Install modes for the Windows update.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"basicUi",
|
||||
"quiet",
|
||||
"passive"
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Specifies there's a basic UI during the installation process, including a final dialog box at the end.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"basicUi"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "The quiet mode means there's no user interaction required. Requires admin privileges if the installer does.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"quiet"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Specifies unattended mode, which means the installation only shows a progress bar.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"passive"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"SystemTrayConfig": {
|
||||
|
Loading…
Reference in New Issue
Block a user