@wp-playground/remote 3.1.20 → 3.1.22
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PlaygroundWorkerEndpoint, WorkerBootOptions, MountDescriptor } from './playground-worker-endpoint';
|
|
2
2
|
export type { MountDescriptor, WorkerBootOptions };
|
|
3
3
|
import type { WebClientMixin } from './playground-client';
|
|
4
|
+
type PHPRemoteApi = WebClientMixin & Pick<PlaygroundWorkerEndpoint, 'cli'>;
|
|
4
5
|
export declare const serviceWorkerUrl: URL;
|
|
5
|
-
export declare function bootPlaygroundRemote(): Promise<import("@php-wasm/universal").PublicAPI<
|
|
6
|
+
export declare function bootPlaygroundRemote(): Promise<import("@php-wasm/universal").PublicAPI<PHPRemoteApi, import("@php-wasm/universal").RemoteAPI<PlaygroundWorkerEndpoint>>>;
|
|
@@ -48,6 +48,7 @@ export interface WebClientMixin extends ProgressReceiver {
|
|
|
48
48
|
/** @inheritDoc @php-wasm/universal!UniversalPHP.onMessage */
|
|
49
49
|
onMessage(listener: MessageListener): Promise<() => Promise<void>>;
|
|
50
50
|
mountOpfs(options: MountDescriptor, onProgress?: SyncProgressCallback): Promise<void>;
|
|
51
|
+
flushOpfs(mountpoint: string): Promise<void>;
|
|
51
52
|
unmountOpfs(mountpoint: string): Promise<void>;
|
|
52
53
|
boot(options: WorkerBootOptions): Promise<void>;
|
|
53
54
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { FilesystemOperation } from '@php-wasm/fs-journal';
|
|
2
2
|
import type { EmscriptenDownloadMonitor } from '@php-wasm/progress';
|
|
3
|
-
import type { SyncProgressCallback } from '@php-wasm/web';
|
|
3
|
+
import type { PHPWebExtension, SyncProgressCallback } from '@php-wasm/web';
|
|
4
4
|
import type { MountDevice } from '@wp-playground/storage';
|
|
5
5
|
import { createMemoizedFetch } from '@wp-playground/common';
|
|
6
|
-
import type { PathAlias,
|
|
6
|
+
import type { AllPHPVersion, PathAlias, PHP, PHPRequestHandler } from '@php-wasm/universal';
|
|
7
7
|
import { PHPWorker } from '@php-wasm/universal';
|
|
8
8
|
import type { BlueprintDeclaration } from '@wp-playground/blueprints';
|
|
9
9
|
import type { WordPressInstallMode } from '@wp-playground/wordpress';
|
|
@@ -15,10 +15,10 @@ export interface MountDescriptor {
|
|
|
15
15
|
export type WorkerBootOptions = {
|
|
16
16
|
wpVersion?: string;
|
|
17
17
|
sqliteDriverVersion?: string;
|
|
18
|
-
phpVersion?:
|
|
18
|
+
phpVersion?: AllPHPVersion;
|
|
19
19
|
sapiName?: string;
|
|
20
20
|
scope: string;
|
|
21
|
-
|
|
21
|
+
extensions?: PHPWebExtension[];
|
|
22
22
|
withNetworking: boolean;
|
|
23
23
|
mounts?: Array<MountDescriptor>;
|
|
24
24
|
shouldInstallWordPress?: boolean;
|
|
@@ -55,22 +55,26 @@ export declare abstract class PlaygroundWorkerEndpoint extends PHPWorker {
|
|
|
55
55
|
loadedWordPressVersion: string | undefined;
|
|
56
56
|
blueprintMessageListeners: Array<(message: any) => void | Promise<void>>;
|
|
57
57
|
unmounts: Record<string, () => any>;
|
|
58
|
+
private opfsMounts;
|
|
58
59
|
private networkTransport;
|
|
60
|
+
private requestHandler;
|
|
59
61
|
protected downloadMonitor: EmscriptenDownloadMonitor;
|
|
60
62
|
protected memoizedFetch: ReturnType<typeof createMemoizedFetch>;
|
|
61
63
|
constructor(monitor: EmscriptenDownloadMonitor);
|
|
62
64
|
protected computeSiteUrl(scope: string): string;
|
|
63
|
-
protected createRequestHandler({ siteUrl, sapiName, corsProxyUrl, knownRemoteAssetPaths,
|
|
65
|
+
protected createRequestHandler({ siteUrl, sapiName, corsProxyUrl, knownRemoteAssetPaths, extensions, withNetworking, phpVersion, pathAliases, }: {
|
|
64
66
|
siteUrl: string;
|
|
65
67
|
sapiName: string;
|
|
66
68
|
corsProxyUrl?: string;
|
|
67
69
|
knownRemoteAssetPaths: Set<string>;
|
|
68
|
-
|
|
70
|
+
extensions?: PHPWebExtension[];
|
|
69
71
|
withNetworking: boolean;
|
|
70
|
-
phpVersion:
|
|
72
|
+
phpVersion: AllPHPVersion;
|
|
71
73
|
pathAliases?: PathAlias[];
|
|
72
|
-
}): Promise<
|
|
74
|
+
}): Promise<PHPRequestHandler>;
|
|
73
75
|
protected finalizeAfterBoot(requestHandler: any, withNetworking: boolean, knownRemoteAssetPaths: Set<string>): Promise<void>;
|
|
76
|
+
protected getRequestHandler(required?: true): PHPRequestHandler;
|
|
77
|
+
protected getRequestHandler(required: false): PHPRequestHandler | undefined;
|
|
74
78
|
/**
|
|
75
79
|
* @returns WordPress module details, including the static assets directory and default theme.
|
|
76
80
|
*/
|
|
@@ -94,6 +98,7 @@ export declare abstract class PlaygroundWorkerEndpoint extends PHPWorker {
|
|
|
94
98
|
}>;
|
|
95
99
|
hasOpfsMount(mountpoint: string): Promise<boolean>;
|
|
96
100
|
mountOpfs(options: MountDescriptor, onProgress?: SyncProgressCallback): Promise<void>;
|
|
101
|
+
flushOpfs(mountpoint: string): Promise<void>;
|
|
97
102
|
unmountOpfs(mountpoint: string): Promise<void>;
|
|
98
103
|
backfillStaticFilesRemovedFromMinifiedBuild(): Promise<void>;
|
|
99
104
|
hasCachedStaticFilesRemovedFromMinifiedBuild(): Promise<boolean>;
|
|
@@ -106,4 +111,5 @@ export declare abstract class PlaygroundWorkerEndpoint extends PHPWorker {
|
|
|
106
111
|
prefetchUpdateChecks(): Promise<void>;
|
|
107
112
|
journalFSEvents(root: string, callback: (op: FilesystemOperation) => void): Promise<() => any>;
|
|
108
113
|
replayFSJournal(events: FilesystemOperation[]): Promise<void>;
|
|
114
|
+
protected mountOpfsIntoPhp(php: PHP, options: MountDescriptor, onProgress?: SyncProgressCallback): Promise<void>;
|
|
109
115
|
}
|
package/lib/worker-utils.d.ts
CHANGED
|
@@ -55,8 +55,8 @@ import type { PHP } from '@php-wasm/universal';
|
|
|
55
55
|
* By skipping existing files, we ensure that the backfill process doesn't overwrite any user
|
|
56
56
|
* changes.
|
|
57
57
|
*/
|
|
58
|
-
export declare function backfillStaticFilesRemovedFromMinifiedBuild(php
|
|
59
|
-
export declare function hasCachedStaticFilesRemovedFromMinifiedBuild(php
|
|
58
|
+
export declare function backfillStaticFilesRemovedFromMinifiedBuild(php?: PHP): Promise<void>;
|
|
59
|
+
export declare function hasCachedStaticFilesRemovedFromMinifiedBuild(php?: PHP): Promise<boolean>;
|
|
60
60
|
/**
|
|
61
61
|
* Returns the URL of the wordpress-static.zip file containing all the
|
|
62
62
|
* static assets missing from the currently load minified build.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/remote",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.22",
|
|
4
4
|
"description": "WordPress Playground remote host",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"access": "public",
|
|
26
26
|
"directory": "../../../dist/packages/playground/remote"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "04c986b63dd56fe74e4ed0cf04d00cae7ac050bf"
|
|
29
29
|
}
|