@wp-playground/client 3.1.27 → 3.1.29

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.
Files changed (4) hide show
  1. package/index.cjs +65 -65
  2. package/index.d.ts +26 -1
  3. package/index.js +2016 -2011
  4. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -5156,13 +5156,17 @@ export declare class BlueprintFetchError extends Error {
5156
5156
  readonly url: string;
5157
5157
  constructor(message: string, url: string, options?: ErrorOptions);
5158
5158
  }
5159
+ export interface ResolveRemoteBlueprintOptions {
5160
+ fetch?: typeof fetch;
5161
+ corsProxy?: string;
5162
+ }
5159
5163
  /**
5160
5164
  * Resolves a remote blueprint from a URL.
5161
5165
  *
5162
5166
  * @param url - The URL of the blueprint to resolve.
5163
5167
  * @returns A promise that resolves to the resolved blueprint.
5164
5168
  */
5165
- export declare function resolveRemoteBlueprint(url: string): Promise<BlueprintBundle>;
5169
+ export declare function resolveRemoteBlueprint(url: string, options?: ResolveRemoteBlueprintOptions): Promise<BlueprintBundle>;
5166
5170
  export declare function resolveRuntimeConfiguration(blueprint: Blueprint): Promise<RuntimeConfiguration>;
5167
5171
  /**
5168
5172
  * @deprecated This function is a no-op. Playground no longer uses a proxy to download plugins and themes.
@@ -5270,6 +5274,7 @@ export type WorkerBootOptions = {
5270
5274
  withNetworking: boolean;
5271
5275
  mounts?: Array<MountDescriptor>;
5272
5276
  shouldInstallWordPress?: boolean;
5277
+ shouldBootWordPress?: boolean;
5273
5278
  corsProxyUrl?: string;
5274
5279
  /** When true, skip default WP install and run Blueprints v2 in the worker */
5275
5280
  experimentalBlueprintsV2Runner?: boolean;
@@ -5444,7 +5449,27 @@ export interface StartPlaygroundOptions {
5444
5449
  */
5445
5450
  sapiName?: string;
5446
5451
  mounts?: Array<MountDescriptor>;
5452
+ /**
5453
+ * Whether to download/install WordPress files.
5454
+ *
5455
+ * Set this to `false` when WordPress files are already available, for example
5456
+ * from `mounts` or a saved site.
5457
+ *
5458
+ * This option cannot be set to `true` when `shouldBootWordPress` is `false`,
5459
+ * because installing WordPress requires running the WordPress boot setup.
5460
+ */
5447
5461
  shouldInstallWordPress?: boolean;
5462
+ /**
5463
+ * Whether to run WordPress boot setup.
5464
+ *
5465
+ * This is separate from `shouldInstallWordPress` because saved sites can boot
5466
+ * from existing WordPress files without downloading or installing a fresh copy.
5467
+ * Set this to `false` for PHP-only Playgrounds.
5468
+ *
5469
+ * If `shouldInstallWordPress` is `false` and this option is `true`, WordPress
5470
+ * files must already be present, for example via `mounts` or a saved site.
5471
+ */
5472
+ shouldBootWordPress?: boolean;
5448
5473
  /**
5449
5474
  * The string prefix used in the site URL served by the currently
5450
5475
  * running remote.html. E.g. for a prefix like `/scope:playground/`,