Getting Started Docs: Update to use wp-env#20044
Conversation
|
I think it's time to deprecate this setup and replace it with |
Can you point me to up-to-date instructions on how to run Gutenberg locally? 😅 Since apparently I don't know. FWIW, I arrived at this doc through https://github.com/WordPress/Gutenberg -> 'Please see CONTRIBUTING.md.' -> 'Code? See the developer section.' -> 'Getting Started.' 🍿 Are you saying that that isn't the most obvious getting started doc? 😱 |
docs/contributors/getting-started.md
Outdated
| npm run env install | ||
| ``` | ||
|
|
||
| You will then also have to build your local WordPress install by running |
There was a problem hiding this comment.
It's odd that you should have to do this. env install, or a related command, should be handling any such needs automatically, IIRC. For instance, running env update pulls the latest changes and builds anew. I wonder if anything regressed.
There was a problem hiding this comment.
Yeah, the fact that Noah was running into the same problem seemed to indicate to me that something might've regressed...
There was a problem hiding this comment.
Right, I originally figured out what command to run because I looked through the code and saw that it was supposed to be running the npm commands within the WordPress repo. So it is probably worth fixing in the script if we want to keep this package working!
I think the simplest would be cd gutenberg
npm i -g @wordpress/env
wp-env startSee #17724 for more on |
$ wp-env start
✖ .IOError: [Errno 13] Permission denied: '~/.nvm/versions/node/v12.14.0/lib/node_modules/@wordpress/env/lib/docker-compose.yml'😕 |
|
Gonna try |
|
It writes a file in That will change in an upcoming PR but you should still get it sorted as I think a lot of popular tools do the same right now. |
npx wp-env start
✔ Started WordPress@master. (in 87s 449ms)🎉 I'll keep this PR open, since I didn't see https://github.com/WordPress/gutenberg/blob/master/packages/env/README.md linked anywhere from the root level README, nor the trail I was describing. We can use it to properly update docs to point to the @wp/env README. |
|
Yes, without a trail this time 😄 Also, see #20002. |
4994f4f to
301c127
Compare
| npx wp-env start | ||
| ``` | ||
|
|
||
| #### Alternative Method: Using an Existing Local WordPress Install |
There was a problem hiding this comment.
I removed the entire section since I wasn't how to fit this in the bigger picture anymore; I had to modify a lot of the commands in subsequent sections to use wp-env, which wouldn't work with the instructions in this section. Okay to retire the alternative method section?
There was a problem hiding this comment.
wp-env does support this with the config file PR. We might want to mention it here.
docs/contributors/getting-started.md
Outdated
| Example on Linux/MacOS: | ||
| ``` | ||
| LOCAL_SCRIPT_DEBUG=false LOCAL_WP_DEBUG=false npm run env install | ||
| LOCAL_SCRIPT_DEBUG=false LOCAL_WP_DEBUG=false npx wp-env start |
There was a problem hiding this comment.
Does this work with wp-env?
There was a problem hiding this comment.
No, you have to navigate to the installation and edit the wp-config.php file for now.
@noisysocks We could add support to the wp-env config file though, right?
There was a problem hiding this comment.
Yes it's on my list of follow-up work once #20002 is merged! 🙂
|
Okay, updated the docs. Wasn't sure about a few sections and would appreciate a review @epiqueras @mcsf 😄 |
wp-env
docs/contributors/getting-started.md
Outdated
| #### Troubleshooting | ||
|
|
||
| You might find yourself stuck on a screen stating that "you are running WordPress without JavaScript and CSS files". If you tried installing WordPress via `npm run env install`, it probably means that something went wrong during the process. To fix it, try removing the `/wordpress` folder and running `npm run env install` again. | ||
| You might find yourself stuck on a screen stating that "you are running WordPress without JavaScript and CSS files". If you tried installing WordPress via `npx wp-env start`, it probably means that something went wrong during the process. To fix it, try removing the `/wordpress` folder and running `npm run env install` again. |
There was a problem hiding this comment.
This doesn't apply. See the wp-env docs for troubleshooting info.
5d48d1a to
116893b
Compare
116893b to
83ef9cb
Compare
|
Thanks for your notes @epiqueras! I rebased the PR and addressed your feedback -- this is ready for another look. |
* Update main project README Update main project repository reamde with various updates that bring it current for now and down the line. First organized it into a more general getting started recognizing the three levels that people might be coming to the project: as a User, as a Devleoper, and as a Contributor For User - added links to the user documentation, support forums, and how to report an issue For Develoepr - added links to the developer documentation For Contributor - simplifed the contributor sections and links to the contributors guide I removed the links at the bottom since those are mostly dated from when the project was starting out and justifying itself. These links can be included elsewhere for background and context, and not necessary on the welcoming page. * Use capitalize Block Editor, rework sentence * Update plugin readme.txt * Restore Code is Potery * Titlecase title * Updated intro paragraphs * Update Gutenberg screenshot * Text edit - tone down the revolution * Apply suggestions from code review Thanks for the updates 👍 Co-Authored-By: Chris Van Patten <hello@chrisvanpatten.com> * Add link for Getting Started guide, from #20044 Co-authored-by: Chris Van Patten <hello@chrisvanpatten.com>
Description
There's apparently a build step currently missing from the Getting Started docs.
How has this been tested?
If you just follow the current Getting Started instructions up until
npm run env install, you'll see the following at http://localhost:8889/ :None of the suggestions listed there actually work. Instead, you have to
cd wordpress/ && npm run dev. Thanks to @noahtallen for pointing this out to me:(Adding that I'm seeing this on Linux, but it's probably not OS specific -- I don't think Noah is using Linux?)
Types of changes
Doc change
Checklist: