Conversation
| { | ||
| "core": "WordPress/WordPress", | ||
| "plugins": [ "https://downloads.wordpress.org/plugin/gutenberg.latest-stable.zip" ], | ||
| "themes": [ "https://downloads.wordpress.org/theme/twentytwentythree.latest-stable.zip" ], |
There was a problem hiding this comment.
Atlas needs TT3 as a dependency
mikachan
left a comment
There was a problem hiding this comment.
When I ran npm run env:start -- --theme blue-note, the env started fine, and I saw this success:
But it tried to activate Twenty Twenty-Five instead, which doesn't exist here. I could still manually switch to Blue Note afterwards, which worked fine.
And when I stopped the env and then ran npm run env:start -- --theme archivist, I saw the same success message again:
But Blue Note was still active.
Otherwise, the test environment is working well for me.
env.mjs
Outdated
| const port = await findFreePort(); | ||
| const testsPort = await findFreePort( port + 1 ); |
There was a problem hiding this comment.
These port checks are called for env:start, but we don't use anything similar for env:stop or env:destroy. Should the port that's being used be checked for these commands? I'm wondering if wp-env might accidentally stop or destroy the wrong instance if it hasn't checked the port.
There was a problem hiding this comment.
I think this whole thing might be more trouble than anything, I'll see what I can do
There was a problem hiding this comment.
I'm making it so that we store the active port in a file, and if we re run the env with a new theme it just changes it instead of destroying it/starting a new one again.
mikachan
left a comment
There was a problem hiding this comment.
Running npm run env:start -- --theme blue-note is working well for me now. Thanks! 🚢
Adds a local development environment powered by wp-env. All themes in the repo are available out of the box.
--theme <slug>activates a theme after startup; if the environment is already running, it skips startupand just switches the active theme
env:stopandenv:destroyread the saved port from .wp-env-port to always target the correct instanceactually switched
How to test
npm run env:start -- --theme blue-note
npm run env:start -- --theme archivist
npm run env:start -- --theme this-does-not-exist
npm run env:stop
npm run env:start
npm run env:stop
npm run env:start -- --theme blue-note
npm run env:destroy