@storm-software/pnpm-tools 0.4.5 → 0.5.0

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/bin/pnpm.js CHANGED
@@ -1,4 +1,1585 @@
1
1
  #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+
28
+ // ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
29
+ var require_color_name = __commonJS({
30
+ "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports, module) {
31
+ "use strict";
32
+ module.exports = {
33
+ "aliceblue": [240, 248, 255],
34
+ "antiquewhite": [250, 235, 215],
35
+ "aqua": [0, 255, 255],
36
+ "aquamarine": [127, 255, 212],
37
+ "azure": [240, 255, 255],
38
+ "beige": [245, 245, 220],
39
+ "bisque": [255, 228, 196],
40
+ "black": [0, 0, 0],
41
+ "blanchedalmond": [255, 235, 205],
42
+ "blue": [0, 0, 255],
43
+ "blueviolet": [138, 43, 226],
44
+ "brown": [165, 42, 42],
45
+ "burlywood": [222, 184, 135],
46
+ "cadetblue": [95, 158, 160],
47
+ "chartreuse": [127, 255, 0],
48
+ "chocolate": [210, 105, 30],
49
+ "coral": [255, 127, 80],
50
+ "cornflowerblue": [100, 149, 237],
51
+ "cornsilk": [255, 248, 220],
52
+ "crimson": [220, 20, 60],
53
+ "cyan": [0, 255, 255],
54
+ "darkblue": [0, 0, 139],
55
+ "darkcyan": [0, 139, 139],
56
+ "darkgoldenrod": [184, 134, 11],
57
+ "darkgray": [169, 169, 169],
58
+ "darkgreen": [0, 100, 0],
59
+ "darkgrey": [169, 169, 169],
60
+ "darkkhaki": [189, 183, 107],
61
+ "darkmagenta": [139, 0, 139],
62
+ "darkolivegreen": [85, 107, 47],
63
+ "darkorange": [255, 140, 0],
64
+ "darkorchid": [153, 50, 204],
65
+ "darkred": [139, 0, 0],
66
+ "darksalmon": [233, 150, 122],
67
+ "darkseagreen": [143, 188, 143],
68
+ "darkslateblue": [72, 61, 139],
69
+ "darkslategray": [47, 79, 79],
70
+ "darkslategrey": [47, 79, 79],
71
+ "darkturquoise": [0, 206, 209],
72
+ "darkviolet": [148, 0, 211],
73
+ "deeppink": [255, 20, 147],
74
+ "deepskyblue": [0, 191, 255],
75
+ "dimgray": [105, 105, 105],
76
+ "dimgrey": [105, 105, 105],
77
+ "dodgerblue": [30, 144, 255],
78
+ "firebrick": [178, 34, 34],
79
+ "floralwhite": [255, 250, 240],
80
+ "forestgreen": [34, 139, 34],
81
+ "fuchsia": [255, 0, 255],
82
+ "gainsboro": [220, 220, 220],
83
+ "ghostwhite": [248, 248, 255],
84
+ "gold": [255, 215, 0],
85
+ "goldenrod": [218, 165, 32],
86
+ "gray": [128, 128, 128],
87
+ "green": [0, 128, 0],
88
+ "greenyellow": [173, 255, 47],
89
+ "grey": [128, 128, 128],
90
+ "honeydew": [240, 255, 240],
91
+ "hotpink": [255, 105, 180],
92
+ "indianred": [205, 92, 92],
93
+ "indigo": [75, 0, 130],
94
+ "ivory": [255, 255, 240],
95
+ "khaki": [240, 230, 140],
96
+ "lavender": [230, 230, 250],
97
+ "lavenderblush": [255, 240, 245],
98
+ "lawngreen": [124, 252, 0],
99
+ "lemonchiffon": [255, 250, 205],
100
+ "lightblue": [173, 216, 230],
101
+ "lightcoral": [240, 128, 128],
102
+ "lightcyan": [224, 255, 255],
103
+ "lightgoldenrodyellow": [250, 250, 210],
104
+ "lightgray": [211, 211, 211],
105
+ "lightgreen": [144, 238, 144],
106
+ "lightgrey": [211, 211, 211],
107
+ "lightpink": [255, 182, 193],
108
+ "lightsalmon": [255, 160, 122],
109
+ "lightseagreen": [32, 178, 170],
110
+ "lightskyblue": [135, 206, 250],
111
+ "lightslategray": [119, 136, 153],
112
+ "lightslategrey": [119, 136, 153],
113
+ "lightsteelblue": [176, 196, 222],
114
+ "lightyellow": [255, 255, 224],
115
+ "lime": [0, 255, 0],
116
+ "limegreen": [50, 205, 50],
117
+ "linen": [250, 240, 230],
118
+ "magenta": [255, 0, 255],
119
+ "maroon": [128, 0, 0],
120
+ "mediumaquamarine": [102, 205, 170],
121
+ "mediumblue": [0, 0, 205],
122
+ "mediumorchid": [186, 85, 211],
123
+ "mediumpurple": [147, 112, 219],
124
+ "mediumseagreen": [60, 179, 113],
125
+ "mediumslateblue": [123, 104, 238],
126
+ "mediumspringgreen": [0, 250, 154],
127
+ "mediumturquoise": [72, 209, 204],
128
+ "mediumvioletred": [199, 21, 133],
129
+ "midnightblue": [25, 25, 112],
130
+ "mintcream": [245, 255, 250],
131
+ "mistyrose": [255, 228, 225],
132
+ "moccasin": [255, 228, 181],
133
+ "navajowhite": [255, 222, 173],
134
+ "navy": [0, 0, 128],
135
+ "oldlace": [253, 245, 230],
136
+ "olive": [128, 128, 0],
137
+ "olivedrab": [107, 142, 35],
138
+ "orange": [255, 165, 0],
139
+ "orangered": [255, 69, 0],
140
+ "orchid": [218, 112, 214],
141
+ "palegoldenrod": [238, 232, 170],
142
+ "palegreen": [152, 251, 152],
143
+ "paleturquoise": [175, 238, 238],
144
+ "palevioletred": [219, 112, 147],
145
+ "papayawhip": [255, 239, 213],
146
+ "peachpuff": [255, 218, 185],
147
+ "peru": [205, 133, 63],
148
+ "pink": [255, 192, 203],
149
+ "plum": [221, 160, 221],
150
+ "powderblue": [176, 224, 230],
151
+ "purple": [128, 0, 128],
152
+ "rebeccapurple": [102, 51, 153],
153
+ "red": [255, 0, 0],
154
+ "rosybrown": [188, 143, 143],
155
+ "royalblue": [65, 105, 225],
156
+ "saddlebrown": [139, 69, 19],
157
+ "salmon": [250, 128, 114],
158
+ "sandybrown": [244, 164, 96],
159
+ "seagreen": [46, 139, 87],
160
+ "seashell": [255, 245, 238],
161
+ "sienna": [160, 82, 45],
162
+ "silver": [192, 192, 192],
163
+ "skyblue": [135, 206, 235],
164
+ "slateblue": [106, 90, 205],
165
+ "slategray": [112, 128, 144],
166
+ "slategrey": [112, 128, 144],
167
+ "snow": [255, 250, 250],
168
+ "springgreen": [0, 255, 127],
169
+ "steelblue": [70, 130, 180],
170
+ "tan": [210, 180, 140],
171
+ "teal": [0, 128, 128],
172
+ "thistle": [216, 191, 216],
173
+ "tomato": [255, 99, 71],
174
+ "turquoise": [64, 224, 208],
175
+ "violet": [238, 130, 238],
176
+ "wheat": [245, 222, 179],
177
+ "white": [255, 255, 255],
178
+ "whitesmoke": [245, 245, 245],
179
+ "yellow": [255, 255, 0],
180
+ "yellowgreen": [154, 205, 50]
181
+ };
182
+ }
183
+ });
184
+
185
+ // ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js
186
+ var require_conversions = __commonJS({
187
+ "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports, module) {
188
+ var __import_colorName = __toESM(require_color_name());
189
+ var cssKeywords = __import_colorName;
190
+ var reverseKeywords = {};
191
+ for (const key of Object.keys(cssKeywords)) {
192
+ reverseKeywords[cssKeywords[key]] = key;
193
+ }
194
+ var convert = {
195
+ rgb: { channels: 3, labels: "rgb" },
196
+ hsl: { channels: 3, labels: "hsl" },
197
+ hsv: { channels: 3, labels: "hsv" },
198
+ hwb: { channels: 3, labels: "hwb" },
199
+ cmyk: { channels: 4, labels: "cmyk" },
200
+ xyz: { channels: 3, labels: "xyz" },
201
+ lab: { channels: 3, labels: "lab" },
202
+ lch: { channels: 3, labels: "lch" },
203
+ hex: { channels: 1, labels: ["hex"] },
204
+ keyword: { channels: 1, labels: ["keyword"] },
205
+ ansi16: { channels: 1, labels: ["ansi16"] },
206
+ ansi256: { channels: 1, labels: ["ansi256"] },
207
+ hcg: { channels: 3, labels: ["h", "c", "g"] },
208
+ apple: { channels: 3, labels: ["r16", "g16", "b16"] },
209
+ gray: { channels: 1, labels: ["gray"] }
210
+ };
211
+ module.exports = convert;
212
+ for (const model of Object.keys(convert)) {
213
+ if (!("channels" in convert[model])) {
214
+ throw new Error("missing channels property: " + model);
215
+ }
216
+ if (!("labels" in convert[model])) {
217
+ throw new Error("missing channel labels property: " + model);
218
+ }
219
+ if (convert[model].labels.length !== convert[model].channels) {
220
+ throw new Error("channel and label counts mismatch: " + model);
221
+ }
222
+ const { channels, labels } = convert[model];
223
+ delete convert[model].channels;
224
+ delete convert[model].labels;
225
+ Object.defineProperty(convert[model], "channels", { value: channels });
226
+ Object.defineProperty(convert[model], "labels", { value: labels });
227
+ }
228
+ convert.rgb.hsl = function(rgb) {
229
+ const r = rgb[0] / 255;
230
+ const g = rgb[1] / 255;
231
+ const b = rgb[2] / 255;
232
+ const min = Math.min(r, g, b);
233
+ const max = Math.max(r, g, b);
234
+ const delta = max - min;
235
+ let h;
236
+ let s;
237
+ if (max === min) {
238
+ h = 0;
239
+ } else if (r === max) {
240
+ h = (g - b) / delta;
241
+ } else if (g === max) {
242
+ h = 2 + (b - r) / delta;
243
+ } else if (b === max) {
244
+ h = 4 + (r - g) / delta;
245
+ }
246
+ h = Math.min(h * 60, 360);
247
+ if (h < 0) {
248
+ h += 360;
249
+ }
250
+ const l = (min + max) / 2;
251
+ if (max === min) {
252
+ s = 0;
253
+ } else if (l <= 0.5) {
254
+ s = delta / (max + min);
255
+ } else {
256
+ s = delta / (2 - max - min);
257
+ }
258
+ return [h, s * 100, l * 100];
259
+ };
260
+ convert.rgb.hsv = function(rgb) {
261
+ let rdif;
262
+ let gdif;
263
+ let bdif;
264
+ let h;
265
+ let s;
266
+ const r = rgb[0] / 255;
267
+ const g = rgb[1] / 255;
268
+ const b = rgb[2] / 255;
269
+ const v = Math.max(r, g, b);
270
+ const diff = v - Math.min(r, g, b);
271
+ const diffc = function(c) {
272
+ return (v - c) / 6 / diff + 1 / 2;
273
+ };
274
+ if (diff === 0) {
275
+ h = 0;
276
+ s = 0;
277
+ } else {
278
+ s = diff / v;
279
+ rdif = diffc(r);
280
+ gdif = diffc(g);
281
+ bdif = diffc(b);
282
+ if (r === v) {
283
+ h = bdif - gdif;
284
+ } else if (g === v) {
285
+ h = 1 / 3 + rdif - bdif;
286
+ } else if (b === v) {
287
+ h = 2 / 3 + gdif - rdif;
288
+ }
289
+ if (h < 0) {
290
+ h += 1;
291
+ } else if (h > 1) {
292
+ h -= 1;
293
+ }
294
+ }
295
+ return [
296
+ h * 360,
297
+ s * 100,
298
+ v * 100
299
+ ];
300
+ };
301
+ convert.rgb.hwb = function(rgb) {
302
+ const r = rgb[0];
303
+ const g = rgb[1];
304
+ let b = rgb[2];
305
+ const h = convert.rgb.hsl(rgb)[0];
306
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
307
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
308
+ return [h, w * 100, b * 100];
309
+ };
310
+ convert.rgb.cmyk = function(rgb) {
311
+ const r = rgb[0] / 255;
312
+ const g = rgb[1] / 255;
313
+ const b = rgb[2] / 255;
314
+ const k = Math.min(1 - r, 1 - g, 1 - b);
315
+ const c = (1 - r - k) / (1 - k) || 0;
316
+ const m = (1 - g - k) / (1 - k) || 0;
317
+ const y = (1 - b - k) / (1 - k) || 0;
318
+ return [c * 100, m * 100, y * 100, k * 100];
319
+ };
320
+ function comparativeDistance(x, y) {
321
+ return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
322
+ }
323
+ convert.rgb.keyword = function(rgb) {
324
+ const reversed = reverseKeywords[rgb];
325
+ if (reversed) {
326
+ return reversed;
327
+ }
328
+ let currentClosestDistance = Infinity;
329
+ let currentClosestKeyword;
330
+ for (const keyword of Object.keys(cssKeywords)) {
331
+ const value = cssKeywords[keyword];
332
+ const distance = comparativeDistance(rgb, value);
333
+ if (distance < currentClosestDistance) {
334
+ currentClosestDistance = distance;
335
+ currentClosestKeyword = keyword;
336
+ }
337
+ }
338
+ return currentClosestKeyword;
339
+ };
340
+ convert.keyword.rgb = function(keyword) {
341
+ return cssKeywords[keyword];
342
+ };
343
+ convert.rgb.xyz = function(rgb) {
344
+ let r = rgb[0] / 255;
345
+ let g = rgb[1] / 255;
346
+ let b = rgb[2] / 255;
347
+ r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
348
+ g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
349
+ b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
350
+ const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
351
+ const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
352
+ const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
353
+ return [x * 100, y * 100, z * 100];
354
+ };
355
+ convert.rgb.lab = function(rgb) {
356
+ const xyz = convert.rgb.xyz(rgb);
357
+ let x = xyz[0];
358
+ let y = xyz[1];
359
+ let z = xyz[2];
360
+ x /= 95.047;
361
+ y /= 100;
362
+ z /= 108.883;
363
+ x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
364
+ y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
365
+ z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
366
+ const l = 116 * y - 16;
367
+ const a = 500 * (x - y);
368
+ const b = 200 * (y - z);
369
+ return [l, a, b];
370
+ };
371
+ convert.hsl.rgb = function(hsl) {
372
+ const h = hsl[0] / 360;
373
+ const s = hsl[1] / 100;
374
+ const l = hsl[2] / 100;
375
+ let t2;
376
+ let t3;
377
+ let val;
378
+ if (s === 0) {
379
+ val = l * 255;
380
+ return [val, val, val];
381
+ }
382
+ if (l < 0.5) {
383
+ t2 = l * (1 + s);
384
+ } else {
385
+ t2 = l + s - l * s;
386
+ }
387
+ const t1 = 2 * l - t2;
388
+ const rgb = [0, 0, 0];
389
+ for (let i = 0; i < 3; i++) {
390
+ t3 = h + 1 / 3 * -(i - 1);
391
+ if (t3 < 0) {
392
+ t3++;
393
+ }
394
+ if (t3 > 1) {
395
+ t3--;
396
+ }
397
+ if (6 * t3 < 1) {
398
+ val = t1 + (t2 - t1) * 6 * t3;
399
+ } else if (2 * t3 < 1) {
400
+ val = t2;
401
+ } else if (3 * t3 < 2) {
402
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
403
+ } else {
404
+ val = t1;
405
+ }
406
+ rgb[i] = val * 255;
407
+ }
408
+ return rgb;
409
+ };
410
+ convert.hsl.hsv = function(hsl) {
411
+ const h = hsl[0];
412
+ let s = hsl[1] / 100;
413
+ let l = hsl[2] / 100;
414
+ let smin = s;
415
+ const lmin = Math.max(l, 0.01);
416
+ l *= 2;
417
+ s *= l <= 1 ? l : 2 - l;
418
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
419
+ const v = (l + s) / 2;
420
+ const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
421
+ return [h, sv * 100, v * 100];
422
+ };
423
+ convert.hsv.rgb = function(hsv) {
424
+ const h = hsv[0] / 60;
425
+ const s = hsv[1] / 100;
426
+ let v = hsv[2] / 100;
427
+ const hi = Math.floor(h) % 6;
428
+ const f = h - Math.floor(h);
429
+ const p = 255 * v * (1 - s);
430
+ const q = 255 * v * (1 - s * f);
431
+ const t = 255 * v * (1 - s * (1 - f));
432
+ v *= 255;
433
+ switch (hi) {
434
+ case 0:
435
+ return [v, t, p];
436
+ case 1:
437
+ return [q, v, p];
438
+ case 2:
439
+ return [p, v, t];
440
+ case 3:
441
+ return [p, q, v];
442
+ case 4:
443
+ return [t, p, v];
444
+ case 5:
445
+ return [v, p, q];
446
+ }
447
+ };
448
+ convert.hsv.hsl = function(hsv) {
449
+ const h = hsv[0];
450
+ const s = hsv[1] / 100;
451
+ const v = hsv[2] / 100;
452
+ const vmin = Math.max(v, 0.01);
453
+ let sl;
454
+ let l;
455
+ l = (2 - s) * v;
456
+ const lmin = (2 - s) * vmin;
457
+ sl = s * vmin;
458
+ sl /= lmin <= 1 ? lmin : 2 - lmin;
459
+ sl = sl || 0;
460
+ l /= 2;
461
+ return [h, sl * 100, l * 100];
462
+ };
463
+ convert.hwb.rgb = function(hwb) {
464
+ const h = hwb[0] / 360;
465
+ let wh = hwb[1] / 100;
466
+ let bl = hwb[2] / 100;
467
+ const ratio = wh + bl;
468
+ let f;
469
+ if (ratio > 1) {
470
+ wh /= ratio;
471
+ bl /= ratio;
472
+ }
473
+ const i = Math.floor(6 * h);
474
+ const v = 1 - bl;
475
+ f = 6 * h - i;
476
+ if ((i & 1) !== 0) {
477
+ f = 1 - f;
478
+ }
479
+ const n = wh + f * (v - wh);
480
+ let r;
481
+ let g;
482
+ let b;
483
+ switch (i) {
484
+ default:
485
+ case 6:
486
+ case 0:
487
+ r = v;
488
+ g = n;
489
+ b = wh;
490
+ break;
491
+ case 1:
492
+ r = n;
493
+ g = v;
494
+ b = wh;
495
+ break;
496
+ case 2:
497
+ r = wh;
498
+ g = v;
499
+ b = n;
500
+ break;
501
+ case 3:
502
+ r = wh;
503
+ g = n;
504
+ b = v;
505
+ break;
506
+ case 4:
507
+ r = n;
508
+ g = wh;
509
+ b = v;
510
+ break;
511
+ case 5:
512
+ r = v;
513
+ g = wh;
514
+ b = n;
515
+ break;
516
+ }
517
+ return [r * 255, g * 255, b * 255];
518
+ };
519
+ convert.cmyk.rgb = function(cmyk) {
520
+ const c = cmyk[0] / 100;
521
+ const m = cmyk[1] / 100;
522
+ const y = cmyk[2] / 100;
523
+ const k = cmyk[3] / 100;
524
+ const r = 1 - Math.min(1, c * (1 - k) + k);
525
+ const g = 1 - Math.min(1, m * (1 - k) + k);
526
+ const b = 1 - Math.min(1, y * (1 - k) + k);
527
+ return [r * 255, g * 255, b * 255];
528
+ };
529
+ convert.xyz.rgb = function(xyz) {
530
+ const x = xyz[0] / 100;
531
+ const y = xyz[1] / 100;
532
+ const z = xyz[2] / 100;
533
+ let r;
534
+ let g;
535
+ let b;
536
+ r = x * 3.2406 + y * -1.5372 + z * -0.4986;
537
+ g = x * -0.9689 + y * 1.8758 + z * 0.0415;
538
+ b = x * 0.0557 + y * -0.204 + z * 1.057;
539
+ r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
540
+ g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
541
+ b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
542
+ r = Math.min(Math.max(0, r), 1);
543
+ g = Math.min(Math.max(0, g), 1);
544
+ b = Math.min(Math.max(0, b), 1);
545
+ return [r * 255, g * 255, b * 255];
546
+ };
547
+ convert.xyz.lab = function(xyz) {
548
+ let x = xyz[0];
549
+ let y = xyz[1];
550
+ let z = xyz[2];
551
+ x /= 95.047;
552
+ y /= 100;
553
+ z /= 108.883;
554
+ x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
555
+ y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
556
+ z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
557
+ const l = 116 * y - 16;
558
+ const a = 500 * (x - y);
559
+ const b = 200 * (y - z);
560
+ return [l, a, b];
561
+ };
562
+ convert.lab.xyz = function(lab) {
563
+ const l = lab[0];
564
+ const a = lab[1];
565
+ const b = lab[2];
566
+ let x;
567
+ let y;
568
+ let z;
569
+ y = (l + 16) / 116;
570
+ x = a / 500 + y;
571
+ z = y - b / 200;
572
+ const y2 = y ** 3;
573
+ const x2 = x ** 3;
574
+ const z2 = z ** 3;
575
+ y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
576
+ x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
577
+ z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
578
+ x *= 95.047;
579
+ y *= 100;
580
+ z *= 108.883;
581
+ return [x, y, z];
582
+ };
583
+ convert.lab.lch = function(lab) {
584
+ const l = lab[0];
585
+ const a = lab[1];
586
+ const b = lab[2];
587
+ let h;
588
+ const hr = Math.atan2(b, a);
589
+ h = hr * 360 / 2 / Math.PI;
590
+ if (h < 0) {
591
+ h += 360;
592
+ }
593
+ const c = Math.sqrt(a * a + b * b);
594
+ return [l, c, h];
595
+ };
596
+ convert.lch.lab = function(lch) {
597
+ const l = lch[0];
598
+ const c = lch[1];
599
+ const h = lch[2];
600
+ const hr = h / 360 * 2 * Math.PI;
601
+ const a = c * Math.cos(hr);
602
+ const b = c * Math.sin(hr);
603
+ return [l, a, b];
604
+ };
605
+ convert.rgb.ansi16 = function(args, saturation = null) {
606
+ const [r, g, b] = args;
607
+ let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
608
+ value = Math.round(value / 50);
609
+ if (value === 0) {
610
+ return 30;
611
+ }
612
+ let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
613
+ if (value === 2) {
614
+ ansi += 60;
615
+ }
616
+ return ansi;
617
+ };
618
+ convert.hsv.ansi16 = function(args) {
619
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
620
+ };
621
+ convert.rgb.ansi256 = function(args) {
622
+ const r = args[0];
623
+ const g = args[1];
624
+ const b = args[2];
625
+ if (r === g && g === b) {
626
+ if (r < 8) {
627
+ return 16;
628
+ }
629
+ if (r > 248) {
630
+ return 231;
631
+ }
632
+ return Math.round((r - 8) / 247 * 24) + 232;
633
+ }
634
+ const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
635
+ return ansi;
636
+ };
637
+ convert.ansi16.rgb = function(args) {
638
+ let color = args % 10;
639
+ if (color === 0 || color === 7) {
640
+ if (args > 50) {
641
+ color += 3.5;
642
+ }
643
+ color = color / 10.5 * 255;
644
+ return [color, color, color];
645
+ }
646
+ const mult = (~~(args > 50) + 1) * 0.5;
647
+ const r = (color & 1) * mult * 255;
648
+ const g = (color >> 1 & 1) * mult * 255;
649
+ const b = (color >> 2 & 1) * mult * 255;
650
+ return [r, g, b];
651
+ };
652
+ convert.ansi256.rgb = function(args) {
653
+ if (args >= 232) {
654
+ const c = (args - 232) * 10 + 8;
655
+ return [c, c, c];
656
+ }
657
+ args -= 16;
658
+ let rem;
659
+ const r = Math.floor(args / 36) / 5 * 255;
660
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
661
+ const b = rem % 6 / 5 * 255;
662
+ return [r, g, b];
663
+ };
664
+ convert.rgb.hex = function(args) {
665
+ const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
666
+ const string = integer.toString(16).toUpperCase();
667
+ return "000000".substring(string.length) + string;
668
+ };
669
+ convert.hex.rgb = function(args) {
670
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
671
+ if (!match) {
672
+ return [0, 0, 0];
673
+ }
674
+ let colorString = match[0];
675
+ if (match[0].length === 3) {
676
+ colorString = colorString.split("").map((char) => {
677
+ return char + char;
678
+ }).join("");
679
+ }
680
+ const integer = parseInt(colorString, 16);
681
+ const r = integer >> 16 & 255;
682
+ const g = integer >> 8 & 255;
683
+ const b = integer & 255;
684
+ return [r, g, b];
685
+ };
686
+ convert.rgb.hcg = function(rgb) {
687
+ const r = rgb[0] / 255;
688
+ const g = rgb[1] / 255;
689
+ const b = rgb[2] / 255;
690
+ const max = Math.max(Math.max(r, g), b);
691
+ const min = Math.min(Math.min(r, g), b);
692
+ const chroma = max - min;
693
+ let grayscale;
694
+ let hue;
695
+ if (chroma < 1) {
696
+ grayscale = min / (1 - chroma);
697
+ } else {
698
+ grayscale = 0;
699
+ }
700
+ if (chroma <= 0) {
701
+ hue = 0;
702
+ } else if (max === r) {
703
+ hue = (g - b) / chroma % 6;
704
+ } else if (max === g) {
705
+ hue = 2 + (b - r) / chroma;
706
+ } else {
707
+ hue = 4 + (r - g) / chroma;
708
+ }
709
+ hue /= 6;
710
+ hue %= 1;
711
+ return [hue * 360, chroma * 100, grayscale * 100];
712
+ };
713
+ convert.hsl.hcg = function(hsl) {
714
+ const s = hsl[1] / 100;
715
+ const l = hsl[2] / 100;
716
+ const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
717
+ let f = 0;
718
+ if (c < 1) {
719
+ f = (l - 0.5 * c) / (1 - c);
720
+ }
721
+ return [hsl[0], c * 100, f * 100];
722
+ };
723
+ convert.hsv.hcg = function(hsv) {
724
+ const s = hsv[1] / 100;
725
+ const v = hsv[2] / 100;
726
+ const c = s * v;
727
+ let f = 0;
728
+ if (c < 1) {
729
+ f = (v - c) / (1 - c);
730
+ }
731
+ return [hsv[0], c * 100, f * 100];
732
+ };
733
+ convert.hcg.rgb = function(hcg) {
734
+ const h = hcg[0] / 360;
735
+ const c = hcg[1] / 100;
736
+ const g = hcg[2] / 100;
737
+ if (c === 0) {
738
+ return [g * 255, g * 255, g * 255];
739
+ }
740
+ const pure = [0, 0, 0];
741
+ const hi = h % 1 * 6;
742
+ const v = hi % 1;
743
+ const w = 1 - v;
744
+ let mg = 0;
745
+ switch (Math.floor(hi)) {
746
+ case 0:
747
+ pure[0] = 1;
748
+ pure[1] = v;
749
+ pure[2] = 0;
750
+ break;
751
+ case 1:
752
+ pure[0] = w;
753
+ pure[1] = 1;
754
+ pure[2] = 0;
755
+ break;
756
+ case 2:
757
+ pure[0] = 0;
758
+ pure[1] = 1;
759
+ pure[2] = v;
760
+ break;
761
+ case 3:
762
+ pure[0] = 0;
763
+ pure[1] = w;
764
+ pure[2] = 1;
765
+ break;
766
+ case 4:
767
+ pure[0] = v;
768
+ pure[1] = 0;
769
+ pure[2] = 1;
770
+ break;
771
+ default:
772
+ pure[0] = 1;
773
+ pure[1] = 0;
774
+ pure[2] = w;
775
+ }
776
+ mg = (1 - c) * g;
777
+ return [
778
+ (c * pure[0] + mg) * 255,
779
+ (c * pure[1] + mg) * 255,
780
+ (c * pure[2] + mg) * 255
781
+ ];
782
+ };
783
+ convert.hcg.hsv = function(hcg) {
784
+ const c = hcg[1] / 100;
785
+ const g = hcg[2] / 100;
786
+ const v = c + g * (1 - c);
787
+ let f = 0;
788
+ if (v > 0) {
789
+ f = c / v;
790
+ }
791
+ return [hcg[0], f * 100, v * 100];
792
+ };
793
+ convert.hcg.hsl = function(hcg) {
794
+ const c = hcg[1] / 100;
795
+ const g = hcg[2] / 100;
796
+ const l = g * (1 - c) + 0.5 * c;
797
+ let s = 0;
798
+ if (l > 0 && l < 0.5) {
799
+ s = c / (2 * l);
800
+ } else if (l >= 0.5 && l < 1) {
801
+ s = c / (2 * (1 - l));
802
+ }
803
+ return [hcg[0], s * 100, l * 100];
804
+ };
805
+ convert.hcg.hwb = function(hcg) {
806
+ const c = hcg[1] / 100;
807
+ const g = hcg[2] / 100;
808
+ const v = c + g * (1 - c);
809
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
810
+ };
811
+ convert.hwb.hcg = function(hwb) {
812
+ const w = hwb[1] / 100;
813
+ const b = hwb[2] / 100;
814
+ const v = 1 - b;
815
+ const c = v - w;
816
+ let g = 0;
817
+ if (c < 1) {
818
+ g = (v - c) / (1 - c);
819
+ }
820
+ return [hwb[0], c * 100, g * 100];
821
+ };
822
+ convert.apple.rgb = function(apple) {
823
+ return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
824
+ };
825
+ convert.rgb.apple = function(rgb) {
826
+ return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
827
+ };
828
+ convert.gray.rgb = function(args) {
829
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
830
+ };
831
+ convert.gray.hsl = function(args) {
832
+ return [0, 0, args[0]];
833
+ };
834
+ convert.gray.hsv = convert.gray.hsl;
835
+ convert.gray.hwb = function(gray) {
836
+ return [0, 100, gray[0]];
837
+ };
838
+ convert.gray.cmyk = function(gray) {
839
+ return [0, 0, 0, gray[0]];
840
+ };
841
+ convert.gray.lab = function(gray) {
842
+ return [gray[0], 0, 0];
843
+ };
844
+ convert.gray.hex = function(gray) {
845
+ const val = Math.round(gray[0] / 100 * 255) & 255;
846
+ const integer = (val << 16) + (val << 8) + val;
847
+ const string = integer.toString(16).toUpperCase();
848
+ return "000000".substring(string.length) + string;
849
+ };
850
+ convert.rgb.gray = function(rgb) {
851
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
852
+ return [val / 255 * 100];
853
+ };
854
+ }
855
+ });
856
+
857
+ // ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
858
+ var require_route = __commonJS({
859
+ "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports, module) {
860
+ var __import___conversions = __toESM(require_conversions());
861
+ var conversions = __import___conversions;
862
+ function buildGraph() {
863
+ const graph = {};
864
+ const models = Object.keys(conversions);
865
+ for (let len = models.length, i = 0; i < len; i++) {
866
+ graph[models[i]] = {
867
+ // http://jsperf.com/1-vs-infinity
868
+ // micro-opt, but this is simple.
869
+ distance: -1,
870
+ parent: null
871
+ };
872
+ }
873
+ return graph;
874
+ }
875
+ function deriveBFS(fromModel) {
876
+ const graph = buildGraph();
877
+ const queue = [fromModel];
878
+ graph[fromModel].distance = 0;
879
+ while (queue.length) {
880
+ const current = queue.pop();
881
+ const adjacents = Object.keys(conversions[current]);
882
+ for (let len = adjacents.length, i = 0; i < len; i++) {
883
+ const adjacent = adjacents[i];
884
+ const node = graph[adjacent];
885
+ if (node.distance === -1) {
886
+ node.distance = graph[current].distance + 1;
887
+ node.parent = current;
888
+ queue.unshift(adjacent);
889
+ }
890
+ }
891
+ }
892
+ return graph;
893
+ }
894
+ function link(from, to) {
895
+ return function(args) {
896
+ return to(from(args));
897
+ };
898
+ }
899
+ function wrapConversion(toModel, graph) {
900
+ const path = [graph[toModel].parent, toModel];
901
+ let fn = conversions[graph[toModel].parent][toModel];
902
+ let cur = graph[toModel].parent;
903
+ while (graph[cur].parent) {
904
+ path.unshift(graph[cur].parent);
905
+ fn = link(conversions[graph[cur].parent][cur], fn);
906
+ cur = graph[cur].parent;
907
+ }
908
+ fn.conversion = path;
909
+ return fn;
910
+ }
911
+ module.exports = function(fromModel) {
912
+ const graph = deriveBFS(fromModel);
913
+ const conversion = {};
914
+ const models = Object.keys(graph);
915
+ for (let len = models.length, i = 0; i < len; i++) {
916
+ const toModel = models[i];
917
+ const node = graph[toModel];
918
+ if (node.parent === null) {
919
+ continue;
920
+ }
921
+ conversion[toModel] = wrapConversion(toModel, graph);
922
+ }
923
+ return conversion;
924
+ };
925
+ }
926
+ });
927
+
928
+ // ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js
929
+ var require_color_convert = __commonJS({
930
+ "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports, module) {
931
+ var __import___conversions = __toESM(require_conversions());
932
+ var __import___route = __toESM(require_route());
933
+ var conversions = __import___conversions;
934
+ var route = __import___route;
935
+ var convert = {};
936
+ var models = Object.keys(conversions);
937
+ function wrapRaw(fn) {
938
+ const wrappedFn = function(...args) {
939
+ const arg0 = args[0];
940
+ if (arg0 === void 0 || arg0 === null) {
941
+ return arg0;
942
+ }
943
+ if (arg0.length > 1) {
944
+ args = arg0;
945
+ }
946
+ return fn(args);
947
+ };
948
+ if ("conversion" in fn) {
949
+ wrappedFn.conversion = fn.conversion;
950
+ }
951
+ return wrappedFn;
952
+ }
953
+ function wrapRounded(fn) {
954
+ const wrappedFn = function(...args) {
955
+ const arg0 = args[0];
956
+ if (arg0 === void 0 || arg0 === null) {
957
+ return arg0;
958
+ }
959
+ if (arg0.length > 1) {
960
+ args = arg0;
961
+ }
962
+ const result = fn(args);
963
+ if (typeof result === "object") {
964
+ for (let len = result.length, i = 0; i < len; i++) {
965
+ result[i] = Math.round(result[i]);
966
+ }
967
+ }
968
+ return result;
969
+ };
970
+ if ("conversion" in fn) {
971
+ wrappedFn.conversion = fn.conversion;
972
+ }
973
+ return wrappedFn;
974
+ }
975
+ models.forEach((fromModel) => {
976
+ convert[fromModel] = {};
977
+ Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
978
+ Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
979
+ const routes = route(fromModel);
980
+ const routeModels = Object.keys(routes);
981
+ routeModels.forEach((toModel) => {
982
+ const fn = routes[toModel];
983
+ convert[fromModel][toModel] = wrapRounded(fn);
984
+ convert[fromModel][toModel].raw = wrapRaw(fn);
985
+ });
986
+ });
987
+ module.exports = convert;
988
+ }
989
+ });
990
+
991
+ // ../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
992
+ var require_ansi_styles = __commonJS({
993
+ "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports, module) {
994
+ var __import_colorConvert = __toESM(require_color_convert());
995
+ var wrapAnsi16 = (fn, offset) => (...args) => {
996
+ const code = fn(...args);
997
+ return `\x1B[${code + offset}m`;
998
+ };
999
+ var wrapAnsi256 = (fn, offset) => (...args) => {
1000
+ const code = fn(...args);
1001
+ return `\x1B[${38 + offset};5;${code}m`;
1002
+ };
1003
+ var wrapAnsi16m = (fn, offset) => (...args) => {
1004
+ const rgb = fn(...args);
1005
+ return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
1006
+ };
1007
+ var ansi2ansi = (n) => n;
1008
+ var rgb2rgb = (r, g, b) => [r, g, b];
1009
+ var setLazyProperty = (object, property, get) => {
1010
+ Object.defineProperty(object, property, {
1011
+ get: () => {
1012
+ const value = get();
1013
+ Object.defineProperty(object, property, {
1014
+ value,
1015
+ enumerable: true,
1016
+ configurable: true
1017
+ });
1018
+ return value;
1019
+ },
1020
+ enumerable: true,
1021
+ configurable: true
1022
+ });
1023
+ };
1024
+ var colorConvert;
1025
+ var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1026
+ if (colorConvert === void 0) {
1027
+ colorConvert = __import_colorConvert;
1028
+ }
1029
+ const offset = isBackground ? 10 : 0;
1030
+ const styles = {};
1031
+ for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
1032
+ const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1033
+ if (sourceSpace === targetSpace) {
1034
+ styles[name] = wrap(identity, offset);
1035
+ } else if (typeof suite === "object") {
1036
+ styles[name] = wrap(suite[targetSpace], offset);
1037
+ }
1038
+ }
1039
+ return styles;
1040
+ };
1041
+ function assembleStyles() {
1042
+ const codes = /* @__PURE__ */ new Map();
1043
+ const styles = {
1044
+ modifier: {
1045
+ reset: [0, 0],
1046
+ // 21 isn't widely supported and 22 does the same thing
1047
+ bold: [1, 22],
1048
+ dim: [2, 22],
1049
+ italic: [3, 23],
1050
+ underline: [4, 24],
1051
+ inverse: [7, 27],
1052
+ hidden: [8, 28],
1053
+ strikethrough: [9, 29]
1054
+ },
1055
+ color: {
1056
+ black: [30, 39],
1057
+ red: [31, 39],
1058
+ green: [32, 39],
1059
+ yellow: [33, 39],
1060
+ blue: [34, 39],
1061
+ magenta: [35, 39],
1062
+ cyan: [36, 39],
1063
+ white: [37, 39],
1064
+ // Bright color
1065
+ blackBright: [90, 39],
1066
+ redBright: [91, 39],
1067
+ greenBright: [92, 39],
1068
+ yellowBright: [93, 39],
1069
+ blueBright: [94, 39],
1070
+ magentaBright: [95, 39],
1071
+ cyanBright: [96, 39],
1072
+ whiteBright: [97, 39]
1073
+ },
1074
+ bgColor: {
1075
+ bgBlack: [40, 49],
1076
+ bgRed: [41, 49],
1077
+ bgGreen: [42, 49],
1078
+ bgYellow: [43, 49],
1079
+ bgBlue: [44, 49],
1080
+ bgMagenta: [45, 49],
1081
+ bgCyan: [46, 49],
1082
+ bgWhite: [47, 49],
1083
+ // Bright color
1084
+ bgBlackBright: [100, 49],
1085
+ bgRedBright: [101, 49],
1086
+ bgGreenBright: [102, 49],
1087
+ bgYellowBright: [103, 49],
1088
+ bgBlueBright: [104, 49],
1089
+ bgMagentaBright: [105, 49],
1090
+ bgCyanBright: [106, 49],
1091
+ bgWhiteBright: [107, 49]
1092
+ }
1093
+ };
1094
+ styles.color.gray = styles.color.blackBright;
1095
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
1096
+ styles.color.grey = styles.color.blackBright;
1097
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
1098
+ for (const [groupName, group] of Object.entries(styles)) {
1099
+ for (const [styleName, style] of Object.entries(group)) {
1100
+ styles[styleName] = {
1101
+ open: `\x1B[${style[0]}m`,
1102
+ close: `\x1B[${style[1]}m`
1103
+ };
1104
+ group[styleName] = styles[styleName];
1105
+ codes.set(style[0], style[1]);
1106
+ }
1107
+ Object.defineProperty(styles, groupName, {
1108
+ value: group,
1109
+ enumerable: false
1110
+ });
1111
+ }
1112
+ Object.defineProperty(styles, "codes", {
1113
+ value: codes,
1114
+ enumerable: false
1115
+ });
1116
+ styles.color.close = "\x1B[39m";
1117
+ styles.bgColor.close = "\x1B[49m";
1118
+ setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
1119
+ setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
1120
+ setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
1121
+ setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
1122
+ setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
1123
+ setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
1124
+ return styles;
1125
+ }
1126
+ Object.defineProperty(module, "exports", {
1127
+ enumerable: true,
1128
+ get: assembleStyles
1129
+ });
1130
+ }
1131
+ });
1132
+
1133
+ // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
1134
+ var require_has_flag = __commonJS({
1135
+ "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
1136
+ "use strict";
1137
+ module.exports = (flag, argv = process.argv) => {
1138
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
1139
+ const position = argv.indexOf(prefix + flag);
1140
+ const terminatorPosition = argv.indexOf("--");
1141
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1142
+ };
1143
+ }
1144
+ });
1145
+
1146
+ // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
1147
+ import * as __import_os from "os";
1148
+ import * as __import_tty from "tty";
1149
+ var require_supports_color = __commonJS({
1150
+ "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
1151
+ var __import_hasFlag = __toESM(require_has_flag());
1152
+ var os = __import_os;
1153
+ var tty = __import_tty;
1154
+ var hasFlag = __import_hasFlag;
1155
+ var { env } = process;
1156
+ var forceColor;
1157
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
1158
+ forceColor = 0;
1159
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
1160
+ forceColor = 1;
1161
+ }
1162
+ if ("FORCE_COLOR" in env) {
1163
+ if (env.FORCE_COLOR === "true") {
1164
+ forceColor = 1;
1165
+ } else if (env.FORCE_COLOR === "false") {
1166
+ forceColor = 0;
1167
+ } else {
1168
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
1169
+ }
1170
+ }
1171
+ function translateLevel(level) {
1172
+ if (level === 0) {
1173
+ return false;
1174
+ }
1175
+ return {
1176
+ level,
1177
+ hasBasic: true,
1178
+ has256: level >= 2,
1179
+ has16m: level >= 3
1180
+ };
1181
+ }
1182
+ function supportsColor(haveStream, streamIsTTY) {
1183
+ if (forceColor === 0) {
1184
+ return 0;
1185
+ }
1186
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
1187
+ return 3;
1188
+ }
1189
+ if (hasFlag("color=256")) {
1190
+ return 2;
1191
+ }
1192
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
1193
+ return 0;
1194
+ }
1195
+ const min = forceColor || 0;
1196
+ if (env.TERM === "dumb") {
1197
+ return min;
1198
+ }
1199
+ if (process.platform === "win32") {
1200
+ const osRelease = os.release().split(".");
1201
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
1202
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
1203
+ }
1204
+ return 1;
1205
+ }
1206
+ if ("CI" in env) {
1207
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
1208
+ return 1;
1209
+ }
1210
+ return min;
1211
+ }
1212
+ if ("TEAMCITY_VERSION" in env) {
1213
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1214
+ }
1215
+ if (env.COLORTERM === "truecolor") {
1216
+ return 3;
1217
+ }
1218
+ if ("TERM_PROGRAM" in env) {
1219
+ const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1220
+ switch (env.TERM_PROGRAM) {
1221
+ case "iTerm.app":
1222
+ return version >= 3 ? 3 : 2;
1223
+ case "Apple_Terminal":
1224
+ return 2;
1225
+ }
1226
+ }
1227
+ if (/-256(color)?$/i.test(env.TERM)) {
1228
+ return 2;
1229
+ }
1230
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1231
+ return 1;
1232
+ }
1233
+ if ("COLORTERM" in env) {
1234
+ return 1;
1235
+ }
1236
+ return min;
1237
+ }
1238
+ function getSupportLevel(stream) {
1239
+ const level = supportsColor(stream, stream && stream.isTTY);
1240
+ return translateLevel(level);
1241
+ }
1242
+ module.exports = {
1243
+ supportsColor: getSupportLevel,
1244
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
1245
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
1246
+ };
1247
+ }
1248
+ });
1249
+
1250
+ // ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js
1251
+ var require_util = __commonJS({
1252
+ "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports, module) {
1253
+ "use strict";
1254
+ var stringReplaceAll = (string, substring, replacer) => {
1255
+ let index = string.indexOf(substring);
1256
+ if (index === -1) {
1257
+ return string;
1258
+ }
1259
+ const substringLength = substring.length;
1260
+ let endIndex = 0;
1261
+ let returnValue = "";
1262
+ do {
1263
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
1264
+ endIndex = index + substringLength;
1265
+ index = string.indexOf(substring, endIndex);
1266
+ } while (index !== -1);
1267
+ returnValue += string.substr(endIndex);
1268
+ return returnValue;
1269
+ };
1270
+ var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
1271
+ let endIndex = 0;
1272
+ let returnValue = "";
1273
+ do {
1274
+ const gotCR = string[index - 1] === "\r";
1275
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
1276
+ endIndex = index + 1;
1277
+ index = string.indexOf("\n", endIndex);
1278
+ } while (index !== -1);
1279
+ returnValue += string.substr(endIndex);
1280
+ return returnValue;
1281
+ };
1282
+ module.exports = {
1283
+ stringReplaceAll,
1284
+ stringEncaseCRLFWithFirstIndex
1285
+ };
1286
+ }
1287
+ });
1288
+
1289
+ // ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js
1290
+ var require_templates = __commonJS({
1291
+ "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports, module) {
1292
+ "use strict";
1293
+ var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
1294
+ var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
1295
+ var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
1296
+ var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
1297
+ var ESCAPES = /* @__PURE__ */ new Map([
1298
+ ["n", "\n"],
1299
+ ["r", "\r"],
1300
+ ["t", " "],
1301
+ ["b", "\b"],
1302
+ ["f", "\f"],
1303
+ ["v", "\v"],
1304
+ ["0", "\0"],
1305
+ ["\\", "\\"],
1306
+ ["e", "\x1B"],
1307
+ ["a", "\x07"]
1308
+ ]);
1309
+ function unescape(c) {
1310
+ const u = c[0] === "u";
1311
+ const bracket = c[1] === "{";
1312
+ if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
1313
+ return String.fromCharCode(parseInt(c.slice(1), 16));
1314
+ }
1315
+ if (u && bracket) {
1316
+ return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
1317
+ }
1318
+ return ESCAPES.get(c) || c;
1319
+ }
1320
+ function parseArguments(name, arguments_) {
1321
+ const results = [];
1322
+ const chunks = arguments_.trim().split(/\s*,\s*/g);
1323
+ let matches;
1324
+ for (const chunk of chunks) {
1325
+ const number = Number(chunk);
1326
+ if (!Number.isNaN(number)) {
1327
+ results.push(number);
1328
+ } else if (matches = chunk.match(STRING_REGEX)) {
1329
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
1330
+ } else {
1331
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
1332
+ }
1333
+ }
1334
+ return results;
1335
+ }
1336
+ function parseStyle(style) {
1337
+ STYLE_REGEX.lastIndex = 0;
1338
+ const results = [];
1339
+ let matches;
1340
+ while ((matches = STYLE_REGEX.exec(style)) !== null) {
1341
+ const name = matches[1];
1342
+ if (matches[2]) {
1343
+ const args = parseArguments(name, matches[2]);
1344
+ results.push([name].concat(args));
1345
+ } else {
1346
+ results.push([name]);
1347
+ }
1348
+ }
1349
+ return results;
1350
+ }
1351
+ function buildStyle(chalk2, styles) {
1352
+ const enabled = {};
1353
+ for (const layer of styles) {
1354
+ for (const style of layer.styles) {
1355
+ enabled[style[0]] = layer.inverse ? null : style.slice(1);
1356
+ }
1357
+ }
1358
+ let current = chalk2;
1359
+ for (const [styleName, styles2] of Object.entries(enabled)) {
1360
+ if (!Array.isArray(styles2)) {
1361
+ continue;
1362
+ }
1363
+ if (!(styleName in current)) {
1364
+ throw new Error(`Unknown Chalk style: ${styleName}`);
1365
+ }
1366
+ current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
1367
+ }
1368
+ return current;
1369
+ }
1370
+ module.exports = (chalk2, temporary) => {
1371
+ const styles = [];
1372
+ const chunks = [];
1373
+ let chunk = [];
1374
+ temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
1375
+ if (escapeCharacter) {
1376
+ chunk.push(unescape(escapeCharacter));
1377
+ } else if (style) {
1378
+ const string = chunk.join("");
1379
+ chunk = [];
1380
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
1381
+ styles.push({ inverse, styles: parseStyle(style) });
1382
+ } else if (close) {
1383
+ if (styles.length === 0) {
1384
+ throw new Error("Found extraneous } in Chalk template literal");
1385
+ }
1386
+ chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
1387
+ chunk = [];
1388
+ styles.pop();
1389
+ } else {
1390
+ chunk.push(character);
1391
+ }
1392
+ });
1393
+ chunks.push(chunk.join(""));
1394
+ if (styles.length > 0) {
1395
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
1396
+ throw new Error(errMessage);
1397
+ }
1398
+ return chunks.join("");
1399
+ };
1400
+ }
1401
+ });
1402
+
1403
+ // ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js
1404
+ var require_source = __commonJS({
1405
+ "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports, module) {
1406
+ var __import_ansiStyles = __toESM(require_ansi_styles());
1407
+ var __import_supportsColor = __toESM(require_supports_color());
1408
+ var __import___util = __toESM(require_util());
1409
+ var __import___templates = __toESM(require_templates());
1410
+ var ansiStyles = __import_ansiStyles;
1411
+ var { stdout: stdoutColor, stderr: stderrColor } = __import_supportsColor;
1412
+ var {
1413
+ stringReplaceAll,
1414
+ stringEncaseCRLFWithFirstIndex
1415
+ } = __import___util;
1416
+ var { isArray } = Array;
1417
+ var levelMapping = [
1418
+ "ansi",
1419
+ "ansi",
1420
+ "ansi256",
1421
+ "ansi16m"
1422
+ ];
1423
+ var styles = /* @__PURE__ */ Object.create(null);
1424
+ var applyOptions = (object, options = {}) => {
1425
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
1426
+ throw new Error("The `level` option should be an integer from 0 to 3");
1427
+ }
1428
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
1429
+ object.level = options.level === void 0 ? colorLevel : options.level;
1430
+ };
1431
+ var ChalkClass = class {
1432
+ constructor(options) {
1433
+ return chalkFactory(options);
1434
+ }
1435
+ };
1436
+ var chalkFactory = (options) => {
1437
+ const chalk3 = {};
1438
+ applyOptions(chalk3, options);
1439
+ chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
1440
+ Object.setPrototypeOf(chalk3, Chalk.prototype);
1441
+ Object.setPrototypeOf(chalk3.template, chalk3);
1442
+ chalk3.template.constructor = () => {
1443
+ throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
1444
+ };
1445
+ chalk3.template.Instance = ChalkClass;
1446
+ return chalk3.template;
1447
+ };
1448
+ function Chalk(options) {
1449
+ return chalkFactory(options);
1450
+ }
1451
+ for (const [styleName, style] of Object.entries(ansiStyles)) {
1452
+ styles[styleName] = {
1453
+ get() {
1454
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
1455
+ Object.defineProperty(this, styleName, { value: builder });
1456
+ return builder;
1457
+ }
1458
+ };
1459
+ }
1460
+ styles.visible = {
1461
+ get() {
1462
+ const builder = createBuilder(this, this._styler, true);
1463
+ Object.defineProperty(this, "visible", { value: builder });
1464
+ return builder;
1465
+ }
1466
+ };
1467
+ var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
1468
+ for (const model of usedModels) {
1469
+ styles[model] = {
1470
+ get() {
1471
+ const { level } = this;
1472
+ return function(...arguments_) {
1473
+ const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
1474
+ return createBuilder(this, styler, this._isEmpty);
1475
+ };
1476
+ }
1477
+ };
1478
+ }
1479
+ for (const model of usedModels) {
1480
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1481
+ styles[bgModel] = {
1482
+ get() {
1483
+ const { level } = this;
1484
+ return function(...arguments_) {
1485
+ const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
1486
+ return createBuilder(this, styler, this._isEmpty);
1487
+ };
1488
+ }
1489
+ };
1490
+ }
1491
+ var proto = Object.defineProperties(() => {
1492
+ }, {
1493
+ ...styles,
1494
+ level: {
1495
+ enumerable: true,
1496
+ get() {
1497
+ return this._generator.level;
1498
+ },
1499
+ set(level) {
1500
+ this._generator.level = level;
1501
+ }
1502
+ }
1503
+ });
1504
+ var createStyler = (open, close, parent) => {
1505
+ let openAll;
1506
+ let closeAll;
1507
+ if (parent === void 0) {
1508
+ openAll = open;
1509
+ closeAll = close;
1510
+ } else {
1511
+ openAll = parent.openAll + open;
1512
+ closeAll = close + parent.closeAll;
1513
+ }
1514
+ return {
1515
+ open,
1516
+ close,
1517
+ openAll,
1518
+ closeAll,
1519
+ parent
1520
+ };
1521
+ };
1522
+ var createBuilder = (self, _styler, _isEmpty) => {
1523
+ const builder = (...arguments_) => {
1524
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
1525
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
1526
+ }
1527
+ return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1528
+ };
1529
+ Object.setPrototypeOf(builder, proto);
1530
+ builder._generator = self;
1531
+ builder._styler = _styler;
1532
+ builder._isEmpty = _isEmpty;
1533
+ return builder;
1534
+ };
1535
+ var applyStyle = (self, string) => {
1536
+ if (self.level <= 0 || !string) {
1537
+ return self._isEmpty ? "" : string;
1538
+ }
1539
+ let styler = self._styler;
1540
+ if (styler === void 0) {
1541
+ return string;
1542
+ }
1543
+ const { openAll, closeAll } = styler;
1544
+ if (string.indexOf("\x1B") !== -1) {
1545
+ while (styler !== void 0) {
1546
+ string = stringReplaceAll(string, styler.close, styler.open);
1547
+ styler = styler.parent;
1548
+ }
1549
+ }
1550
+ const lfIndex = string.indexOf("\n");
1551
+ if (lfIndex !== -1) {
1552
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1553
+ }
1554
+ return openAll + string + closeAll;
1555
+ };
1556
+ var template;
1557
+ var chalkTag = (chalk3, ...strings) => {
1558
+ const [firstString] = strings;
1559
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
1560
+ return strings.join(" ");
1561
+ }
1562
+ const arguments_ = strings.slice(1);
1563
+ const parts = [firstString.raw[0]];
1564
+ for (let i = 1; i < firstString.length; i++) {
1565
+ parts.push(
1566
+ String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
1567
+ String(firstString.raw[i])
1568
+ );
1569
+ }
1570
+ if (template === void 0) {
1571
+ template = __import___templates;
1572
+ }
1573
+ return template(chalk3, parts.join(""));
1574
+ };
1575
+ Object.defineProperties(Chalk.prototype, styles);
1576
+ var chalk2 = Chalk();
1577
+ chalk2.supportsColor = stdoutColor;
1578
+ chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
1579
+ chalk2.stderr.supportsColor = stderrColor;
1580
+ module.exports = chalk2;
1581
+ }
1582
+ });
2
1583
 
3
1584
  // bin/pnpm.ts
4
1585
  import { getWorkspaceConfig as getWorkspaceConfig2 } from "@storm-software/config-tools/get-config";
@@ -12,24 +1593,276 @@ import {
12
1593
  // src/cli/index.ts
13
1594
  import {
14
1595
  findWorkspaceRootSafe,
15
- writeDebug as writeDebug2,
16
- writeFatal,
17
- writeInfo,
18
- writeSuccess,
19
- writeTrace as writeTrace2
1596
+ runAsync,
1597
+ writeDebug as writeDebug3,
1598
+ writeFatal as writeFatal2,
1599
+ writeInfo as writeInfo2,
1600
+ writeTrace as writeTrace3
20
1601
  } from "@storm-software/config-tools";
21
- import { Argument, Command } from "commander";
22
- import { exec } from "node:child_process";
1602
+ import { Argument, Command, Option } from "commander";
23
1603
 
24
1604
  // src/helpers/catalog.ts
25
1605
  import { getWorkspaceConfig } from "@storm-software/config-tools/get-config";
26
1606
  import {
27
- writeDebug,
28
- writeTrace
1607
+ writeDebug as writeDebug2,
1608
+ writeTrace as writeTrace2
29
1609
  } from "@storm-software/config-tools/logger/console";
30
1610
  import { findWorkspaceRoot as findWorkspaceRoot2 } from "@storm-software/config-tools/utilities/find-workspace-root";
31
1611
  import { DEFAULT_NPM_TAG } from "@storm-software/npm-tools/constants";
32
1612
  import { getVersion } from "@storm-software/npm-tools/helpers/get-version";
1613
+
1614
+ // ../config-tools/dist/chunk-LA3S35UI.js
1615
+ var DEFAULT_COLOR_CONFIG = {
1616
+ light: {
1617
+ background: "#fafafa",
1618
+ foreground: "#1d1e22",
1619
+ brand: "#1fb2a6",
1620
+ alternate: "#db2777",
1621
+ help: "#5C4EE5",
1622
+ success: "#087f5b",
1623
+ info: "#0550ae",
1624
+ warning: "#e3b341",
1625
+ danger: "#D8314A",
1626
+ fatal: "#51070f",
1627
+ link: "#3fa6ff",
1628
+ positive: "#22c55e",
1629
+ negative: "#dc2626",
1630
+ gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
1631
+ },
1632
+ dark: {
1633
+ background: "#1d1e22",
1634
+ foreground: "#cbd5e1",
1635
+ brand: "#2dd4bf",
1636
+ alternate: "#db2777",
1637
+ help: "#818cf8",
1638
+ success: "#10b981",
1639
+ info: "#58a6ff",
1640
+ warning: "#f3d371",
1641
+ danger: "#D8314A",
1642
+ fatal: "#a40e26",
1643
+ link: "#3fa6ff",
1644
+ positive: "#22c55e",
1645
+ negative: "#dc2626",
1646
+ gradient: ["#1fb2a6", "#db2777", "#818cf8"]
1647
+ }
1648
+ };
1649
+
1650
+ // ../config-tools/dist/chunk-HVVJHTFS.js
1651
+ var import_chalk = __toESM(require_source(), 1);
1652
+ var chalkDefault = {
1653
+ hex: (_) => (message) => message,
1654
+ bgHex: (_) => ({
1655
+ whiteBright: (message) => message,
1656
+ white: (message) => message
1657
+ }),
1658
+ white: (message) => message,
1659
+ whiteBright: (message) => message,
1660
+ gray: (message) => message,
1661
+ bold: {
1662
+ hex: (_) => (message) => message,
1663
+ bgHex: (_) => ({
1664
+ whiteBright: (message) => message,
1665
+ white: (message) => message
1666
+ }),
1667
+ whiteBright: (message) => message,
1668
+ white: (message) => message
1669
+ },
1670
+ dim: {
1671
+ hex: (_) => (message) => message,
1672
+ gray: (message) => message
1673
+ }
1674
+ };
1675
+ var getChalk = () => {
1676
+ let _chalk = import_chalk.default;
1677
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
1678
+ _chalk = chalkDefault;
1679
+ }
1680
+ return _chalk;
1681
+ };
1682
+
1683
+ // ../config-tools/dist/chunk-G2MK47WL.js
1684
+ function isUnicodeSupported() {
1685
+ if (process.platform !== "win32") {
1686
+ return process.env.TERM !== "linux";
1687
+ }
1688
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
1689
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
1690
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
1691
+ process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1692
+ }
1693
+
1694
+ // ../config-tools/dist/chunk-POXTJ6GF.js
1695
+ var LogLevel = {
1696
+ SILENT: 0,
1697
+ FATAL: 10,
1698
+ ERROR: 20,
1699
+ WARN: 30,
1700
+ SUCCESS: 35,
1701
+ INFO: 40,
1702
+ DEBUG: 60,
1703
+ TRACE: 70,
1704
+ ALL: 100
1705
+ };
1706
+ var LogLevelLabel = {
1707
+ SILENT: "silent",
1708
+ FATAL: "fatal",
1709
+ ERROR: "error",
1710
+ WARN: "warn",
1711
+ SUCCESS: "success",
1712
+ INFO: "info",
1713
+ DEBUG: "debug",
1714
+ TRACE: "trace",
1715
+ ALL: "all"
1716
+ };
1717
+
1718
+ // ../config-tools/dist/chunk-LM2UMGYA.js
1719
+ var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
1720
+ var CONSOLE_ICONS = {
1721
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
1722
+ [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
1723
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
1724
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
1725
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
1726
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
1727
+ [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
1728
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
1729
+ };
1730
+
1731
+ // ../config-tools/dist/chunk-CZ4IE2QN.js
1732
+ var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
1733
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
1734
+ };
1735
+
1736
+ // ../config-tools/dist/chunk-K4CDYUQR.js
1737
+ var getLogLevel = (label) => {
1738
+ switch (label) {
1739
+ case "all":
1740
+ return LogLevel.ALL;
1741
+ case "trace":
1742
+ return LogLevel.TRACE;
1743
+ case "debug":
1744
+ return LogLevel.DEBUG;
1745
+ case "info":
1746
+ return LogLevel.INFO;
1747
+ case "warn":
1748
+ return LogLevel.WARN;
1749
+ case "error":
1750
+ return LogLevel.ERROR;
1751
+ case "fatal":
1752
+ return LogLevel.FATAL;
1753
+ case "silent":
1754
+ return LogLevel.SILENT;
1755
+ default:
1756
+ return LogLevel.INFO;
1757
+ }
1758
+ };
1759
+
1760
+ // ../config-tools/dist/chunk-7L77OWOV.js
1761
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
1762
+ const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
1763
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
1764
+ if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
1765
+ return (_) => {
1766
+ };
1767
+ }
1768
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
1769
+ return (message) => {
1770
+ console.error(
1771
+ `
1772
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1773
+ `
1774
+ );
1775
+ };
1776
+ }
1777
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
1778
+ return (message) => {
1779
+ console.error(
1780
+ `
1781
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1782
+ `
1783
+ );
1784
+ };
1785
+ }
1786
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
1787
+ return (message) => {
1788
+ console.warn(
1789
+ `
1790
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1791
+ `
1792
+ );
1793
+ };
1794
+ }
1795
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
1796
+ return (message) => {
1797
+ console.info(
1798
+ `
1799
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1800
+ `
1801
+ );
1802
+ };
1803
+ }
1804
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
1805
+ return (message) => {
1806
+ console.info(
1807
+ `
1808
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1809
+ `
1810
+ );
1811
+ };
1812
+ }
1813
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
1814
+ return (message) => {
1815
+ console.debug(
1816
+ `
1817
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1818
+ `
1819
+ );
1820
+ };
1821
+ }
1822
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
1823
+ return (message) => {
1824
+ console.debug(
1825
+ `
1826
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1827
+ `
1828
+ );
1829
+ };
1830
+ }
1831
+ return (message) => {
1832
+ console.log(
1833
+ `
1834
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
1835
+ `
1836
+ );
1837
+ };
1838
+ };
1839
+ var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
1840
+ var MAX_DEPTH = 4;
1841
+ var formatLogMessage = (message, options = {}, depth = 0) => {
1842
+ if (depth > MAX_DEPTH) {
1843
+ return "<max depth>";
1844
+ }
1845
+ const prefix = options.prefix ?? "-";
1846
+ const skip = options.skip ?? [];
1847
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
1848
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
1849
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map(
1850
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
1851
+ message[key],
1852
+ { prefix: `${prefix}-`, skip },
1853
+ depth + 1
1854
+ ) : message[key]}`
1855
+ ).join("\n")}` : message;
1856
+ };
1857
+ var _isFunction = (value) => {
1858
+ try {
1859
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
1860
+ } catch {
1861
+ return false;
1862
+ }
1863
+ };
1864
+
1865
+ // src/helpers/catalog.ts
33
1866
  import { coerce, gt, valid } from "semver";
34
1867
 
35
1868
  // src/helpers/pnpm-workspace.ts
@@ -73,7 +1906,7 @@ async function getCatalogSafe(workspaceRoot = findWorkspaceRoot2(process.cwd()))
73
1906
  if (pnpmWorkspaceFile?.catalog) {
74
1907
  return Object.fromEntries(
75
1908
  Object.entries(pnpmWorkspaceFile.catalog).map(([key, value]) => {
76
- return [key, value.replaceAll(/^"/g, "").replaceAll(/"$/g, "")];
1909
+ return [key, value.replaceAll('"', "").replaceAll("'", "")];
77
1910
  })
78
1911
  );
79
1912
  } else {
@@ -102,7 +1935,7 @@ async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot2(process.cw
102
1935
  }
103
1936
  pnpmWorkspaceFile.catalog = Object.fromEntries(
104
1937
  Object.entries(catalog).map(([key, value]) => {
105
- return [key, `"${value}"`];
1938
+ return [key, value.replaceAll('"', "").replaceAll("'", "")];
106
1939
  })
107
1940
  );
108
1941
  await writePnpmWorkspaceFile(pnpmWorkspaceFile, workspaceRoot);
@@ -110,6 +1943,7 @@ async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot2(process.cw
110
1943
  async function upgradeCatalogPackage(packageName, options = {}) {
111
1944
  const {
112
1945
  tag = DEFAULT_NPM_TAG,
1946
+ prefix = "^",
113
1947
  throwIfMissingInCatalog = false,
114
1948
  workspaceRoot = findWorkspaceRoot2()
115
1949
  } = options;
@@ -127,27 +1961,32 @@ async function upgradeCatalogPackage(packageName, options = {}) {
127
1961
  )}`
128
1962
  );
129
1963
  }
130
- writeTrace(
1964
+ writeTrace2(
131
1965
  `Upgrading catalog entry for package "${packageName}" with tag "${tag}"`,
132
1966
  workspaceConfig
133
1967
  );
134
1968
  const version = await getVersion(packageName, tag);
135
1969
  if (!valid(coerce(catalog[packageName])) || coerce(catalog[packageName]) && coerce(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
136
1970
  gt(coerce(version), coerce(catalog[packageName]))) {
137
- catalog[packageName] = version;
1971
+ catalog[packageName] = `${prefix || ""}${version}`;
1972
+ writeDebug2(
1973
+ `Writing version ${version} to catalog for "${packageName}" package`,
1974
+ workspaceConfig
1975
+ );
1976
+ await setCatalog(catalog, workspaceRoot);
1977
+ } else {
1978
+ writeWarning(
1979
+ `The current version "${catalog[packageName]}" for package "${packageName}" is greater than or equal to the version "${version}" fetched from the npm registry with tag "${tag}". No update performed.`,
1980
+ workspaceConfig
1981
+ );
138
1982
  }
139
- writeDebug(
140
- `Writing version ${version} to catalog for "${packageName}" package`,
141
- workspaceConfig
142
- );
143
- await setCatalog(catalog, workspaceRoot);
144
1983
  }
145
1984
 
146
1985
  // src/cli/index.ts
147
1986
  var _config = {};
148
1987
  function createProgram(config) {
149
1988
  _config = config;
150
- writeInfo("\u26A1 Running the `storm-pnpm` command-line application", config);
1989
+ writeInfo2("\u26A1 Running the `storm-pnpm` command-line application", config);
151
1990
  const root = findWorkspaceRootSafe(_config.workspaceRoot || process.cwd());
152
1991
  process.env.STORM_WORKSPACE_ROOT ??= root;
153
1992
  process.env.NX_WORKSPACE_ROOT_PATH ??= root;
@@ -156,24 +1995,39 @@ function createProgram(config) {
156
1995
  }
157
1996
  const program = new Command("storm-pnpm");
158
1997
  program.version("1.0.0", "-v --version", "display CLI version");
159
- program.command("update").description("Update pnpm catalog dependency package version.").addArgument(
160
- new Argument(
161
- "<package-name>",
162
- "The package name/pattern to update the version for (e.g., @storm-software/config or @storm-software/ for all Storm packages)."
163
- )
164
- ).option(
165
- "--tag <tag>",
166
- 'The npm tag to use when fetching the latest version of the package (e.g., "latest", "next", etc.). Defaults to "latest".',
167
- "latest"
168
- ).action(updateAction);
1998
+ const packageNames = new Argument(
1999
+ "<package-names...>",
2000
+ "The package name/pattern to update the version for (e.g., @storm-software/config or @storm-software/ for all Storm packages)."
2001
+ );
2002
+ const prefix = new Option(
2003
+ "-p, --prefix <string>",
2004
+ `The version prefix to use when updating the package (e.g., "^", "~", or "1.2.3"). Defaults to "^".
2005
+ - Caret (^): The default prefix. It allows updates to the latest minor or patch version while staying within the same major version. Example: \u201C^1.2.3" allows updates to 1.3.0 or 1.2.4, but not 2.0.0.
2006
+ - Tilde (~): Allows updates to the latest patch version while staying within the same minor version. Example: \u201C~1.2.3" allows updates to 1.2.4 but not 1.3.0.
2007
+ - Exact (no prefix): Locks the dependency to a specific version. No updates are allowed. Example: 1.2.3 will only use 1.2.3.
2008
+ - Greater/Less Than (>, <, >=, <=): Specifies a range of acceptable versions. Example: \u201C>=1.2.3 <2.0.0" allows any version from 1.2.3 to 1.9.x.
2009
+ - Wildcard (*): Allows the most flexibility by accepting any version. Example: \u201C*2.4.6" allows any version.`
2010
+ ).choices(["^", "~", ">", "<", ">=", "<=", "*"]).default("^");
2011
+ const tag = new Option(
2012
+ "-t, --tag <string>",
2013
+ `The npm tag to use when fetching the latest version of the package (e.g., "latest", "next", etc.). Defaults to "latest".`
2014
+ ).default("latest");
2015
+ const install = new Option(
2016
+ "-i, --install",
2017
+ "Whether to install the package after updating the version."
2018
+ ).default(false);
2019
+ program.command("update").description("Update pnpm catalog dependency package version.").addArgument(packageNames).addOption(tag).addOption(install).addOption(prefix).action(updateAction);
169
2020
  return program;
170
2021
  }
171
- async function updateAction(packageName, {
172
- tag
2022
+ async function updateAction(packageNames, {
2023
+ tag,
2024
+ install = false,
2025
+ prefix = "^"
173
2026
  }) {
174
2027
  try {
175
- writeInfo(
176
- `\u26A1 Preparing to update the package version for ${packageName}.`,
2028
+ const packages = (Array.isArray(packageNames) ? packageNames : [packageNames.split(",")].flat()).map((p) => p.trim().replaceAll("*", ""));
2029
+ writeInfo2(
2030
+ `\u26A1 Preparing to update the package version for ${packages.join(", ")}.`,
177
2031
  _config
178
2032
  );
179
2033
  const catalog = await getCatalog();
@@ -182,54 +2036,43 @@ async function updateAction(packageName, {
182
2036
  "No catalog found in the pnpm-workspace.yaml file of the current workspace."
183
2037
  );
184
2038
  }
185
- writeTrace2(
186
- `Found catalog file with the following details:
2039
+ for (const pkg of packages) {
2040
+ const matchedPackages = Object.keys(catalog).filter(
2041
+ (p) => pkg.endsWith("/") ? p.startsWith(pkg) : p === pkg
2042
+ );
2043
+ if (matchedPackages.length === 0) {
2044
+ throw new Error(
2045
+ `No packages found in the catalog matching the name/pattern "${pkg}".`
2046
+ );
2047
+ }
2048
+ writeDebug3(
2049
+ `Found ${matchedPackages.length} matching packages in the catalog file:
187
2050
 
188
- ${JSON.stringify(
189
- catalog
190
- )}`,
191
- _config
192
- );
193
- const matchedPackages = Object.keys(catalog).filter(
194
- (pkg) => packageName.endsWith("/") ? pkg.startsWith(packageName) : pkg === packageName
195
- );
196
- if (matchedPackages.length === 0) {
197
- throw new Error(
198
- `No packages found in the catalog matching the name/pattern "${packageName}".`
2051
+ - ${matchedPackages.map((p) => `${p} (${catalog[p] || "unknown"})`).join("\n- ")}`,
2052
+ _config
2053
+ );
2054
+ await Promise.all(
2055
+ matchedPackages.map(
2056
+ (p) => upgradeCatalogPackage(p, {
2057
+ tag,
2058
+ throwIfMissingInCatalog: true,
2059
+ prefix
2060
+ })
2061
+ )
199
2062
  );
200
2063
  }
201
- writeDebug2(
202
- `Found ${matchedPackages.length} matching packages in the catalog file:
203
-
204
- - ${matchedPackages.map((pkg) => `${pkg} (${catalog[pkg] || "unknown"})`).join("\n- ")}`,
205
- _config
206
- );
207
- await Promise.all(
208
- matchedPackages.map(
209
- (pkg) => upgradeCatalogPackage(pkg, { tag, throwIfMissingInCatalog: true })
210
- )
211
- );
212
- writeTrace2(
213
- "Running `pnpm dedupe` to update local dependency versions",
214
- _config
215
- );
216
- await new Promise((resolve, reject) => {
217
- exec("pnpm dedupe", (error, stdout, stderr) => {
218
- if (error) {
219
- return reject(error);
220
- }
221
- if (stderr) {
222
- return reject(stderr);
223
- }
224
- return resolve(stdout.trim());
2064
+ if (install) {
2065
+ writeTrace3(
2066
+ "Running `pnpm install --no-frozen-lockfile` to update local dependency versions",
2067
+ _config
2068
+ );
2069
+ const proc = await runAsync(_config, "pnpm install --no-frozen-lockfile");
2070
+ proc.stdout?.on("data", (data) => {
2071
+ console.log(data.toString());
225
2072
  });
226
- });
227
- writeSuccess(
228
- `\u{1F389} Storm pnpm update processing completed successfully!`,
229
- _config
230
- );
2073
+ }
231
2074
  } catch (error) {
232
- writeFatal(
2075
+ writeFatal2(
233
2076
  `A fatal error occurred while running Storm pnpm update:
234
2077
 
235
2078
  ${JSON.stringify(