You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local Environment: Replace custom setup logic with a Blueprints-based setup #9
Using the requested PHP / WordPress version via CLI options
Aims to have a JSON config at some point
These are Blueprints features. There's no need to re-implement them from scratch. Let's use and contribute to a common standard that other Playground projects will immediately benefit from.
changed the title [-]Local Environment: Use Blueprints for setup[/-][+]Local Environment: Setup with Blueprints (instead of rebuilding features Blueprints already provide)[/+]on May 23, 2023
changed the title [-]Local Environment: Setup with Blueprints (instead of rebuilding features Blueprints already provide)[/-][+]Local Environment: Replace custom setup with a Blueprints-based setup[/+]on May 23, 2023
changed the title [-]Local Environment: Replace custom setup with a Blueprints-based setup[/-][+]Local Environment: Replace custom setup logic with a Blueprints-based setup[/+]on May 23, 2023
In short, it's a declarative data format where you communicate all the steps needed to set up a WordPress instance, and then the executor finds the optimal way of running these steps. They work in the browser and in Node.js.
For now this means downloading files in parallel with a concurrency limit. In the future it will involve flattening and parallelizing entire steps.
This Blueprint, for example, downloads a plugin and a theme in parallel and then installs both:
^ Blueprints will be merge-able, which means I'll be able to take a Blog Blueprint and a Woo store Blueprint and create a Woo Blog that uses the right PHP and WordPress versions.
I love the concept and do think blueprints are an awesome approach. For my specific use case of using the playground as a wp-env replacement, it would be great to have a way to pass a path to a blueprint for my local project as an optional parameter to wp-now. Maybe something like wp-now start -b './blueprint.json'. Some more specific thoughts:
Ideally it would automatically use something like playground.blueprint.json by default and as fallback
Some data might be provided twice like the php version and the wp version since they can be provided as parameters. Some have to take precedence
This allows to easily prepare various blueprints for various tests inside my ci. To me, it seems like a nice adoption of the committable wp-env.json file.
I love the idea of not only sharing the exact same setup with other developer inside a repo, but also provide example data through php snippets and also use the same instance for ci tests. So many possibilities 🤯
Reacted by Wojtek Naruniec, Antonio Sejas and Adam Zieliński
Activity
[-]Local Environment: Use Blueprints for setup[/-][+]Local Environment: Setup with Blueprints (instead of rebuilding features Blueprints already provide)[/+][-]Local Environment: Setup with Blueprints (instead of rebuilding features Blueprints already provide)[/-][+]Local Environment: Replace custom setup with a Blueprints-based setup[/+][-]Local Environment: Replace custom setup with a Blueprints-based setup[/-][+]Local Environment: Replace custom setup logic with a Blueprints-based setup[/+]danielbachhuber commentedon May 23, 2023
How do Blueprints work?
adamziel commentedon May 23, 2023
I wrote up this documentation last week: https://wordpress.github.io/wordpress-playground/docs/blueprints-api/index
In short, it's a declarative data format where you communicate all the steps needed to set up a WordPress instance, and then the executor finds the optimal way of running these steps. They work in the browser and in Node.js.
For now this means downloading files in parallel with a concurrency limit. In the future it will involve flattening and parallelizing entire steps.
This Blueprint, for example, downloads a plugin and a theme in parallel and then installs both:
{ "steps": [ { "step": "installPlugin", "pluginZipFile": { "resource": "wordpress.org/plugins", "slug": "coblocks" } }, { "step": "installTheme", "pluginZipFile": { "resource": "wordpress.org/themes", "slug": "pendant" } } ] }This one resolves the PHP and WordPress version to use:
{ "preferredVersions": { "php": "7.4", "wp": "5.9" } }^ Blueprints will be merge-able, which means I'll be able to take a Blog Blueprint and a Woo store Blueprint and create a Woo Blog that uses the right PHP and WordPress versions.
adamziel commentedon May 23, 2023
An update on that last point: WordPress/blueprints#49
JUVOJustin commentedon Jun 11, 2023
I love the concept and do think blueprints are an awesome approach. For my specific use case of using the playground as a wp-env replacement, it would be great to have a way to pass a path to a blueprint for my local project as an optional parameter to wp-now. Maybe something like
wp-now start -b './blueprint.json'. Some more specific thoughts:This allows to easily prepare various blueprints for various tests inside my ci. To me, it seems like a nice adoption of the committable wp-env.json file.
I love the idea of not only sharing the exact same setup with other developer inside a repo, but also provide example data through php snippets and also use the same instance for ci tests. So many possibilities 🤯
Scoped WordPress instances to support multiple browser tabs (WordPres…