10up / wp-scaffold

10up WordPress project scaffold.
MIT License
194 stars 46 forks source link

Automate the process of renaming the theme and plugin to match the project name #204

Open dmtrmrv opened 9 months ago

dmtrmrv commented 9 months ago

Is your enhancement related to a problem? Please describe.

When starting a new project, engineers should change the name of the theme and plugin to match the project's name. This includes changing names in many places, like the theme folder, the domain, the theme name in the style.css file, and other parts.

It's best to have a clear, standard way to do this, like using a script or following a step-by-step guide.

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

claytoncollie commented 9 months ago

What if we changed all of the namespaces/text-domains/prefices/slugs in the scaffold and accounted for all of the variations? They could also be listed in the README to make sure they were replaced. This would still be a manual process but I think this needs to happen before adding automation. The variations below allow for an exact case search and replacement within the editor.

Namespace

ClientName\ProjectName

Text domain

project-name

Prefix

project_name

Constant

PROJECT_NAME
dmtrmrv commented 9 months ago

I agree with the phased approach. Makes perfect sense.

tobeycodes commented 7 months ago

My personal opinion is that we should discourage this outside of perhaps changing the folder name and anything public such as the style.css. The more a project diverges from the scaffold the harder it is to keep up to date. I would love to see a world we are able to from a CLI command, codemod or package update we can bring in the latest changes from the scaffold into existing projects.