From 9264e2af92a6f292ccfe8dff4b455617a913e208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 21 Nov 2025 12:46:11 +0100 Subject: [PATCH 1/3] [Docs] Document how to use Playground CLI as a developer --- packages/playground/cli/README.md | 33 +++++++++++++++++++++++++++- packages/playground/cli/project.json | 4 ++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/packages/playground/cli/README.md b/packages/playground/cli/README.md index 4599882c94..eef8d456bb 100644 --- a/packages/playground/cli/README.md +++ b/packages/playground/cli/README.md @@ -175,7 +175,38 @@ cliServer = await runCLI({ - Is faster to start up for quick tests and development. - The Playground doesn't come with a MySQL Server, but you can provide your own MySQL credentials. -## How can I contribute? +## Contributing + +### Running Playground CLI from source + +To set it up: + +```bash +git clone -b trunk --single-branch --depth 1 --recurse-submodules https://github.com/WordPress/wordpress-playground.git + +# Alternatively, if you already have a clone but forgot to +# pull the submodules, you can run: +git submodule update --init --recursive + +cd wordpress-playground + +nvm use 23 +npm install +``` + +To run it: + +```bash +node --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts +``` + +Or this instead of the above: + +```bash +nx dev playground-cli server +``` + +### How can I contribute? WordPress Playground CLI is an open-source project and welcomes all contributors from documentation to triage. If the feature you need is missing, you are more than welcome to start a discussion, open an issue, and even propose a Pull Request to implement it. diff --git a/packages/playground/cli/project.json b/packages/playground/cli/project.json index 3e066764ff..9ed89baa92 100644 --- a/packages/playground/cli/project.json +++ b/packages/playground/cli/project.json @@ -45,7 +45,7 @@ "dev": { "executor": "nx:run-commands", "options": { - "command": "node --no-warnings --experimental-wasm-stack-switching --experimental-wasm-jspi --loader=./packages/meta/src/node-es-module-loader/loader.mts ./packages/playground/cli/src/cli.ts", + "command": "node --no-warnings=ExperimentalWarning --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts --watch ./packages/playground/cli/src/cli.ts", "tty": true } }, @@ -57,7 +57,7 @@ "command": "node -e \"if (parseInt(process.versions.node) < 22) { console.error('Node.js version 22 or greater is required'); process.exit(1); }\"", "forwardAllArgs": false }, - "node --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts --watch ./packages/playground/cli/src/cli.ts" + "node --no-warnings=ExperimentalWarning --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts --watch ./packages/playground/cli/src/cli.ts" ], "tty": true, "parallel": false From a47d2189de724bb3285e3f02bedbbdf3604d4574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 21 Nov 2025 12:51:57 +0100 Subject: [PATCH 2/3] Update ToC --- packages/playground/cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playground/cli/README.md b/packages/playground/cli/README.md index eef8d456bb..3cb3d5aa99 100644 --- a/packages/playground/cli/README.md +++ b/packages/playground/cli/README.md @@ -8,7 +8,7 @@ - [Quickstart](#quickstart) - [Usage](#usage) - [Working with Blueprints](#working-with-blueprints) -- [How can I contribute?](#how-can-i-contribute) +- [Contributing](#contributing) ## Requirements From 076eb4882c33a9b1ccf7c7760ed3441977619408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 21 Nov 2025 13:04:27 +0100 Subject: [PATCH 3/3] Clarify `cd` when cloning the repo --- packages/playground/cli/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/playground/cli/README.md b/packages/playground/cli/README.md index 3cb3d5aa99..247e7be6c0 100644 --- a/packages/playground/cli/README.md +++ b/packages/playground/cli/README.md @@ -182,13 +182,14 @@ cliServer = await runCLI({ To set it up: ```bash +# If you don't have the repository cloned yet: git clone -b trunk --single-branch --depth 1 --recurse-submodules https://github.com/WordPress/wordpress-playground.git +cd wordpress-playground # Alternatively, if you already have a clone but forgot to # pull the submodules, you can run: -git submodule update --init --recursive - cd wordpress-playground +git submodule update --init --recursive nvm use 23 npm install