[Blueprints] Export resolveBlueprintFromURL, applyQueryOverrides and parseBlueprint functions in the @wp-playground/blueprints package #2867
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.
Motivation for the change, related issues
In the past when we had only JSON Blueprints v1 it was easy download and customize a Blueprint with vanilla JS, but today we have Blueprints v1 and v2, JSON Blueprints, and bundles.
For a site that uses the
@wp-playground/clientpackage, there's currently no easy way to download a Blueprint and adjust it, but the Playground website has helper functions that enable the query API to fetch and override a Blueprint.This PR moves the
resolveBlueprintFromURL,applyQueryOverrides,parseBlueprintfunctions, and related types to the@wp-playground/blueprintspackage, so users can import and use these helper functions.We had to move the code out of the website package because it isn't public, while the Blueprint package is.
The PR also moves the base64 related helpers to
@wp-playground/commonas this seemed like a appropriate place for these helpers.Implementation details
TBD
Testing Instructions (or ideally a Blueprint)
TODO