@wp-playground/blueprints 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ import type { Blueprint, BlueprintBundle } from './types';
2
+ import type { BlueprintV1Declaration } from './v1/types';
3
+ import type { BlueprintV2Declaration } from './v2/blueprint-v2-declaration';
4
+ export declare function isBlueprintBundle(input: any): input is BlueprintBundle;
5
+ export declare function getBlueprintDeclaration(blueprint: Blueprint): Promise<BlueprintV1Declaration | BlueprintV2Declaration>;
6
+ export type BlueprintType = 'bundle' | 'declaration';
7
+ export declare class BlueprintReflection {
8
+ private readonly declaration;
9
+ private readonly bundle;
10
+ private readonly version;
11
+ static create(blueprint: Blueprint): Promise<BlueprintReflection>;
12
+ static createFromDeclaration(declaration: BlueprintV1Declaration | BlueprintV2Declaration, bundle?: BlueprintBundle | undefined): BlueprintReflection;
13
+ protected constructor(declaration: BlueprintV1Declaration | BlueprintV2Declaration, bundle: BlueprintBundle | undefined, version: number);
14
+ getVersion(): number;
15
+ getDeclaration(): import("./v2/wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema").V2Schema.BlueprintV2 | BlueprintV1Declaration;
16
+ isBundle(): boolean;
17
+ getBundle(): import("@wp-playground/storage").Filesystem | undefined;
18
+ getBlueprint(): Blueprint;
19
+ }
@@ -0,0 +1,2 @@
1
+ import type { Blueprint, RuntimeConfiguration } from './types';
2
+ export declare function resolveRuntimeConfiguration(blueprint: Blueprint): Promise<RuntimeConfiguration>;
@@ -25,7 +25,7 @@ export interface InstallAssetOptions {
25
25
  /**
26
26
  * Install asset: Extract folder from zip file and move it to target
27
27
  */
28
- export declare function installAsset(playground: UniversalPHP, { targetPath, zipFile, ifAlreadyInstalled, targetFolderName }: InstallAssetOptions): Promise<{
28
+ export declare function installAsset(playground: UniversalPHP, { targetPath, zipFile, ifAlreadyInstalled, targetFolderName, }: InstallAssetOptions): Promise<{
29
29
  assetFolderPath: string;
30
30
  assetFolderName: string;
31
31
  }>;
package/lib/types.d.ts CHANGED
@@ -1,11 +1,19 @@
1
1
  import type { Filesystem } from '@wp-playground/storage';
2
- import type { V2Schema } from './v2/wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema';
3
- import type { BlueprintV1, BlueprintV1Declaration } from './v1/types';
4
- import type { RawBlueprintV2Data } from './v2/blueprint-v2-declaration';
2
+ import type { BlueprintV1, BlueprintV1Declaration, ExtraLibrary, PHPConstants } from './v1/types';
3
+ import type { BlueprintV2, BlueprintV2Declaration } from './v2/blueprint-v2-declaration';
4
+ import type { SupportedPHPVersion } from '@php-wasm/universal';
5
5
  /**
6
6
  * A filesystem structure containing a /blueprint.json file and any
7
7
  * resources referenced by that blueprint.
8
8
  */
9
9
  export type BlueprintBundle = Filesystem;
10
- export type BlueprintDeclaration = BlueprintV1Declaration | RawBlueprintV2Data;
11
- export type Blueprint = BlueprintV1 | V2Schema.BlueprintV2;
10
+ export type BlueprintDeclaration = BlueprintV1Declaration | BlueprintV2Declaration;
11
+ export type Blueprint = BlueprintV1 | BlueprintV2;
12
+ export interface RuntimeConfiguration {
13
+ phpVersion: SupportedPHPVersion;
14
+ wpVersion: string;
15
+ intl: boolean;
16
+ networking: boolean;
17
+ extraLibraries: ExtraLibrary[];
18
+ constants: PHPConstants;
19
+ }
@@ -1,10 +1,15 @@
1
+ import type { BlueprintBundle } from '../types';
1
2
  import type { BlueprintV1Declaration } from '../v1/types';
2
- export type RawBlueprintV2Data = string | BlueprintV1Declaration | undefined;
3
- export type ParsedBlueprintV2String = {
3
+ import type { V2Schema } from './wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema';
4
+ type BlueprintV2Declaration = V2Schema.BlueprintV2;
5
+ export type BlueprintV2 = BlueprintV2Declaration | BlueprintBundle;
6
+ export type { BlueprintV2Declaration };
7
+ export type RawBlueprintV2Data = string | BlueprintV2Declaration | undefined;
8
+ export type ParsedBlueprintV1orV2String = {
4
9
  type: 'inline-file';
5
10
  contents: string;
6
11
  } | {
7
12
  type: 'file-reference';
8
13
  reference: string;
9
14
  };
10
- export declare function parseBlueprintDeclaration(source: RawBlueprintV2Data | ParsedBlueprintV2String): ParsedBlueprintV2String;
15
+ export declare function parseBlueprintDeclaration(source: RawBlueprintV2Data | ParsedBlueprintV1orV2String | BlueprintV1Declaration): ParsedBlueprintV1orV2String;
@@ -1,5 +1,6 @@
1
1
  import { type StreamedPHPResponse, type UniversalPHP } from '@php-wasm/universal';
2
- import { type RawBlueprintV2Data, type ParsedBlueprintV2String } from './blueprint-v2-declaration';
2
+ import { type RawBlueprintV2Data, type ParsedBlueprintV1orV2String } from './blueprint-v2-declaration';
3
+ import type { BlueprintV1Declaration } from '../v1/types';
3
4
  export type PHPExceptionDetails = {
4
5
  exception: string;
5
6
  message: string;
@@ -24,7 +25,7 @@ export type BlueprintMessage = {
24
25
  interface RunV2Options {
25
26
  php: UniversalPHP;
26
27
  cliArgs?: string[];
27
- blueprint: RawBlueprintV2Data | ParsedBlueprintV2String;
28
+ blueprint: RawBlueprintV2Data | ParsedBlueprintV1orV2String | BlueprintV1Declaration;
28
29
  blueprintOverrides?: {
29
30
  wordpressVersion?: string;
30
31
  additionalSteps?: any[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/blueprints",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./index.js",
@@ -21,7 +21,7 @@
21
21
  "access": "public",
22
22
  "directory": "../../../dist/packages/playground/blueprints"
23
23
  },
24
- "gitHead": "9a65507f4294f48d98953edb9fc91392a8fab759",
24
+ "gitHead": "238d05ffb780d420070b23384e0a906c71bd0611",
25
25
  "engines": {
26
26
  "node": ">=20.18.3",
27
27
  "npm": ">=10.1.0"
@@ -46,17 +46,17 @@
46
46
  "wasm-feature-detect": "1.8.0",
47
47
  "ws": "8.18.1",
48
48
  "yargs": "17.7.2",
49
- "@php-wasm/node-polyfills": "3.0.1",
50
- "@wp-playground/storage": "3.0.1",
51
- "@php-wasm/universal": "3.0.1",
52
- "@wp-playground/common": "3.0.1",
53
- "@php-wasm/util": "3.0.1",
54
- "@php-wasm/node": "3.0.1",
55
- "@wp-playground/wordpress": "3.0.1",
56
- "@php-wasm/logger": "3.0.1",
57
- "@php-wasm/progress": "3.0.1",
58
- "@php-wasm/stream-compression": "3.0.1",
59
- "@php-wasm/web": "3.0.1"
49
+ "@php-wasm/node-polyfills": "3.0.3",
50
+ "@wp-playground/storage": "3.0.3",
51
+ "@wp-playground/common": "3.0.3",
52
+ "@php-wasm/universal": "3.0.3",
53
+ "@php-wasm/util": "3.0.3",
54
+ "@php-wasm/node": "3.0.3",
55
+ "@wp-playground/wordpress": "3.0.3",
56
+ "@php-wasm/logger": "3.0.3",
57
+ "@php-wasm/progress": "3.0.3",
58
+ "@php-wasm/stream-compression": "3.0.3",
59
+ "@php-wasm/web": "3.0.3"
60
60
  },
61
61
  "overrides": {
62
62
  "rollup": "^4.34.6",