@wp-playground/blueprints 0.1.51 → 0.1.56

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.
@@ -4,6 +4,4 @@ export declare function zipNameToHumanName(zipName: string): string;
4
4
  type PatchFileCallback = (contents: string) => string | Uint8Array;
5
5
  export declare function updateFile(php: UniversalPHP, path: string, callback: PatchFileCallback): Promise<void>;
6
6
  export declare function fileToUint8Array(file: File): Promise<Uint8Array>;
7
- export declare const VFS_CONFIG_FILE_BASENAME = "/vfs-blueprints";
8
- export declare const VFS_CONFIG_FILE_PATH = "/vfs-blueprints/wp-config-consts.php";
9
7
  export {};
@@ -1,4 +1,5 @@
1
1
  import { StepHandler } from '.';
2
+ export declare const VFS_TMP_DIRECTORY = "/vfs-blueprints";
2
3
  /**
3
4
  * The step object for defining constants in the wp-config.php file of a WordPress installation.
4
5
  */
@@ -6,11 +7,19 @@ export interface DefineWpConfigConstsStep {
6
7
  step: 'defineWpConfigConsts';
7
8
  /** The constants to define */
8
9
  consts: Record<string, unknown>;
10
+ /**
11
+ * Enables the virtualization of wp-config.php and playground-consts.json files, leaving the local system files untouched.
12
+ * The variables defined in the /vfs-blueprints/playground-consts.json file are loaded via the auto_prepend_file directive in the php.ini file.
13
+ * @default false
14
+ * @see https://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file
15
+ */
16
+ virtualize?: boolean;
9
17
  }
10
18
  /**
11
19
  * Sets site URL of the WordPress installation.
12
20
  *
13
21
  * @param playground The playground client.
14
- * @param wpConfigConst
22
+ * @param wpConfigConst An object containing the constants to be defined and the optional virtual file system configuration file path.
23
+ * @returns Returns the virtual file system configuration file path.
15
24
  */
16
25
  export declare const defineWpConfigConsts: StepHandler<DefineWpConfigConstsStep>;
@@ -10,4 +10,3 @@ export { login } from './login';
10
10
  export { runWpInstallationWizard } from './run-wp-installation-wizard';
11
11
  export { setSiteOptions, updateUserMeta } from './site-data';
12
12
  export { defineWpConfigConsts } from './define-wp-config-consts';
13
- export { defineVirtualWpConfigConsts } from './define-virtual-wp-config-consts';
@@ -13,7 +13,6 @@ 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
15
  import { ActivateThemeStep } from './activate-theme';
16
- import { DefineVirtualWpConfigConstsStep } from './define-virtual-wp-config-consts';
17
16
  export type Step = GenericStep<FileReference>;
18
17
  export type StepDefinition = Step & {
19
18
  progress?: {
@@ -25,8 +24,8 @@ export type StepDefinition = Step & {
25
24
  * If you add a step here, make sure to also
26
25
  * add it to the exports below.
27
26
  */
28
- 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>;
29
- export type { ActivatePluginStep, ActivateThemeStep, ApplyWordPressPatchesStep, CpStep, DefineWpConfigConstsStep, DefineVirtualWpConfigConstsStep, DefineSiteUrlStep, ImportFileStep, InstallPluginStep, InstallPluginOptions, InstallThemeStep, InstallThemeOptions, LoginStep, MkdirStep, MvStep, RequestStep, ReplaceSiteStep, RmStep, RmdirStep, RunPHPStep, RunPHPWithOptionsStep, RunWpInstallationWizardStep, WordPressInstallationOptions, SetPhpIniEntryStep, SetSiteOptionsStep, UnzipStep, UpdateUserMetaStep, WriteFileStep, };
27
+ export type GenericStep<Resource> = ActivatePluginStep | ActivateThemeStep | ApplyWordPressPatchesStep | CpStep | DefineWpConfigConstsStep | DefineSiteUrlStep | ImportFileStep<Resource> | InstallPluginStep<Resource> | InstallThemeStep<Resource> | LoginStep | MkdirStep | MvStep | RequestStep | ReplaceSiteStep<Resource> | RmStep | RmdirStep | RunPHPStep | RunPHPWithOptionsStep | RunWpInstallationWizardStep | SetPhpIniEntryStep | SetSiteOptionsStep | UnzipStep | UpdateUserMetaStep | WriteFileStep<Resource>;
28
+ export type { ActivatePluginStep, ActivateThemeStep, 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, };
30
29
  export type StepHandler<S extends GenericStep<File>> = (
31
30
  /**
32
31
  * A PHP instance or Playground client.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/blueprints",
3
- "version": "0.1.51",
3
+ "version": "0.1.56",
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": "756f9e316b51bc1496982fa4ed9310a16701afa5"
24
+ "gitHead": "af3583eb7c6644a9859ea4782702c6e2c3474821"
25
25
  }
@@ -1,19 +0,0 @@
1
- import { StepHandler } from '.';
2
- /**
3
- * The step object for defining constants in the VFS_CONFIG_FILE_PATH php file and loaded using the auto_prepend_file php.ini directive.
4
- */
5
- export interface DefineVirtualWpConfigConstsStep {
6
- step: 'defineVirtualWpConfigConsts';
7
- /** The constants to define */
8
- consts: Record<string, unknown>;
9
- }
10
- /**
11
- * Function to define constants in the virtual VFS_CONFIG_FILE_PATH php file of a WordPress installation.
12
- * The file should be dynamically loaded using the auto_prepend_file php.ini directive after this step.
13
- *
14
- * @param playground The playground client.
15
- * @param wpConfigConst An object containing the constants to be defined and the optional virtual file system configuration file path.
16
- * @returns Returns the virtual file system configuration file path.
17
- * @see {@link https://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file}
18
- */
19
- export declare const defineVirtualWpConfigConsts: StepHandler<DefineVirtualWpConfigConstsStep>;