From bb01539c640fc2d91708981526c7b1d02f071346 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Thu, 11 Sep 2025 15:26:29 +0200 Subject: [PATCH 1/2] Add an example using the step library --- demos/step-library.ts | 25 +++++++++++++++++++++++++ package.json | 7 +++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 demos/step-library.ts diff --git a/demos/step-library.ts b/demos/step-library.ts new file mode 100644 index 0000000..3a9f596 --- /dev/null +++ b/demos/step-library.ts @@ -0,0 +1,25 @@ +import { runCLI, RunCLIServer } from '@wp-playground/cli'; +import PlaygroundStepLibrary from 'playground-step-library'; + +const compiler = new PlaygroundStepLibrary(); + +let cliServer: RunCLIServer; + +cliServer = await runCLI({ + command: 'server', + wp: 'latest', + login: true, + blueprint: compiler.compile( + { + steps: [ + { + step: 'addPost', + postTitle: 'Welcome to Playground', + postStatus: 'publish', + postType: 'post', + postContent: 'This is a test post created by the blueprint', + }, + ], + } + ), +}); diff --git a/package.json b/package.json index 6fb3227..6347287 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test:headed": "npx playwright test --headed", "test:title": "npx playwright test tests/e2e/set-wordpress-options.spec.ts", "start": "tsx demo-basic.ts", - "dev": "tsx watch demo-basic.ts", + "dev": "tsx watch demos/step-library.ts", "format": "prettier --write .", "format:check": "prettier --check ." }, @@ -29,5 +29,8 @@ "prettier": "^3.6.2", "tsx": "^4.20.5", "typescript": "^5.9.2" + }, + "dependencies": { + "playground-step-library": "^1.0.1" } -} +} \ No newline at end of file From a9e07b4ff8296705ebdfb8b0f4f02393a5e5c453 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Thu, 11 Sep 2025 15:27:27 +0200 Subject: [PATCH 2/2] Revert change --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6347287..8522317 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test:headed": "npx playwright test --headed", "test:title": "npx playwright test tests/e2e/set-wordpress-options.spec.ts", "start": "tsx demo-basic.ts", - "dev": "tsx watch demos/step-library.ts", + "dev": "tsx watch demo-basic.ts", "format": "prettier --write .", "format:check": "prettier --check ." }, @@ -33,4 +33,4 @@ "dependencies": { "playground-step-library": "^1.0.1" } -} \ No newline at end of file +}