@supraio/client-daemon-js 1.0.0-mzscreengeometry.464 → 1.0.0-mzscreengeometry.466

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/daemon.html CHANGED
@@ -4,6 +4,6 @@
4
4
  <title>Supra daemon</title>
5
5
  </head>
6
6
  <body>
7
- <script type="text/javascript" src="daemon.js?v=1.0.0-mzscreengeometry.464"></script>
7
+ <script type="text/javascript" src="daemon.js?v=1.0.0-mzscreengeometry.466"></script>
8
8
  </body>
9
9
  </html>
package/daemon.js CHANGED
@@ -10290,12 +10290,12 @@
10290
10290
  if (process2["initializeTTYs"]) {
10291
10291
  process2["initializeTTYs"]();
10292
10292
  }
10293
- function install2(obj) {
10293
+ function install(obj) {
10294
10294
  obj.Buffer = Buffer2;
10295
10295
  obj.process = process2;
10296
10296
  var oldRequire = obj.require ? obj.require : null;
10297
10297
  obj.require = function(arg) {
10298
- var rv = BFSRequire(arg);
10298
+ var rv = BFSRequire2(arg);
10299
10299
  if (!rv) {
10300
10300
  return oldRequire.apply(null, Array.prototype.slice.call(arguments, 0));
10301
10301
  } else {
@@ -10306,7 +10306,7 @@
10306
10306
  function registerFileSystem(name, fs2) {
10307
10307
  Backends[name] = fs2;
10308
10308
  }
10309
- function BFSRequire(module4) {
10309
+ function BFSRequire2(module4) {
10310
10310
  switch (module4) {
10311
10311
  case "fs":
10312
10312
  return _fsMock;
@@ -10421,9 +10421,9 @@
10421
10421
  };
10422
10422
  }
10423
10423
  }
10424
- exports2.install = install2;
10424
+ exports2.install = install;
10425
10425
  exports2.registerFileSystem = registerFileSystem;
10426
- exports2.BFSRequire = BFSRequire;
10426
+ exports2.BFSRequire = BFSRequire2;
10427
10427
  exports2.initialize = initialize;
10428
10428
  exports2.configure = configure2;
10429
10429
  exports2.getFileSystem = getFileSystem;
@@ -20486,7 +20486,7 @@
20486
20486
  options: {}
20487
20487
  };
20488
20488
  async function initBrowserFS() {
20489
- BrowserFS.install(window);
20489
+ installBrowserFSGlobals();
20490
20490
  await new Promise((resolve, reject) => {
20491
20491
  BrowserFS.configure(config, (error) => {
20492
20492
  if (error) {
@@ -20500,6 +20500,73 @@
20500
20500
  shim(fs);
20501
20501
  return fs;
20502
20502
  }
20503
+ var installedBrowserFSRequire;
20504
+ function installBrowserFSGlobals() {
20505
+ const browserFSProcess = BrowserFS.BFSRequire("process");
20506
+ if (!window.process) {
20507
+ Object.defineProperty(window, "process", {
20508
+ configurable: true,
20509
+ enumerable: true,
20510
+ value: {},
20511
+ writable: true
20512
+ });
20513
+ }
20514
+ const processPolyfills = /* @__PURE__ */ new Map([
20515
+ ["browser", true],
20516
+ ["env", {}],
20517
+ ["getuid", browserFSProcess.getuid.bind(browserFSProcess)],
20518
+ ["getgid", browserFSProcess.getgid.bind(browserFSProcess)],
20519
+ ["geteuid", browserFSProcess.getuid.bind(browserFSProcess)],
20520
+ ["getegid", browserFSProcess.getgid.bind(browserFSProcess)],
20521
+ ["getgroups", () => {
20522
+ throw createNotImplementedError();
20523
+ }],
20524
+ ["pid", browserFSProcess.pid],
20525
+ ["ppid", -1],
20526
+ ["umask", browserFSProcess.umask.bind(browserFSProcess)],
20527
+ ["cwd", browserFSProcess.cwd.bind(browserFSProcess)],
20528
+ ["chdir", browserFSProcess.chdir.bind(browserFSProcess)]
20529
+ ]);
20530
+ for (const [property, value] of processPolyfills) {
20531
+ if (Reflect.get(window.process, property) === void 0) {
20532
+ Object.defineProperty(window.process, property, {
20533
+ configurable: true,
20534
+ value,
20535
+ writable: true
20536
+ });
20537
+ }
20538
+ }
20539
+ if (!installedBrowserFSRequire) {
20540
+ const previousRequire = window.require;
20541
+ installedBrowserFSRequire = (moduleName) => {
20542
+ const browserFSModule = BrowserFS.BFSRequire(moduleName);
20543
+ if (browserFSModule) {
20544
+ return browserFSModule;
20545
+ }
20546
+ if (previousRequire) {
20547
+ return previousRequire(moduleName);
20548
+ }
20549
+ throw new Error(`Cannot find module '${moduleName}'`);
20550
+ };
20551
+ }
20552
+ Object.defineProperty(window, "Buffer", {
20553
+ configurable: true,
20554
+ enumerable: true,
20555
+ value: BrowserFS.BFSRequire("buffer").Buffer,
20556
+ writable: true
20557
+ });
20558
+ Object.defineProperty(window, "require", {
20559
+ configurable: true,
20560
+ enumerable: true,
20561
+ value: installedBrowserFSRequire,
20562
+ writable: true
20563
+ });
20564
+ }
20565
+ function createNotImplementedError() {
20566
+ const error = new Error("not implemented");
20567
+ Object.defineProperty(error, "code", { value: "ENOSYS" });
20568
+ return error;
20569
+ }
20503
20570
  function getStringFlagsByNumber(fs, origFlags) {
20504
20571
  if ((origFlags & (fs.constants.O_APPEND | fs.constants.O_CREAT)) !== 0) {
20505
20572
  return "a";
@@ -20720,7 +20787,7 @@
20720
20787
  }
20721
20788
 
20722
20789
  // daemon/plain.ts
20723
- var DAEMON_JS_URL = "supra-client-daemon.js?v=1.0.0-mzscreengeometry.464";
20790
+ var DAEMON_JS_URL = "supra-client-daemon.js?v=1.0.0-mzscreengeometry.466";
20724
20791
  async function startPlainDaemon() {
20725
20792
  await initNaClTCP();
20726
20793
  await initSamsungWasmTCP();
@@ -20733,7 +20800,7 @@
20733
20800
  }
20734
20801
 
20735
20802
  // daemon/wasm.ts
20736
- var DAEMON_WASM_URL = "supra-client-daemon.wasm?v=1.0.0-mzscreengeometry.464";
20803
+ var DAEMON_WASM_URL = "supra-client-daemon.wasm?v=1.0.0-mzscreengeometry.466";
20737
20804
  async function startWasmDaemon() {
20738
20805
  await initNaClTCP();
20739
20806
  await initSamsungWasmTCP();