@wp-playground/blueprints 0.5.5 → 0.6.0
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 +34 -2
- package/index.cjs +142 -73
- package/index.d.ts +67 -14
- package/index.js +4085 -3711
- package/lib/steps/enable-multisite.d.ts +24 -0
- package/lib/steps/handlers.d.ts +1 -0
- package/lib/steps/index.d.ts +5 -4
- package/lib/steps/request.d.ts +2 -2
- package/lib/steps/run-php.d.ts +2 -1
- package/lib/steps/unzip.d.ts +12 -4
- package/package.json +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc enableMultisite
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* <code>
|
|
8
|
+
* {
|
|
9
|
+
* "step": "enableMultisite",
|
|
10
|
+
* }
|
|
11
|
+
* </code>
|
|
12
|
+
*/
|
|
13
|
+
export interface EnableMultisiteStep {
|
|
14
|
+
step: 'enableMultisite';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Defines constants in a wp-config.php file.
|
|
18
|
+
*
|
|
19
|
+
* This step can be called multiple times, and the constants will be merged.
|
|
20
|
+
*
|
|
21
|
+
* @param playground The playground client.
|
|
22
|
+
* @param enableMultisite
|
|
23
|
+
*/
|
|
24
|
+
export declare const enableMultisite: StepHandler<EnableMultisiteStep>;
|
package/lib/steps/handlers.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { runPHPWithOptions } from './run-php-with-options';
|
|
|
6
6
|
export { runSql } from './run-sql';
|
|
7
7
|
export { setPhpIniEntry } from './set-php-ini-entry';
|
|
8
8
|
export { request } from './request';
|
|
9
|
+
export { enableMultisite } from './enable-multisite';
|
|
9
10
|
export { cp } from './cp';
|
|
10
11
|
export { mv } from './mv';
|
|
11
12
|
export { rm } from './rm';
|
package/lib/steps/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { ActivateThemeStep } from './activate-theme';
|
|
|
25
25
|
import { UnzipStep } from './unzip';
|
|
26
26
|
import { ImportWordPressFilesStep } from './import-wordpress-files';
|
|
27
27
|
import { ImportFileStep } from './import-file';
|
|
28
|
+
import { EnableMultisiteStep } from './enable-multisite';
|
|
28
29
|
export type Step = GenericStep<FileReference>;
|
|
29
30
|
export type StepDefinition = Step & {
|
|
30
31
|
progress?: {
|
|
@@ -37,8 +38,8 @@ export { wpContentFilesExcludedFromExport } from '../utils/wp-content-files-excl
|
|
|
37
38
|
* If you add a step here, make sure to also
|
|
38
39
|
* add it to the exports below.
|
|
39
40
|
*/
|
|
40
|
-
export type GenericStep<Resource> = ActivatePluginStep | ActivateThemeStep | ApplyWordPressPatchesStep | CpStep | DefineWpConfigConstsStep | DefineSiteUrlStep | ImportFileStep<Resource> | ImportWordPressFilesStep<Resource> | InstallPluginStep<Resource> | InstallThemeStep<Resource> | LoginStep | MkdirStep | MvStep | RequestStep | RmStep | RmdirStep | RunPHPStep | RunPHPWithOptionsStep | RunWpInstallationWizardStep | RunSqlStep<Resource> | SetPhpIniEntryStep | SetSiteOptionsStep | UnzipStep | UpdateUserMetaStep | WriteFileStep<Resource>;
|
|
41
|
-
export type { ActivatePluginStep, ActivateThemeStep, ApplyWordPressPatchesStep, CpStep, DefineWpConfigConstsStep, DefineSiteUrlStep, ImportFileStep, ImportWordPressFilesStep, InstallPluginStep, InstallPluginOptions, InstallThemeStep, InstallThemeOptions, LoginStep, MkdirStep, MvStep, RequestStep, RmStep, RmdirStep, RunPHPStep, RunPHPWithOptionsStep, RunWpInstallationWizardStep, RunSqlStep, WordPressInstallationOptions, SetPhpIniEntryStep, SetSiteOptionsStep, UnzipStep, UpdateUserMetaStep, WriteFileStep, };
|
|
41
|
+
export type GenericStep<Resource> = ActivatePluginStep | ActivateThemeStep | ApplyWordPressPatchesStep | CpStep | DefineWpConfigConstsStep | DefineSiteUrlStep | EnableMultisiteStep | ImportFileStep<Resource> | ImportWordPressFilesStep<Resource> | InstallPluginStep<Resource> | InstallThemeStep<Resource> | LoginStep | MkdirStep | MvStep | RequestStep | RmStep | RmdirStep | RunPHPStep | RunPHPWithOptionsStep | RunWpInstallationWizardStep | RunSqlStep<Resource> | SetPhpIniEntryStep | SetSiteOptionsStep | UnzipStep<Resource> | UpdateUserMetaStep | WriteFileStep<Resource>;
|
|
42
|
+
export type { ActivatePluginStep, ActivateThemeStep, ApplyWordPressPatchesStep, CpStep, DefineWpConfigConstsStep, DefineSiteUrlStep, EnableMultisiteStep, ImportFileStep, ImportWordPressFilesStep, InstallPluginStep, InstallPluginOptions, InstallThemeStep, InstallThemeOptions, LoginStep, MkdirStep, MvStep, RequestStep, RmStep, RmdirStep, RunPHPStep, RunPHPWithOptionsStep, RunWpInstallationWizardStep, RunSqlStep, WordPressInstallationOptions, SetPhpIniEntryStep, SetSiteOptionsStep, UnzipStep, UpdateUserMetaStep, WriteFileStep, };
|
|
42
43
|
/**
|
|
43
44
|
* Progress reporting details.
|
|
44
45
|
*/
|
|
@@ -46,8 +47,8 @@ export type StepProgress = {
|
|
|
46
47
|
tracker: ProgressTracker;
|
|
47
48
|
initialCaption?: string;
|
|
48
49
|
};
|
|
49
|
-
export type StepHandler<S extends GenericStep<File
|
|
50
|
+
export type StepHandler<S extends GenericStep<File>, Return = any> = (
|
|
50
51
|
/**
|
|
51
52
|
* A PHP instance or Playground client.
|
|
52
53
|
*/
|
|
53
|
-
php: UniversalPHP, args: Omit<S, 'step'>, progressArgs?: StepProgress) =>
|
|
54
|
+
php: UniversalPHP, args: Omit<S, 'step'>, progressArgs?: StepProgress) => Return;
|
package/lib/steps/request.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PHPRequest } from '../../../../../php-wasm/universal/src/index.ts';
|
|
1
|
+
import { PHPRequest, PHPResponse } from '../../../../../php-wasm/universal/src/index.ts';
|
|
2
2
|
import { StepHandler } from '.';
|
|
3
3
|
/**
|
|
4
4
|
* @inheritDoc request
|
|
@@ -30,4 +30,4 @@ export interface RequestStep {
|
|
|
30
30
|
/**
|
|
31
31
|
* Sends a HTTP request to the Playground.
|
|
32
32
|
*/
|
|
33
|
-
export declare const request: StepHandler<RequestStep
|
|
33
|
+
export declare const request: StepHandler<RequestStep, Promise<PHPResponse>>;
|
package/lib/steps/run-php.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PHPResponse } from '../../../../../php-wasm/universal/src/index.ts';
|
|
1
2
|
import { StepHandler } from '.';
|
|
2
3
|
/**
|
|
3
4
|
* @inheritDoc runPHP
|
|
@@ -20,4 +21,4 @@ export interface RunPHPStep {
|
|
|
20
21
|
/**
|
|
21
22
|
* Runs PHP code.
|
|
22
23
|
*/
|
|
23
|
-
export declare const runPHP: StepHandler<RunPHPStep
|
|
24
|
+
export declare const runPHP: StepHandler<RunPHPStep, Promise<PHPResponse>>;
|
package/lib/steps/unzip.d.ts
CHANGED
|
@@ -6,15 +6,23 @@ import { StepHandler } from '.';
|
|
|
6
6
|
* <code>
|
|
7
7
|
* {
|
|
8
8
|
* "step": "unzip",
|
|
9
|
-
* "
|
|
9
|
+
* "zipFile": {
|
|
10
|
+
* "resource": "vfs",
|
|
11
|
+
* "path": "/wordpress/data.zip"
|
|
12
|
+
* },
|
|
10
13
|
* "extractToPath": "/wordpress"
|
|
11
14
|
* }
|
|
12
15
|
* </code>
|
|
13
16
|
*/
|
|
14
|
-
export interface UnzipStep {
|
|
17
|
+
export interface UnzipStep<ResourceType> {
|
|
15
18
|
step: 'unzip';
|
|
16
19
|
/** The zip file to extract */
|
|
17
|
-
|
|
20
|
+
zipFile?: ResourceType;
|
|
21
|
+
/**
|
|
22
|
+
* The path of the zip file to extract
|
|
23
|
+
* @deprecated Use zipFile instead.
|
|
24
|
+
*/
|
|
25
|
+
zipPath?: string;
|
|
18
26
|
/** The path to extract the zip file to */
|
|
19
27
|
extractToPath: string;
|
|
20
28
|
}
|
|
@@ -25,4 +33,4 @@ export interface UnzipStep {
|
|
|
25
33
|
* @param zipPath The zip file to unzip.
|
|
26
34
|
* @param extractTo The directory to extract the zip file to.
|
|
27
35
|
*/
|
|
28
|
-
export declare const unzip: StepHandler<UnzipStep
|
|
36
|
+
export declare const unzip: StepHandler<UnzipStep<File>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/blueprints",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
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": "3f137306ec8e3b10ec0674a1fe69ee43349edb4a",
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": ">=18.18.2",
|
|
27
27
|
"npm": ">=8.11.0"
|