rxferrix-cli 0.18.0

The `rxferrix` command: scaffolds new RxFerrix apps (`rxferrix new`) and runs them in development (`rxferrix dev`)
use rxferrix::prelude::*;

/// One item on the list.
#[table(name = "tasks")]
pub struct Task {
    pub text: String,
    pub done: bool,
}

/// All tasks, newest first.
#[query]
pub async fn list(ctx: &QueryCtx) -> Result<Vec<Doc<Task>>> {
    ctx.db.query::<Task>().order(Order::Desc).take(100).await
}

#[mutation]
pub async fn add(
    ctx: &MutationCtx,
    #[validate(trim, non_empty, code = "empty_text", message = "A task needs some text")] text: String,
) -> Result<Id<Task>> {
    ctx.db.insert(Task { text, done: false }).await
}

#[mutation]
pub async fn set_done(ctx: &MutationCtx, id: Id<Task>, done: bool) -> Result<()> {
    ctx.db.patch(id, patch!(Task { done })).await
}

#[mutation]
pub async fn remove(ctx: &MutationCtx, id: Id<Task>) -> Result<()> {
    ctx.db.delete(id).await
}