Skip to content

Commit

Permalink
Decouple component and field macro crates from the library crates (#47)
Browse files Browse the repository at this point in the history
* Decouple cgp-component-macro crate from cgp-component

* Decouple cgp-field-macro from cgp-field

* Reformat Cargo.toml files

* Add changelog
  • Loading branch information
soareschen authored Jan 5, 2025
1 parent 25581f3 commit 9a79e8e
Show file tree
Hide file tree
Showing 25 changed files with 64 additions and 54 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.3.0 (pre-release)

- Decouple component and field macro crates from the library crates - [#47](https://github.com/contextgeneric/cgp/pull/47)
- Remove `cgp-component-macro` crate from being a dependency of `cgp-component`.
- Remove `cgp-field-macro` crate from being a dependency of `cgp-field`.

## v0.2.0 (2025-12-08)

- Rename `define_components!` to `cgp_preset!` with slight improvement - [#41](https://github.com/contextgeneric/cgp/pull/41)
Expand Down
15 changes: 8 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/cgp-async-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ proc-macro = true
[features]

[dependencies]
syn = { version = "2.0.90", features = [ "full" ] }
quote = "1.0.33"
syn = { version = "2.0.90", features = [ "full" ] }
quote = "1.0.33"
proc-macro2 = "1.0.92"
2 changes: 1 addition & 1 deletion crates/cgp-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ static = [ "async" ]

[dependencies]
cgp-async-macro = { version = "0.2.0" }
cgp-sync = { version = "0.2.0" }
cgp-sync = { version = "0.2.0" }
10 changes: 5 additions & 5 deletions crates/cgp-component-macro-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ description = """
"""

[dependencies]
syn = { version = "2.0.90", features = [ "full", "extra-traits" ] }
quote = "1.0.33"
proc-macro2 = "1.0.92"
itertools = "0.13.0"
prettyplease = "0.2.25"
syn = { version = "2.0.90", features = [ "full", "extra-traits" ] }
quote = "1.0.33"
proc-macro2 = "1.0.92"
itertools = "0.13.0"
prettyplease = "0.2.25"
3 changes: 1 addition & 2 deletions crates/cgp-component-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ description = """
proc-macro = true

[dependencies]
cgp-component-macro-lib = { version = "0.2.0" }
proc-macro2 = "1.0.92"
cgp-component-macro-lib = { version = "0.2.0" }
1 change: 0 additions & 1 deletion crates/cgp-component/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ description = """
"""

[dependencies]
cgp-component-macro = { version = "0.2.0" }
3 changes: 0 additions & 3 deletions crates/cgp-component/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@
pub mod traits;
pub mod types;

pub use cgp_component_macro::{
cgp_component, cgp_preset, delegate_components, for_each_replace, replace_with,
};
pub use traits::{DelegateComponent, HasComponents};
pub use types::{UseContext, UseDelegate, WithContext, WithProvider};
14 changes: 8 additions & 6 deletions crates/cgp-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ default = [ "full" ]
full = [ "cgp-async/full" ]

[dependencies]
cgp-async = { version = "0.2.0", default-features = false }
cgp-component = { version = "0.2.0" }
cgp-type = { version = "0.2.0" }
cgp-error = { version = "0.2.0" }
cgp-field = { version = "0.2.0" }
cgp-inner = { version = "0.2.0" }
cgp-async = { version = "0.2.0", default-features = false }
cgp-component = { version = "0.2.0" }
cgp-component-macro = { version = "0.2.0" }
cgp-type = { version = "0.2.0" }
cgp-error = { version = "0.2.0" }
cgp-field = { version = "0.2.0" }
cgp-field-macro = { version = "0.2.0" }
cgp-inner = { version = "0.2.0" }
9 changes: 4 additions & 5 deletions crates/cgp-core/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
pub use cgp_async::{async_trait, Async, MaybeSend, MaybeStatic, MaybeSync};
pub use cgp_component::{
pub use cgp_component::{DelegateComponent, HasComponents};
pub use cgp_component_macro::{
cgp_component, cgp_preset, delegate_components, for_each_replace, replace_with,
DelegateComponent, HasComponents,
};
pub use cgp_error::{CanRaiseError, HasErrorType};
pub use cgp_field::{
product, symbol, Char, Cons, Either, HasField, HasFieldMut, Nil, Product, Sum, Void,
};
pub use cgp_field::{Char, Cons, Either, HasField, HasFieldMut, Nil, Void};
pub use cgp_field_macro::{product, symbol, HasField, Product, Sum};
2 changes: 1 addition & 1 deletion crates/cgp-error-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ description = """
"""

[dependencies]
cgp-core = { version = "0.2.0", default-features = false }
cgp-core = { version = "0.2.0", default-features = false }
7 changes: 4 additions & 3 deletions crates/cgp-error/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ description = """
"""

[dependencies]
cgp-async = { version = "0.2.0", default-features = false }
cgp-component = { version = "0.2.0" }
cgp-type = { version = "0.2.0" }
cgp-async = { version = "0.2.0", default-features = false }
cgp-component = { version = "0.2.0" }
cgp-component-macro = { version = "0.2.0" }
cgp-type = { version = "0.2.0" }
3 changes: 2 additions & 1 deletion crates/cgp-error/src/can_raise_error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use cgp_component::{cgp_component, DelegateComponent, HasComponents, UseDelegate};
use cgp_component::{DelegateComponent, HasComponents, UseDelegate};
use cgp_component_macro::cgp_component;

use crate::has_error_type::HasErrorType;

Expand Down
3 changes: 2 additions & 1 deletion crates/cgp-error/src/has_error_type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use core::fmt::Debug;

use cgp_async::Async;
use cgp_component::{cgp_component, DelegateComponent, HasComponents, WithProvider};
use cgp_component::{DelegateComponent, HasComponents, WithProvider};
use cgp_component_macro::cgp_component;
use cgp_type::traits::has_type::ProvideType;

/**
Expand Down
2 changes: 1 addition & 1 deletion crates/cgp-extra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ description = """
"""

[dependencies]
cgp-run = { version = "0.2.0" }
cgp-run = { version = "0.2.0" }
10 changes: 5 additions & 5 deletions crates/cgp-field-macro-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ description = """
"""

[dependencies]
syn = { version = "2.0.90", features = [ "full" ] }
quote = "1.0.33"
proc-macro2 = "1.0.92"
itertools = "0.13.0"
prettyplease = "0.2.20"
syn = { version = "2.0.90", features = [ "full" ] }
quote = "1.0.33"
proc-macro2 = "1.0.92"
itertools = "0.13.0"
prettyplease = "0.2.20"
2 changes: 1 addition & 1 deletion crates/cgp-field-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ proc-macro = true

[dependencies]
cgp-field-macro-lib = { version = "0.2.0" }
proc-macro2 = "1.0.92"
proc-macro2 = "1.0.92"
1 change: 0 additions & 1 deletion crates/cgp-field/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ description = """
"""

[dependencies]
cgp-field-macro = { version = "0.2.0" }
cgp-component = { version = "0.2.0" }
cgp-type = { version = "0.2.0" }
1 change: 0 additions & 1 deletion crates/cgp-field/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ pub mod impls;
pub mod traits;
pub mod types;

pub use cgp_field_macro::{product, symbol, HasField, Product, Sum};
pub use traits::{FieldGetter, HasField, HasFieldMut, MutFieldGetter};
pub use types::{Char, Cons, Either, Field, Index, Nil, Void};
3 changes: 2 additions & 1 deletion crates/cgp-inner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ description = """
"""

[dependencies]
cgp-component = { version = "0.2.0" }
cgp-component = { version = "0.2.0" }
cgp-component-macro = { version = "0.2.0" }
3 changes: 2 additions & 1 deletion crates/cgp-inner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

extern crate alloc;

use cgp_component::{cgp_component, DelegateComponent, HasComponents};
use cgp_component::{DelegateComponent, HasComponents};
use cgp_component_macro::cgp_component;

#[cgp_component {
name: InnerComponent,
Expand Down
7 changes: 4 additions & 3 deletions crates/cgp-run/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ description = """
"""

[dependencies]
cgp-async = { version = "0.2.0", default-features = false }
cgp-error = { version = "0.2.0" }
cgp-component = { version = "0.2.0" }
cgp-async = { version = "0.2.0", default-features = false }
cgp-error = { version = "0.2.0" }
cgp-component = { version = "0.2.0" }
cgp-component-macro = { version = "0.2.0" }
1 change: 1 addition & 0 deletions crates/cgp-run/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use alloc::boxed::Box;

use cgp_async::*;
use cgp_component::*;
use cgp_component_macro::*;
use cgp_error::HasErrorType;

#[cgp_component {
Expand Down
3 changes: 2 additions & 1 deletion crates/cgp-type/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ description = """
"""

[dependencies]
cgp-component = { version = "0.2.0" }
cgp-component = { version = "0.2.0" }
cgp-component-macro = { version = "0.2.0" }
3 changes: 2 additions & 1 deletion crates/cgp-type/src/traits/has_type.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use cgp_component::{cgp_component, DelegateComponent, HasComponents, UseContext, UseDelegate};
use cgp_component::{DelegateComponent, HasComponents, UseContext, UseDelegate};
use cgp_component_macro::cgp_component;

#[cgp_component {
name: TypeComponent,
Expand Down

0 comments on commit 9a79e8e

Please sign in to comment.