Skip to content

Commit 657bb24

Browse files
authored
pgml components library (postgresml#991)
1 parent 620847c commit 657bb24

File tree

33 files changed

+365
-132
lines changed

33 files changed

+365
-132
lines changed

packages/pgml-components/Cargo.lock

Lines changed: 315 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/pgml-components/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "pgml-components"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
sailfish = ">=0.8"

pgml-apps/cargo-pgml-components/src/components/component.rs renamed to packages/pgml-components/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@ pub struct Component {
1313
#[macro_export]
1414
macro_rules! component {
1515
($name:tt) => {
16-
impl From<$name> for crate::components::Component {
17-
fn from(thing: $name) -> crate::components::Component {
16+
impl From<$name> for pgml_components::Component {
17+
fn from(thing: $name) -> pgml_components::Component {
1818
use sailfish::TemplateOnce;
1919

20-
crate::components::Component {
20+
pgml_components::Component {
2121
value: thing.render_once().unwrap(),
2222
}
2323
}
2424
}
2525
};
2626

2727
($name:tt, $lifetime:lifetime) => {
28-
impl<$lifetime> From<$name<$lifetime>> for crate::components::Component {
29-
fn from(thing: $name<$lifetime>) -> crate::components::Component {
28+
impl<$lifetime> From<$name<$lifetime>> for pgml_components::Component {
29+
fn from(thing: $name<$lifetime>) -> pgml_components::Component {
3030
use sailfish::TemplateOnce;
3131

32-
crate::components::Component {
32+
pgml_components::Component {
3333
value: thing.render_once().unwrap(),
3434
}
3535
}
3636
}
3737
};
3838
}
3939

40-
pub use component;
40+
// pub use component;
4141

4242
// Render any string.
4343
impl From<&str> for Component {

pgml-apps/cargo-pgml-components/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cargo-pgml-components"
3-
version = "0.1.14"
3+
version = "0.1.15"
44
edition = "2021"
55
authors = ["PostgresML <team@postgresml.org>"]
66
license = "MIT"

0 commit comments

Comments
 (0)