ratatui/Cargo.toml

336 lines
8.3 KiB
TOML
Raw Permalink Normal View History

2016-10-09 17:46:53 +00:00
[package]
name = "ratatui"
version = "0.26.2" # crate version
authors = ["Florian Dehau <work@fdehau.com>", "The Ratatui Developers"]
description = "A library that's all about cooking up terminal user interfaces"
documentation = "https://docs.rs/ratatui/latest/ratatui/"
repository = "https://github.com/ratatui-org/ratatui"
homepage = "https://ratatui.rs"
keywords = ["tui", "terminal", "dashboard"]
categories = ["command-line-interface"]
2021-01-01 13:35:07 +00:00
readme = "README.md"
2016-11-08 09:29:42 +00:00
license = "MIT"
exclude = [
"assets/*",
".github",
"Makefile.toml",
"CONTRIBUTING.md",
"*.log",
"tags",
]
autoexamples = true
edition = "2021"
rust-version = "1.74.0"
2016-10-09 17:46:53 +00:00
2017-05-21 12:07:44 +00:00
[badges]
2016-10-09 17:46:53 +00:00
[dependencies]
bitflags = "2.3"
2018-09-04 20:00:45 +00:00
cassowary = "0.3"
compact_str = "0.7.1"
crossterm = { version = "0.27", optional = true }
document-features = { version = "0.2.7", optional = true }
itertools = "0.12"
lru = "0.12.0"
paste = "1.0.2"
serde = { version = "1", optional = true, features = ["derive"] }
stability = "0.2.0"
strum = { version = "0.26", features = ["derive"] }
termion = { version = "3.0", optional = true }
termwiz = { version = "0.22.0", optional = true }
time = { version = "0.3.11", optional = true, features = ["local-offset"] }
unicode-segmentation = "1.10"
unicode-truncate = "1"
unicode-width = "0.1"
2019-05-15 17:33:11 +00:00
2016-10-12 17:43:39 +00:00
[dev-dependencies]
anyhow = "1.0.71"
argh = "0.1.12"
better-panic = "0.3.0"
cargo-husky = { version = "1.5.0", default-features = false, features = [
"user-hooks",
] }
color-eyre = "0.6.2"
criterion = { version = "0.5.1", features = ["html_reports"] }
derive_builder = "0.20.0"
fakeit = "1.1"
font8x8 = "0.3.1"
indoc = "2"
palette = "0.7.3"
pretty_assertions = "1.4.0"
rand = "0.8.5"
rand_chacha = "0.3.1"
chore(deps): update rstest requirement from 0.18.2 to 0.19.0 (#1031) Updates the requirements on [rstest](https://github.com/la10736/rstest) to permit the latest version. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/la10736/rstest/releases">rstest's releases</a>.</em></p> <blockquote> <p>Introduce MSRV and minor fixes</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/la10736/rstest/blob/master/CHANGELOG.md">rstest's changelog</a>.</em></p> <blockquote> <h2>[0.19.0] 2024/4/9</h2> <h3>Changed</h3> <ul> <li>Defined <code>rust-version</code> for each crate (see <a href="https://redirect.github.com/la10736/rstest/issues/227">#227</a>)</li> </ul> <h3>Fixed</h3> <ul> <li> <p><code>#[once]</code> fixtures now require the returned type to be <a href="https://doc.rust-lang.org/std/marker/trait.Sync.html"><code>Sync</code></a> to prevent UB when tests are executed in parallel. (see <a href="https://redirect.github.com/la10736/rstest/issues/235">#235</a> for more details)</p> </li> <li> <p><code>#[future(awt)]</code> and <code>#[awt]</code> now properly handle mutable (<code>mut</code>) parameters by treating futures as immutable and treating the awaited rebinding as mutable.</p> </li> </ul> <h2>[0.18.2] 2023/8/13</h2> <h3>Changed</h3> <ul> <li>Now <code>#[files]</code> accept also parent folders (see <a href="https://redirect.github.com/la10736/rstest/issues/205">#205</a> for more details).</li> </ul> <h2>[0.18.1] 2023/7/5</h2> <h3>Fixed</h3> <ul> <li>Wrong doc test</li> <li>Docs</li> </ul> <h2>[0.18.0] 2023/7/4</h2> <h3>Add</h3> <ul> <li>Add support for <code>RSTEST_TIMEOUT</code> environment variable to define a max timeout for each function (see <a href="https://redirect.github.com/la10736/rstest/issues/190">#190</a> for details). Thanks to <a href="https://github.com/aviramha"><code>@​aviramha</code></a> for idea and PR</li> <li><code>#[files(&quot;glob path&quot;)]</code> attribute to generate tests based on files that satisfy the given glob path (see <a href="https://redirect.github.com/la10736/rstest/issues/163">#163</a> for details).</li> </ul> <h3>Changed</h3> <ul> <li>Switch to <code>syn</code> 2.0 and edition 2021 : minimal Rust version now is 1.56.0 both for <code>rstest</code> and <code>rstest_reuse</code> (see <a href="https://redirect.github.com/la10736/rstest/issues/187">#187</a>)</li> </ul> <h3>Fixed</h3> <ul> <li>Fixed wired behavior on extraction <code>#[awt]</code> function attrs (See <a href="https://redirect.github.com/la10736/rstest/issues/189">#189</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/la10736/rstest/commit/3ffd682568b49bcd77bc69742da0fc59c1e3ea37"><code>3ffd682</code></a> Fix license links</li> <li><a href="https://github.com/la10736/rstest/commit/36ab06d68eff527fa325ce5464f378001ac7a161"><code>36ab06d</code></a> Fix license link</li> <li><a href="https://github.com/la10736/rstest/commit/941d8ac7ae08ddec7a184f219e6449e065679732"><code>941d8ac</code></a> Update changelog</li> <li><a href="https://github.com/la10736/rstest/commit/cdff674d16521d71f8aa2a4bb52ad934540ad692"><code>cdff674</code></a> Bump version</li> <li><a href="https://github.com/la10736/rstest/commit/e0624fe19846ead048135dd1f34faa71319e0748"><code>e0624fe</code></a> Fix clippy warning</li> <li><a href="https://github.com/la10736/rstest/commit/f7b4b57922e0dd671c793acab424b6bf858737a4"><code>f7b4b57</code></a> Shutup warning on nightly (tests)</li> <li><a href="https://github.com/la10736/rstest/commit/49a7d3816e51ca9137a8df8985e5abf21548add9"><code>49a7d38</code></a> Shutup warning in night</li> <li><a href="https://github.com/la10736/rstest/commit/b58ce22ef1cd1a24e78f8ce31b69cf43a3ddf6a3"><code>b58ce22</code></a> Set resolver in virtual manifest</li> <li><a href="https://github.com/la10736/rstest/commit/3c2fb9c33c0d6fbc7b173f9e9477cea60e3fd59a"><code>3c2fb9c</code></a> Properly handle mutability for awaited futures (<a href="https://redirect.github.com/la10736/rstest/issues/239">#239</a>)</li> <li><a href="https://github.com/la10736/rstest/commit/61a7007f666803138b2146a41804a375b3bb12cd"><code>61a7007</code></a> We're not interested about msrv for tests</li> <li>Additional commits viewable in <a href="https://github.com/la10736/rstest/compare/v0.18.2...v0.19.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 15:55:45 +00:00
rstest = "0.19.0"
serde_json = "1.0.109"
[lints.rust]
unsafe_code = "forbid"
[lints.clippy]
cargo = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
wildcard_imports = "allow"
# nursery or restricted
as_underscore = "warn"
deref_by_slicing = "warn"
else_if_without_else = "warn"
empty_line_after_doc_comments = "warn"
equatable_if_let = "warn"
fn_to_numeric_cast_any = "warn"
format_push_string = "warn"
map_err_ignore = "warn"
missing_const_for_fn = "warn"
mixed_read_write_in_expression = "warn"
mod_module_files = "warn"
needless_raw_strings = "warn"
redundant_type_annotations = "warn"
rest_pat_in_fully_bound_structs = "warn"
string_lit_chars_any = "warn"
string_to_string = "warn"
2024-02-27 11:54:00 +00:00
use_self = "warn"
[features]
#! The crate provides a set of optional features that can be enabled in your `cargo.toml` file.
#!
## By default, we enable the crossterm backend as this is a reasonable choice for most applications
## as it is supported on Linux/Mac/Windows systems. We also enable the `underline-color` feature
## which allows you to set the underline color of text.
default = ["crossterm", "underline-color"]
#! Generally an application will only use one backend, so you should only enable one of the following features:
## enables the [`CrosstermBackend`] backend and adds a dependency on the [Crossterm crate].
crossterm = ["dep:crossterm"]
## enables the [`TermionBackend`] backend and adds a dependency on the [Termion crate].
termion = ["dep:termion"]
## enables the [`TermwizBackend`] backend and adds a dependency on the [Termwiz crate].
termwiz = ["dep:termwiz"]
#! The following optional features are available for all backends:
## enables serialization and deserialization of style and color types using the [Serde crate].
## This is useful if you want to save themes to a file.
serde = ["dep:serde", "bitflags/serde", "compact_str/serde"]
## enables the [`border!`] macro.
macros = []
## enables all widgets.
all-widgets = ["widget-calendar"]
#! Widgets that add dependencies are gated behind feature flags to prevent unused transitive
#! dependencies. The available features are:
## enables the [`calendar`] widget module and adds a dependency on the [Time crate].
widget-calendar = ["dep:time"]
#! Underline color is only supported by the [`CrosstermBackend`] backend, and is not supported
#! on Windows 7.
## enables the backend code that sets the underline color.
underline-color = ["dep:crossterm"]
#! The following features are unstable and may change in the future:
## Enable all unstable features.
feat: add WidgetRef and StatefulWidgetRef traits (#903) The Widget trait consumes self, which makes it impossible to use in a boxed context. Previously we implemented the Widget trait for &T, but this was not enough to render a boxed widget. We now have a new trait called `WidgetRef` that allows rendering a widget by reference. This trait is useful when you want to store a reference to one or more widgets and render them later. Additionaly this makes it possible to render boxed widgets where the type is not known at compile time (e.g. in a composite layout with multiple panes of different types). This change also adds a new trait called `StatefulWidgetRef` which is the stateful equivalent of `WidgetRef`. Both new traits are gated behind the `unstable-widget-ref` feature flag as we may change the exact name / approach a little on this based on further discussion. Blanket implementation of `Widget` for `&W` where `W` implements `WidgetRef` and `StatefulWidget` for `&W` where `W` implements `StatefulWidgetRef` is provided. This allows you to render a widget by reference and a stateful widget by reference. A blanket implementation of `WidgetRef` for `Option<W>` where `W` implements `WidgetRef` is provided. This makes it easier to render child widgets that are optional without the boilerplate of unwrapping the option. Previously several widgets implemented this manually. This commits expands the pattern to apply to all widgets. ```rust struct Parent { child: Option<Child>, } impl WidgetRef for Parent { fn render_ref(&self, area: Rect, buf: &mut Buffer) { self.child.render_ref(area, buf); } } ``` ```rust let widgets: Vec<Box<dyn WidgetRef>> = vec![Box::new(Greeting), Box::new(Farewell)]; for widget in widgets { widget.render_ref(buf.area, &mut buf); } assert_eq!(buf, Buffer::with_lines(["Hello Goodbye"])); ```
2024-02-02 08:02:16 +00:00
unstable = ["unstable-rendered-line-info", "unstable-widget-ref"]
## Enables the [`Paragraph::line_count`](crate::widgets::Paragraph::line_count)
## [`Paragraph::line_width`](crate::widgets::Paragraph::line_width) methods
## which are experimental and may change in the future.
## See [Issue 293](https://github.com/ratatui-org/ratatui/issues/293) for more details.
unstable-rendered-line-info = []
feat: add WidgetRef and StatefulWidgetRef traits (#903) The Widget trait consumes self, which makes it impossible to use in a boxed context. Previously we implemented the Widget trait for &T, but this was not enough to render a boxed widget. We now have a new trait called `WidgetRef` that allows rendering a widget by reference. This trait is useful when you want to store a reference to one or more widgets and render them later. Additionaly this makes it possible to render boxed widgets where the type is not known at compile time (e.g. in a composite layout with multiple panes of different types). This change also adds a new trait called `StatefulWidgetRef` which is the stateful equivalent of `WidgetRef`. Both new traits are gated behind the `unstable-widget-ref` feature flag as we may change the exact name / approach a little on this based on further discussion. Blanket implementation of `Widget` for `&W` where `W` implements `WidgetRef` and `StatefulWidget` for `&W` where `W` implements `StatefulWidgetRef` is provided. This allows you to render a widget by reference and a stateful widget by reference. A blanket implementation of `WidgetRef` for `Option<W>` where `W` implements `WidgetRef` is provided. This makes it easier to render child widgets that are optional without the boilerplate of unwrapping the option. Previously several widgets implemented this manually. This commits expands the pattern to apply to all widgets. ```rust struct Parent { child: Option<Child>, } impl WidgetRef for Parent { fn render_ref(&self, area: Rect, buf: &mut Buffer) { self.child.render_ref(area, buf); } } ``` ```rust let widgets: Vec<Box<dyn WidgetRef>> = vec![Box::new(Greeting), Box::new(Farewell)]; for widget in widgets { widget.render_ref(buf.area, &mut buf); } assert_eq!(buf, Buffer::with_lines(["Hello Goodbye"])); ```
2024-02-02 08:02:16 +00:00
## Enables the `WidgetRef` and `StatefulWidgetRef` traits which are experimental and may change in
## the future.
unstable-widget-ref = []
[package.metadata.docs.rs]
all-features = true
# see https://doc.rust-lang.org/nightly/rustdoc/scraped-examples.html
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
rustdoc-args = ["--cfg", "docsrs"]
2023-09-02 02:57:48 +00:00
[[bench]]
name = "barchart"
harness = false
[[bench]]
name = "block"
harness = false
[[bench]]
name = "line"
harness = false
[[bench]]
2023-09-02 02:57:48 +00:00
name = "list"
harness = false
[lib]
bench = false
[[bench]]
2023-09-02 02:57:48 +00:00
name = "paragraph"
harness = false
[[bench]]
2023-09-02 02:57:48 +00:00
name = "sparkline"
harness = false
[[example]]
2021-11-11 14:56:37 +00:00
name = "barchart"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "block"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "canvas"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "calendar"
required-features = ["crossterm", "widget-calendar"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "chart"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "colors"
required-features = ["crossterm"]
# this example is a bit verbose, so we don't want to include it in the docs
doc-scrape-examples = false
[[example]]
name = "colors_rgb"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "custom_widget"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "demo"
# this runs for all of the terminal backends, so it can't be built using --all-features or scraped
doc-scrape-examples = false
2021-11-11 14:56:37 +00:00
[[example]]
name = "demo2"
required-features = ["crossterm", "widget-calendar"]
doc-scrape-examples = true
[[example]]
name = "docsrs"
required-features = ["crossterm"]
doc-scrape-examples = false
2021-11-11 14:56:37 +00:00
[[example]]
name = "gauge"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "hello_world"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "layout"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "constraints"
required-features = ["crossterm"]
doc-scrape-examples = false
[[example]]
name = "flex"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "constraint-explorer"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "list"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "modifiers"
required-features = ["crossterm"]
# this example is a bit verbose, so we don't want to include it in the docs
doc-scrape-examples = false
[[example]]
name = "panic"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "paragraph"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "popup"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "ratatui-logo"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "scrollbar"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "sparkline"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "table"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "tabs"
required-features = ["crossterm"]
doc-scrape-examples = true
2021-11-11 14:56:37 +00:00
[[example]]
name = "user_input"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "inline"
required-features = ["crossterm"]
doc-scrape-examples = true
[[test]]
name = "state_serde"
required-features = ["serde"]