Skip to content

Expose Blueprints v2 runner in Playground CLI #2394

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

Merged
merged 4 commits into from
Jul 22, 2025
Merged

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Jul 21, 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

@adamziel adamziel merged commit 51533b7 into trunk Jul 22, 2025
46 of 50 checks passed
@adamziel adamziel deleted the blueprints-v2-bindings branch July 22, 2025 07:54
@adamziel adamziel mentioned this pull request Jul 22, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant