@php-wasm/web 0.9.44 → 0.9.46

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/index.js CHANGED
@@ -1,47 +1,47 @@
1
- import { PHPResponse as C, LatestSupportedPHPVersion as R, loadPHPRuntime as L, FSHelpers as w, __private__dont__use as g } from "@php-wasm/universal";
2
- import * as d from "comlink";
3
- import { PhpWasmError as h, Semaphore as O, joinPaths as T } from "@php-wasm/util";
4
- import { responseTo as S } from "@php-wasm/web-service-worker";
5
- import { logger as m } from "@php-wasm/logger";
6
- import { journalFSEvents as z } from "@php-wasm/fs-journal";
7
- function N(r, t = void 0) {
8
- W();
9
- const e = r instanceof Worker ? r : d.windowEndpoint(r, t), a = d.wrap(e), n = y(a);
10
- return new Proxy(n, {
1
+ import { PHPResponse as D, LatestSupportedPHPVersion as R, loadPHPRuntime as L, FSHelpers as p, __private__dont__use as P } from "@php-wasm/universal";
2
+ import * as f from "comlink";
3
+ import { PhpWasmError as y, Semaphore as z, joinPaths as T } from "@php-wasm/util";
4
+ import { responseTo as M } from "@php-wasm/web-service-worker";
5
+ import { logger as h } from "@php-wasm/logger";
6
+ import { journalFSEvents as O } from "@php-wasm/fs-journal";
7
+ function Q(r, t = void 0) {
8
+ v();
9
+ const e = r instanceof Worker ? r : f.windowEndpoint(r, t), n = f.wrap(e), a = g(n);
10
+ return new Proxy(a, {
11
11
  get: (i, s) => s === "isConnected" ? async () => {
12
12
  for (; ; )
13
13
  try {
14
- await D(a.isConnected(), 200);
14
+ await A(n.isConnected(), 200);
15
15
  break;
16
16
  } catch {
17
17
  }
18
- } : a[s]
18
+ } : n[s]
19
19
  });
20
20
  }
21
- async function D(r, t) {
22
- return new Promise((e, a) => {
23
- setTimeout(a, t), r.then(e);
21
+ async function A(r, t) {
22
+ return new Promise((e, n) => {
23
+ setTimeout(n, t), r.then(e);
24
24
  });
25
25
  }
26
- function G(r, t) {
27
- W();
26
+ function X(r, t) {
27
+ v();
28
28
  const e = Promise.resolve();
29
- let a, n;
30
- const i = new Promise((o, u) => {
31
- a = o, n = u;
32
- }), s = y(r), c = new Proxy(s, {
33
- get: (o, u) => u === "isConnected" ? () => e : u === "isReady" ? () => i : u in o ? o[u] : t == null ? void 0 : t[u]
29
+ let n, a;
30
+ const i = new Promise((c, u) => {
31
+ n = c, a = u;
32
+ }), s = g(r), o = new Proxy(s, {
33
+ get: (c, u) => u === "isConnected" ? () => e : u === "isReady" ? () => i : u in c ? c[u] : t == null ? void 0 : t[u]
34
34
  });
35
- return d.expose(
36
- c,
37
- typeof window < "u" ? d.windowEndpoint(self.parent) : void 0
38
- ), [a, n, c];
35
+ return f.expose(
36
+ o,
37
+ typeof window < "u" ? f.windowEndpoint(self.parent) : void 0
38
+ ), [n, a, o];
39
39
  }
40
- let P = !1;
41
- function W() {
42
- if (P)
40
+ let E = !1;
41
+ function v() {
42
+ if (E)
43
43
  return;
44
- P = !0, d.transferHandlers.set("EVENT", {
44
+ E = !0, f.transferHandlers.set("EVENT", {
45
45
  canHandle: (e) => e instanceof CustomEvent,
46
46
  serialize: (e) => [
47
47
  {
@@ -50,49 +50,49 @@ function W() {
50
50
  []
51
51
  ],
52
52
  deserialize: (e) => e
53
- }), d.transferHandlers.set("FUNCTION", {
53
+ }), f.transferHandlers.set("FUNCTION", {
54
54
  canHandle: (e) => typeof e == "function",
55
55
  serialize(e) {
56
- const { port1: a, port2: n } = new MessageChannel();
57
- return d.expose(e, a), [n, [n]];
56
+ const { port1: n, port2: a } = new MessageChannel();
57
+ return f.expose(e, n), [a, [a]];
58
58
  },
59
59
  deserialize(e) {
60
- return e.start(), d.wrap(e);
60
+ return e.start(), f.wrap(e);
61
61
  }
62
- }), d.transferHandlers.set("PHPResponse", {
62
+ }), f.transferHandlers.set("PHPResponse", {
63
63
  canHandle: (e) => typeof e == "object" && e !== null && "headers" in e && "bytes" in e && "errors" in e && "exitCode" in e && "httpStatusCode" in e,
64
64
  serialize(e) {
65
65
  return [e.toRawData(), []];
66
66
  },
67
67
  deserialize(e) {
68
- return C.fromRawData(e);
68
+ return D.fromRawData(e);
69
69
  }
70
70
  });
71
- const r = d.transferHandlers.get("throw"), t = r == null ? void 0 : r.serialize;
71
+ const r = f.transferHandlers.get("throw"), t = r == null ? void 0 : r.serialize;
72
72
  r.serialize = ({ value: e }) => {
73
- const a = t({ value: e });
74
- return e.response && (a[0].value.response = e.response), e.source && (a[0].value.source = e.source), a;
73
+ const n = t({ value: e });
74
+ return e.response && (n[0].value.response = e.response), e.source && (n[0].value.source = e.source), n;
75
75
  };
76
76
  }
77
- function y(r) {
77
+ function g(r) {
78
78
  return new Proxy(r, {
79
79
  get(t, e) {
80
80
  switch (typeof t[e]) {
81
81
  case "function":
82
- return (...a) => t[e](...a);
82
+ return (...n) => t[e](...n);
83
83
  case "object":
84
- return t[e] === null ? t[e] : y(t[e]);
84
+ return t[e] === null ? t[e] : g(t[e]);
85
85
  case "undefined":
86
86
  case "number":
87
87
  case "string":
88
88
  return t[e];
89
89
  default:
90
- return d.proxy(t[e]);
90
+ return f.proxy(t[e]);
91
91
  }
92
92
  }
93
93
  });
94
94
  }
95
- async function M(r = R, t = "light") {
95
+ async function I(r = R, t = "light") {
96
96
  if (t === "kitchen-sink")
97
97
  switch (r) {
98
98
  case "8.3":
@@ -137,7 +137,7 @@ async function M(r = R, t = "light") {
137
137
  }
138
138
  throw new Error(`Unsupported PHP version ${r}`);
139
139
  }
140
- const A = () => ({
140
+ const _ = () => ({
141
141
  websocket: {
142
142
  decorator: (r) => class extends r {
143
143
  constructor() {
@@ -152,168 +152,199 @@ const A = () => ({
152
152
  }
153
153
  }
154
154
  });
155
- async function Q(r, t = {}) {
156
- var n;
157
- const e = t.loadAllExtensions ? "kitchen-sink" : "light", a = await M(r, e);
158
- return (n = t.onPhpLoaderModuleLoaded) == null || n.call(t, a), await L(a, {
155
+ async function Z(r, t = {}) {
156
+ var a;
157
+ const e = t.loadAllExtensions ? "kitchen-sink" : "light", n = await I(r, e);
158
+ return (a = t.onPhpLoaderModuleLoaded) == null || a.call(t, n), await L(n, {
159
159
  ...t.emscriptenOptions || {},
160
- ...A()
160
+ ..._()
161
161
  });
162
162
  }
163
163
  let b;
164
- const I = new Promise((r) => {
164
+ const $ = new Promise((r) => {
165
165
  b = r;
166
166
  });
167
- function X(r) {
167
+ function ee(r) {
168
168
  if (!r)
169
- throw new h("PHP API client must be a valid client object.");
169
+ throw new y("PHP API client must be a valid client object.");
170
170
  b(r);
171
171
  }
172
- async function Y(r, t) {
173
- const e = navigator.serviceWorker;
174
- if (!e)
175
- throw window.isSecureContext ? new h(
172
+ async function te(r) {
173
+ const t = navigator.serviceWorker;
174
+ if (!t)
175
+ throw window.isSecureContext ? new y(
176
176
  "Service workers are not supported in your browser."
177
- ) : new h(
177
+ ) : new y(
178
178
  "WordPress Playground uses service workers and may only work on HTTPS and http://localhost/ sites, but the current site is neither."
179
179
  );
180
- const a = await e.register(t, {
180
+ const e = await t.register(r, {
181
181
  type: "module",
182
182
  // Always bypass HTTP cache when fetching the new Service Worker script:
183
183
  updateViaCache: "none"
184
184
  });
185
185
  try {
186
- await a.update();
186
+ await e.update();
187
187
  } catch (n) {
188
- m.error("Failed to update service worker.", n);
188
+ h.error("Failed to update service worker.", n);
189
189
  }
190
- navigator.serviceWorker.addEventListener(
191
- "message",
192
- async function(i) {
193
- if (r && i.data.scope !== r)
194
- return;
195
- const s = await I, c = i.data.args || [], o = i.data.method, u = await s[o](...c);
196
- i.source.postMessage(S(i.data.requestId, u));
190
+ return {
191
+ /**
192
+ * Establishes the communication bridge between the service worker and the web worker
193
+ * where the current site is running.
194
+ *
195
+ * @param scope The string prefix used in the site URL served by the currently
196
+ * running remote.html. E.g. for a prefix like `/scope:playground/`,
197
+ * the scope would be `playground`. See the `@php-wasm/scopes` package
198
+ * for more details.
199
+ */
200
+ startServiceWorkerCommunicationBridge({ scope: n }) {
201
+ navigator.serviceWorker.addEventListener(
202
+ "message",
203
+ async function(i) {
204
+ if (n && i.data.scope !== n)
205
+ return;
206
+ const s = await $, o = i.data.args || [], c = i.data.method, u = await s[c](...o);
207
+ i.source.postMessage(
208
+ M(i.data.requestId, u)
209
+ );
210
+ }
211
+ ), t.startMessages();
197
212
  }
198
- ), e.startMessages();
213
+ };
199
214
  }
200
- function Z(r, t) {
215
+ function re(r, t) {
201
216
  window.addEventListener("message", (e) => {
202
217
  e.source === r.contentWindow && (t && e.origin !== t || typeof e.data != "object" || e.data.type !== "relay" || window.parent.postMessage(e.data, "*"));
203
218
  }), window.addEventListener("message", (e) => {
204
- var a;
205
- e.source === window.parent && (typeof e.data != "object" || e.data.type !== "relay" || (a = r == null ? void 0 : r.contentWindow) == null || a.postMessage(e.data));
219
+ var n;
220
+ e.source === window.parent && (typeof e.data != "object" || e.data.type !== "relay" || (n = r == null ? void 0 : r.contentWindow) == null || n.postMessage(e.data));
206
221
  });
207
222
  }
208
- async function ee(r) {
223
+ async function ne(r) {
209
224
  const t = new Worker(r, { type: "module" });
210
- return new Promise((e, a) => {
225
+ return new Promise((e, n) => {
211
226
  t.onerror = (i) => {
212
227
  const s = new Error(
213
228
  `WebWorker failed to load at ${r}. ${i.message ? `Original error: ${i.message}` : ""}`
214
229
  );
215
- s.filename = i.filename, a(s);
230
+ s.filename = i.filename, n(s);
216
231
  };
217
- function n(i) {
218
- i.data === "worker-script-started" && (e(t), t.removeEventListener("message", n));
232
+ function a(i) {
233
+ i.data === "worker-script-started" && (e(t), t.removeEventListener("message", a));
219
234
  }
220
- t.addEventListener("message", n);
235
+ t.addEventListener("message", a);
221
236
  });
222
237
  }
223
- function te(r, t = { initialSync: {} }) {
238
+ function ae(r, t = { initialSync: {} }) {
224
239
  return t = {
225
240
  ...t,
226
241
  initialSync: {
227
242
  ...t.initialSync,
228
243
  direction: t.initialSync.direction ?? "opfs-to-memfs"
229
244
  }
230
- }, async function(e, a, n) {
231
- return t.initialSync.direction === "opfs-to-memfs" ? (w.fileExists(a, n) && w.rmdir(a, n), w.mkdir(a, n), await _(a, r, n)) : await v(
232
- a,
233
- r,
245
+ }, async function(e, n, a) {
246
+ return t.initialSync.direction === "opfs-to-memfs" ? (p.fileExists(n, a) && p.rmdir(n, a), p.mkdir(n, a), await q(n, r, a)) : await x(
234
247
  n,
248
+ r,
249
+ a,
235
250
  t.initialSync.onProgress
236
- ), q(e, r, n);
251
+ ), J(e, r, a);
237
252
  };
238
253
  }
239
- async function _(r, t, e) {
240
- w.mkdir(r, e);
241
- const a = new O({
254
+ async function q(r, t, e) {
255
+ p.mkdir(r, e);
256
+ const n = new z({
242
257
  concurrency: 40
243
- }), n = [], i = [
258
+ }), a = [], i = [
244
259
  [t, e]
245
260
  ];
246
261
  for (; i.length > 0; ) {
247
- const [s, c] = i.pop();
248
- for await (const o of s.values()) {
249
- const u = a.run(async () => {
250
- const l = T(
251
- c,
252
- o.name
262
+ const [s, o] = i.pop();
263
+ for await (const c of s.values()) {
264
+ const u = n.run(async () => {
265
+ const w = T(
266
+ o,
267
+ c.name
253
268
  );
254
- if (o.kind === "directory") {
269
+ if (c.kind === "directory") {
255
270
  try {
256
- r.mkdir(l);
257
- } catch (f) {
258
- if ((f == null ? void 0 : f.errno) !== 20)
259
- throw m.error(f), f;
271
+ r.mkdir(w);
272
+ } catch (l) {
273
+ if ((l == null ? void 0 : l.errno) !== 20)
274
+ throw h.error(l), l;
260
275
  }
261
- i.push([o, l]);
262
- } else if (o.kind === "file") {
263
- const f = await o.getFile(), p = new Uint8Array(await f.arrayBuffer());
276
+ i.push([c, w]);
277
+ } else if (c.kind === "file") {
278
+ const l = await c.getFile(), d = new Uint8Array(await l.arrayBuffer());
264
279
  r.createDataFile(
265
- c,
266
- o.name,
267
- p,
280
+ o,
281
+ c.name,
282
+ d,
268
283
  !0,
269
284
  !0,
270
285
  !0
271
286
  );
272
287
  }
273
- n.splice(n.indexOf(u), 1);
288
+ a.splice(a.indexOf(u), 1);
274
289
  });
275
- n.push(u);
290
+ a.push(u);
276
291
  }
277
- for (; i.length === 0 && n.length > 0; )
278
- await Promise.any(n);
292
+ for (; i.length === 0 && a.length > 0; )
293
+ await Promise.any(a);
279
294
  }
280
295
  }
281
- async function v(r, t, e, a) {
296
+ async function x(r, t, e, n) {
282
297
  r.mkdirTree(e);
283
- const n = [];
284
- async function i(o, u) {
298
+ const a = [];
299
+ async function i(w, l) {
285
300
  await Promise.all(
286
- r.readdir(o).filter(
287
- (l) => l !== "." && l !== ".."
288
- ).map(async (l) => {
289
- const f = T(o, l);
290
- if (!$(r, f)) {
291
- n.push([u, f, l]);
301
+ r.readdir(w).filter(
302
+ (d) => d !== "." && d !== ".."
303
+ ).map(async (d) => {
304
+ const m = T(w, d);
305
+ if (!F(r, m)) {
306
+ a.push([l, m, d]);
292
307
  return;
293
308
  }
294
- const p = await u.getDirectoryHandle(l, {
309
+ const S = await l.getDirectoryHandle(d, {
295
310
  create: !0
296
311
  });
297
- return await i(f, p);
312
+ return await i(m, S);
298
313
  })
299
314
  );
300
315
  }
301
316
  await i(e, t);
302
317
  let s = 0;
303
- const c = n.map(
304
- ([o, u, l]) => x(o, l, r, u).then(() => {
305
- a == null || a({ files: ++s, total: n.length });
306
- })
307
- );
308
- await Promise.all(c);
318
+ const o = n && B(n, 100), c = 100, u = /* @__PURE__ */ new Set();
319
+ try {
320
+ for (const [w, l, d] of a) {
321
+ const m = C(
322
+ w,
323
+ d,
324
+ r,
325
+ l
326
+ ).then(() => {
327
+ s++, u.delete(m), o == null || o({
328
+ files: s,
329
+ total: a.length
330
+ });
331
+ });
332
+ u.add(m), u.size >= c && (await Promise.race(u), o == null || o({
333
+ files: s,
334
+ total: a.length
335
+ }));
336
+ }
337
+ } finally {
338
+ await Promise.allSettled(u);
339
+ }
309
340
  }
310
- function $(r, t) {
341
+ function F(r, t) {
311
342
  return r.isDir(r.lookupPath(t, { follow: !0 }).node.mode);
312
343
  }
313
- async function x(r, t, e, a) {
314
- let n;
344
+ async function C(r, t, e, n) {
345
+ let a;
315
346
  try {
316
- n = e.readFile(a, {
347
+ a = e.readFile(n, {
317
348
  encoding: "binary"
318
349
  });
319
350
  } catch {
@@ -327,31 +358,31 @@ async function x(r, t, e, a) {
327
358
  await i.createSyncAccessHandle()
328
359
  );
329
360
  try {
330
- await s.truncate(0), await s.write(n);
361
+ await s.truncate(0), await s.write(a);
331
362
  } finally {
332
363
  await s.close();
333
364
  }
334
365
  }
335
- function q(r, t, e) {
336
- const a = [], n = z(r, e, (c) => {
337
- a.push(c);
338
- }), i = new J(r, t, e);
366
+ function J(r, t, e) {
367
+ const n = [], a = O(r, e, (o) => {
368
+ n.push(o);
369
+ }), i = new j(r, t, e);
339
370
  async function s() {
340
- const c = await r.semaphore.acquire();
371
+ const o = await r.semaphore.acquire();
341
372
  try {
342
- for (; a.length; )
343
- await i.processEntry(a.shift());
373
+ for (; n.length; )
374
+ await i.processEntry(n.shift());
344
375
  } finally {
345
- c();
376
+ o();
346
377
  }
347
378
  }
348
379
  return r.addEventListener("request.end", s), function() {
349
- n(), r.removeEventListener("request.end", s);
380
+ a(), r.removeEventListener("request.end", s);
350
381
  };
351
382
  }
352
- class J {
353
- constructor(t, e, a) {
354
- this.php = t, this.opfs = e, this.memfsRoot = k(a);
383
+ class j {
384
+ constructor(t, e, n) {
385
+ this.php = t, this.opfs = e, this.memfsRoot = k(n);
355
386
  }
356
387
  toOpfsPath(t) {
357
388
  return k(t.substring(this.memfsRoot.length));
@@ -359,82 +390,95 @@ class J {
359
390
  async processEntry(t) {
360
391
  if (!t.path.startsWith(this.memfsRoot) || t.path === this.memfsRoot)
361
392
  return;
362
- const e = this.toOpfsPath(t.path), a = await H(this.opfs, e), n = E(e);
363
- if (n)
393
+ const e = this.toOpfsPath(t.path), n = await W(this.opfs, e), a = H(e);
394
+ if (a)
364
395
  try {
365
396
  if (t.operation === "DELETE")
366
397
  try {
367
- await a.removeEntry(n, {
398
+ await n.removeEntry(a, {
368
399
  recursive: !0
369
400
  });
370
401
  } catch {
371
402
  }
372
403
  else if (t.operation === "CREATE")
373
- t.nodeType === "directory" ? await a.getDirectoryHandle(n, {
404
+ t.nodeType === "directory" ? await n.getDirectoryHandle(a, {
374
405
  create: !0
375
- }) : await a.getFileHandle(n, {
406
+ }) : await n.getFileHandle(a, {
376
407
  create: !0
377
408
  });
378
409
  else if (t.operation === "WRITE")
379
- await x(
380
- a,
410
+ await C(
381
411
  n,
382
- this.php[g].FS,
412
+ a,
413
+ this.php[P].FS,
383
414
  t.path
384
415
  );
385
416
  else if (t.operation === "RENAME" && t.toPath.startsWith(this.memfsRoot)) {
386
- const i = this.toOpfsPath(t.toPath), s = await H(
417
+ const i = this.toOpfsPath(t.toPath), s = await W(
387
418
  this.opfs,
388
419
  i
389
- ), c = E(i);
420
+ ), o = H(i);
390
421
  if (t.nodeType === "directory") {
391
- const o = await s.getDirectoryHandle(
392
- n,
422
+ const c = await s.getDirectoryHandle(
423
+ a,
393
424
  {
394
425
  create: !0
395
426
  }
396
427
  );
397
- await v(
398
- this.php[g].FS,
399
- o,
428
+ await x(
429
+ this.php[P].FS,
430
+ c,
400
431
  t.toPath
401
- ), await a.removeEntry(n, {
432
+ ), await n.removeEntry(a, {
402
433
  recursive: !0
403
434
  });
404
435
  } else
405
- (await a.getFileHandle(n)).move(s, c);
436
+ (await n.getFileHandle(a)).move(s, o);
406
437
  }
407
438
  } catch (i) {
408
- throw m.log({ entry: t, name: n }), m.error(i), i;
439
+ throw h.log({ entry: t, name: a }), h.error(i), i;
409
440
  }
410
441
  }
411
442
  }
412
443
  function k(r) {
413
444
  return r.replace(/\/$/, "").replace(/\/\/+/g, "/");
414
445
  }
415
- function E(r) {
446
+ function H(r) {
416
447
  return r.substring(r.lastIndexOf("/") + 1);
417
448
  }
418
- async function H(r, t) {
449
+ async function W(r, t) {
419
450
  const e = t.replace(/^\/+|\/+$/g, "").replace(/\/+/, "/");
420
451
  if (!e)
421
452
  return r;
422
- const a = e.split("/");
423
- let n = r;
424
- for (let i = 0; i < a.length - 1; i++) {
425
- const s = a[i];
426
- n = await n.getDirectoryHandle(s, { create: !0 });
453
+ const n = e.split("/");
454
+ let a = r;
455
+ for (let i = 0; i < n.length - 1; i++) {
456
+ const s = n[i];
457
+ a = await a.getDirectoryHandle(s, { create: !0 });
427
458
  }
428
- return n;
459
+ return a;
460
+ }
461
+ function B(r, t) {
462
+ let e = 0, n, a;
463
+ return function(...s) {
464
+ a = s;
465
+ const o = Date.now() - e;
466
+ if (n === void 0) {
467
+ const c = Math.max(0, t - o);
468
+ n = setTimeout(() => {
469
+ n = void 0, e = Date.now(), r(...a);
470
+ }, c);
471
+ }
472
+ };
429
473
  }
430
474
  export {
431
- N as consumeAPI,
432
- te as createDirectoryHandleMountHandler,
433
- G as exposeAPI,
434
- M as getPHPLoaderModule,
435
- Q as loadWebRuntime,
436
- Y as registerServiceWorker,
437
- X as setPhpInstanceUsedByServiceWorker,
438
- Z as setupPostMessageRelay,
439
- ee as spawnPHPWorkerThread
475
+ Q as consumeAPI,
476
+ ae as createDirectoryHandleMountHandler,
477
+ X as exposeAPI,
478
+ I as getPHPLoaderModule,
479
+ Z as loadWebRuntime,
480
+ te as registerServiceWorker,
481
+ ee as setPhpInstanceUsedByServiceWorker,
482
+ re as setupPostMessageRelay,
483
+ ne as spawnPHPWorkerThread
440
484
  };
@@ -15,10 +15,19 @@ export declare function setPhpInstanceUsedByServiceWorker(api: Client): void;
15
15
  * reload the registered worker if the app expects a different version
16
16
  * than the currently registered one.
17
17
  *
18
- * @param scope The numeric value used in the path prefix of the site
19
- * this service worker is meant to serve. E.g. for a prefix
20
- * like `/scope:793/`, the scope would be `793`. See the
21
- * `@php-wasm/scopes` package for more details.
22
18
  * @param scriptUrl The URL of the service worker script.
23
19
  */
24
- export declare function registerServiceWorker(scope: string, scriptUrl: string): Promise<void>;
20
+ export declare function registerServiceWorker(scriptUrl: string): Promise<{
21
+ /**
22
+ * Establishes the communication bridge between the service worker and the web worker
23
+ * where the current site is running.
24
+ *
25
+ * @param scope The string prefix used in the site URL served by the currently
26
+ * running remote.html. E.g. for a prefix like `/scope:playground/`,
27
+ * the scope would be `playground`. See the `@php-wasm/scopes` package
28
+ * for more details.
29
+ */
30
+ startServiceWorkerCommunicationBridge({ scope }: {
31
+ scope: string;
32
+ }): void;
33
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/web",
3
- "version": "0.9.44",
3
+ "version": "0.9.46",
4
4
  "description": "PHP.wasm for the web",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,7 +29,7 @@
29
29
  "type": "module",
30
30
  "main": "index.js",
31
31
  "types": "index.d.ts",
32
- "gitHead": "9e9943cca00e850e6ce60f1aac4313831fc4a65c",
32
+ "gitHead": "fa393bcf69536e421246aa8e321e3e9af4b61c7b",
33
33
  "engines": {
34
34
  "node": ">=16.15.1",
35
35
  "npm": ">=8.11.0"
@@ -40,10 +40,10 @@
40
40
  "ini": "4.1.2",
41
41
  "ws": "8.18.0",
42
42
  "yargs": "17.7.2",
43
- "@php-wasm/universal": "0.9.44",
44
- "@php-wasm/util": "0.9.44",
45
- "@php-wasm/logger": "0.9.44",
46
- "@php-wasm/fs-journal": "0.9.44",
47
- "@php-wasm/web-service-worker": "0.9.44"
43
+ "@php-wasm/universal": "0.9.46",
44
+ "@php-wasm/util": "0.9.46",
45
+ "@php-wasm/logger": "0.9.46",
46
+ "@php-wasm/fs-journal": "0.9.46",
47
+ "@php-wasm/web-service-worker": "0.9.46"
48
48
  }
49
49
  }