@jsenv/plugin-supervisor 1.4.13 → 1.4.15

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.
@@ -203,21 +203,41 @@ const createAnsi = ({
203
203
  MAGENTA: "\x1b[35m",
204
204
  CYAN: "\x1b[36m",
205
205
  GREY: "\x1b[90m",
206
- color: (text, ANSI_COLOR) => {
207
- return ANSI.supported && ANSI_COLOR ? "".concat(ANSI_COLOR).concat(text).concat(RESET) : text;
206
+ color: (text, color) => {
207
+ if (!ANSI.supported) {
208
+ return text;
209
+ }
210
+ if (!color) {
211
+ return text;
212
+ }
213
+ if (text.trim() === "") {
214
+ // cannot set color of blank chars
215
+ return text;
216
+ }
217
+ return "".concat(color).concat(text).concat(RESET);
208
218
  },
209
219
  BOLD: "\x1b[1m",
210
220
  UNDERLINE: "\x1b[4m",
211
221
  STRIKE: "\x1b[9m",
212
- effect: (text, ANSI_EFFECT) => {
213
- return ANSI.supported && ANSI_EFFECT ? "".concat(ANSI_EFFECT).concat(text).concat(RESET) : text;
222
+ effect: (text, effect) => {
223
+ if (!ANSI.supported) {
224
+ return text;
225
+ }
226
+ if (!effect) {
227
+ return text;
228
+ }
229
+ // cannot add effect to empty string
230
+ if (text === "") {
231
+ return text;
232
+ }
233
+ return "".concat(effect).concat(text).concat(RESET);
214
234
  }
215
235
  };
216
236
  return ANSI;
217
237
  };
218
238
  const processSupportsBasicColor = createSupportsColor(process.stdout).hasBasic;
219
239
  const ANSI = createAnsi({
220
- supported: processSupportsBasicColor ||
240
+ supported: process.env.FORCE_COLOR === "1" || processSupportsBasicColor ||
221
241
  // GitHub workflow does support ANSI but "supports-color" returns false
222
242
  // because stream.isTTY returns false, see https://github.com/actions/runner/issues/241
223
243
  process.env.GITHUB_WORKFLOW
@@ -261,6 +281,9 @@ const createUnicode = ({
261
281
  get CIRCLE_CROSS_RAW() {
262
282
  return UNICODE.supported ? "\u24E7" : "(\xD7)";
263
283
  },
284
+ get CIRCLE_DOTTED_RAW() {
285
+ return UNICODE.supported ? "\u25CC" : "*";
286
+ },
264
287
  get COMMAND() {
265
288
  return ANSI.color(UNICODE.COMMAND_RAW, ANSI.GREY); // ANSI_MAGENTA)
266
289
  },
@@ -289,7 +312,7 @@ const createUnicode = ({
289
312
  return UNICODE;
290
313
  };
291
314
  createUnicode({
292
- supported: isUnicodeSupported() || process.env.FORCE_UNICODE === "1",
315
+ supported: process.env.FORCE_UNICODE === "1" || isUnicodeSupported(),
293
316
  ANSI
294
317
  });
295
318
  const formatDefault = v => v;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-supervisor",
3
- "version": "1.4.13",
3
+ "version": "1.4.15",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,9 +26,9 @@
26
26
  "/dist/"
27
27
  ],
28
28
  "dependencies": {
29
- "@jsenv/ast": "6.1.1",
30
- "@jsenv/urls": "2.2.7",
31
- "@jsenv/sourcemap": "1.2.10",
29
+ "@jsenv/ast": "6.1.3",
30
+ "@jsenv/urls": "2.2.9",
31
+ "@jsenv/sourcemap": "1.2.12",
32
32
  "launch-editor": "2.8.0"
33
33
  },
34
34
  "scripts": {