Skip to content

Commit 4acc8aa

Browse files
authored
[Docs] Document how to use Playground CLI as a developer (#2925)
## Motivation for the change, related issues Documents how developers can run Playground CLI from source. cc @wojtekn @bgrgicak
1 parent b24ed74 commit 4acc8aa

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

packages/playground/cli/README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- [Quickstart](#quickstart)
99
- [Usage](#usage)
1010
- [Working with Blueprints](#working-with-blueprints)
11-
- [How can I contribute?](#how-can-i-contribute)
11+
- [Contributing](#contributing)
1212

1313
## Requirements
1414

@@ -175,7 +175,39 @@ cliServer = await runCLI({
175175
- Is faster to start up for quick tests and development.
176176
- The Playground doesn't come with a MySQL Server, but you can provide your own MySQL credentials.
177177

178-
## How can I contribute?
178+
## Contributing
179+
180+
### Running Playground CLI from source
181+
182+
To set it up:
183+
184+
```bash
185+
# If you don't have the repository cloned yet:
186+
git clone -b trunk --single-branch --depth 1 --recurse-submodules https://github.com/WordPress/wordpress-playground.git
187+
cd wordpress-playground
188+
189+
# Alternatively, if you already have a clone but forgot to
190+
# pull the submodules, you can run:
191+
cd wordpress-playground
192+
git submodule update --init --recursive
193+
194+
nvm use 23
195+
npm install
196+
```
197+
198+
To run it:
199+
200+
```bash
201+
node --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts
202+
```
203+
204+
Or this instead of the above:
205+
206+
```bash
207+
nx dev playground-cli server
208+
```
209+
210+
### How can I contribute?
179211

180212
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.
181213

packages/playground/cli/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"dev": {
4646
"executor": "nx:run-commands",
4747
"options": {
48-
"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",
48+
"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",
4949
"tty": true
5050
}
5151
},
@@ -57,7 +57,7 @@
5757
"command": "node -e \"if (parseInt(process.versions.node) < 22) { console.error('Node.js version 22 or greater is required'); process.exit(1); }\"",
5858
"forwardAllArgs": false
5959
},
60-
"node --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts --watch ./packages/playground/cli/src/cli.ts"
60+
"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"
6161
],
6262
"tty": true,
6363
"parallel": false

0 commit comments

Comments
 (0)