playground-tools
playground-tools copied to clipboard
Local Environment: Auto-apply plugin or theme Blueprint when initializing
In certain cases, a plugin or theme may want to have its local environment pre-configured to a default state. It would be cool if our wp-now.json
file supported a blueprint
attribute, so that the blueprint is auto-applied when running wp-now start
for the first time.
Conceptually, is wp-now.json
any different from a Blueprint? If not, then we could join forces here to make Blueprints better.
Blueprints already support setting preferred PHP/WP versions and in the future they'll also support:
- Setting min/max PHP/WP versions
- Specifying custom WordPress core (via a path or a url)
- Specifying the required PHP extensions
- ...probably many other things that will also be useful in context of
wp-now.json
What would be an example of a setting that's useful in wp-now.json
but not in a Blueprint?
Conceptually, is
wp-now.json
any different from a Blueprint? If not, then we could join forces here to make Blueprints better.
@adamziel Maybe not. What filename are Blueprints using? Could we adopt the "Blueprint format" for wp-now.json
?
Could we adopt the "Blueprint format" for wp-now.json?
I think so – it would also inform the evolution of the Blueprint format.
What filename are Blueprints using?
Blueprint isn't using any filename at the moment. It's just a JSON object you can pass to startPlaygroundNode()
or apply it manually as follows:
https://github.com/WordPress/wordpress-playground/blob/2b01f8dbd63e6e54db8e579f5687fe70e8bd7237/packages/playground/node/src/index.ts#L23-L55
CC @sejas on that startPlaygroundNode()
function referenced above – perhaps it could be reused by or moved into wp-now
.
@adamziel it would be great if WordPress Playground for VS Code could automatically pick up a blueprint from the current repository.