AngelMunoz / Perla

A cross-platform tool for unbundled front-end development that doesn't depend on Node or requires you to install a complex toolchain
https://perla-docs.web.app/
MIT License
131 stars 12 forks source link

Remove required argument from the template command #120

Closed AngelMunoz closed 1 year ago

AngelMunoz commented 1 year ago

Is your feature request related to a problem? Please describe.

Running perla templates without arguments should show the table of the current templates available for perla's scaffolding features, but currently it requires an argument (namely the template name for the rest of the operations related to templates)

Describe the solution you'd like We should make the required templateName optional, and just default to show the list of existing templates available for perla.

In regards of the information of the table it currently displays the following columns:

Taking feedback from #118 I'm considering using the following columns instead:

e.g.

Name perla new -t perla new -id perla new -tn
Fable Feliz perla new -t ff perla new -id perla.templates.fable.feliz perla new -tn AngelMunoz/perla-templates/fable-feliz
Fable Sutil perla new -t fs perla new -id perla.templates.fable.sutil perla new -tn perla-templates/fable-sutil

One potential issue here is that -tn can be provided partially or fully annotated. The shorthand form (no GH user) in the example it works because there is a single repository with the perla-templates name, the following wouldn't work and you will need to provide the full name:

So we could remove that option completely at least for users

Describe alternatives you've considered A Wizard-like experience for templates as well, perla template runs a wizard-like experience just as perla new does

Additional context

Reported in #118 cc @kaeedo

kaeedo commented 1 year ago

Question: What's the idea behind the group ID of the templates? It seems like overkill to have three different ways of specifying a template, especially when two of them are rather long. Having the shortname makes sense IMO, and having the full repository name also makes sense, because then you automatically know the source.

Would it make sense to remove the id option?

AngelMunoz commented 1 year ago

The original way to add templates was the -tn flag, and there were no wizard-like commands, so it was very annoying to type the full name, but I'm settled on removing hiding that flag now as either group, and -t are good enough for this kind of use case

As for why I want to offer both -id and -t flags:

-t is a quick short string which may not be explicative the example is -t ff if you're familiar then ff makes sense to fable-feliz but for other people it might not be as straight forward, the id flag for me means a clear way to differentiate templates even if their -t counterparts might look like the same for other templates

Having both doesn't affect us much, and -id fills what -tn was used for (a fully qualified way to ensure the template you selected is the one you actually want)

kaeedo commented 1 year ago

Thanks for the explanation. In that case i'll also do this change, and at the same time remove the -tn option. Sound good?

AngelMunoz commented 1 year ago

Yep, that sounds good!

AngelMunoz commented 1 year ago

This is out in beta 21!