Skip to content

[Website] Add Blueprint bundle resource path helper - #3966

Merged
adamziel merged 7 commits into
trunkfrom
blueprint-editor-bundle-helpers
Jul 9, 2026
Merged

[Website] Add Blueprint bundle resource path helper#3966
adamziel merged 7 commits into
trunkfrom
blueprint-editor-bundle-helpers

Conversation

@adamziel

@adamziel adamziel commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

What it does

Adds collectBlueprintBundleResourcePaths(), a helper that finds the files a Blueprint bundle must keep alongside blueprint.json before the bundle is edited. This will come handy for editing Blueprint bundles later on in the Dock UI work.

The helper covers:

  • Blueprint v1 { resource: "bundled" } references anywhere in the declaration
  • Blueprint v2 execution-context references in themes, plugins, media, content, fonts, post types, and additional steps

Related to #3965.

Other changes

This PR also records the path-handling rule in AGENTS.md: use existing @php-wasm/util path helpers instead of ad-hoc regex/string parsing.

Testing instructions

npm exec nx test playground-website --testFile=blueprint-bundle-resource-paths.spec.ts
npm exec nx lint playground-website
npm exec nx typecheck playground-website

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.

Adds reusable Blueprint editor helper utilities to (a) collect bundle-backed resource paths from Blueprint v1/v2 shapes and (b) persist updated blueprint.json into bundle-backed filesystem metadata, with accompanying Vitest coverage.

Changes:

  • Added helper to write blueprint.json back into a WritableFilesystemBackend-backed originalBlueprint.
  • Added helper to collect bundle resource paths across Blueprint v1 (“bundled”) and Blueprint v2 execution-context references (with v2 .. escape rejection).
  • Added Vitest specs for bundle-path collection and filesystem writes.

Reviewed changes

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

File Description
packages/playground/website/src/components/blueprint-editor/blueprint-filesystem.ts Adds filesystem-backend type guard + helper to write updated blueprint JSON back into bundle metadata.
packages/playground/website/src/components/blueprint-editor/blueprint-filesystem.spec.ts Tests that the helper writes /blueprint.json only for filesystem-backed originals.
packages/playground/website/src/components/blueprint-editor/blueprint-bundle-resource-paths.ts Adds traversal/collection of bundle resource paths for Blueprint v1 and v2 structures.
packages/playground/website/src/components/blueprint-editor/blueprint-bundle-resource-paths.spec.ts Tests v1 bundled path collection, v2 execution-context collection, and v2 parent-directory escape rejection.

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

@adamziel adamziel changed the title [Website] Add Blueprint bundle editor helpers Jul 8, 2026
@github-actions github-actions Bot added the [Type] Documentation Improvements or additions to documentation label Jul 8, 2026
@adamziel
adamziel merged commit 738ddc2 into trunk Jul 9, 2026
102 of 103 checks passed
@adamziel
adamziel deleted the blueprint-editor-bundle-helpers branch July 9, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment