Skip to content

Expose Blueprints v2 runner in Playground CLI - #2394

Merged
adamziel merged 4 commits into
trunkfrom
blueprints-v2-bindings
Jul 22, 2025
Merged

Expose Blueprints v2 runner in Playground CLI#2394
adamziel merged 4 commits into
trunkfrom
blueprints-v2-bindings

Conversation

@adamziel

@adamziel adamziel commented Jul 21, 2025

Copy link
Copy Markdown
Collaborator

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