Skip to content

Commit 55f0bc0

Browse files
authored
[Playground CLI] Consolidate auto mounting logic (#2360)
## Motivation for the change, related issues Simplifies the auto mounting logic and adds explicit semantics for creating additional Blueprint steps as a result of an auto mount, e.g. installing and activating a plugin that was automatically detected. Also, adds unit tests for the automounting detection. A part of #2281 ## Testing Instructions (or ideally a Blueprint) Confirm the tests are still green
1 parent 53c7650 commit 55f0bc0

File tree

4 files changed

+560
-128
lines changed

4 files changed

+560
-128
lines changed

packages/playground/blueprints/src/lib/compile.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export interface CompileBlueprintOptions {
8181
* A filesystem to use for the blueprint.
8282
*/
8383
streamBundledFile?: StreamBundledFile;
84+
/**
85+
* Additional steps to add to the blueprint.
86+
*/
87+
additionalSteps?: any[];
8488
}
8589

8690
export async function compileBlueprint(
@@ -135,6 +139,7 @@ function compileBlueprintJson(
135139
onStepCompleted = () => {},
136140
corsProxy,
137141
streamBundledFile,
142+
additionalSteps,
138143
}: CompileBlueprintOptions = {}
139144
): CompiledBlueprint {
140145
blueprint = structuredClone(blueprint);
@@ -145,6 +150,9 @@ function compileBlueprintJson(
145150
.filter(isStepDefinition)
146151
.filter(isStepStillSupported),
147152
};
153+
154+
blueprint.steps = [...(blueprint.steps || []), ...(additionalSteps || [])];
155+
148156
for (const step of blueprint.steps!) {
149157
if (!step || typeof step !== 'object') {
150158
continue;

0 commit comments

Comments
 (0)