@wp-playground/cli 3.1.11 → 3.1.13

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,31 +1,30 @@
1
- import { logger as P, LogSeverity as N, errorLogPath as J } from "@php-wasm/logger";
2
- import { consumeAPI as de, ProcessIdAllocator as Ee, SupportedPHPVersions as W, printDebugDetails as $e, HttpCookieStore as Te, FileLockManagerInMemory as Ie, StreamedPHPResponse as K, createObjectPoolProxy as ke, exposeAPI as Me, PHPResponse as Ce, exposeSyncAPI as Ae } from "@php-wasm/universal";
3
- import { resolveRemoteBlueprint as Be, resolveRuntimeConfiguration as ee, compileBlueprintV1 as pe, isBlueprintBundle as De, runBlueprintV1Steps as te } from "@wp-playground/blueprints";
4
- import { zipDirectory as Re, RecommendedPHPVersion as C } from "@wp-playground/common";
5
- import c, { existsSync as z, rmdirSync as We, mkdirSync as Y, readdirSync as Le } from "fs";
6
- import { MessageChannel as ce, Worker as re } from "worker_threads";
7
- import { createNodeFsMountHandler as Ue } from "@php-wasm/node";
8
- import d, { basename as R, join as me } from "path";
9
- import { exec as he } from "child_process";
10
- import { promisify as He } from "util";
11
- import fe from "express";
12
- import { Readable as _e } from "stream";
1
+ import { logger as w, LogSeverity as O, errorLogPath as te } from "@php-wasm/logger";
2
+ import { consumeAPI as me, ProcessIdAllocator as Te, SupportedPHPVersions as W, printDebugDetails as Ie, HttpCookieStore as ke, FileLockManagerInMemory as Me, StreamedPHPResponse as re, createObjectPoolProxy as Ce, exposeAPI as Ae, PHPResponse as Be, exposeSyncAPI as Re } from "@php-wasm/universal";
3
+ import { resolveRemoteBlueprint as De, resolveRuntimeConfiguration as oe, compileBlueprintV1 as fe, isBlueprintBundle as We, runBlueprintV1Steps as se } from "@wp-playground/blueprints";
4
+ import { zipDirectory as Le, RecommendedPHPVersion as C } from "@wp-playground/common";
5
+ import p, { existsSync as z, rmdirSync as _e, mkdirSync as Y, readdirSync as Ue } from "fs";
6
+ import { MessageChannel as he, Worker as ie } from "worker_threads";
7
+ import { createNodeFsMountHandler as He } from "@php-wasm/node";
8
+ import d, { basename as D, join as we } from "path";
9
+ import { exec as ye } from "child_process";
10
+ import { promisify as Ne } from "util";
11
+ import be from "express";
12
+ import { Readable as Oe } from "stream";
13
13
  import { pipeline as Fe } from "stream/promises";
14
- import Ne from "yargs";
15
- import { NodeJsFilesystem as Oe, OverlayFilesystem as je, InMemoryFilesystem as Ve, ZipFilesystem as Ye } from "@wp-playground/storage";
16
- import { EmscriptenDownloadMonitor as qe, ProgressTracker as ze } from "@php-wasm/progress";
17
- import { resolveWordPressRelease as Ge } from "@wp-playground/wordpress";
14
+ import je from "yargs";
15
+ import { NodeJsFilesystem as Ve, OverlayFilesystem as Ye, InMemoryFilesystem as qe, ZipFilesystem as ze } from "@wp-playground/storage";
16
+ import { EmscriptenDownloadMonitor as Ge, ProgressTracker as Qe } from "@php-wasm/progress";
17
+ import { resolveWordPressRelease as Xe } from "@wp-playground/wordpress";
18
18
  import $ from "fs-extra";
19
- import { createRequire as Qe } from "module";
19
+ import { createRequire as Ze } from "module";
20
20
  import G from "os";
21
- import { startBridge as Xe } from "@php-wasm/xdebug-bridge";
22
- import { dir as Ze, setGracefulCleanup as Je } from "tmp-promise";
23
- import Ke from "ps-man";
24
- import { removeTempDirSymlink as et, createTempDirSymlink as oe, makeXdebugConfig as tt, clearXdebugIDEConfig as rt, addXdebugIDEConfig as ot } from "@php-wasm/cli-util";
25
- import { createHash as st } from "crypto";
26
- import { PHPMYADMIN_INSTALL_PATH as se, getPhpMyAdminInstallSteps as it, PHPMYADMIN_ENTRY_PATH as nt } from "@wp-playground/tools";
27
- import { jspi as ie } from "wasm-feature-detect";
28
- function O(e) {
21
+ import { startBridge as Je } from "@php-wasm/xdebug-bridge";
22
+ import { dir as Ke, setGracefulCleanup as et } from "tmp-promise";
23
+ import { removeTempDirSymlink as tt, createTempDirSymlink as ne, makeXdebugConfig as rt, clearXdebugIDEConfig as ot, addXdebugIDEConfig as st } from "@php-wasm/cli-util";
24
+ import { createHash as it } from "crypto";
25
+ import { PHPMYADMIN_INSTALL_PATH as ae, getPhpMyAdminInstallSteps as nt, PHPMYADMIN_ENTRY_PATH as at } from "@wp-playground/tools";
26
+ import { jspi as le } from "wasm-feature-detect";
27
+ function F(e) {
29
28
  const t = [];
30
29
  for (const r of e) {
31
30
  const o = r.split(":");
@@ -41,7 +40,7 @@ function O(e) {
41
40
  }
42
41
  return t;
43
42
  }
44
- function ne(e) {
43
+ function ue(e) {
45
44
  if (e.length % 2 !== 0)
46
45
  throw new Error("Invalid mount format. Expected: /host/path /vfs/path");
47
46
  const t = [];
@@ -56,14 +55,14 @@ function ne(e) {
56
55
  }
57
56
  return t;
58
57
  }
59
- async function yr(e, t) {
58
+ async function wr(e, t) {
60
59
  for (const r of t)
61
60
  await e.mount(
62
61
  r.vfsPath,
63
- Ue(r.hostPath)
62
+ He(r.hostPath)
64
63
  );
65
64
  }
66
- const ae = {
65
+ const de = {
67
66
  step: "runPHP",
68
67
  code: {
69
68
  filename: "activate-theme.php",
@@ -82,7 +81,7 @@ const ae = {
82
81
  `
83
82
  }
84
83
  };
85
- function we(e) {
84
+ function ge(e) {
86
85
  const t = e.autoMount, r = [...e.mount || []], o = [...e["mount-before-install"] || []], s = {
87
86
  ...e,
88
87
  mount: r,
@@ -91,21 +90,21 @@ function we(e) {
91
90
  ...e["additional-blueprint-steps"] || []
92
91
  ]
93
92
  };
94
- if (dt(t)) {
95
- const n = `/wordpress/wp-content/plugins/${R(t)}`;
93
+ if (ct(t)) {
94
+ const a = `/wordpress/wp-content/plugins/${D(t)}`;
96
95
  r.push({
97
96
  hostPath: t,
98
- vfsPath: n,
97
+ vfsPath: a,
99
98
  autoMounted: !0
100
99
  }), s["additional-blueprint-steps"].push({
101
100
  step: "activatePlugin",
102
- pluginPath: `/wordpress/wp-content/plugins/${R(t)}`
101
+ pluginPath: `/wordpress/wp-content/plugins/${D(t)}`
103
102
  });
104
- } else if (ut(t)) {
105
- const i = R(t), n = `/wordpress/wp-content/themes/${i}`;
103
+ } else if (dt(t)) {
104
+ const i = D(t), a = `/wordpress/wp-content/themes/${i}`;
106
105
  r.push({
107
106
  hostPath: t,
108
- vfsPath: n,
107
+ vfsPath: a,
109
108
  autoMounted: !0
110
109
  }), s["additional-blueprint-steps"].push(
111
110
  e["experimental-blueprints-v2-runner"] ? {
@@ -116,40 +115,40 @@ function we(e) {
116
115
  themeFolderName: i
117
116
  }
118
117
  );
119
- } else if (lt(t)) {
120
- const i = c.readdirSync(t);
121
- for (const n of i)
122
- n !== "index.php" && r.push({
123
- hostPath: `${t}/${n}`,
124
- vfsPath: `/wordpress/wp-content/${n}`,
118
+ } else if (ut(t)) {
119
+ const i = p.readdirSync(t);
120
+ for (const a of i)
121
+ a !== "index.php" && r.push({
122
+ hostPath: `${t}/${a}`,
123
+ vfsPath: `/wordpress/wp-content/${a}`,
125
124
  autoMounted: !0
126
125
  });
127
- s["additional-blueprint-steps"].push(ae);
128
- } else at(t) && (o.push({
126
+ s["additional-blueprint-steps"].push(de);
127
+ } else lt(t) && (o.push({
129
128
  hostPath: t,
130
129
  vfsPath: "/wordpress",
131
130
  autoMounted: !0
132
- }), s.mode = "apply-to-existing-site", s["additional-blueprint-steps"].push(ae), s.wordpressInstallMode || (s.wordpressInstallMode = "install-from-existing-files-if-needed"));
131
+ }), s.mode = "apply-to-existing-site", s["additional-blueprint-steps"].push(de), s.wordpressInstallMode || (s.wordpressInstallMode = "install-from-existing-files-if-needed"));
133
132
  return s;
134
133
  }
135
- function at(e) {
136
- const t = c.readdirSync(e);
134
+ function lt(e) {
135
+ const t = p.readdirSync(e);
137
136
  return t.includes("wp-admin") && t.includes("wp-includes") && t.includes("wp-content");
138
137
  }
139
- function lt(e) {
140
- const t = c.readdirSync(e);
138
+ function ut(e) {
139
+ const t = p.readdirSync(e);
141
140
  return t.includes("themes") || t.includes("plugins") || t.includes("mu-plugins") || t.includes("uploads");
142
141
  }
143
- function ut(e) {
144
- if (!c.readdirSync(e).includes("style.css"))
142
+ function dt(e) {
143
+ if (!p.readdirSync(e).includes("style.css"))
145
144
  return !1;
146
- const r = c.readFileSync(me(e, "style.css"), "utf8");
145
+ const r = p.readFileSync(we(e, "style.css"), "utf8");
147
146
  return !!/^(?:[ \t]*<\?php)?[ \t/*#@]*Theme Name:(.*)$/im.exec(r);
148
147
  }
149
- function dt(e) {
150
- const t = c.readdirSync(e), r = /^(?:[ \t]*<\?php)?[ \t/*#@]*Plugin Name:(.*)$/im;
148
+ function ct(e) {
149
+ const t = p.readdirSync(e), r = /^(?:[ \t]*<\?php)?[ \t/*#@]*Plugin Name:(.*)$/im;
151
150
  return !!t.filter((s) => s.endsWith(".php")).find((s) => {
152
- const i = c.readFileSync(me(e, s), "utf8");
151
+ const i = p.readFileSync(we(e, s), "utf8");
153
152
  return !!r.exec(i);
154
153
  });
155
154
  }
@@ -167,7 +166,7 @@ function pt(e) {
167
166
  }
168
167
  return t;
169
168
  }
170
- function ct(e) {
169
+ function mt(e) {
171
170
  if (e.length % 2 !== 0)
172
171
  throw new Error(
173
172
  "Invalid boolean constant definition format. Expected pairs of NAME value"
@@ -188,7 +187,7 @@ function ct(e) {
188
187
  }
189
188
  return t;
190
189
  }
191
- function mt(e) {
190
+ function ft(e) {
192
191
  if (e.length % 2 !== 0)
193
192
  throw new Error(
194
193
  "Invalid number constant definition format. Expected pairs of NAME value"
@@ -208,59 +207,59 @@ function mt(e) {
208
207
  return t;
209
208
  }
210
209
  function ht(e = {}, t = {}, r = {}) {
211
- const o = {}, s = /* @__PURE__ */ new Set(), i = (n, l) => {
212
- for (const u in n) {
210
+ const o = {}, s = /* @__PURE__ */ new Set(), i = (a, l) => {
211
+ for (const u in a) {
213
212
  if (s.has(u))
214
213
  throw new Error(
215
214
  `Constant "${u}" is defined multiple times across different --define-${l} flags`
216
215
  );
217
- s.add(u), o[u] = n[u];
216
+ s.add(u), o[u] = a[u];
218
217
  }
219
218
  };
220
219
  return i(e, "string"), i(t, "bool"), i(r, "number"), o;
221
220
  }
222
- function ye(e) {
221
+ function Q(e) {
223
222
  return ht(
224
223
  e.define,
225
224
  e["define-bool"],
226
225
  e["define-number"]
227
226
  );
228
227
  }
229
- const ft = He(he);
230
- function wt(e) {
228
+ const wt = Ne(ye);
229
+ function yt(e) {
231
230
  return new Promise((t) => {
232
231
  if (e === 0) return t(!1);
233
- const r = fe().listen(e);
232
+ const r = be().listen(e);
234
233
  r.once("listening", () => r.close(() => t(!1))), r.once(
235
234
  "error",
236
235
  (o) => t(o.code === "EADDRINUSE")
237
236
  );
238
237
  });
239
238
  }
240
- async function yt(e) {
241
- const t = fe(), r = await new Promise((n, l) => {
239
+ async function bt(e) {
240
+ const t = be(), r = await new Promise((a, l) => {
242
241
  const u = t.listen(e.port, () => {
243
- const w = u.address();
244
- w === null || typeof w == "string" ? l(new Error("Server address is not available")) : n(u);
242
+ const y = u.address();
243
+ y === null || typeof y == "string" ? l(new Error("Server address is not available")) : a(u);
245
244
  }).once("error", l);
246
245
  });
247
- t.use("/", async (n, l) => {
246
+ t.use("/", async (a, l) => {
248
247
  try {
249
248
  const u = {
250
- url: n.url,
251
- headers: vt(n),
252
- method: n.method,
253
- body: await gt(n)
254
- }, w = await e.handleRequest(u);
255
- await bt(w, l);
249
+ url: a.url,
250
+ headers: St(a),
251
+ method: a.method,
252
+ body: await Pt(a)
253
+ }, y = await e.handleRequest(u);
254
+ await gt(y, l);
256
255
  } catch (u) {
257
- P.error(u), l.headersSent || (l.statusCode = 500, l.end("Internal Server Error"));
256
+ w.error(u), l.headersSent || (l.statusCode = 500, l.end("Internal Server Error"));
258
257
  }
259
258
  });
260
259
  const s = r.address().port, i = process.env.CODESPACE_NAME;
261
- return i && Pt(s, i), await e.onBind(r, s);
260
+ return i && vt(s, i), await e.onBind(r, s);
262
261
  }
263
- async function bt(e, t) {
262
+ async function gt(e, t) {
264
263
  const [r, o] = await Promise.all([
265
264
  e.headers,
266
265
  e.httpStatusCode
@@ -268,16 +267,16 @@ async function bt(e, t) {
268
267
  t.statusCode = o;
269
268
  for (const i in r)
270
269
  t.setHeader(i, r[i]);
271
- const s = _e.fromWeb(e.stdout);
270
+ const s = Oe.fromWeb(e.stdout);
272
271
  try {
273
272
  await Fe(s, t);
274
273
  } catch (i) {
275
- if (i instanceof Error && "code" in i && i.code === "ERR_STREAM_PREMATURE_CLOSE")
274
+ if (i instanceof Error && "code" in i && (i.code === "ERR_STREAM_PREMATURE_CLOSE" || i.code === "ERR_STREAM_UNABLE_TO_PIPE"))
276
275
  return;
277
276
  throw i;
278
277
  }
279
278
  }
280
- const gt = async (e) => await new Promise((t) => {
279
+ const Pt = async (e) => await new Promise((t) => {
281
280
  const r = [];
282
281
  e.on("data", (o) => {
283
282
  r.push(o);
@@ -285,39 +284,39 @@ const gt = async (e) => await new Promise((t) => {
285
284
  t(new Uint8Array(Buffer.concat(r)));
286
285
  });
287
286
  });
288
- async function Pt(e, t) {
289
- P.log(`Publishing port ${e}...`);
287
+ async function vt(e, t) {
288
+ w.log(`Publishing port ${e}...`);
290
289
  const r = `gh codespace ports visibility ${e}:public -c ${t}`;
291
290
  for (let o = 0; o < 10; o++)
292
291
  try {
293
- await ft(r);
292
+ await wt(r);
294
293
  return;
295
294
  } catch {
296
295
  await new Promise((s) => setTimeout(s, 2e3));
297
296
  }
298
297
  }
299
- const vt = (e) => {
298
+ const St = (e) => {
300
299
  const t = {};
301
300
  if (e.rawHeaders && e.rawHeaders.length)
302
301
  for (let r = 0; r < e.rawHeaders.length; r += 2)
303
302
  t[e.rawHeaders[r].toLowerCase()] = e.rawHeaders[r + 1];
304
303
  return t;
305
304
  };
306
- function St(e) {
305
+ function xt(e) {
307
306
  return /^latest$|^trunk$|^nightly$|^(?:(\d+)\.(\d+)(?:\.(\d+))?)((?:-beta(?:\d+)?)|(?:-RC(?:\d+)?))?$/.test(e);
308
307
  }
309
- async function xt({
308
+ async function Et({
310
309
  sourceString: e,
311
310
  blueprintMayReadAdjacentFiles: t
312
311
  }) {
313
312
  if (!e)
314
313
  return;
315
314
  if (e.startsWith("http://") || e.startsWith("https://"))
316
- return await Be(e);
315
+ return await De(e);
317
316
  let r = d.resolve(process.cwd(), e);
318
- if (!c.existsSync(r))
317
+ if (!p.existsSync(r))
319
318
  throw new Error(`Blueprint file does not exist: ${r}`);
320
- const o = c.statSync(r);
319
+ const o = p.statSync(r);
321
320
  if (o.isDirectory() && (r = d.join(r, "blueprint.json")), !o.isFile() && o.isSymbolicLink())
322
321
  throw new Error(
323
322
  `Blueprint path is neither a file nor a directory: ${r}`
@@ -325,11 +324,11 @@ async function xt({
325
324
  const s = d.extname(r);
326
325
  switch (s) {
327
326
  case ".zip":
328
- return Ye.fromArrayBuffer(
329
- c.readFileSync(r).buffer
327
+ return ze.fromArrayBuffer(
328
+ p.readFileSync(r).buffer
330
329
  );
331
330
  case ".json": {
332
- const i = c.readFileSync(r, "utf-8");
331
+ const i = p.readFileSync(r, "utf-8");
333
332
  try {
334
333
  JSON.parse(i);
335
334
  } catch {
@@ -337,9 +336,9 @@ async function xt({
337
336
  `Blueprint file at ${r} is not a valid JSON file`
338
337
  );
339
338
  }
340
- const n = d.dirname(r), l = new Oe(n);
341
- return new je([
342
- new Ve({
339
+ const a = d.dirname(r), l = new Ve(a);
340
+ return new Ye([
341
+ new qe({
343
342
  "blueprint.json": i
344
343
  }),
345
344
  /**
@@ -365,7 +364,7 @@ You can allow this Blueprint to read files from the same parent directory by exp
365
364
  );
366
365
  }
367
366
  }
368
- class Et {
367
+ class $t {
369
368
  constructor(t, r) {
370
369
  this.args = t, this.siteUrl = r.siteUrl, this.phpVersion = t.php, this.cliOutput = r.cliOutput;
371
370
  }
@@ -386,7 +385,7 @@ class Et {
386
385
  fileLockManagerPort: r,
387
386
  nativeInternalDirPath: o
388
387
  }) {
389
- const s = de(t.phpPort);
388
+ const s = me(t.phpPort);
390
389
  await s.useFileLockManager(r);
391
390
  const i = {
392
391
  ...this.args,
@@ -401,17 +400,17 @@ class Et {
401
400
  nativeInternalDirPath: o,
402
401
  mountsBeforeWpInstall: this.args["mount-before-install"] || [],
403
402
  mountsAfterWpInstall: this.args.mount || [],
404
- constants: ye(this.args)
403
+ constants: Q(this.args)
405
404
  };
406
405
  return await s.bootWorker(i), s;
407
406
  }
408
407
  }
409
408
  const q = d.join(G.homedir(), ".wordpress-playground");
410
- async function $t() {
409
+ async function Tt() {
411
410
  const e = typeof __dirname < "u" ? __dirname : import.meta.dirname;
412
411
  let t = d.join(e, "sqlite-database-integration.zip");
413
412
  if (!$.existsSync(t)) {
414
- const r = Qe(import.meta.url), o = d.dirname(
413
+ const r = Ze(import.meta.url), o = d.dirname(
415
414
  r.resolve("@wp-playground/wordpress-builds/package.json")
416
415
  );
417
416
  t = d.join(
@@ -423,29 +422,29 @@ async function $t() {
423
422
  }
424
423
  return new File([await $.readFile(t)], d.basename(t));
425
424
  }
426
- async function Tt(e, t, r) {
425
+ async function It(e, t, r) {
427
426
  const o = d.join(q, t);
428
- return $.existsSync(o) || ($.ensureDirSync(q), await It(e, o, r)), be(o);
427
+ return $.existsSync(o) || ($.ensureDirSync(q), await kt(e, o, r)), Pe(o);
429
428
  }
430
- async function It(e, t, r) {
431
- const s = (await r.monitorFetch(fetch(e))).body.getReader(), i = `${t}.partial`, n = $.createWriteStream(i);
429
+ async function kt(e, t, r) {
430
+ const s = (await r.monitorFetch(fetch(e))).body.getReader(), i = `${t}.partial`, a = $.createWriteStream(i);
432
431
  for (; ; ) {
433
432
  const { done: l, value: u } = await s.read();
434
- if (u && n.write(u), l)
433
+ if (u && a.write(u), l)
435
434
  break;
436
435
  }
437
- n.close(), n.closed || await new Promise((l, u) => {
438
- n.on("finish", () => {
436
+ a.close(), a.closed || await new Promise((l, u) => {
437
+ a.on("finish", () => {
439
438
  $.renameSync(i, t), l(null);
440
- }), n.on("error", (w) => {
441
- $.removeSync(i), u(w);
439
+ }), a.on("error", (y) => {
440
+ $.removeSync(i), u(y);
442
441
  });
443
442
  });
444
443
  }
445
- function be(e, t) {
446
- return new File([$.readFileSync(e)], R(e));
444
+ function Pe(e, t) {
445
+ return new File([$.readFileSync(e)], D(e));
447
446
  }
448
- class kt {
447
+ class Mt {
449
448
  constructor(t, r) {
450
449
  this.args = t, this.siteUrl = r.siteUrl, this.cliOutput = r.cliOutput;
451
450
  }
@@ -454,33 +453,33 @@ class kt {
454
453
  }
455
454
  async bootWordPress(t, r) {
456
455
  let o, s, i;
457
- const n = new qe();
456
+ const a = new Ge();
458
457
  if (this.args.wordpressInstallMode === "download-and-install") {
459
- let w = !1;
460
- n.addEventListener("progress", (E) => {
461
- if (w)
458
+ let y = !1;
459
+ a.addEventListener("progress", (E) => {
460
+ if (y)
462
461
  return;
463
- const { loaded: p, total: a } = E.detail, m = Math.floor(
464
- Math.min(100, 100 * p / a)
462
+ const { loaded: c, total: n } = E.detail, m = Math.floor(
463
+ Math.min(100, 100 * c / n)
465
464
  );
466
- w = m === 100, this.cliOutput.updateProgress(
465
+ y = m === 100, this.cliOutput.updateProgress(
467
466
  "Downloading WordPress",
468
467
  m
469
468
  );
470
- }), o = await Ge(this.args.wp), i = d.join(
469
+ }), o = await Xe(this.args.wp), i = d.join(
471
470
  q,
472
471
  `prebuilt-wp-content-for-wp-${o.version}.zip`
473
- ), s = c.existsSync(i) ? be(i) : await Tt(
472
+ ), s = p.existsSync(i) ? Pe(i) : await It(
474
473
  o.releaseUrl,
475
474
  `${o.version}.zip`,
476
- n
477
- ), P.debug(
475
+ a
476
+ ), w.debug(
478
477
  `Resolved WordPress release URL: ${o?.releaseUrl}`
479
478
  );
480
479
  }
481
480
  let l;
482
- this.args.skipSqliteSetup ? (P.debug("Skipping SQLite integration plugin setup..."), l = void 0) : (this.cliOutput.updateProgress("Preparing SQLite database"), l = await $t()), this.cliOutput.updateProgress("Booting WordPress");
483
- const u = await ee(
481
+ this.args.skipSqliteSetup ? (w.debug("Skipping SQLite integration plugin setup..."), l = void 0) : (this.cliOutput.updateProgress("Preparing SQLite database"), l = await Tt()), this.cliOutput.updateProgress("Booting WordPress");
482
+ const u = await oe(
484
483
  this.getEffectiveBlueprint()
485
484
  );
486
485
  return await t.bootWordPress(
@@ -490,14 +489,14 @@ class kt {
490
489
  wordpressInstallMode: this.args.wordpressInstallMode || "download-and-install",
491
490
  wordPressZip: s && await s.arrayBuffer(),
492
491
  sqliteIntegrationPluginZip: await l?.arrayBuffer(),
493
- constants: ye(this.args)
492
+ constants: Q(this.args)
494
493
  },
495
494
  r
496
- ), i && !this.args["mount-before-install"] && !c.existsSync(i) && (this.cliOutput.updateProgress("Caching WordPress for next boot"), c.writeFileSync(
495
+ ), i && !this.args["mount-before-install"] && !p.existsSync(i) && (this.cliOutput.updateProgress("Caching WordPress for next boot"), p.writeFileSync(
497
496
  i,
498
497
  // Comlink proxy is not assignable to UniversalPHP but
499
498
  // proxies all method calls transparently at runtime.
500
- await Re(
499
+ await Le(
501
500
  t,
502
501
  "/wordpress"
503
502
  )
@@ -508,11 +507,11 @@ class kt {
508
507
  fileLockManagerPort: r,
509
508
  nativeInternalDirPath: o
510
509
  }) {
511
- const s = de(
510
+ const s = me(
512
511
  t.phpPort
513
512
  );
514
513
  await s.isConnected();
515
- const i = await ee(
514
+ const i = await oe(
516
515
  this.getEffectiveBlueprint()
517
516
  );
518
517
  return await s.useFileLockManager(r), await s.bootRequestHandler({
@@ -532,22 +531,22 @@ class kt {
532
531
  }), await s.isReady(), s;
533
532
  }
534
533
  async compileInputBlueprint(t) {
535
- const r = this.getEffectiveBlueprint(), o = new ze();
534
+ const r = this.getEffectiveBlueprint(), o = new Qe();
536
535
  let s = "", i = !1;
537
- return o.addEventListener("progress", (n) => {
536
+ return o.addEventListener("progress", (a) => {
538
537
  if (i)
539
538
  return;
540
- i = n.detail.progress === 100;
541
- const l = Math.floor(n.detail.progress);
542
- s = n.detail.caption || s || "Running Blueprint", this.cliOutput.updateProgress(s.trim(), l);
543
- }), await pe(r, {
539
+ i = a.detail.progress === 100;
540
+ const l = Math.floor(a.detail.progress);
541
+ s = a.detail.caption || s || "Running Blueprint", this.cliOutput.updateProgress(s.trim(), l);
542
+ }), await fe(r, {
544
543
  progress: o,
545
544
  additionalSteps: t
546
545
  });
547
546
  }
548
547
  getEffectiveBlueprint() {
549
548
  const t = this.args.blueprint;
550
- return De(t) ? t : {
549
+ return We(t) ? t : {
551
550
  login: this.args.login,
552
551
  ...t || {},
553
552
  preferredVersions: {
@@ -558,8 +557,8 @@ class kt {
558
557
  };
559
558
  }
560
559
  }
561
- async function Mt(e, t = !0) {
562
- const o = `${d.basename(process.argv0)}${e}${process.pid}-`, s = await Ze({
560
+ async function Ct(e, t = !0) {
561
+ const o = `${d.basename(process.argv0)}${e}${process.pid}-`, s = await Ke({
563
562
  prefix: o,
564
563
  /*
565
564
  * Allow recursive cleanup on process exit.
@@ -571,43 +570,43 @@ async function Mt(e, t = !0) {
571
570
  */
572
571
  unsafeCleanup: !0
573
572
  });
574
- return t && Je(), s;
573
+ return t && et(), s;
575
574
  }
576
- async function Ct(e, t, r) {
577
- const s = (await At(
575
+ async function At(e, t, r) {
576
+ const s = (await Bt(
578
577
  e,
579
578
  t,
580
579
  r
581
580
  )).map(
582
- (i) => new Promise((n) => {
583
- c.rm(i, { recursive: !0 }, (l) => {
584
- l ? P.warn(
581
+ (i) => new Promise((a) => {
582
+ p.rm(i, { recursive: !0 }, (l) => {
583
+ l ? w.warn(
585
584
  `Failed to delete stale Playground temp dir: ${i}`,
586
585
  l
587
- ) : P.info(
586
+ ) : w.info(
588
587
  `Deleted stale Playground temp dir: ${i}`
589
- ), n();
588
+ ), a();
590
589
  });
591
590
  })
592
591
  );
593
592
  await Promise.all(s);
594
593
  }
595
- async function At(e, t, r) {
594
+ async function Bt(e, t, r) {
596
595
  try {
597
- const o = c.readdirSync(r).map((i) => d.join(r, i)), s = [];
596
+ const o = p.readdirSync(r).map((i) => d.join(r, i)), s = [];
598
597
  for (const i of o)
599
- await Bt(
598
+ await Rt(
600
599
  e,
601
600
  t,
602
601
  i
603
602
  ) && s.push(i);
604
603
  return s;
605
604
  } catch (o) {
606
- return P.warn(`Failed to find stale Playground temp dirs: ${o}`), [];
605
+ return w.warn(`Failed to find stale Playground temp dirs: ${o}`), [];
607
606
  }
608
607
  }
609
- async function Bt(e, t, r) {
610
- if (!c.lstatSync(r).isDirectory())
608
+ async function Rt(e, t, r) {
609
+ if (!p.lstatSync(r).isDirectory())
611
610
  return !1;
612
611
  const s = d.basename(r);
613
612
  if (!s.includes(e))
@@ -617,37 +616,33 @@ async function Bt(e, t, r) {
617
616
  );
618
617
  if (!i)
619
618
  return !1;
620
- const n = {
619
+ const a = {
621
620
  executableName: i[1],
622
621
  pid: i[2]
623
622
  };
624
- if (await Dt(n.pid, n.executableName))
623
+ if (Dt(a.pid))
625
624
  return !1;
626
625
  const l = Date.now() - t;
627
- return c.statSync(r).mtime.getTime() < l;
626
+ return p.statSync(r).mtime.getTime() < l;
628
627
  }
629
- async function Dt(e, t) {
630
- const [r] = await new Promise(
631
- (o, s) => {
632
- Ke.list(
633
- {
634
- pid: e,
635
- name: t,
636
- // Remove path from executable name in the results.
637
- clean: !0
638
- },
639
- (i, n) => {
640
- i ? s(i) : o(n);
641
- }
642
- );
643
- }
644
- );
645
- return !!r && r.pid === e && r.command === t;
628
+ function Dt(e, t) {
629
+ try {
630
+ return process.kill(Number(e), 0), !0;
631
+ } catch (r) {
632
+ const o = r, s = o && typeof o.code == "string" ? o.code : void 0;
633
+ return s === "ESRCH" ? !1 : s === "EPERM" || s === "EACCES" ? (w.debug(
634
+ `Permission denied while checking if process ${e} exists (code: ${s}).`,
635
+ r
636
+ ), !0) : (w.warn(
637
+ `Could not determine if process ${e} exists due to unexpected error${s ? ` (code: ${s})` : ""}.`,
638
+ r
639
+ ), !0);
640
+ }
646
641
  }
647
- function Rt(e) {
642
+ function Wt(e) {
648
643
  return process.env.CI === "true" || process.env.CI === "1" || process.env.GITHUB_ACTIONS === "true" || process.env.GITHUB_ACTIONS === "1" || (process.env.TERM || "").toLowerCase() === "dumb" ? !1 : e ? !!e.isTTY : process.stdout.isTTY;
649
644
  }
650
- class Wt {
645
+ class Lt {
651
646
  constructor(t) {
652
647
  this.lastProgressLine = "", this.progressActive = !1, this.verbosity = t.verbosity, this.writeStream = t.writeStream || process.stdout;
653
648
  }
@@ -661,7 +656,7 @@ class Wt {
661
656
  * This prevents progress spam in logs - users only see the final outcome.
662
657
  */
663
658
  get shouldRender() {
664
- return Rt(this.writeStream);
659
+ return Wt(this.writeStream);
665
660
  }
666
661
  get isQuiet() {
667
662
  return this.verbosity === "quiet";
@@ -810,12 +805,12 @@ ${this.green("Ready!")} WordPress is running on ${this.bold(t)} ${this.dim(`(${r
810
805
  );
811
806
  }
812
807
  }
813
- const ge = {
814
- Quiet: { name: "quiet", severity: N.Fatal },
815
- Normal: { name: "normal", severity: N.Info },
816
- Debug: { name: "debug", severity: N.Debug }
808
+ const X = {
809
+ Quiet: { name: "quiet", severity: O.Fatal },
810
+ Normal: { name: "normal", severity: O.Info },
811
+ Debug: { name: "debug", severity: O.Debug }
817
812
  };
818
- async function br(e) {
813
+ async function _t(e) {
819
814
  try {
820
815
  const t = {
821
816
  "site-url": {
@@ -845,14 +840,14 @@ async function br(e) {
845
840
  type: "string",
846
841
  nargs: 2,
847
842
  array: !0,
848
- coerce: ct
843
+ coerce: mt
849
844
  },
850
845
  "define-number": {
851
846
  describe: "Define PHP number constants (can be used multiple times). Format: NAME value. Examples: --define-number LIMIT 100 --define-number RATE 45.67",
852
847
  type: "string",
853
848
  nargs: 2,
854
849
  array: !0,
855
- coerce: mt
850
+ coerce: ft
856
851
  },
857
852
  // @TODO: Support read-only mounts, e.g. via WORKERFS, a custom
858
853
  // ReadOnlyNODEFS, or by copying the files into MEMFS
@@ -861,28 +856,28 @@ async function br(e) {
861
856
  type: "array",
862
857
  string: !0,
863
858
  nargs: 1,
864
- coerce: O
859
+ coerce: F
865
860
  },
866
861
  "mount-before-install": {
867
862
  describe: "Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: /host/path:/vfs/path",
868
863
  type: "array",
869
864
  string: !0,
870
865
  nargs: 1,
871
- coerce: O
866
+ coerce: F
872
867
  },
873
868
  "mount-dir": {
874
869
  describe: 'Mount a directory to the PHP runtime (can be used multiple times). Format: "/host/path" "/vfs/path"',
875
870
  type: "array",
876
871
  nargs: 2,
877
872
  array: !0,
878
- coerce: ne
873
+ coerce: ue
879
874
  },
880
875
  "mount-dir-before-install": {
881
876
  describe: 'Mount a directory before WordPress installation (can be used multiple times). Format: "/host/path" "/vfs/path"',
882
877
  type: "string",
883
878
  nargs: 2,
884
879
  array: !0,
885
- coerce: ne
880
+ coerce: ue
886
881
  },
887
882
  login: {
888
883
  describe: "Should log the user in",
@@ -929,8 +924,8 @@ async function br(e) {
929
924
  verbosity: {
930
925
  describe: "Output logs and progress messages.",
931
926
  type: "string",
932
- choices: Object.values(ge).map(
933
- (a) => a.name
927
+ choices: Object.values(X).map(
928
+ (n) => n.name
934
929
  ),
935
930
  default: "normal"
936
931
  },
@@ -990,7 +985,7 @@ Warning: Following symlinks will expose files outside mounted directories to Pla
990
985
  // supported IDEs and, if needed, will create the relevant
991
986
  // config file for each.
992
987
  choices: ["", "vscode", "phpstorm"],
993
- coerce: (a) => a === "" ? ["vscode", "phpstorm"] : [a]
988
+ coerce: (n) => n === "" ? ["vscode", "phpstorm"] : [n]
994
989
  },
995
990
  "experimental-blueprints-v2-runner": {
996
991
  describe: "Use the experimental Blueprint V2 runner.",
@@ -1009,7 +1004,7 @@ Warning: Following symlinks will expose files outside mounted directories to Pla
1009
1004
  phpmyadmin: {
1010
1005
  describe: "Install phpMyAdmin for database management. The phpMyAdmin URL will be printed after boot. Optionally specify a custom URL path (default: /phpmyadmin).",
1011
1006
  type: "string",
1012
- coerce: (a) => a === "" ? "/phpmyadmin" : a
1007
+ coerce: (n) => n === "" ? "/phpmyadmin" : n
1013
1008
  }
1014
1009
  }, r = {
1015
1010
  port: {
@@ -1080,7 +1075,7 @@ Warning: Following symlinks will expose files outside mounted directories to Pla
1080
1075
  describe: "Mount a directory to the PHP runtime (can be used multiple times). Format: /host/path:/vfs/path. Use this for additional mounts beyond auto-detection.",
1081
1076
  type: "array",
1082
1077
  string: !0,
1083
- coerce: O
1078
+ coerce: F
1084
1079
  },
1085
1080
  reset: {
1086
1081
  describe: "Deletes the stored site directory and starts a new site from scratch.",
@@ -1104,10 +1099,10 @@ Warning: Following symlinks will expose files outside mounted directories to Pla
1104
1099
  type: "string",
1105
1100
  default: "wordpress.zip"
1106
1101
  }
1107
- }, i = Ne(e).usage("Usage: wp-playground <command> [options]").command(
1102
+ }, i = je(e).usage("Usage: wp-playground <command> [options]").command(
1108
1103
  "start",
1109
1104
  "Start a local WordPress server with automatic project detection (recommended)",
1110
- (a) => a.usage(
1105
+ (n) => n.usage(
1111
1106
  `Usage: wp-playground start [options]
1112
1107
 
1113
1108
  The easiest way to run WordPress locally. Automatically detects
@@ -1124,43 +1119,43 @@ Examples:
1124
1119
  ).command(
1125
1120
  "server",
1126
1121
  "Start a local WordPress server (advanced, low-level)",
1127
- (a) => a.options({
1122
+ (n) => n.options({
1128
1123
  ...t,
1129
1124
  ...r
1130
1125
  })
1131
1126
  ).command(
1132
1127
  "run-blueprint",
1133
1128
  "Execute a Blueprint without starting a server",
1134
- (a) => a.options({ ...t })
1129
+ (n) => n.options({ ...t })
1135
1130
  ).command(
1136
1131
  "build-snapshot",
1137
1132
  "Build a ZIP snapshot of a WordPress site based on a Blueprint",
1138
- (a) => a.options({
1133
+ (n) => n.options({
1139
1134
  ...t,
1140
1135
  ...s
1141
1136
  })
1142
1137
  ).command(
1143
1138
  "php",
1144
1139
  "Run a PHP script",
1145
- (a) => a.options({ ...t })
1140
+ (n) => n.options({ ...t })
1146
1141
  ).demandCommand(1, "Please specify a command").strictCommands().conflicts(
1147
1142
  "experimental-unsafe-ide-integration",
1148
1143
  "experimental-devtools"
1149
- ).showHelpOnFail(!1).fail((a, m, y) => {
1144
+ ).showHelpOnFail(!1).fail((n, m, b) => {
1150
1145
  if (m)
1151
1146
  throw m;
1152
- a && a.includes("Please specify a command") && (y.showHelp(), console.error(`
1153
- ` + a), process.exit(1)), console.error(a), process.exit(1);
1154
- }).strictOptions().check(async (a) => {
1155
- if (a["skip-wordpress-install"] === !0 && (a["wordpress-install-mode"] = "do-not-attempt-installing", a.wordpressInstallMode = "do-not-attempt-installing"), a.wp !== void 0 && typeof a.wp == "string" && !St(a.wp))
1147
+ n && n.includes("Please specify a command") && (b.showHelp(), console.error(`
1148
+ ` + n), process.exit(1)), console.error(n), process.exit(1);
1149
+ }).strictOptions().check(async (n) => {
1150
+ if (n["skip-wordpress-install"] === !0 && (n["wordpress-install-mode"] = "do-not-attempt-installing", n.wordpressInstallMode = "do-not-attempt-installing"), n.wp !== void 0 && typeof n.wp == "string" && !xt(n.wp))
1156
1151
  try {
1157
- new URL(a.wp);
1152
+ new URL(n.wp);
1158
1153
  } catch {
1159
1154
  throw new Error(
1160
1155
  'Unrecognized WordPress version. Please use "latest", a URL, or a numeric version such as "6.2", "6.0.1", "6.2-beta1", or "6.2-RC1"'
1161
1156
  );
1162
1157
  }
1163
- const m = a["site-url"];
1158
+ const m = n["site-url"];
1164
1159
  if (typeof m == "string" && m.trim() !== "")
1165
1160
  try {
1166
1161
  new URL(m);
@@ -1169,32 +1164,32 @@ Examples:
1169
1164
  `Invalid site-url "${m}". Please provide a valid URL (e.g., http://localhost:8080 or https://example.com)`
1170
1165
  );
1171
1166
  }
1172
- if (a["auto-mount"]) {
1173
- let y = !1;
1167
+ if (n["auto-mount"]) {
1168
+ let b = !1;
1174
1169
  try {
1175
- y = c.statSync(
1176
- a["auto-mount"]
1170
+ b = p.statSync(
1171
+ n["auto-mount"]
1177
1172
  ).isDirectory();
1178
1173
  } catch {
1179
- y = !1;
1174
+ b = !1;
1180
1175
  }
1181
- if (!y)
1176
+ if (!b)
1182
1177
  throw new Error(
1183
- `The specified --auto-mount path is not a directory: '${a["auto-mount"]}'.`
1178
+ `The specified --auto-mount path is not a directory: '${n["auto-mount"]}'.`
1184
1179
  );
1185
1180
  }
1186
- if (a["experimental-blueprints-v2-runner"] === !0)
1181
+ if (n["experimental-blueprints-v2-runner"] === !0)
1187
1182
  throw new Error(
1188
1183
  "Blueprints v2 are temporarily disabled while we rework their runtime implementation."
1189
1184
  );
1190
- if (a.mode !== void 0)
1185
+ if (n.mode !== void 0)
1191
1186
  throw new Error(
1192
1187
  "The --mode option requires the --experimentalBlueprintsV2Runner flag."
1193
1188
  );
1194
1189
  return !0;
1195
1190
  });
1196
1191
  i.wrap(i.terminalWidth());
1197
- const n = await i.argv, l = n._[0];
1192
+ const a = await i.argv, l = a._[0];
1198
1193
  [
1199
1194
  "start",
1200
1195
  "run-blueprint",
@@ -1202,39 +1197,39 @@ Examples:
1202
1197
  "build-snapshot",
1203
1198
  "php"
1204
1199
  ].includes(l) || (i.showHelp(), process.exit(1));
1205
- const u = n.define || {};
1200
+ const u = a.define || {};
1206
1201
  !("WP_DEBUG" in u) && !("WP_DEBUG_LOG" in u) && !("WP_DEBUG_DISPLAY" in u) && (u.WP_DEBUG = "true", u.WP_DEBUG_LOG = "true", u.WP_DEBUG_DISPLAY = "true");
1207
- const w = {
1208
- ...n,
1202
+ const y = {
1203
+ ...a,
1209
1204
  define: u,
1210
1205
  command: l,
1211
1206
  mount: [
1212
- ...n.mount || [],
1213
- ...n["mount-dir"] || []
1207
+ ...a.mount || [],
1208
+ ...a["mount-dir"] || []
1214
1209
  ],
1215
1210
  "mount-before-install": [
1216
- ...n["mount-before-install"] || [],
1217
- ...n["mount-dir-before-install"] || []
1211
+ ...a["mount-before-install"] || [],
1212
+ ...a["mount-dir-before-install"] || []
1218
1213
  ]
1219
- }, E = await Ut(w);
1214
+ }, E = await ve(y);
1220
1215
  E === void 0 && process.exit(0);
1221
- const p = /* @__PURE__ */ (() => {
1222
- let a;
1216
+ const c = /* @__PURE__ */ (() => {
1217
+ let n;
1223
1218
  return async () => {
1224
- a === void 0 && (a = E[Symbol.asyncDispose]()), await a, process.exit(0);
1219
+ n === void 0 && (n = E[Symbol.asyncDispose]()), await n, process.exit(0);
1225
1220
  };
1226
1221
  })();
1227
- return process.on("SIGINT", p), process.on("SIGTERM", p), {
1222
+ return process.on("SIGINT", c), process.on("SIGTERM", c), {
1228
1223
  [Symbol.asyncDispose]: async () => {
1229
- process.off("SIGINT", p), process.off("SIGTERM", p), await E[Symbol.asyncDispose]();
1224
+ process.off("SIGINT", c), process.off("SIGTERM", c), await E[Symbol.asyncDispose]();
1230
1225
  },
1231
- [Pe]: { cliServer: E }
1226
+ [Z]: { cliServer: E }
1232
1227
  };
1233
1228
  } catch (t) {
1234
1229
  if (console.error(t), !(t instanceof Error))
1235
1230
  throw t;
1236
1231
  if (process.argv.includes("--debug"))
1237
- $e(t);
1232
+ Ie(t);
1238
1233
  else {
1239
1234
  const o = [];
1240
1235
  let s = t;
@@ -1248,34 +1243,28 @@ Examples:
1248
1243
  process.exit(1);
1249
1244
  }
1250
1245
  }
1251
- function le(e, t) {
1246
+ function ce(e, t) {
1252
1247
  return e.find(
1253
1248
  (r) => r.vfsPath.replace(/\/$/, "") === t.replace(/\/$/, "")
1254
1249
  );
1255
1250
  }
1256
- const Pe = Symbol("playground-cli-testing"), I = (e) => process.stdout.isTTY ? "\x1B[1m" + e + "\x1B[0m" : e, Lt = (e) => process.stdout.isTTY ? "\x1B[31m" + e + "\x1B[0m" : e, ue = (e) => process.stdout.isTTY ? `\x1B[2m${e}\x1B[0m` : e, D = (e) => process.stdout.isTTY ? `\x1B[3m${e}\x1B[0m` : e, j = (e) => process.stdout.isTTY ? `\x1B[33m${e}\x1B[0m` : e;
1257
- async function Ut(e) {
1251
+ const Z = Symbol("playground-cli-testing"), I = (e) => process.stdout.isTTY ? "\x1B[1m" + e + "\x1B[0m" : e, Ut = (e) => process.stdout.isTTY ? "\x1B[31m" + e + "\x1B[0m" : e, pe = (e) => process.stdout.isTTY ? `\x1B[2m${e}\x1B[0m` : e, R = (e) => process.stdout.isTTY ? `\x1B[3m${e}\x1B[0m` : e, j = (e) => process.stdout.isTTY ? `\x1B[33m${e}\x1B[0m` : e;
1252
+ async function ve(e) {
1258
1253
  let t;
1259
- const r = e.internalCookieStore ? new Te() : void 0, o = [], s = /* @__PURE__ */ new Map();
1260
- if (e.command === "start" && (e = Ht(e)), e.autoMount !== void 0 && (e.autoMount === "" && (e = { ...e, autoMount: process.cwd() }), e = we(e)), e.wordpressInstallMode === void 0 && (e.wordpressInstallMode = "download-and-install"), e.quiet && (e.verbosity = "quiet", delete e.quiet), e.debug && (e.verbosity = "debug", delete e.debug), e.verbosity) {
1261
- const p = Object.values(ge).find(
1262
- (a) => a.name === e.verbosity
1254
+ const r = e.internalCookieStore ? new ke() : void 0, o = [], s = /* @__PURE__ */ new Map();
1255
+ if (e.command === "start" && (e = Ht(e)), e.autoMount !== void 0 && (e.autoMount === "" && (e = { ...e, autoMount: process.cwd() }), e = ge(e)), e.wordpressInstallMode === void 0 && (e.wordpressInstallMode = "download-and-install"), e.quiet && (e.verbosity = "quiet", delete e.quiet), e.debug && (e.verbosity = "debug", delete e.debug), e.verbosity) {
1256
+ const c = Object.values(X).find(
1257
+ (n) => n.name === e.verbosity
1263
1258
  ).severity;
1264
- P.setSeverityFilterLevel(p);
1259
+ w.setSeverityFilterLevel(c);
1265
1260
  }
1266
- if (e.intl || (e.intl = !0), e.redis === void 0 && (e.redis = await ie()), e.memcached === void 0 && (e.memcached = await ie()), e.phpmyadmin) {
1267
- if (e.phpmyadmin === !0 && (e.phpmyadmin = "/phpmyadmin"), e.skipSqliteSetup)
1268
- throw new Error(
1269
- "--phpmyadmin requires SQLite. Cannot be used with --skip-sqlite-setup."
1270
- );
1271
- e.pathAliases = [
1272
- {
1273
- urlPrefix: e.phpmyadmin,
1274
- fsPath: se
1275
- }
1276
- ];
1277
- }
1278
- const i = new Wt({
1261
+ e.intl || (e.intl = !0), e.redis === void 0 && (e.redis = await le()), e.memcached === void 0 && (e.memcached = await le()), e.phpmyadmin && (e.phpmyadmin === !0 && (e.phpmyadmin = "/phpmyadmin"), e.pathAliases = [
1262
+ {
1263
+ urlPrefix: e.phpmyadmin,
1264
+ fsPath: ae
1265
+ }
1266
+ ]);
1267
+ const i = new Lt({
1279
1268
  verbosity: e.verbosity || "normal"
1280
1269
  });
1281
1270
  e.command === "server" && (i.printBanner(), i.printConfig({
@@ -1292,30 +1281,30 @@ async function Ut(e) {
1292
1281
  ],
1293
1282
  blueprint: typeof e.blueprint == "string" ? e.blueprint : void 0
1294
1283
  }));
1295
- const n = e.command === "server" ? e.port ?? 9400 : 0, l = new Ie();
1296
- let u = !1, w = !0;
1297
- const E = await yt({
1298
- port: e.port ? e.port : await wt(n) ? 0 : n,
1299
- onBind: async (p, a) => {
1300
- const m = "127.0.0.1", y = `http://${m}:${a}`, L = e["site-url"] || y, U = 6, Q = "-playground-cli-site-", T = await Mt(Q);
1301
- P.debug(`Native temp dir for VFS root: ${T.path}`);
1302
- const A = "WP Playground CLI - Listen for Xdebug", X = ".playground-xdebug-root", H = d.join(process.cwd(), X);
1303
- if (await et(H), e.xdebug) {
1304
- const h = {
1305
- hostPath: d.join(".", d.sep, X),
1284
+ const a = e.command === "server" ? e.port ?? 9400 : 0, l = new Me();
1285
+ let u = !1, y = !0;
1286
+ const E = await bt({
1287
+ port: e.port ? e.port : await yt(a) ? 0 : a,
1288
+ onBind: async (c, n) => {
1289
+ const m = "127.0.0.1", b = `http://${m}:${n}`, L = e["site-url"] || b, _ = 6, J = "-playground-cli-site-", T = await Ct(J);
1290
+ w.debug(`Native temp dir for VFS root: ${T.path}`);
1291
+ const A = "WP Playground CLI - Listen for Xdebug", K = ".playground-xdebug-root", U = d.join(process.cwd(), K);
1292
+ if (await tt(U), e.xdebug) {
1293
+ const f = {
1294
+ hostPath: d.join(".", d.sep, K),
1306
1295
  vfsPath: "/"
1307
1296
  };
1308
1297
  if (W.indexOf(
1309
1298
  e.php || C
1310
1299
  ) <= W.indexOf("8.5"))
1311
- await oe(
1300
+ await ne(
1312
1301
  T.path,
1313
- H,
1302
+ U,
1314
1303
  process.platform
1315
- ), e.xdebug = tt({
1304
+ ), e.xdebug = rt({
1316
1305
  cwd: process.cwd(),
1317
1306
  mounts: [
1318
- h,
1307
+ f,
1319
1308
  ...e["mount-before-install"] || [],
1320
1309
  ...e.mount || []
1321
1310
  ],
@@ -1327,43 +1316,43 @@ async function Ut(e) {
1327
1316
  "/proc/"
1328
1317
  ]
1329
1318
  }), console.log(I("Xdebug configured successfully")), console.log(
1330
- j("Playground source root: ") + ".playground-xdebug-root" + D(
1331
- ue(
1319
+ j("Playground source root: ") + ".playground-xdebug-root" + R(
1320
+ pe(
1332
1321
  " – you can set breakpoints and preview Playground's VFS structure in there."
1333
1322
  )
1334
1323
  )
1335
1324
  );
1336
1325
  else if (e.experimentalUnsafeIdeIntegration) {
1337
- await oe(
1326
+ await ne(
1338
1327
  T.path,
1339
- H,
1328
+ U,
1340
1329
  process.platform
1341
1330
  );
1342
1331
  try {
1343
- await rt(
1332
+ await ot(
1344
1333
  A,
1345
1334
  process.cwd()
1346
1335
  );
1347
- const f = typeof e.xdebug == "object" ? e.xdebug : {}, b = await ot({
1336
+ const h = typeof e.xdebug == "object" ? e.xdebug : {}, g = await st({
1348
1337
  name: A,
1349
1338
  host: m,
1350
- port: a,
1339
+ port: n,
1351
1340
  ides: e.experimentalUnsafeIdeIntegration,
1352
1341
  cwd: process.cwd(),
1353
1342
  mounts: [
1354
- h,
1343
+ f,
1355
1344
  ...e["mount-before-install"] || [],
1356
1345
  ...e.mount || []
1357
1346
  ],
1358
- ideKey: f.ideKey || "WPPLAYGROUNDCLI"
1359
- }), v = e.experimentalUnsafeIdeIntegration, S = v.includes("vscode"), x = v.includes("phpstorm"), B = Object.values(b);
1347
+ ideKey: h.ideKey || "WPPLAYGROUNDCLI"
1348
+ }), v = e.experimentalUnsafeIdeIntegration, S = v.includes("vscode"), x = v.includes("phpstorm"), B = Object.values(g);
1360
1349
  console.log(""), B.length > 0 ? (console.log(
1361
1350
  I("Xdebug configured successfully")
1362
1351
  ), console.log(
1363
1352
  j("Updated IDE config: ") + B.join(" ")
1364
1353
  ), console.log(
1365
- j("Playground source root: ") + ".playground-xdebug-root" + D(
1366
- ue(
1354
+ j("Playground source root: ") + ".playground-xdebug-root" + R(
1355
+ pe(
1367
1356
  " – you can set breakpoints and preview Playground's VFS structure in there."
1368
1357
  )
1369
1358
  )
@@ -1371,7 +1360,7 @@ async function Ut(e) {
1371
1360
  I("Xdebug configuration failed.")
1372
1361
  ), console.log(
1373
1362
  "No IDE-specific project settings directory was found in the current working directory."
1374
- )), console.log(""), S && b.vscode && (console.log(
1363
+ )), console.log(""), S && g.vscode && (console.log(
1375
1364
  I("VS Code / Cursor instructions:")
1376
1365
  ), console.log(
1377
1366
  " 1. Ensure you have installed an IDE extension for PHP Debugging"
@@ -1382,15 +1371,15 @@ async function Ut(e) {
1382
1371
  ), console.log(
1383
1372
  " 2. Open the Run and Debug panel on the left sidebar"
1384
1373
  ), console.log(
1385
- ` 3. Select "${D(
1374
+ ` 3. Select "${R(
1386
1375
  A
1387
1376
  )}" from the dropdown`
1388
1377
  ), console.log(' 3. Click "start debugging"'), console.log(
1389
1378
  " 5. Set a breakpoint. For example, in .playground-xdebug-root/wordpress/index.php"
1390
1379
  ), console.log(
1391
1380
  " 6. Visit Playground in your browser to hit the breakpoint"
1392
- ), x && console.log("")), x && b.phpstorm && (console.log(I("PhpStorm instructions:")), console.log(
1393
- ` 1. Choose "${D(
1381
+ ), x && console.log("")), x && g.phpstorm && (console.log(I("PhpStorm instructions:")), console.log(
1382
+ ` 1. Choose "${R(
1394
1383
  A
1395
1384
  )}" debug configuration in the toolbar`
1396
1385
  ), console.log(
@@ -1400,22 +1389,22 @@ async function Ut(e) {
1400
1389
  ), console.log(
1401
1390
  " 4. Visit Playground in your browser to hit the breakpoint"
1402
1391
  )), console.log("");
1403
- } catch (f) {
1392
+ } catch (h) {
1404
1393
  throw new Error("Could not configure Xdebug", {
1405
- cause: f
1394
+ cause: h
1406
1395
  });
1407
1396
  }
1408
1397
  }
1409
1398
  }
1410
- const ve = d.dirname(T.path), Se = 2 * 24 * 60 * 60 * 1e3;
1411
- Ct(
1412
- Q,
1413
- Se,
1414
- ve
1399
+ const xe = d.dirname(T.path), Ee = 2 * 24 * 60 * 60 * 1e3;
1400
+ At(
1401
+ J,
1402
+ Ee,
1403
+ xe
1415
1404
  );
1416
- const Z = d.join(T.path, "internal");
1417
- Y(Z);
1418
- const xe = [
1405
+ const ee = d.join(T.path, "internal");
1406
+ Y(ee);
1407
+ const $e = [
1419
1408
  "wordpress",
1420
1409
  "tools",
1421
1410
  // Note: These dirs are from Emscripten's "default dirs" list:
@@ -1427,67 +1416,67 @@ async function Ut(e) {
1427
1416
  "tmp",
1428
1417
  "home"
1429
1418
  ];
1430
- for (const h of xe) {
1431
- const g = (b) => b.vfsPath === `/${h}`;
1432
- if (!(e["mount-before-install"]?.some(g) || e.mount?.some(g))) {
1433
- const b = d.join(
1419
+ for (const f of $e) {
1420
+ const P = (g) => g.vfsPath === `/${f}`;
1421
+ if (!(e["mount-before-install"]?.some(P) || e.mount?.some(P))) {
1422
+ const g = d.join(
1434
1423
  T.path,
1435
- h
1424
+ f
1436
1425
  );
1437
- Y(b), e["mount-before-install"] === void 0 && (e["mount-before-install"] = []), e["mount-before-install"].unshift({
1438
- vfsPath: `/${h}`,
1439
- hostPath: b
1426
+ Y(g), e["mount-before-install"] === void 0 && (e["mount-before-install"] = []), e["mount-before-install"].unshift({
1427
+ vfsPath: `/${f}`,
1428
+ hostPath: g
1440
1429
  });
1441
1430
  }
1442
1431
  }
1443
1432
  if (e["mount-before-install"])
1444
- for (const h of e["mount-before-install"])
1445
- P.debug(
1446
- `Mount before WP install: ${h.vfsPath} -> ${h.hostPath}`
1433
+ for (const f of e["mount-before-install"])
1434
+ w.debug(
1435
+ `Mount before WP install: ${f.vfsPath} -> ${f.hostPath}`
1447
1436
  );
1448
1437
  if (e.mount)
1449
- for (const h of e.mount)
1450
- P.debug(
1451
- `Mount after WP install: ${h.vfsPath} -> ${h.hostPath}`
1438
+ for (const f of e.mount)
1439
+ w.debug(
1440
+ `Mount after WP install: ${f.vfsPath} -> ${f.hostPath}`
1452
1441
  );
1453
1442
  let k;
1454
- e["experimental-blueprints-v2-runner"] ? k = new Et(e, {
1443
+ e["experimental-blueprints-v2-runner"] ? k = new $t(e, {
1455
1444
  siteUrl: L,
1456
1445
  cliOutput: i
1457
- }) : (k = new kt(e, {
1446
+ }) : (k = new Mt(e, {
1458
1447
  siteUrl: L,
1459
1448
  cliOutput: i
1460
- }), typeof e.blueprint == "string" && (e.blueprint = await xt({
1449
+ }), typeof e.blueprint == "string" && (e.blueprint = await Et({
1461
1450
  sourceString: e.blueprint,
1462
1451
  blueprintMayReadAdjacentFiles: e["blueprint-may-read-adjacent-files"] === !0
1463
1452
  })));
1464
- let _ = !1;
1453
+ let H = !1;
1465
1454
  const M = async function() {
1466
- _ || (_ = !0, await Promise.all(
1467
- o.map(async (g) => {
1468
- await s.get(g)?.dispose(), await g.worker.terminate();
1455
+ H || (H = !0, await Promise.all(
1456
+ o.map(async (P) => {
1457
+ await s.get(P)?.dispose(), await P.worker.terminate();
1469
1458
  })
1470
- ), p && await new Promise((g) => {
1471
- p.close(g), p.closeAllConnections();
1459
+ ), c && await new Promise((P) => {
1460
+ c.close(P), c.closeAllConnections();
1472
1461
  }), await T.cleanup());
1473
1462
  };
1474
1463
  try {
1475
- const h = [], g = k.getWorkerType();
1476
- for (let f = 0; f < U; f++) {
1477
- const b = _t(g, {
1464
+ const f = [], P = k.getWorkerType();
1465
+ for (let h = 0; h < _; h++) {
1466
+ const g = Se(P, {
1478
1467
  onExit: (v) => {
1479
- _ || v === 0 && P.error(
1480
- `Worker ${f} exited with code ${v}
1468
+ H || v === 0 && w.error(
1469
+ `Worker ${h} exited with code ${v}
1481
1470
  `
1482
1471
  );
1483
1472
  }
1484
1473
  }).then(
1485
1474
  async (v) => {
1486
1475
  o.push(v);
1487
- const S = await Ft(l), x = await k.bootRequestHandler({
1476
+ const S = await Nt(l), x = await k.bootRequestHandler({
1488
1477
  worker: v,
1489
1478
  fileLockManagerPort: S,
1490
- nativeInternalDirPath: Z
1479
+ nativeInternalDirPath: ee
1491
1480
  });
1492
1481
  return s.set(
1493
1482
  v,
@@ -1495,16 +1484,16 @@ async function Ut(e) {
1495
1484
  ), [v, x];
1496
1485
  }
1497
1486
  );
1498
- h.push(b), f === 0 && await b;
1487
+ f.push(g), h === 0 && await g;
1499
1488
  }
1500
- await Promise.all(h), t = ke(
1489
+ await Promise.all(f), t = Ce(
1501
1490
  o.map(
1502
- (f) => s.get(f)
1491
+ (h) => s.get(h)
1503
1492
  )
1504
1493
  );
1505
1494
  {
1506
- const f = new ce(), b = f.port1, v = f.port2;
1507
- if (await Me(
1495
+ const h = new he(), g = h.port1, v = h.port2;
1496
+ if (await Ae(
1508
1497
  {
1509
1498
  applyPostInstallMountsToAllWorkers: async () => {
1510
1499
  await Promise.all(
@@ -1519,27 +1508,27 @@ async function Ut(e) {
1519
1508
  }
1520
1509
  },
1521
1510
  void 0,
1522
- b
1511
+ g
1523
1512
  ), await k.bootWordPress(
1524
1513
  t,
1525
1514
  v
1526
- ), b.close(), u = !0, !e["experimental-blueprints-v2-runner"]) {
1515
+ ), g.close(), u = !0, !e["experimental-blueprints-v2-runner"]) {
1527
1516
  const S = await k.compileInputBlueprint(
1528
1517
  e["additional-blueprint-steps"] || []
1529
1518
  );
1530
- S && await te(
1519
+ S && await se(
1531
1520
  S,
1532
1521
  t
1533
1522
  );
1534
1523
  }
1535
1524
  if (e.phpmyadmin && !await t.fileExists(
1536
- `${se}/index.php`
1525
+ `${ae}/index.php`
1537
1526
  )) {
1538
- const S = await it(), x = await pe({ steps: S });
1539
- await te(x, t);
1527
+ const S = await nt(), x = await fe({ steps: S });
1528
+ await se(x, t);
1540
1529
  }
1541
1530
  if (e.command === "build-snapshot") {
1542
- await Ot(t, e.outfile), i.printStatus(`Exported to ${e.outfile}`), await M();
1531
+ await Ft(t, e.outfile), i.printStatus(`Exported to ${e.outfile}`), await M();
1543
1532
  return;
1544
1533
  } else if (e.command === "run-blueprint") {
1545
1534
  i.finishProgress("Done"), await M();
@@ -1554,15 +1543,15 @@ async function Ut(e) {
1554
1543
  x.exitCode,
1555
1544
  x.stdout.pipeTo(
1556
1545
  new WritableStream({
1557
- write(F) {
1558
- process.stdout.write(F);
1546
+ write(N) {
1547
+ process.stdout.write(N);
1559
1548
  }
1560
1549
  })
1561
1550
  ),
1562
1551
  x.stderr.pipeTo(
1563
1552
  new WritableStream({
1564
- write(F) {
1565
- process.stderr.write(F);
1553
+ write(N) {
1554
+ process.stderr.write(N);
1566
1555
  }
1567
1556
  })
1568
1557
  )
@@ -1570,59 +1559,59 @@ async function Ut(e) {
1570
1559
  await M(), process.exit(B);
1571
1560
  }
1572
1561
  }
1573
- if (i.finishProgress(), i.printReady(y, U), e.phpmyadmin) {
1574
- const f = d.join(
1562
+ if (i.finishProgress(), i.printReady(b, _), e.phpmyadmin) {
1563
+ const h = d.join(
1575
1564
  e.phpmyadmin,
1576
- nt
1565
+ at
1577
1566
  );
1578
1567
  i.printPhpMyAdminUrl(
1579
- new URL(f, y).toString()
1568
+ new URL(h, b).toString()
1580
1569
  );
1581
1570
  }
1582
- return e.xdebug && e.experimentalDevtools && (await Xe({
1571
+ return e.xdebug && e.experimentalDevtools && (await Je({
1583
1572
  phpInstance: t,
1584
1573
  phpRoot: "/wordpress"
1585
1574
  })).start(), {
1586
1575
  playground: t,
1587
- server: p,
1588
- serverUrl: y,
1576
+ server: c,
1577
+ serverUrl: b,
1589
1578
  [Symbol.asyncDispose]: M,
1590
- [Pe]: {
1591
- workerThreadCount: U
1579
+ [Z]: {
1580
+ workerThreadCount: _
1592
1581
  }
1593
1582
  };
1594
- } catch (h) {
1583
+ } catch (f) {
1595
1584
  if (e.verbosity !== "debug")
1596
- throw h;
1597
- let g = "";
1598
- throw await t?.fileExists(J) && (g = await t.readFileAsText(J)), await M(), new Error(g, { cause: h });
1585
+ throw f;
1586
+ let P = "";
1587
+ throw await t?.fileExists(te) && (P = await t.readFileAsText(te)), await M(), new Error(P, { cause: f });
1599
1588
  }
1600
1589
  },
1601
- async handleRequest(p) {
1590
+ async handleRequest(c) {
1602
1591
  if (!u)
1603
- return K.forHttpCode(
1592
+ return re.forHttpCode(
1604
1593
  502,
1605
1594
  "WordPress is not ready yet"
1606
1595
  );
1607
- if (w) {
1608
- w = !1;
1596
+ if (y) {
1597
+ y = !1;
1609
1598
  const m = {
1610
1599
  "Content-Type": ["text/plain"],
1611
1600
  "Content-Length": ["0"],
1612
- Location: [p.url]
1601
+ Location: [c.url]
1613
1602
  };
1614
- return p.headers?.cookie?.includes(
1603
+ return c.headers?.cookie?.includes(
1615
1604
  "playground_auto_login_already_happened"
1616
1605
  ) && (m["Set-Cookie"] = [
1617
1606
  "playground_auto_login_already_happened=1; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/"
1618
- ]), K.fromPHPResponse(
1619
- new Ce(302, m, new Uint8Array())
1607
+ ]), re.fromPHPResponse(
1608
+ new Be(302, m, new Uint8Array())
1620
1609
  );
1621
1610
  }
1622
- r && (p = {
1623
- ...p,
1611
+ r && (c = {
1612
+ ...c,
1624
1613
  headers: {
1625
- ...p.headers,
1614
+ ...c.headers,
1626
1615
  // While we have an internal cookie store, we
1627
1616
  // completely replace the incoming request's Cookie
1628
1617
  // header with the cookies from our store. This avoids
@@ -1631,28 +1620,28 @@ async function Ut(e) {
1631
1620
  cookie: r.getCookieRequestHeader()
1632
1621
  }
1633
1622
  });
1634
- const a = await t.requestStreamed(p);
1623
+ const n = await t.requestStreamed(c);
1635
1624
  if (r) {
1636
- const m = await a.headers;
1625
+ const m = await n.headers;
1637
1626
  r.rememberCookiesFromResponseHeaders(m), delete m["set-cookie"];
1638
1627
  }
1639
- return a;
1628
+ return n;
1640
1629
  }
1641
- }).catch((p) => {
1642
- i.printError(p.message), process.exit(1);
1630
+ }).catch((c) => {
1631
+ i.printError(c.message), process.exit(1);
1643
1632
  });
1644
- return E && e.command === "start" && !e.skipBrowser && Nt(E.serverUrl), E;
1633
+ return E && e.command === "start" && !e.skipBrowser && Ot(E.serverUrl), E;
1645
1634
  }
1646
1635
  function Ht(e) {
1647
1636
  let t = { ...e, command: "server" };
1648
- e.noAutoMount || (t.autoMount = d.resolve(process.cwd(), t.path ?? ""), t = we(t), delete t.autoMount);
1649
- const r = le(
1637
+ e.noAutoMount || (t.autoMount = d.resolve(process.cwd(), t.path ?? ""), t = ge(t), delete t.autoMount);
1638
+ const r = ce(
1650
1639
  t["mount-before-install"] || [],
1651
1640
  "/wordpress"
1652
- ) || le(t.mount || [], "/wordpress");
1641
+ ) || ce(t.mount || [], "/wordpress");
1653
1642
  if (r)
1654
1643
  console.log("Site files stored at:", r?.hostPath), e.reset && (console.log(""), console.log(
1655
- Lt(
1644
+ Ut(
1656
1645
  "This site is not managed by Playground CLI and cannot be reset."
1657
1646
  )
1658
1647
  ), console.log(
@@ -1661,15 +1650,15 @@ function Ht(e) {
1661
1650
  "You may still remove the site's directory manually if you wish."
1662
1651
  ), process.exit(1));
1663
1652
  else {
1664
- const o = t.autoMount || process.cwd(), s = st("sha256").update(o).digest("hex"), i = G.homedir(), n = d.join(
1653
+ const o = t.autoMount || process.cwd(), s = it("sha256").update(o).digest("hex"), i = G.homedir(), a = d.join(
1665
1654
  i,
1666
1655
  ".wordpress-playground/sites",
1667
1656
  s
1668
1657
  );
1669
- console.log("Site files stored at:", n), z(n) && e.reset && (console.log("Resetting site..."), We(n, { recursive: !0 })), Y(n, { recursive: !0 }), t["mount-before-install"] = [
1658
+ console.log("Site files stored at:", a), z(a) && e.reset && (console.log("Resetting site..."), _e(a, { recursive: !0 })), Y(a, { recursive: !0 }), t["mount-before-install"] = [
1670
1659
  ...t["mount-before-install"] || [],
1671
- { vfsPath: "/wordpress", hostPath: n }
1672
- ], t.wordpressInstallMode = Le(n).length === 0 ? (
1660
+ { vfsPath: "/wordpress", hostPath: a }
1661
+ ], t.wordpressInstallMode = Ue(a).length === 0 ? (
1673
1662
  // Only download WordPress on the first run when the site directory is still
1674
1663
  // empty.
1675
1664
  "download-and-install"
@@ -1680,10 +1669,10 @@ function Ht(e) {
1680
1669
  }
1681
1670
  return t;
1682
1671
  }
1683
- const V = new Ee();
1684
- function _t(e, { onExit: t } = {}) {
1672
+ const V = new Te();
1673
+ function Se(e, { onExit: t } = {}) {
1685
1674
  let r;
1686
- return e === "v1" ? r = new re(new URL("./worker-thread-v1.js", import.meta.url)) : r = new re(new URL("./worker-thread-v2.js", import.meta.url)), new Promise((o, s) => {
1675
+ return e === "v1" ? r = new ie(new URL("./worker-thread-v1.js", import.meta.url)) : r = new ie(new URL("./worker-thread-v2.js", import.meta.url)), new Promise((o, s) => {
1687
1676
  const i = V.claim();
1688
1677
  r.once("message", function(l) {
1689
1678
  l.command === "worker-script-initialized" && o({
@@ -1698,19 +1687,19 @@ function _t(e, { onExit: t } = {}) {
1698
1687
  );
1699
1688
  s(u);
1700
1689
  });
1701
- let n = !1;
1690
+ let a = !1;
1702
1691
  r.once("spawn", () => {
1703
- n = !0;
1692
+ a = !0;
1704
1693
  }), r.once("exit", (l) => {
1705
- V.release(i), n || s(new Error(`Worker exited before spawning: ${l}`)), t?.(l);
1694
+ V.release(i), a || s(new Error(`Worker exited before spawning: ${l}`)), t?.(l);
1706
1695
  });
1707
1696
  });
1708
1697
  }
1709
- async function Ft(e) {
1710
- const { port1: t, port2: r } = new ce();
1711
- return await Ae(e, t), r;
1698
+ async function Nt(e) {
1699
+ const { port1: t, port2: r } = new he();
1700
+ return await Re(e, t), r;
1712
1701
  }
1713
- function Nt(e) {
1702
+ function Ot(e) {
1714
1703
  const t = G.platform();
1715
1704
  let r;
1716
1705
  switch (t) {
@@ -1724,11 +1713,11 @@ function Nt(e) {
1724
1713
  r = `xdg-open "${e}"`;
1725
1714
  break;
1726
1715
  }
1727
- he(r, (o) => {
1728
- o && P.debug(`Could not open browser: ${o.message}`);
1716
+ ye(r, (o) => {
1717
+ o && w.debug(`Could not open browser: ${o.message}`);
1729
1718
  });
1730
1719
  }
1731
- async function Ot(e, t) {
1720
+ async function Ft(e, t) {
1732
1721
  await e.run({
1733
1722
  code: `<?php
1734
1723
  $zip = new ZipArchive();
@@ -1750,16 +1739,26 @@ async function Ot(e, t) {
1750
1739
  `
1751
1740
  });
1752
1741
  const r = await e.readFileAsBuffer("/tmp/build.zip");
1753
- c.writeFileSync(t, r);
1742
+ p.writeFileSync(t, r);
1754
1743
  }
1744
+ const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1745
+ __proto__: null,
1746
+ LogVerbosity: X,
1747
+ internalsKeyForTesting: Z,
1748
+ mergeDefinedConstants: Q,
1749
+ parseOptionsAndRunCLI: _t,
1750
+ runCLI: ve,
1751
+ spawnWorkerThread: Se
1752
+ }, Symbol.toStringTag, { value: "Module" }));
1755
1753
  export {
1756
- ge as L,
1757
- yr as a,
1758
- Rt as b,
1759
- Pe as i,
1760
- ye as m,
1761
- br as p,
1762
- Ut as r,
1763
- _t as s
1754
+ X as L,
1755
+ wr as a,
1756
+ Wt as b,
1757
+ yr as c,
1758
+ Z as i,
1759
+ Q as m,
1760
+ _t as p,
1761
+ ve as r,
1762
+ Se as s
1764
1763
  };
1765
- //# sourceMappingURL=run-cli-D-hJyCz2.js.map
1764
+ //# sourceMappingURL=run-cli-Dka9y1Ev.js.map