Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: config schema generator (#5193)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
- Loading branch information
1 parent
cc186c7
commit a178f95
Showing
37 changed files
with
3,127 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"tauri-utils": minor | ||
--- | ||
|
||
`PatternKind::Isolation` is now defined even without the `isolation` feature. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" ] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(()) | ||
} |
Oops, something went wrong.