devloco / create-react-wptheme

Create modern, React-enabled WordPress themes with a single command.
MIT License
359 stars 60 forks source link

More detailed deployment instructions/troubleshooting? #20

Closed adigitalnative closed 5 years ago

adigitalnative commented 5 years ago

Is there any additional info about deployment located somewhere?

I've run the wpbuild and dropped the build folder into my server. I'm getting a white screen and 404 errors - any thoughts or pointers on how to troubleshoot?

devloco commented 5 years ago

Hi @adigitalnative,

I saw you closed this, but I'm going to reopen it to remind me to put some clearer instructions in the readme for deployment. And just to be clear, yes, the build folder can be deployed. Also, the build folder is copied to the root. So you could deploy from there, just leaving off the react-src folder in that case.

Thanks!

adigitalnative commented 5 years ago

Great! I felt a little silly asking after I poked around for a moment and figured out how to deploy, but more info would be good for future users.

One little thing I ran into, and this may be a configuration issue on my end: the 'build' folder contents, not the folder itself, needs to end up in a folder with the same name as what you used to create-react-wptheme. Not a major issue/I was able to troubleshoot pretty quickly, but I could see it causing some confusion for newer devs trying to take a site to production.

devloco commented 5 years ago

You bring up issue I’ve mentally struggled with since I started this project. You need the index.php and style.css files to be in root for Wordpress to consider the folder as a valid theme. So I consider the “react-src” folder as something that is inherently confusing.

I’ve thought and thought on it, but can’t really come up with an idea that meets all the technical requirements and is easy to understand for users... and so far, I still think it’s a bit confusing.

Any suggestions are welcome. I’ll try anything. More instructions on screen while developing..? More instructions in the readme...?

Anyway I’m out of town this week but I’ll look at any suggestions when I get home this weekend.

Thanks!

adigitalnative commented 5 years ago

Solutions:

  1. Accept that it is the way it is, and just put some really clear README Instructions in place. Not ideal, but it can get the job done. Having screen prompts after running wpbuild might be helpful too, though I personally prefer a readme so I can figure out what I’m doing BEFORE I run a command, rather than following a process through without knowing the path I’m heading down.

If you'd like a PR with some basic 'how to' info in the readme, I might be able to whip something super basic up.

  1. Is there any way that the build tool can spit out a complete, ready to go theme - IE /that/ is the thing that you upload directly to your production server? Pull the name from the files, and then name your build folder to that?

Jacqueline Chenault jq@nativefoundry.com

202.489.6128 Github | Linkedin | Portfolio


On Jun 5, 2019, 2:40 PM -0400, devloco notifications@github.com, wrote:

You bring up issue I’ve mentally struggled with since I started this project. You need the index.php and style.css files to be in root for Wordpress to consider the folder as a valid theme. So I consider the “react-src” folder as something that is inherently confusing. I’ve thought and thought on it, but can’t really come up with an idea that meets all the technical requirements and is easy to understand for users... and so far, I still think it’s a bit confusing. Any suggestions are welcome. I’ll try anything. More instructions on screen while developing..? More instructions in the readme...? Anyway I’m out of town this week but I’ll look at any suggestions when I get home this weekend. Thanks! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

devloco commented 5 years ago

Hi @adigitalnative,

I just updated the readme and build code. I think it's better. The changes to the readme are mostly choosing phrases that make more sense "Developing Your Theme" and "Deploying Your Theme" for example.

Then I made changes to the build script. Here's what it does now:

There is an outline of the file/folder structure after a build in the readme here.

Anyway, if you get a chance to take a look, please let me know what you think.