@wp-playground/blueprints 2.0.21 → 3.0.1
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.
- package/blueprint-schema-validator.js +2 -2
- package/blueprint-schema.json +2 -2
- package/index.cjs +75 -66
- package/index.cjs.map +1 -1
- package/index.d.ts +6 -5
- package/index.js +1234 -1219
- package/index.js.map +1 -1
- package/lib/resolve-remote-blueprint.d.ts +1 -1
- package/lib/steps/index.d.ts +1 -1
- package/lib/steps/install-plugin.d.ts +1 -1
- package/lib/steps/install-theme.d.ts +1 -1
- package/lib/steps/wp-cli.d.ts +1 -1
- package/lib/steps/write-files.d.ts +1 -1
- package/lib/types.d.ts +11 -0
- package/lib/{compile.d.ts → v1/compile.d.ts} +11 -8
- package/lib/{resources.d.ts → v1/resources.d.ts} +1 -1
- package/lib/{blueprint.d.ts → v1/types.d.ts} +4 -9
- package/lib/v2/blueprint-v2-declaration.d.ts +4 -4
- package/lib/v2/run-blueprint-v2.d.ts +2 -2
- package/lib/v2/wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema.d.ts +1400 -0
- package/lib/v2/wep-1-blueprint-v2-schema/appendix-B-data-sources.d.ts +179 -0
- package/package.json +13 -13
package/lib/steps/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProgressTracker } from '@php-wasm/progress';
|
|
2
2
|
import type { UniversalPHP } from '@php-wasm/universal';
|
|
3
|
-
import type { FileReference, DirectoryReference, Directory } from '../resources';
|
|
3
|
+
import type { FileReference, DirectoryReference, Directory } from '../v1/resources';
|
|
4
4
|
import type { ActivatePluginStep } from './activate-plugin';
|
|
5
5
|
import type { DefineSiteUrlStep } from './define-site-url';
|
|
6
6
|
import type { InstallPluginStep, InstallPluginOptions } from './install-plugin';
|
package/lib/steps/wp-cli.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PHPResponse, UniversalPHP } from '@php-wasm/universal';
|
|
2
2
|
import type { StepHandler } from '.';
|
|
3
|
-
import type { FileReference } from '../resources';
|
|
3
|
+
import type { FileReference } from '../v1/resources';
|
|
4
4
|
export declare const defaultWpCliPath = "/tmp/wp-cli.phar";
|
|
5
5
|
export declare const defaultWpCliResource: FileReference;
|
|
6
6
|
export declare const assertWpCli: (playground: UniversalPHP, wpCliPath?: string) => Promise<void>;
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
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';
|
|
5
|
+
/**
|
|
6
|
+
* A filesystem structure containing a /blueprint.json file and any
|
|
7
|
+
* resources referenced by that blueprint.
|
|
8
|
+
*/
|
|
9
|
+
export type BlueprintBundle = Filesystem;
|
|
10
|
+
export type BlueprintDeclaration = BlueprintV1Declaration | RawBlueprintV2Data;
|
|
11
|
+
export type Blueprint = BlueprintV1 | V2Schema.BlueprintV2;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ProgressTracker } from '@php-wasm/progress';
|
|
2
2
|
import { Semaphore } from '@php-wasm/util';
|
|
3
3
|
import type { SupportedPHPVersion, UniversalPHP } from '@php-wasm/universal';
|
|
4
|
-
import type { StepDefinition } from '
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
export
|
|
4
|
+
import type { StepDefinition } from '../steps';
|
|
5
|
+
import type { BlueprintV1Declaration, ExtraLibrary, StreamBundledFile, BlueprintV1 } from './types';
|
|
6
|
+
import type { BlueprintBundle } from '../types';
|
|
7
|
+
export type CompiledV1Step = (php: UniversalPHP) => Promise<void> | void;
|
|
8
|
+
export interface CompiledBlueprintV1 {
|
|
8
9
|
/** The requested versions of PHP and WordPress for the blueprint */
|
|
9
10
|
versions: {
|
|
10
11
|
php: SupportedPHPVersion;
|
|
@@ -20,13 +21,15 @@ export interface CompiledBlueprint {
|
|
|
20
21
|
run: (playground: UniversalPHP) => Promise<void>;
|
|
21
22
|
}
|
|
22
23
|
export type OnStepCompleted = (output: any, step: StepDefinition) => any;
|
|
23
|
-
export interface
|
|
24
|
+
export interface CompileBlueprintV1Options {
|
|
24
25
|
/** Optional progress tracker to monitor progress */
|
|
25
26
|
progress?: ProgressTracker;
|
|
26
27
|
/** Optional semaphore to control access to a shared resource */
|
|
27
28
|
semaphore?: Semaphore;
|
|
28
29
|
/** Optional callback with step output */
|
|
29
30
|
onStepCompleted?: OnStepCompleted;
|
|
31
|
+
/** Optional callback with blueprint validation result */
|
|
32
|
+
onBlueprintValidated?: (blueprint: BlueprintV1Declaration) => void;
|
|
30
33
|
/**
|
|
31
34
|
* Proxy URL to use for cross-origin requests.
|
|
32
35
|
*
|
|
@@ -44,9 +47,9 @@ export interface CompileBlueprintOptions {
|
|
|
44
47
|
*/
|
|
45
48
|
additionalSteps?: any[];
|
|
46
49
|
}
|
|
47
|
-
export declare function
|
|
50
|
+
export declare function compileBlueprintV1(input: BlueprintV1Declaration | BlueprintBundle, options?: Omit<CompileBlueprintV1Options, 'streamBundledFile'>): Promise<CompiledBlueprintV1>;
|
|
48
51
|
export declare function isBlueprintBundle(input: any): input is BlueprintBundle;
|
|
49
|
-
export declare function getBlueprintDeclaration(blueprint:
|
|
52
|
+
export declare function getBlueprintDeclaration(blueprint: BlueprintV1 | BlueprintBundle): Promise<BlueprintV1Declaration>;
|
|
50
53
|
export declare function validateBlueprint(blueprintMaybe: object): {
|
|
51
54
|
valid: true;
|
|
52
55
|
errors?: undefined;
|
|
@@ -54,4 +57,4 @@ export declare function validateBlueprint(blueprintMaybe: object): {
|
|
|
54
57
|
valid: false;
|
|
55
58
|
errors: import("ajv").ErrorObject<string, Record<string, any>, unknown>[] | undefined;
|
|
56
59
|
};
|
|
57
|
-
export declare function
|
|
60
|
+
export declare function runBlueprintV1Steps(compiledBlueprint: CompiledBlueprintV1, playground: UniversalPHP): Promise<void>;
|
|
@@ -2,7 +2,7 @@ import type { ProgressTracker } from '@php-wasm/progress';
|
|
|
2
2
|
import type { FileTree, UniversalPHP } from '@php-wasm/universal';
|
|
3
3
|
import type { Semaphore } from '@php-wasm/util';
|
|
4
4
|
import { StreamedFile } from '@php-wasm/stream-compression';
|
|
5
|
-
import type { StreamBundledFile } from './
|
|
5
|
+
import type { StreamBundledFile } from './types';
|
|
6
6
|
export type { FileTree };
|
|
7
7
|
export declare const ResourceTypes: readonly ["vfs", "literal", "wordpress.org/themes", "wordpress.org/plugins", "url", "git:directory", "bundled"];
|
|
8
8
|
export type VFSReference = {
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import type { SupportedPHPVersion } from '@php-wasm/universal';
|
|
2
|
-
import type { StepDefinition } from '
|
|
2
|
+
import type { StepDefinition } from '../steps';
|
|
3
3
|
import type { FileReference } from './resources';
|
|
4
4
|
import type { StreamedFile } from '@php-wasm/stream-compression';
|
|
5
|
-
import type {
|
|
5
|
+
import type { BlueprintBundle } from '../types';
|
|
6
6
|
export type ExtraLibrary = 'wp-cli';
|
|
7
7
|
export type PHPConstants = Record<string, string | boolean | number>;
|
|
8
8
|
export type StreamBundledFile = (relativePath: string) => Promise<StreamedFile>;
|
|
9
|
-
export type
|
|
10
|
-
/**
|
|
11
|
-
* A filesystem structure containing a /blueprint.json file and any
|
|
12
|
-
* resources referenced by that blueprint.
|
|
13
|
-
*/
|
|
14
|
-
export type BlueprintBundle = Filesystem;
|
|
9
|
+
export type BlueprintV1 = BlueprintV1Declaration | BlueprintBundle;
|
|
15
10
|
/**
|
|
16
11
|
* The Blueprint declaration, typically stored in a blueprint.json file.
|
|
17
12
|
*/
|
|
18
|
-
export type
|
|
13
|
+
export type BlueprintV1Declaration = {
|
|
19
14
|
/**
|
|
20
15
|
* The URL to navigate to after the blueprint has been run.
|
|
21
16
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
1
|
+
import type { BlueprintV1Declaration } from '../v1/types';
|
|
2
|
+
export type RawBlueprintV2Data = string | BlueprintV1Declaration | undefined;
|
|
3
|
+
export type ParsedBlueprintV2String = {
|
|
4
4
|
type: 'inline-file';
|
|
5
5
|
contents: string;
|
|
6
6
|
} | {
|
|
7
7
|
type: 'file-reference';
|
|
8
8
|
reference: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function parseBlueprintDeclaration(source:
|
|
10
|
+
export declare function parseBlueprintDeclaration(source: RawBlueprintV2Data | ParsedBlueprintV2String): ParsedBlueprintV2String;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type StreamedPHPResponse, type UniversalPHP } from '@php-wasm/universal';
|
|
2
|
-
import { type
|
|
2
|
+
import { type RawBlueprintV2Data, type ParsedBlueprintV2String } from './blueprint-v2-declaration';
|
|
3
3
|
export type PHPExceptionDetails = {
|
|
4
4
|
exception: string;
|
|
5
5
|
message: string;
|
|
@@ -24,7 +24,7 @@ export type BlueprintMessage = {
|
|
|
24
24
|
interface RunV2Options {
|
|
25
25
|
php: UniversalPHP;
|
|
26
26
|
cliArgs?: string[];
|
|
27
|
-
blueprint:
|
|
27
|
+
blueprint: RawBlueprintV2Data | ParsedBlueprintV2String;
|
|
28
28
|
blueprintOverrides?: {
|
|
29
29
|
wordpressVersion?: string;
|
|
30
30
|
additionalSteps?: any[];
|