Skip to content

docs: update resource command output to reflect auto-wired module declaration - #721

Merged
arferreira merged 4 commits into
rapina-rs:mainfrom
GuTS805:docs/update-cli-commands
Aug 5, 2026
Merged

docs: update resource command output to reflect auto-wired module declaration#721
arferreira merged 4 commits into
rapina-rs:mainfrom
GuTS805:docs/update-cli-commands

Conversation

@GuTS805

@GuTS805 GuTS805 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • rapina add resource now wires the mod <resource>; declaration into src/main.rs automatically (idempotent on repeat runs), so the docs no longer instruct users to add it by hand.
  • Clarifies the two steps still required manually: registering routes in the Router and enabling the database feature in Cargo.toml.

Edited: closes #698

Test plan

@GuTS805
GuTS805 requested a review from arferreira as a code owner July 30, 2026 12:03
@github-actions

Copy link
Copy Markdown

Thanks for your first PR! A maintainer will review it shortly.

Make sure CI passes and take a look at our contributing guide if you haven't already.

@github-actions github-actions Bot added the area: docs Documentation site label Jul 30, 2026
@GuTS805

GuTS805 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Please review

Comment thread docs/content/docs/cli/commands.md
Comment thread docs/content/docs/cli/commands.md

@ShiraiEd ShiraiEd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @GuTS805 , thanks for contributing!

So for this issue I just wanted to match the command output written in the docs with the actual output, that would be changing:

  • from this snippet:
    Next steps:
    
    1. Add the module declaration to src/main.rs:
    
     mod users;
     mod entity;
     mod migrations;
    
    2. Register the routes in your Router:
    
     use users::handlers::{list_users, get_user, create_user, update_user, delete_user};
    
     let router = Router::new()
         .get("/users", list_users)
         .get("/users/:id", get_user)
         .post("/users", create_user)
         .put("/users/:id", update_user)
         .delete("/users/:id", delete_user);
    
    3. Enable the database feature in Cargo.toml:
    
     rapina = { version = "...", features = ["postgres"] }
  • to this one:
    Adding resource: User
    
    ✓ Created src/users/
    ✓ Created src/users/mod.rs
    ✓ Created src/users/handlers.rs
    ✓ Created src/users/dto.rs
    ✓ Created src/users/error.rs
    ✓ Updated src/entity.rs
    ✓ Created src/migrations/
    ✓ Created src/migrations/m20260723_090145_create_users.rs
    ✓ Updated src/migrations/mod.rs
    ✓ Wired mod users; in src/main.rs
    
    Next steps:
    
    1. Run cargo build to verify
    
    Resource Item created successfully!
      ```
    

I also commented something to add after de snippet

@GuTS805
GuTS805 requested a review from ShiraiEd July 31, 2026 10:05
@GuTS805

GuTS805 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Updated the snippet. Please review it again.

@ShiraiEd

ShiraiEd commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Hey @GuTS805, can I ask you something?

What did you find that difficult in this task that made you use and even commit with claude?

In my conception it is just a simple change in a markdown, the use of AI is totally unacessary,
if you had any questions you should have just asked in the issue comments or here.

Also did you tested the changes locally with Zola to see if it really got applied?

@GuTS805

GuTS805 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Honestly, it was just a small docs change. I only used Claude to double-check that I was following your suggested wording correctly and hadn't missed anything not because the change itself needed AI. I probably should've just asked you directly if I was unsure, and I'll do that next time.

I also tested everything locally with zola build. It built cleanly with no errors, and I checked the generated HTML for the commands page to make sure the snippet and bullet formatting looked right.

@ShiraiEd

ShiraiEd commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Ok, understood

Can you just amend the commit and delete Claude as co-author then

GuTS805 added 2 commits August 2, 2026 14:20
Match the exact CLI checklist output, mention .discover() as an
alternative to manual router registration, and note mod entity/
mod migrations still need to be added manually.
@GuTS805
GuTS805 force-pushed the docs/update-cli-commands branch from f582c9e to cf10d03 Compare August 2, 2026 09:00
@GuTS805

GuTS805 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Done

@ShiraiEd ShiraiEd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arferreira
arferreira merged commit 6861ebd into rapina-rs:main Aug 5, 2026
14 checks passed
@GuTS805
GuTS805 deleted the docs/update-cli-commands branch August 5, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation site

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Rapina add resource docs doesn't match command output

3 participants