Skip to content

v0.1.0: promkit-derive #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 19, 2025
Merged

v0.1.0: promkit-derive #17

merged 7 commits into from
Feb 19, 2025

Conversation

ynqa
Copy link
Owner

@ynqa ynqa commented Mar 18, 2024

Resolves #11

Example

cargo run --example derive

The code is

use promkit::{crossterm::style::Color, style::StyleBuilder};
use promkit_derive::Promkit;

#[derive(Default, Debug, Promkit)]
struct Profile {
    #[form(
        prefix = "What is your name?",
        prefix_style = StyleBuilder::new().fgc(Color::DarkCyan).build(),
    )]
    name: String,

    #[form(default)]
    hobby: Option<String>,

    #[form(prefix = "How old are you?", ignore_invalid_attr = "nothing")]
    age: usize,
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut ret = Profile::default();
    ret.build()?;
    dbg!(ret);
    Ok(())
}

@ynqa ynqa added the v0.4.0 label Mar 18, 2024
@ynqa ynqa force-pushed the dev-0.4.0/promkit-derive branch from 74787df to 371cf69 Compare March 19, 2024 13:07
@ynqa ynqa force-pushed the dev-0.4.0/promkit-derive branch from 371cf69 to 5b43b71 Compare March 19, 2024 13:12
@ynqa ynqa force-pushed the dev-0.4.0/promkit-derive branch from 5b43b71 to 00b2ed5 Compare March 19, 2024 13:15
@ynqa ynqa changed the title v0.4.0: promkit-derive v0.5.x: promkit-derive Apr 6, 2024
@ynqa ynqa added v0.5.0 and removed v0.4.0 labels Apr 6, 2024
@ynqa ynqa force-pushed the dev-0.4.0/main branch from 7d0036b to 5ddcd90 Compare April 6, 2024 08:39
@ynqa ynqa added the v0.4.0 label Apr 6, 2024
@ynqa ynqa changed the title v0.5.x: promkit-derive v0.4.x: promkit-derive Apr 6, 2024
@ynqa ynqa removed the v0.4.0 label Apr 14, 2024
@ynqa ynqa changed the title v0.4.x: promkit-derive v0.x.x: promkit-derive Apr 14, 2024
Base automatically changed from dev-0.4.0/main to main April 21, 2024 10:44
@ynqa ynqa force-pushed the dev-0.4.0/promkit-derive branch from 00b2ed5 to 7576091 Compare September 18, 2024 12:05
@ynqa ynqa changed the title v0.x.x: promkit-derive v0.5.0: promkit-derive Sep 19, 2024
@ynqa ynqa force-pushed the dev-0.4.0/promkit-derive branch from 7576091 to b99bf04 Compare September 19, 2024 12:27
@ynqa ynqa removed the v0.5.0 label Oct 10, 2024
@ynqa ynqa changed the title v0.5.0: promkit-derive v0.1.0: promkit-derive Oct 10, 2024
@simonsan
Copy link

When you are feeling ready for a review, let me know, I'll be able to look over it then. 🫂

@ynqa ynqa force-pushed the dev-0.4.0/promkit-derive branch from b99bf04 to 0eab121 Compare December 1, 2024 06:52
@ynqa ynqa marked this pull request as ready for review December 1, 2024 06:54
@ynqa
Copy link
Owner Author

ynqa commented Dec 1, 2024

@simonsan I apologize for the delayed response. I have made the correction to use Form. Please review it again!

@simonsan
Copy link

simonsan commented Dec 1, 2024

I will build and try it later, this is the first thing that caught my eye 👍🏽

@ynqa ynqa force-pushed the dev-0.4.0/promkit-derive branch from 0eab121 to fd4e9c4 Compare December 1, 2024 14:35
@ynqa ynqa requested a review from simonsan December 8, 2024 04:51
@simonsan
Copy link

@ynqa I'm a bit low on time the last/next couple of days, so I won't be able to review. Probably next week only. If that's fine with you, otherwise please merge, and I give feedback afterwards. ❤️

@ynqa
Copy link
Owner Author

ynqa commented Feb 19, 2025

@simonsan I’ll go ahead and merge it. Feel free to drop by again if you feel like it 👋

@ynqa ynqa merged commit 3ee3649 into main Feb 19, 2025
1 check passed
@ynqa ynqa deleted the dev-0.4.0/promkit-derive branch February 19, 2025 12:52
@simonsan
Copy link

@simonsan I’ll go ahead and merge it. Feel free to drop by again if you feel like it 👋

Hey sorry, yes please. I'm a bit out of the loop right now.

@WolfDan
Copy link

WolfDan commented Mar 6, 2025

@ynqa How to use this feature? it's on the 0.7.0 changelog but the the crate is not available on crates.io nor can use the code using only promkit 🤔

@ynqa
Copy link
Owner Author

ynqa commented Mar 7, 2025

@WolfDan Please wait a moment, I just have not published it yet.

@ynqa
Copy link
Owner Author

ynqa commented Mar 17, 2025

@WolfDan Sorry for late, I just released promkit-derive v0.1.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Derive a form (multiple prompts) from struct
3 participants