Workaround trybuild ignoring optional dependencies as features

This commit is contained in:
Lutetium-Vanadium 2021-07-16 20:34:23 +05:30
parent 417f0b723d
commit 6829f10496
7 changed files with 8 additions and 15 deletions

View File

@ -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

View File

@ -1,5 +1,5 @@
[package]
name = "requestty-macros"
name = "requestty-macro"
version = "0.0.1"
authors = ["Lutetium Vanadium"]
edition = "2018"

View File

@ -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;

10
todo.md
View File

@ -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