From c7e01493ef0b5615e1f43669066ddd7c326f4b84 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Mon, 21 Apr 2025 22:39:54 +0100 Subject: [PATCH] Update WordPress Playground integration to use HTML files --- bin/setup-test-env.sh | 32 ++++++++++++++++++++++++++++++-- playground/index.html | 25 +++++++++++++++++++++++++ playground/multisite.html | 25 +++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 playground/index.html create mode 100644 playground/multisite.html diff --git a/bin/setup-test-env.sh b/bin/setup-test-env.sh index 019e98b..0dbeb0d 100755 --- a/bin/setup-test-env.sh +++ b/bin/setup-test-env.sh @@ -150,7 +150,21 @@ EOF # Start WordPress Playground echo "Starting WordPress Playground..." - npx @wp-playground/client start --blueprint playground/blueprint.json --port 8888 & + if command_exists python3; then + python3 -m http.server 8888 --directory playground & + echo "Opening WordPress Playground in your browser..." + if command_exists open; then + open http://localhost:8888/index.html + elif command_exists xdg-open; then + xdg-open http://localhost:8888/index.html + elif command_exists start; then + start http://localhost:8888/index.html + else + echo "Please open http://localhost:8888/index.html in your browser" + fi + else + echo "Python3 is not installed. Please open playground/index.html in your browser." + fi # Wait for WordPress Playground to be ready echo "Waiting for WordPress Playground to be ready..." @@ -243,7 +257,21 @@ EOF # Start WordPress Playground echo "Starting WordPress Playground..." - npx @wp-playground/client start --blueprint playground/multisite-blueprint.json --port 8888 & + if command_exists python3; then + python3 -m http.server 8888 --directory playground & + echo "Opening WordPress Playground in your browser..." + if command_exists open; then + open http://localhost:8888/multisite.html + elif command_exists xdg-open; then + xdg-open http://localhost:8888/multisite.html + elif command_exists start; then + start http://localhost:8888/multisite.html + else + echo "Please open http://localhost:8888/multisite.html in your browser" + fi + else + echo "Python3 is not installed. Please open playground/multisite.html in your browser." + fi # Wait for WordPress Playground to be ready echo "Waiting for WordPress Playground to be ready..." diff --git a/playground/index.html b/playground/index.html new file mode 100644 index 0000000..c24ccc5 --- /dev/null +++ b/playground/index.html @@ -0,0 +1,25 @@ + + +
+ + +