[Website] Add Blueprint bundle resource path helper - #3966
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.
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.jsonback into aWritableFilesystemBackend-backedoriginalBlueprint. - 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.
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 it does
Adds
collectBlueprintBundleResourcePaths(), a helper that finds the files a Blueprint bundle must keep alongsideblueprint.jsonbefore the bundle is edited. This will come handy for editing Blueprint bundles later on in the Dock UI work.The helper covers:
{ resource: "bundled" }references anywhere in the declarationRelated to #3965.
Other changes
This PR also records the path-handling rule in
AGENTS.md: use existing@php-wasm/utilpath helpers instead of ad-hoc regex/string parsing.Testing instructions