-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow wp-env to start without config #23913
Conversation
if ( | ||
config.env.development.coreSource && | ||
hasSameCoreSource( [ config.env.development, config.env.tests ] ) | ||
) { | ||
await copyCoreFiles( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this crashed when config.env.development
was undefined
Size Change: -109 B (0%) Total Size: 1.14 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! 👍
Do you think it'd be worthwhile to still echo something to the screen, so if it was done by mistake people would know? Could just be: "No .wp-env.json, plugin, or theme detected."
I think that would be valuable. What do you think about adding a prompt like "Would you like to create an empty WordPress instance?" |
I'd prefer no prompt, and just start it with a message. If it was a mistake, it is easy to stop and go where you want to and start again. I think prompting for empty will cause confusion, people may not know what empty means, plus it may not actually be empty if they've used it like this before. |
As I am following the steps in the development environment documentation I will be at the root prompt. It would be nice to get help with setting up a local WP site in the directory the users chooses. Using an example such as a "Sites" folder located inside the root folder. It could then be added to the development environment documentation, as a step to take before running wp-env start. As in cd into the existing or new folder to create a new local WP site. |
Here is a warning message that displays when running
how do you think this should be integrated? Instead of showing a warning message, we could show a message pointing them to documentation and then not set up a WordPress instance |
Taking a step back... In the WordPress Development Site section. https://github.com/WordPress/gutenberg/tree/docs/cab-devenv/docs/designers-developers/developers/tutorials/devenv After you have installed Docker, go ahead and install wp-env globally from the command-line using: npm -g install @wordpress/env wp-env --version
It seems that nothing is happening when one adds the This is how I see it: The wp-env package requires Docker to be installed. We will now create a new WordPress site. -> User types "YES" if it is the correct directory. The install process continues and a new local WP site is created in the "sites" directory. A message then says "A new WordPress site has been made in the sites directory/folder." User types "NO" and it goes back to prompt. After the local WP site has been made we then need help on how to access the newly created local WordPress site. Btw |
@noahtallen I think what you have is good to go. Let the environment start up, there is a message there that gives them a warning if they might be in the wrong spot, but explains why. 👍 Also, a WordPress environment could be used just to run WP locally and not necessarily do plugin or theme development. So let's merge this one, and see what feedback we get. |
We should explain that the purpose of this step is to install a tool, not to install an environment. It installs
I think this next section you describe is basically a guided "tutorial" to using
I definitely see where you're coming from on this! That said, I don't think this will happen. I think it's kind of a philosophical difference. I personally think this works out well and is simpler to use in general.
In #23809, we start showing a "configuring WordPress" message when the installation step happens, so that should help
Sounds good to me! We can of course continue working towards improvements after merging this. |
Description
Previously, if you ran
wp-env start
without a config (or if it couldn't detect a plugin to mount), it would fail. I'm not convinced this is expected behavior. Why not just allow people to create an empty WordPress instance?There are a few concerns I have with this:
cd
to the correct location in case you accidentally ranwp-env start
from somewhere randomwp-env start
from different directories on their machine, each instance would be different. (To be fair, it will error out when you have instances with the same port number.)This was motivated by discussion around documentation for starting your local environment and how to start it if you did not have a local source. (#23593)
I think this was also the behavior at some point in the past (it didn't fail if it couldn't find a config)
Additionally, this fixes a crash which occurred if you did not set a WordPress source.
How has this been tested?
Locally with
wp-env
Screenshots
Types of changes
enhancement
Checklist: