baumrock / RockMigrations

The Ultimate Automation and Deployment-Tool for ProcessWire
MIT License
33 stars 10 forks source link

add: export code sort, cleanup empty arrays [], print in textarea, 4 spaces tabs #55

Closed donatasben closed 7 months ago

donatasben commented 7 months ago

Hi. I would like to offer some small improvements to export code display for fields and templates. My suggestions:

BernhardBaumrock commented 7 months ago

Very nice thank you @donatasben !

I kept the 4 spaces to say thank you ;)

donatasben commented 7 months ago

Thanks! :) I think that the spaces amount could become a module config option! But didn't have time to implement just now.

BernhardBaumrock commented 7 months ago

yeah I thought about adding a switch via JS to it :) If you want to give cursor a try these things can really be easily added with AI! see https://processwire.com/talk/topic/29439-cursor-might-be-my-vscode-replacement/ Just mark the spot where to add the buttons and tell it what to do and it will code for you.

BernhardBaumrock commented 7 months ago

So maybe two buttons below the field: "copy with 2 spaces", "copy with 4 spaces"

BernhardBaumrock commented 7 months ago

Ah and have a look here: https://github.com/baumrock/RockMigrations/commit/e958d3d5d232cac996efe4f9757476751223211f

This will be really simple as the copy method is already there in the RockMigrations JS !

BernhardBaumrock commented 7 months ago

Sorry - it's too late :) Have a look at the mentioned commit. You can now copy single migration settings directly from within the admin via shift-click!

image
donatasben commented 7 months ago

Cool! Yes, the AI helps a lot these days! I'm completely clueless with regex, so it usually super helpful there :D

About the spaces: I think it's a once-set-and-forget type of situation. If a person is working that has a preference, or if a team with some Prettier setting to keep consistency - it's rarely the need to have 2 and 4 space options on hand all at once.