From 59f939e25ce5833955c61e8c58af394c54cf93b8 Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Tue, 29 Sep 2020 12:35:11 -0400 Subject: [PATCH] chore: update v0.45.0 removal notice (#1687) * chore: update deprecation notice * Add deprecation page to sidebar * Replace the use of "deprected" with "removed" --- docs/.vuepress/config.js | 3 +- docs/migrating-to-0.45.0/README.md | 72 ++++++++++++------------ src/config.rs | 3 + starship_module_config_derive/src/lib.rs | 7 ++- 4 files changed, 46 insertions(+), 39 deletions(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 42453a3a..e6628513 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -94,7 +94,8 @@ module.exports = { ["/config/", "Configuration"], ["/advanced-config/", "Advanced Configuration"], ["/faq/", "Frequently Asked Questions"], - ["/presets/", "Presets"] + ["/presets/", "Presets"], + ["/migrating-to-0.45.0/", "Migrating to v0.45.0"] ] }, "/de-DE/": { diff --git a/docs/migrating-to-0.45.0/README.md b/docs/migrating-to-0.45.0/README.md index 3a0ea093..c736125d 100644 --- a/docs/migrating-to-0.45.0/README.md +++ b/docs/migrating-to-0.45.0/README.md @@ -83,7 +83,7 @@ format = "took [$duration]($style)" #### Character -| Deprecated Property | Replacement | +| Removed Property | Replacement | | ----------------------- | ---------------- | | `symbol` | `success_symbol` | | `use_symbol_for_status` | `error_symbol` | @@ -116,9 +116,9 @@ error_symbol = "[✖](bold red) " #### Command Duration -| Deprecated Property | Replacement | -| ------------------- | ----------- | -| `prefix` | `format` | +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | **Changes to the Default Configuration** @@ -130,9 +130,9 @@ error_symbol = "[✖](bold red) " #### Directory -| Deprecated Property | Replacement | -| ------------------- | ----------- | -| `prefix` | `format` | +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | **Changes to the Default Configuration** @@ -144,10 +144,10 @@ error_symbol = "[✖](bold red) " #### Environment Variable -| Deprecated Property | Replacement | -| ------------------- | ----------- | -| `prefix` | `format` | -| `suffix` | `format` | +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | **Changes to the Default Configuration** @@ -160,10 +160,10 @@ error_symbol = "[✖](bold red) " #### Git Commit -| Deprecated Property | Replacement | -| ------------------- | ----------- | -| `prefix` | `format` | -| `suffix` | `format` | +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | **Changes to the Default Configuration** @@ -176,11 +176,11 @@ error_symbol = "[✖](bold red) " #### Git Status -| Deprecated Property | Replacement | -| ------------------- | ----------- | -| `prefix` | `format` | -| `suffix` | `format` | -| `show_sync_count` | `format` | +| Removed Property | Replacement | +| ----------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | **Changes to the Default Configuration** @@ -209,10 +209,10 @@ behind = "⇣${count}" #### Hostname -| Deprecated Property | Replacement | -| ------------------- | ----------- | -| `prefix` | `format` | -| `suffix` | `format` | +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | **Changes to the Default Configuration** @@ -225,11 +225,11 @@ behind = "⇣${count}" #### Singularity -| Deprecated Property | Replacement | -| ------------------- | ----------- | -| `label` | `format` | -| `prefix` | `format` | -| `suffix` | `format` | +| Removed Property | Replacement | +| ---------------- | ----------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | **Changes to the Default Configuration** @@ -242,9 +242,9 @@ behind = "⇣${count}" #### Time -| Deprecated Property | Replacement | -| ------------------- | ------------- | -| `format` | `time_format` | +| Removed Property | Replacement | +| ---------------- | ------------- | +| `format` | `time_format` | **Changes to the Default Configuration** @@ -257,10 +257,10 @@ behind = "⇣${count}" #### Custom Commands -| Deprecated Property | Replacement | -| ------------------- | ----------- | -| `prefix` | `format` | -| `suffix` | `format` | +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | **Changes to the Default Configuration** diff --git a/src/config.rs b/src/config.rs index e6d3a4d4..c781e903 100644 --- a/src/config.rs +++ b/src/config.rs @@ -20,6 +20,9 @@ where /// Load root module config from given Value and fill unset variables with default /// values. fn load(config: &'a Value) -> Self { + if config.get("prompt_order").is_some() { + log::warn!("\"prompt_order\" has been removed in favor of \"format\". For more details, see: https://starship.rs/migrating-to-0.45.0/") + } Self::new().load_config(config) } diff --git a/starship_module_config_derive/src/lib.rs b/starship_module_config_derive/src/lib.rs index b6d11326..4dd0ed7d 100644 --- a/starship_module_config_derive/src/lib.rs +++ b/starship_module_config_derive/src/lib.rs @@ -47,8 +47,11 @@ fn impl_module_config(dinput: DeriveInput) -> proc_macro::TokenStream { fn load_config(&self, config: &'a toml::Value) -> Self { let mut new_module_config = self.clone(); if let toml::Value::Table(config) = config { - if config.get("prefix").is_some() || config.get("suffix").is_some() { - log::warn!("You're using the outdated config format! Migrate your config here: https://starship.rs/migrating-to-0.45.0/") + if config.get("prefix").is_some() { + log::warn!("\"prefix\" has been removed in favor of \"format\". For more details, see: https://starship.rs/migrating-to-0.45.0/") + } + if config.get("suffix").is_some() { + log::warn!("\"suffix\" has been removed in favor of \"format\". For more details, see: https://starship.rs/migrating-to-0.45.0/") } #load_tokens }