File tree Expand file tree Collapse file tree 6 files changed +45
-14
lines changed Expand file tree Collapse file tree 6 files changed +45
-14
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,10 @@ export type {
4949export * from './lib/steps' ;
5050export * from './lib/steps/handlers' ;
5151export type {
52+ BlueprintV2 ,
53+ BlueprintV2Declaration ,
5254 RawBlueprintV2Data ,
53- ParsedBlueprintV2String ,
55+ ParsedBlueprintV1orV2String as ParsedBlueprintV2String ,
5456} from './lib/v2/blueprint-v2-declaration' ;
5557export { getV2Runner } from './lib/v2/get-v2-runner' ;
5658export { runBlueprintV2 } from './lib/v2/run-blueprint-v2' ;
Original file line number Diff line number Diff line change 11import type { Filesystem } from '@wp-playground/storage' ;
2- import type { V2Schema } from './v2/wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema' ;
32import type { BlueprintV1 , BlueprintV1Declaration } from './v1/types' ;
4- import type { RawBlueprintV2Data } from './v2/blueprint-v2-declaration' ;
3+ import type {
4+ BlueprintV2 ,
5+ BlueprintV2Declaration ,
6+ } from './v2/blueprint-v2-declaration' ;
57
68/**
79 * A filesystem structure containing a /blueprint.json file and any
810 * resources referenced by that blueprint.
911 */
1012export type BlueprintBundle = Filesystem ;
1113
12- export type BlueprintDeclaration = BlueprintV1Declaration | RawBlueprintV2Data ;
13- export type Blueprint = BlueprintV1 | V2Schema . BlueprintV2 ;
14+ export type BlueprintDeclaration =
15+ | BlueprintV1Declaration
16+ | BlueprintV2Declaration ;
17+ export type Blueprint = BlueprintV1 | BlueprintV2 ;
Original file line number Diff line number Diff line change 1+ import type { BlueprintBundle } from '../types' ;
12import type { BlueprintV1Declaration } from '../v1/types' ;
3+ import type { V2Schema } from './wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema' ;
24
3- export type RawBlueprintV2Data = string | BlueprintV1Declaration | undefined ;
4- export type ParsedBlueprintV2String =
5+ type BlueprintV2Declaration = V2Schema . BlueprintV2 ;
6+ export type BlueprintV2 = BlueprintV2Declaration | BlueprintBundle ;
7+
8+ export type { BlueprintV2Declaration } ;
9+ export type RawBlueprintV2Data = string | BlueprintV2Declaration | undefined ;
10+
11+ export type ParsedBlueprintV1orV2String =
512 | { type : 'inline-file' ; contents : string }
613 | { type : 'file-reference' ; reference : string } ;
714
815export function parseBlueprintDeclaration (
9- source : RawBlueprintV2Data | ParsedBlueprintV2String
10- ) : ParsedBlueprintV2String {
16+ source :
17+ | RawBlueprintV2Data
18+ | ParsedBlueprintV1orV2String
19+ | BlueprintV1Declaration
20+ ) : ParsedBlueprintV1orV2String {
1121 if (
1222 typeof source === 'object' &&
1323 'type' in source &&
Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ import { phpVar } from '@php-wasm/util';
77import { getV2Runner } from './get-v2-runner' ;
88import {
99 type RawBlueprintV2Data ,
10- type ParsedBlueprintV2String ,
10+ type ParsedBlueprintV1orV2String ,
1111 parseBlueprintDeclaration ,
1212} from './blueprint-v2-declaration' ;
13+ import type { BlueprintV1Declaration } from '../v1/types' ;
1314
1415export type PHPExceptionDetails = {
1516 exception : string ;
@@ -32,7 +33,10 @@ export type BlueprintMessage =
3233interface RunV2Options {
3334 php : UniversalPHP ;
3435 cliArgs ?: string [ ] ;
35- blueprint : RawBlueprintV2Data | ParsedBlueprintV2String ;
36+ blueprint :
37+ | RawBlueprintV2Data
38+ | ParsedBlueprintV1orV2String
39+ | BlueprintV1Declaration ;
3640 blueprintOverrides ?: {
3741 wordpressVersion ?: string ;
3842 additionalSteps ?: any [ ] ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { sprintf } from '@php-wasm/util';
2121import {
2222 type BlueprintMessage ,
2323 runBlueprintV2 ,
24+ type BlueprintV1Declaration ,
2425} from '@wp-playground/blueprints' ;
2526import {
2627 type ParsedBlueprintV2String ,
@@ -122,13 +123,19 @@ export type PrimaryWorkerBootArgs = RunCLIArgs & {
122123 firstProcessId : number ;
123124 processIdSpaceLength : number ;
124125 trace : boolean ;
125- blueprint : RawBlueprintV2Data | ParsedBlueprintV2String ;
126+ blueprint :
127+ | RawBlueprintV2Data
128+ | ParsedBlueprintV2String
129+ | BlueprintV1Declaration ;
126130 nativeInternalDirPath : string ;
127131} ;
128132
129133type WorkerRunBlueprintArgs = RunCLIArgs & {
130134 siteUrl : string ;
131- blueprint : RawBlueprintV2Data | ParsedBlueprintV2String ;
135+ blueprint :
136+ | RawBlueprintV2Data
137+ | ParsedBlueprintV2String
138+ | BlueprintV1Declaration ;
132139} ;
133140
134141export type SecondaryWorkerBootArgs = {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313import type {
1414 BlueprintBundle ,
1515 BlueprintV1Declaration ,
16+ BlueprintV2Declaration ,
1617} from '@wp-playground/blueprints' ;
1718import { runBlueprintV1Steps } from '@wp-playground/blueprints' ;
1819import { RecommendedPHPVersion } from '@wp-playground/common' ;
@@ -394,7 +395,10 @@ export async function parseOptionsAndRunCLI() {
394395}
395396
396397export interface RunCLIArgs {
397- blueprint ?: BlueprintV1Declaration | BlueprintBundle ;
398+ blueprint ?:
399+ | BlueprintV1Declaration
400+ | BlueprintV2Declaration
401+ | BlueprintBundle ;
398402 command : 'server' | 'run-blueprint' | 'build-snapshot' ;
399403 debug ?: boolean ;
400404 login ?: boolean ;
You can’t perform that action at this time.
0 commit comments