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

[RFC] Add a make:maker command #74

Closed
yceruto opened this issue Nov 30, 2017 · 5 comments
Closed

[RFC] Add a make:maker command #74

yceruto opened this issue Nov 30, 2017 · 5 comments
Labels
Feature New Feature RFC

Comments

@yceruto
Copy link
Member

yceruto commented Nov 30, 2017

https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html#creating-your-own-makers

Creating your Own Makers
------------------------

In case your applications need to generate custom boilerplate code, you can
create your own ``make:...`` command reusing the tools provided by this bundle.
Imagine that you need to create a ``make:report`` command. First, create a
class that implements ...... 

... wait no no, just run make:maker report that's it! =)

What do you think?

@weaverryan
Copy link
Member

I thought about this... I wasn't sure. It shouldn't be that common... and there's a small cost: it's another command that the user needs to look through when trying to find the one they want.

@yceruto
Copy link
Member Author

yceruto commented Dec 1, 2017

It shouldn't be that common

Yep, it isn't right now, because the bundle is really very new, but I think it will be. I have many skeletons specific to other libraries (not directly related to Symfony) that I would love to not have to create manually, so I'll need the maker.

I know, I can create my own make:maker but I will have to update it constantly with the latest changes in the bundle, as well as the documentation (here) related to how create a new one.

it's another command that the user needs to look through when trying to find the one they want.

I think it is very subjective depending on whether the maker is really necessary or no.

@stof
Copy link
Member

stof commented Dec 1, 2017

But would projects themselves need to create makers ? I'm not sure about it. third-party makers are more likely to be provided by third-party bundles than by projects themselves IMO.

@javiereguiluz
Copy link
Member

I'm not sure either. We could add it as a hidden command though.

@yceruto
Copy link
Member Author

yceruto commented Dec 1, 2017

But would projects themselves need to create makers ?

@stof I think so, in case your applications need to generate custom boilerplate code, also there is not way to override a skeleton template ATM (and we probably will not have it), so how I can modify it?

Current steps to create your own maker:

  1. Find the documentation of the MakerBundle and read it.
  2. Create the class that implements MakerInterface.
  3. Find the skeleton template to reuse or create a new one.
  4. Understand the architecture! (The most complicated step for everyone)
  5. Done! try and add a test case, as I need to make sure that future changes made to the bundle don't break my maker.

It is not too easy really IMHO.

The make:maker command should be visible on bin/console list make. It can provide the nicer maker class with important comments (jumping steps 1, 2 and 4), this one could ask me: do you want to reuse one or create a new skeleton template? It could create the base skeleton template for me (step 3) with important comments (mandatory <?= "<?php\n" ?>), even it could ask (step 5): do you want to add a test case class for this new maker? oh, definitely yes :)

The big question is, if we already have the possibility of creating our own maker, why not make the path happy?

@javiereguiluz javiereguiluz added RFC Feature New Feature labels Jan 24, 2018
@yceruto yceruto closed this as completed Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature RFC
Projects
None yet
Development

No branches or pull requests

4 participants