chore: include versions of all packages in /info

feat/type-attributes
Tomáš Mládek 2023-07-06 16:44:52 +02:00
parent ea7a5e6f18
commit c8ec3e03cd
6 changed files with 25 additions and 4 deletions

View File

@ -37,6 +37,7 @@ nonempty = "0.6.0"
wasm-bindgen = { version = "0.2", optional = true }
shadow-rs = "0.17"
[build-dependencies]
shadow-rs = "0.17"

3
base/build.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() -> shadow_rs::SdResult<()> {
shadow_rs::new()
}

3
base/src/common.rs Normal file
View File

@ -0,0 +1,3 @@
use shadow_rs::shadow;
shadow!(build);

View File

@ -2,8 +2,9 @@
extern crate lazy_static;
pub mod addressing;
pub mod common;
pub mod constants;
pub mod entry;
pub mod hash;
pub mod error;
pub mod hash;
pub mod lang;

View File

@ -819,7 +819,12 @@ pub async fn get_info(state: web::Data<State>) -> Result<HttpResponse, Error> {
Ok(HttpResponse::Ok().json(json!({
"name": state.config.vault_name,
// "location": &*state.store.path,
"version": build::PKG_VERSION,
"version": format!(
"{} / {} / {}",
upend_base::common::build::PKG_VERSION,
upend_db::common::build::PKG_VERSION,
build::PKG_VERSION
),
"desktop": state.config.desktop_enabled
})))
}
@ -948,7 +953,15 @@ mod tests {
let info: VaultInfo = actix_web::test::call_and_read_body_json(&app, req).await;
assert_eq!(info.name, Some("TEST VAULT".to_string()));
assert_eq!(info.version, format!("{}", build::PKG_VERSION));
assert_eq!(
info.version,
format!(
"{} / {} / {}",
upend_base::common::build::PKG_VERSION,
upend_db::common::build::PKG_VERSION,
build::PKG_VERSION
)
);
assert!(!info.desktop);
}

View File

@ -10,13 +10,13 @@ extern crate lazy_static;
#[macro_use]
mod macros;
pub mod common;
pub mod engine;
pub mod entry;
pub mod hierarchies;
pub mod jobs;
pub mod stores;
mod common;
mod inner;
mod util;