From a47eca3a8a26714be25c08eb87a778eb63ecba0a Mon Sep 17 00:00:00 2001 From: Amos Wenger Date: Tue, 22 Apr 2025 10:00:34 +0200 Subject: [PATCH] Stub out facet-kdl --- Cargo.lock | 14 ++++++++++ Cargo.toml | 1 + facet-kdl/Cargo.toml | 29 +++++++++++++++++++++ facet-kdl/README.md | 56 ++++++++++++++++++++++++++++++++++++++++ facet-kdl/README.md.in | 1 + facet-kdl/src/lib.rs | 4 +++ facet-kdl/tests/basic.rs | 1 + 7 files changed, 106 insertions(+) create mode 100644 facet-kdl/Cargo.toml create mode 100644 facet-kdl/README.md create mode 100644 facet-kdl/README.md.in create mode 100644 facet-kdl/src/lib.rs create mode 100644 facet-kdl/tests/basic.rs diff --git a/Cargo.lock b/Cargo.lock index 2dc99a024..39f4c961e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -236,6 +236,20 @@ dependencies = [ "owo-colors", ] +[[package]] +name = "facet-kdl" +version = "0.14.0" +dependencies = [ + "ariadne", + "facet", + "facet-core", + "facet-reflect", + "facet-testhelpers", + "log", + "num-traits", + "owo-colors", +] + [[package]] name = "facet-msgpack" version = "0.14.0" diff --git a/Cargo.toml b/Cargo.toml index 7fbb32320..8cc0c5fd2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ members = [ "facet-msgpack", "facet-pretty", "facet-toml", + "facet-kdl", "facet-urlencoded", "facet-yaml", ] diff --git a/facet-kdl/Cargo.toml b/facet-kdl/Cargo.toml new file mode 100644 index 000000000..4e75ff1c9 --- /dev/null +++ b/facet-kdl/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "facet-kdl" +version.workspace = true +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true +description = "KDL serialization and deserialization for Facet types" +keywords = ["kdl", "serialization", "deserialization", "reflection", "facet"] +categories = ["encoding", "parsing", "data-structures"] + +[features] +std = ["alloc", "facet-core/std", "facet-reflect/std", "num-traits/std"] +alloc = ["facet-core/alloc", "facet-reflect/alloc"] +rich-diagnostics = ["dep:ariadne", "std"] +default = ["std", "rich-diagnostics"] + +[dependencies] +ariadne = { version = "=0.5.1", optional = true } +log = "0.4.27" +num-traits = { version = "0.2.19", default-features = false } +facet-core = { version = "0.11.0", path = "../facet-core", default-features = false } +facet-reflect = { version = "0.10.4", path = "../facet-reflect", default-features = false } +owo-colors = "4.2.0" + +[dev-dependencies] +facet = { path = "../facet" } +facet-testhelpers = { path = "../facet-testhelpers" } diff --git a/facet-kdl/README.md b/facet-kdl/README.md new file mode 100644 index 000000000..3858173cf --- /dev/null +++ b/facet-kdl/README.md @@ -0,0 +1,56 @@ +

+ + + + + Facet logo - a reflection library for Rust + +

+ +[![Coverage Status](https://coveralls.io/repos/github/facet-rs/facet/badge.svg?branch=main)](https://coveralls.io/github/facet-rs/facet?branch=main) +[![free of syn](https://img.shields.io/badge/free%20of-syn-hotpink)](https://github.com/fasterthanlime/free-of-syn) +[![crates.io](https://img.shields.io/crates/v/facet-kdl.svg)](https://crates.io/crates/facet-kdl) +[![documentation](https://docs.rs/facet-kdl/badge.svg)](https://docs.rs/facet-kdl) +[![MIT/Apache-2.0 licensed](https://img.shields.io/crates/l/facet-kdl.svg)](./LICENSE) + +_Logo by [Misiasart](https://misiasart.com/)_ + +Thanks to all individual and corporate sponsors, without whom this work could not exist: + +

+ + +Ko-fi + + + + +GitHub Sponsors + + + + +Patreon + + + + +Zed + + + + +built with blacksmith + +

+ +Provides KDL serialization and deserialization for Facet types (wip) + +## License + +Licensed under either of: + +- Apache License, Version 2.0 ([LICENSE-APACHE](https://github.com/facet-rs/facet/blob/main/LICENSE-APACHE) or ) +- MIT license ([LICENSE-MIT](https://github.com/facet-rs/facet/blob/main/LICENSE-MIT) or ) + +at your option. diff --git a/facet-kdl/README.md.in b/facet-kdl/README.md.in new file mode 100644 index 000000000..9a3d7e23e --- /dev/null +++ b/facet-kdl/README.md.in @@ -0,0 +1 @@ +Provides KDL serialization and deserialization for Facet types (wip) diff --git a/facet-kdl/src/lib.rs b/facet-kdl/src/lib.rs new file mode 100644 index 000000000..95083951f --- /dev/null +++ b/facet-kdl/src/lib.rs @@ -0,0 +1,4 @@ +#![warn(missing_docs)] +#![doc = include_str!("../README.md")] + +// cf. facet-toml/facet-json for examples diff --git a/facet-kdl/tests/basic.rs b/facet-kdl/tests/basic.rs new file mode 100644 index 000000000..6f3887163 --- /dev/null +++ b/facet-kdl/tests/basic.rs @@ -0,0 +1 @@ +// Basic tests go here