Add `taffy_test_helpers` crate (#755)
1[package]
2name = "taffy"
3version = "0.6.3"
4authors = [
5 "Alice Cecile <alice.i.cecile@gmail.com>",
6 "Johnathan Kelley <jkelleyrtp@gmail.com>",
7 "Nico Burns <nico@nicoburns.com>",
8]
9edition = "2021"
10rust-version = "1.65"
11include = ["src/**/*", "examples/**/*", "Cargo.toml", "README.md"]
12description = "A flexible UI layout library "
13repository = "https://github.com/DioxusLabs/taffy"
14keywords = ["cross-platform", "layout", "flexbox", "css-grid", "grid"]
15categories = ["gui"]
16license = "MIT"
17
18[dependencies]
19arrayvec = { version = "0.7", default-features = false }
20document-features = { version = "0.2.7", optional = true }
21num-traits = { version = "0.2", default-features = false }
22serde = { version = "1.0", default-features = false, optional = true, features = [
23 "serde_derive",
24] }
25slotmap = { version = "1.0.6", default-features = false, optional = true }
26grid = { version = "0.15.0", default-features = false, optional = true }
27
28[package.metadata.docs.rs]
29# To test all the documentation related features, run:
30# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc -Zunstable-options -Zrustdoc-scrape-examples --all-features --no-deps --open
31
32all-features = true
33# see https://doc.rust-lang.org/nightly/rustdoc/scraped-examples.html
34cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
35rustdoc-args = ["--cfg", "docsrs"]
36
37[features]
38default = [
39 "std",
40 "taffy_tree",
41 "flexbox",
42 "grid",
43 "block_layout",
44 "content_size",
45]
46#! ## Feature Flags
47#!
48#! ### Algorithms
49
50## Enables the Block layout algorithm. See [`compute_block_layout`](crate::compute_block_layout).
51block_layout = []
52## Enables the Flexbox layout algorithm. See [`compute_flexbox_layout`](crate::compute_flexbox_layout).
53flexbox = []
54## Enables the CSS Grid layout algorithm. See [`compute_grid_layout`](crate::compute_grid_layout).
55grid = ["alloc", "dep:grid"]
56## Causes all algorithms to compute and output a content size for each node
57content_size = []
58
59#! ### Taffy Tree
60
61## Enable the built-in Taffy node tree. See [`TaffyTree`](crate::TaffyTree).
62taffy_tree = ["dep:slotmap"]
63
64#! ### Other
65
66## Add [`serde`] derives to Style structs
67serde = ["dep:serde"]
68## Allow Taffy to depend on the [`Rust Standard Library`](std)
69std = ["num-traits/std", "grid?/std", "serde?/std", "slotmap?/std"]
70## Allow Taffy to depend on the alloc library
71alloc = ["serde?/alloc"]
72## Internal feature for debugging
73debug = ["std"]
74## Internal feature for profiling
75profile = ["std"]
76
77[dev-dependencies]
78serde_json = "1.0.93"
79taffy_test_helpers = { path = "tests/common"}
80
81# Enable default features for tests and examples
82taffy = { path = "." }
83
84[profile.release]
85lto = true
86panic = 'abort'
87
88[[bench]]
89name = "dummy_benchmark"
90path = "benches/dummy_benchmark.rs"
91harness = false
92
93[[example]]
94name = "basic"
95# This causes all the examples to be scraped for documentation, not just the basic example
96doc-scrape-examples = true
97
98[workspace]
99members = [
100 "scripts/gentest",
101 "scripts/format-fixtures",
102 "scripts/import-yoga-tests",
103 "benches", "examples/cosmic_text", "tests/common",
104]