@wp-playground/blueprints 0.7.18 → 0.7.20
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.json +2 -2
- package/index.cjs +123 -102
- package/index.d.ts +19 -30
- package/index.js +1118 -1067
- package/lib/steps/define-site-url.d.ts +3 -3
- package/lib/steps/define-wp-config-consts.d.ts +3 -2
- package/lib/steps/enable-multisite.d.ts +1 -1
- package/lib/steps/import-wordpress-files.d.ts +2 -2
- package/lib/steps/login.d.ts +2 -2
- package/lib/steps/request.d.ts +1 -1
- package/lib/steps/run-php-with-options.d.ts +1 -1
- package/lib/steps/run-php.d.ts +1 -0
- package/lib/steps/site-data.d.ts +3 -3
- package/lib/steps/wp-cli.d.ts +1 -1
- package/package.json +2 -2
- package/lib/utils/run-php-with-zip-functions.d.ts +0 -2
|
@@ -10,10 +10,10 @@ export interface DefineSiteUrlStep {
|
|
|
10
10
|
siteUrl: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Sets WP_HOME and WP_SITEURL constants for the WordPress installation.
|
|
13
|
+
* Sets [`WP_HOME`](https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#blog-address-url) and [`WP_SITEURL`](https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#wp-siteurl) constants for the WordPress installation.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* It is useful when
|
|
15
|
+
* Using this step on playground.wordpress.net is moot.
|
|
16
|
+
* It is useful when building a custom Playground-based tool, like [`wp-now`](https://www.npmjs.com/package/@wp-now/wp-now),
|
|
17
17
|
* or deploying Playground on a custom domain.
|
|
18
18
|
*
|
|
19
19
|
* @param playground The playground client.
|
|
@@ -19,13 +19,14 @@ export interface DefineWpConfigConstsStep {
|
|
|
19
19
|
/** The constants to define */
|
|
20
20
|
consts: Record<string, unknown>;
|
|
21
21
|
/**
|
|
22
|
-
* The method of defining the constants. Possible values are:
|
|
22
|
+
* The method of defining the constants in wp-config.php. Possible values are:
|
|
23
23
|
*
|
|
24
24
|
* - rewrite-wp-config: Default. Rewrites the wp-config.php file to
|
|
25
25
|
* explicitly call define() with the requested
|
|
26
26
|
* name and value. This method alters the file
|
|
27
27
|
* on the disk, but it doesn't conflict with
|
|
28
28
|
* existing define() calls in wp-config.php.
|
|
29
|
+
*
|
|
29
30
|
* - define-before-run: Defines the constant before running the requested
|
|
30
31
|
* script. It doesn't alter any files on the disk, but
|
|
31
32
|
* constants defined this way may conflict with existing
|
|
@@ -40,7 +41,7 @@ export interface DefineWpConfigConstsStep {
|
|
|
40
41
|
virtualize?: boolean;
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
|
-
* Defines constants in a wp-config.php file.
|
|
44
|
+
* Defines constants in a [`wp-config.php`](https://developer.wordpress.org/advanced-administration/wordpress/wp-config/) file.
|
|
44
45
|
*
|
|
45
46
|
* This step can be called multiple times, and the constants will be merged.
|
|
46
47
|
*
|
|
@@ -14,7 +14,7 @@ export interface EnableMultisiteStep {
|
|
|
14
14
|
step: 'enableMultisite';
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Defines constants in a wp-config.php file.
|
|
17
|
+
* Defines the [Multisite](https://developer.wordpress.org/advanced-administration/multisite/create-network/) constants in a `wp-config.php` file.
|
|
18
18
|
*
|
|
19
19
|
* This step can be called multiple times, and the constants will be merged.
|
|
20
20
|
*
|
|
@@ -27,9 +27,9 @@ export interface ImportWordPressFilesStep<ResourceType> {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Imports top-level WordPress files from a given zip file into
|
|
30
|
-
* the documentRoot
|
|
30
|
+
* the `documentRoot`. For example, if a zip file contains the
|
|
31
31
|
* `wp-content` and `wp-includes` directories, they will replace
|
|
32
|
-
* the corresponding directories in Playground's documentRoot
|
|
32
|
+
* the corresponding directories in Playground's `documentRoot`.
|
|
33
33
|
*
|
|
34
34
|
* Any files that Playground recognizes as "excluded from the export"
|
|
35
35
|
* will carry over from the existing document root into the imported
|
package/lib/steps/login.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ export type LoginStep = {
|
|
|
24
24
|
password?: string;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
|
-
* Logs in to
|
|
28
|
-
* Under the hood, this function submits the wp-login.php form
|
|
27
|
+
* Logs in to Playground.
|
|
28
|
+
* Under the hood, this function submits the [`wp-login.php`](https://developer.wordpress.org/reference/files/wp-login.php/) [form](https://developer.wordpress.org/reference/functions/wp_login_form/)
|
|
29
29
|
* just like a user would.
|
|
30
30
|
*/
|
|
31
31
|
export declare const login: StepHandler<LoginStep>;
|
package/lib/steps/request.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { PHPRunOptions } from '../../../../../php-wasm/universal/src/index.ts';
|
|
|
20
20
|
export interface RunPHPWithOptionsStep {
|
|
21
21
|
step: 'runPHPWithOptions';
|
|
22
22
|
/**
|
|
23
|
-
* Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions)
|
|
23
|
+
* Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions/))
|
|
24
24
|
*/
|
|
25
25
|
options: PHPRunOptions;
|
|
26
26
|
}
|
package/lib/steps/run-php.d.ts
CHANGED
|
@@ -20,5 +20,6 @@ export interface RunPHPStep {
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Runs PHP code.
|
|
23
|
+
* When running WordPress functions, the `code` key must first load [`wp-load.php`](https://github.com/WordPress/WordPress/blob/master/wp-load.php) and start with `"<?php require_once 'wordpress/wp-load.php'; "`.
|
|
23
24
|
*/
|
|
24
25
|
export declare const runPHP: StepHandler<RunPHPStep, Promise<PHPResponse>>;
|
package/lib/steps/site-data.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ export type SetSiteOptionsStep = {
|
|
|
22
22
|
options: Record<string, unknown>;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
* Sets site options. This is equivalent to calling `update_option` for each
|
|
26
|
-
* option in the `options` object.
|
|
25
|
+
* Sets site options. This is equivalent to calling [`update_option`](https://developer.wordpress.org/reference/functions/update_option/) for each
|
|
26
|
+
* option in the [`options`](https://developer.wordpress.org/apis/options/#available-options-by-category) object.
|
|
27
27
|
*/
|
|
28
28
|
export declare const setSiteOptions: StepHandler<SetSiteOptionsStep>;
|
|
29
29
|
/**
|
|
@@ -51,7 +51,7 @@ export interface UpdateUserMetaStep {
|
|
|
51
51
|
userId: number;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* Updates user meta. This is equivalent to calling `update_user_meta` for each
|
|
54
|
+
* Updates user meta. This is equivalent to calling [`update_user_meta`](https://developer.wordpress.org/reference/functions/update_user_meta/) for each
|
|
55
55
|
* meta value in the `meta` object.
|
|
56
56
|
*/
|
|
57
57
|
export declare const updateUserMeta: StepHandler<UpdateUserMetaStep>;
|
package/lib/steps/wp-cli.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/blueprints",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.20",
|
|
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": "5915ef756c88da8dcb665f9f0e49ddc0c0b10d50",
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": ">=18.18.0",
|
|
27
27
|
"npm": ">=8.11.0"
|