@oclif/plugin-test-esbuild 0.4.23 → 0.5.1

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/dist/index.js CHANGED
@@ -1,19 +1,21 @@
1
1
  import {
2
2
  ESBuild
3
- } from "./chunk-3RGGSNDJ.js";
3
+ } from "./chunk-OPQR7U44.js";
4
4
  import {
5
5
  Hello
6
- } from "./chunk-BIYL2HN3.js";
6
+ } from "./chunk-MN6CETUK.js";
7
7
  import {
8
8
  World
9
- } from "./chunk-L44NO6VG.js";
9
+ } from "./chunk-EKA2OJBU.js";
10
10
  import {
11
11
  init_default
12
- } from "./chunk-EB5PZLA5.js";
12
+ } from "./chunk-THX4UIMR.js";
13
13
  import {
14
+ require_ansis,
14
15
  require_lib,
15
16
  require_src
16
- } from "./chunk-PAHNEEAY.js";
17
+ } from "./chunk-5SUCPGFA.js";
18
+ import "./chunk-A4WCMQ5V.js";
17
19
  import {
18
20
  require_lib as require_lib2,
19
21
  require_semver
@@ -34,505 +36,15 @@ init_cjs_shims();
34
36
  init_cjs_shims();
35
37
  var import_core5 = __toESM(require_lib(), 1);
36
38
 
37
- // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/index.js
39
+ // node_modules/ansis/index.mjs
38
40
  init_cjs_shims();
41
+ var import_index = __toESM(require_ansis(), 1);
42
+ var { ansi256, fg, bgAnsi256, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bold, dim, italic, underline, strikethrough, strike, black, red, green, yellow, blue, magenta, cyan, white, grey, gray, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGrey, bgGray, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = import_index.default;
39
43
 
40
- // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/vendor/ansi-styles/index.js
41
- init_cjs_shims();
42
- var ANSI_BACKGROUND_OFFSET = 10;
43
- var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
44
- var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
45
- var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
46
- var styles = {
47
- modifier: {
48
- reset: [0, 0],
49
- // 21 isn't widely supported and 22 does the same thing
50
- bold: [1, 22],
51
- dim: [2, 22],
52
- italic: [3, 23],
53
- underline: [4, 24],
54
- overline: [53, 55],
55
- inverse: [7, 27],
56
- hidden: [8, 28],
57
- strikethrough: [9, 29]
58
- },
59
- color: {
60
- black: [30, 39],
61
- red: [31, 39],
62
- green: [32, 39],
63
- yellow: [33, 39],
64
- blue: [34, 39],
65
- magenta: [35, 39],
66
- cyan: [36, 39],
67
- white: [37, 39],
68
- // Bright color
69
- blackBright: [90, 39],
70
- gray: [90, 39],
71
- // Alias of `blackBright`
72
- grey: [90, 39],
73
- // Alias of `blackBright`
74
- redBright: [91, 39],
75
- greenBright: [92, 39],
76
- yellowBright: [93, 39],
77
- blueBright: [94, 39],
78
- magentaBright: [95, 39],
79
- cyanBright: [96, 39],
80
- whiteBright: [97, 39]
81
- },
82
- bgColor: {
83
- bgBlack: [40, 49],
84
- bgRed: [41, 49],
85
- bgGreen: [42, 49],
86
- bgYellow: [43, 49],
87
- bgBlue: [44, 49],
88
- bgMagenta: [45, 49],
89
- bgCyan: [46, 49],
90
- bgWhite: [47, 49],
91
- // Bright color
92
- bgBlackBright: [100, 49],
93
- bgGray: [100, 49],
94
- // Alias of `bgBlackBright`
95
- bgGrey: [100, 49],
96
- // Alias of `bgBlackBright`
97
- bgRedBright: [101, 49],
98
- bgGreenBright: [102, 49],
99
- bgYellowBright: [103, 49],
100
- bgBlueBright: [104, 49],
101
- bgMagentaBright: [105, 49],
102
- bgCyanBright: [106, 49],
103
- bgWhiteBright: [107, 49]
104
- }
105
- };
106
- var modifierNames = Object.keys(styles.modifier);
107
- var foregroundColorNames = Object.keys(styles.color);
108
- var backgroundColorNames = Object.keys(styles.bgColor);
109
- var colorNames = [...foregroundColorNames, ...backgroundColorNames];
110
- function assembleStyles() {
111
- const codes = /* @__PURE__ */ new Map();
112
- for (const [groupName, group] of Object.entries(styles)) {
113
- for (const [styleName, style] of Object.entries(group)) {
114
- styles[styleName] = {
115
- open: `\x1B[${style[0]}m`,
116
- close: `\x1B[${style[1]}m`
117
- };
118
- group[styleName] = styles[styleName];
119
- codes.set(style[0], style[1]);
120
- }
121
- Object.defineProperty(styles, groupName, {
122
- value: group,
123
- enumerable: false
124
- });
125
- }
126
- Object.defineProperty(styles, "codes", {
127
- value: codes,
128
- enumerable: false
129
- });
130
- styles.color.close = "\x1B[39m";
131
- styles.bgColor.close = "\x1B[49m";
132
- styles.color.ansi = wrapAnsi16();
133
- styles.color.ansi256 = wrapAnsi256();
134
- styles.color.ansi16m = wrapAnsi16m();
135
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
136
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
137
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
138
- Object.defineProperties(styles, {
139
- rgbToAnsi256: {
140
- value(red, green, blue) {
141
- if (red === green && green === blue) {
142
- if (red < 8) {
143
- return 16;
144
- }
145
- if (red > 248) {
146
- return 231;
147
- }
148
- return Math.round((red - 8) / 247 * 24) + 232;
149
- }
150
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
151
- },
152
- enumerable: false
153
- },
154
- hexToRgb: {
155
- value(hex) {
156
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
157
- if (!matches) {
158
- return [0, 0, 0];
159
- }
160
- let [colorString] = matches;
161
- if (colorString.length === 3) {
162
- colorString = [...colorString].map((character) => character + character).join("");
163
- }
164
- const integer = Number.parseInt(colorString, 16);
165
- return [
166
- /* eslint-disable no-bitwise */
167
- integer >> 16 & 255,
168
- integer >> 8 & 255,
169
- integer & 255
170
- /* eslint-enable no-bitwise */
171
- ];
172
- },
173
- enumerable: false
174
- },
175
- hexToAnsi256: {
176
- value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
177
- enumerable: false
178
- },
179
- ansi256ToAnsi: {
180
- value(code) {
181
- if (code < 8) {
182
- return 30 + code;
183
- }
184
- if (code < 16) {
185
- return 90 + (code - 8);
186
- }
187
- let red;
188
- let green;
189
- let blue;
190
- if (code >= 232) {
191
- red = ((code - 232) * 10 + 8) / 255;
192
- green = red;
193
- blue = red;
194
- } else {
195
- code -= 16;
196
- const remainder = code % 36;
197
- red = Math.floor(code / 36) / 5;
198
- green = Math.floor(remainder / 6) / 5;
199
- blue = remainder % 6 / 5;
200
- }
201
- const value = Math.max(red, green, blue) * 2;
202
- if (value === 0) {
203
- return 30;
204
- }
205
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
206
- if (value === 2) {
207
- result += 60;
208
- }
209
- return result;
210
- },
211
- enumerable: false
212
- },
213
- rgbToAnsi: {
214
- value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
215
- enumerable: false
216
- },
217
- hexToAnsi: {
218
- value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
219
- enumerable: false
220
- }
221
- });
222
- return styles;
223
- }
224
- var ansiStyles = assembleStyles();
225
- var ansi_styles_default = ansiStyles;
226
-
227
- // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/vendor/supports-color/index.js
228
- init_cjs_shims();
229
- import process2 from "node:process";
230
- import os from "node:os";
231
- import tty from "node:tty";
232
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
233
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
234
- const position = argv.indexOf(prefix + flag);
235
- const terminatorPosition = argv.indexOf("--");
236
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
237
- }
238
- var { env } = process2;
239
- var flagForceColor;
240
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
241
- flagForceColor = 0;
242
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
243
- flagForceColor = 1;
244
- }
245
- function envForceColor() {
246
- if ("FORCE_COLOR" in env) {
247
- if (env.FORCE_COLOR === "true") {
248
- return 1;
249
- }
250
- if (env.FORCE_COLOR === "false") {
251
- return 0;
252
- }
253
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
254
- }
255
- }
256
- function translateLevel(level) {
257
- if (level === 0) {
258
- return false;
259
- }
260
- return {
261
- level,
262
- hasBasic: true,
263
- has256: level >= 2,
264
- has16m: level >= 3
265
- };
266
- }
267
- function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
268
- const noFlagForceColor = envForceColor();
269
- if (noFlagForceColor !== void 0) {
270
- flagForceColor = noFlagForceColor;
271
- }
272
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
273
- if (forceColor === 0) {
274
- return 0;
275
- }
276
- if (sniffFlags) {
277
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
278
- return 3;
279
- }
280
- if (hasFlag("color=256")) {
281
- return 2;
282
- }
283
- }
284
- if ("TF_BUILD" in env && "AGENT_NAME" in env) {
285
- return 1;
286
- }
287
- if (haveStream && !streamIsTTY && forceColor === void 0) {
288
- return 0;
289
- }
290
- const min = forceColor || 0;
291
- if (env.TERM === "dumb") {
292
- return min;
293
- }
294
- if (process2.platform === "win32") {
295
- const osRelease = os.release().split(".");
296
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
297
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
298
- }
299
- return 1;
300
- }
301
- if ("CI" in env) {
302
- if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
303
- return 3;
304
- }
305
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
306
- return 1;
307
- }
308
- return min;
309
- }
310
- if ("TEAMCITY_VERSION" in env) {
311
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
312
- }
313
- if (env.COLORTERM === "truecolor") {
314
- return 3;
315
- }
316
- if (env.TERM === "xterm-kitty") {
317
- return 3;
318
- }
319
- if ("TERM_PROGRAM" in env) {
320
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
321
- switch (env.TERM_PROGRAM) {
322
- case "iTerm.app": {
323
- return version >= 3 ? 3 : 2;
324
- }
325
- case "Apple_Terminal": {
326
- return 2;
327
- }
328
- }
329
- }
330
- if (/-256(color)?$/i.test(env.TERM)) {
331
- return 2;
332
- }
333
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
334
- return 1;
335
- }
336
- if ("COLORTERM" in env) {
337
- return 1;
338
- }
339
- return min;
340
- }
341
- function createSupportsColor(stream, options = {}) {
342
- const level = _supportsColor(stream, {
343
- streamIsTTY: stream && stream.isTTY,
344
- ...options
345
- });
346
- return translateLevel(level);
347
- }
348
- var supportsColor = {
349
- stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
350
- stderr: createSupportsColor({ isTTY: tty.isatty(2) })
351
- };
352
- var supports_color_default = supportsColor;
353
-
354
- // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/utilities.js
355
- init_cjs_shims();
356
- function stringReplaceAll(string, substring, replacer) {
357
- let index = string.indexOf(substring);
358
- if (index === -1) {
359
- return string;
360
- }
361
- const substringLength = substring.length;
362
- let endIndex = 0;
363
- let returnValue = "";
364
- do {
365
- returnValue += string.slice(endIndex, index) + substring + replacer;
366
- endIndex = index + substringLength;
367
- index = string.indexOf(substring, endIndex);
368
- } while (index !== -1);
369
- returnValue += string.slice(endIndex);
370
- return returnValue;
371
- }
372
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
373
- let endIndex = 0;
374
- let returnValue = "";
375
- do {
376
- const gotCR = string[index - 1] === "\r";
377
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
378
- endIndex = index + 1;
379
- index = string.indexOf("\n", endIndex);
380
- } while (index !== -1);
381
- returnValue += string.slice(endIndex);
382
- return returnValue;
383
- }
384
-
385
- // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/index.js
386
- var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
387
- var GENERATOR = Symbol("GENERATOR");
388
- var STYLER = Symbol("STYLER");
389
- var IS_EMPTY = Symbol("IS_EMPTY");
390
- var levelMapping = [
391
- "ansi",
392
- "ansi",
393
- "ansi256",
394
- "ansi16m"
395
- ];
396
- var styles2 = /* @__PURE__ */ Object.create(null);
397
- var applyOptions = (object, options = {}) => {
398
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
399
- throw new Error("The `level` option should be an integer from 0 to 3");
400
- }
401
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
402
- object.level = options.level === void 0 ? colorLevel : options.level;
403
- };
404
- var chalkFactory = (options) => {
405
- const chalk2 = (...strings) => strings.join(" ");
406
- applyOptions(chalk2, options);
407
- Object.setPrototypeOf(chalk2, createChalk.prototype);
408
- return chalk2;
409
- };
410
- function createChalk(options) {
411
- return chalkFactory(options);
412
- }
413
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
414
- for (const [styleName, style] of Object.entries(ansi_styles_default)) {
415
- styles2[styleName] = {
416
- get() {
417
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
418
- Object.defineProperty(this, styleName, { value: builder });
419
- return builder;
420
- }
421
- };
422
- }
423
- styles2.visible = {
424
- get() {
425
- const builder = createBuilder(this, this[STYLER], true);
426
- Object.defineProperty(this, "visible", { value: builder });
427
- return builder;
428
- }
429
- };
430
- var getModelAnsi = (model, level, type, ...arguments_) => {
431
- if (model === "rgb") {
432
- if (level === "ansi16m") {
433
- return ansi_styles_default[type].ansi16m(...arguments_);
434
- }
435
- if (level === "ansi256") {
436
- return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
437
- }
438
- return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
439
- }
440
- if (model === "hex") {
441
- return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
442
- }
443
- return ansi_styles_default[type][model](...arguments_);
444
- };
445
- var usedModels = ["rgb", "hex", "ansi256"];
446
- for (const model of usedModels) {
447
- styles2[model] = {
448
- get() {
449
- const { level } = this;
450
- return function(...arguments_) {
451
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
452
- return createBuilder(this, styler, this[IS_EMPTY]);
453
- };
454
- }
455
- };
456
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
457
- styles2[bgModel] = {
458
- get() {
459
- const { level } = this;
460
- return function(...arguments_) {
461
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
462
- return createBuilder(this, styler, this[IS_EMPTY]);
463
- };
464
- }
465
- };
466
- }
467
- var proto = Object.defineProperties(() => {
468
- }, {
469
- ...styles2,
470
- level: {
471
- enumerable: true,
472
- get() {
473
- return this[GENERATOR].level;
474
- },
475
- set(level) {
476
- this[GENERATOR].level = level;
477
- }
478
- }
479
- });
480
- var createStyler = (open, close, parent) => {
481
- let openAll;
482
- let closeAll;
483
- if (parent === void 0) {
484
- openAll = open;
485
- closeAll = close;
486
- } else {
487
- openAll = parent.openAll + open;
488
- closeAll = close + parent.closeAll;
489
- }
490
- return {
491
- open,
492
- close,
493
- openAll,
494
- closeAll,
495
- parent
496
- };
497
- };
498
- var createBuilder = (self, _styler, _isEmpty) => {
499
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
500
- Object.setPrototypeOf(builder, proto);
501
- builder[GENERATOR] = self;
502
- builder[STYLER] = _styler;
503
- builder[IS_EMPTY] = _isEmpty;
504
- return builder;
505
- };
506
- var applyStyle = (self, string) => {
507
- if (self.level <= 0 || !string) {
508
- return self[IS_EMPTY] ? "" : string;
509
- }
510
- let styler = self[STYLER];
511
- if (styler === void 0) {
512
- return string;
513
- }
514
- const { openAll, closeAll } = styler;
515
- if (string.includes("\x1B")) {
516
- while (styler !== void 0) {
517
- string = stringReplaceAll(string, styler.close, styler.open);
518
- styler = styler.parent;
519
- }
520
- }
521
- const lfIndex = string.indexOf("\n");
522
- if (lfIndex !== -1) {
523
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
524
- }
525
- return openAll + string + closeAll;
526
- };
527
- Object.defineProperties(createChalk.prototype, styles2);
528
- var chalk = createChalk();
529
- var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
530
- var source_default = chalk;
531
-
532
- // node_modules/@oclif/plugin-plugins/node_modules/object-treeify/lib/index.js
44
+ // node_modules/object-treeify/lib/index.js
533
45
  init_cjs_shims();
534
46
 
535
- // node_modules/@oclif/plugin-plugins/node_modules/object-treeify/lib/assert.js
47
+ // node_modules/object-treeify/lib/assert.js
536
48
  init_cjs_shims();
537
49
  var assert_default = (condition, message) => {
538
50
  if (!condition) {
@@ -540,7 +52,7 @@ var assert_default = (condition, message) => {
540
52
  }
541
53
  };
542
54
 
543
- // node_modules/@oclif/plugin-plugins/node_modules/object-treeify/lib/index.js
55
+ // node_modules/object-treeify/lib/index.js
544
56
  var buildCtx = (opts) => {
545
57
  const ctx = {
546
58
  joined: true,
@@ -627,7 +139,7 @@ import { spawn as cpSpawn } from "node:child_process";
627
139
 
628
140
  // node_modules/npm-run-path/index.js
629
141
  init_cjs_shims();
630
- import process3 from "node:process";
142
+ import process2 from "node:process";
631
143
  import path from "node:path";
632
144
  import { fileURLToPath } from "node:url";
633
145
 
@@ -635,21 +147,21 @@ import { fileURLToPath } from "node:url";
635
147
  init_cjs_shims();
636
148
  function pathKey(options = {}) {
637
149
  const {
638
- env: env2 = process.env,
150
+ env = process.env,
639
151
  platform = process.platform
640
152
  } = options;
641
153
  if (platform !== "win32") {
642
154
  return "PATH";
643
155
  }
644
- return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
156
+ return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
645
157
  }
646
158
 
647
159
  // node_modules/npm-run-path/index.js
648
160
  var npmRunPath = ({
649
- cwd = process3.cwd(),
650
- path: pathOption = process3.env[pathKey()],
161
+ cwd = process2.cwd(),
162
+ path: pathOption = process2.env[pathKey()],
651
163
  preferLocal = true,
652
- execPath = process3.execPath,
164
+ execPath = process2.execPath,
653
165
  addExecPath = true
654
166
  } = {}) => {
655
167
  const cwdString = cwd instanceof URL ? fileURLToPath(cwd) : cwd;
@@ -675,12 +187,12 @@ var applyExecPath = (result, execPath, cwdPath) => {
675
187
  const execPathString = execPath instanceof URL ? fileURLToPath(execPath) : execPath;
676
188
  result.push(path.resolve(cwdPath, execPathString, ".."));
677
189
  };
678
- var npmRunPathEnv = ({ env: env2 = process3.env, ...options } = {}) => {
679
- env2 = { ...env2 };
680
- const pathName = pathKey({ env: env2 });
681
- options.path = env2[pathName];
682
- env2[pathName] = npmRunPath(options);
683
- return env2;
190
+ var npmRunPathEnv = ({ env = process2.env, ...options } = {}) => {
191
+ env = { ...env };
192
+ const pathName = pathKey({ env });
193
+ options.path = env[pathName];
194
+ env[pathName] = npmRunPath(options);
195
+ return env;
684
196
  };
685
197
 
686
198
  // node_modules/@oclif/plugin-plugins/lib/spawn.js
@@ -724,7 +236,7 @@ async function spawn(modulePath, args = [], { cwd, logLevel }) {
724
236
  stderr.push(output);
725
237
  if (shouldPrint(output)) {
726
238
  loggedStderr.push(output);
727
- import_core.ux.log(output);
239
+ import_core.ux.stdout(output);
728
240
  } else
729
241
  debug(output);
730
242
  });
@@ -734,7 +246,7 @@ async function spawn(modulePath, args = [], { cwd, logLevel }) {
734
246
  stdout.push(output);
735
247
  if (shouldPrint(output)) {
736
248
  loggedStdout.push(output);
737
- import_core.ux.log(output);
249
+ import_core.ux.stdout(output);
738
250
  } else
739
251
  debug(output);
740
252
  });
@@ -768,7 +280,7 @@ var NPM = class {
768
280
  if (this.config.npmRegistry)
769
281
  args.push(`--registry=${this.config.npmRegistry}`);
770
282
  if (options.logLevel !== "notice" && options.logLevel !== "silent") {
771
- import_core2.ux.logToStderr(`${options.cwd}: ${bin} ${args.join(" ")}`);
283
+ import_core2.ux.stderr(`${options.cwd}: ${bin} ${args.join(" ")}`);
772
284
  }
773
285
  debug2(`${options.cwd}: ${bin} ${args.join(" ")}`);
774
286
  try {
@@ -869,7 +381,7 @@ var Yarn = class {
869
381
  if (this.config.npmRegistry)
870
382
  args.push(`--registry=${this.config.npmRegistry}`);
871
383
  if (options.logLevel !== "notice" && options.logLevel !== "silent") {
872
- import_core3.ux.logToStderr(`${options.cwd}: ${bin} ${args.join(" ")}`);
384
+ import_core3.ux.stderr(`${options.cwd}: ${bin} ${args.join(" ")}`);
873
385
  }
874
386
  debug3(`${options.cwd}: ${bin} ${args.join(" ")}`);
875
387
  try {
@@ -915,11 +427,7 @@ async function fileExists(filePath) {
915
427
  }
916
428
  }
917
429
  function dedupePlugins(plugins) {
918
- return uniqWith(
919
- plugins,
920
- // @ts-expect-error because typescript doesn't think it's possible for a plugin to have the `link` type here
921
- (a, b) => a.name === b.name || a.type === "link" && b.type === "link" && a.root === b.root
922
- );
430
+ return uniqWith(plugins, (a, b) => a.name === b.name || a.type === "link" && b.type === "link" && a.root === b.root);
923
431
  }
924
432
  function extractIssuesLocation(bugs, repository) {
925
433
  if (bugs) {
@@ -932,10 +440,10 @@ function extractIssuesLocation(bugs, repository) {
932
440
  function notifyUser(plugin, output) {
933
441
  const containsWarnings = [...output.stdout, ...output.stderr].some((l) => l.includes("npm WARN"));
934
442
  if (containsWarnings) {
935
- import_core4.ux.logToStderr(source_default.bold.yellow(`
443
+ import_core4.ux.stderr(bold.yellow(`
936
444
  These warnings can only be addressed by the owner(s) of ${plugin.name}.`));
937
445
  if (plugin.pjson.bugs || plugin.pjson.repository) {
938
- import_core4.ux.logToStderr(`We suggest that you create an issue at ${extractIssuesLocation(plugin.pjson.bugs, plugin.pjson.repository)} and ask the plugin owners to address them.
446
+ import_core4.ux.stderr(`We suggest that you create an issue at ${extractIssuesLocation(plugin.pjson.bugs, plugin.pjson.repository)} and ask the plugin owners to address them.
939
447
  `);
940
448
  }
941
449
  }
@@ -1252,16 +760,18 @@ Does your current user own the directory ${this.config.dataDir}?`
1252
760
  }
1253
761
  }
1254
762
  async savePJSON(pjson) {
1255
- this.debug(`saving pjson at ${this.pjsonPath}`, JSON.stringify(pjson, null, 2));
1256
763
  await mkdir(dirname(this.pjsonPath), { recursive: true });
1257
764
  await writeFile(this.pjsonPath, JSON.stringify({ name: this.config.name, ...pjson }, null, 2));
1258
765
  }
1259
766
  };
1260
- var normalizePlugins = (input) => dedupePlugins((input ?? []).map((p) => typeof p === "string" ? {
1261
- name: p,
1262
- tag: "latest",
1263
- type: "user"
1264
- } : p));
767
+ var normalizePlugins = (input) => {
768
+ const normalized = (input ?? []).map((p) => typeof p === "string" ? {
769
+ name: p,
770
+ tag: "latest",
771
+ type: "user"
772
+ } : p);
773
+ return dedupePlugins(normalized);
774
+ };
1265
775
 
1266
776
  // node_modules/@oclif/plugin-plugins/lib/commands/plugins/index.js
1267
777
  var PluginsIndex = class _PluginsIndex extends import_core5.Command {
@@ -1320,19 +830,19 @@ var PluginsIndex = class _PluginsIndex extends import_core5.Command {
1320
830
  displayJitPlugins(jitPlugins) {
1321
831
  if (jitPlugins.length === 0)
1322
832
  return;
1323
- this.log(source_default.dim("\nUninstalled JIT Plugins:"));
833
+ this.log(dim("\nUninstalled JIT Plugins:"));
1324
834
  for (const { name, version } of jitPlugins) {
1325
- this.log(`${this.plugins.friendlyName(name)} ${source_default.dim(version)}`);
835
+ this.log(`${this.plugins.friendlyName(name)} ${dim(version)}`);
1326
836
  }
1327
837
  }
1328
838
  formatPlugin(plugin) {
1329
- let output = `${this.plugins.friendlyName(plugin.name)} ${source_default.dim(plugin.version)}`;
839
+ let output = `${this.plugins.friendlyName(plugin.name)} ${dim(plugin.version)}`;
1330
840
  if (plugin.type !== "user")
1331
- output += source_default.dim(` (${plugin.type})`);
841
+ output += dim(` (${plugin.type})`);
1332
842
  if (plugin.type === "link")
1333
843
  output += ` ${plugin.root}`;
1334
844
  else if (plugin.tag && plugin.tag !== "latest")
1335
- output += source_default.dim(` (${String(plugin.tag)})`);
845
+ output += dim(` (${String(plugin.tag)})`);
1336
846
  return output;
1337
847
  }
1338
848
  };
@@ -1421,13 +931,13 @@ var PluginsInspect = class _PluginsInspect extends import_core6.Command {
1421
931
  if (!version)
1422
932
  continue;
1423
933
  const from = plugin.pjson.dependencies?.[dep];
1424
- const versionMsg = source_default.dim(from ? `${from} => ${version}` : version);
934
+ const versionMsg = dim(from ? `${from} => ${version}` : version);
1425
935
  const msg = verbose ? `${dep} ${versionMsg} ${pkgPath}` : `${dep} ${versionMsg}`;
1426
936
  dependencies[msg] = null;
1427
937
  depsJson[dep] = { from, version };
1428
938
  }
1429
939
  const tree = {
1430
- [source_default.bold.cyan(plugin.name)]: {
940
+ [bold.cyan(plugin.name)]: {
1431
941
  [`version ${plugin.version}`]: null,
1432
942
  ...plugin.tag ? { [`tag ${plugin.tag}`]: null } : {},
1433
943
  ...plugin.pjson.homepage ? { [`homepage ${plugin.pjson.homepage}`]: null } : {},
@@ -1460,7 +970,7 @@ var PluginsInspect = class _PluginsInspect extends import_core6.Command {
1460
970
  try {
1461
971
  plugins.push(await this.inspect(pluginName, flags.verbose));
1462
972
  } catch (error) {
1463
- this.log(source_default.bold.red("failed"));
973
+ this.log(bold.red("failed"));
1464
974
  throw error;
1465
975
  }
1466
976
  }
@@ -1595,17 +1105,17 @@ Use the <%= config.scopedEnvVarKey('NPM_REGISTRY') %> environment variable to se
1595
1105
  });
1596
1106
  try {
1597
1107
  if (p.type === "npm") {
1598
- import_core7.ux.action.start(`${this.config.name}: Installing plugin ${source_default.cyan(plugins.friendlyName(p.name) + "@" + p.tag)}`);
1108
+ import_core7.ux.action.start(`${this.config.name}: Installing plugin ${cyan(plugins.friendlyName(p.name) + "@" + p.tag)}`);
1599
1109
  plugin = await plugins.install(p.name, {
1600
1110
  force: flags.force,
1601
1111
  tag: p.tag
1602
1112
  });
1603
1113
  } else {
1604
- import_core7.ux.action.start(`${this.config.name}: Installing plugin ${source_default.cyan(p.url)}`);
1114
+ import_core7.ux.action.start(`${this.config.name}: Installing plugin ${cyan(p.url)}`);
1605
1115
  plugin = await plugins.install(p.url, { force: flags.force });
1606
1116
  }
1607
1117
  } catch (error) {
1608
- import_core7.ux.action.stop(source_default.bold.red("failed"));
1118
+ import_core7.ux.action.stop(bold.red("failed"));
1609
1119
  throw error;
1610
1120
  }
1611
1121
  import_core7.ux.action.stop(`installed v${plugin.version}`);
@@ -1646,7 +1156,7 @@ e.g. If you have a user-installed or core plugin that has a 'hello' command, ins
1646
1156
  config: this.config,
1647
1157
  logLevel: determineLogLevel(this.config, flags, "silent")
1648
1158
  });
1649
- import_core8.ux.action.start(`${this.config.name}: Linking plugin ${source_default.cyan(args.path)}`);
1159
+ import_core8.ux.action.start(`${this.config.name}: Linking plugin ${cyan(args.path)}`);
1650
1160
  await plugins.link(args.path, { install: flags.install });
1651
1161
  import_core8.ux.action.stop();
1652
1162
  }
@@ -1675,7 +1185,7 @@ var Reset = class _Reset extends import_core9.Command {
1675
1185
  const userPlugins = await plugins.list();
1676
1186
  this.log(`Found ${userPlugins.length} plugin${userPlugins.length === 0 ? "" : "s"}:`);
1677
1187
  for (const plugin of userPlugins) {
1678
- this.log(`- ${plugin.name} ${source_default.dim(this.config.plugins.get(plugin.name)?.version)} ${source_default.dim(`(${plugin.type})`)}`);
1188
+ this.log(`- ${plugin.name} ${dim(this.config.plugins.get(plugin.name)?.version ?? "")} ${dim(`(${plugin.type})`)}`);
1679
1189
  }
1680
1190
  if (flags.hard) {
1681
1191
  const filesToDelete = [
@@ -1708,7 +1218,7 @@ var Reset = class _Reset extends import_core9.Command {
1708
1218
  if (plugin.type === "link") {
1709
1219
  try {
1710
1220
  const newPlugin = await plugins.link(plugin.root, { install: false });
1711
- const newVersion = source_default.dim(`-> ${newPlugin.version}`);
1221
+ const newVersion = dim(`-> ${newPlugin.version}`);
1712
1222
  this.log(`\u2705 Relinked ${plugin.name} ${newVersion}`);
1713
1223
  } catch {
1714
1224
  this.warn(`Failed to relink ${plugin.name}`);
@@ -1717,7 +1227,7 @@ var Reset = class _Reset extends import_core9.Command {
1717
1227
  if (plugin.type === "user") {
1718
1228
  try {
1719
1229
  const newPlugin = plugin.url ? await plugins.install(plugin.url) : await plugins.install(plugin.name, { tag: plugin.tag });
1720
- const newVersion = source_default.dim(`-> ${newPlugin.version}`);
1230
+ const newVersion = dim(`-> ${newPlugin.version}`);
1721
1231
  const tag = plugin.tag ? `@${plugin.tag}` : plugin.url ? ` (${plugin.url})` : "";
1722
1232
  this.log(`\u2705 Reinstalled ${plugin.name}${tag} ${newVersion}`);
1723
1233
  } catch {
@@ -1780,7 +1290,7 @@ var PluginsUninstall = class _PluginsUninstall extends import_core10.Command {
1780
1290
  import_core10.ux.action.start(`${this.config.name}: Uninstalling ${displayName}`);
1781
1291
  await plugins.uninstall(name);
1782
1292
  } catch (error) {
1783
- import_core10.ux.action.stop(source_default.bold.red("failed"));
1293
+ import_core10.ux.action.stop(bold.red("failed"));
1784
1294
  throw error;
1785
1295
  }
1786
1296
  import_core10.ux.action.stop();