diff --git a/Cargo.lock b/Cargo.lock index a44e72ae3680..1f7d304bda24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1120,30 +1120,15 @@ dependencies = [ "tauri-build", ] -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec 0.6.3", -] - [[package]] name = "bit-set" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ - "bit-vec 0.8.0", + "bit-vec", ] -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bit-vec" version = "0.8.0" @@ -1269,6 +1254,12 @@ dependencies = [ "cipher", ] +[[package]] +name = "borrow-or-share" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eeab4423108c5d7c744f4d234de88d18d636100093ae04caf4825134b9c3a32" + [[package]] name = "borsh" version = "1.5.1" @@ -2692,6 +2683,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "email_address" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e079f19b08ca6239f47f8ba8509c11cf3ea30095831f7fed61441475edd8c449" +dependencies = [ + "serde", +] + [[package]] name = "embed-resource" version = "2.5.0" @@ -2845,11 +2845,11 @@ dependencies = [ [[package]] name = "fancy-regex" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" dependencies = [ - "bit-set 0.5.3", + "bit-set", "regex-automata", "regex-syntax", ] @@ -2962,6 +2962,17 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +[[package]] +name = "fluent-uri" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1918b65d96df47d3591bed19c5cca17e3fa5d0707318e4b5ef2eae01764df7e5" +dependencies = [ + "borrow-or-share", + "ref-cast", + "serde", +] + [[package]] name = "flume" version = "0.11.0" @@ -4326,15 +4337,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "iso8601" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924e5d73ea28f59011fec52a0d12185d496a9b075d360657aed2a5707f701153" -dependencies = [ - "nom", -] - [[package]] name = "iter-read" version = "1.1.0" @@ -4615,32 +4617,27 @@ dependencies = [ [[package]] name = "jsonschema" -version = "0.18.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0f4bea31643be4c6a678e9aa4ae44f0db9e5609d5ca9dc9083d06eb3e9a27a" +checksum = "c2303ef9ebb6acd7afe7c48cbc06ab807349c429d4e47c4cde8b35400503198f" dependencies = [ "ahash 0.8.11", - "anyhow", "base64 0.22.1", "bytecount", - "clap", + "email_address", "fancy-regex", "fraction", - "getrandom 0.2.15", - "iso8601", + "idna", "itoa 1.0.11", - "memchr", "num-cmp", "once_cell", - "parking_lot", "percent-encoding", - "regex", + "referencing", + "regex-syntax", "reqwest 0.12.9", "serde", "serde_json", - "time", - "url", - "uuid", + "uuid-simd", ] [[package]] @@ -6815,8 +6812,8 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ - "bit-set 0.8.0", - "bit-vec 0.8.0", + "bit-set", + "bit-vec", "bitflags 2.6.0", "lazy_static", "num-traits", @@ -7197,6 +7194,39 @@ dependencies = [ "thiserror 1.0.68", ] +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", +] + +[[package]] +name = "referencing" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fb7a1f338d8e32357ad1d7078454c248e5fdd2188fbb6966b400c2fa4d4f566" +dependencies = [ + "ahash 0.8.11", + "fluent-uri", + "once_cell", + "percent-encoding", + "serde_json", +] + [[package]] name = "regex" version = "1.11.1" @@ -10422,6 +10452,17 @@ dependencies = [ "sha1_smol", ] +[[package]] +name = "uuid-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b082222b4f6619906941c17eb2297fff4c2fb96cb60164170522942a200bd8" +dependencies = [ + "outref", + "uuid", + "vsimd", +] + [[package]] name = "v_frame" version = "0.3.8" diff --git a/crates/tauri-cli/Cargo.toml b/crates/tauri-cli/Cargo.toml index 34c49a28780e..67329096f7dc 100644 --- a/crates/tauri-cli/Cargo.toml +++ b/crates/tauri-cli/Cargo.toml @@ -70,7 +70,7 @@ tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [ "config-toml", ] } toml = "0.8" -jsonschema = "0.18" +jsonschema = "0.28" handlebars = "6" include_dir = "0.7" minisign = "=0.7.3" diff --git a/crates/tauri-cli/src/helpers/config.rs b/crates/tauri-cli/src/helpers/config.rs index 2ae0bf030b07..eb9cc5bded8b 100644 --- a/crates/tauri-cli/src/helpers/config.rs +++ b/crates/tauri-cli/src/helpers/config.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use itertools::Itertools; use json_patch::merge; use serde_json::Value as JsonValue; @@ -172,11 +173,11 @@ fn get_internal( || config_path.extension() == Some(OsStr::new("json5")) { let schema: JsonValue = serde_json::from_str(include_str!("../../config.schema.json"))?; - let schema = jsonschema::JSONSchema::compile(&schema).unwrap(); - let result = schema.validate(&config); - if let Err(errors) = result { + let validator = jsonschema::validator_for(&schema).expect("Invalid schema"); + let mut errors = validator.iter_errors(&config).peekable(); + if errors.peek().is_some() { for error in errors { - let path = error.instance_path.clone().into_vec().join(" > "); + let path = error.instance_path.into_iter().join(" > "); if path.is_empty() { log::error!("`{}` error: {}", config_file_name, error); } else {