Skip to content
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

Add angular cli style commands for generating components, resources, plugins etc. #300

Open
tigerplush opened this issue Mar 9, 2025 · 2 comments
Labels
A-CLI Related to the main CLI and not a more specific subcommand

Comments

@tigerplush
Copy link

I was attending the 7DRL Jam last week and it really hit me how much I had to write pub fn plugin(app: &mut App)... so I was thinking that maybe there should be a command to generate these for me like angulars cli does

so I propose that
bevy generate plugin ./path/to/plugin
generates that boilerplate for me

likewise you could use
bevy generate component ./path/to/component
to generate a component with the given name and if path/to/already exists and has a mod.rs in it, could add mod component; to the file, so that I don't have to manually.

this could then of course be extended for resources and the likes.

@DaAlbrecht
Copy link
Collaborator

Hi, thanks for the feedback! I’m unsure if a custom subcommand is the right approach. I think, snippets mostly solve this. The bevy_new_2d template comes with vs code snippets or you could check out this VS Code extension that provides Bevy snippets.

@DaAlbrecht DaAlbrecht added the A-CLI Related to the main CLI and not a more specific subcommand label Mar 9, 2025
@tigerplush
Copy link
Author

Hi, thanks for the feedback! I’m unsure if a custom subcommand is the right approach. I think, snippets mostly solve this. The bevy_new_2d template comes with vs code snippets or you could check out this VS Code extension that provides Bevy snippets.

This is almost exactly what I was looking for, thank you! Although I would argue that not everyone uses vs code, so there still might be some benefit in my proposal ;D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Related to the main CLI and not a more specific subcommand
Projects
None yet
Development

No branches or pull requests

2 participants