Extract Blueprint v1-specific parts of Playground CLI - #2392
Merged
Conversation
adamziel
force-pushed
the
support-blueprints-v2-part1
branch
from
July 21, 2025 18:27
95c25aa to
7d64e6d
Compare
adamziel
force-pushed
the
support-blueprints-v2-part1
branch
from
July 21, 2025 18:33
7d64e6d to
76c3dc5
Compare
adamziel
marked this pull request as ready for review
July 21, 2025 18:38
adamziel
added a commit
that referenced
this pull request
Jul 22, 2025
## Motivation for the change, related issues Adds Blueprints v2 support to Playground CLI via the `--experimental-blueprints-v2-runner` flag. A part of #2223 ## Implementation details Following the structure set up in #2392, this PR adds: * A separate worker script `worker-thread-v2.ts` for starting workers relying on Blueprints V2 * A `BlueprintsV2Handler` class that enables using the new worker from the main CLI thread ## Testing Instructions (or ideally a Blueprint) Confirm the `--experimental-blueprints-v2-runner` flag yields output similar to this – it's produced by the Blueprints v2 runner: ``` $ PHP=7.4 node --loader=./packages/meta/src/node-es-module-loader/loader.mts ./packages/playground/cli/src/cli.ts server --experimental-blueprints-v2-runner --blueprint=https://raw.githubusercontent.com/wordpress/blueprints/refs/heads/trunk/blueprints/custom-post/blueprint.json Running WP-CLI command: wp post create --post_type=gbtbooks --post_title='WordPress Styling with Blocks, Patterns, Templates, and Themes' --post_content='<!-- wp:paragraph --><p>Explore WordPress styl Complete – 100.00% Booted! WordPress is running on http://127.0.0.1:9400 ``` Confirm the CLI still works without the `--experimental-blueprints-v2` flag: ``` $ PHP=7.4 node --loader=./packages/meta/src/node-es-module-loader/loader.mts ./packages/playground/cli/src/cli.ts server --blueprint=https://raw.githubusercontent.com/wordpress/blueprints/refs/heads/trunk/blueprints/custom-post/blueprint.json Starting a PHP server... Setting up WordPress latest Resolved WordPress release URL: https://downloads.w.org/release/wordpress-6.8.2.zip Fetching SQLite integration plugin... Booting WordPress... Booted! Running the Blueprint... Logging in – 100% Finished running the blueprint WordPress is running on http://127.0.0.1:9400
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for the change, related issues
This PR sets the stage for integrating Blueprints v2. All the Blueprints v1-specific parts are moved to a new class called
BlueprintsV1Handler. This opens the door to implementingBlueprintsV2Handler.A part of #2223
Testing Instructions (or ideally a Blueprint)
This PR mostly moves code around without changing the logic. Just run a smoke test:
And a few others from https://wordpress.github.io/wordpress-playground/developers/local-development/wp-playground-cli