Skip to content

[Blueprints] Support bundled Blueprint v2 resources - #3912

Merged
adamziel merged 1 commit into
trunkfrom
support-blueprint-v2-bundle-resources
Jul 4, 2026
Merged

[Blueprints] Support bundled Blueprint v2 resources#3912
adamziel merged 1 commit into
trunkfrom
support-blueprint-v2-bundle-resources

Conversation

@adamziel

@adamziel adamziel commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

What it does

Allows compileBlueprintForExecution() to run Blueprint v2 bundles whose lowered steps reference files from the Blueprint execution context, such as ./plugin.php.

Rationale

The v2 compiler already lowers execution-context paths to v1 bundled resources. After #3911, those lowered steps can run, but bundle inputs still lost their file reader before reaching the v1 resource layer. That meant a runnable v2 bundle could fail as if it were a standalone JSON file.

Implementation

  • Removes the v2 bundle rejection from compileBlueprintForExecution().
  • Passes the bundle reader into compileBlueprintV2() as streamBundledFile.
  • Lets the v2 runner forward that reader to compileBlueprintV1() when it lazily builds the v1 runner.
  • Widens compileBlueprintV1() options to accept the existing streamBundledFile option directly, which the internal options type already supported.

The test uses a bundled single-file plugin with active: false. That keeps the assertion focused on bundle-resource resolution and avoids pulling in plugin activation or WordPress runtime behavior.

Testing instructions

npm exec nx run playground-blueprints:test:vite -- --testFiles=packages/playground/blueprints/src/tests/compile.spec.ts
npm exec nx run playground-blueprints:typecheck
npm exec nx run playground-blueprints:lint
npm exec nx run playground-blueprints:build

Part of #2592.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Enables Blueprint v2 bundles to execute when lowered v2 steps reference execution-context files (bundled resources like ./plugin.php) by plumbing a bundle file reader through the v2 compiler into the existing v1 runner.

Changes:

  • Allow compileBlueprintForExecution() to accept Blueprint v2 bundles and provide a streamBundledFile reader to the v2 compilation pipeline.
  • Forward streamBundledFile from the v2 runner into the v1 compiler when building the v1 runner.
  • Add a regression test that installs a bundled plugin file via a v2 bundle.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/playground/blueprints/src/tests/compile.spec.ts Adds a test ensuring v2 bundle execution can resolve bundled execution-context resources.
packages/playground/blueprints/src/lib/v2/compile.ts Introduces v2 compile options (streamBundledFile) and forwards them to v1 compilation at runtime.
packages/playground/blueprints/src/lib/v1/compile.ts Widens v1 compile options parameter to accept streamBundledFile directly.
packages/playground/blueprints/src/lib/compile.ts Removes v2 bundle rejection and wires bundle reading into v2 compilation via streamBundledFile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/playground/blueprints/src/lib/compile.ts
Comment thread packages/playground/blueprints/src/lib/v2/compile.ts Outdated
Comment thread packages/playground/blueprints/src/tests/compile.spec.ts Outdated
@adamziel
adamziel force-pushed the support-blueprint-v2-bundle-resources branch from 30ed706 to 8982d25 Compare July 4, 2026 01:52
@adamziel
adamziel merged commit 75e47df into trunk Jul 4, 2026
53 checks passed
@adamziel
adamziel deleted the support-blueprint-v2-bundle-resources branch July 4, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment