realdecoy / frontier

Realdecoy Frontier
3 stars 2 forks source link

Added ability to import prebuilt ui components from .rdvue #85

Closed nxtedecoy closed 4 months ago

nxtedecoy commented 9 months ago

🔗 Linked issue

❓ Type of change

📚 Description

Adds the ability to import prebuilt components located in .rdvue/components/ui in our Vue3 template. This adds a new flag --ui to the vue add component command. When the command is run with this flag a checklist prompt appears, prompting you to select one of the available components which are checked at runtime and displayed. The updated template isn't what gets pulled with frontier vue create-project command. So the components aren't actually available so what you'll have to do to test is just copy the .rdvue/template/components folder into your current project and it will work.

📝 Checklist

Davane commented 9 months ago

The command to add the components from the new component libraries is currently frontier vue add component --ui. @andre-vidal was this the expectation?

Maybe it could be something like frontier vue plugin shadcn --install or frontier vue plugin component --install. Then we could do frontier vue plugin [ shadcn | component ] button to add a new component from the component library to the project. We could get rid of the install flag all together and install the dependencies (if not already installed) when we try to add a new component from the library to the project. The reason why I expected something along that line is because:

  1. It follows a similar pattern as Buefy.
  2. It separates the creation of a custom component and a component from the library (which has pros and cons).

Things I don't like about it:

  1. The command is a bit long
  2. We would have two separate commands to add components. The original frontier vue add component command and this new way with the plugin keyword.

Not sure if this approach is the best route but any ideas are welcome even if that means leaving it as is with the --ui flag. @carl-clarke @Saspect-IO @forevergareth any thoughts?