diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-11 01:51:35 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-11 01:51:35 +0800 |
| commit | 9245799135458d9afd5e779b6d061cee0962d585 (patch) | |
| tree | 1ed86601fd566ea4373fa34dd16e5c8a798707ac | |
| parent | fe2f3405f518e5ad34fc6f6e409fdfafbb10e8d9 (diff) | |
feat: add mingling-picker and mingling-picker-macros crates
| -rw-r--r-- | CONTRIBUTING.md | 30 | ||||
| -rw-r--r-- | Cargo.lock | 44 | ||||
| -rw-r--r-- | Cargo.toml | 26 | ||||
| -rw-r--r-- | mingling/Cargo.toml | 3 | ||||
| -rw-r--r-- | mingling/src/lib.rs | 14 | ||||
| -rw-r--r-- | mingling_picker/Cargo.toml | 11 | ||||
| -rw-r--r-- | mingling_picker/README.md | 0 | ||||
| -rw-r--r-- | mingling_picker/src/lib.rs | 1 | ||||
| -rw-r--r-- | mingling_picker_macros/Cargo.toml | 17 | ||||
| -rw-r--r-- | mingling_picker_macros/README.md | 0 | ||||
| -rw-r--r-- | mingling_picker_macros/src/lib.rs | 1 |
11 files changed, 93 insertions, 54 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f63832a..b10e96d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,20 +6,22 @@ Before contributing, we recommend reading [README](README.md) to get an overview ## 1. Project Structure 📦 -| Category | Path/Name | Description | -| ----------------------- | -------------------- | ------------------------------------------------------------------ | -| **Entry crate** | `mingling/` | Project entry point | -| **Core library** | `mingling_core/` | Imported as an external dependency | -| **Macro library** | `mingling_macros/` | Imported as an external dependency | -| **Mingling Pathfinder** | `mingling_pathf/` | Build-time module path resolution for types | -| **Scaffolding tool** | `mling/` | Scaffolding tool `mingling-cli` | -| **Examples** | `examples/` | To add expected output tests, modify `examples/test-examples.toml` | -| **Documents** | `docs/` | All documents | -| **Dev Documents** | `docs/dev/` | Internal documents | -| **Resources** | `docs/res/` | All resources | -| **Development tools** | `.run/src/bin` | Contains scripts and Rust tools | -| **CI** | `.run/src/bin/ci.rs` | Can be invoked directly via `cargo ci` | -| **Temporary files** | `.temp/` | Ignored by `.gitignore` | +| Category | Path/Name | Description | +| --------------------------- | ------------------------- | ------------------------------------------------------------------ | +| **Entry crate** | `mingling/` | Project entry point | +| **Core library** | `mingling_core/` | Imported as an external dependency | +| **Macro library** | `mingling_macros/` | Imported as an external dependency | +| **Mingling Pathfinder** | `mingling_pathf/` | Build-time module path resolution for types | +| **Mingling Picker2** | `mingling_picker/` | Mingling Arguments Parser | +| **Mingling Picker2 Macros** | `mingling_picker_macros/` | Mingling Arguments Parser Macros | +| **Scaffolding tool** | `mling/` | Scaffolding tool `mingling-cli` | +| **Examples** | `examples/` | To add expected output tests, modify `examples/test-examples.toml` | +| **Documents** | `docs/` | All documents | +| **Dev Documents** | `docs/dev/` | Internal documents | +| **Resources** | `docs/res/` | All resources | +| **Development tools** | `.run/src/bin` | Contains scripts and Rust tools | +| **CI** | `.run/src/bin/ci.rs` | Can be invoked directly via `cargo ci` | +| **Temporary files** | `.temp/` | Ignored by `.gitignore` | ## 2. How to Contribute @@ -404,8 +404,10 @@ name = "mingling" version = "0.2.2" dependencies = [ "mingling", - "mingling_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "mingling_macros 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mingling_core", + "mingling_macros", + "mingling_picker", + "mingling_picker_macros", "serde", "size", "tokio", @@ -433,25 +435,7 @@ dependencies = [ "just_fmt", "just_template", "log", - "mingling_pathf 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ron", - "serde", - "serde_json", - "serde_yaml", - "toml", -] - -[[package]] -name = "mingling_core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64318a9b61120f0deaf33c4ab9efc9313387dece2defd7841665242807634ea" -dependencies = [ - "env_logger", - "just_fmt", - "just_template", - "log", - "mingling_pathf 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mingling_pathf", "ron", "serde", "serde_json", @@ -470,34 +454,24 @@ dependencies = [ ] [[package]] -name = "mingling_macros" +name = "mingling_pathf" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29efa15f48e39fd4a06868030545b1938e5ba050929cd9a235525814bfb6367" dependencies = [ "just_fmt", "proc-macro2", - "quote", "syn", ] [[package]] -name = "mingling_pathf" +name = "mingling_picker" version = "0.2.2" -dependencies = [ - "just_fmt", - "proc-macro2", - "syn", -] [[package]] -name = "mingling_pathf" +name = "mingling_picker_macros" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134fb0a329f4cc605298eb47683cd2e9eaa184bf651215cbc72d411e9533a4be" dependencies = [ - "just_fmt", "proc-macro2", + "quote", "syn", ] @@ -1,6 +1,22 @@ [workspace] resolver = "2" -members = ["mingling", "mingling_core", "mingling_macros", "mingling_pathf", "mling"] +members = [ + # Core + "mingling", + "mingling_core", + "mingling_macros", + + # Pathfinder + "mingling_pathf", + + # Picker2 + "mingling_picker", + "mingling_picker_macros", + + # Scaffolding tool + "mling" +] + exclude = [ # README-Tests "./temp/*", @@ -17,9 +33,11 @@ exclude = [ ] [workspace.dependencies] -mingling_core = { version = "0.2.2", default-features = false } -mingling_macros = { version = "0.2.2", default-features = false } -mingling_pathf = { version = "0.2.2", default-features = false } +mingling_core = { path = "mingling_core", default-features = false } +mingling_macros = { path = "mingling_macros", default-features = false } +mingling_pathf = { path = "mingling_pathf", default-features = false } +mingling_picker = { path = "mingling_picker", default-features = false } +mingling_picker_macros = { path = "mingling_picker_macros", default-features = false } just_fmt = "0.1.2" just_template = "0.2.0" diff --git a/mingling/Cargo.toml b/mingling/Cargo.toml index be223fe..667cfa5 100644 --- a/mingling/Cargo.toml +++ b/mingling/Cargo.toml @@ -44,6 +44,7 @@ dispatch_tree = ["mingling_core/dispatch_tree", "mingling_macros/dispatch_tree"] repl = ["mingling_core/repl", "mingling_macros/repl"] comp = ["mingling_core/comp", "mingling_macros/comp"] parser = ["dep:size"] +picker = ["dep:mingling_picker", "dep:mingling_picker_macros"] pathf = ["mingling_core/pathf", "mingling_macros/pathf"] structural_renderer = [ @@ -83,5 +84,7 @@ extra_macros = ["mingling_macros/extra_macros"] [dependencies] mingling_core.workspace = true mingling_macros.workspace = true +mingling_picker = { workspace = true, optional = true } +mingling_picker_macros = { workspace = true, optional = true } serde = { workspace = true, optional = true } size = { version = "0.5", optional = true } diff --git a/mingling/src/lib.rs b/mingling/src/lib.rs index 0fd4ece..ff8890c 100644 --- a/mingling/src/lib.rs +++ b/mingling/src/lib.rs @@ -71,10 +71,16 @@ mod example_docs; pub use mingling::*; pub use mingling_core as mingling; -/// `Mingling` argument parser +/// `Mingling` argument parser (Built-in) #[cfg(feature = "parser")] pub mod parser; +/// `Mingling` argument parser (Picker2) +#[cfg(feature = "picker")] +pub mod picker { + pub use mingling_picker::*; +} + /// Re-export of all macros from `mingling_macros`. /// /// This module re-exports all macros provided by the `mingling_macros` crate, @@ -162,6 +168,9 @@ pub mod macros { /// `suggest_enum!(EnumNames)` - Used to generate enum suggestions #[cfg(feature = "comp")] pub use mingling_macros::suggest_enum; + + #[cfg(feature = "picker")] + pub use mingling_macros::*; } /// derive macro `EnumTag` @@ -250,4 +259,7 @@ pub mod prelude { /// Re-export of the `AsPicker` trait for picker functionality. #[cfg(feature = "parser")] pub use crate::parser::AsPicker; + + #[cfg(feature = "picker")] + pub use mingling_picker::prelude::*; } diff --git a/mingling_picker/Cargo.toml b/mingling_picker/Cargo.toml new file mode 100644 index 0000000..71205d7 --- /dev/null +++ b/mingling_picker/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "mingling_picker" +version.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +authors = ["Weicao-CatilGrass"] +readme = "README.md" +description = "Mingling's lightweight argument parser" + +[dependencies] diff --git a/mingling_picker/README.md b/mingling_picker/README.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/mingling_picker/README.md diff --git a/mingling_picker/src/lib.rs b/mingling_picker/src/lib.rs new file mode 100644 index 0000000..0b6b62e --- /dev/null +++ b/mingling_picker/src/lib.rs @@ -0,0 +1 @@ +pub mod preulude {} diff --git a/mingling_picker_macros/Cargo.toml b/mingling_picker_macros/Cargo.toml new file mode 100644 index 0000000..5bab6e5 --- /dev/null +++ b/mingling_picker_macros/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "mingling_picker_macros" +version.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +authors = ["Weicao-CatilGrass"] +readme = "README.md" +description = "Mingling's lightweight argument parser macros" + +[lib] +proc-macro = true + +[dependencies] +syn.workspace = true +quote.workspace = true +proc-macro2.workspace = true diff --git a/mingling_picker_macros/README.md b/mingling_picker_macros/README.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/mingling_picker_macros/README.md diff --git a/mingling_picker_macros/src/lib.rs b/mingling_picker_macros/src/lib.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/mingling_picker_macros/src/lib.rs @@ -0,0 +1 @@ + |
