From 6829f1049694c8b24652cdfce1a2e4f32dd0c25b Mon Sep 17 00:00:00 2001 From: Lutetium-Vanadium Date: Fri, 16 Jul 2021 20:34:23 +0530 Subject: [PATCH] Workaround trybuild ignoring optional dependencies as features --- Cargo.toml | 6 ++++-- {requestty-macros => requestty-macro}/Cargo.toml | 2 +- {requestty-macros => requestty-macro}/src/helpers.rs | 0 {requestty-macros => requestty-macro}/src/lib.rs | 0 {requestty-macros => requestty-macro}/src/question.rs | 0 src/lib.rs | 5 +++-- todo.md | 10 ---------- 7 files changed, 8 insertions(+), 15 deletions(-) rename {requestty-macros => requestty-macro}/Cargo.toml (89%) rename {requestty-macros => requestty-macro}/src/helpers.rs (100%) rename {requestty-macros => requestty-macro}/src/lib.rs (100%) rename {requestty-macros => requestty-macro}/src/question.rs (100%) delete mode 100644 todo.md diff --git a/Cargo.toml b/Cargo.toml index 2bed7db..01dec70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,13 +8,13 @@ edition = "2018" members = [ ".", "requestty-ui", - "requestty-macros", + "requestty-macro", ] [dependencies] tempfile = "3" ui = { package = "requestty-ui", path = "./requestty-ui" } -macros = { package = "requestty-macros", path = "./requestty-macros", optional = true } +macro = { package = "requestty-macro", path = "./requestty-macro", optional = true } smallvec = { version = "1.6", optional = true } @@ -32,6 +32,8 @@ fuzzy-matcher = "0.3" # examples/file_auto_complete.rs default = ["crossterm", "smallvec"] crossterm = ["ui/crossterm"] termion = ["ui/termion"] +# Hack to get around trybuild not considering 'optional = true' as features +macros = ["macro"] [package.metadata.docs.rs] all-features = true diff --git a/requestty-macros/Cargo.toml b/requestty-macro/Cargo.toml similarity index 89% rename from requestty-macros/Cargo.toml rename to requestty-macro/Cargo.toml index 71cb2a8..005bac6 100644 --- a/requestty-macros/Cargo.toml +++ b/requestty-macro/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "requestty-macros" +name = "requestty-macro" version = "0.0.1" authors = ["Lutetium Vanadium"] edition = "2018" diff --git a/requestty-macros/src/helpers.rs b/requestty-macro/src/helpers.rs similarity index 100% rename from requestty-macros/src/helpers.rs rename to requestty-macro/src/helpers.rs diff --git a/requestty-macros/src/lib.rs b/requestty-macro/src/lib.rs similarity index 100% rename from requestty-macros/src/lib.rs rename to requestty-macro/src/lib.rs diff --git a/requestty-macros/src/question.rs b/requestty-macro/src/question.rs similarity index 100% rename from requestty-macros/src/question.rs rename to requestty-macro/src/question.rs diff --git a/src/lib.rs b/src/lib.rs index d645fc8..60206db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,5 @@ -//! `requestty` is an easy-to-use collection of interactive cli prompts inspired by [Inquirer.js]. +//! `requestty` (request-tty) is an easy-to-use collection of interactive cli prompts inspired by +//! [Inquirer.js]. //! //! [Inquirer.js]: https://github.com/SBoudrias/Inquirer.js/ //! @@ -214,7 +215,7 @@ use ui::{backend::Backend, events::EventIterator}; /// See also [`prompt_module`](prompt_module!). #[cfg(feature = "macros")] #[cfg_attr(docsrs, doc(cfg(feature = "macros")))] -pub use macros::questions; +pub use r#macro::questions; pub use answer::{Answer, Answers, ExpandItem, ListItem}; pub use prompt_module::PromptModule; diff --git a/todo.md b/todo.md deleted file mode 100644 index ffa277c..0000000 --- a/todo.md +++ /dev/null @@ -1,10 +0,0 @@ -## Required -- docs - -## Would be nice -- support tabs in prompts -- when and message as functions cannot infer correct argument lifetime - - due to hrtb -- vi bindings / custom bindings -- themes -- non-unicode terminal support