haxtheweb / issues

Issue queue for hax, haxcms, elmsln, lrnwebcomponents, wcfactory, websites and more.
Apache License 2.0
11 stars 2 forks source link

[feature request] Rename web-component with CLI #2187

Open zdodson21 opened 5 days ago

zdodson21 commented 5 days ago

Would be cool to be able to rename web components created with the CLI, in case a user names a component during creation but then later realizes another name might work better.

A thought for how this could work: hax rename [path to component directory] [new component name]

Basically a command to tell the CLI to rename the component, then the path to the component directory, and the name the user wishes to change it to, changing it both in files and changing relevant file names.

btopro commented 4 days ago

we'll need some rearchitecting of how the hax webcomponent command works because right now there: hax start (general, start program that branches to webcomponent or site programs) hax site start running a sub-command of site however, hax webcomponent my-element is the only way to use webcomponent command as if has no sub-commands

I don't mind the idea of a rename command but it is a lot more involving than you are describing given folder-name as well as everything deriving from folder-name (SubClass, tag name, file names, haxProperties wiring) would also need to be renamed. It's not impossible, and I'd be open to it, but it's probably like you have, an actual hax rename because then it could detect scope as webcomponent, haxtheme (@winstonwumbo working on this now), or site and then behave accordingly. sites being renamed CAN work without folder matching metadata.site.name however it's better practice they conform.