feat(playground): auto-load the editor in the WordPress Playground#51
Merged
Conversation
Add a writeFile + runPHP pair to the blueprint that fetches the shared eXeLearning editor release asset (github-proxy, CORS) over the fast JS transport and extracts it into the installed plugin's dist/static, so the playground boots with a working editor instead of requiring the manual "Download & Install Editor" button. The plugin is installed from the branch source archive, so its directory carries a branch suffix (wp-exelearning-<branch>); the extract step locates it with a glob and unzips with ZipArchive (already used by the fixtures step). The release asset wraps everything in a 'static/' folder, so extracting into 'dist' yields the dist/static/ layout the plugin loads from (EXELEARNING_PLUGIN_DIR . 'dist/static/index.html'). Pinned to v4.0.0 to match .editor-version. StaticEditorInstaller is kept for production/offline installs; the PR-preview note is updated accordingly.
Contributor
Test in WordPress PlaygroundTest the plugin with the code from this branch:
|
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
Auto-load the embedded eXeLearning editor in the WordPress Playground so it boots with a working editor instead of requiring the manual Settings → eXeLearning → Download & Install Editor button.
Two blueprint steps after
installPlugin:writeFilefetches the shared editor release asset through the github-proxy (CORS) over the fast JS transport into/tmp/exe-editor.zip.runPHPlocates the installed plugin dir and extracts the zip into itsdist/:Why
The static editor is byte-identical across all eXeLearning plugins and is already published once at
exelearning/exelearning. Fetching that shared artifact at blueprint time is the WordPress-Playground-idiomatic pattern (resourceurl+ extract), and it keeps the plugin zip lean.Notes:
wp-exelearning-<branch>); the extract step finds it with a glob, so it works on any PR.ZipArchiveis already used by the fixtures step, so no new runtime dependency.static/wrapper means extracting intodistyields thedist/static/layout the plugin loads from (EXELEARNING_PLUGIN_DIR . 'dist/static/index.html'). Pinned tov4.0.0to match.editor-version.StaticEditorInstalleris kept for production/offline installs; only the playground changes.Test
Open the Playground for this branch and confirm the editor loads on boot (no manual step) and a page renders.