devloco / create-react-wptheme

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

How to update? #7

Closed this-is-rafa closed 5 years ago

this-is-rafa commented 5 years ago

Hi, thanks for this project. It's been really handy.

I started a project when the build bug was still a thing. I'm wondering if you could tell me how to update. npm update doesn't work.

Thanks.

devloco commented 5 years ago

Apologies for the delay. And thank you for letting me know this project has been useful for you. You're officially the first person to tell me that you use it and like it.

As for updating, I'll have to look at what NPM steps to take and document them in the README. I'll get that done this week.

In the meantime, a quick-n-dirty process would be:

I'll leave this ticket open to remind me to document an official update process.

Thanks again!

-joe

devloco commented 5 years ago

@this-is-rafa, I was just surfing your jolt-theme repo and looked at the package.json there. I bet if you change version of:

"@devloco/react-scripts-wptheme": "2.1.1-wptheme-2.0.8",

to be:

"@devloco/react-scripts-wptheme": "2.1.1-wptheme-2.1.1",

Note "2.0.8" to "2.1.1" and then run npm install in there, you'll get updated in a proper fashion.

devloco commented 5 years ago

I've added NPM updating instructions to the README. I got the ideas from Facebook's updating instructions. The new section added to the README is:

Updating

When new versions of Create React WP Theme are released, you can upgrade using a single command.

From within your theme's react-src folder, run this command at a command prompt:

npm install @devloco/react-scripts-wptheme@latest

If your theme uses TypeScript, you'll need to run a second command (create-react-wptheme uses the Types from Facebook's React-Scripts):

npm install react-scripts@latest

this-is-rafa commented 5 years ago

Wow, thanks for much for the thorough investigation and solution. I've not tried it yet but it looks like it should work no problem.

You're officially the first person to tell me that you use it and like it.

It works like it says on the tin and it's a great way to get into React and the Wordpress API at the same time. Thanks again!