@wp-playground/blueprints 0.2.0 → 0.3.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.json +17 -0
- package/index.cjs +352 -34
- package/index.d.ts +5 -1
- package/index.js +2471 -2063
- package/lib/blueprint.d.ts +5 -1
- package/lib/compile.d.ts +4 -5
- package/lib/resources.d.ts +0 -1
- package/lib/steps/activate-plugin.d.ts +9 -0
- package/lib/steps/activate-theme.d.ts +9 -0
- package/lib/steps/apply-wordpress-patches/index.d.ts +33 -0
- package/lib/steps/cp.d.ts +26 -0
- package/lib/steps/handlers.d.ts +10 -1
- package/lib/steps/import-export.d.ts +25 -0
- package/lib/steps/index.d.ts +10 -1
- package/lib/steps/mkdir.d.ts +22 -0
- package/lib/steps/mv.d.ts +26 -0
- package/lib/steps/request.d.ts +33 -0
- package/lib/steps/rm.d.ts +23 -0
- package/lib/steps/rmdir.d.ts +23 -0
- package/lib/steps/run-php-with-options.d.ts +30 -0
- package/lib/steps/run-php.d.ts +23 -0
- package/lib/steps/set-php-ini-entry.d.ts +25 -0
- package/lib/steps/write-file.d.ts +26 -0
- package/package.json +2 -2
- package/lib/steps/client-methods.d.ts +0 -247
package/lib/blueprint.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SupportedPHPVersion } from '@php-wasm/universal';
|
|
1
|
+
import { SupportedPHPExtensionBundle, SupportedPHPVersion } from '@php-wasm/universal';
|
|
2
2
|
import { StepDefinition } from './steps';
|
|
3
3
|
export interface Blueprint {
|
|
4
4
|
/**
|
|
@@ -20,6 +20,10 @@ export interface Blueprint {
|
|
|
20
20
|
*/
|
|
21
21
|
wp: string | 'latest';
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* The PHP extensions to use.
|
|
25
|
+
*/
|
|
26
|
+
phpExtensionBundles?: SupportedPHPExtensionBundle[];
|
|
23
27
|
/**
|
|
24
28
|
* The steps to run.
|
|
25
29
|
*/
|
package/lib/compile.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { ProgressTracker } from '@php-wasm/progress';
|
|
2
2
|
import { Semaphore } from '@php-wasm/util';
|
|
3
|
-
import { SupportedPHPVersion, UniversalPHP } from '@php-wasm/universal';
|
|
3
|
+
import { SupportedPHPExtension, SupportedPHPVersion, UniversalPHP } from '@php-wasm/universal';
|
|
4
4
|
import { StepDefinition } from './steps';
|
|
5
5
|
import { Blueprint } from './blueprint';
|
|
6
6
|
export type CompiledStep = (php: UniversalPHP) => Promise<void> | void;
|
|
7
|
-
declare const supportedWordPressVersions: readonly ["6.2", "6.1", "6.0", "5.9", "nightly"];
|
|
8
|
-
type supportedWordPressVersion = (typeof supportedWordPressVersions)[number];
|
|
9
7
|
export interface CompiledBlueprint {
|
|
10
8
|
/** The requested versions of PHP and WordPress for the blueprint */
|
|
11
9
|
versions: {
|
|
12
10
|
php: SupportedPHPVersion;
|
|
13
|
-
wp:
|
|
11
|
+
wp: string;
|
|
14
12
|
};
|
|
13
|
+
/** The requested PHP extensions to load */
|
|
14
|
+
phpExtensions: SupportedPHPExtension[];
|
|
15
15
|
/** The compiled steps for the blueprint */
|
|
16
16
|
run: (playground: UniversalPHP) => Promise<void>;
|
|
17
17
|
}
|
|
@@ -41,4 +41,3 @@ export declare function validateBlueprint(blueprintMaybe: object): {
|
|
|
41
41
|
errors: import("ajv").ErrorObject<string, Record<string, any>, unknown>[] | undefined;
|
|
42
42
|
};
|
|
43
43
|
export declare function runBlueprintSteps(compiledBlueprint: CompiledBlueprint, playground: UniversalPHP): Promise<void>;
|
|
44
|
-
export {};
|
package/lib/resources.d.ts
CHANGED
|
@@ -146,7 +146,6 @@ export declare class UrlResource extends FetchResource {
|
|
|
146
146
|
/** @inheritDoc */
|
|
147
147
|
protected get caption(): string;
|
|
148
148
|
}
|
|
149
|
-
export declare function setPluginProxyURL(url: string): void;
|
|
150
149
|
/**
|
|
151
150
|
* A `Resource` that represents a WordPress core theme.
|
|
152
151
|
*/
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { StepHandler } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* @inheritDoc activatePlugin
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* <code>
|
|
7
|
+
* {
|
|
8
|
+
* "step": "activatePlugin",
|
|
9
|
+
* "pluginName": "Gutenberg",
|
|
10
|
+
* "pluginPath": "/wordpress/wp-content/plugins/gutenberg"
|
|
11
|
+
* }
|
|
12
|
+
* </code>
|
|
4
13
|
*/
|
|
5
14
|
export interface ActivatePluginStep {
|
|
6
15
|
step: 'activatePlugin';
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { StepHandler } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* @inheritDoc activateTheme
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* <code>
|
|
7
|
+
* {
|
|
8
|
+
* "step": "activateTheme",
|
|
9
|
+
* "pluginName": "Storefront",
|
|
10
|
+
* "pluginPath": "/wordpress/wp-content/themes/storefront"
|
|
11
|
+
* }
|
|
12
|
+
* </code>
|
|
4
13
|
*/
|
|
5
14
|
export interface ActivateThemeStep {
|
|
6
15
|
step: 'activateTheme';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UniversalPHP } from '@php-wasm/universal';
|
|
1
2
|
import { StepHandler } from '..';
|
|
2
3
|
/**
|
|
3
4
|
* @private
|
|
@@ -10,5 +11,37 @@ export interface ApplyWordPressPatchesStep {
|
|
|
10
11
|
patchSecrets?: boolean;
|
|
11
12
|
disableSiteHealth?: boolean;
|
|
12
13
|
disableWpNewBlogNotification?: boolean;
|
|
14
|
+
makeEditorFrameControlled?: boolean;
|
|
15
|
+
prepareForRunningInsideWebBrowser?: boolean;
|
|
13
16
|
}
|
|
14
17
|
export declare const applyWordPressPatches: StepHandler<ApplyWordPressPatchesStep>;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* Pair the site editor's nested iframe to the Service Worker.
|
|
21
|
+
*
|
|
22
|
+
* Without the patch below, the site editor initiates network requests that
|
|
23
|
+
* aren't routed through the service worker. That's a known browser issue:
|
|
24
|
+
*
|
|
25
|
+
* * https://bugs.chromium.org/p/chromium/issues/detail?id=880768
|
|
26
|
+
* * https://bugzilla.mozilla.org/show_bug.cgi?id=1293277
|
|
27
|
+
* * https://github.com/w3c/ServiceWorker/issues/765
|
|
28
|
+
*
|
|
29
|
+
* The problem with iframes using srcDoc and src="about:blank" as they
|
|
30
|
+
* fail to inherit the root site's service worker.
|
|
31
|
+
*
|
|
32
|
+
* Gutenberg loads the site editor using <iframe srcDoc="<!doctype html">
|
|
33
|
+
* to force the standards mode and not the quirks mode:
|
|
34
|
+
*
|
|
35
|
+
* https://github.com/WordPress/gutenberg/pull/38855
|
|
36
|
+
*
|
|
37
|
+
* This commit patches the site editor to achieve the same result via
|
|
38
|
+
* <iframe src="/doctype.html"> and a doctype.html file containing just
|
|
39
|
+
* `<!doctype html>`. This allows the iframe to inherit the service worker
|
|
40
|
+
* and correctly load all the css, js, fonts, images, and other assets.
|
|
41
|
+
*
|
|
42
|
+
* Ideally this issue would be fixed directly in Gutenberg and the patch
|
|
43
|
+
* below would be removed.
|
|
44
|
+
*
|
|
45
|
+
* See https://github.com/WordPress/wordpress-playground/issues/42 for more details
|
|
46
|
+
*/
|
|
47
|
+
export declare function makeEditorFrameControlled(php: UniversalPHP, wordpressPath: string, blockEditorScripts: string[]): Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc cp
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @landingPage /index2.php
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* <code>
|
|
9
|
+
* {
|
|
10
|
+
* "step": "cp",
|
|
11
|
+
* "fromPath": "/wordpress/index.php",
|
|
12
|
+
* "toPath": "/wordpress/index2.php"
|
|
13
|
+
* }
|
|
14
|
+
* </code>
|
|
15
|
+
*/
|
|
16
|
+
export interface CpStep {
|
|
17
|
+
step: 'cp';
|
|
18
|
+
/** Source path */
|
|
19
|
+
fromPath: string;
|
|
20
|
+
/** Target path */
|
|
21
|
+
toPath: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Copies a file from one path to another.
|
|
25
|
+
*/
|
|
26
|
+
export declare const cp: StepHandler<CpStep>;
|
package/lib/steps/handlers.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
export { activatePlugin } from './activate-plugin';
|
|
2
2
|
export { activateTheme } from './activate-theme';
|
|
3
3
|
export { applyWordPressPatches } from './apply-wordpress-patches';
|
|
4
|
-
export {
|
|
4
|
+
export { runPHP } from './run-php';
|
|
5
|
+
export { runPHPWithOptions } from './run-php-with-options';
|
|
6
|
+
export { setPhpIniEntry } from './set-php-ini-entry';
|
|
7
|
+
export { request } from './request';
|
|
8
|
+
export { cp } from './cp';
|
|
9
|
+
export { mv } from './mv';
|
|
10
|
+
export { rm } from './rm';
|
|
11
|
+
export { mkdir } from './mkdir';
|
|
12
|
+
export { rmdir } from './rmdir';
|
|
13
|
+
export { writeFile } from './write-file';
|
|
5
14
|
export { defineSiteUrl } from './define-site-url';
|
|
6
15
|
export { importFile, unzip, replaceSite, zipEntireSite } from './import-export';
|
|
7
16
|
export { installPlugin } from './install-plugin';
|
|
@@ -11,6 +11,14 @@ import { StepHandler } from '.';
|
|
|
11
11
|
export declare function zipEntireSite(playground: UniversalPHP): Promise<File>;
|
|
12
12
|
/**
|
|
13
13
|
* @inheritDoc replaceSite
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* <code>
|
|
17
|
+
* {
|
|
18
|
+
* "step": "replaceSite",
|
|
19
|
+
* "fullSiteZip": "https://mysite.com/import.zip"
|
|
20
|
+
* }
|
|
21
|
+
* </code>
|
|
14
22
|
*/
|
|
15
23
|
export interface ReplaceSiteStep<ResourceType> {
|
|
16
24
|
step: 'replaceSite';
|
|
@@ -28,6 +36,15 @@ export interface ReplaceSiteStep<ResourceType> {
|
|
|
28
36
|
export declare const replaceSite: StepHandler<ReplaceSiteStep<File>>;
|
|
29
37
|
/**
|
|
30
38
|
* @inheritDoc unzip
|
|
39
|
+
* @example
|
|
40
|
+
*
|
|
41
|
+
* <code>
|
|
42
|
+
* {
|
|
43
|
+
* "step": "unzip",
|
|
44
|
+
* "zipPath": "/wordpress/data.zip",
|
|
45
|
+
* "extractToPath": "/wordpress"
|
|
46
|
+
* }
|
|
47
|
+
* </code>
|
|
31
48
|
*/
|
|
32
49
|
export interface UnzipStep {
|
|
33
50
|
step: 'unzip';
|
|
@@ -65,6 +82,14 @@ export declare function exportWXR(playground: UniversalPHP): Promise<File>;
|
|
|
65
82
|
export declare function exportWXZ(playground: UniversalPHP): Promise<File>;
|
|
66
83
|
/**
|
|
67
84
|
* @inheritDoc importFile
|
|
85
|
+
* @example
|
|
86
|
+
*
|
|
87
|
+
* <code>
|
|
88
|
+
* {
|
|
89
|
+
* "step": "importFile",
|
|
90
|
+
* "file": "https://mysite.com/import.WXR"
|
|
91
|
+
* }
|
|
92
|
+
* </code>
|
|
68
93
|
*/
|
|
69
94
|
export interface ImportFileStep<ResourceType> {
|
|
70
95
|
step: 'importFile';
|
package/lib/steps/index.d.ts
CHANGED
|
@@ -10,7 +10,16 @@ import { InstallThemeStep, InstallThemeOptions } from './install-theme';
|
|
|
10
10
|
import { LoginStep } from './login';
|
|
11
11
|
import { RunWpInstallationWizardStep, WordPressInstallationOptions } from './run-wp-installation-wizard';
|
|
12
12
|
import { SetSiteOptionsStep, UpdateUserMetaStep } from './site-data';
|
|
13
|
-
import { RmStep
|
|
13
|
+
import { RmStep } from './rm';
|
|
14
|
+
import { CpStep } from './cp';
|
|
15
|
+
import { RmdirStep } from './rmdir';
|
|
16
|
+
import { MkdirStep } from './mkdir';
|
|
17
|
+
import { MvStep } from './mv';
|
|
18
|
+
import { SetPhpIniEntryStep } from './set-php-ini-entry';
|
|
19
|
+
import { RunPHPStep } from './run-php';
|
|
20
|
+
import { RunPHPWithOptionsStep } from './run-php-with-options';
|
|
21
|
+
import { RequestStep } from './request';
|
|
22
|
+
import { WriteFileStep } from './write-file';
|
|
14
23
|
import { DefineWpConfigConstsStep } from './define-wp-config-consts';
|
|
15
24
|
import { ActivateThemeStep } from './activate-theme';
|
|
16
25
|
export type Step = GenericStep<FileReference>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc mkdir
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* <code>
|
|
8
|
+
* {
|
|
9
|
+
* "step": "mkdir",
|
|
10
|
+
* "path": "/wordpress/my-new-folder"
|
|
11
|
+
* }
|
|
12
|
+
* </code>
|
|
13
|
+
*/
|
|
14
|
+
export interface MkdirStep {
|
|
15
|
+
step: 'mkdir';
|
|
16
|
+
/** The path of the directory you want to create */
|
|
17
|
+
path: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates a directory at the specified path.
|
|
21
|
+
*/
|
|
22
|
+
export declare const mkdir: StepHandler<MkdirStep>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc mv
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @landingPage /index2.php
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* <code>
|
|
9
|
+
* {
|
|
10
|
+
* "step": "mv",
|
|
11
|
+
* "fromPath": "/wordpress/index.php",
|
|
12
|
+
* "toPath": "/wordpress/index2.php"
|
|
13
|
+
* }
|
|
14
|
+
* </code>
|
|
15
|
+
*/
|
|
16
|
+
export interface MvStep {
|
|
17
|
+
step: 'mv';
|
|
18
|
+
/** Source path */
|
|
19
|
+
fromPath: string;
|
|
20
|
+
/** Target path */
|
|
21
|
+
toPath: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Moves a file or directory from one path to another.
|
|
25
|
+
*/
|
|
26
|
+
export declare const mv: StepHandler<MvStep>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PHPRequest } from '@php-wasm/universal';
|
|
2
|
+
import { StepHandler } from '.';
|
|
3
|
+
/**
|
|
4
|
+
* @inheritDoc request
|
|
5
|
+
* @needsLogin
|
|
6
|
+
* @hasRunnableExample
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* <code>
|
|
10
|
+
* {
|
|
11
|
+
* "step": "request",
|
|
12
|
+
* "request": {
|
|
13
|
+
* "method": "POST",
|
|
14
|
+
* "url": "/wp-admin/admin-ajax.php",
|
|
15
|
+
* "formData": {
|
|
16
|
+
* "action": "my_action",
|
|
17
|
+
* "foo": "bar"
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* </code>
|
|
22
|
+
*/
|
|
23
|
+
export interface RequestStep {
|
|
24
|
+
step: 'request';
|
|
25
|
+
/**
|
|
26
|
+
* Request details (See /wordpress-playground/api/universal/interface/PHPRequest)
|
|
27
|
+
*/
|
|
28
|
+
request: PHPRequest;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Sends a HTTP request to the Playground.
|
|
32
|
+
*/
|
|
33
|
+
export declare const request: StepHandler<RequestStep>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc rm
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @landingPage /index.php
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* <code>
|
|
9
|
+
* {
|
|
10
|
+
* "step": "rm",
|
|
11
|
+
* "path": "/wordpress/index.php"
|
|
12
|
+
* }
|
|
13
|
+
* </code>
|
|
14
|
+
*/
|
|
15
|
+
export interface RmStep {
|
|
16
|
+
step: 'rm';
|
|
17
|
+
/** The path to remove */
|
|
18
|
+
path: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Removes a file at the specified path.
|
|
22
|
+
*/
|
|
23
|
+
export declare const rm: StepHandler<RmStep>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc rmdir
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @landingPage /wp-admin/
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* <code>
|
|
9
|
+
* {
|
|
10
|
+
* "step": "rmdir",
|
|
11
|
+
* "path": "/wordpress/wp-admin"
|
|
12
|
+
* }
|
|
13
|
+
* </code>
|
|
14
|
+
*/
|
|
15
|
+
export interface RmdirStep {
|
|
16
|
+
step: 'rmdir';
|
|
17
|
+
/** The path to remove */
|
|
18
|
+
path: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Removes a directory at the specified path.
|
|
22
|
+
*/
|
|
23
|
+
export declare const rmdir: StepHandler<RmdirStep>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
import { PHPRunOptions } from '@php-wasm/universal';
|
|
3
|
+
/**
|
|
4
|
+
* @inheritDoc runPHP
|
|
5
|
+
* @hasRunnableExample
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* <code>
|
|
9
|
+
* {
|
|
10
|
+
* "step": "runPHP",
|
|
11
|
+
* "options": {
|
|
12
|
+
* "code": "<?php echo $_SERVER['CONTENT_TYPE']; ?>",
|
|
13
|
+
* "headers": {
|
|
14
|
+
* "Content-type": "text/plain"
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* </code>
|
|
19
|
+
*/
|
|
20
|
+
export interface RunPHPWithOptionsStep {
|
|
21
|
+
step: 'runPHPWithOptions';
|
|
22
|
+
/**
|
|
23
|
+
* Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions)
|
|
24
|
+
*/
|
|
25
|
+
options: PHPRunOptions;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Runs PHP code with the given options.
|
|
29
|
+
*/
|
|
30
|
+
export declare const runPHPWithOptions: StepHandler<RunPHPWithOptionsStep>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc runPHP
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* <code>
|
|
8
|
+
* {
|
|
9
|
+
* "step": "runPHP",
|
|
10
|
+
* "code": "<?php require_once 'wordpress/wp-load.php'; wp_insert_post(array('post_title' => 'wp-load.php required for WP functionality', 'post_status' => 'publish')); ?>"
|
|
11
|
+
* }
|
|
12
|
+
* </code>
|
|
13
|
+
*/
|
|
14
|
+
export interface RunPHPStep {
|
|
15
|
+
/** The step identifier. */
|
|
16
|
+
step: 'runPHP';
|
|
17
|
+
/** The PHP code to run. */
|
|
18
|
+
code: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Runs PHP code.
|
|
22
|
+
*/
|
|
23
|
+
export declare const runPHP: StepHandler<RunPHPStep>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc setPhpIniEntry
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* <code>
|
|
8
|
+
* {
|
|
9
|
+
* "step": "setPhpIniEntry",
|
|
10
|
+
* "key": "display_errors",
|
|
11
|
+
* "value": "1"
|
|
12
|
+
* }
|
|
13
|
+
* </code>
|
|
14
|
+
*/
|
|
15
|
+
export interface SetPhpIniEntryStep {
|
|
16
|
+
step: 'setPhpIniEntry';
|
|
17
|
+
/** Entry name e.g. "display_errors" */
|
|
18
|
+
key: string;
|
|
19
|
+
/** Entry value as a string e.g. "1" */
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Sets a PHP ini entry.
|
|
24
|
+
*/
|
|
25
|
+
export declare const setPhpIniEntry: StepHandler<SetPhpIniEntryStep>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc writeFile
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @landingPage /test.php
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* <code>
|
|
9
|
+
* {
|
|
10
|
+
* "step": "writeFile",
|
|
11
|
+
* "path": "/wordpress/test.php",
|
|
12
|
+
* "data": "<?php echo 'Hello World!'; ?>"
|
|
13
|
+
* }
|
|
14
|
+
* </code>
|
|
15
|
+
*/
|
|
16
|
+
export interface WriteFileStep<ResourceType> {
|
|
17
|
+
step: 'writeFile';
|
|
18
|
+
/** The path of the file to write to */
|
|
19
|
+
path: string;
|
|
20
|
+
/** The data to write */
|
|
21
|
+
data: ResourceType | string | Uint8Array;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Writes data to a file at the specified path.
|
|
25
|
+
*/
|
|
26
|
+
export declare const writeFile: StepHandler<WriteFileStep<File>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/blueprints",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
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": "73b285f8b496c7442474fd7325b3f6b1287cbf95",
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": ">=16.15.1",
|
|
27
27
|
"npm": ">=8.11.0"
|