@wp-playground/cli 3.1.21 → 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,5 @@
1
1
  import type { EmscriptenDownloadMonitor } from '@php-wasm/progress';
2
2
  export declare const CACHE_FOLDER: string;
3
- export declare function fetchSqliteIntegration(version?: 'trunk' | 'v2.1.16' | 'v2.2.22' | 'v2.2.22-php52'): Promise<File>;
3
+ export declare function fetchSqliteIntegration(version?: 'trunk' | 'v2.1.16' | 'v3.0.0-rc.3-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,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { FileLockManager } from '@php-wasm/universal';
3
+ import { type PHPExtension } from '@php-wasm/node';
3
4
  import { EmscriptenDownloadMonitor } from '@php-wasm/progress';
4
5
  import type { AllPHPVersion, PathAlias } from '@php-wasm/universal';
5
6
  import { PHPWorker } from '@php-wasm/universal';
@@ -28,10 +29,7 @@ interface WorkerBootRequestHandlerOptions {
28
29
  mountsBeforeWpInstall: Array<Mount>;
29
30
  mountsAfterWpInstall: Array<Mount>;
30
31
  followSymlinks: boolean;
31
- withIntl?: boolean;
32
- withRedis?: boolean;
33
- withMemcached?: boolean;
34
- withXdebug?: boolean;
32
+ extensions?: PHPExtension[];
35
33
  pathAliases?: PathAlias[];
36
34
  }
37
35
  export declare class PlaygroundCliBlueprintV1Worker extends PHPWorker {
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { FileLockManager } from '@php-wasm/universal';
3
+ import { type PHPExtension } from '@php-wasm/node';
3
4
  import { EmscriptenDownloadMonitor } from '@php-wasm/progress';
4
5
  import type { PathAlias, PHP, FileTree, SupportedPHPVersion, SpawnHandler } from '@php-wasm/universal';
5
6
  import { PHPWorker } from '@php-wasm/universal';
@@ -28,10 +29,7 @@ export type SecondaryWorkerBootArgs = {
28
29
  processId: number;
29
30
  trace: boolean;
30
31
  nativeInternalDirPath: string;
31
- withIntl?: boolean;
32
- withRedis?: boolean;
33
- withMemcached?: boolean;
34
- withXdebug?: boolean;
32
+ extensions?: PHPExtension[];
35
33
  pathAliases?: PathAlias[];
36
34
  mountsBeforeWpInstall?: Array<Mount>;
37
35
  mountsAfterWpInstall?: Array<Mount>;
@@ -59,7 +57,7 @@ export declare class PlaygroundCliBlueprintV2Worker extends PHPWorker {
59
57
  bootWordPress(args: WorkerWordPressBootArgs, workerPostInstallMountsPort: MessagePort): Promise<void>;
60
58
  bootWorker(args: SecondaryWorkerBootArgs): Promise<void>;
61
59
  runBlueprintV2(args: WorkerRunBlueprintArgs, workerPostInstallMountsPort: MessagePort): Promise<void>;
62
- bootRequestHandler({ siteUrl, allow, phpVersion, processId, createFiles, constants, phpIniEntries, trace, nativeInternalDirPath, withIntl, withRedis, withMemcached, withXdebug, pathAliases, onPHPInstanceCreated, spawnHandler, }: WorkerBootRequestHandlerOptions): Promise<void>;
60
+ bootRequestHandler({ siteUrl, allow, phpVersion, processId, createFiles, constants, phpIniEntries, trace, nativeInternalDirPath, extensions, pathAliases, onPHPInstanceCreated, spawnHandler, }: WorkerBootRequestHandlerOptions): Promise<void>;
63
61
  mountAfterWordPressInstall(mounts: Array<Mount>): Promise<void>;
64
62
  applyPostInstallMountsToAllWorkers(postInstallMountsPort: MessagePort): Promise<void>;
65
63
  dispose(): Promise<void>;
package/cli-output.d.ts CHANGED
@@ -1,22 +1,16 @@
1
1
  /**
2
2
  * Manages formatted terminal output for the WordPress Playground CLI.
3
3
  *
4
- * This class handles two distinct output modes:
5
- * - TTY (terminal): Uses ANSI escape codes for colors and in-place progress updates
6
- * - Non-TTY (pipes/logs): Skips progress updates entirely, outputs plain text only
4
+ * Extends the base CLIOutput from @php-wasm/cli-util with
5
+ * Playground-specific output: config summary, progress indicators,
6
+ * and server-ready messages.
7
7
  *
8
- * Progress updates rewrite the same line in TTY mode to create smooth animations.
9
- * When output is piped or redirected, progress is suppressed to avoid cluttering
10
- * logs with intermediate states - only the final "Ready!" message appears.
8
+ * Progress updates rewrite the same line in TTY mode to create smooth
9
+ * animations. When output is piped or redirected, progress is suppressed
10
+ * to avoid cluttering logs with intermediate states.
11
11
  */
12
- /// <reference types="node" />
12
+ import { CLIOutput as BaseCLIOutput } from '@php-wasm/cli-util';
13
13
  import type { Mount } from '@php-wasm/cli-util';
14
- export interface CLIOutputOptions {
15
- /** Verbosity level: 'quiet', 'normal', or 'debug' */
16
- verbosity: string;
17
- /** Output stream to write to. Defaults to process.stdout */
18
- writeStream?: NodeJS.WriteStream;
19
- }
20
14
  /**
21
15
  * Configuration details displayed at CLI startup.
22
16
  */
@@ -32,13 +26,9 @@ export interface ConfigSummary {
32
26
  mounts: Mount[];
33
27
  blueprint?: string;
34
28
  }
35
- export declare class CLIOutput {
36
- private verbosity;
37
- private writeStream;
29
+ export declare class CLIOutput extends BaseCLIOutput {
38
30
  private lastProgressLine;
39
31
  private progressActive;
40
- constructor(options: CLIOutputOptions);
41
- get isTTY(): boolean;
42
32
  /**
43
33
  * Determines if progress updates should be rendered.
44
34
  *
@@ -46,20 +36,6 @@ export declare class CLIOutput {
46
36
  * This prevents progress spam in logs - users only see the final outcome.
47
37
  */
48
38
  get shouldRender(): boolean;
49
- get isQuiet(): boolean;
50
- /**
51
- * ANSI formatting helpers.
52
- *
53
- * These only apply color codes when outputting to a terminal (TTY).
54
- * When piped to files or non-TTY streams, they return plain text to
55
- * avoid polluting logs with escape sequences.
56
- */
57
- private bold;
58
- private dim;
59
- private green;
60
- private cyan;
61
- private yellow;
62
- private red;
63
39
  printBanner(): void;
64
40
  /**
65
41
  * Prints the configuration summary before starting the server.
@@ -112,7 +88,6 @@ export declare class CLIOutput {
112
88
  * CI tests, so changes to this string will break test assertions.
113
89
  */
114
90
  printReady(url: string, workerCount: number): void;
115
- printWarning(message: string): void;
116
91
  /**
117
92
  * Prints the phpMyAdmin URL when the --phpmyadmin flag is enabled.
118
93
  */
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-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();
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-b6r6MAhq.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-C2bV7mIt.js").then((e) => e.d).then(({ parseOptionsAndRunCLI: e }) => {
7
+ import("./run-cli-CC9V0J3D.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-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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./run-cli-b6r6MAhq.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,4 +1,4 @@
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";
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-CC9V0J3D.js";
2
2
  export {
3
3
  r as LogVerbosity,
4
4
  a as internalsKeyForTesting,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/cli",
3
- "version": "3.1.21",
3
+ "version": "3.1.22",
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": "5864051cbf4c2a55656112d99a3f1b076bcd67cd",
37
+ "gitHead": "04c986b63dd56fe74e4ed0cf04d00cae7ac050bf",
38
38
  "dependencies": {
39
39
  "@zip.js/zip.js": "2.7.57",
40
40
  "ajv": "8.12.0",
@@ -53,6 +53,7 @@
53
53
  "octokit": "3.1.2",
54
54
  "pako": "1.0.10",
55
55
  "pify": "2.3.0",
56
+ "playwright": "1.55.1",
56
57
  "readable-stream": "3.6.2",
57
58
  "sha.js": "2.4.12",
58
59
  "simple-get": "4.0.1",
@@ -61,18 +62,18 @@
61
62
  "ws": "8.18.0",
62
63
  "xml2js": "0.6.2",
63
64
  "yargs": "17.7.2",
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"
65
+ "@wp-playground/common": "3.1.22",
66
+ "@php-wasm/logger": "3.1.22",
67
+ "@php-wasm/progress": "3.1.22",
68
+ "@php-wasm/universal": "3.1.22",
69
+ "@wp-playground/blueprints": "3.1.22",
70
+ "@wp-playground/wordpress": "3.1.22",
71
+ "@php-wasm/node": "3.1.22",
72
+ "@php-wasm/util": "3.1.22",
73
+ "@php-wasm/cli-util": "3.1.22",
74
+ "@wp-playground/storage": "3.1.22",
75
+ "@php-wasm/xdebug-bridge": "3.1.22",
76
+ "@wp-playground/tools": "3.1.22"
76
77
  },
77
78
  "packageManager": "npm@10.9.2",
78
79
  "overrides": {
@@ -0,0 +1,21 @@
1
+ import type { PHPExtension, XdebugOptions } from '@php-wasm/node';
2
+ /**
3
+ * Converts the legacy Playground CLI extension options object into the runtime
4
+ * `extensions` array.
5
+ *
6
+ * The CLI still receives extensions as individual options: `intl`, `redis`,
7
+ * `memcached`, and `xdebug`. The PHP runtime no longer has separate `with*`
8
+ * entry points for new callers; it expects one array that can contain built-in
9
+ * extension names and, elsewhere, external extension sources. This function is
10
+ * the CLI boundary between those two shapes.
11
+ *
12
+ * Xdebug is the only CLI extension here with options. A plain `true` becomes
13
+ * the built-in `xdebug` request, while an object preserves the Xdebug settings
14
+ * and passes them through to the Node runtime.
15
+ */
16
+ export declare function legacyPHPExtensionsObjectToExtensionsArray(args: {
17
+ intl?: boolean;
18
+ redis?: boolean;
19
+ memcached?: boolean;
20
+ xdebug?: boolean | XdebugOptions;
21
+ }): PHPExtension[];