From 6602715d31e2f23441735910af8ea73d7c08ceb6 Mon Sep 17 00:00:00 2001 From: sejas Date: Mon, 19 Jun 2023 13:13:19 +0100 Subject: [PATCH] wp-now: Compile and execute blueprint steps --- packages/wp-now/src/wp-now.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/wp-now/src/wp-now.ts b/packages/wp-now/src/wp-now.ts index 4f628747..6cc447ea 100644 --- a/packages/wp-now/src/wp-now.ts +++ b/packages/wp-now/src/wp-now.ts @@ -8,10 +8,13 @@ import { downloadWordPress, } from './download'; import { + StepDefinition, activatePlugin, activateTheme, + compileBlueprint, defineWpConfigConsts, login, + runBlueprintSteps, } from '@wp-playground/blueprints'; import { WPNowOptions, WPNowMode } from './config'; import { @@ -132,6 +135,19 @@ export default async function startWPNow( await activatePluginOrTheme(php, options); } + if (options.blueprintObject) { + output.log(`blueprint steps: ${options.blueprintObject.steps.length}`); + const compiled = compileBlueprint(options.blueprintObject, { + onStepCompleted: (result, step: StepDefinition) => { + output.log(`Blueprint Step completed: ${step.step}`, { + result, + step, + }); + }, + }); + await runBlueprintSteps(compiled, php); + } + return { php, phpInstances,