@wp-playground/blueprints 0.9.26 → 0.9.28
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.d.ts +2 -0
- package/blueprint-schema-validator.js +19465 -0
- package/blueprint-schema.json +11 -0
- package/index.cjs +63 -56
- package/index.js +10325 -2116
- package/lib/blueprint.d.ts +5 -0
- package/lib/compile.d.ts +2 -1
- package/lib/steps/reset-data.d.ts +3 -5
- package/package.json +11 -11
- package/schema-readme.md +10 -6
package/lib/blueprint.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SupportedPHPExtensionBundle, SupportedPHPVersion } from '../../../../php-wasm/universal/src/index.ts';
|
|
2
2
|
import { StepDefinition } from './steps';
|
|
3
3
|
import { FileReference } from './resources';
|
|
4
|
+
export type ExtraLibrary = 'wp-cli';
|
|
4
5
|
export interface Blueprint {
|
|
5
6
|
/**
|
|
6
7
|
* The URL to navigate to after the blueprint has been run.
|
|
@@ -54,6 +55,10 @@ export interface Blueprint {
|
|
|
54
55
|
/** Should boot with support for network request via wp_safe_remote_get? */
|
|
55
56
|
networking?: boolean;
|
|
56
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Extra libraries to preload into the Playground instance.
|
|
60
|
+
*/
|
|
61
|
+
extraLibraries?: ExtraLibrary[];
|
|
57
62
|
/**
|
|
58
63
|
* PHP Constants to define on every request
|
|
59
64
|
*/
|
package/lib/compile.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ProgressTracker } from '../../../../php-wasm/progress/src/index.ts';
|
|
|
2
2
|
import { Semaphore } from '../../../../php-wasm/util/src/index.ts';
|
|
3
3
|
import { SupportedPHPExtension, SupportedPHPVersion, UniversalPHP } from '../../../../php-wasm/universal/src/index.ts';
|
|
4
4
|
import { StepDefinition } from './steps';
|
|
5
|
-
import { Blueprint } from './blueprint';
|
|
5
|
+
import { Blueprint, ExtraLibrary } from './blueprint';
|
|
6
6
|
export type CompiledStep = (php: UniversalPHP) => Promise<void> | void;
|
|
7
7
|
export interface CompiledBlueprint {
|
|
8
8
|
/** The requested versions of PHP and WordPress for the blueprint */
|
|
@@ -16,6 +16,7 @@ export interface CompiledBlueprint {
|
|
|
16
16
|
/** Should boot with support for network request via wp_safe_remote_get? */
|
|
17
17
|
networking: boolean;
|
|
18
18
|
};
|
|
19
|
+
extraLibraries: ExtraLibrary[];
|
|
19
20
|
/** The compiled steps for the blueprint */
|
|
20
21
|
run: (playground: UniversalPHP) => Promise<void>;
|
|
21
22
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { StepHandler } from '.';
|
|
2
2
|
/**
|
|
3
|
-
* Deletes WordPress posts and comments and sets the auto increment sequence for the
|
|
4
|
-
* posts and comments tables to 0.
|
|
5
|
-
*
|
|
6
|
-
* @private
|
|
7
|
-
* @internal
|
|
8
3
|
* @inheritDoc resetData
|
|
9
4
|
* @example
|
|
10
5
|
*
|
|
@@ -18,6 +13,9 @@ export interface ResetDataStep {
|
|
|
18
13
|
step: 'resetData';
|
|
19
14
|
}
|
|
20
15
|
/**
|
|
16
|
+
* Deletes WordPress posts and comments and sets the auto increment sequence for the
|
|
17
|
+
* posts and comments tables to 0.
|
|
18
|
+
*
|
|
21
19
|
* @param playground Playground client.
|
|
22
20
|
*/
|
|
23
21
|
export declare const resetData: StepHandler<ResetDataStep>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/blueprints",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.28",
|
|
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": "
|
|
24
|
+
"gitHead": "15d87898b0a7f8a0cf322425923336df1d84843b",
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": ">=18.18.0",
|
|
27
27
|
"npm": ">=8.11.0"
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"ajv": "8.12.0",
|
|
31
31
|
"comlink": "^4.4.1",
|
|
32
32
|
"ini": "4.1.2",
|
|
33
|
-
"@php-wasm/node-polyfills": "0.9.
|
|
34
|
-
"@php-wasm/universal": "0.9.
|
|
35
|
-
"@wp-playground/common": "0.9.
|
|
36
|
-
"@php-wasm/node": "0.9.
|
|
37
|
-
"@php-wasm/progress": "0.9.
|
|
38
|
-
"@php-wasm/util": "0.9.
|
|
39
|
-
"@php-wasm/logger": "0.9.
|
|
40
|
-
"@wp-playground/wordpress": "0.9.
|
|
41
|
-
"@php-wasm/scopes": "0.9.
|
|
33
|
+
"@php-wasm/node-polyfills": "0.9.28",
|
|
34
|
+
"@php-wasm/universal": "0.9.28",
|
|
35
|
+
"@wp-playground/common": "0.9.28",
|
|
36
|
+
"@php-wasm/node": "0.9.28",
|
|
37
|
+
"@php-wasm/progress": "0.9.28",
|
|
38
|
+
"@php-wasm/util": "0.9.28",
|
|
39
|
+
"@php-wasm/logger": "0.9.28",
|
|
40
|
+
"@wp-playground/wordpress": "0.9.28",
|
|
41
|
+
"@php-wasm/scopes": "0.9.28"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/schema-readme.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
The JSON schema stored in this directory
|
|
2
|
-
and is autogenerated from the Blueprints TypeScript types.
|
|
1
|
+
The JSON schema stored in this directory describes how to validate
|
|
2
|
+
the Blueprints and is autogenerated from the Blueprints TypeScript types.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
The Blueprint schema validator stored in this directory is used to validate
|
|
5
|
+
Blueprints and is autogenerated from the Blueprints JSON schema.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Whenever the types are modified, the schema and validator need to be
|
|
8
|
+
rebuilt using `nx build playground-blueprints` and then committed to
|
|
9
|
+
the repository.
|
|
10
|
+
|
|
11
|
+
Unfortunately, they are not auto-rebuilt in `npm run dev` mode as the
|
|
12
|
+
`dts-bundle-generator` utility we use for type rollyps does not support
|
|
9
13
|
watching for changes.
|