@wp-playground/cli 3.1.20 → 3.1.21

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.
package/README.md CHANGED
@@ -97,7 +97,8 @@ The `server` command supports the following optional arguments:
97
97
 
98
98
  - `--debug`: Print the PHP error log if an error occurs during boot.
99
99
  - `--follow-symlinks`: Allow Playground to follow symlinks by automatically mounting symlinked directories and files encountered in mounted directories. ⚠️ Warning: Following symlinks will expose files outside mounted directories to Playground and could be a security risk.
100
- - `--experimental-multi-worker`: Enables experimental multi-worker support. It needs JSPI and a /wordpress directory on a real filesystem. You can pass a positive number to use a specific number of workers, otherwise, it defaults to the number of CPUs minus one.
100
+ - `--workers=<n|auto>`: Number of request-handling worker threads. Pass a positive integer, or `auto` to use one worker per CPU core (minus one). Defaults to `min(6, cpus-1)`. Useful for multi-client workloads (e.g. parallel e2e suites) that need more than 6 in-flight requests.
101
+ - `--experimental-multi-worker`: Deprecated. Use `--workers=<n|auto>` instead. The value of this flag is ignored.
101
102
  - `--phpmyadmin[=<path>]`: Install phpMyAdmin for database management. The phpMyAdmin URL will be printed after boot. Optionally specify a custom URL path (default: `/phpmyadmin`).
102
103
  - `--internal-cookie-store`: Enables Playground's internal cookie handling. When active, Playground uses an HttpCookieStore to manage and persist cookies across requests. If disabled, cookies are handled externally, like by a browser in Node.js.
103
104
 
@@ -1,5 +1,5 @@
1
1
  import type { EmscriptenDownloadMonitor } from '@php-wasm/progress';
2
2
  export declare const CACHE_FOLDER: string;
3
- export declare function fetchSqliteIntegration(): Promise<File>;
3
+ export declare function fetchSqliteIntegration(version?: 'trunk' | 'v2.1.16' | 'v2.2.22' | 'v2.2.22-php52'): Promise<File>;
4
4
  export declare function cachedDownload(remoteUrl: string, cacheKey: string, monitor: EmscriptenDownloadMonitor): Promise<File>;
5
5
  export declare function readAsFile(path: string, fileName?: string): File;
@@ -1,13 +1,14 @@
1
1
  /// <reference types="node" />
2
2
  import type { FileLockManager } from '@php-wasm/universal';
3
3
  import { EmscriptenDownloadMonitor } from '@php-wasm/progress';
4
- import type { PathAlias, SupportedPHPVersion } from '@php-wasm/universal';
4
+ import type { AllPHPVersion, PathAlias } from '@php-wasm/universal';
5
5
  import { PHPWorker } from '@php-wasm/universal';
6
6
  import { type WordPressInstallMode } from '@wp-playground/wordpress';
7
7
  import { type MessagePort } from 'worker_threads';
8
8
  import type { Mount } from '@php-wasm/cli-util';
9
9
  export type WorkerBootWordPressOptions = {
10
10
  siteUrl: string;
11
+ phpVersion?: string;
11
12
  wpVersion?: string;
12
13
  wordpressInstallMode: WordPressInstallMode;
13
14
  wordPressZip?: ArrayBuffer;
@@ -20,7 +21,7 @@ export type WorkerBootWordPressOptions = {
20
21
  };
21
22
  interface WorkerBootRequestHandlerOptions {
22
23
  siteUrl: string;
23
- phpVersion: SupportedPHPVersion;
24
+ phpVersion: AllPHPVersion;
24
25
  processId: number;
25
26
  trace: boolean;
26
27
  nativeInternalDirPath: string;
package/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("child_process");function t(){return!("Suspending"in WebAssembly||process.env.PLAYGROUND_NO_JSPI_RESPAWN||process.versions.bun||"Deno"in globalThis||process.execArgv.includes("--experimental-wasm-jspi")||parseInt(process.versions.node.split(".")[0],10)<23)}function o(){const r=process.argv.slice(2);Promise.resolve().then(()=>require("./run-cli-B6Dm34vQ.cjs")).then(e=>e.runCli).then(({parseOptionsAndRunCLI:e})=>{e(r)})}if(t()){const r=Date.now(),e=i.spawn(process.execPath,["--experimental-wasm-jspi",...process.execArgv,...process.argv.slice(1)],{stdio:"inherit"});for(const s of["SIGINT","SIGTERM"])process.on(s,()=>e.kill(s));e.on("error",()=>{o()}),e.on("close",(s,n)=>{if(s!==0&&!n&&Date.now()-r<1e3){o();return}n?process.kill(process.pid,n):process.exit(s)})}else o();
1
+ "use strict";const i=require("child_process");function t(){return!("Suspending"in WebAssembly||process.env.PLAYGROUND_NO_JSPI_RESPAWN||process.versions.bun||"Deno"in globalThis||process.execArgv.includes("--experimental-wasm-jspi")||parseInt(process.versions.node.split(".")[0],10)<23)}function o(){const r=process.argv.slice(2);Promise.resolve().then(()=>require("./run-cli-vtAjdYXb.cjs")).then(e=>e.runCli).then(({parseOptionsAndRunCLI:e})=>{e(r)})}if(t()){const r=Date.now(),e=i.spawn(process.execPath,["--experimental-wasm-jspi",...process.execArgv,...process.argv.slice(1)],{stdio:"inherit"});for(const s of["SIGINT","SIGTERM"])process.on(s,()=>e.kill(s));e.on("error",()=>{o()}),e.on("close",(s,n)=>{if(s!==0&&!n&&Date.now()-r<1e3){o();return}n?process.kill(process.pid,n):process.exit(s)})}else o();
2
2
  //# sourceMappingURL=cli.cjs.map
package/cli.js CHANGED
@@ -4,7 +4,7 @@ function t() {
4
4
  }
5
5
  function o() {
6
6
  const r = process.argv.slice(2);
7
- import("./run-cli-B9kBDU12.js").then((e) => e.c).then(({ parseOptionsAndRunCLI: e }) => {
7
+ import("./run-cli-C2bV7mIt.js").then((e) => e.d).then(({ parseOptionsAndRunCLI: e }) => {
8
8
  e(r);
9
9
  });
10
10
  }
package/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./run-cli-B6Dm34vQ.cjs");exports.LogVerbosity=e.LogVerbosity;exports.internalsKeyForTesting=e.internalsKeyForTesting;exports.mergeDefinedConstants=e.mergeDefinedConstants;exports.parseOptionsAndRunCLI=e.parseOptionsAndRunCLI;exports.runCLI=e.runCLI;exports.spawnWorkerThread=e.spawnWorkerThread;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./run-cli-vtAjdYXb.cjs");exports.LogVerbosity=e.LogVerbosity;exports.internalsKeyForTesting=e.internalsKeyForTesting;exports.mergeDefinedConstants=e.mergeDefinedConstants;exports.parseOptionsAndRunCLI=e.parseOptionsAndRunCLI;exports.resolveWorkerCount=e.resolveWorkerCount;exports.runCLI=e.runCLI;exports.spawnWorkerThread=e.spawnWorkerThread;
2
2
  //# sourceMappingURL=index.cjs.map
package/index.js CHANGED
@@ -1,10 +1,11 @@
1
- import { L as r, i as a, m as n, p as o, r as t, s as i } from "./run-cli-B9kBDU12.js";
1
+ import { L as r, i as a, m as n, p as o, r as t, a as i, s as p } from "./run-cli-C2bV7mIt.js";
2
2
  export {
3
3
  r as LogVerbosity,
4
4
  a as internalsKeyForTesting,
5
5
  n as mergeDefinedConstants,
6
6
  o as parseOptionsAndRunCLI,
7
- t as runCLI,
8
- i as spawnWorkerThread
7
+ t as resolveWorkerCount,
8
+ i as runCLI,
9
+ p as spawnWorkerThread
9
10
  };
10
11
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/cli",
3
- "version": "3.1.20",
3
+ "version": "3.1.21",
4
4
  "description": "WordPress Playground CLI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,7 +34,7 @@
34
34
  "bin": {
35
35
  "wp-playground-cli": "wp-playground.js"
36
36
  },
37
- "gitHead": "98cfca0a050ef1dacce25710d6ebdf816e80b764",
37
+ "gitHead": "5864051cbf4c2a55656112d99a3f1b076bcd67cd",
38
38
  "dependencies": {
39
39
  "@zip.js/zip.js": "2.7.57",
40
40
  "ajv": "8.12.0",
@@ -61,18 +61,18 @@
61
61
  "ws": "8.18.0",
62
62
  "xml2js": "0.6.2",
63
63
  "yargs": "17.7.2",
64
- "@wp-playground/common": "3.1.20",
65
- "@php-wasm/logger": "3.1.20",
66
- "@php-wasm/progress": "3.1.20",
67
- "@php-wasm/universal": "3.1.20",
68
- "@wp-playground/blueprints": "3.1.20",
69
- "@wp-playground/wordpress": "3.1.20",
70
- "@php-wasm/node": "3.1.20",
71
- "@php-wasm/util": "3.1.20",
72
- "@php-wasm/cli-util": "3.1.20",
73
- "@wp-playground/storage": "3.1.20",
74
- "@php-wasm/xdebug-bridge": "3.1.20",
75
- "@wp-playground/tools": "3.1.20"
64
+ "@wp-playground/common": "3.1.21",
65
+ "@php-wasm/logger": "3.1.21",
66
+ "@php-wasm/progress": "3.1.21",
67
+ "@php-wasm/universal": "3.1.21",
68
+ "@wp-playground/blueprints": "3.1.21",
69
+ "@wp-playground/wordpress": "3.1.21",
70
+ "@php-wasm/node": "3.1.21",
71
+ "@php-wasm/util": "3.1.21",
72
+ "@php-wasm/cli-util": "3.1.21",
73
+ "@wp-playground/storage": "3.1.21",
74
+ "@php-wasm/xdebug-bridge": "3.1.21",
75
+ "@wp-playground/tools": "3.1.21"
76
76
  },
77
77
  "packageManager": "npm@10.9.2",
78
78
  "overrides": {