Skip to content

Commit 25a3b83

Browse files
committed
[WordPress] Split the BootOptions type into BootOptions and BootRequestHandlerOptions
1 parent 55f0bc0 commit 25a3b83

File tree

1 file changed

+19
-16
lines changed
  • packages/playground/wordpress/src

1 file changed

+19
-16
lines changed

packages/playground/wordpress/src/boot.ts

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,9 @@ export interface Hooks {
3636

3737
export type DatabaseType = 'sqlite' | 'mysql' | 'custom';
3838

39-
export interface BootOptions {
39+
export interface BootRequestHandlerOptions {
4040
createPhpRuntime: () => Promise<number>;
4141
onPHPInstanceCreated?: (php: PHP) => Promise<void>;
42-
/**
43-
* Mounting and Copying is handled via hooks for starters.
44-
*
45-
* In the future we could standardize the
46-
* browser-specific and node-specific mounts
47-
* in the future.
48-
*/
49-
hooks?: Hooks;
5042
/**
5143
* PHP SAPI name to be returned by get_sapi_name(). Overriding
5244
* it is useful for running programs that check for this value,
@@ -59,12 +51,6 @@ export interface BootOptions {
5951
*/
6052
siteUrl: string;
6153
documentRoot?: string;
62-
/** SQL file to load instead of installing WordPress. */
63-
dataSqlPath?: string;
64-
/** Zip with the WordPress installation to extract in /wordpress. */
65-
wordPressZip?: File | Promise<File> | undefined;
66-
/** Preloaded SQLite integration plugin. */
67-
sqliteIntegrationPluginZip?: File | Promise<File>;
6854
spawnHandler?: (processManager: PHPProcessManager) => SpawnHandler;
6955
/**
7056
* PHP.ini entries to define before running any code. They'll
@@ -116,6 +102,23 @@ export interface BootOptions {
116102
cookieStore?: CookieStore | false;
117103
}
118104

105+
export interface BootOptions extends BootRequestHandlerOptions {
106+
/**
107+
* Mounting and Copying is handled via hooks for starters.
108+
*
109+
* In the future we could standardize the
110+
* browser-specific and node-specific mounts
111+
* in the future.
112+
*/
113+
hooks?: Hooks;
114+
/** SQL file to load instead of installing WordPress. */
115+
dataSqlPath?: string;
116+
/** Zip with the WordPress installation to extract in /wordpress. */
117+
wordPressZip?: File | Promise<File> | undefined;
118+
/** Preloaded SQLite integration plugin. */
119+
sqliteIntegrationPluginZip?: File | Promise<File>;
120+
}
121+
119122
/**
120123
* Boots a WordPress instance with the given options.
121124
*
@@ -190,7 +193,7 @@ export async function bootWordPress(options: BootOptions) {
190193
return requestHandler;
191194
}
192195

193-
export async function bootRequestHandler(options: BootOptions) {
196+
export async function bootRequestHandler(options: BootRequestHandlerOptions) {
194197
const spawnHandler = options.spawnHandler ?? sandboxedSpawnHandlerFactory;
195198
async function createPhp(
196199
requestHandler: PHPRequestHandler,

0 commit comments

Comments
 (0)