@wp-playground/blueprints 0.6.2 → 0.6.4

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.
@@ -25,3 +25,4 @@ export { runWpInstallationWizard } from './run-wp-installation-wizard';
25
25
  export { setSiteOptions, updateUserMeta } from './site-data';
26
26
  export { defineWpConfigConsts } from './define-wp-config-consts';
27
27
  export { zipWpContent } from './zip-wp-content';
28
+ export { wpCLI } from './wp-cli';
@@ -25,6 +25,7 @@ import { UnzipStep } from './unzip';
25
25
  import { ImportWordPressFilesStep } from './import-wordpress-files';
26
26
  import { ImportFileStep } from './import-file';
27
27
  import { EnableMultisiteStep } from './enable-multisite';
28
+ import { WPCLIStep } from './wp-cli';
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 | 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>;
41
- export type { ActivatePluginStep, ActivateThemeStep, 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, };
41
+ export type GenericStep<Resource> = ActivatePluginStep | ActivateThemeStep | 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> | WPCLIStep;
42
+ export type { ActivatePluginStep, ActivateThemeStep, 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, WPCLIStep, };
42
43
  /**
43
44
  * Progress reporting details.
44
45
  */
@@ -0,0 +1,36 @@
1
+ import { PHPResponse } from '../../../../../php-wasm/universal/src/index.ts';
2
+ import { StepHandler } from '.';
3
+ /**
4
+ * @inheritDoc wpCLI
5
+ * @hasRunnableExample
6
+ * @example
7
+ *
8
+ * <code>
9
+ * {
10
+ * "step": "wpCLI",
11
+ * "command": "wp post create --post_title='Test post' --post_excerpt='Some content'"
12
+ * }
13
+ * </code>
14
+ */
15
+ export interface WPCLIStep {
16
+ /** The step identifier. */
17
+ step: 'wp-cli';
18
+ /** The WP CLI command to run. */
19
+ command: string | string[];
20
+ /** wp-cli.phar path */
21
+ wpCliPath?: string;
22
+ }
23
+ /**
24
+ * Runs PHP code.
25
+ */
26
+ export declare const wpCLI: StepHandler<WPCLIStep, Promise<PHPResponse>>;
27
+ /**
28
+ * Naive shell command parser.
29
+ * Ensures that commands like `wp option set blogname "My blog name"` are split into
30
+ * `['wp', 'option', 'set', 'blogname', 'My blog name']` instead of
31
+ * `['wp', 'option', 'set', 'blogname', 'My', 'blog', 'name']`.
32
+ *
33
+ * @param command
34
+ * @returns
35
+ */
36
+ export declare function splitShellCommand(command: string): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/blueprints",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
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": "3c0de0d0847c3550a75a026bef9724eac421afbf",
24
+ "gitHead": "8b74852e9701f5083b367f9a294f34200230ce79",
25
25
  "engines": {
26
26
  "node": ">=18.18.2",
27
27
  "npm": ">=8.11.0"