mirror of https://github.com/zino-rs/zino
Release version 0.25.3
This commit is contained in:
parent
57fbbc58e7
commit
51885659f9
|
@ -19,7 +19,7 @@ features = ["derive"]
|
|||
|
||||
[dependencies.zino]
|
||||
path = "../../zino"
|
||||
version = "0.24.2"
|
||||
version = "0.24.3"
|
||||
features = [
|
||||
"actix",
|
||||
"i18n",
|
||||
|
@ -30,7 +30,7 @@ features = [
|
|||
|
||||
[dependencies.zino-core]
|
||||
path = "../../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
features = [
|
||||
"cookie",
|
||||
"env-filter",
|
||||
|
@ -40,8 +40,8 @@ features = [
|
|||
|
||||
[dependencies.zino-derive]
|
||||
path = "../../zino-derive"
|
||||
version = "0.22.2"
|
||||
version = "0.22.3"
|
||||
|
||||
[dependencies.zino-model]
|
||||
path = "../../zino-model"
|
||||
version = "0.22.2"
|
||||
version = "0.22.3"
|
||||
|
|
|
@ -19,7 +19,7 @@ features = ["derive"]
|
|||
|
||||
[dependencies.zino]
|
||||
path = "../../zino"
|
||||
version = "0.24.2"
|
||||
version = "0.24.3"
|
||||
features = [
|
||||
"axum",
|
||||
"i18n",
|
||||
|
@ -29,7 +29,7 @@ features = [
|
|||
|
||||
[dependencies.zino-core]
|
||||
path = "../../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
features = [
|
||||
"cookie",
|
||||
"env-filter",
|
||||
|
@ -40,8 +40,8 @@ features = [
|
|||
|
||||
[dependencies.zino-derive]
|
||||
path = "../../zino-derive"
|
||||
version = "0.22.2"
|
||||
version = "0.22.3"
|
||||
|
||||
[dependencies.zino-model]
|
||||
path = "../../zino-model"
|
||||
version = "0.22.2"
|
||||
version = "0.22.3"
|
||||
|
|
|
@ -22,14 +22,14 @@ features = [
|
|||
|
||||
[dependencies.zino]
|
||||
path = "../../zino"
|
||||
version = "0.24.2"
|
||||
version = "0.24.3"
|
||||
features = ["dioxus-desktop"]
|
||||
|
||||
[dependencies.zino-core]
|
||||
path = "../../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
features = ["env-filter", "tls-native"]
|
||||
|
||||
[dependencies.zino-dioxus]
|
||||
path = "../../zino-dioxus"
|
||||
version = "0.7.2"
|
||||
version = "0.7.3"
|
||||
|
|
|
@ -22,14 +22,14 @@ features = [
|
|||
|
||||
[dependencies.zino]
|
||||
path = "../../zino"
|
||||
version = "0.24.2"
|
||||
version = "0.24.3"
|
||||
features = ["dioxus-ssr"]
|
||||
|
||||
[dependencies.zino-core]
|
||||
path = "../../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
features = ["env-filter", "tls-native"]
|
||||
|
||||
[dependencies.zino-dioxus]
|
||||
path = "../../zino-dioxus"
|
||||
version = "0.7.2"
|
||||
version = "0.7.3"
|
||||
|
|
|
@ -8,6 +8,6 @@ publish = false
|
|||
|
||||
[dependencies.zino]
|
||||
path = "../../zino"
|
||||
version = "0.24.2"
|
||||
version = "0.24.3"
|
||||
features = ["axum"]
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ features = ["derive"]
|
|||
|
||||
[dependencies.zino]
|
||||
path = "../../zino"
|
||||
version = "0.24.2"
|
||||
version = "0.24.3"
|
||||
features = [
|
||||
"i18n",
|
||||
"jwt",
|
||||
|
@ -29,7 +29,7 @@ features = [
|
|||
|
||||
[dependencies.zino-core]
|
||||
path = "../../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
features = [
|
||||
"cookie",
|
||||
"env-filter",
|
||||
|
@ -39,8 +39,8 @@ features = [
|
|||
|
||||
[dependencies.zino-derive]
|
||||
path = "../../zino-derive"
|
||||
version = "0.22.2"
|
||||
version = "0.22.3"
|
||||
|
||||
[dependencies.zino-model]
|
||||
path = "../../zino-model"
|
||||
version = "0.22.2"
|
||||
version = "0.22.3"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "zino-core"
|
||||
description = "Core types and traits for zino."
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
rust-version = "1.75"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
@ -197,6 +197,7 @@ cfg-if = "1.0"
|
|||
convert_case = "0.6.0"
|
||||
cron = "0.12.1"
|
||||
csv = "1.3.0"
|
||||
dirs = "5.0.1"
|
||||
etag = "4.0.0"
|
||||
faster-hex = "0.9.0"
|
||||
futures = "0.3.30"
|
||||
|
@ -372,7 +373,7 @@ version = "0.4.1"
|
|||
optional = true
|
||||
|
||||
[dependencies.sqlx]
|
||||
version = "0.8.1"
|
||||
version = "0.8.2"
|
||||
optional = true
|
||||
default-features = false
|
||||
features = [
|
||||
|
|
|
@ -118,13 +118,8 @@ pub trait Application {
|
|||
|
||||
// Initializes the directories to ensure that they are ready for use
|
||||
if let Some(dirs) = SHARED_APP_STATE.get_config("dirs") {
|
||||
let project_dir = Self::project_dir();
|
||||
for dir in dirs.values().filter_map(|v| v.as_str()) {
|
||||
let path = if dir.starts_with('/') {
|
||||
PathBuf::from(dir)
|
||||
} else {
|
||||
project_dir.join(dir)
|
||||
};
|
||||
let path = parse_path(dir);
|
||||
if !path.exists() {
|
||||
if let Err(err) = fs::create_dir_all(&path) {
|
||||
let path = path.display();
|
||||
|
@ -336,6 +331,21 @@ pub trait Application {
|
|||
}
|
||||
}
|
||||
|
||||
/// Parses a path relative to the project dir.
|
||||
pub(crate) fn parse_path(path: &str) -> PathBuf {
|
||||
if path.starts_with('/') {
|
||||
path.into()
|
||||
} else if let Some(path) = path.strip_prefix("~/") {
|
||||
if let Some(home_dir) = dirs::home_dir() {
|
||||
home_dir.join(path)
|
||||
} else {
|
||||
PROJECT_DIR.join(path)
|
||||
}
|
||||
} else {
|
||||
PROJECT_DIR.join(path)
|
||||
}
|
||||
}
|
||||
|
||||
/// App name.
|
||||
pub(crate) static APP_NMAE: LazyLock<&'static str> = LazyLock::new(|| {
|
||||
SHARED_APP_STATE
|
||||
|
|
|
@ -100,8 +100,7 @@ pub(super) fn init<APP: Application + ?Sized>() {
|
|||
flatten_event = config.get_bool("flatten-event").unwrap_or(false);
|
||||
}
|
||||
|
||||
let project_dir = APP::project_dir();
|
||||
let log_dir = project_dir.join(log_dir);
|
||||
let log_dir = super::parse_path(log_dir);
|
||||
if !log_dir.exists() {
|
||||
fs::create_dir(log_dir.as_path()).unwrap_or_else(|err| {
|
||||
let log_dir = log_dir.display();
|
||||
|
|
|
@ -180,13 +180,8 @@ cfg_if::cfg_if! {
|
|||
connect_options = connect_options.read_only(read_only);
|
||||
}
|
||||
|
||||
let database_path = std::path::Path::new(database);
|
||||
let database_file = if database_path.is_relative() {
|
||||
crate::application::PROJECT_DIR.join(database_path)
|
||||
} else {
|
||||
database_path.to_path_buf()
|
||||
};
|
||||
connect_options.filename(database_file)
|
||||
let database_path = crate::application::parse_path(database);
|
||||
connect_options.filename(database_path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "zino-derive"
|
||||
description = "Derived traits for zino."
|
||||
version = "0.22.2"
|
||||
version = "0.22.3"
|
||||
rust-version = "1.75"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
@ -21,5 +21,5 @@ syn = "2.0.77"
|
|||
|
||||
[dependencies.zino-core]
|
||||
path = "../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
features = ["orm"]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "zino-dioxus"
|
||||
description = "Dioxus components for zino."
|
||||
version = "0.7.2"
|
||||
version = "0.7.3"
|
||||
rust-version = "1.75"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
@ -56,4 +56,4 @@ features = [
|
|||
|
||||
[dependencies.zino-core]
|
||||
path = "../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
|
|
|
@ -39,4 +39,4 @@ optional = true
|
|||
|
||||
[dependencies.zino-core]
|
||||
path = "../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "zino-model"
|
||||
description = "Domain models for zino."
|
||||
version = "0.22.2"
|
||||
version = "0.22.3"
|
||||
rust-version = "1.75"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
@ -40,7 +40,7 @@ version = "1.0.209"
|
|||
features = ["derive"]
|
||||
|
||||
[dependencies.sqlx]
|
||||
version = "0.8.1"
|
||||
version = "0.8.2"
|
||||
default-features = false
|
||||
|
||||
[dependencies.strum]
|
||||
|
@ -49,7 +49,7 @@ features = ["derive"]
|
|||
|
||||
[dependencies.zino-core]
|
||||
path = "../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
features = [
|
||||
"jwt",
|
||||
"orm",
|
||||
|
@ -58,4 +58,4 @@ features = [
|
|||
|
||||
[dependencies.zino-derive]
|
||||
path = "../zino-derive"
|
||||
version = "0.22.2"
|
||||
version = "0.22.3"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "zino"
|
||||
description = "Next-generation framework for composable applications in Rust."
|
||||
version = "0.24.2"
|
||||
version = "0.24.3"
|
||||
rust-version = "1.75"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
@ -140,7 +140,7 @@ version = "0.25.2"
|
|||
optional = true
|
||||
|
||||
[dependencies.ntex]
|
||||
version = "2.3.0"
|
||||
version = "2.4.0"
|
||||
optional = true
|
||||
default-features = false
|
||||
features = ["compress", "tokio"]
|
||||
|
@ -189,4 +189,4 @@ optional = true
|
|||
|
||||
[dependencies.zino-core]
|
||||
path = "../zino-core"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
|
|
Loading…
Reference in New Issue