Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Retain the resolveBlueprint() call for Blueprints v1
  • Loading branch information
adamziel committed Jul 21, 2025
commit 89931e87ac65675e1be59cfdef16aaeb9eb047a6
42 changes: 21 additions & 21 deletions packages/playground/cli/src/run-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,6 @@ export async function parseOptionsAndRunCLI() {
const cliArgs = {
...args,
command,
blueprint: await resolveBlueprint({
sourceString: args.blueprint,
blueprintMayReadAdjacentFiles: args.blueprintMayReadAdjacentFiles,
}),
mount: [...(args.mount || []), ...(args['mount-dir'] || [])],
'mount-before-install': [
...(args['mount-before-install'] || []),
Expand Down Expand Up @@ -381,15 +377,26 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
Number.MAX_SAFE_INTEGER / totalWorkerCount
);

const handler = args['experimental-blueprints-v2']
? new BlueprintsV2Handler(args, {
siteUrl: absoluteUrl,
processIdSpaceLength,
})
: new BlueprintsV1Handler(args, {
siteUrl: absoluteUrl,
processIdSpaceLength,
});
let handler: BlueprintsV1Handler | BlueprintsV2Handler;
if (args['experimental-blueprints-v2']) {
handler = new BlueprintsV2Handler(args, {
siteUrl: absoluteUrl,
processIdSpaceLength,
});
} else {
handler = new BlueprintsV1Handler(args, {
siteUrl: absoluteUrl,
processIdSpaceLength,
});

if (typeof args.blueprint === 'string') {
args.blueprint = await resolveBlueprint({
sourceString: args.blueprint,
blueprintMayReadAdjacentFiles:
args['blueprint-may-read-adjacent-files'] === true,
});
}
}

// Kick off worker threads now to save time later.
// There is no need to wait for other async processes to complete.
Expand Down Expand Up @@ -856,14 +863,7 @@ class BlueprintsV1Handler {

async compileInputBlueprint(additionalBlueprintSteps: any[]) {
const args = this.args;
const resolvedBlueprint =
typeof args.blueprint === 'string'
? await resolveBlueprint({
sourceString: args.blueprint,
blueprintMayReadAdjacentFiles:
args['blueprint-may-read-adjacent-files'] === true,
})
: (args.blueprint as BlueprintDeclaration);
const resolvedBlueprint = args.blueprint as BlueprintDeclaration;
/**
* @TODO This looks similar to the resolveBlueprint() call in the website package:
* https://github.com/WordPress/wordpress-playground/blob/ce586059e5885d185376184fdd2f52335cca32b0/packages/playground/website/src/main.tsx#L41
Expand Down
Loading