bumpp 7.2.0 → 8.2.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/LICENSE +1 -0
- package/README.md +7 -276
- package/bin/bumpp.js +3 -3
- package/dist/chunk-DW6HTJ47.mjs +2281 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1716 -286
- package/dist/cli/index.mjs +18 -119
- package/dist/index.d.ts +110 -1
- package/dist/index.js +1718 -177
- package/dist/index.mjs +5 -3
- package/package.json +36 -39
- package/dist/chunk-2TP63A7S.mjs +0 -741
package/dist/index.js
CHANGED
|
@@ -67,25 +67,1551 @@ var init_cjs_shims = __esm({
|
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
// node_modules/.pnpm/
|
|
71
|
-
var
|
|
72
|
-
"node_modules/.pnpm/
|
|
70
|
+
// node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
|
|
71
|
+
var require_color_name = __commonJS({
|
|
72
|
+
"node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports, module2) {
|
|
73
73
|
"use strict";
|
|
74
74
|
init_cjs_shims();
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
module2.exports = {
|
|
76
|
+
"aliceblue": [240, 248, 255],
|
|
77
|
+
"antiquewhite": [250, 235, 215],
|
|
78
|
+
"aqua": [0, 255, 255],
|
|
79
|
+
"aquamarine": [127, 255, 212],
|
|
80
|
+
"azure": [240, 255, 255],
|
|
81
|
+
"beige": [245, 245, 220],
|
|
82
|
+
"bisque": [255, 228, 196],
|
|
83
|
+
"black": [0, 0, 0],
|
|
84
|
+
"blanchedalmond": [255, 235, 205],
|
|
85
|
+
"blue": [0, 0, 255],
|
|
86
|
+
"blueviolet": [138, 43, 226],
|
|
87
|
+
"brown": [165, 42, 42],
|
|
88
|
+
"burlywood": [222, 184, 135],
|
|
89
|
+
"cadetblue": [95, 158, 160],
|
|
90
|
+
"chartreuse": [127, 255, 0],
|
|
91
|
+
"chocolate": [210, 105, 30],
|
|
92
|
+
"coral": [255, 127, 80],
|
|
93
|
+
"cornflowerblue": [100, 149, 237],
|
|
94
|
+
"cornsilk": [255, 248, 220],
|
|
95
|
+
"crimson": [220, 20, 60],
|
|
96
|
+
"cyan": [0, 255, 255],
|
|
97
|
+
"darkblue": [0, 0, 139],
|
|
98
|
+
"darkcyan": [0, 139, 139],
|
|
99
|
+
"darkgoldenrod": [184, 134, 11],
|
|
100
|
+
"darkgray": [169, 169, 169],
|
|
101
|
+
"darkgreen": [0, 100, 0],
|
|
102
|
+
"darkgrey": [169, 169, 169],
|
|
103
|
+
"darkkhaki": [189, 183, 107],
|
|
104
|
+
"darkmagenta": [139, 0, 139],
|
|
105
|
+
"darkolivegreen": [85, 107, 47],
|
|
106
|
+
"darkorange": [255, 140, 0],
|
|
107
|
+
"darkorchid": [153, 50, 204],
|
|
108
|
+
"darkred": [139, 0, 0],
|
|
109
|
+
"darksalmon": [233, 150, 122],
|
|
110
|
+
"darkseagreen": [143, 188, 143],
|
|
111
|
+
"darkslateblue": [72, 61, 139],
|
|
112
|
+
"darkslategray": [47, 79, 79],
|
|
113
|
+
"darkslategrey": [47, 79, 79],
|
|
114
|
+
"darkturquoise": [0, 206, 209],
|
|
115
|
+
"darkviolet": [148, 0, 211],
|
|
116
|
+
"deeppink": [255, 20, 147],
|
|
117
|
+
"deepskyblue": [0, 191, 255],
|
|
118
|
+
"dimgray": [105, 105, 105],
|
|
119
|
+
"dimgrey": [105, 105, 105],
|
|
120
|
+
"dodgerblue": [30, 144, 255],
|
|
121
|
+
"firebrick": [178, 34, 34],
|
|
122
|
+
"floralwhite": [255, 250, 240],
|
|
123
|
+
"forestgreen": [34, 139, 34],
|
|
124
|
+
"fuchsia": [255, 0, 255],
|
|
125
|
+
"gainsboro": [220, 220, 220],
|
|
126
|
+
"ghostwhite": [248, 248, 255],
|
|
127
|
+
"gold": [255, 215, 0],
|
|
128
|
+
"goldenrod": [218, 165, 32],
|
|
129
|
+
"gray": [128, 128, 128],
|
|
130
|
+
"green": [0, 128, 0],
|
|
131
|
+
"greenyellow": [173, 255, 47],
|
|
132
|
+
"grey": [128, 128, 128],
|
|
133
|
+
"honeydew": [240, 255, 240],
|
|
134
|
+
"hotpink": [255, 105, 180],
|
|
135
|
+
"indianred": [205, 92, 92],
|
|
136
|
+
"indigo": [75, 0, 130],
|
|
137
|
+
"ivory": [255, 255, 240],
|
|
138
|
+
"khaki": [240, 230, 140],
|
|
139
|
+
"lavender": [230, 230, 250],
|
|
140
|
+
"lavenderblush": [255, 240, 245],
|
|
141
|
+
"lawngreen": [124, 252, 0],
|
|
142
|
+
"lemonchiffon": [255, 250, 205],
|
|
143
|
+
"lightblue": [173, 216, 230],
|
|
144
|
+
"lightcoral": [240, 128, 128],
|
|
145
|
+
"lightcyan": [224, 255, 255],
|
|
146
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
147
|
+
"lightgray": [211, 211, 211],
|
|
148
|
+
"lightgreen": [144, 238, 144],
|
|
149
|
+
"lightgrey": [211, 211, 211],
|
|
150
|
+
"lightpink": [255, 182, 193],
|
|
151
|
+
"lightsalmon": [255, 160, 122],
|
|
152
|
+
"lightseagreen": [32, 178, 170],
|
|
153
|
+
"lightskyblue": [135, 206, 250],
|
|
154
|
+
"lightslategray": [119, 136, 153],
|
|
155
|
+
"lightslategrey": [119, 136, 153],
|
|
156
|
+
"lightsteelblue": [176, 196, 222],
|
|
157
|
+
"lightyellow": [255, 255, 224],
|
|
158
|
+
"lime": [0, 255, 0],
|
|
159
|
+
"limegreen": [50, 205, 50],
|
|
160
|
+
"linen": [250, 240, 230],
|
|
161
|
+
"magenta": [255, 0, 255],
|
|
162
|
+
"maroon": [128, 0, 0],
|
|
163
|
+
"mediumaquamarine": [102, 205, 170],
|
|
164
|
+
"mediumblue": [0, 0, 205],
|
|
165
|
+
"mediumorchid": [186, 85, 211],
|
|
166
|
+
"mediumpurple": [147, 112, 219],
|
|
167
|
+
"mediumseagreen": [60, 179, 113],
|
|
168
|
+
"mediumslateblue": [123, 104, 238],
|
|
169
|
+
"mediumspringgreen": [0, 250, 154],
|
|
170
|
+
"mediumturquoise": [72, 209, 204],
|
|
171
|
+
"mediumvioletred": [199, 21, 133],
|
|
172
|
+
"midnightblue": [25, 25, 112],
|
|
173
|
+
"mintcream": [245, 255, 250],
|
|
174
|
+
"mistyrose": [255, 228, 225],
|
|
175
|
+
"moccasin": [255, 228, 181],
|
|
176
|
+
"navajowhite": [255, 222, 173],
|
|
177
|
+
"navy": [0, 0, 128],
|
|
178
|
+
"oldlace": [253, 245, 230],
|
|
179
|
+
"olive": [128, 128, 0],
|
|
180
|
+
"olivedrab": [107, 142, 35],
|
|
181
|
+
"orange": [255, 165, 0],
|
|
182
|
+
"orangered": [255, 69, 0],
|
|
183
|
+
"orchid": [218, 112, 214],
|
|
184
|
+
"palegoldenrod": [238, 232, 170],
|
|
185
|
+
"palegreen": [152, 251, 152],
|
|
186
|
+
"paleturquoise": [175, 238, 238],
|
|
187
|
+
"palevioletred": [219, 112, 147],
|
|
188
|
+
"papayawhip": [255, 239, 213],
|
|
189
|
+
"peachpuff": [255, 218, 185],
|
|
190
|
+
"peru": [205, 133, 63],
|
|
191
|
+
"pink": [255, 192, 203],
|
|
192
|
+
"plum": [221, 160, 221],
|
|
193
|
+
"powderblue": [176, 224, 230],
|
|
194
|
+
"purple": [128, 0, 128],
|
|
195
|
+
"rebeccapurple": [102, 51, 153],
|
|
196
|
+
"red": [255, 0, 0],
|
|
197
|
+
"rosybrown": [188, 143, 143],
|
|
198
|
+
"royalblue": [65, 105, 225],
|
|
199
|
+
"saddlebrown": [139, 69, 19],
|
|
200
|
+
"salmon": [250, 128, 114],
|
|
201
|
+
"sandybrown": [244, 164, 96],
|
|
202
|
+
"seagreen": [46, 139, 87],
|
|
203
|
+
"seashell": [255, 245, 238],
|
|
204
|
+
"sienna": [160, 82, 45],
|
|
205
|
+
"silver": [192, 192, 192],
|
|
206
|
+
"skyblue": [135, 206, 235],
|
|
207
|
+
"slateblue": [106, 90, 205],
|
|
208
|
+
"slategray": [112, 128, 144],
|
|
209
|
+
"slategrey": [112, 128, 144],
|
|
210
|
+
"snow": [255, 250, 250],
|
|
211
|
+
"springgreen": [0, 255, 127],
|
|
212
|
+
"steelblue": [70, 130, 180],
|
|
213
|
+
"tan": [210, 180, 140],
|
|
214
|
+
"teal": [0, 128, 128],
|
|
215
|
+
"thistle": [216, 191, 216],
|
|
216
|
+
"tomato": [255, 99, 71],
|
|
217
|
+
"turquoise": [64, 224, 208],
|
|
218
|
+
"violet": [238, 130, 238],
|
|
219
|
+
"wheat": [245, 222, 179],
|
|
220
|
+
"white": [255, 255, 255],
|
|
221
|
+
"whitesmoke": [245, 245, 245],
|
|
222
|
+
"yellow": [255, 255, 0],
|
|
223
|
+
"yellowgreen": [154, 205, 50]
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js
|
|
229
|
+
var require_conversions = __commonJS({
|
|
230
|
+
"node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports, module2) {
|
|
231
|
+
init_cjs_shims();
|
|
232
|
+
var cssKeywords = require_color_name();
|
|
233
|
+
var reverseKeywords = {};
|
|
234
|
+
for (const key of Object.keys(cssKeywords)) {
|
|
235
|
+
reverseKeywords[cssKeywords[key]] = key;
|
|
236
|
+
}
|
|
237
|
+
var convert = {
|
|
238
|
+
rgb: { channels: 3, labels: "rgb" },
|
|
239
|
+
hsl: { channels: 3, labels: "hsl" },
|
|
240
|
+
hsv: { channels: 3, labels: "hsv" },
|
|
241
|
+
hwb: { channels: 3, labels: "hwb" },
|
|
242
|
+
cmyk: { channels: 4, labels: "cmyk" },
|
|
243
|
+
xyz: { channels: 3, labels: "xyz" },
|
|
244
|
+
lab: { channels: 3, labels: "lab" },
|
|
245
|
+
lch: { channels: 3, labels: "lch" },
|
|
246
|
+
hex: { channels: 1, labels: ["hex"] },
|
|
247
|
+
keyword: { channels: 1, labels: ["keyword"] },
|
|
248
|
+
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
249
|
+
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
250
|
+
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
251
|
+
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
252
|
+
gray: { channels: 1, labels: ["gray"] }
|
|
253
|
+
};
|
|
254
|
+
module2.exports = convert;
|
|
255
|
+
for (const model of Object.keys(convert)) {
|
|
256
|
+
if (!("channels" in convert[model])) {
|
|
257
|
+
throw new Error("missing channels property: " + model);
|
|
78
258
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return;
|
|
259
|
+
if (!("labels" in convert[model])) {
|
|
260
|
+
throw new Error("missing channel labels property: " + model);
|
|
82
261
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
262
|
+
if (convert[model].labels.length !== convert[model].channels) {
|
|
263
|
+
throw new Error("channel and label counts mismatch: " + model);
|
|
264
|
+
}
|
|
265
|
+
const { channels, labels } = convert[model];
|
|
266
|
+
delete convert[model].channels;
|
|
267
|
+
delete convert[model].labels;
|
|
268
|
+
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
269
|
+
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
270
|
+
}
|
|
271
|
+
convert.rgb.hsl = function(rgb) {
|
|
272
|
+
const r = rgb[0] / 255;
|
|
273
|
+
const g = rgb[1] / 255;
|
|
274
|
+
const b = rgb[2] / 255;
|
|
275
|
+
const min = Math.min(r, g, b);
|
|
276
|
+
const max = Math.max(r, g, b);
|
|
277
|
+
const delta = max - min;
|
|
278
|
+
let h;
|
|
279
|
+
let s;
|
|
280
|
+
if (max === min) {
|
|
281
|
+
h = 0;
|
|
282
|
+
} else if (r === max) {
|
|
283
|
+
h = (g - b) / delta;
|
|
284
|
+
} else if (g === max) {
|
|
285
|
+
h = 2 + (b - r) / delta;
|
|
286
|
+
} else if (b === max) {
|
|
287
|
+
h = 4 + (r - g) / delta;
|
|
288
|
+
}
|
|
289
|
+
h = Math.min(h * 60, 360);
|
|
290
|
+
if (h < 0) {
|
|
291
|
+
h += 360;
|
|
292
|
+
}
|
|
293
|
+
const l = (min + max) / 2;
|
|
294
|
+
if (max === min) {
|
|
295
|
+
s = 0;
|
|
296
|
+
} else if (l <= 0.5) {
|
|
297
|
+
s = delta / (max + min);
|
|
298
|
+
} else {
|
|
299
|
+
s = delta / (2 - max - min);
|
|
300
|
+
}
|
|
301
|
+
return [h, s * 100, l * 100];
|
|
302
|
+
};
|
|
303
|
+
convert.rgb.hsv = function(rgb) {
|
|
304
|
+
let rdif;
|
|
305
|
+
let gdif;
|
|
306
|
+
let bdif;
|
|
307
|
+
let h;
|
|
308
|
+
let s;
|
|
309
|
+
const r = rgb[0] / 255;
|
|
310
|
+
const g = rgb[1] / 255;
|
|
311
|
+
const b = rgb[2] / 255;
|
|
312
|
+
const v = Math.max(r, g, b);
|
|
313
|
+
const diff = v - Math.min(r, g, b);
|
|
314
|
+
const diffc = function(c) {
|
|
315
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
316
|
+
};
|
|
317
|
+
if (diff === 0) {
|
|
318
|
+
h = 0;
|
|
319
|
+
s = 0;
|
|
320
|
+
} else {
|
|
321
|
+
s = diff / v;
|
|
322
|
+
rdif = diffc(r);
|
|
323
|
+
gdif = diffc(g);
|
|
324
|
+
bdif = diffc(b);
|
|
325
|
+
if (r === v) {
|
|
326
|
+
h = bdif - gdif;
|
|
327
|
+
} else if (g === v) {
|
|
328
|
+
h = 1 / 3 + rdif - bdif;
|
|
329
|
+
} else if (b === v) {
|
|
330
|
+
h = 2 / 3 + gdif - rdif;
|
|
331
|
+
}
|
|
332
|
+
if (h < 0) {
|
|
333
|
+
h += 1;
|
|
334
|
+
} else if (h > 1) {
|
|
335
|
+
h -= 1;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return [
|
|
339
|
+
h * 360,
|
|
340
|
+
s * 100,
|
|
341
|
+
v * 100
|
|
342
|
+
];
|
|
343
|
+
};
|
|
344
|
+
convert.rgb.hwb = function(rgb) {
|
|
345
|
+
const r = rgb[0];
|
|
346
|
+
const g = rgb[1];
|
|
347
|
+
let b = rgb[2];
|
|
348
|
+
const h = convert.rgb.hsl(rgb)[0];
|
|
349
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
350
|
+
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
351
|
+
return [h, w * 100, b * 100];
|
|
352
|
+
};
|
|
353
|
+
convert.rgb.cmyk = function(rgb) {
|
|
354
|
+
const r = rgb[0] / 255;
|
|
355
|
+
const g = rgb[1] / 255;
|
|
356
|
+
const b = rgb[2] / 255;
|
|
357
|
+
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
358
|
+
const c = (1 - r - k) / (1 - k) || 0;
|
|
359
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
360
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
361
|
+
return [c * 100, m * 100, y * 100, k * 100];
|
|
362
|
+
};
|
|
363
|
+
function comparativeDistance(x, y) {
|
|
364
|
+
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
365
|
+
}
|
|
366
|
+
convert.rgb.keyword = function(rgb) {
|
|
367
|
+
const reversed = reverseKeywords[rgb];
|
|
368
|
+
if (reversed) {
|
|
369
|
+
return reversed;
|
|
370
|
+
}
|
|
371
|
+
let currentClosestDistance = Infinity;
|
|
372
|
+
let currentClosestKeyword;
|
|
373
|
+
for (const keyword of Object.keys(cssKeywords)) {
|
|
374
|
+
const value = cssKeywords[keyword];
|
|
375
|
+
const distance = comparativeDistance(rgb, value);
|
|
376
|
+
if (distance < currentClosestDistance) {
|
|
377
|
+
currentClosestDistance = distance;
|
|
378
|
+
currentClosestKeyword = keyword;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return currentClosestKeyword;
|
|
382
|
+
};
|
|
383
|
+
convert.keyword.rgb = function(keyword) {
|
|
384
|
+
return cssKeywords[keyword];
|
|
385
|
+
};
|
|
386
|
+
convert.rgb.xyz = function(rgb) {
|
|
387
|
+
let r = rgb[0] / 255;
|
|
388
|
+
let g = rgb[1] / 255;
|
|
389
|
+
let b = rgb[2] / 255;
|
|
390
|
+
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
391
|
+
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
392
|
+
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
393
|
+
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
394
|
+
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
395
|
+
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
396
|
+
return [x * 100, y * 100, z * 100];
|
|
397
|
+
};
|
|
398
|
+
convert.rgb.lab = function(rgb) {
|
|
399
|
+
const xyz = convert.rgb.xyz(rgb);
|
|
400
|
+
let x = xyz[0];
|
|
401
|
+
let y = xyz[1];
|
|
402
|
+
let z = xyz[2];
|
|
403
|
+
x /= 95.047;
|
|
404
|
+
y /= 100;
|
|
405
|
+
z /= 108.883;
|
|
406
|
+
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
407
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
408
|
+
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
409
|
+
const l = 116 * y - 16;
|
|
410
|
+
const a = 500 * (x - y);
|
|
411
|
+
const b = 200 * (y - z);
|
|
412
|
+
return [l, a, b];
|
|
413
|
+
};
|
|
414
|
+
convert.hsl.rgb = function(hsl) {
|
|
415
|
+
const h = hsl[0] / 360;
|
|
416
|
+
const s = hsl[1] / 100;
|
|
417
|
+
const l = hsl[2] / 100;
|
|
418
|
+
let t2;
|
|
419
|
+
let t3;
|
|
420
|
+
let val;
|
|
421
|
+
if (s === 0) {
|
|
422
|
+
val = l * 255;
|
|
423
|
+
return [val, val, val];
|
|
424
|
+
}
|
|
425
|
+
if (l < 0.5) {
|
|
426
|
+
t2 = l * (1 + s);
|
|
427
|
+
} else {
|
|
428
|
+
t2 = l + s - l * s;
|
|
429
|
+
}
|
|
430
|
+
const t1 = 2 * l - t2;
|
|
431
|
+
const rgb = [0, 0, 0];
|
|
432
|
+
for (let i = 0; i < 3; i++) {
|
|
433
|
+
t3 = h + 1 / 3 * -(i - 1);
|
|
434
|
+
if (t3 < 0) {
|
|
435
|
+
t3++;
|
|
436
|
+
}
|
|
437
|
+
if (t3 > 1) {
|
|
438
|
+
t3--;
|
|
439
|
+
}
|
|
440
|
+
if (6 * t3 < 1) {
|
|
441
|
+
val = t1 + (t2 - t1) * 6 * t3;
|
|
442
|
+
} else if (2 * t3 < 1) {
|
|
443
|
+
val = t2;
|
|
444
|
+
} else if (3 * t3 < 2) {
|
|
445
|
+
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
446
|
+
} else {
|
|
447
|
+
val = t1;
|
|
448
|
+
}
|
|
449
|
+
rgb[i] = val * 255;
|
|
450
|
+
}
|
|
451
|
+
return rgb;
|
|
452
|
+
};
|
|
453
|
+
convert.hsl.hsv = function(hsl) {
|
|
454
|
+
const h = hsl[0];
|
|
455
|
+
let s = hsl[1] / 100;
|
|
456
|
+
let l = hsl[2] / 100;
|
|
457
|
+
let smin = s;
|
|
458
|
+
const lmin = Math.max(l, 0.01);
|
|
459
|
+
l *= 2;
|
|
460
|
+
s *= l <= 1 ? l : 2 - l;
|
|
461
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
462
|
+
const v = (l + s) / 2;
|
|
463
|
+
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
464
|
+
return [h, sv * 100, v * 100];
|
|
465
|
+
};
|
|
466
|
+
convert.hsv.rgb = function(hsv) {
|
|
467
|
+
const h = hsv[0] / 60;
|
|
468
|
+
const s = hsv[1] / 100;
|
|
469
|
+
let v = hsv[2] / 100;
|
|
470
|
+
const hi = Math.floor(h) % 6;
|
|
471
|
+
const f = h - Math.floor(h);
|
|
472
|
+
const p = 255 * v * (1 - s);
|
|
473
|
+
const q = 255 * v * (1 - s * f);
|
|
474
|
+
const t = 255 * v * (1 - s * (1 - f));
|
|
475
|
+
v *= 255;
|
|
476
|
+
switch (hi) {
|
|
477
|
+
case 0:
|
|
478
|
+
return [v, t, p];
|
|
479
|
+
case 1:
|
|
480
|
+
return [q, v, p];
|
|
481
|
+
case 2:
|
|
482
|
+
return [p, v, t];
|
|
483
|
+
case 3:
|
|
484
|
+
return [p, q, v];
|
|
485
|
+
case 4:
|
|
486
|
+
return [t, p, v];
|
|
487
|
+
case 5:
|
|
488
|
+
return [v, p, q];
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
convert.hsv.hsl = function(hsv) {
|
|
492
|
+
const h = hsv[0];
|
|
493
|
+
const s = hsv[1] / 100;
|
|
494
|
+
const v = hsv[2] / 100;
|
|
495
|
+
const vmin = Math.max(v, 0.01);
|
|
496
|
+
let sl;
|
|
497
|
+
let l;
|
|
498
|
+
l = (2 - s) * v;
|
|
499
|
+
const lmin = (2 - s) * vmin;
|
|
500
|
+
sl = s * vmin;
|
|
501
|
+
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
502
|
+
sl = sl || 0;
|
|
503
|
+
l /= 2;
|
|
504
|
+
return [h, sl * 100, l * 100];
|
|
505
|
+
};
|
|
506
|
+
convert.hwb.rgb = function(hwb) {
|
|
507
|
+
const h = hwb[0] / 360;
|
|
508
|
+
let wh = hwb[1] / 100;
|
|
509
|
+
let bl = hwb[2] / 100;
|
|
510
|
+
const ratio = wh + bl;
|
|
511
|
+
let f;
|
|
512
|
+
if (ratio > 1) {
|
|
513
|
+
wh /= ratio;
|
|
514
|
+
bl /= ratio;
|
|
515
|
+
}
|
|
516
|
+
const i = Math.floor(6 * h);
|
|
517
|
+
const v = 1 - bl;
|
|
518
|
+
f = 6 * h - i;
|
|
519
|
+
if ((i & 1) !== 0) {
|
|
520
|
+
f = 1 - f;
|
|
521
|
+
}
|
|
522
|
+
const n = wh + f * (v - wh);
|
|
523
|
+
let r;
|
|
524
|
+
let g;
|
|
525
|
+
let b;
|
|
526
|
+
switch (i) {
|
|
527
|
+
default:
|
|
528
|
+
case 6:
|
|
529
|
+
case 0:
|
|
530
|
+
r = v;
|
|
531
|
+
g = n;
|
|
532
|
+
b = wh;
|
|
533
|
+
break;
|
|
534
|
+
case 1:
|
|
535
|
+
r = n;
|
|
536
|
+
g = v;
|
|
537
|
+
b = wh;
|
|
538
|
+
break;
|
|
539
|
+
case 2:
|
|
540
|
+
r = wh;
|
|
541
|
+
g = v;
|
|
542
|
+
b = n;
|
|
543
|
+
break;
|
|
544
|
+
case 3:
|
|
545
|
+
r = wh;
|
|
546
|
+
g = n;
|
|
547
|
+
b = v;
|
|
548
|
+
break;
|
|
549
|
+
case 4:
|
|
550
|
+
r = n;
|
|
551
|
+
g = wh;
|
|
552
|
+
b = v;
|
|
553
|
+
break;
|
|
554
|
+
case 5:
|
|
555
|
+
r = v;
|
|
556
|
+
g = wh;
|
|
557
|
+
b = n;
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
return [r * 255, g * 255, b * 255];
|
|
561
|
+
};
|
|
562
|
+
convert.cmyk.rgb = function(cmyk) {
|
|
563
|
+
const c = cmyk[0] / 100;
|
|
564
|
+
const m = cmyk[1] / 100;
|
|
565
|
+
const y = cmyk[2] / 100;
|
|
566
|
+
const k = cmyk[3] / 100;
|
|
567
|
+
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
568
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
569
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
570
|
+
return [r * 255, g * 255, b * 255];
|
|
571
|
+
};
|
|
572
|
+
convert.xyz.rgb = function(xyz) {
|
|
573
|
+
const x = xyz[0] / 100;
|
|
574
|
+
const y = xyz[1] / 100;
|
|
575
|
+
const z = xyz[2] / 100;
|
|
576
|
+
let r;
|
|
577
|
+
let g;
|
|
578
|
+
let b;
|
|
579
|
+
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
580
|
+
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
581
|
+
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
582
|
+
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
583
|
+
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
584
|
+
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
585
|
+
r = Math.min(Math.max(0, r), 1);
|
|
586
|
+
g = Math.min(Math.max(0, g), 1);
|
|
587
|
+
b = Math.min(Math.max(0, b), 1);
|
|
588
|
+
return [r * 255, g * 255, b * 255];
|
|
589
|
+
};
|
|
590
|
+
convert.xyz.lab = function(xyz) {
|
|
591
|
+
let x = xyz[0];
|
|
592
|
+
let y = xyz[1];
|
|
593
|
+
let z = xyz[2];
|
|
594
|
+
x /= 95.047;
|
|
595
|
+
y /= 100;
|
|
596
|
+
z /= 108.883;
|
|
597
|
+
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
598
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
599
|
+
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
600
|
+
const l = 116 * y - 16;
|
|
601
|
+
const a = 500 * (x - y);
|
|
602
|
+
const b = 200 * (y - z);
|
|
603
|
+
return [l, a, b];
|
|
604
|
+
};
|
|
605
|
+
convert.lab.xyz = function(lab) {
|
|
606
|
+
const l = lab[0];
|
|
607
|
+
const a = lab[1];
|
|
608
|
+
const b = lab[2];
|
|
609
|
+
let x;
|
|
610
|
+
let y;
|
|
611
|
+
let z;
|
|
612
|
+
y = (l + 16) / 116;
|
|
613
|
+
x = a / 500 + y;
|
|
614
|
+
z = y - b / 200;
|
|
615
|
+
const y2 = y ** 3;
|
|
616
|
+
const x2 = x ** 3;
|
|
617
|
+
const z2 = z ** 3;
|
|
618
|
+
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
619
|
+
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
620
|
+
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
621
|
+
x *= 95.047;
|
|
622
|
+
y *= 100;
|
|
623
|
+
z *= 108.883;
|
|
624
|
+
return [x, y, z];
|
|
625
|
+
};
|
|
626
|
+
convert.lab.lch = function(lab) {
|
|
627
|
+
const l = lab[0];
|
|
628
|
+
const a = lab[1];
|
|
629
|
+
const b = lab[2];
|
|
630
|
+
let h;
|
|
631
|
+
const hr = Math.atan2(b, a);
|
|
632
|
+
h = hr * 360 / 2 / Math.PI;
|
|
633
|
+
if (h < 0) {
|
|
634
|
+
h += 360;
|
|
635
|
+
}
|
|
636
|
+
const c = Math.sqrt(a * a + b * b);
|
|
637
|
+
return [l, c, h];
|
|
638
|
+
};
|
|
639
|
+
convert.lch.lab = function(lch) {
|
|
640
|
+
const l = lch[0];
|
|
641
|
+
const c = lch[1];
|
|
642
|
+
const h = lch[2];
|
|
643
|
+
const hr = h / 360 * 2 * Math.PI;
|
|
644
|
+
const a = c * Math.cos(hr);
|
|
645
|
+
const b = c * Math.sin(hr);
|
|
646
|
+
return [l, a, b];
|
|
647
|
+
};
|
|
648
|
+
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
649
|
+
const [r, g, b] = args;
|
|
650
|
+
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
651
|
+
value = Math.round(value / 50);
|
|
652
|
+
if (value === 0) {
|
|
653
|
+
return 30;
|
|
654
|
+
}
|
|
655
|
+
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
656
|
+
if (value === 2) {
|
|
657
|
+
ansi += 60;
|
|
658
|
+
}
|
|
659
|
+
return ansi;
|
|
660
|
+
};
|
|
661
|
+
convert.hsv.ansi16 = function(args) {
|
|
662
|
+
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
663
|
+
};
|
|
664
|
+
convert.rgb.ansi256 = function(args) {
|
|
665
|
+
const r = args[0];
|
|
666
|
+
const g = args[1];
|
|
667
|
+
const b = args[2];
|
|
668
|
+
if (r === g && g === b) {
|
|
669
|
+
if (r < 8) {
|
|
670
|
+
return 16;
|
|
671
|
+
}
|
|
672
|
+
if (r > 248) {
|
|
673
|
+
return 231;
|
|
674
|
+
}
|
|
675
|
+
return Math.round((r - 8) / 247 * 24) + 232;
|
|
676
|
+
}
|
|
677
|
+
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
678
|
+
return ansi;
|
|
679
|
+
};
|
|
680
|
+
convert.ansi16.rgb = function(args) {
|
|
681
|
+
let color = args % 10;
|
|
682
|
+
if (color === 0 || color === 7) {
|
|
683
|
+
if (args > 50) {
|
|
684
|
+
color += 3.5;
|
|
685
|
+
}
|
|
686
|
+
color = color / 10.5 * 255;
|
|
687
|
+
return [color, color, color];
|
|
688
|
+
}
|
|
689
|
+
const mult = (~~(args > 50) + 1) * 0.5;
|
|
690
|
+
const r = (color & 1) * mult * 255;
|
|
691
|
+
const g = (color >> 1 & 1) * mult * 255;
|
|
692
|
+
const b = (color >> 2 & 1) * mult * 255;
|
|
693
|
+
return [r, g, b];
|
|
694
|
+
};
|
|
695
|
+
convert.ansi256.rgb = function(args) {
|
|
696
|
+
if (args >= 232) {
|
|
697
|
+
const c = (args - 232) * 10 + 8;
|
|
698
|
+
return [c, c, c];
|
|
699
|
+
}
|
|
700
|
+
args -= 16;
|
|
701
|
+
let rem;
|
|
702
|
+
const r = Math.floor(args / 36) / 5 * 255;
|
|
703
|
+
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
704
|
+
const b = rem % 6 / 5 * 255;
|
|
705
|
+
return [r, g, b];
|
|
706
|
+
};
|
|
707
|
+
convert.rgb.hex = function(args) {
|
|
708
|
+
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
709
|
+
const string = integer.toString(16).toUpperCase();
|
|
710
|
+
return "000000".substring(string.length) + string;
|
|
711
|
+
};
|
|
712
|
+
convert.hex.rgb = function(args) {
|
|
713
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
714
|
+
if (!match) {
|
|
715
|
+
return [0, 0, 0];
|
|
716
|
+
}
|
|
717
|
+
let colorString = match[0];
|
|
718
|
+
if (match[0].length === 3) {
|
|
719
|
+
colorString = colorString.split("").map((char) => {
|
|
720
|
+
return char + char;
|
|
721
|
+
}).join("");
|
|
722
|
+
}
|
|
723
|
+
const integer = parseInt(colorString, 16);
|
|
724
|
+
const r = integer >> 16 & 255;
|
|
725
|
+
const g = integer >> 8 & 255;
|
|
726
|
+
const b = integer & 255;
|
|
727
|
+
return [r, g, b];
|
|
728
|
+
};
|
|
729
|
+
convert.rgb.hcg = function(rgb) {
|
|
730
|
+
const r = rgb[0] / 255;
|
|
731
|
+
const g = rgb[1] / 255;
|
|
732
|
+
const b = rgb[2] / 255;
|
|
733
|
+
const max = Math.max(Math.max(r, g), b);
|
|
734
|
+
const min = Math.min(Math.min(r, g), b);
|
|
735
|
+
const chroma = max - min;
|
|
736
|
+
let grayscale;
|
|
737
|
+
let hue;
|
|
738
|
+
if (chroma < 1) {
|
|
739
|
+
grayscale = min / (1 - chroma);
|
|
740
|
+
} else {
|
|
741
|
+
grayscale = 0;
|
|
742
|
+
}
|
|
743
|
+
if (chroma <= 0) {
|
|
744
|
+
hue = 0;
|
|
745
|
+
} else if (max === r) {
|
|
746
|
+
hue = (g - b) / chroma % 6;
|
|
747
|
+
} else if (max === g) {
|
|
748
|
+
hue = 2 + (b - r) / chroma;
|
|
749
|
+
} else {
|
|
750
|
+
hue = 4 + (r - g) / chroma;
|
|
751
|
+
}
|
|
752
|
+
hue /= 6;
|
|
753
|
+
hue %= 1;
|
|
754
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
755
|
+
};
|
|
756
|
+
convert.hsl.hcg = function(hsl) {
|
|
757
|
+
const s = hsl[1] / 100;
|
|
758
|
+
const l = hsl[2] / 100;
|
|
759
|
+
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
760
|
+
let f = 0;
|
|
761
|
+
if (c < 1) {
|
|
762
|
+
f = (l - 0.5 * c) / (1 - c);
|
|
763
|
+
}
|
|
764
|
+
return [hsl[0], c * 100, f * 100];
|
|
765
|
+
};
|
|
766
|
+
convert.hsv.hcg = function(hsv) {
|
|
767
|
+
const s = hsv[1] / 100;
|
|
768
|
+
const v = hsv[2] / 100;
|
|
769
|
+
const c = s * v;
|
|
770
|
+
let f = 0;
|
|
771
|
+
if (c < 1) {
|
|
772
|
+
f = (v - c) / (1 - c);
|
|
773
|
+
}
|
|
774
|
+
return [hsv[0], c * 100, f * 100];
|
|
775
|
+
};
|
|
776
|
+
convert.hcg.rgb = function(hcg) {
|
|
777
|
+
const h = hcg[0] / 360;
|
|
778
|
+
const c = hcg[1] / 100;
|
|
779
|
+
const g = hcg[2] / 100;
|
|
780
|
+
if (c === 0) {
|
|
781
|
+
return [g * 255, g * 255, g * 255];
|
|
782
|
+
}
|
|
783
|
+
const pure = [0, 0, 0];
|
|
784
|
+
const hi = h % 1 * 6;
|
|
785
|
+
const v = hi % 1;
|
|
786
|
+
const w = 1 - v;
|
|
787
|
+
let mg = 0;
|
|
788
|
+
switch (Math.floor(hi)) {
|
|
789
|
+
case 0:
|
|
790
|
+
pure[0] = 1;
|
|
791
|
+
pure[1] = v;
|
|
792
|
+
pure[2] = 0;
|
|
793
|
+
break;
|
|
794
|
+
case 1:
|
|
795
|
+
pure[0] = w;
|
|
796
|
+
pure[1] = 1;
|
|
797
|
+
pure[2] = 0;
|
|
798
|
+
break;
|
|
799
|
+
case 2:
|
|
800
|
+
pure[0] = 0;
|
|
801
|
+
pure[1] = 1;
|
|
802
|
+
pure[2] = v;
|
|
803
|
+
break;
|
|
804
|
+
case 3:
|
|
805
|
+
pure[0] = 0;
|
|
806
|
+
pure[1] = w;
|
|
807
|
+
pure[2] = 1;
|
|
808
|
+
break;
|
|
809
|
+
case 4:
|
|
810
|
+
pure[0] = v;
|
|
811
|
+
pure[1] = 0;
|
|
812
|
+
pure[2] = 1;
|
|
813
|
+
break;
|
|
814
|
+
default:
|
|
815
|
+
pure[0] = 1;
|
|
816
|
+
pure[1] = 0;
|
|
817
|
+
pure[2] = w;
|
|
818
|
+
}
|
|
819
|
+
mg = (1 - c) * g;
|
|
820
|
+
return [
|
|
821
|
+
(c * pure[0] + mg) * 255,
|
|
822
|
+
(c * pure[1] + mg) * 255,
|
|
823
|
+
(c * pure[2] + mg) * 255
|
|
824
|
+
];
|
|
825
|
+
};
|
|
826
|
+
convert.hcg.hsv = function(hcg) {
|
|
827
|
+
const c = hcg[1] / 100;
|
|
828
|
+
const g = hcg[2] / 100;
|
|
829
|
+
const v = c + g * (1 - c);
|
|
830
|
+
let f = 0;
|
|
831
|
+
if (v > 0) {
|
|
832
|
+
f = c / v;
|
|
833
|
+
}
|
|
834
|
+
return [hcg[0], f * 100, v * 100];
|
|
835
|
+
};
|
|
836
|
+
convert.hcg.hsl = function(hcg) {
|
|
837
|
+
const c = hcg[1] / 100;
|
|
838
|
+
const g = hcg[2] / 100;
|
|
839
|
+
const l = g * (1 - c) + 0.5 * c;
|
|
840
|
+
let s = 0;
|
|
841
|
+
if (l > 0 && l < 0.5) {
|
|
842
|
+
s = c / (2 * l);
|
|
843
|
+
} else if (l >= 0.5 && l < 1) {
|
|
844
|
+
s = c / (2 * (1 - l));
|
|
845
|
+
}
|
|
846
|
+
return [hcg[0], s * 100, l * 100];
|
|
847
|
+
};
|
|
848
|
+
convert.hcg.hwb = function(hcg) {
|
|
849
|
+
const c = hcg[1] / 100;
|
|
850
|
+
const g = hcg[2] / 100;
|
|
851
|
+
const v = c + g * (1 - c);
|
|
852
|
+
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
853
|
+
};
|
|
854
|
+
convert.hwb.hcg = function(hwb) {
|
|
855
|
+
const w = hwb[1] / 100;
|
|
856
|
+
const b = hwb[2] / 100;
|
|
857
|
+
const v = 1 - b;
|
|
858
|
+
const c = v - w;
|
|
859
|
+
let g = 0;
|
|
860
|
+
if (c < 1) {
|
|
861
|
+
g = (v - c) / (1 - c);
|
|
862
|
+
}
|
|
863
|
+
return [hwb[0], c * 100, g * 100];
|
|
864
|
+
};
|
|
865
|
+
convert.apple.rgb = function(apple) {
|
|
866
|
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
867
|
+
};
|
|
868
|
+
convert.rgb.apple = function(rgb) {
|
|
869
|
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
870
|
+
};
|
|
871
|
+
convert.gray.rgb = function(args) {
|
|
872
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
873
|
+
};
|
|
874
|
+
convert.gray.hsl = function(args) {
|
|
875
|
+
return [0, 0, args[0]];
|
|
876
|
+
};
|
|
877
|
+
convert.gray.hsv = convert.gray.hsl;
|
|
878
|
+
convert.gray.hwb = function(gray) {
|
|
879
|
+
return [0, 100, gray[0]];
|
|
880
|
+
};
|
|
881
|
+
convert.gray.cmyk = function(gray) {
|
|
882
|
+
return [0, 0, 0, gray[0]];
|
|
883
|
+
};
|
|
884
|
+
convert.gray.lab = function(gray) {
|
|
885
|
+
return [gray[0], 0, 0];
|
|
886
|
+
};
|
|
887
|
+
convert.gray.hex = function(gray) {
|
|
888
|
+
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
889
|
+
const integer = (val << 16) + (val << 8) + val;
|
|
890
|
+
const string = integer.toString(16).toUpperCase();
|
|
891
|
+
return "000000".substring(string.length) + string;
|
|
892
|
+
};
|
|
893
|
+
convert.rgb.gray = function(rgb) {
|
|
894
|
+
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
895
|
+
return [val / 255 * 100];
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
// node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
|
|
901
|
+
var require_route = __commonJS({
|
|
902
|
+
"node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports, module2) {
|
|
903
|
+
init_cjs_shims();
|
|
904
|
+
var conversions = require_conversions();
|
|
905
|
+
function buildGraph() {
|
|
906
|
+
const graph = {};
|
|
907
|
+
const models = Object.keys(conversions);
|
|
908
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
909
|
+
graph[models[i]] = {
|
|
910
|
+
distance: -1,
|
|
911
|
+
parent: null
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
return graph;
|
|
915
|
+
}
|
|
916
|
+
function deriveBFS(fromModel) {
|
|
917
|
+
const graph = buildGraph();
|
|
918
|
+
const queue = [fromModel];
|
|
919
|
+
graph[fromModel].distance = 0;
|
|
920
|
+
while (queue.length) {
|
|
921
|
+
const current = queue.pop();
|
|
922
|
+
const adjacents = Object.keys(conversions[current]);
|
|
923
|
+
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
924
|
+
const adjacent = adjacents[i];
|
|
925
|
+
const node = graph[adjacent];
|
|
926
|
+
if (node.distance === -1) {
|
|
927
|
+
node.distance = graph[current].distance + 1;
|
|
928
|
+
node.parent = current;
|
|
929
|
+
queue.unshift(adjacent);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
return graph;
|
|
934
|
+
}
|
|
935
|
+
function link(from, to) {
|
|
936
|
+
return function(args) {
|
|
937
|
+
return to(from(args));
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
function wrapConversion(toModel, graph) {
|
|
941
|
+
const path3 = [graph[toModel].parent, toModel];
|
|
942
|
+
let fn = conversions[graph[toModel].parent][toModel];
|
|
943
|
+
let cur = graph[toModel].parent;
|
|
944
|
+
while (graph[cur].parent) {
|
|
945
|
+
path3.unshift(graph[cur].parent);
|
|
946
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
947
|
+
cur = graph[cur].parent;
|
|
948
|
+
}
|
|
949
|
+
fn.conversion = path3;
|
|
950
|
+
return fn;
|
|
951
|
+
}
|
|
952
|
+
module2.exports = function(fromModel) {
|
|
953
|
+
const graph = deriveBFS(fromModel);
|
|
954
|
+
const conversion = {};
|
|
955
|
+
const models = Object.keys(graph);
|
|
956
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
957
|
+
const toModel = models[i];
|
|
958
|
+
const node = graph[toModel];
|
|
959
|
+
if (node.parent === null) {
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
963
|
+
}
|
|
964
|
+
return conversion;
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
|
|
969
|
+
// node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js
|
|
970
|
+
var require_color_convert = __commonJS({
|
|
971
|
+
"node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports, module2) {
|
|
972
|
+
init_cjs_shims();
|
|
973
|
+
var conversions = require_conversions();
|
|
974
|
+
var route = require_route();
|
|
975
|
+
var convert = {};
|
|
976
|
+
var models = Object.keys(conversions);
|
|
977
|
+
function wrapRaw(fn) {
|
|
978
|
+
const wrappedFn = function(...args) {
|
|
979
|
+
const arg0 = args[0];
|
|
980
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
981
|
+
return arg0;
|
|
982
|
+
}
|
|
983
|
+
if (arg0.length > 1) {
|
|
984
|
+
args = arg0;
|
|
985
|
+
}
|
|
986
|
+
return fn(args);
|
|
987
|
+
};
|
|
988
|
+
if ("conversion" in fn) {
|
|
989
|
+
wrappedFn.conversion = fn.conversion;
|
|
990
|
+
}
|
|
991
|
+
return wrappedFn;
|
|
992
|
+
}
|
|
993
|
+
function wrapRounded(fn) {
|
|
994
|
+
const wrappedFn = function(...args) {
|
|
995
|
+
const arg0 = args[0];
|
|
996
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
997
|
+
return arg0;
|
|
998
|
+
}
|
|
999
|
+
if (arg0.length > 1) {
|
|
1000
|
+
args = arg0;
|
|
1001
|
+
}
|
|
1002
|
+
const result = fn(args);
|
|
1003
|
+
if (typeof result === "object") {
|
|
1004
|
+
for (let len = result.length, i = 0; i < len; i++) {
|
|
1005
|
+
result[i] = Math.round(result[i]);
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return result;
|
|
1009
|
+
};
|
|
1010
|
+
if ("conversion" in fn) {
|
|
1011
|
+
wrappedFn.conversion = fn.conversion;
|
|
1012
|
+
}
|
|
1013
|
+
return wrappedFn;
|
|
1014
|
+
}
|
|
1015
|
+
models.forEach((fromModel) => {
|
|
1016
|
+
convert[fromModel] = {};
|
|
1017
|
+
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
1018
|
+
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
1019
|
+
const routes = route(fromModel);
|
|
1020
|
+
const routeModels = Object.keys(routes);
|
|
1021
|
+
routeModels.forEach((toModel) => {
|
|
1022
|
+
const fn = routes[toModel];
|
|
1023
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1024
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1025
|
+
});
|
|
1026
|
+
});
|
|
1027
|
+
module2.exports = convert;
|
|
1028
|
+
}
|
|
1029
|
+
});
|
|
1030
|
+
|
|
1031
|
+
// node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
|
|
1032
|
+
var require_ansi_styles = __commonJS({
|
|
1033
|
+
"node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports, module2) {
|
|
1034
|
+
"use strict";
|
|
1035
|
+
init_cjs_shims();
|
|
1036
|
+
var wrapAnsi16 = (fn, offset) => (...args) => {
|
|
1037
|
+
const code = fn(...args);
|
|
1038
|
+
return `[${code + offset}m`;
|
|
1039
|
+
};
|
|
1040
|
+
var wrapAnsi256 = (fn, offset) => (...args) => {
|
|
1041
|
+
const code = fn(...args);
|
|
1042
|
+
return `[${38 + offset};5;${code}m`;
|
|
1043
|
+
};
|
|
1044
|
+
var wrapAnsi16m = (fn, offset) => (...args) => {
|
|
1045
|
+
const rgb = fn(...args);
|
|
1046
|
+
return `[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
1047
|
+
};
|
|
1048
|
+
var ansi2ansi = (n) => n;
|
|
1049
|
+
var rgb2rgb = (r, g, b) => [r, g, b];
|
|
1050
|
+
var setLazyProperty = (object, property, get) => {
|
|
1051
|
+
Object.defineProperty(object, property, {
|
|
1052
|
+
get: () => {
|
|
1053
|
+
const value = get();
|
|
1054
|
+
Object.defineProperty(object, property, {
|
|
1055
|
+
value,
|
|
1056
|
+
enumerable: true,
|
|
1057
|
+
configurable: true
|
|
1058
|
+
});
|
|
1059
|
+
return value;
|
|
1060
|
+
},
|
|
1061
|
+
enumerable: true,
|
|
1062
|
+
configurable: true
|
|
1063
|
+
});
|
|
1064
|
+
};
|
|
1065
|
+
var colorConvert;
|
|
1066
|
+
var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1067
|
+
if (colorConvert === void 0) {
|
|
1068
|
+
colorConvert = require_color_convert();
|
|
1069
|
+
}
|
|
1070
|
+
const offset = isBackground ? 10 : 0;
|
|
1071
|
+
const styles = {};
|
|
1072
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
1073
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1074
|
+
if (sourceSpace === targetSpace) {
|
|
1075
|
+
styles[name] = wrap(identity, offset);
|
|
1076
|
+
} else if (typeof suite === "object") {
|
|
1077
|
+
styles[name] = wrap(suite[targetSpace], offset);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
return styles;
|
|
1081
|
+
};
|
|
1082
|
+
function assembleStyles() {
|
|
1083
|
+
const codes = /* @__PURE__ */ new Map();
|
|
1084
|
+
const styles = {
|
|
1085
|
+
modifier: {
|
|
1086
|
+
reset: [0, 0],
|
|
1087
|
+
bold: [1, 22],
|
|
1088
|
+
dim: [2, 22],
|
|
1089
|
+
italic: [3, 23],
|
|
1090
|
+
underline: [4, 24],
|
|
1091
|
+
inverse: [7, 27],
|
|
1092
|
+
hidden: [8, 28],
|
|
1093
|
+
strikethrough: [9, 29]
|
|
1094
|
+
},
|
|
1095
|
+
color: {
|
|
1096
|
+
black: [30, 39],
|
|
1097
|
+
red: [31, 39],
|
|
1098
|
+
green: [32, 39],
|
|
1099
|
+
yellow: [33, 39],
|
|
1100
|
+
blue: [34, 39],
|
|
1101
|
+
magenta: [35, 39],
|
|
1102
|
+
cyan: [36, 39],
|
|
1103
|
+
white: [37, 39],
|
|
1104
|
+
blackBright: [90, 39],
|
|
1105
|
+
redBright: [91, 39],
|
|
1106
|
+
greenBright: [92, 39],
|
|
1107
|
+
yellowBright: [93, 39],
|
|
1108
|
+
blueBright: [94, 39],
|
|
1109
|
+
magentaBright: [95, 39],
|
|
1110
|
+
cyanBright: [96, 39],
|
|
1111
|
+
whiteBright: [97, 39]
|
|
1112
|
+
},
|
|
1113
|
+
bgColor: {
|
|
1114
|
+
bgBlack: [40, 49],
|
|
1115
|
+
bgRed: [41, 49],
|
|
1116
|
+
bgGreen: [42, 49],
|
|
1117
|
+
bgYellow: [43, 49],
|
|
1118
|
+
bgBlue: [44, 49],
|
|
1119
|
+
bgMagenta: [45, 49],
|
|
1120
|
+
bgCyan: [46, 49],
|
|
1121
|
+
bgWhite: [47, 49],
|
|
1122
|
+
bgBlackBright: [100, 49],
|
|
1123
|
+
bgRedBright: [101, 49],
|
|
1124
|
+
bgGreenBright: [102, 49],
|
|
1125
|
+
bgYellowBright: [103, 49],
|
|
1126
|
+
bgBlueBright: [104, 49],
|
|
1127
|
+
bgMagentaBright: [105, 49],
|
|
1128
|
+
bgCyanBright: [106, 49],
|
|
1129
|
+
bgWhiteBright: [107, 49]
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
styles.color.gray = styles.color.blackBright;
|
|
1133
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1134
|
+
styles.color.grey = styles.color.blackBright;
|
|
1135
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1136
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
1137
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
1138
|
+
styles[styleName] = {
|
|
1139
|
+
open: `[${style[0]}m`,
|
|
1140
|
+
close: `[${style[1]}m`
|
|
1141
|
+
};
|
|
1142
|
+
group[styleName] = styles[styleName];
|
|
1143
|
+
codes.set(style[0], style[1]);
|
|
1144
|
+
}
|
|
1145
|
+
Object.defineProperty(styles, groupName, {
|
|
1146
|
+
value: group,
|
|
1147
|
+
enumerable: false
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
Object.defineProperty(styles, "codes", {
|
|
1151
|
+
value: codes,
|
|
1152
|
+
enumerable: false
|
|
1153
|
+
});
|
|
1154
|
+
styles.color.close = "[39m";
|
|
1155
|
+
styles.bgColor.close = "[49m";
|
|
1156
|
+
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
1157
|
+
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
1158
|
+
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
1159
|
+
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
1160
|
+
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
1161
|
+
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
1162
|
+
return styles;
|
|
1163
|
+
}
|
|
1164
|
+
Object.defineProperty(module2, "exports", {
|
|
1165
|
+
enumerable: true,
|
|
1166
|
+
get: assembleStyles
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
|
|
1171
|
+
// node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
|
|
1172
|
+
var require_has_flag = __commonJS({
|
|
1173
|
+
"node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module2) {
|
|
1174
|
+
"use strict";
|
|
1175
|
+
init_cjs_shims();
|
|
1176
|
+
module2.exports = (flag, argv = process.argv) => {
|
|
1177
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
1178
|
+
const position = argv.indexOf(prefix + flag);
|
|
1179
|
+
const terminatorPosition = argv.indexOf("--");
|
|
1180
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
});
|
|
1184
|
+
|
|
1185
|
+
// node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
1186
|
+
var require_supports_color = __commonJS({
|
|
1187
|
+
"node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module2) {
|
|
1188
|
+
"use strict";
|
|
1189
|
+
init_cjs_shims();
|
|
1190
|
+
var os = require("os");
|
|
1191
|
+
var tty = require("tty");
|
|
1192
|
+
var hasFlag = require_has_flag();
|
|
1193
|
+
var { env } = process;
|
|
1194
|
+
var forceColor;
|
|
1195
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
1196
|
+
forceColor = 0;
|
|
1197
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
1198
|
+
forceColor = 1;
|
|
1199
|
+
}
|
|
1200
|
+
if ("FORCE_COLOR" in env) {
|
|
1201
|
+
if (env.FORCE_COLOR === "true") {
|
|
1202
|
+
forceColor = 1;
|
|
1203
|
+
} else if (env.FORCE_COLOR === "false") {
|
|
1204
|
+
forceColor = 0;
|
|
1205
|
+
} else {
|
|
1206
|
+
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
function translateLevel(level) {
|
|
1210
|
+
if (level === 0) {
|
|
1211
|
+
return false;
|
|
1212
|
+
}
|
|
1213
|
+
return {
|
|
1214
|
+
level,
|
|
1215
|
+
hasBasic: true,
|
|
1216
|
+
has256: level >= 2,
|
|
1217
|
+
has16m: level >= 3
|
|
1218
|
+
};
|
|
1219
|
+
}
|
|
1220
|
+
function supportsColor(haveStream, streamIsTTY) {
|
|
1221
|
+
if (forceColor === 0) {
|
|
1222
|
+
return 0;
|
|
1223
|
+
}
|
|
1224
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
1225
|
+
return 3;
|
|
1226
|
+
}
|
|
1227
|
+
if (hasFlag("color=256")) {
|
|
1228
|
+
return 2;
|
|
1229
|
+
}
|
|
1230
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
1231
|
+
return 0;
|
|
1232
|
+
}
|
|
1233
|
+
const min = forceColor || 0;
|
|
1234
|
+
if (env.TERM === "dumb") {
|
|
1235
|
+
return min;
|
|
1236
|
+
}
|
|
1237
|
+
if (process.platform === "win32") {
|
|
1238
|
+
const osRelease = os.release().split(".");
|
|
1239
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
1240
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1241
|
+
}
|
|
1242
|
+
return 1;
|
|
1243
|
+
}
|
|
1244
|
+
if ("CI" in env) {
|
|
1245
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
1246
|
+
return 1;
|
|
1247
|
+
}
|
|
1248
|
+
return min;
|
|
1249
|
+
}
|
|
1250
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
1251
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
1252
|
+
}
|
|
1253
|
+
if (env.COLORTERM === "truecolor") {
|
|
1254
|
+
return 3;
|
|
1255
|
+
}
|
|
1256
|
+
if ("TERM_PROGRAM" in env) {
|
|
1257
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
1258
|
+
switch (env.TERM_PROGRAM) {
|
|
1259
|
+
case "iTerm.app":
|
|
1260
|
+
return version >= 3 ? 3 : 2;
|
|
1261
|
+
case "Apple_Terminal":
|
|
1262
|
+
return 2;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
1266
|
+
return 2;
|
|
1267
|
+
}
|
|
1268
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
1269
|
+
return 1;
|
|
1270
|
+
}
|
|
1271
|
+
if ("COLORTERM" in env) {
|
|
1272
|
+
return 1;
|
|
1273
|
+
}
|
|
1274
|
+
return min;
|
|
1275
|
+
}
|
|
1276
|
+
function getSupportLevel(stream) {
|
|
1277
|
+
const level = supportsColor(stream, stream && stream.isTTY);
|
|
1278
|
+
return translateLevel(level);
|
|
1279
|
+
}
|
|
1280
|
+
module2.exports = {
|
|
1281
|
+
supportsColor: getSupportLevel,
|
|
1282
|
+
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
1283
|
+
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
});
|
|
1287
|
+
|
|
1288
|
+
// node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js
|
|
1289
|
+
var require_util = __commonJS({
|
|
1290
|
+
"node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports, module2) {
|
|
1291
|
+
"use strict";
|
|
1292
|
+
init_cjs_shims();
|
|
1293
|
+
var stringReplaceAll = (string, substring, replacer) => {
|
|
1294
|
+
let index = string.indexOf(substring);
|
|
1295
|
+
if (index === -1) {
|
|
1296
|
+
return string;
|
|
1297
|
+
}
|
|
1298
|
+
const substringLength = substring.length;
|
|
1299
|
+
let endIndex = 0;
|
|
1300
|
+
let returnValue = "";
|
|
1301
|
+
do {
|
|
1302
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
1303
|
+
endIndex = index + substringLength;
|
|
1304
|
+
index = string.indexOf(substring, endIndex);
|
|
1305
|
+
} while (index !== -1);
|
|
1306
|
+
returnValue += string.substr(endIndex);
|
|
1307
|
+
return returnValue;
|
|
1308
|
+
};
|
|
1309
|
+
var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
1310
|
+
let endIndex = 0;
|
|
1311
|
+
let returnValue = "";
|
|
1312
|
+
do {
|
|
1313
|
+
const gotCR = string[index - 1] === "\r";
|
|
1314
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1315
|
+
endIndex = index + 1;
|
|
1316
|
+
index = string.indexOf("\n", endIndex);
|
|
1317
|
+
} while (index !== -1);
|
|
1318
|
+
returnValue += string.substr(endIndex);
|
|
1319
|
+
return returnValue;
|
|
1320
|
+
};
|
|
1321
|
+
module2.exports = {
|
|
1322
|
+
stringReplaceAll,
|
|
1323
|
+
stringEncaseCRLFWithFirstIndex
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1327
|
+
|
|
1328
|
+
// node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js
|
|
1329
|
+
var require_templates = __commonJS({
|
|
1330
|
+
"node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports, module2) {
|
|
1331
|
+
"use strict";
|
|
1332
|
+
init_cjs_shims();
|
|
1333
|
+
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;
|
|
1334
|
+
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
1335
|
+
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
1336
|
+
var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
1337
|
+
var ESCAPES = /* @__PURE__ */ new Map([
|
|
1338
|
+
["n", "\n"],
|
|
1339
|
+
["r", "\r"],
|
|
1340
|
+
["t", " "],
|
|
1341
|
+
["b", "\b"],
|
|
1342
|
+
["f", "\f"],
|
|
1343
|
+
["v", "\v"],
|
|
1344
|
+
["0", "\0"],
|
|
1345
|
+
["\\", "\\"],
|
|
1346
|
+
["e", ""],
|
|
1347
|
+
["a", "\x07"]
|
|
1348
|
+
]);
|
|
1349
|
+
function unescape(c) {
|
|
1350
|
+
const u = c[0] === "u";
|
|
1351
|
+
const bracket = c[1] === "{";
|
|
1352
|
+
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
1353
|
+
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
1354
|
+
}
|
|
1355
|
+
if (u && bracket) {
|
|
1356
|
+
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
1357
|
+
}
|
|
1358
|
+
return ESCAPES.get(c) || c;
|
|
1359
|
+
}
|
|
1360
|
+
function parseArguments(name, arguments_) {
|
|
1361
|
+
const results = [];
|
|
1362
|
+
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
1363
|
+
let matches;
|
|
1364
|
+
for (const chunk of chunks) {
|
|
1365
|
+
const number = Number(chunk);
|
|
1366
|
+
if (!Number.isNaN(number)) {
|
|
1367
|
+
results.push(number);
|
|
1368
|
+
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
1369
|
+
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
1370
|
+
} else {
|
|
1371
|
+
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
return results;
|
|
1375
|
+
}
|
|
1376
|
+
function parseStyle(style) {
|
|
1377
|
+
STYLE_REGEX.lastIndex = 0;
|
|
1378
|
+
const results = [];
|
|
1379
|
+
let matches;
|
|
1380
|
+
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
1381
|
+
const name = matches[1];
|
|
1382
|
+
if (matches[2]) {
|
|
1383
|
+
const args = parseArguments(name, matches[2]);
|
|
1384
|
+
results.push([name].concat(args));
|
|
1385
|
+
} else {
|
|
1386
|
+
results.push([name]);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
return results;
|
|
1390
|
+
}
|
|
1391
|
+
function buildStyle(chalk, styles) {
|
|
1392
|
+
const enabled = {};
|
|
1393
|
+
for (const layer of styles) {
|
|
1394
|
+
for (const style of layer.styles) {
|
|
1395
|
+
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
let current = chalk;
|
|
1399
|
+
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
1400
|
+
if (!Array.isArray(styles2)) {
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
if (!(styleName in current)) {
|
|
1404
|
+
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
1405
|
+
}
|
|
1406
|
+
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
1407
|
+
}
|
|
1408
|
+
return current;
|
|
1409
|
+
}
|
|
1410
|
+
module2.exports = (chalk, temporary) => {
|
|
1411
|
+
const styles = [];
|
|
1412
|
+
const chunks = [];
|
|
1413
|
+
let chunk = [];
|
|
1414
|
+
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
1415
|
+
if (escapeCharacter) {
|
|
1416
|
+
chunk.push(unescape(escapeCharacter));
|
|
1417
|
+
} else if (style) {
|
|
1418
|
+
const string = chunk.join("");
|
|
1419
|
+
chunk = [];
|
|
1420
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
|
1421
|
+
styles.push({ inverse, styles: parseStyle(style) });
|
|
1422
|
+
} else if (close) {
|
|
1423
|
+
if (styles.length === 0) {
|
|
1424
|
+
throw new Error("Found extraneous } in Chalk template literal");
|
|
1425
|
+
}
|
|
1426
|
+
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
1427
|
+
chunk = [];
|
|
1428
|
+
styles.pop();
|
|
1429
|
+
} else {
|
|
1430
|
+
chunk.push(character);
|
|
1431
|
+
}
|
|
1432
|
+
});
|
|
1433
|
+
chunks.push(chunk.join(""));
|
|
1434
|
+
if (styles.length > 0) {
|
|
1435
|
+
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
1436
|
+
throw new Error(errMessage);
|
|
1437
|
+
}
|
|
1438
|
+
return chunks.join("");
|
|
86
1439
|
};
|
|
87
|
-
|
|
88
|
-
|
|
1440
|
+
}
|
|
1441
|
+
});
|
|
1442
|
+
|
|
1443
|
+
// node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js
|
|
1444
|
+
var require_source = __commonJS({
|
|
1445
|
+
"node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports, module2) {
|
|
1446
|
+
"use strict";
|
|
1447
|
+
init_cjs_shims();
|
|
1448
|
+
var ansiStyles = require_ansi_styles();
|
|
1449
|
+
var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
|
|
1450
|
+
var {
|
|
1451
|
+
stringReplaceAll,
|
|
1452
|
+
stringEncaseCRLFWithFirstIndex
|
|
1453
|
+
} = require_util();
|
|
1454
|
+
var { isArray } = Array;
|
|
1455
|
+
var levelMapping = [
|
|
1456
|
+
"ansi",
|
|
1457
|
+
"ansi",
|
|
1458
|
+
"ansi256",
|
|
1459
|
+
"ansi16m"
|
|
1460
|
+
];
|
|
1461
|
+
var styles = Object.create(null);
|
|
1462
|
+
var applyOptions = (object, options = {}) => {
|
|
1463
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1464
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1465
|
+
}
|
|
1466
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1467
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1468
|
+
};
|
|
1469
|
+
var ChalkClass = class {
|
|
1470
|
+
constructor(options) {
|
|
1471
|
+
return chalkFactory(options);
|
|
1472
|
+
}
|
|
1473
|
+
};
|
|
1474
|
+
var chalkFactory = (options) => {
|
|
1475
|
+
const chalk2 = {};
|
|
1476
|
+
applyOptions(chalk2, options);
|
|
1477
|
+
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
1478
|
+
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
1479
|
+
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
1480
|
+
chalk2.template.constructor = () => {
|
|
1481
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
1482
|
+
};
|
|
1483
|
+
chalk2.template.Instance = ChalkClass;
|
|
1484
|
+
return chalk2.template;
|
|
1485
|
+
};
|
|
1486
|
+
function Chalk(options) {
|
|
1487
|
+
return chalkFactory(options);
|
|
1488
|
+
}
|
|
1489
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
1490
|
+
styles[styleName] = {
|
|
1491
|
+
get() {
|
|
1492
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1493
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
1494
|
+
return builder;
|
|
1495
|
+
}
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
styles.visible = {
|
|
1499
|
+
get() {
|
|
1500
|
+
const builder = createBuilder(this, this._styler, true);
|
|
1501
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
1502
|
+
return builder;
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1506
|
+
for (const model of usedModels) {
|
|
1507
|
+
styles[model] = {
|
|
1508
|
+
get() {
|
|
1509
|
+
const { level } = this;
|
|
1510
|
+
return function(...arguments_) {
|
|
1511
|
+
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
1512
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1513
|
+
};
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
for (const model of usedModels) {
|
|
1518
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1519
|
+
styles[bgModel] = {
|
|
1520
|
+
get() {
|
|
1521
|
+
const { level } = this;
|
|
1522
|
+
return function(...arguments_) {
|
|
1523
|
+
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
1524
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
}
|
|
1529
|
+
var proto = Object.defineProperties(() => {
|
|
1530
|
+
}, __spreadProps(__spreadValues({}, styles), {
|
|
1531
|
+
level: {
|
|
1532
|
+
enumerable: true,
|
|
1533
|
+
get() {
|
|
1534
|
+
return this._generator.level;
|
|
1535
|
+
},
|
|
1536
|
+
set(level) {
|
|
1537
|
+
this._generator.level = level;
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
}));
|
|
1541
|
+
var createStyler = (open, close, parent) => {
|
|
1542
|
+
let openAll;
|
|
1543
|
+
let closeAll;
|
|
1544
|
+
if (parent === void 0) {
|
|
1545
|
+
openAll = open;
|
|
1546
|
+
closeAll = close;
|
|
1547
|
+
} else {
|
|
1548
|
+
openAll = parent.openAll + open;
|
|
1549
|
+
closeAll = close + parent.closeAll;
|
|
1550
|
+
}
|
|
1551
|
+
return {
|
|
1552
|
+
open,
|
|
1553
|
+
close,
|
|
1554
|
+
openAll,
|
|
1555
|
+
closeAll,
|
|
1556
|
+
parent
|
|
1557
|
+
};
|
|
1558
|
+
};
|
|
1559
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
1560
|
+
const builder = (...arguments_) => {
|
|
1561
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
1562
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1563
|
+
}
|
|
1564
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1565
|
+
};
|
|
1566
|
+
Object.setPrototypeOf(builder, proto);
|
|
1567
|
+
builder._generator = self;
|
|
1568
|
+
builder._styler = _styler;
|
|
1569
|
+
builder._isEmpty = _isEmpty;
|
|
1570
|
+
return builder;
|
|
1571
|
+
};
|
|
1572
|
+
var applyStyle = (self, string) => {
|
|
1573
|
+
if (self.level <= 0 || !string) {
|
|
1574
|
+
return self._isEmpty ? "" : string;
|
|
1575
|
+
}
|
|
1576
|
+
let styler = self._styler;
|
|
1577
|
+
if (styler === void 0) {
|
|
1578
|
+
return string;
|
|
1579
|
+
}
|
|
1580
|
+
const { openAll, closeAll } = styler;
|
|
1581
|
+
if (string.indexOf("") !== -1) {
|
|
1582
|
+
while (styler !== void 0) {
|
|
1583
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1584
|
+
styler = styler.parent;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
const lfIndex = string.indexOf("\n");
|
|
1588
|
+
if (lfIndex !== -1) {
|
|
1589
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1590
|
+
}
|
|
1591
|
+
return openAll + string + closeAll;
|
|
1592
|
+
};
|
|
1593
|
+
var template;
|
|
1594
|
+
var chalkTag = (chalk2, ...strings) => {
|
|
1595
|
+
const [firstString] = strings;
|
|
1596
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
1597
|
+
return strings.join(" ");
|
|
1598
|
+
}
|
|
1599
|
+
const arguments_ = strings.slice(1);
|
|
1600
|
+
const parts = [firstString.raw[0]];
|
|
1601
|
+
for (let i = 1; i < firstString.length; i++) {
|
|
1602
|
+
parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
|
|
1603
|
+
}
|
|
1604
|
+
if (template === void 0) {
|
|
1605
|
+
template = require_templates();
|
|
1606
|
+
}
|
|
1607
|
+
return template(chalk2, parts.join(""));
|
|
1608
|
+
};
|
|
1609
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
1610
|
+
var chalk = Chalk();
|
|
1611
|
+
chalk.supportsColor = stdoutColor;
|
|
1612
|
+
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1613
|
+
chalk.stderr.supportsColor = stderrColor;
|
|
1614
|
+
module2.exports = chalk;
|
|
89
1615
|
}
|
|
90
1616
|
});
|
|
91
1617
|
|
|
@@ -108,7 +1634,7 @@ var require_log_symbols = __commonJS({
|
|
|
108
1634
|
"node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js"(exports, module2) {
|
|
109
1635
|
"use strict";
|
|
110
1636
|
init_cjs_shims();
|
|
111
|
-
var chalk =
|
|
1637
|
+
var chalk = require_source();
|
|
112
1638
|
var isUnicodeSupported = require_is_unicode_supported();
|
|
113
1639
|
var main = {
|
|
114
1640
|
info: chalk.blue("\u2139"),
|
|
@@ -126,6 +1652,28 @@ var require_log_symbols = __commonJS({
|
|
|
126
1652
|
}
|
|
127
1653
|
});
|
|
128
1654
|
|
|
1655
|
+
// node_modules/.pnpm/detect-newline@3.1.0/node_modules/detect-newline/index.js
|
|
1656
|
+
var require_detect_newline = __commonJS({
|
|
1657
|
+
"node_modules/.pnpm/detect-newline@3.1.0/node_modules/detect-newline/index.js"(exports, module2) {
|
|
1658
|
+
"use strict";
|
|
1659
|
+
init_cjs_shims();
|
|
1660
|
+
var detectNewline2 = (string) => {
|
|
1661
|
+
if (typeof string !== "string") {
|
|
1662
|
+
throw new TypeError("Expected a string");
|
|
1663
|
+
}
|
|
1664
|
+
const newlines = string.match(/(?:\r?\n)/g) || [];
|
|
1665
|
+
if (newlines.length === 0) {
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1668
|
+
const crlf = newlines.filter((newline) => newline === "\r\n").length;
|
|
1669
|
+
const lf = newlines.length - crlf;
|
|
1670
|
+
return crlf > lf ? "\r\n" : "\n";
|
|
1671
|
+
};
|
|
1672
|
+
module2.exports = detectNewline2;
|
|
1673
|
+
module2.exports.graceful = (string) => typeof string === "string" && detectNewline2(string) || "\n";
|
|
1674
|
+
}
|
|
1675
|
+
});
|
|
1676
|
+
|
|
129
1677
|
// src/index.ts
|
|
130
1678
|
var src_exports = {};
|
|
131
1679
|
__export(src_exports, {
|
|
@@ -133,25 +1681,28 @@ __export(src_exports, {
|
|
|
133
1681
|
ProgressEvent: () => ProgressEvent,
|
|
134
1682
|
ReleaseType: () => import_semver.ReleaseType,
|
|
135
1683
|
default: () => src_default,
|
|
136
|
-
versionBump: () => versionBump
|
|
1684
|
+
versionBump: () => versionBump,
|
|
1685
|
+
versionBumpInfo: () => versionBumpInfo
|
|
137
1686
|
});
|
|
138
1687
|
init_cjs_shims();
|
|
139
1688
|
|
|
140
1689
|
// src/version-bump.ts
|
|
141
1690
|
init_cjs_shims();
|
|
142
1691
|
var ezSpawn3 = __toESM(require("@jsdevtools/ez-spawn"));
|
|
1692
|
+
var import_kleur2 = require("kleur");
|
|
1693
|
+
var import_log_symbols = __toESM(require_log_symbols());
|
|
1694
|
+
var import_prompts2 = __toESM(require("prompts"));
|
|
143
1695
|
|
|
144
1696
|
// src/get-new-version.ts
|
|
145
1697
|
init_cjs_shims();
|
|
146
|
-
var
|
|
1698
|
+
var import_kleur = require("kleur");
|
|
147
1699
|
var import_prompts = __toESM(require("prompts"));
|
|
148
|
-
var import_semver2 = require("semver");
|
|
149
|
-
var import_semver3 = __toESM(require("semver"));
|
|
1700
|
+
var import_semver2 = __toESM(require("semver"));
|
|
150
1701
|
|
|
151
1702
|
// src/release-type.ts
|
|
152
1703
|
init_cjs_shims();
|
|
153
1704
|
var import_semver = require("semver");
|
|
154
|
-
var prereleaseTypes = ["prerelease"];
|
|
1705
|
+
var prereleaseTypes = ["premajor", "preminor", "prepatch", "prerelease"];
|
|
155
1706
|
var releaseTypes = prereleaseTypes.concat(["major", "minor", "patch"]);
|
|
156
1707
|
function isPrerelease(value) {
|
|
157
1708
|
return prereleaseTypes.includes(value);
|
|
@@ -162,15 +1713,14 @@ function isReleaseType(value) {
|
|
|
162
1713
|
|
|
163
1714
|
// src/get-new-version.ts
|
|
164
1715
|
async function getNewVersion(operation) {
|
|
165
|
-
|
|
166
|
-
|
|
1716
|
+
const { release } = operation.options;
|
|
1717
|
+
const { oldVersion } = operation.state;
|
|
167
1718
|
switch (release.type) {
|
|
168
1719
|
case "prompt":
|
|
169
1720
|
return promptForNewVersion(operation);
|
|
170
1721
|
case "version":
|
|
171
|
-
let newSemVer = new import_semver3.SemVer(release.version, true);
|
|
172
1722
|
return operation.update({
|
|
173
|
-
newVersion:
|
|
1723
|
+
newVersion: new import_semver2.SemVer(release.version, true).version
|
|
174
1724
|
});
|
|
175
1725
|
default:
|
|
176
1726
|
return operation.update({
|
|
@@ -180,8 +1730,8 @@ async function getNewVersion(operation) {
|
|
|
180
1730
|
}
|
|
181
1731
|
}
|
|
182
1732
|
function getNextVersion(oldVersion, bump) {
|
|
183
|
-
|
|
184
|
-
|
|
1733
|
+
const oldSemVer = new import_semver2.SemVer(oldVersion);
|
|
1734
|
+
const newSemVer = oldSemVer.inc(bump.type, bump.preid);
|
|
185
1735
|
if (isPrerelease(bump.type) && newSemVer.prerelease.length === 2 && newSemVer.prerelease[0] === bump.preid && String(newSemVer.prerelease[1]) === "0") {
|
|
186
1736
|
newSemVer.prerelease[1] = "1";
|
|
187
1737
|
newSemVer.format();
|
|
@@ -190,36 +1740,36 @@ function getNextVersion(oldVersion, bump) {
|
|
|
190
1740
|
}
|
|
191
1741
|
function getNextVersions(oldVersion, preid) {
|
|
192
1742
|
var _a;
|
|
193
|
-
|
|
194
|
-
const parse =
|
|
195
|
-
if (typeof (parse == null ? void 0 : parse.prerelease[0]) === "string")
|
|
1743
|
+
const next = {};
|
|
1744
|
+
const parse = import_semver2.default.parse(oldVersion);
|
|
1745
|
+
if (typeof (parse == null ? void 0 : parse.prerelease[0]) === "string")
|
|
196
1746
|
preid = (parse == null ? void 0 : parse.prerelease[0]) || "preid";
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
next.next = ((_a = parse == null ? void 0 : parse.prerelease) == null ? void 0 : _a.length) ? import_semver3.default.inc(oldVersion, "prerelease", preid) : import_semver3.default.inc(oldVersion, "patch");
|
|
1747
|
+
for (const type of releaseTypes)
|
|
1748
|
+
next[type] = import_semver2.default.inc(oldVersion, type, preid);
|
|
1749
|
+
next.next = ((_a = parse == null ? void 0 : parse.prerelease) == null ? void 0 : _a.length) ? import_semver2.default.inc(oldVersion, "prerelease", preid) : import_semver2.default.inc(oldVersion, "patch");
|
|
202
1750
|
return next;
|
|
203
1751
|
}
|
|
204
1752
|
async function promptForNewVersion(operation) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
answers = await (0, import_prompts.default)([
|
|
1753
|
+
const { oldVersion } = operation.state;
|
|
1754
|
+
const release = operation.options.release;
|
|
1755
|
+
const next = getNextVersions(oldVersion, release.preid);
|
|
1756
|
+
const PADDING = 13;
|
|
1757
|
+
const answers = await (0, import_prompts.default)([
|
|
210
1758
|
{
|
|
211
1759
|
type: "autocomplete",
|
|
212
1760
|
name: "release",
|
|
213
|
-
message: `Current version
|
|
1761
|
+
message: `Current version ${(0, import_kleur.green)(oldVersion)}`,
|
|
214
1762
|
initial: "next",
|
|
215
1763
|
choices: [
|
|
216
|
-
{ value: "major", title: "major
|
|
217
|
-
{ value: "minor", title: "minor
|
|
218
|
-
{ value: "patch", title: "patch
|
|
219
|
-
{ value: "next", title: "next
|
|
220
|
-
{ value: "
|
|
221
|
-
{ value: "
|
|
222
|
-
{ value: "
|
|
1764
|
+
{ value: "major", title: `${"major".padStart(PADDING, " ")} ${(0, import_kleur.bold)(next.major)}` },
|
|
1765
|
+
{ value: "minor", title: `${"minor".padStart(PADDING, " ")} ${(0, import_kleur.bold)(next.minor)}` },
|
|
1766
|
+
{ value: "patch", title: `${"patch".padStart(PADDING, " ")} ${(0, import_kleur.bold)(next.patch)}` },
|
|
1767
|
+
{ value: "next", title: `${"next".padStart(PADDING, " ")} ${(0, import_kleur.bold)(next.next)}` },
|
|
1768
|
+
{ value: "prepatch", title: `${"pre-patch".padStart(PADDING, " ")} ${(0, import_kleur.bold)(next.prepatch)}` },
|
|
1769
|
+
{ value: "preminor", title: `${"pre-minor".padStart(PADDING, " ")} ${(0, import_kleur.bold)(next.preminor)}` },
|
|
1770
|
+
{ value: "premajor", title: `${"pre-major".padStart(PADDING, " ")} ${(0, import_kleur.bold)(next.premajor)}` },
|
|
1771
|
+
{ value: "none", title: `${"as-is".padStart(PADDING, " ")} ${(0, import_kleur.bold)(oldVersion)}` },
|
|
1772
|
+
{ value: "custom", title: "custom ...".padStart(PADDING + 4, " ") }
|
|
223
1773
|
]
|
|
224
1774
|
},
|
|
225
1775
|
{
|
|
@@ -233,11 +1783,11 @@ async function promptForNewVersion(operation) {
|
|
|
233
1783
|
}
|
|
234
1784
|
]);
|
|
235
1785
|
const newVersion = answers.release === "none" ? oldVersion : answers.release === "custom" ? (0, import_semver2.clean)(answers.custom) : next[answers.release];
|
|
236
|
-
if (!newVersion)
|
|
1786
|
+
if (!newVersion)
|
|
237
1787
|
process.exit(1);
|
|
238
|
-
}
|
|
239
1788
|
switch (answers.release) {
|
|
240
1789
|
case "custom":
|
|
1790
|
+
case "next":
|
|
241
1791
|
case "none":
|
|
242
1792
|
return operation.update({ newVersion });
|
|
243
1793
|
default:
|
|
@@ -247,10 +1797,12 @@ async function promptForNewVersion(operation) {
|
|
|
247
1797
|
|
|
248
1798
|
// src/get-old-version.ts
|
|
249
1799
|
init_cjs_shims();
|
|
250
|
-
var
|
|
1800
|
+
var import_semver3 = require("semver");
|
|
251
1801
|
|
|
252
1802
|
// src/fs.ts
|
|
253
1803
|
init_cjs_shims();
|
|
1804
|
+
var import_fs = __toESM(require("fs"));
|
|
1805
|
+
var import_path = __toESM(require("path"));
|
|
254
1806
|
|
|
255
1807
|
// node_modules/.pnpm/detect-indent@7.0.0/node_modules/detect-indent/index.js
|
|
256
1808
|
init_cjs_shims();
|
|
@@ -352,25 +1904,22 @@ function detectIndent(string) {
|
|
|
352
1904
|
|
|
353
1905
|
// src/fs.ts
|
|
354
1906
|
var import_detect_newline = __toESM(require_detect_newline());
|
|
355
|
-
var import_fs = __toESM(require("fs"));
|
|
356
|
-
var import_path = __toESM(require("path"));
|
|
357
1907
|
async function readJsonFile(name, cwd) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
1908
|
+
const file = await readTextFile(name, cwd);
|
|
1909
|
+
const data = JSON.parse(file.data);
|
|
1910
|
+
const indent = detectIndent(file.data).indent;
|
|
1911
|
+
const newline = (0, import_detect_newline.default)(file.data);
|
|
362
1912
|
return __spreadProps(__spreadValues({}, file), { data, indent, newline });
|
|
363
1913
|
}
|
|
364
1914
|
async function writeJsonFile(file) {
|
|
365
1915
|
let json = JSON.stringify(file.data, void 0, file.indent);
|
|
366
|
-
if (file.newline)
|
|
1916
|
+
if (file.newline)
|
|
367
1917
|
json += file.newline;
|
|
368
|
-
}
|
|
369
1918
|
return writeTextFile(__spreadProps(__spreadValues({}, file), { data: json }));
|
|
370
1919
|
}
|
|
371
1920
|
function readTextFile(name, cwd) {
|
|
372
1921
|
return new Promise((resolve, reject) => {
|
|
373
|
-
|
|
1922
|
+
const filePath = import_path.default.join(cwd, name);
|
|
374
1923
|
import_fs.default.readFile(filePath, "utf8", (err, text) => {
|
|
375
1924
|
if (err) {
|
|
376
1925
|
reject(err);
|
|
@@ -386,11 +1935,10 @@ function readTextFile(name, cwd) {
|
|
|
386
1935
|
function writeTextFile(file) {
|
|
387
1936
|
return new Promise((resolve, reject) => {
|
|
388
1937
|
import_fs.default.writeFile(file.path, file.data, (err) => {
|
|
389
|
-
if (err)
|
|
1938
|
+
if (err)
|
|
390
1939
|
reject(err);
|
|
391
|
-
|
|
1940
|
+
else
|
|
392
1941
|
resolve();
|
|
393
|
-
}
|
|
394
1942
|
});
|
|
395
1943
|
});
|
|
396
1944
|
}
|
|
@@ -401,19 +1949,18 @@ function isManifest(obj) {
|
|
|
401
1949
|
return obj && typeof obj === "object" && isOptionalString(obj.name) && isOptionalString(obj.version) && isOptionalString(obj.description);
|
|
402
1950
|
}
|
|
403
1951
|
function isOptionalString(value) {
|
|
404
|
-
|
|
1952
|
+
const type = typeof value;
|
|
405
1953
|
return value === null || type === "undefined" || type === "string";
|
|
406
1954
|
}
|
|
407
1955
|
|
|
408
1956
|
// src/get-old-version.ts
|
|
409
1957
|
async function getOldVersion(operation) {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
if (!filesToCheck.includes("package.json"))
|
|
1958
|
+
const { cwd, files } = operation.options;
|
|
1959
|
+
const filesToCheck = files.filter((file) => file.endsWith(".json"));
|
|
1960
|
+
if (!filesToCheck.includes("package.json"))
|
|
413
1961
|
filesToCheck.push("package.json");
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
let version = await readVersion(file, cwd);
|
|
1962
|
+
for (const file of filesToCheck) {
|
|
1963
|
+
const version = await readVersion(file, cwd);
|
|
417
1964
|
if (version) {
|
|
418
1965
|
return operation.update({
|
|
419
1966
|
oldVersionSource: file,
|
|
@@ -425,11 +1972,10 @@ async function getOldVersion(operation) {
|
|
|
425
1972
|
}
|
|
426
1973
|
async function readVersion(file, cwd) {
|
|
427
1974
|
try {
|
|
428
|
-
|
|
1975
|
+
const { data: manifest } = await readJsonFile(file, cwd);
|
|
429
1976
|
if (isManifest(manifest)) {
|
|
430
|
-
if ((0,
|
|
1977
|
+
if ((0, import_semver3.valid)(manifest.version))
|
|
431
1978
|
return manifest.version;
|
|
432
|
-
}
|
|
433
1979
|
}
|
|
434
1980
|
} catch (error) {
|
|
435
1981
|
return void 0;
|
|
@@ -451,20 +1997,19 @@ var ProgressEvent = /* @__PURE__ */ ((ProgressEvent2) => {
|
|
|
451
1997
|
ProgressEvent2["NpmScript"] = "npm script";
|
|
452
1998
|
return ProgressEvent2;
|
|
453
1999
|
})(ProgressEvent || {});
|
|
454
|
-
var NpmScript = /* @__PURE__ */ ((
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
return
|
|
2000
|
+
var NpmScript = /* @__PURE__ */ ((NpmScript2) => {
|
|
2001
|
+
NpmScript2["PreVersion"] = "preversion";
|
|
2002
|
+
NpmScript2["Version"] = "version";
|
|
2003
|
+
NpmScript2["PostVersion"] = "postversion";
|
|
2004
|
+
return NpmScript2;
|
|
459
2005
|
})(NpmScript || {});
|
|
460
2006
|
|
|
461
2007
|
// src/git.ts
|
|
462
2008
|
async function gitCommit(operation) {
|
|
463
|
-
if (!operation.options.commit)
|
|
2009
|
+
if (!operation.options.commit)
|
|
464
2010
|
return operation;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
let { updatedFiles, newVersion } = operation.state;
|
|
2011
|
+
const { all, noVerify, message } = operation.options.commit;
|
|
2012
|
+
const { updatedFiles, newVersion } = operation.state;
|
|
468
2013
|
let args = [];
|
|
469
2014
|
if (all) {
|
|
470
2015
|
args.push("--all");
|
|
@@ -472,34 +2017,31 @@ async function gitCommit(operation) {
|
|
|
472
2017
|
if (noVerify) {
|
|
473
2018
|
args.push("--no-verify");
|
|
474
2019
|
}
|
|
475
|
-
|
|
2020
|
+
const commitMessage = formatVersionString(message, newVersion);
|
|
476
2021
|
args.push("--message", commitMessage);
|
|
477
|
-
if (!all)
|
|
2022
|
+
if (!all)
|
|
478
2023
|
args = args.concat(updatedFiles);
|
|
479
|
-
}
|
|
480
2024
|
await ezSpawn.async("git", ["commit", ...args]);
|
|
481
2025
|
return operation.update({ event: "git commit" /* GitCommit */, commitMessage });
|
|
482
2026
|
}
|
|
483
2027
|
async function gitTag(operation) {
|
|
484
|
-
if (!operation.options.tag)
|
|
2028
|
+
if (!operation.options.tag)
|
|
485
2029
|
return operation;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
let args = [
|
|
2030
|
+
const { commit, tag } = operation.options;
|
|
2031
|
+
const { newVersion } = operation.state;
|
|
2032
|
+
const args = [
|
|
490
2033
|
"--annotate",
|
|
491
2034
|
"--message",
|
|
492
2035
|
formatVersionString(commit.message, newVersion)
|
|
493
2036
|
];
|
|
494
|
-
|
|
2037
|
+
const tagName = formatVersionString(tag.name, newVersion);
|
|
495
2038
|
args.push(tagName);
|
|
496
2039
|
await ezSpawn.async("git", ["tag", ...args]);
|
|
497
2040
|
return operation.update({ event: "git tag" /* GitTag */, tagName });
|
|
498
2041
|
}
|
|
499
2042
|
async function gitPush(operation) {
|
|
500
|
-
if (!operation.options.push)
|
|
2043
|
+
if (!operation.options.push)
|
|
501
2044
|
return operation;
|
|
502
|
-
}
|
|
503
2045
|
await ezSpawn.async("git", "push");
|
|
504
2046
|
if (operation.options.tag) {
|
|
505
2047
|
await ezSpawn.async("git", ["push", "--tags"]);
|
|
@@ -507,11 +2049,10 @@ async function gitPush(operation) {
|
|
|
507
2049
|
return operation.update({ event: "git push" /* GitPush */ });
|
|
508
2050
|
}
|
|
509
2051
|
function formatVersionString(template, newVersion) {
|
|
510
|
-
if (template.includes("%s"))
|
|
2052
|
+
if (template.includes("%s"))
|
|
511
2053
|
return template.replace(/%s/g, newVersion);
|
|
512
|
-
|
|
2054
|
+
else
|
|
513
2055
|
return template + newVersion;
|
|
514
|
-
}
|
|
515
2056
|
}
|
|
516
2057
|
|
|
517
2058
|
// src/operation.ts
|
|
@@ -519,83 +2060,51 @@ init_cjs_shims();
|
|
|
519
2060
|
|
|
520
2061
|
// src/normalize-options.ts
|
|
521
2062
|
init_cjs_shims();
|
|
522
|
-
var
|
|
523
|
-
var import_globby2 = require("globby");
|
|
2063
|
+
var import_fast_glob = __toESM(require("fast-glob"));
|
|
524
2064
|
async function normalizeOptions(raw) {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
2065
|
+
var _a;
|
|
2066
|
+
const preid = typeof raw.preid === "string" ? raw.preid : "beta";
|
|
2067
|
+
const push = Boolean(raw.push);
|
|
2068
|
+
const all = Boolean(raw.all);
|
|
2069
|
+
const noVerify = Boolean(raw.noVerify);
|
|
2070
|
+
const cwd = raw.cwd || process.cwd();
|
|
2071
|
+
const ignoreScripts = Boolean(raw.ignoreScripts);
|
|
2072
|
+
const execute = raw.execute;
|
|
532
2073
|
let release;
|
|
533
|
-
if (!raw.release || raw.release === "prompt")
|
|
2074
|
+
if (!raw.release || raw.release === "prompt")
|
|
534
2075
|
release = { type: "prompt", preid };
|
|
535
|
-
|
|
2076
|
+
else if (isReleaseType(raw.release))
|
|
536
2077
|
release = { type: raw.release, preid };
|
|
537
|
-
|
|
2078
|
+
else
|
|
538
2079
|
release = { type: "version", version: raw.release };
|
|
539
|
-
}
|
|
540
2080
|
let tag;
|
|
541
|
-
if (typeof raw.tag === "string")
|
|
2081
|
+
if (typeof raw.tag === "string")
|
|
542
2082
|
tag = { name: raw.tag };
|
|
543
|
-
|
|
2083
|
+
else if (raw.tag)
|
|
544
2084
|
tag = { name: "v" };
|
|
545
|
-
}
|
|
546
2085
|
let commit;
|
|
547
|
-
if (typeof raw.commit === "string")
|
|
2086
|
+
if (typeof raw.commit === "string")
|
|
548
2087
|
commit = { all, noVerify, message: raw.commit };
|
|
549
|
-
|
|
550
|
-
commit = { all, noVerify, message: "release v" };
|
|
551
|
-
}
|
|
552
|
-
let files;
|
|
553
|
-
if (Array.isArray(raw.files) && raw.files.length > 0) {
|
|
554
|
-
files = await strictGlobMatches(raw.files, { cwd });
|
|
555
|
-
} else {
|
|
556
|
-
files = await (0, import_globby.default)(["package.json", "package-lock.json"], { cwd });
|
|
557
|
-
}
|
|
2088
|
+
else if (raw.commit || tag || push)
|
|
2089
|
+
commit = { all, noVerify, message: "chore: release v" };
|
|
2090
|
+
const files = await (0, import_fast_glob.default)(((_a = raw.files) == null ? void 0 : _a.length) ? raw.files : ["package.json", "package-lock.json"], { cwd, onlyFiles: true });
|
|
558
2091
|
let ui;
|
|
559
2092
|
if (raw.interface === false) {
|
|
560
|
-
ui = { input: false,
|
|
2093
|
+
ui = { input: false, output: false };
|
|
561
2094
|
} else if (raw.interface === true || !raw.interface) {
|
|
562
2095
|
ui = { input: process.stdin, output: process.stdout };
|
|
563
2096
|
} else {
|
|
564
|
-
let
|
|
565
|
-
if (input === true || input !== false && !input)
|
|
2097
|
+
let _b = raw.interface, { input, output } = _b, other = __objRest(_b, ["input", "output"]);
|
|
2098
|
+
if (input === true || input !== false && !input)
|
|
566
2099
|
input = process.stdin;
|
|
567
|
-
|
|
568
|
-
if (output === true || output !== false && !output) {
|
|
2100
|
+
if (output === true || output !== false && !output)
|
|
569
2101
|
output = process.stdout;
|
|
570
|
-
}
|
|
571
2102
|
ui = __spreadValues({ input, output }, other);
|
|
572
2103
|
}
|
|
573
|
-
if (release.type === "prompt" && !(ui.input && ui.output))
|
|
2104
|
+
if (release.type === "prompt" && !(ui.input && ui.output))
|
|
574
2105
|
throw new Error("Cannot prompt for the version number because input or output has been disabled.");
|
|
575
|
-
}
|
|
576
2106
|
return { release, commit, tag, push, files, cwd, interface: ui, ignoreScripts, execute };
|
|
577
2107
|
}
|
|
578
|
-
async function strictGlobMatches(files, options) {
|
|
579
|
-
let matches = await Promise.all(files.map((file) => strictGlobMatch(file, options)));
|
|
580
|
-
let matchedFiles = /* @__PURE__ */ new Set();
|
|
581
|
-
for (let match of matches) {
|
|
582
|
-
for (let file of match) {
|
|
583
|
-
matchedFiles.add(file);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
return [...matchedFiles];
|
|
587
|
-
}
|
|
588
|
-
async function strictGlobMatch(file, options) {
|
|
589
|
-
let matches = await (0, import_globby.default)(file, options);
|
|
590
|
-
if (matches.length === 0) {
|
|
591
|
-
if ((0, import_globby2.hasMagic)(file)) {
|
|
592
|
-
throw new Error(`Could not find any files matching "${file}".`);
|
|
593
|
-
} else {
|
|
594
|
-
throw new Error(`Could not find file: ${file}.`);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
return matches.sort();
|
|
598
|
-
}
|
|
599
2108
|
|
|
600
2109
|
// src/operation.ts
|
|
601
2110
|
var Operation = class {
|
|
@@ -614,8 +2123,8 @@ var Operation = class {
|
|
|
614
2123
|
this._progress = progress;
|
|
615
2124
|
}
|
|
616
2125
|
get results() {
|
|
617
|
-
|
|
618
|
-
|
|
2126
|
+
const options = this.options;
|
|
2127
|
+
const state = this.state;
|
|
619
2128
|
return {
|
|
620
2129
|
release: state.release,
|
|
621
2130
|
oldVersion: state.oldVersion,
|
|
@@ -627,7 +2136,7 @@ var Operation = class {
|
|
|
627
2136
|
};
|
|
628
2137
|
}
|
|
629
2138
|
static async start(input) {
|
|
630
|
-
|
|
2139
|
+
const options = await normalizeOptions(input);
|
|
631
2140
|
return new Operation(options, input.progress);
|
|
632
2141
|
}
|
|
633
2142
|
update(_a) {
|
|
@@ -644,9 +2153,9 @@ var Operation = class {
|
|
|
644
2153
|
init_cjs_shims();
|
|
645
2154
|
var ezSpawn2 = __toESM(require("@jsdevtools/ez-spawn"));
|
|
646
2155
|
async function runNpmScript(script, operation) {
|
|
647
|
-
|
|
2156
|
+
const { cwd, ignoreScripts } = operation.options;
|
|
648
2157
|
if (!ignoreScripts) {
|
|
649
|
-
|
|
2158
|
+
const { data: manifest } = await readJsonFile("package.json", cwd);
|
|
650
2159
|
if (isManifest(manifest) && hasScript(manifest, script)) {
|
|
651
2160
|
await ezSpawn2.async("npm", ["run", script, "--silent"], { stdio: "inherit" });
|
|
652
2161
|
operation.update({ event: "npm script" /* NpmScript */, script });
|
|
@@ -655,10 +2164,9 @@ async function runNpmScript(script, operation) {
|
|
|
655
2164
|
return operation;
|
|
656
2165
|
}
|
|
657
2166
|
function hasScript(manifest, script) {
|
|
658
|
-
|
|
659
|
-
if (scripts && typeof scripts === "object")
|
|
2167
|
+
const scripts = manifest.scripts;
|
|
2168
|
+
if (scripts && typeof scripts === "object")
|
|
660
2169
|
return Boolean(scripts[script]);
|
|
661
|
-
}
|
|
662
2170
|
return false;
|
|
663
2171
|
}
|
|
664
2172
|
|
|
@@ -666,9 +2174,9 @@ function hasScript(manifest, script) {
|
|
|
666
2174
|
init_cjs_shims();
|
|
667
2175
|
var path2 = __toESM(require("path"));
|
|
668
2176
|
async function updateFiles(operation) {
|
|
669
|
-
|
|
670
|
-
for (
|
|
671
|
-
|
|
2177
|
+
const { files } = operation.options;
|
|
2178
|
+
for (const relPath of files) {
|
|
2179
|
+
const modified = await updateFile(relPath, operation);
|
|
672
2180
|
if (modified) {
|
|
673
2181
|
operation.update({
|
|
674
2182
|
event: "file updated" /* FileUpdated */,
|
|
@@ -684,7 +2192,7 @@ async function updateFiles(operation) {
|
|
|
684
2192
|
return operation;
|
|
685
2193
|
}
|
|
686
2194
|
async function updateFile(relPath, operation) {
|
|
687
|
-
|
|
2195
|
+
const name = path2.basename(relPath).trim().toLowerCase();
|
|
688
2196
|
switch (name) {
|
|
689
2197
|
case "package.json":
|
|
690
2198
|
case "package-lock.json":
|
|
@@ -696,10 +2204,10 @@ async function updateFile(relPath, operation) {
|
|
|
696
2204
|
}
|
|
697
2205
|
}
|
|
698
2206
|
async function updateManifestFile(relPath, operation) {
|
|
699
|
-
|
|
700
|
-
|
|
2207
|
+
const { cwd } = operation.options;
|
|
2208
|
+
const { newVersion } = operation.state;
|
|
701
2209
|
let modified = false;
|
|
702
|
-
|
|
2210
|
+
const file = await readJsonFile(relPath, cwd);
|
|
703
2211
|
if (isManifest(file.data) && file.data.version !== newVersion) {
|
|
704
2212
|
file.data.version = newVersion;
|
|
705
2213
|
await writeJsonFile(file);
|
|
@@ -708,14 +2216,14 @@ async function updateManifestFile(relPath, operation) {
|
|
|
708
2216
|
return modified;
|
|
709
2217
|
}
|
|
710
2218
|
async function updateTextFile(relPath, operation) {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
2219
|
+
const { cwd } = operation.options;
|
|
2220
|
+
const { oldVersion, newVersion } = operation.state;
|
|
2221
|
+
const modified = false;
|
|
2222
|
+
const file = await readTextFile(relPath, cwd);
|
|
715
2223
|
if (file.data.includes(oldVersion)) {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
file.data = file.data.replace(replacePattern,
|
|
2224
|
+
const sanitizedVersion = oldVersion.replace(/(\W)/g, "\\$1");
|
|
2225
|
+
const replacePattern = new RegExp(`(\\b|v)${sanitizedVersion}\\b`, "g");
|
|
2226
|
+
file.data = file.data.replace(replacePattern, `$1${newVersion}`);
|
|
719
2227
|
await writeTextFile(file);
|
|
720
2228
|
return true;
|
|
721
2229
|
}
|
|
@@ -723,14 +2231,22 @@ async function updateTextFile(relPath, operation) {
|
|
|
723
2231
|
}
|
|
724
2232
|
|
|
725
2233
|
// src/version-bump.ts
|
|
726
|
-
var import_log_symbols = __toESM(require_log_symbols());
|
|
727
2234
|
async function versionBump(arg = {}) {
|
|
728
|
-
if (typeof arg === "string")
|
|
2235
|
+
if (typeof arg === "string")
|
|
729
2236
|
arg = { release: arg };
|
|
730
|
-
|
|
731
|
-
let operation = await Operation.start(arg);
|
|
2237
|
+
const operation = await Operation.start(arg);
|
|
732
2238
|
await getOldVersion(operation);
|
|
733
2239
|
await getNewVersion(operation);
|
|
2240
|
+
if (arg.confirm) {
|
|
2241
|
+
printSummary(operation);
|
|
2242
|
+
if (!await (0, import_prompts2.default)({
|
|
2243
|
+
name: "yes",
|
|
2244
|
+
type: "confirm",
|
|
2245
|
+
message: "Bump?",
|
|
2246
|
+
initial: true
|
|
2247
|
+
}).then((r) => r.yes))
|
|
2248
|
+
process.exit(1);
|
|
2249
|
+
}
|
|
734
2250
|
await runNpmScript("preversion" /* PreVersion */, operation);
|
|
735
2251
|
await updateFiles(operation);
|
|
736
2252
|
if (operation.options.execute) {
|
|
@@ -745,6 +2261,30 @@ async function versionBump(arg = {}) {
|
|
|
745
2261
|
await gitPush(operation);
|
|
746
2262
|
return operation.results;
|
|
747
2263
|
}
|
|
2264
|
+
function printSummary(operation) {
|
|
2265
|
+
console.log();
|
|
2266
|
+
console.log(` files ${operation.options.files.map((i) => (0, import_kleur2.bold)(i)).join(", ")}`);
|
|
2267
|
+
if (operation.options.commit)
|
|
2268
|
+
console.log(` commit ${(0, import_kleur2.bold)(formatVersionString(operation.options.commit.message, operation.state.newVersion))}`);
|
|
2269
|
+
if (operation.options.tag)
|
|
2270
|
+
console.log(` tag ${(0, import_kleur2.bold)(formatVersionString(operation.options.tag.name, operation.state.newVersion))}`);
|
|
2271
|
+
if (operation.options.execute)
|
|
2272
|
+
console.log(` execute ${(0, import_kleur2.bold)(operation.options.execute)}`);
|
|
2273
|
+
if (operation.options.push)
|
|
2274
|
+
console.log(` push ${(0, import_kleur2.cyan)((0, import_kleur2.bold)("yes"))}`);
|
|
2275
|
+
console.log();
|
|
2276
|
+
console.log(` from ${(0, import_kleur2.bold)(operation.state.oldVersion)}`);
|
|
2277
|
+
console.log(` to ${(0, import_kleur2.green)((0, import_kleur2.bold)(operation.state.newVersion))}`);
|
|
2278
|
+
console.log();
|
|
2279
|
+
}
|
|
2280
|
+
async function versionBumpInfo(arg = {}) {
|
|
2281
|
+
if (typeof arg === "string")
|
|
2282
|
+
arg = { release: arg };
|
|
2283
|
+
const operation = await Operation.start(arg);
|
|
2284
|
+
await getOldVersion(operation);
|
|
2285
|
+
await getNewVersion(operation);
|
|
2286
|
+
return operation;
|
|
2287
|
+
}
|
|
748
2288
|
|
|
749
2289
|
// src/types/version-bump-options.ts
|
|
750
2290
|
init_cjs_shims();
|
|
@@ -760,5 +2300,6 @@ module.exports = __toCommonJS(src_exports);
|
|
|
760
2300
|
NpmScript,
|
|
761
2301
|
ProgressEvent,
|
|
762
2302
|
ReleaseType,
|
|
763
|
-
versionBump
|
|
2303
|
+
versionBump,
|
|
2304
|
+
versionBumpInfo
|
|
764
2305
|
});
|