@wp-playground/blueprints 0.1.43 → 0.1.46
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/index.cjs +27 -20
- package/index.js +305 -277
- package/lib/steps/activate-plugin.d.ts +1 -1
- package/lib/steps/activate-theme.d.ts +12 -0
- package/lib/steps/handlers.d.ts +1 -0
- package/lib/steps/index.d.ts +11 -2
- package/lib/steps/install-plugin.d.ts +8 -3
- package/lib/steps/install-theme.d.ts +34 -1
- package/lib/steps/login.d.ts +19 -4
- package/package.json +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StepHandler } from '.';
|
|
2
|
+
export interface ActivateThemeStep {
|
|
3
|
+
step: 'activateTheme';
|
|
4
|
+
themeFolderName: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Activates a WordPress theme in the Playground.
|
|
8
|
+
*
|
|
9
|
+
* @param playground The playground client.
|
|
10
|
+
* @param themeFolderName The theme folder name.
|
|
11
|
+
*/
|
|
12
|
+
export declare const activateTheme: StepHandler<ActivateThemeStep>;
|
package/lib/steps/handlers.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { activatePlugin } from './activate-plugin';
|
|
2
|
+
export { activateTheme } from './activate-theme';
|
|
2
3
|
export { applyWordPressPatches } from './apply-wordpress-patches';
|
|
3
4
|
export { rm, cp, mkdir, rmdir, mv, setPhpIniEntry, runPHP, runPHPWithOptions, request, writeFile, } from './client-methods';
|
|
4
5
|
export { defineSiteUrl } from './define-site-url';
|
package/lib/steps/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { RunWpInstallationWizardStep, WordPressInstallationOptions } from './run
|
|
|
12
12
|
import { SetSiteOptionsStep, UpdateUserMetaStep } from './site-data';
|
|
13
13
|
import { RmStep, CpStep, MkdirStep, RmdirStep, MvStep, SetPhpIniEntryStep, RunPHPStep, RunPHPWithOptionsStep, RequestStep, WriteFileStep } from './client-methods';
|
|
14
14
|
import { DefineWpConfigConstsStep } from './define-wp-config-consts';
|
|
15
|
+
import { ActivateThemeStep } from './activate-theme';
|
|
15
16
|
import { DefineVirtualWpConfigConstsStep } from './define-virtual-wp-config-consts';
|
|
16
17
|
export type Step = GenericStep<FileReference>;
|
|
17
18
|
export type StepDefinition = Step & {
|
|
@@ -20,9 +21,17 @@ export type StepDefinition = Step & {
|
|
|
20
21
|
caption?: string;
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
|
-
export type GenericStep<Resource> = ActivatePluginStep | ApplyWordPressPatchesStep | CpStep | DefineWpConfigConstsStep | DefineVirtualWpConfigConstsStep | DefineSiteUrlStep | ImportFileStep<Resource> | InstallPluginStep<Resource> | InstallThemeStep<Resource> | LoginStep | MkdirStep | MvStep | RequestStep | ReplaceSiteStep<Resource> | RmStep | RmdirStep | RunPHPStep | RunPHPWithOptionsStep | RunWpInstallationWizardStep | SetPhpIniEntryStep | SetSiteOptionsStep | UnzipStep | UpdateUserMetaStep | WriteFileStep<Resource>;
|
|
24
|
+
export type GenericStep<Resource> = ActivatePluginStep | ActivateThemeStep | ApplyWordPressPatchesStep | CpStep | DefineWpConfigConstsStep | DefineVirtualWpConfigConstsStep | DefineSiteUrlStep | ImportFileStep<Resource> | InstallPluginStep<Resource> | InstallThemeStep<Resource> | LoginStep | MkdirStep | MvStep | RequestStep | ReplaceSiteStep<Resource> | RmStep | RmdirStep | RunPHPStep | RunPHPWithOptionsStep | RunWpInstallationWizardStep | SetPhpIniEntryStep | SetSiteOptionsStep | UnzipStep | UpdateUserMetaStep | WriteFileStep<Resource>;
|
|
24
25
|
export type { ActivatePluginStep, ApplyWordPressPatchesStep, CpStep, DefineWpConfigConstsStep, DefineSiteUrlStep, ImportFileStep, InstallPluginStep, InstallPluginOptions, InstallThemeStep, InstallThemeOptions, LoginStep, MkdirStep, MvStep, RequestStep, ReplaceSiteStep, RmStep, RmdirStep, RunPHPStep, RunPHPWithOptionsStep, RunWpInstallationWizardStep, WordPressInstallationOptions, SetPhpIniEntryStep, SetSiteOptionsStep, UnzipStep, UpdateUserMetaStep, WriteFileStep, };
|
|
25
|
-
export type StepHandler<S extends GenericStep<File>> = (
|
|
26
|
+
export type StepHandler<S extends GenericStep<File>> = (
|
|
27
|
+
/**
|
|
28
|
+
* A PHP instance or Playground client.
|
|
29
|
+
*/
|
|
30
|
+
php: UniversalPHP, args: Omit<S, 'step'>,
|
|
31
|
+
/**
|
|
32
|
+
* Progress reporting details.
|
|
33
|
+
*/
|
|
34
|
+
progressArgs?: {
|
|
26
35
|
tracker: ProgressTracker;
|
|
27
36
|
initialCaption?: string;
|
|
28
37
|
}) => any;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { StepHandler } from '.';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* @inheritDoc installPlugin
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @needsLogin
|
|
6
|
+
* @landingPage /wp-admin/plugins.php
|
|
5
7
|
* @example
|
|
6
8
|
*
|
|
7
9
|
* <code>
|
|
8
10
|
* {
|
|
9
11
|
* "step": "installPlugin",
|
|
10
|
-
* "pluginZipFile":
|
|
12
|
+
* "pluginZipFile": {
|
|
13
|
+
* "resource": "wordpress.org/plugins",
|
|
14
|
+
* "slug": "gutenberg"
|
|
15
|
+
* },
|
|
11
16
|
* "options": {
|
|
12
17
|
* "activate": true
|
|
13
18
|
* }
|
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc installTheme
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @needsLogin
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* <code>
|
|
9
|
+
* {
|
|
10
|
+
* "step": "installTheme",
|
|
11
|
+
* "themeZipFile": {
|
|
12
|
+
* "resource": "wordpress.org/themes",
|
|
13
|
+
* "slug": "pendant"
|
|
14
|
+
* },
|
|
15
|
+
* "options": {
|
|
16
|
+
* "activate": true
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* </code>
|
|
20
|
+
*/
|
|
2
21
|
export interface InstallThemeStep<ResourceType> {
|
|
22
|
+
/**
|
|
23
|
+
* The step identifier.
|
|
24
|
+
*/
|
|
3
25
|
step: 'installTheme';
|
|
26
|
+
/**
|
|
27
|
+
* The theme zip file to install.
|
|
28
|
+
*/
|
|
4
29
|
themeZipFile: ResourceType;
|
|
5
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Optional installation options.
|
|
32
|
+
*/
|
|
33
|
+
options?: {
|
|
34
|
+
/**
|
|
35
|
+
* Whether to activate the theme after installing it.
|
|
36
|
+
*/
|
|
37
|
+
activate?: boolean;
|
|
38
|
+
};
|
|
6
39
|
}
|
|
7
40
|
export interface InstallThemeOptions {
|
|
8
41
|
/**
|
package/lib/steps/login.d.ts
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
import { StepHandler } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* @inheritDoc login
|
|
4
|
+
* @hasRunnableExample
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* <code>
|
|
8
|
+
* {
|
|
9
|
+
* "step": "login",
|
|
10
|
+
* "username": "admin",
|
|
11
|
+
* "password": "password"
|
|
12
|
+
* }
|
|
13
|
+
* </code>
|
|
14
|
+
*/
|
|
2
15
|
export type LoginStep = {
|
|
3
16
|
step: 'login';
|
|
17
|
+
/**
|
|
18
|
+
* The user to log in as. Defaults to 'admin'.
|
|
19
|
+
*/
|
|
4
20
|
username?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The password to log in with. Defaults to 'password'.
|
|
23
|
+
*/
|
|
5
24
|
password?: string;
|
|
6
25
|
};
|
|
7
26
|
/**
|
|
8
27
|
* Logs in to the Playground.
|
|
9
28
|
* Under the hood, this function submits the wp-login.php form
|
|
10
29
|
* just like a user would.
|
|
11
|
-
*
|
|
12
|
-
* @param playground The playground client.
|
|
13
|
-
* @param user The user to log in as. Defaults to 'admin'.
|
|
14
|
-
* @param password The password to log in with. Defaults to 'password'.
|
|
15
30
|
*/
|
|
16
31
|
export declare const login: StepHandler<LoginStep>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/blueprints",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./index.js",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"access": "public",
|
|
22
22
|
"directory": "../../../dist/packages/playground/blueprints"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "b1e1b4b57b00fb52429f0490af4ccb943f496f74"
|
|
25
25
|
}
|