[Blueprints] Load v2 WordPress data-reference sources - #4005
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Enables Blueprint v2 callers (web, CLI, worker) to supply WordPress core as a resolved archive when wordpressVersion is a v2 data reference (execution-context path, inline file/dir, Git), avoiding runtime rejection and redundant core downloads.
Changes:
- Add
wordPressZipsupport to the worker boot options and skip core download when it’s provided. - Resolve v2
wordpressVersiondata references into a concrete archive via the existing resource loader (resolveBlueprintV2WordPressSource), and pass it through client/CLI boot boundaries. - Update/extend tests to cover custom WordPress archive resolution and “no core download” behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/playground/remote/src/lib/playground-worker-endpoint.ts | Extends worker boot options with a caller-supplied WordPress archive. |
| packages/playground/remote/src/lib/playground-worker-endpoint-blueprints-v1.ts | Skips WordPress core download when wordPressZip is provided; forwards archive to boot. |
| packages/playground/remote/src/lib/playground-worker-endpoint-blueprints-v1.spec.ts | Adds test ensuring caller-provided core avoids core download. |
| packages/playground/client/src/blueprints-v2-handler.ts | Resolves v2 WordPress sources to an archive and passes it to the worker. |
| packages/playground/client/src/blueprints-v2-handler.spec.ts | Adds test ensuring resolved archive is forwarded to worker boot. |
| packages/playground/cli/src/blueprints-v2/blueprints-v2-handler.ts | Uses v2 WordPress archive resolver before falling back to download in CLI. |
| packages/playground/cli/tests/blueprints-v2-handler.spec.ts | Tests bundled v2 archive path avoids core download (CLI). |
| packages/playground/blueprints/src/lib/v2/resolve-runtime-configuration.ts | Treats v2 WordPress data references as a synthetic runtime label (custom). |
| packages/playground/blueprints/src/lib/v2/compile.ts | Adds resolveBlueprintV2WordPressSource and plumbing to map v2 references to v1 resources. |
| packages/playground/blueprints/src/index.ts | Exports the new v2 WordPress source resolver API. |
| packages/playground/blueprints/src/tests/v2/resolve-wordpress-source.spec.ts | New unit tests for data-reference WordPress source resolution. |
| packages/playground/blueprints/src/tests/v2/resolve-runtime-configuration.spec.ts | Updates runtime-config tests to accept v2 WordPress data references. |
Comments suppressed due to low confidence (1)
packages/playground/cli/src/blueprints-v2/blueprints-v2-handler.ts:1
wordPressZipis now typed asFile | undefinedin the CLI handler, but the CLI pathway commonly operates on transferable byte payloads (e.g.,Uint8Array/ArrayBuffer) rather than DOMFiles. GivenresolveBlueprintV2WordPressSource()is exported for both web and CLI use, it would be safer to typewordPressZipbased on that function’s real return type (or a shared archive payload type) to avoid DOM-specific types leaking into Node/worker code and to prevent accidental.arrayBuffer()/.text()usage where it may not exist.
import { logger } from '@php-wasm/logger';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 10, 2026
adamziel
force-pushed
the
blueprint-v2-wordpress-data-sources
branch
from
July 10, 2026 23:55
bb86ac0 to
ae82d73
Compare
adamziel
added a commit
that referenced
this pull request
Jul 11, 2026
## What Remove the retired Blueprint v2 opt-in aliases now that v2 declarations select the native TypeScript path automatically. - The hidden CLI `--experimental-blueprints-v2-runner` flag and its v1-option translations are gone. - `WorkerBootOptions.experimentalBlueprintsV2Runner`, which was already a no-op, is gone. - Personal WP no longer gives the retired query parameter special cleanup behavior. - Auto-mounted themes always emit the normal v1-shaped activation step; the v2 handler already owns the one required shape conversion. ## Breaking change Callers still passing `--experimental-blueprints-v2-runner` must remove it. Use a v2 declaration for automatic selection, or use `--mode` to choose `create-new-site`, `apply-to-existing-site`, or `mount-only`. Use `--allow=follow-symlinks` and `--allow=read-local-fs` for the capabilities the alias used to infer from old flags. Code passing `experimentalBlueprintsV2Runner` in worker boot options must remove that property. It has had no effect since handler selection moved before worker boot. ## Testing - `npm exec -- nx run-many -t typecheck -p playground-cli playground-personal-wp playground-remote --parallel=3` - `npm exec -- nx run-many -t lint -p playground-cli playground-personal-wp playground-remote --parallel=3` - `npm exec -- nx run playground-cli:test-playground-cli --testFiles=mounts.spec.ts` - `npx vitest run --config packages/playground/cli/vite.config.ts packages/playground/cli/tests/run-cli.spec.ts -t "should reject the retired experimental v2 flag"` - `npm exec -- nx test playground-personal-wp --testFile=landing-page.spec.ts` ## Stack 1. #4005 2. #4006 3. This PR
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.
What
Load custom
wordpressVersiondata references in TypeScript Blueprints v2.Blueprints v2 can now load WordPress from a custom ZIP, a directory embedded in the Blueprint, or a directory in Git. The ZIP can sit next to the Blueprint or be embedded in it. Directory sources are turned into ZIPs before WordPress boots. Both the browser and CLI use the supplied source instead of downloading another WordPress build.
Built-in versions and HTTP(S) archives keep their existing download paths. This takes the useful source-resolution idea from #3725 without reviving that PR's compiler, validator, or migration work.
Why
The public v2 schema already accepts general data references for
wordpressVersion, but the TypeScript runtime rejected every form except HTTP(S). A valid Blueprint could therefore validate and still fail before boot.Testing
CI