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

CLI Utility #39

Closed
System-Glitch opened this issue Mar 6, 2020 · 23 comments
Closed

CLI Utility #39

System-Glitch opened this issue Mar 6, 2020 · 23 comments
Assignees
Labels
feature request Request for new feature implementation

Comments

@System-Glitch
Copy link
Member

System-Glitch commented Mar 6, 2020

Proposal

Create a CLI Utility called goyave-cli or gyv to make Goyave development easier. The utility would be an interactive, a bit like gh

  • Creation tools:
    • Create a project
      • The utility would ask a series of questions
      • Name of the project, name of the go module
      • Goyave version (latest by default)
      • Database used (changes the config options)
    • Create controllers
      • Resource controllers (full CRUD template, then fill the blanks)
      • Resource controller creation can take a model as reference to automatically create a request and the handlers
    • Create middleware
    • Create request (validation, may be created alongside resource controllers)
    • Create model (+ its resource controller)
  • Database commands:
    • Run seeders
    • Run migrations (may open to a more advanced migration system)
    • Clear / recreate database
  • Miscellaneous:
    • Detailed routes list
    • Run tests (maybe not needed, as it would duplicate go test)
    • Generate OpenAPI specification OpenAPI generator #42
    • Open documentation page (goyave.dev)

Possible drawbacks

None.

Additional information

This issue is a feature proposal and is meant to be discussed. If you have any other idea for this CLI Utility, feel free to suggest it!
It is also a good candidate if you want to contribute to the project.
This should probably be developed as a side-project.

@System-Glitch System-Glitch added good first issue Good for newcomers feature request Request for new feature implementation labels Mar 6, 2020
@jg-l
Copy link

jg-l commented Mar 6, 2020

Is this essentially a scaffolding utility to get new projects started quickly? If so, is goyave-template a good starting point for this utility? At least for the project creation heading.

Looking further, this is similar to Django's manage.py

@System-Glitch
Copy link
Member Author

@jg-l It is a bit more than scaffolding as you can see. The idea is to build something a bit like artisan in Laravel.

But the goyave template can be used for the "Create project" part indeed.

@jg-l
Copy link

jg-l commented Mar 11, 2020

@jg-l It is a bit more than scaffolding as you can see. The idea is to build something a bit like artisan in Laravel.

But the goyave template can be used for the "Create project" part indeed.

I see. I will draft a PR for this project. Can we agree the CLI should be made in Go? Or do you have something else in mind?

@System-Glitch
Copy link
Member Author

System-Glitch commented Mar 11, 2020

@jg-l Yes I planned the CLI to be done in Go. Thank you very much for your contribution!

@jg-l
Copy link

jg-l commented Mar 12, 2020

I've started the project, but it's just a skeleton for now.

https://github.com/jg-l/goyave-cli

I do have a few questions which I'm compiling regarding the first heading: "Creation tools". I'll post it when it's ready.

Any thoughts on the architecture so far?

@System-Glitch
Copy link
Member Author

Looks good to me so far. Setup CI with similar tools that the ones I used for Goyave, so it ensures the CLI has the same code quality.

@System-Glitch
Copy link
Member Author

@jg-l Any progress?

@jg-l
Copy link

jg-l commented Mar 28, 2020

Very little progress though I have something, will push soon

@Wulfheart
Copy link

I'm on it.

@jg-l
Copy link

jg-l commented Apr 30, 2020

I may have taken more than I can chew at the moment. I will cede this project to @Wulfheart

@Wulfheart
Copy link

@jg-l Thanks man.

@jg-l
Copy link

jg-l commented Apr 30, 2020

Im watching this thread, I'm still interested in this project. Just don't have the time to maintain another OSS project. I will help with what I can.

Good luck @Wulfheart

@Wulfheart
Copy link

What about renaming it to another fruit like mango?
This would make it distinguishable from the main app plus it will be redistributable via the go get -u-command which would ease getting the cli.

@System-Glitch What are your thoughts on this?

@System-Glitch
Copy link
Member Author

@Wulfheart It would probably be confusing if the CLI didn't have the same name as the framework, but I agree that goyave-cli command is a bit long and annoying to write. In the same fashion as angular ng command, we could remove some letters.
Any idea to make it shorter while keeping it clear that it's the CLI for goyave?

@Wulfheart
Copy link

Wulfheart commented May 2, 2020

@System-Glitch What about gyv?

@System-Glitch
Copy link
Member Author

@Wulfheart I like it! Let's go with gyv.

@MShoaei MShoaei mentioned this issue May 2, 2020
@Wulfheart
Copy link

@System-Glitch I have a prototype running under https://github.com/Wulfheart/gyv.

Please note that it is really early stage and a sketch. The only command working properly is the init command.

@System-Glitch
Copy link
Member Author

@Wulfheart Thanks for the link. I will watch it.
Is it possible to make it available for go 1.13 minimum instead of 1.14 so the requirements for the CLI are the same as the framework?

@Wulfheart
Copy link

@System-Glitch Should be no problem. 1.14 is just the version installed on my machine.

@MShoaei
Copy link

MShoaei commented May 2, 2020

I would try to work on it although I have no experience working with cli

@Wulfheart
Copy link

Wulfheart commented May 2, 2020

@MShoaei Feel free to contribute. The structure is already given. "Just" filling out actions. https://github.com/Wulfheart/gyv.

@Wulfheart
Copy link

This weekend I will have some spare time and release an initial version of the tool. I'm estimating that it can be only used for bootstrapping a project.

@System-Glitch
Copy link
Member Author

System-Glitch commented Mar 8, 2021

The repository for this project has been created here. issues and discussions related to the CLI will take place in this repository. Feel free to fork if you want to contribute!

@System-Glitch System-Glitch removed the good first issue Good for newcomers label Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for new feature implementation
Projects
None yet
Development

No branches or pull requests

5 participants