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