From 65c162bf90f23290b707b12e4b6dcf8f066778d2 Mon Sep 17 00:00:00 2001 From: 4t145 Date: Mon, 8 Apr 2024 17:28:15 +0800 Subject: [PATCH] global: Fix some build warning (#697) * fix build warnings * revert path changes * fix workspace typo --- Cargo.toml | 7 +++---- backend/middlewares/event/src/event_initializer.rs | 2 +- backend/middlewares/flow/Cargo.toml | 2 +- backend/middlewares/flow/src/event.rs | 2 +- backend/middlewares/flow/src/flow_initializer.rs | 2 +- backend/middlewares/schedule/Cargo.toml | 2 +- backend/middlewares/schedule/src/schedule_initializer.rs | 2 +- backend/services/bios-all/Cargo.toml | 2 +- backend/services/spacegate/Cargo.toml | 3 +-- .../spi/spi-conf/tests/spi_conf_nacos_compatible_test.rs | 2 +- backend/spi/spi-log/Cargo.toml | 1 - backend/spi/spi-log/src/event.rs | 2 +- backend/spi/spi-plugin/Cargo.toml | 2 +- backend/spi/spi-search/Cargo.toml | 3 +-- backend/spi/spi-search/src/event.rs | 2 +- backend/spi/spi-stats/Cargo.toml | 2 +- backend/supports/iam/Cargo.toml | 3 +-- backend/supports/iam/src/iam_initializer.rs | 8 ++++---- frontend/enhance-wasm/Cargo.toml | 3 ++- frontend/sdks/invoke/Cargo.toml | 2 +- 20 files changed, 25 insertions(+), 29 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cd3adc98c..9537f174e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ members = [ "frontend/sdks/*", "frontend/clients/*", ] - +resolver = "2" [workspace.package] version = "0.1.0" authors = [ @@ -61,9 +61,9 @@ run_script = { version = "0.10" } testcontainers-modules = { version = "0.3", features = ["redis"] } strum = { version = "0.26", features = ["derive"] } # tardis -# tardis = { version = "0.1.0-rc.10" } +tardis = { version = "0.1.0-rc.11" } # tardis = { path = "../tardis/tardis" } -tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "191f3ec" } +# tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "191f3ec" } #spacegate # spacegate-kernel = { git = "https://github.com/ideal-world/spacegate.git", rev = "f37a81a", features = [ @@ -81,7 +81,6 @@ spacegate-shell = { git = "https://github.com/ideal-world/spacegate.git", branch "cache", "k8s", "ext-redis", - "ext-axum", ] } spacegate-plugin = { git = "https://github.com/ideal-world/spacegate.git", branch = "master" } diff --git a/backend/middlewares/event/src/event_initializer.rs b/backend/middlewares/event/src/event_initializer.rs index 2aa8d6605..5d7d677df 100644 --- a/backend/middlewares/event/src/event_initializer.rs +++ b/backend/middlewares/event/src/event_initializer.rs @@ -126,7 +126,7 @@ async fn init_log_ws_client() -> TardisWSClient { let conf = funs.conf::(); let mut event_conf = conf.log_event.clone(); if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let default_avatar = event_conf.avatars[0].clone(); set_default_log_avatar(default_avatar); diff --git a/backend/middlewares/flow/Cargo.toml b/backend/middlewares/flow/Cargo.toml index 23c54f7ec..32497159b 100644 --- a/backend/middlewares/flow/Cargo.toml +++ b/backend/middlewares/flow/Cargo.toml @@ -22,7 +22,7 @@ async-trait.workspace = true async-recursion.workspace = true lazy_static.workspace = true itertools.workspace = true -tardis = { workspace = true, features = ["reldb-postgres", "web-client", "build-info"] } +tardis = { workspace = true, features = ["reldb-postgres", "web-client"] } bios-basic = { path = "../../basic", features = ["default"] } bios-sdk-invoke = { path = "../../../frontend/sdks/invoke", features = ["default"] } [dev-dependencies] diff --git a/backend/middlewares/flow/src/event.rs b/backend/middlewares/flow/src/event.rs index 4c3874187..15cd301d7 100644 --- a/backend/middlewares/flow/src/event.rs +++ b/backend/middlewares/flow/src/event.rs @@ -21,7 +21,7 @@ pub async fn start_flow_event_service(config: &EventTopicConfig) -> TardisResult let client = event_client::EventClient::new(config.base_url.as_str(), &funs); let mut event_conf = config.clone(); if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let resp = client.register(&event_conf.into()).await?; let ws_client = TardisFuns::ws_client(&resp.ws_addr, |message| async move { diff --git a/backend/middlewares/flow/src/flow_initializer.rs b/backend/middlewares/flow/src/flow_initializer.rs index 474bfbb19..3a6c3b8d9 100644 --- a/backend/middlewares/flow/src/flow_initializer.rs +++ b/backend/middlewares/flow/src/flow_initializer.rs @@ -887,7 +887,7 @@ async fn init_ws_flow_client() -> Option { return None; } if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let default_avatar = event_conf.avatars[0].clone(); set_default_flow_avatar(default_avatar); diff --git a/backend/middlewares/schedule/Cargo.toml b/backend/middlewares/schedule/Cargo.toml index 09140ea82..dcc2daba5 100644 --- a/backend/middlewares/schedule/Cargo.toml +++ b/backend/middlewares/schedule/Cargo.toml @@ -32,7 +32,7 @@ git = "https://github.com/4t145/tokio-cron-scheduler.git" branch = "time-local" features = ["cron_local"] [dev-dependencies] -tardis = { workspace = true, features = ["test", "ws-client", "build-info"] } +tardis = { workspace = true, features = ["test", "ws-client"] } bios-basic = { path = "../../basic", features = ["default", "test"] } bios-spi-kv = { path = "../../spi/spi-kv" } bios-spi-log = { path = "../../spi/spi-log" } diff --git a/backend/middlewares/schedule/src/schedule_initializer.rs b/backend/middlewares/schedule/src/schedule_initializer.rs index 4872d3a8d..9ab4ffeeb 100644 --- a/backend/middlewares/schedule/src/schedule_initializer.rs +++ b/backend/middlewares/schedule/src/schedule_initializer.rs @@ -37,7 +37,7 @@ async fn init_ws_client() -> TardisWSClient { let conf = funs.conf::(); let mut event_conf = conf.event.clone(); if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let default_avatar = event_conf.avatars[0].clone(); set_default_avatar(default_avatar); diff --git a/backend/services/bios-all/Cargo.toml b/backend/services/bios-all/Cargo.toml index ba5402d35..bd84b33e4 100644 --- a/backend/services/bios-all/Cargo.toml +++ b/backend/services/bios-all/Cargo.toml @@ -12,7 +12,7 @@ publish.workspace = true [dependencies] serde.workspace = true -tardis = { workspace = true, features = ["web-server", "conf-remote", "cluster", "k8s", "build-info"] } +tardis = { workspace = true, features = ["web-server", "conf-remote", "cluster", "k8s"] } bios-iam = { path = "../../supports/iam", features = ["spi_search", "spi_kv"] } bios-auth = { path = "../../supports/auth", features = ["web-server"] } bios-reach = { path = "../../supports/reach" } diff --git a/backend/services/spacegate/Cargo.toml b/backend/services/spacegate/Cargo.toml index 2528daf95..4a5b3c60b 100644 --- a/backend/services/spacegate/Cargo.toml +++ b/backend/services/spacegate/Cargo.toml @@ -19,10 +19,9 @@ spacegate-shell = { workspace = true, features = [ "k8s", "plugin-all", "ext-redis", - "ext-axum", "cache", ] } -tardis = { workerspace = true } +tardis = { workspace = true } spacegate-plugins = { path = "../../gateways/spacegate-plugins" } envy = "0.4" [dev-dependencies] diff --git a/backend/spi/spi-conf/tests/spi_conf_nacos_compatible_test.rs b/backend/spi/spi-conf/tests/spi_conf_nacos_compatible_test.rs index c6c891f07..2286ce516 100644 --- a/backend/spi/spi-conf/tests/spi_conf_nacos_compatible_test.rs +++ b/backend/spi/spi-conf/tests/spi_conf_nacos_compatible_test.rs @@ -5,7 +5,7 @@ use bios_spi_conf::{ conf_constants::DOMAIN_CODE, dto::conf_auth_dto::{RegisterRequest, RegisterResponse}, }; -use tardis::web::reqwest::header::HeaderName; +use tardis::web::reqwest::{self, header::HeaderName}; use tardis::{ basic::{dto::TardisContext, field::TrimString, result::TardisResult}, log, diff --git a/backend/spi/spi-log/Cargo.toml b/backend/spi/spi-log/Cargo.toml index fca2bfdab..9c7c58f2f 100644 --- a/backend/spi/spi-log/Cargo.toml +++ b/backend/spi/spi-log/Cargo.toml @@ -23,7 +23,6 @@ serde.workspace = true tardis = { workspace = true, features = [ "reldb-postgres", "web-server", - "build-info" ] } bios-basic = { path = "../../basic", features = ["default"] } bios-sdk-invoke = { path = "../../../frontend/sdks/invoke", features = [ diff --git a/backend/spi/spi-log/src/event.rs b/backend/spi/spi-log/src/event.rs index 0472ccd28..990ce3750 100644 --- a/backend/spi/spi-log/src/event.rs +++ b/backend/spi/spi-log/src/event.rs @@ -17,7 +17,7 @@ pub async fn start_log_event_service(config: &EventTopicConfig) -> TardisResult< let client = event_client::EventClient::new(config.base_url.as_str(), &funs); let mut event_conf = config.clone(); if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let resp = client.register(&event_conf.into()).await?; let ws_client = TardisFuns::ws_client(&resp.ws_addr, |message| async move { diff --git a/backend/spi/spi-plugin/Cargo.toml b/backend/spi/spi-plugin/Cargo.toml index cdc48392e..6d5ad7e16 100644 --- a/backend/spi/spi-plugin/Cargo.toml +++ b/backend/spi/spi-plugin/Cargo.toml @@ -24,7 +24,7 @@ async-trait.workspace = true tardis = { workspace = true, features = ["reldb-postgres", "web-server"] } bios-basic = { path = "../../basic", features = ["default"] } bios-sdk-invoke = { path = "../../../frontend/sdks/invoke", features = ["default"] } -strum = { workerspace = true, features = ["derive"] } +strum = { workspace = true, features = ["derive"] } [dev-dependencies] tardis = { workspace = true, features = ["test", "ws-client"] } diff --git a/backend/spi/spi-search/Cargo.toml b/backend/spi/spi-search/Cargo.toml index 3b1e1bceb..10e3017a7 100644 --- a/backend/spi/spi-search/Cargo.toml +++ b/backend/spi/spi-search/Cargo.toml @@ -26,10 +26,9 @@ tardis = { workspace = true, features = [ "web-server", "web-client", "openapi-rapidoc", - "build-info" ] } bios-basic = { path = "../../basic", features = ["default"] } -strum = { workerspace = true, features = ["derive"] } +strum = { workspace = true, features = ["derive"] } pinyin = { version = "0.10" } bios-sdk-invoke = { path = "../../../frontend/sdks/invoke", features = [ "event", diff --git a/backend/spi/spi-search/src/event.rs b/backend/spi/spi-search/src/event.rs index 964a2b883..c55c1b8ca 100644 --- a/backend/spi/spi-search/src/event.rs +++ b/backend/spi/spi-search/src/event.rs @@ -26,7 +26,7 @@ pub async fn start_search_event_service(config: &EventTopicConfig) -> TardisResu let client = event_client::EventClient::new(config.base_url.as_str(), &funs); let mut event_conf = config.clone(); if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let resp = client.register(&event_conf.into()).await?; let ws_client = TardisFuns::ws_client(&resp.ws_addr, |message| async move { diff --git a/backend/spi/spi-stats/Cargo.toml b/backend/spi/spi-stats/Cargo.toml index 8d900549b..cad3aee71 100644 --- a/backend/spi/spi-stats/Cargo.toml +++ b/backend/spi/spi-stats/Cargo.toml @@ -25,7 +25,7 @@ lazy_static.workspace = true itertools.workspace = true tardis = { workspace = true, features = ["reldb-postgres", "web-server"] } serde_json = { workspace = true, features = ["preserve_order"] } -strum = { workerspace = true, features = ["derive"] } +strum = { workspace = true, features = ["derive"] } [dev-dependencies] tardis = { workspace = true, features = ["test"] } diff --git a/backend/supports/iam/Cargo.toml b/backend/supports/iam/Cargo.toml index 4e1a9e721..8c6b4dbb3 100644 --- a/backend/supports/iam/Cargo.toml +++ b/backend/supports/iam/Cargo.toml @@ -35,7 +35,6 @@ tardis = { workspace = true, features = [ "web-client", "mail", "k8s", - "build-info" ] } bios-basic = { path = "../../basic", features = ["default", "with-mq"] } bios-sdk-invoke = { path = "../../../frontend/sdks/invoke", features = ["default", "event"] } @@ -46,8 +45,8 @@ tokio-util = { version = "0.7", optional = true } ldap3 = { version = "0.11", optional = true } # todo Wait for tardis field to upgrade during removal nanoid = { version = "0.4" } -strum = { workerspace = true, features = ["derive"] } +strum = { workspace = true, features = ["derive"] } [dev-dependencies] tardis = { workspace = true, features = ["test"] } bios-basic = { path = "../../basic", features = ["default", "test"] } diff --git a/backend/supports/iam/src/iam_initializer.rs b/backend/supports/iam/src/iam_initializer.rs index 506cd2700..565fe1579 100644 --- a/backend/supports/iam/src/iam_initializer.rs +++ b/backend/supports/iam/src/iam_initializer.rs @@ -743,7 +743,7 @@ async fn init_ws_log_client() -> Option { return None; } if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let default_avatar = event_conf.avatars[0].clone(); set_default_log_avatar(default_avatar); @@ -782,7 +782,7 @@ async fn init_ws_search_client() -> Option { return None; } if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let default_avatar = event_conf.avatars[0].clone(); set_default_search_avatar(default_avatar); @@ -821,7 +821,7 @@ async fn init_ws_iam_send_event_client() -> Option { return None; } if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let default_avatar = event_conf.avatars[0].clone(); set_default_iam_send_avatar(default_avatar); @@ -853,7 +853,7 @@ pub async fn init_ws_iam_event_client() -> TardisResult<()> { let conf = funs.conf::(); let mut event_conf = conf.iam_event_bus.clone(); if event_conf.avatars.is_empty() { - event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, tardis::pkg!())) + event_conf.avatars.push(format!("{}/{}", event_conf.topic_code, env!("CARGO_PKG_NAME"))) } let client = bios_sdk_invoke::clients::event_client::EventClient::new(&event_conf.base_url, &funs); let addr = loop { diff --git a/frontend/enhance-wasm/Cargo.toml b/frontend/enhance-wasm/Cargo.toml index befea14e0..a96b0dd0c 100644 --- a/frontend/enhance-wasm/Cargo.toml +++ b/frontend/enhance-wasm/Cargo.toml @@ -9,7 +9,6 @@ license.workspace = true edition.workspace = true readme.workspace = true publish.workspace = true - [lib] name = "bios_enhance_wasm" path = "src/lib.rs" @@ -33,6 +32,8 @@ wasm-bindgen-futures = { version = "0" } serde-wasm-bindgen = { version = "0" } js-sys = { version = "0" } web-sys = { version = "0", features = [ + 'MessageEvent', + 'Event', 'Headers', 'Request', 'RequestInit', diff --git a/frontend/sdks/invoke/Cargo.toml b/frontend/sdks/invoke/Cargo.toml index 1b41b2080..3e0d21865 100644 --- a/frontend/sdks/invoke/Cargo.toml +++ b/frontend/sdks/invoke/Cargo.toml @@ -41,4 +41,4 @@ simple-invoke-client-macro = { path = "../simple-invoke-client-macro" } [[test]] name = "test_macros" -features = ["macro"] +required-features = ["macro"]