@xarc/app-dev 10.0.8 → 10.0.12

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.
Files changed (119) hide show
  1. package/config/archetype.js +5 -5
  2. package/config/archetype.js.map +1 -1
  3. package/config/babel/babelrc-client.js +28 -28
  4. package/config/babel/babelrc-client.js.map +1 -1
  5. package/config/babel/babelrc-server.js +1 -1
  6. package/config/babel/babelrc-server.js.map +1 -1
  7. package/config/babel/babelrc.js +32 -32
  8. package/config/babel/babelrc.js.map +1 -1
  9. package/config/babel/common.js +2 -2
  10. package/config/babel/common.js.map +1 -1
  11. package/config/constants.js +1 -1
  12. package/config/constants.js.map +1 -1
  13. package/config/dev-proxy.js +8 -8
  14. package/config/dev-proxy.js.map +1 -1
  15. package/config/env-app.js +2 -2
  16. package/config/env-app.js.map +1 -1
  17. package/config/env-babel.js +3 -3
  18. package/config/env-babel.js.map +1 -1
  19. package/config/env-karma.js +2 -2
  20. package/config/env-karma.js.map +1 -1
  21. package/config/env-proxy.js +3 -3
  22. package/config/env-proxy.js.map +1 -1
  23. package/config/env-webpack.js +3 -3
  24. package/config/env-webpack.js.map +1 -1
  25. package/config/jest/__mocks__/framework-mock.js +2 -3
  26. package/config/jest/__mocks__/framework-mock.js.map +1 -1
  27. package/config/jest/jest.config.js +1 -1
  28. package/config/jest/jest.config.js.map +1 -1
  29. package/config/karma/browser-settings.js +1 -1
  30. package/config/karma/browser-settings.js.map +1 -1
  31. package/config/karma/entry-xarc.js +1 -1
  32. package/config/karma/entry.js +1 -1
  33. package/config/karma/karma.conf.coverage.js +5 -5
  34. package/config/karma/karma.conf.coverage.js.map +1 -1
  35. package/config/karma/karma.conf.dev.js +2 -2
  36. package/config/karma/karma.conf.dev.js.map +1 -1
  37. package/config/karma/karma.conf.js +2 -2
  38. package/config/karma/karma.conf.js.map +1 -1
  39. package/config/karma/karma.conf.watch.js +4 -4
  40. package/config/karma/karma.conf.watch.js.map +1 -1
  41. package/config/karma/util/load-user-config.js +6 -6
  42. package/config/karma/util/load-user-config.js.map +1 -1
  43. package/config/mocha/setup.js +3 -4
  44. package/config/mocha/setup.js.map +1 -1
  45. package/config/options.js +23 -25
  46. package/config/options.js.map +1 -1
  47. package/config/user-config.js +4 -4
  48. package/config/user-config.js.map +1 -1
  49. package/lib/app-dev-middleware.js +2 -2
  50. package/lib/app-dev-middleware.js.map +1 -1
  51. package/lib/babel-run.js +8 -5
  52. package/lib/babel-run.js.map +1 -1
  53. package/lib/dev-admin/admin-http.js +9 -9
  54. package/lib/dev-admin/admin-http.js.map +1 -1
  55. package/lib/dev-admin/admin-server.js +65 -65
  56. package/lib/dev-admin/admin-server.js.map +1 -1
  57. package/lib/dev-admin/cdn-mock.js +7 -7
  58. package/lib/dev-admin/cdn-mock.js.map +1 -1
  59. package/lib/dev-admin/cleanup.js +3 -3
  60. package/lib/dev-admin/cleanup.js.map +1 -1
  61. package/lib/dev-admin/console-io.js +2 -2
  62. package/lib/dev-admin/console-io.js.map +1 -1
  63. package/lib/dev-admin/dev-http.js +6 -6
  64. package/lib/dev-admin/dev-http.js.map +1 -1
  65. package/lib/dev-admin/dev-server-start.js +5 -5
  66. package/lib/dev-admin/dev-server-start.js.map +1 -1
  67. package/lib/dev-admin/dev-server.js +1 -1
  68. package/lib/dev-admin/dev-server.js.map +1 -1
  69. package/lib/dev-admin/index.js +2 -2
  70. package/lib/dev-admin/index.js.map +1 -1
  71. package/lib/dev-admin/json-formatter-js.js +38 -38
  72. package/lib/dev-admin/log-view.js +19 -19
  73. package/lib/dev-admin/middleware.js +24 -24
  74. package/lib/dev-admin/middleware.js.map +1 -1
  75. package/lib/dev-admin/redbird-proxy.js +50 -50
  76. package/lib/dev-admin/redbird-proxy.js.map +1 -1
  77. package/lib/dev-admin/redbird-spawn.js +10 -10
  78. package/lib/dev-admin/redbird-spawn.js.map +1 -1
  79. package/lib/dev-tasks.d.ts +1 -1
  80. package/lib/dev-tasks.js +134 -133
  81. package/lib/dev-tasks.js.map +1 -1
  82. package/lib/fake-res.js +4 -4
  83. package/lib/fake-res.js.map +1 -1
  84. package/lib/index.js +2 -2
  85. package/lib/index.js.map +1 -1
  86. package/lib/module-processor.js +2 -2
  87. package/lib/module-processor.js.map +1 -1
  88. package/lib/stats-mapper.js +2 -2
  89. package/lib/stats-mapper.js.map +1 -1
  90. package/lib/stats-utils.js +2 -2
  91. package/lib/stats-utils.js.map +1 -1
  92. package/lib/tasks/eslint.js +29 -29
  93. package/lib/tasks/eslint.js.map +1 -1
  94. package/lib/tasks/package-json.js +6 -6
  95. package/lib/tasks/package-json.js.map +1 -1
  96. package/lib/utils.d.ts +1 -1
  97. package/lib/utils.js +20 -19
  98. package/lib/utils.js.map +1 -1
  99. package/package.json +7 -7
  100. package/scripts/l10n/flatten-messages.js +2 -2
  101. package/scripts/map-isomorphic-cdn.js +1 -1
  102. package/scripts/merge-isomorphic-assets.js +2 -2
  103. package/src/config/babel/babelrc-client.ts +25 -25
  104. package/src/config/babel/babelrc.ts +26 -26
  105. package/src/config/jest/__mocks__/framework-mock.ts +3 -3
  106. package/src/config/karma/entry-xarc.js +1 -1
  107. package/src/config/karma/entry.js +1 -1
  108. package/src/config/karma/util/load-user-config.ts +2 -2
  109. package/src/config/mocha/setup.ts +2 -2
  110. package/src/config/options.ts +12 -14
  111. package/src/config/user-config.ts +1 -1
  112. package/src/lib/babel-run.ts +7 -3
  113. package/src/lib/dev-admin/admin-server.ts +32 -32
  114. package/src/lib/dev-admin/json-formatter-js.js +38 -38
  115. package/src/lib/dev-admin/log-view.js +19 -19
  116. package/src/lib/dev-admin/redbird-proxy.ts +25 -23
  117. package/src/lib/dev-tasks.ts +110 -105
  118. package/src/lib/tasks/eslint.ts +26 -26
  119. package/src/lib/utils.ts +11 -10
@@ -14,7 +14,7 @@ import isCI from "is-ci";
14
14
  import { doCleanup } from "./cleanup";
15
15
  import * as xaa from "xaa";
16
16
  import { formUrl } from "../utils";
17
- import makeOptionalRequire from "optional-require";
17
+ import { makeOptionalRequire } from "optional-require";
18
18
  const optionalRequire = makeOptionalRequire(require);
19
19
 
20
20
  const WT = optionalRequire("worker_threads");
@@ -28,7 +28,7 @@ import { devProxy } from "../../config/dev-proxy";
28
28
  const {
29
29
  settings: { useDevProxy: DEV_PROXY_ENABLED, adminLogLevel },
30
30
  fullDevServer,
31
- controlPaths
31
+ controlPaths,
32
32
  } = devProxy;
33
33
 
34
34
  const ADMIN_LOG_LEVEL = parseInt(adminLogLevel) || 0;
@@ -47,10 +47,10 @@ const PROMPT_SPIN_INTERVAL = 3500;
47
47
 
48
48
  const SERVER_ENVS = {
49
49
  [APP_SERVER_NAME]: {
50
- XARC_BABEL_TARGET: "node"
50
+ XARC_BABEL_TARGET: "node",
51
51
  },
52
52
  [DEV_SERVER_NAME]: {} as any,
53
- [PROXY_SERVER_NAME]: {} as any
53
+ [PROXY_SERVER_NAME]: {} as any,
54
54
  };
55
55
 
56
56
  const getTerminalColumns = () => {
@@ -116,7 +116,7 @@ export class AdminServer {
116
116
  this._fullAppLogUrl = formUrl({ ...fullDevServer, path: controlPaths.appLog });
117
117
  this._adminHttp = new AdminHttp({
118
118
  getLogs: (app: string) => this.getLogs(app),
119
- port: this._opts.port
119
+ port: this._opts.port,
120
120
  });
121
121
  }
122
122
 
@@ -132,7 +132,7 @@ export class AdminServer {
132
132
  name: DEV_ADMIN_STATUS,
133
133
  display: ck`[<green.inverse>DEV ADMIN</>]`,
134
134
  spinner: PROMPT_SPINNER,
135
- spinInterval: PROMPT_SPIN_INTERVAL
135
+ spinInterval: PROMPT_SPIN_INTERVAL,
136
136
  });
137
137
  this.updateStatus("webpack is PENDING");
138
138
  this.handleUserInput();
@@ -255,7 +255,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
255
255
  } else if (child.terminate) {
256
256
  child.postMessage("kill");
257
257
  const defer1 = xaa.defer();
258
- child.once("message", msg => defer1.resolve(msg));
258
+ child.once("message", (msg) => defer1.resolve(msg));
259
259
  await xaa.try(() => xaa.runTimeout(defer1.promise, 1000));
260
260
  child.terminate();
261
261
  const defer2 = xaa.defer();
@@ -278,7 +278,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
278
278
  await Promise.all([
279
279
  this.kill(DEV_SERVER_NAME, "SIGINT"),
280
280
  this.kill(APP_SERVER_NAME, "SIGINT"),
281
- this.kill(PROXY_SERVER_NAME, "SIGINT")
281
+ this.kill(PROXY_SERVER_NAME, "SIGINT"),
282
282
  ]);
283
283
 
284
284
  this._io.shutdown();
@@ -322,7 +322,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
322
322
  x: () => this.kill(DEV_SERVER_NAME, "SIGINT"),
323
323
  z: () => this.toggleFullLogUrlMessage(APP_SERVER_NAME),
324
324
  // dev proxy server
325
- p: () => DEV_PROXY_ENABLED && this.sendMsg(PROXY_SERVER_NAME, { name: "restart" })
325
+ p: () => DEV_PROXY_ENABLED && this.sendMsg(PROXY_SERVER_NAME, { name: "restart" }),
326
326
  };
327
327
 
328
328
  if (str === "^c") {
@@ -401,7 +401,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
401
401
  XARC_ADMIN_SERVER: true,
402
402
  // pass admin port to child process
403
403
  XARC_ADMIN_PORT: this._adminHttp._port,
404
- ...SERVER_ENVS[name]
404
+ ...SERVER_ENVS[name],
405
405
  });
406
406
 
407
407
  if (Worker) {
@@ -409,7 +409,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
409
409
  } else {
410
410
  const forkOpts: any = {
411
411
  env,
412
- silent: true
412
+ silent: true,
413
413
  };
414
414
 
415
415
  if (options.passThruArgs) {
@@ -446,7 +446,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
446
446
  //
447
447
  async startWebpackDevServer(debug = undefined) {
448
448
  const progSig = `<s> [webpack.Progress] `;
449
- const waitStart = async info => {
449
+ const waitStart = async (info) => {
450
450
  const cwdRegex = new RegExp(process.env.XARC_CWD || process.cwd(), "g");
451
451
  let removeTimer;
452
452
  let progLine = "";
@@ -463,8 +463,8 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
463
463
  }, 2000).unref();
464
464
  };
465
465
 
466
- const watchWdsLog = input => {
467
- const processLine = data => {
466
+ const watchWdsLog = (input) => {
467
+ const processLine = (data) => {
468
468
  const line = data.toString();
469
469
  if (line.trim().length < 1) {
470
470
  return;
@@ -474,7 +474,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
474
474
  this._io.addItem({
475
475
  name: WDS_PROGRESS,
476
476
  spinner: true,
477
- display: `Webpack Progress`
477
+ display: `Webpack Progress`,
478
478
  });
479
479
  this._io.updateItem(WDS_PROGRESS, progLine);
480
480
  const match = progLine.match(/\d{1,3}%/);
@@ -508,9 +508,9 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
508
508
 
509
509
  this._webpackDevRelay.setWebpackServer(info._child);
510
510
 
511
- return new Promise(resolve => {
511
+ return new Promise((resolve) => {
512
512
  const listenForReport = () =>
513
- info._child.once("message", data => {
513
+ info._child.once("message", (data) => {
514
514
  if (data.name === "webpack-report") {
515
515
  if (data.port) {
516
516
  SERVER_ENVS[PROXY_SERVER_NAME].WEBPACK_DEV_PORT = data.port;
@@ -537,7 +537,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
537
537
  exec: Path.join(__dirname, "dev-server.js"),
538
538
  debug: debug || false,
539
539
  skipWatch: debug === "--inspect-brk",
540
- waitStart
540
+ waitStart,
541
541
  });
542
542
  }
543
543
 
@@ -559,7 +559,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
559
559
  name: LOG_ALERT,
560
560
  display: ck`[<orange.inverse>ALERT</>]`,
561
561
  spinner: PROMPT_SPINNER,
562
- spinInterval: PROMPT_SPIN_INTERVAL
562
+ spinInterval: PROMPT_SPIN_INTERVAL,
563
563
  });
564
564
  const instruction = `<orange>View full logs at: <cyan.underline>${url}</></> - \
565
565
  <green>Press Z to hide or show this message</>`;
@@ -639,7 +639,7 @@ ${instruction}`
639
639
  }
640
640
  context._showFullLink = undefined;
641
641
  if (store.length > 25000) {
642
- const cleanup = store.filter(x => x !== false);
642
+ const cleanup = store.filter((x) => x !== false);
643
643
  context.store = cleanup.slice(cleanup.length - 9999);
644
644
  }
645
645
  }, delay);
@@ -648,7 +648,7 @@ ${instruction}`
648
648
  saveLineOutput(context) {
649
649
  const { inputs, store } = context;
650
650
 
651
- const handler = data => {
651
+ const handler = (data) => {
652
652
  const timeDiff = Date.now() - context._deferTimestamp;
653
653
  // if an error line has been detected, then only consider other lines following it
654
654
  // within 30 milliseconds as part of it.
@@ -680,7 +680,7 @@ ${instruction}`
680
680
  this._adminHttp.sendLogsToStreamClients();
681
681
  };
682
682
 
683
- inputs.forEach(input => {
683
+ inputs.forEach((input) => {
684
684
  const reader = readline.createInterface({ input });
685
685
  reader.on("line", handler);
686
686
  return reader;
@@ -693,7 +693,7 @@ ${instruction}`
693
693
  tag: this._app,
694
694
  store: [],
695
695
  fullLogUrl: this._fullAppLogUrl,
696
- checkLine: str => {
696
+ checkLine: (str) => {
697
697
  if (
698
698
  !this._fullyStarted &&
699
699
  (str.includes("server running") || str.includes("Server listening"))
@@ -707,7 +707,7 @@ ${instruction}`
707
707
  this.logTime(`App is ready in dev mode, total time took`);
708
708
  }
709
709
  return str;
710
- }
710
+ },
711
711
  };
712
712
 
713
713
  await this.startServer({
@@ -721,12 +721,12 @@ ${instruction}`
721
721
  noTimeoutCheck: skipWatch,
722
722
  passThruArgs: this._passThru,
723
723
  logSaver,
724
- waitStart: async info => {
724
+ waitStart: async (info) => {
725
725
  logSaver.inputs = [info._child.stdout, info._child.stderr];
726
726
  this.saveLineOutput(logSaver);
727
727
  await this.waitForAppServerStart(info);
728
728
  this._webpackDevRelay.setAppServer(info._child);
729
- }
729
+ },
730
730
  });
731
731
  }
732
732
 
@@ -755,7 +755,7 @@ ${instruction}`
755
755
  let lineBuffers = [];
756
756
  let deferWrite;
757
757
 
758
- reader.on("line", data => {
758
+ reader.on("line", (data) => {
759
759
  clearTimeout(deferWrite);
760
760
  deferWrite = setTimeout(() => {
761
761
  output.show(lineBuffers.join("\n"));
@@ -774,7 +774,7 @@ ${instruction}`
774
774
  killKey: "O",
775
775
  debug,
776
776
  exec: Path.join(__dirname, "redbird-spawn"),
777
- waitStart: async info => {
777
+ waitStart: async (info) => {
778
778
  info._child.on("message", (data: any) => {
779
779
  // this._io.show(ck`<orange>proxy message ${JSON.stringify(data)}</>`, this._appPort);
780
780
  if (data.name === "proxy-started") {
@@ -786,7 +786,7 @@ ${instruction}`
786
786
  });
787
787
  this.passThruLineOutput(this._proxy, info._child.stdout, this._io);
788
788
  this.passThruLineOutput(this._proxy, info._child.stderr, this._io);
789
- }
789
+ },
790
790
  });
791
791
  }
792
792
 
@@ -800,7 +800,7 @@ ${instruction}`
800
800
  this.sendMsg(PROXY_SERVER_NAME, {
801
801
  ...update,
802
802
  name: "update-ports",
803
- quiet: true
803
+ quiet: true,
804
804
  });
805
805
  }, 250).unref();
806
806
  }
@@ -822,7 +822,7 @@ ${instruction}`
822
822
  }
823
823
  };
824
824
 
825
- const checkStarted = data => {
825
+ const checkStarted = (data) => {
826
826
  if (started) {
827
827
  return true;
828
828
  }
@@ -912,7 +912,7 @@ ${info.name} - assuming it started.</>`);
912
912
  if (!info._watcher && !info.options.skipWatch && !_.isEmpty(info.options.watch)) {
913
913
  info._watcher = chokidar.watch(info.options.watch, {
914
914
  cwd: process.env.XARC_CWD || process.cwd(),
915
- persistent: true
915
+ persistent: true,
916
916
  });
917
917
  info._watcher.on("change", restart);
918
918
  }
@@ -46,7 +46,7 @@ var a = /(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[0
46
46
  m = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,
47
47
  l =
48
48
  window.requestAnimationFrame ||
49
- function(t) {
49
+ function (t) {
50
50
  return t(), 0;
51
51
  },
52
52
  d = {
@@ -57,9 +57,9 @@ var a = /(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[0
57
57
  animateClose: !0,
58
58
  theme: null,
59
59
  useToJSON: !0,
60
- sortPropertiesBy: null
60
+ sortPropertiesBy: null,
61
61
  },
62
- c = (function() {
62
+ c = (function () {
63
63
  function c(t, e, r, n) {
64
64
  void 0 === e && (e = 1),
65
65
  void 0 === r && (r = d),
@@ -79,17 +79,17 @@ var a = /(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[0
79
79
  }
80
80
  return (
81
81
  Object.defineProperty(c.prototype, "isOpen", {
82
- get: function() {
82
+ get: function () {
83
83
  return null !== this._isOpen ? this._isOpen : this.open > 0;
84
84
  },
85
- set: function(t) {
85
+ set: function (t) {
86
86
  this._isOpen = t;
87
87
  },
88
88
  enumerable: !0,
89
- configurable: !0
89
+ configurable: !0,
90
90
  }),
91
91
  Object.defineProperty(c.prototype, "isDate", {
92
- get: function() {
92
+ get: function () {
93
93
  return (
94
94
  this.json instanceof Date ||
95
95
  ("string" === this.type &&
@@ -97,75 +97,75 @@ var a = /(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[0
97
97
  );
98
98
  },
99
99
  enumerable: !0,
100
- configurable: !0
100
+ configurable: !0,
101
101
  }),
102
102
  Object.defineProperty(c.prototype, "isUrl", {
103
- get: function() {
103
+ get: function () {
104
104
  return "string" === this.type && 0 === this.json.indexOf("http");
105
105
  },
106
106
  enumerable: !0,
107
- configurable: !0
107
+ configurable: !0,
108
108
  }),
109
109
  Object.defineProperty(c.prototype, "isArray", {
110
- get: function() {
110
+ get: function () {
111
111
  return Array.isArray(this.json);
112
112
  },
113
113
  enumerable: !0,
114
- configurable: !0
114
+ configurable: !0,
115
115
  }),
116
116
  Object.defineProperty(c.prototype, "isObject", {
117
- get: function() {
117
+ get: function () {
118
118
  return e(this.json);
119
119
  },
120
120
  enumerable: !0,
121
- configurable: !0
121
+ configurable: !0,
122
122
  }),
123
123
  Object.defineProperty(c.prototype, "isEmptyObject", {
124
- get: function() {
124
+ get: function () {
125
125
  return !this.keys.length && !this.isArray;
126
126
  },
127
127
  enumerable: !0,
128
- configurable: !0
128
+ configurable: !0,
129
129
  }),
130
130
  Object.defineProperty(c.prototype, "isEmpty", {
131
- get: function() {
131
+ get: function () {
132
132
  return this.isEmptyObject || (this.keys && !this.keys.length && this.isArray);
133
133
  },
134
134
  enumerable: !0,
135
- configurable: !0
135
+ configurable: !0,
136
136
  }),
137
137
  Object.defineProperty(c.prototype, "useToJSON", {
138
- get: function() {
138
+ get: function () {
139
139
  return this.config.useToJSON && "stringifiable" === this.type;
140
140
  },
141
141
  enumerable: !0,
142
- configurable: !0
142
+ configurable: !0,
143
143
  }),
144
144
  Object.defineProperty(c.prototype, "hasKey", {
145
- get: function() {
145
+ get: function () {
146
146
  return void 0 !== this.key;
147
147
  },
148
148
  enumerable: !0,
149
- configurable: !0
149
+ configurable: !0,
150
150
  }),
151
151
  Object.defineProperty(c.prototype, "constructorName", {
152
- get: function() {
152
+ get: function () {
153
153
  return r(this.json);
154
154
  },
155
155
  enumerable: !0,
156
- configurable: !0
156
+ configurable: !0,
157
157
  }),
158
158
  Object.defineProperty(c.prototype, "type", {
159
- get: function() {
159
+ get: function () {
160
160
  return this.config.useToJSON && this.json && this.json.toJSON
161
161
  ? "stringifiable"
162
162
  : t(this.json);
163
163
  },
164
164
  enumerable: !0,
165
- configurable: !0
165
+ configurable: !0,
166
166
  }),
167
167
  Object.defineProperty(c.prototype, "keys", {
168
- get: function() {
168
+ get: function () {
169
169
  if (this.isObject) {
170
170
  var t = Object.keys(this.json);
171
171
  return !this.isArray && this.config.sortPropertiesBy
@@ -175,9 +175,9 @@ var a = /(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[0
175
175
  return [];
176
176
  },
177
177
  enumerable: !0,
178
- configurable: !0
178
+ configurable: !0,
179
179
  }),
180
- (c.prototype.toggleOpen = function() {
180
+ (c.prototype.toggleOpen = function () {
181
181
  (this.isOpen = !this.isOpen),
182
182
  this.element &&
183
183
  (this.isOpen
@@ -185,7 +185,7 @@ var a = /(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[0
185
185
  : this.removeChildren(this.config.animateClose),
186
186
  this.element.classList.toggle(i("open")));
187
187
  }),
188
- (c.prototype.openAtDepth = function(t) {
188
+ (c.prototype.openAtDepth = function (t) {
189
189
  void 0 === t && (t = 1),
190
190
  t < 0 ||
191
191
  ((this.open = t),
@@ -197,20 +197,20 @@ var a = /(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[0
197
197
  : (this.appendChildren(this.config.animateOpen),
198
198
  this.element.classList.add(i("open")))));
199
199
  }),
200
- (c.prototype.getInlinepreview = function() {
200
+ (c.prototype.getInlinepreview = function () {
201
201
  var t = this;
202
202
  if (this.isArray)
203
203
  return this.json.length > this.config.hoverPreviewArrayCount
204
204
  ? "Array[" + this.json.length + "]"
205
205
  : "[" + this.json.map(o).join(", ") + "]";
206
206
  var e = this.keys,
207
- r = e.slice(0, this.config.hoverPreviewFieldCount).map(function(e) {
207
+ r = e.slice(0, this.config.hoverPreviewFieldCount).map(function (e) {
208
208
  return e + ":" + o(t.json[e]);
209
209
  }),
210
210
  n = e.length >= this.config.hoverPreviewFieldCount ? "…" : "";
211
211
  return "{" + r.join(", ") + n + "}";
212
212
  }),
213
- (c.prototype.render = function() {
213
+ (c.prototype.render = function () {
214
214
  this.element = s("div", "row");
215
215
  var t = this.isObject ? s("a", "toggler-link") : s("span");
216
216
  if (
@@ -256,31 +256,31 @@ var a = /(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[0
256
256
  this.element
257
257
  );
258
258
  }),
259
- (c.prototype.appendChildren = function(t) {
259
+ (c.prototype.appendChildren = function (t) {
260
260
  var e = this;
261
261
  void 0 === t && (t = !1);
262
262
  var r = this.element.querySelector("div." + i("children"));
263
263
  if (r && !this.isEmpty)
264
264
  if (t) {
265
265
  var n = 0,
266
- o = function() {
266
+ o = function () {
267
267
  var t = e.keys[n],
268
268
  i = new c(e.json[t], e.open - 1, e.config, t);
269
269
  r.appendChild(i.render()), (n += 1) < e.keys.length && (n > 10 ? o() : l(o));
270
270
  };
271
271
  l(o);
272
272
  } else
273
- this.keys.forEach(function(t) {
273
+ this.keys.forEach(function (t) {
274
274
  var n = new c(e.json[t], e.open - 1, e.config, t);
275
275
  r.appendChild(n.render());
276
276
  });
277
277
  }),
278
- (c.prototype.removeChildren = function(t) {
278
+ (c.prototype.removeChildren = function (t) {
279
279
  void 0 === t && (t = !1);
280
280
  var e = this.element.querySelector("div." + i("children"));
281
281
  if (t) {
282
282
  var r = 0,
283
- n = function() {
283
+ n = function () {
284
284
  e && e.children.length && (e.removeChild(e.children[0]), (r += 1) > 10 ? n() : l(n));
285
285
  };
286
286
  l(n);
@@ -17,38 +17,38 @@ const Levels = {
17
17
  error: {
18
18
  color: "red",
19
19
  index: 0,
20
- name: "error"
20
+ name: "error",
21
21
  },
22
22
  warn: {
23
23
  color: "yellow",
24
24
  index: 1,
25
- name: "warn"
25
+ name: "warn",
26
26
  },
27
27
  info: {
28
28
  color: "green",
29
29
  index: 2,
30
- name: "info"
30
+ name: "info",
31
31
  },
32
32
  http: {
33
33
  color: "green",
34
34
  index: 3,
35
- name: "http"
35
+ name: "http",
36
36
  },
37
37
  verbose: {
38
38
  color: "blue",
39
39
  index: 4,
40
- name: "verbose"
40
+ name: "verbose",
41
41
  },
42
42
  debug: {
43
43
  color: "orange",
44
44
  index: 5,
45
- name: "debug"
45
+ name: "debug",
46
46
  },
47
47
  silly: {
48
48
  color: "purple",
49
49
  index: 6,
50
- name: "silly"
51
- }
50
+ name: "silly",
51
+ },
52
52
  };
53
53
 
54
54
  const themeArr = ["", "adventure", "acai", "monikai"];
@@ -71,14 +71,14 @@ function startLogStream() {
71
71
  logStreamReconnectTimer = null;
72
72
 
73
73
  logStream = new EventSource("/__electrode_dev/stream-logs");
74
- logStream.addEventListener("log-stream", e => {
74
+ logStream.addEventListener("log-stream", (e) => {
75
75
  if (debugStreamEvents) {
76
76
  console.log("stream event", e);
77
77
  }
78
78
  const data = JSON.parse(e.data);
79
79
  updateLogs(data);
80
80
  });
81
- logStream.addEventListener("open", _e => {
81
+ logStream.addEventListener("open", (_e) => {
82
82
  console.log("log stream opened");
83
83
  logStreamReconnectDelay = 5000;
84
84
  });
@@ -132,7 +132,7 @@ const defaultLevelSelections = {
132
132
  http: true,
133
133
  verbose: true,
134
134
  debug: true,
135
- silly: true
135
+ silly: true,
136
136
  };
137
137
 
138
138
  class HashValues {
@@ -161,7 +161,7 @@ class HashValues {
161
161
  toUrl() {
162
162
  const str = Object.keys(this._hash)
163
163
  .sort()
164
- .map(k => `${k}=${this._hash[k]}`)
164
+ .map((k) => `${k}=${this._hash[k]}`)
165
165
  .join("&");
166
166
 
167
167
  return str ? "#" + str : "";
@@ -178,7 +178,7 @@ class HashValues {
178
178
  }
179
179
 
180
180
  remove(values) {
181
- [].concat(values).forEach(k => delete this._hash[k]);
181
+ [].concat(values).forEach((k) => delete this._hash[k]);
182
182
  this.update();
183
183
  }
184
184
 
@@ -377,7 +377,7 @@ function prettyJSON(jsonObj) {
377
377
  theme: themeArr[curThemeIdx++],
378
378
  animateOpen: true,
379
379
  animateClose: true,
380
- useToJSON: true
380
+ useToJSON: true,
381
381
  });
382
382
 
383
383
  // alternatively display different theme
@@ -447,7 +447,7 @@ async function updateLogs(data, levelSelections, scrollToEnd = true) {
447
447
  } else {
448
448
  // filter received logs by timestamp, only the ones after current timestamp are kept
449
449
 
450
- newLogs = data.logs.filter(l => {
450
+ newLogs = data.logs.filter((l) => {
451
451
  return compareEntryId(l, lastEntryId) > 0;
452
452
  });
453
453
  }
@@ -458,7 +458,7 @@ async function updateLogs(data, levelSelections, scrollToEnd = true) {
458
458
  bounding.bottom - (window.innerHeight || document.documentElement.clientHeight) < -25;
459
459
 
460
460
  if (newLogs.length > 0) {
461
- newLogs.forEach(event => {
461
+ newLogs.forEach((event) => {
462
462
  const newLine = document.createElement("div");
463
463
  newLine.setAttribute("lvl", event.level);
464
464
  newLine.setAttribute("entryId", stringifyEntryId(event));
@@ -519,7 +519,7 @@ async function displayLogs(levelSelections, scrollToEnd = true) {
519
519
  *
520
520
  */
521
521
  function updateLevelCheckboxes() {
522
- Object.keys(defaultLevelSelections).forEach(k => {
522
+ Object.keys(defaultLevelSelections).forEach((k) => {
523
523
  const elem = document.getElementById(`level.${k}`);
524
524
  if (elem) {
525
525
  elem.checked = hashVal.get(k) !== "false";
@@ -535,7 +535,7 @@ function parseEntryId(str) {
535
535
  const parts = str.split(",");
536
536
  return {
537
537
  ts: parseInt(parts[0]),
538
- tx: parseInt(parts[1])
538
+ tx: parseInt(parts[1]),
539
539
  };
540
540
  }
541
541
 
@@ -563,7 +563,7 @@ window.addEventListener(
563
563
  false
564
564
  );
565
565
 
566
- window.addEventListener("keypress", event => {
566
+ window.addEventListener("keypress", (event) => {
567
567
  if (event.ctrlKey && event.code === "KeyK") {
568
568
  wipeLogs();
569
569
  }