@wp-playground/remote 1.0.15 → 1.0.16

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.
@@ -2,7 +2,7 @@
2
2
  * Imports required for the Playground Client.
3
3
  */
4
4
  import { ProgressReceiver } from '@php-wasm/progress';
5
- import { UniversalPHP } from '@php-wasm/universal';
5
+ import { MessageListener, UniversalPHP } from '@php-wasm/universal';
6
6
  import { RemoteAPI, SyncProgressCallback } from '@php-wasm/web';
7
7
  import { ProgressBarOptions } from './progress-bar';
8
8
  import type { PlaygroundWorkerEndpoint, MountDescriptor, WorkerBootOptions } from './worker-thread';
@@ -46,7 +46,7 @@ export interface WebClientMixin extends ProgressReceiver {
46
46
  backfillStaticFilesRemovedFromMinifiedBuild: PlaygroundWorkerEndpoint['backfillStaticFilesRemovedFromMinifiedBuild'];
47
47
  hasCachedStaticFilesRemovedFromMinifiedBuild: PlaygroundWorkerEndpoint['hasCachedStaticFilesRemovedFromMinifiedBuild'];
48
48
  /** @inheritDoc @php-wasm/universal!UniversalPHP.onMessage */
49
- onMessage: PlaygroundWorkerEndpoint['onMessage'];
49
+ onMessage(listener: MessageListener): Promise<() => Promise<void>>;
50
50
  mountOpfs(options: MountDescriptor, onProgress?: SyncProgressCallback): Promise<void>;
51
51
  unmountOpfs(mountpoint: string): Promise<void>;
52
52
  boot(options: WorkerBootOptions): Promise<void>;
@@ -9,11 +9,14 @@ export interface RequestMessage {
9
9
  type: 'request';
10
10
  data: RequestData;
11
11
  }
12
+ export interface SetupFetchNetworkTransportOptions {
13
+ corsProxyUrl?: string;
14
+ }
12
15
  /**
13
16
  * Allow WordPress to make network requests via the fetch API.
14
17
  * On the WordPress side, this is handled by Requests_Transport_Fetch
15
18
  *
16
19
  * @param playground the Playground instance to set up with network support.
17
20
  */
18
- export declare function setupFetchNetworkTransport(playground: UniversalPHP): Promise<void>;
21
+ export declare function setupFetchNetworkTransport(playground: UniversalPHP, options?: SetupFetchNetworkTransportOptions): Promise<void>;
19
22
  export declare function handleRequest(data: RequestData, fetchFn?: typeof fetch): Promise<Uint8Array>;
@@ -15,6 +15,7 @@ export type WorkerBootOptions = {
15
15
  withNetworking: boolean;
16
16
  mounts?: Array<MountDescriptor>;
17
17
  shouldInstallWordPress?: boolean;
18
+ corsProxyUrl?: string;
18
19
  };
19
20
  /** @inheritDoc PHPClient */
20
21
  export declare class PlaygroundWorkerEndpoint extends PHPWorker {
@@ -57,7 +58,7 @@ export declare class PlaygroundWorkerEndpoint extends PHPWorker {
57
58
  unmountOpfs(mountpoint: string): Promise<void>;
58
59
  backfillStaticFilesRemovedFromMinifiedBuild(): Promise<void>;
59
60
  hasCachedStaticFilesRemovedFromMinifiedBuild(): Promise<boolean>;
60
- boot({ scope, mounts, wpVersion, phpVersion, sapiName, withNetworking, shouldInstallWordPress, }: WorkerBootOptions): Promise<void>;
61
+ boot({ scope, mounts, wpVersion, phpVersion, sapiName, withNetworking, shouldInstallWordPress, corsProxyUrl, }: WorkerBootOptions): Promise<void>;
61
62
  journalFSEvents(root: string, callback: (op: FilesystemOperation) => void): Promise<() => any>;
62
63
  replayFSJournal(events: FilesystemOperation[]): Promise<void>;
63
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/remote",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
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": "916516040522ab257109dd617bfcc493bb4f2eb1"
28
+ "gitHead": "bb91e62fb28611a9d447a182aff26dcfced2bb2e"
29
29
  }