diff --git a/pgml-apps/cargo-pgml-components/Cargo.lock b/pgml-apps/cargo-pgml-components/Cargo.lock index 40c0e87cf..872e6707e 100644 --- a/pgml-apps/cargo-pgml-components/Cargo.lock +++ b/pgml-apps/cargo-pgml-components/Cargo.lock @@ -126,7 +126,7 @@ dependencies = [ [[package]] name = "cargo-pgml-components" -version = "0.1.12" +version = "0.1.13" dependencies = [ "anyhow", "assert_cmd", diff --git a/pgml-apps/cargo-pgml-components/Cargo.toml b/pgml-apps/cargo-pgml-components/Cargo.toml index 74c3aace5..5779f93e7 100644 --- a/pgml-apps/cargo-pgml-components/Cargo.toml +++ b/pgml-apps/cargo-pgml-components/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-pgml-components" -version = "0.1.12" +version = "0.1.13" edition = "2021" authors = ["PostgresML "] license = "MIT" diff --git a/pgml-apps/cargo-pgml-components/src/components/component.rs b/pgml-apps/cargo-pgml-components/src/components/component.rs index 184b3cd3b..a785ed9d7 100644 --- a/pgml-apps/cargo-pgml-components/src/components/component.rs +++ b/pgml-apps/cargo-pgml-components/src/components/component.rs @@ -10,6 +10,7 @@ pub struct Component { pub value: String, } +#[macro_export] macro_rules! component { ($name:tt) => { impl From<$name> for crate::components::Component { @@ -36,7 +37,8 @@ macro_rules! component { }; } -pub(crate) use component; + +pub use component; // Render any string. impl From<&str> for Component { diff --git a/pgml-apps/cargo-pgml-components/src/frontend/templates/mod.rs.tpl b/pgml-apps/cargo-pgml-components/src/frontend/templates/mod.rs.tpl index ca15b0754..fe37ba782 100644 --- a/pgml-apps/cargo-pgml-components/src/frontend/templates/mod.rs.tpl +++ b/pgml-apps/cargo-pgml-components/src/frontend/templates/mod.rs.tpl @@ -2,8 +2,8 @@ // You shouldn't modify it manually. <% if root { %> -mod component; -pub(crate) use component::{component, Component}; +pub mod component; +pub use component::{component, Component}; <% } %> <% for component in modules.iter() { %> // <%= component.full_path() %> diff --git a/pgml-dashboard/src/components/component.rs b/pgml-dashboard/src/components/component.rs index 184b3cd3b..a785ed9d7 100644 --- a/pgml-dashboard/src/components/component.rs +++ b/pgml-dashboard/src/components/component.rs @@ -10,6 +10,7 @@ pub struct Component { pub value: String, } +#[macro_export] macro_rules! component { ($name:tt) => { impl From<$name> for crate::components::Component { @@ -36,7 +37,8 @@ macro_rules! component { }; } -pub(crate) use component; + +pub use component; // Render any string. impl From<&str> for Component { diff --git a/pgml-dashboard/src/components/mod.rs b/pgml-dashboard/src/components/mod.rs index 40205f3c2..9008682f1 100644 --- a/pgml-dashboard/src/components/mod.rs +++ b/pgml-dashboard/src/components/mod.rs @@ -1,8 +1,8 @@ // This file is automatically generated. // You shouldn't modify it manually. -mod component; -pub(crate) use component::{component, Component}; +pub mod component; +pub use component::{component, Component}; // src/components/breadcrumbs pub mod breadcrumbs;