@jsenv/plugin-supervisor 1.4.3 → 1.4.4

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.
@@ -642,7 +642,7 @@ window.__supervisor__ = (() => {
642
642
  exception.code = DYNAMIC_IMPORT_EXPORT_MISSING;
643
643
  }
644
644
  // firefox
645
- if (exception.message.startsWith("import not found:") || exception.message.startsWith("ambiguous indirect export:")) {
645
+ if (exception.message.startsWith("import not found:") || exception.message.startsWith("ambiguous indirect export:") || exception.message.includes("doesn't provide an export named:")) {
646
646
  exception.code = DYNAMIC_IMPORT_EXPORT_MISSING;
647
647
  }
648
648
  // safari
@@ -48,8 +48,26 @@ const getOriginalPosition = ({
48
48
  return originalPosition;
49
49
  };
50
50
 
51
- /* global window */
52
- const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
51
+ /* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */
52
+
53
+ const isBrowser = globalThis.window?.document !== undefined;
54
+ globalThis.process?.versions?.node !== undefined;
55
+ globalThis.process?.versions?.bun !== undefined;
56
+ globalThis.Deno?.version?.deno !== undefined;
57
+ globalThis.process?.versions?.electron !== undefined;
58
+ globalThis.navigator?.userAgent?.includes('jsdom') === true;
59
+ typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;
60
+ typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;
61
+ typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;
62
+ typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;
63
+
64
+ // Note: I'm intentionally not DRYing up the other variables to keep them "lazy".
65
+ const platform = globalThis.navigator?.userAgentData?.platform;
66
+ platform === 'macOS' || globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.
67
+ || globalThis.navigator?.userAgent?.includes(' Mac ') === true || globalThis.process?.platform === 'darwin';
68
+ platform === 'Windows' || globalThis.navigator?.platform === 'Win32' || globalThis.process?.platform === 'win32';
69
+ platform === 'Linux' || globalThis.navigator?.platform?.startsWith('Linux') === true || globalThis.navigator?.userAgent?.includes(' Linux ') === true || globalThis.process?.platform === 'linux';
70
+ platform === 'Android' || globalThis.navigator?.platform === 'Android' || globalThis.navigator?.userAgent?.includes(' Android ') === true || globalThis.process?.platform === 'android';
53
71
  !isBrowser && process$1.env.TERM_PROGRAM === 'Apple_Terminal';
54
72
  !isBrowser && process$1.platform === 'win32';
55
73
  isBrowser ? () => {
@@ -206,13 +224,16 @@ const ANSI = {
206
224
  YELLOW: "\x1b[33m",
207
225
  BLUE: "\x1b[34m",
208
226
  MAGENTA: "\x1b[35m",
227
+ CYAN: "\x1b[36m",
209
228
  GREY: "\x1b[90m",
210
229
  color: (text, ANSI_COLOR) => {
211
- return ANSI.supported ? "".concat(ANSI_COLOR).concat(text).concat(RESET) : text;
230
+ return ANSI.supported && ANSI_COLOR ? "".concat(ANSI_COLOR).concat(text).concat(RESET) : text;
212
231
  },
213
232
  BOLD: "\x1b[1m",
233
+ UNDERLINE: "\x1b[4m",
234
+ STRIKE: "\x1b[9m",
214
235
  effect: (text, ANSI_EFFECT) => {
215
- return ANSI.supported ? "".concat(ANSI_EFFECT).concat(text).concat(RESET) : text;
236
+ return ANSI.supported && ANSI_EFFECT ? "".concat(ANSI_EFFECT).concat(text).concat(RESET) : text;
216
237
  }
217
238
  };
218
239
 
@@ -280,6 +301,9 @@ const UNICODE = {
280
301
  },
281
302
  get CIRCLE_CROSS() {
282
303
  return ANSI.color(UNICODE.CIRCLE_CROSS_RAW, ANSI.RED);
304
+ },
305
+ get ELLIPSIS() {
306
+ return UNICODE.supported ? "\u2026" : "...";
283
307
  }
284
308
  };
285
309
  const formatDefault = v => v;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-supervisor",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,10 +26,10 @@
26
26
  "/dist/"
27
27
  ],
28
28
  "dependencies": {
29
- "@jsenv/ast": "6.0.3",
30
- "@jsenv/urls": "2.2.3",
31
- "@jsenv/sourcemap": "1.2.6",
32
- "launch-editor": "2.6.1"
29
+ "@jsenv/ast": "6.0.4",
30
+ "@jsenv/urls": "2.2.4",
31
+ "@jsenv/sourcemap": "1.2.7",
32
+ "launch-editor": "2.8.0"
33
33
  },
34
34
  "scripts": {
35
35
  "eslint": "npx eslint . --ext=.js,.mjs,.cjs,.html",
@@ -606,7 +606,8 @@ window.__supervisor__ = (() => {
606
606
  // firefox
607
607
  if (
608
608
  exception.message.startsWith("import not found:") ||
609
- exception.message.startsWith("ambiguous indirect export:")
609
+ exception.message.startsWith("ambiguous indirect export:") ||
610
+ exception.message.includes("doesn't provide an export named:")
610
611
  ) {
611
612
  exception.code = DYNAMIC_IMPORT_EXPORT_MISSING;
612
613
  }