bumpp 8.2.1 → 9.1.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/README.md +10 -0
- package/dist/chunk-L3LY4KGC.mjs +1288 -0
- package/dist/cli/index.js +658 -1679
- package/dist/cli/index.mjs +28 -32
- package/dist/index.d.ts +12 -2
- package/dist/index.js +648 -1647
- package/dist/index.mjs +7 -11
- package/package.json +22 -21
- package/dist/chunk-DW6HTJ47.mjs +0 -2281
package/dist/index.js
CHANGED
|
@@ -21,7 +21,6 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __objRest = (source, exclude) => {
|
|
26
25
|
var target = {};
|
|
27
26
|
for (var prop in source)
|
|
@@ -34,9 +33,6 @@ var __objRest = (source, exclude) => {
|
|
|
34
33
|
}
|
|
35
34
|
return target;
|
|
36
35
|
};
|
|
37
|
-
var __esm = (fn, res) => function __init() {
|
|
38
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
39
|
-
};
|
|
40
36
|
var __commonJS = (cb, mod) => function __require() {
|
|
41
37
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
42
38
|
};
|
|
@@ -44,1663 +40,613 @@ var __export = (target, all) => {
|
|
|
44
40
|
for (var name in all)
|
|
45
41
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
46
42
|
};
|
|
47
|
-
var
|
|
48
|
-
if (
|
|
49
|
-
for (let key of __getOwnPropNames(
|
|
50
|
-
if (!__hasOwnProp.call(
|
|
51
|
-
__defProp(
|
|
43
|
+
var __copyProps = (to, from, except, desc) => {
|
|
44
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
45
|
+
for (let key of __getOwnPropNames(from))
|
|
46
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
47
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
52
48
|
}
|
|
53
|
-
return
|
|
54
|
-
};
|
|
55
|
-
var __toESM = (module2, isNodeMode) => {
|
|
56
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
49
|
+
return to;
|
|
57
50
|
};
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
52
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
53
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
54
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
55
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
56
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
57
|
+
mod
|
|
58
|
+
));
|
|
59
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
63
60
|
|
|
64
|
-
// node_modules/.pnpm/
|
|
65
|
-
var
|
|
66
|
-
"node_modules/.pnpm/
|
|
61
|
+
// node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js
|
|
62
|
+
var require_picocolors = __commonJS({
|
|
63
|
+
"node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js"(exports, module2) {
|
|
64
|
+
var tty2 = require("tty");
|
|
65
|
+
var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
|
|
66
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
67
|
+
let string = "" + input;
|
|
68
|
+
let index = string.indexOf(close, open.length);
|
|
69
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
70
|
+
};
|
|
71
|
+
var replaceClose = (string, close, replace, index) => {
|
|
72
|
+
let start = string.substring(0, index) + replace;
|
|
73
|
+
let end = string.substring(index + close.length);
|
|
74
|
+
let nextIndex = end.indexOf(close);
|
|
75
|
+
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
76
|
+
};
|
|
77
|
+
var createColors = (enabled = isColorSupported) => ({
|
|
78
|
+
isColorSupported: enabled,
|
|
79
|
+
reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
|
|
80
|
+
bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
|
|
81
|
+
dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
|
|
82
|
+
italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
|
|
83
|
+
underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
|
|
84
|
+
inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
|
|
85
|
+
hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
|
|
86
|
+
strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
|
|
87
|
+
black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
|
|
88
|
+
red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
|
|
89
|
+
green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
|
|
90
|
+
yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
|
|
91
|
+
blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
|
|
92
|
+
magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
|
|
93
|
+
cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
|
|
94
|
+
white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
|
|
95
|
+
gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
|
|
96
|
+
bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
|
|
97
|
+
bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
|
|
98
|
+
bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
|
|
99
|
+
bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
|
|
100
|
+
bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
|
|
101
|
+
bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
|
|
102
|
+
bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
|
|
103
|
+
bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
|
|
104
|
+
});
|
|
105
|
+
module2.exports = createColors();
|
|
106
|
+
module2.exports.createColors = createColors;
|
|
67
107
|
}
|
|
68
108
|
});
|
|
69
109
|
|
|
70
|
-
//
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
}
|
|
110
|
+
// src/index.ts
|
|
111
|
+
var src_exports = {};
|
|
112
|
+
__export(src_exports, {
|
|
113
|
+
NpmScript: () => NpmScript,
|
|
114
|
+
ProgressEvent: () => ProgressEvent,
|
|
115
|
+
ReleaseType: () => import_semver.ReleaseType,
|
|
116
|
+
bumpConfigDefaults: () => bumpConfigDefaults,
|
|
117
|
+
default: () => src_default,
|
|
118
|
+
defineConfig: () => defineConfig,
|
|
119
|
+
loadBumpConfig: () => loadBumpConfig,
|
|
120
|
+
versionBump: () => versionBump,
|
|
121
|
+
versionBumpInfo: () => versionBumpInfo
|
|
226
122
|
});
|
|
123
|
+
module.exports = __toCommonJS(src_exports);
|
|
227
124
|
|
|
228
|
-
//
|
|
229
|
-
var
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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;
|
|
125
|
+
// src/version-bump.ts
|
|
126
|
+
var ezSpawn3 = __toESM(require("@jsdevtools/ez-spawn"));
|
|
127
|
+
var import_picocolors2 = __toESM(require_picocolors());
|
|
128
|
+
|
|
129
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
130
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
131
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
132
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
133
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
134
|
+
var styles = {
|
|
135
|
+
modifier: {
|
|
136
|
+
reset: [0, 0],
|
|
137
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
138
|
+
bold: [1, 22],
|
|
139
|
+
dim: [2, 22],
|
|
140
|
+
italic: [3, 23],
|
|
141
|
+
underline: [4, 24],
|
|
142
|
+
overline: [53, 55],
|
|
143
|
+
inverse: [7, 27],
|
|
144
|
+
hidden: [8, 28],
|
|
145
|
+
strikethrough: [9, 29]
|
|
146
|
+
},
|
|
147
|
+
color: {
|
|
148
|
+
black: [30, 39],
|
|
149
|
+
red: [31, 39],
|
|
150
|
+
green: [32, 39],
|
|
151
|
+
yellow: [33, 39],
|
|
152
|
+
blue: [34, 39],
|
|
153
|
+
magenta: [35, 39],
|
|
154
|
+
cyan: [36, 39],
|
|
155
|
+
white: [37, 39],
|
|
156
|
+
// Bright color
|
|
157
|
+
blackBright: [90, 39],
|
|
158
|
+
gray: [90, 39],
|
|
159
|
+
// Alias of `blackBright`
|
|
160
|
+
grey: [90, 39],
|
|
161
|
+
// Alias of `blackBright`
|
|
162
|
+
redBright: [91, 39],
|
|
163
|
+
greenBright: [92, 39],
|
|
164
|
+
yellowBright: [93, 39],
|
|
165
|
+
blueBright: [94, 39],
|
|
166
|
+
magentaBright: [95, 39],
|
|
167
|
+
cyanBright: [96, 39],
|
|
168
|
+
whiteBright: [97, 39]
|
|
169
|
+
},
|
|
170
|
+
bgColor: {
|
|
171
|
+
bgBlack: [40, 49],
|
|
172
|
+
bgRed: [41, 49],
|
|
173
|
+
bgGreen: [42, 49],
|
|
174
|
+
bgYellow: [43, 49],
|
|
175
|
+
bgBlue: [44, 49],
|
|
176
|
+
bgMagenta: [45, 49],
|
|
177
|
+
bgCyan: [46, 49],
|
|
178
|
+
bgWhite: [47, 49],
|
|
179
|
+
// Bright color
|
|
180
|
+
bgBlackBright: [100, 49],
|
|
181
|
+
bgGray: [100, 49],
|
|
182
|
+
// Alias of `bgBlackBright`
|
|
183
|
+
bgGrey: [100, 49],
|
|
184
|
+
// Alias of `bgBlackBright`
|
|
185
|
+
bgRedBright: [101, 49],
|
|
186
|
+
bgGreenBright: [102, 49],
|
|
187
|
+
bgYellowBright: [103, 49],
|
|
188
|
+
bgBlueBright: [104, 49],
|
|
189
|
+
bgMagentaBright: [105, 49],
|
|
190
|
+
bgCyanBright: [106, 49],
|
|
191
|
+
bgWhiteBright: [107, 49]
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
195
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
196
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
197
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
198
|
+
function assembleStyles() {
|
|
199
|
+
const codes = /* @__PURE__ */ new Map();
|
|
200
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
201
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
202
|
+
styles[styleName] = {
|
|
203
|
+
open: `\x1B[${style[0]}m`,
|
|
204
|
+
close: `\x1B[${style[1]}m`
|
|
316
205
|
};
|
|
317
|
-
|
|
318
|
-
|
|
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;
|
|
206
|
+
group[styleName] = styles[styleName];
|
|
207
|
+
codes.set(style[0], style[1]);
|
|
365
208
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
209
|
+
Object.defineProperty(styles, groupName, {
|
|
210
|
+
value: group,
|
|
211
|
+
enumerable: false
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
Object.defineProperty(styles, "codes", {
|
|
215
|
+
value: codes,
|
|
216
|
+
enumerable: false
|
|
217
|
+
});
|
|
218
|
+
styles.color.close = "\x1B[39m";
|
|
219
|
+
styles.bgColor.close = "\x1B[49m";
|
|
220
|
+
styles.color.ansi = wrapAnsi16();
|
|
221
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
222
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
223
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
224
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
225
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
226
|
+
Object.defineProperties(styles, {
|
|
227
|
+
rgbToAnsi256: {
|
|
228
|
+
value(red, green, blue) {
|
|
229
|
+
if (red === green && green === blue) {
|
|
230
|
+
if (red < 8) {
|
|
231
|
+
return 16;
|
|
232
|
+
}
|
|
233
|
+
if (red > 248) {
|
|
234
|
+
return 231;
|
|
235
|
+
}
|
|
236
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
379
237
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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++;
|
|
238
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
239
|
+
},
|
|
240
|
+
enumerable: false
|
|
241
|
+
},
|
|
242
|
+
hexToRgb: {
|
|
243
|
+
value(hex) {
|
|
244
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
245
|
+
if (!matches) {
|
|
246
|
+
return [0, 0, 0];
|
|
436
247
|
}
|
|
437
|
-
|
|
438
|
-
|
|
248
|
+
let [colorString] = matches;
|
|
249
|
+
if (colorString.length === 3) {
|
|
250
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
439
251
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
252
|
+
const integer = Number.parseInt(colorString, 16);
|
|
253
|
+
return [
|
|
254
|
+
/* eslint-disable no-bitwise */
|
|
255
|
+
integer >> 16 & 255,
|
|
256
|
+
integer >> 8 & 255,
|
|
257
|
+
integer & 255
|
|
258
|
+
/* eslint-enable no-bitwise */
|
|
259
|
+
];
|
|
260
|
+
},
|
|
261
|
+
enumerable: false
|
|
262
|
+
},
|
|
263
|
+
hexToAnsi256: {
|
|
264
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
265
|
+
enumerable: false
|
|
266
|
+
},
|
|
267
|
+
ansi256ToAnsi: {
|
|
268
|
+
value(code) {
|
|
269
|
+
if (code < 8) {
|
|
270
|
+
return 30 + code;
|
|
448
271
|
}
|
|
449
|
-
|
|
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;
|
|
272
|
+
if (code < 16) {
|
|
273
|
+
return 90 + (code - 8);
|
|
671
274
|
}
|
|
672
|
-
|
|
673
|
-
|
|
275
|
+
let red;
|
|
276
|
+
let green;
|
|
277
|
+
let blue;
|
|
278
|
+
if (code >= 232) {
|
|
279
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
280
|
+
green = red;
|
|
281
|
+
blue = red;
|
|
282
|
+
} else {
|
|
283
|
+
code -= 16;
|
|
284
|
+
const remainder = code % 36;
|
|
285
|
+
red = Math.floor(code / 36) / 5;
|
|
286
|
+
green = Math.floor(remainder / 6) / 5;
|
|
287
|
+
blue = remainder % 6 / 5;
|
|
674
288
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
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;
|
|
289
|
+
const value = Math.max(red, green, blue) * 2;
|
|
290
|
+
if (value === 0) {
|
|
291
|
+
return 30;
|
|
685
292
|
}
|
|
686
|
-
|
|
687
|
-
|
|
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
|
-
}
|
|
293
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
294
|
+
if (value === 2) {
|
|
295
|
+
result += 60;
|
|
931
296
|
}
|
|
932
|
-
|
|
933
|
-
|
|
297
|
+
return result;
|
|
298
|
+
},
|
|
299
|
+
enumerable: false
|
|
300
|
+
},
|
|
301
|
+
rgbToAnsi: {
|
|
302
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
303
|
+
enumerable: false
|
|
304
|
+
},
|
|
305
|
+
hexToAnsi: {
|
|
306
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
307
|
+
enumerable: false
|
|
934
308
|
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
309
|
+
});
|
|
310
|
+
return styles;
|
|
311
|
+
}
|
|
312
|
+
var ansiStyles = assembleStyles();
|
|
313
|
+
var ansi_styles_default = ansiStyles;
|
|
314
|
+
|
|
315
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
316
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
317
|
+
var import_node_os = __toESM(require("os"), 1);
|
|
318
|
+
var import_node_tty = __toESM(require("tty"), 1);
|
|
319
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
|
|
320
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
321
|
+
const position = argv.indexOf(prefix + flag);
|
|
322
|
+
const terminatorPosition = argv.indexOf("--");
|
|
323
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
324
|
+
}
|
|
325
|
+
var { env } = import_node_process.default;
|
|
326
|
+
var flagForceColor;
|
|
327
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
328
|
+
flagForceColor = 0;
|
|
329
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
330
|
+
flagForceColor = 1;
|
|
331
|
+
}
|
|
332
|
+
function envForceColor() {
|
|
333
|
+
if ("FORCE_COLOR" in env) {
|
|
334
|
+
if (env.FORCE_COLOR === "true") {
|
|
335
|
+
return 1;
|
|
939
336
|
}
|
|
940
|
-
|
|
941
|
-
|
|
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;
|
|
337
|
+
if (env.FORCE_COLOR === "false") {
|
|
338
|
+
return 0;
|
|
951
339
|
}
|
|
952
|
-
|
|
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
|
-
};
|
|
340
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
966
341
|
}
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
return wrappedFn;
|
|
342
|
+
}
|
|
343
|
+
function translateLevel(level) {
|
|
344
|
+
if (level === 0) {
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
return {
|
|
348
|
+
level,
|
|
349
|
+
hasBasic: true,
|
|
350
|
+
has256: level >= 2,
|
|
351
|
+
has16m: level >= 3
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
355
|
+
const noFlagForceColor = envForceColor();
|
|
356
|
+
if (noFlagForceColor !== void 0) {
|
|
357
|
+
flagForceColor = noFlagForceColor;
|
|
358
|
+
}
|
|
359
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
360
|
+
if (forceColor === 0) {
|
|
361
|
+
return 0;
|
|
362
|
+
}
|
|
363
|
+
if (sniffFlags) {
|
|
364
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
365
|
+
return 3;
|
|
992
366
|
}
|
|
993
|
-
|
|
994
|
-
|
|
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;
|
|
367
|
+
if (hasFlag("color=256")) {
|
|
368
|
+
return 2;
|
|
1014
369
|
}
|
|
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
370
|
}
|
|
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
|
-
});
|
|
371
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
372
|
+
return 1;
|
|
1168
373
|
}
|
|
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
|
-
};
|
|
374
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
375
|
+
return 0;
|
|
1182
376
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
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;
|
|
377
|
+
const min = forceColor || 0;
|
|
378
|
+
if (env.TERM === "dumb") {
|
|
379
|
+
return min;
|
|
380
|
+
}
|
|
381
|
+
if (import_node_process.default.platform === "win32") {
|
|
382
|
+
const osRelease = import_node_os.default.release().split(".");
|
|
383
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
384
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1199
385
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
} else {
|
|
1206
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
1207
|
-
}
|
|
386
|
+
return 1;
|
|
387
|
+
}
|
|
388
|
+
if ("CI" in env) {
|
|
389
|
+
if ("GITHUB_ACTIONS" in env) {
|
|
390
|
+
return 3;
|
|
1208
391
|
}
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
return false;
|
|
1212
|
-
}
|
|
1213
|
-
return {
|
|
1214
|
-
level,
|
|
1215
|
-
hasBasic: true,
|
|
1216
|
-
has256: level >= 2,
|
|
1217
|
-
has16m: level >= 3
|
|
1218
|
-
};
|
|
392
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
393
|
+
return 1;
|
|
1219
394
|
}
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
return
|
|
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
|
-
}
|
|
395
|
+
return min;
|
|
396
|
+
}
|
|
397
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
398
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
399
|
+
}
|
|
400
|
+
if (env.COLORTERM === "truecolor") {
|
|
401
|
+
return 3;
|
|
402
|
+
}
|
|
403
|
+
if (env.TERM === "xterm-kitty") {
|
|
404
|
+
return 3;
|
|
405
|
+
}
|
|
406
|
+
if ("TERM_PROGRAM" in env) {
|
|
407
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
408
|
+
switch (env.TERM_PROGRAM) {
|
|
409
|
+
case "iTerm.app": {
|
|
410
|
+
return version >= 3 ? 3 : 2;
|
|
1264
411
|
}
|
|
1265
|
-
|
|
412
|
+
case "Apple_Terminal": {
|
|
1266
413
|
return 2;
|
|
1267
414
|
}
|
|
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
415
|
}
|
|
1280
|
-
module2.exports = {
|
|
1281
|
-
supportsColor: getSupportLevel,
|
|
1282
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
1283
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
1284
|
-
};
|
|
1285
416
|
}
|
|
1286
|
-
|
|
417
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
418
|
+
return 2;
|
|
419
|
+
}
|
|
420
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
421
|
+
return 1;
|
|
422
|
+
}
|
|
423
|
+
if ("COLORTERM" in env) {
|
|
424
|
+
return 1;
|
|
425
|
+
}
|
|
426
|
+
return min;
|
|
427
|
+
}
|
|
428
|
+
function createSupportsColor(stream, options = {}) {
|
|
429
|
+
const level = _supportsColor(stream, __spreadValues({
|
|
430
|
+
streamIsTTY: stream && stream.isTTY
|
|
431
|
+
}, options));
|
|
432
|
+
return translateLevel(level);
|
|
433
|
+
}
|
|
434
|
+
var supportsColor = {
|
|
435
|
+
stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
|
|
436
|
+
stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
|
|
437
|
+
};
|
|
438
|
+
var supports_color_default = supportsColor;
|
|
1287
439
|
|
|
1288
|
-
// node_modules/.pnpm/chalk@
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
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
|
-
};
|
|
440
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/utilities.js
|
|
441
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
442
|
+
let index = string.indexOf(substring);
|
|
443
|
+
if (index === -1) {
|
|
444
|
+
return string;
|
|
1325
445
|
}
|
|
1326
|
-
|
|
446
|
+
const substringLength = substring.length;
|
|
447
|
+
let endIndex = 0;
|
|
448
|
+
let returnValue = "";
|
|
449
|
+
do {
|
|
450
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
451
|
+
endIndex = index + substringLength;
|
|
452
|
+
index = string.indexOf(substring, endIndex);
|
|
453
|
+
} while (index !== -1);
|
|
454
|
+
returnValue += string.slice(endIndex);
|
|
455
|
+
return returnValue;
|
|
456
|
+
}
|
|
457
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
458
|
+
let endIndex = 0;
|
|
459
|
+
let returnValue = "";
|
|
460
|
+
do {
|
|
461
|
+
const gotCR = string[index - 1] === "\r";
|
|
462
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
463
|
+
endIndex = index + 1;
|
|
464
|
+
index = string.indexOf("\n", endIndex);
|
|
465
|
+
} while (index !== -1);
|
|
466
|
+
returnValue += string.slice(endIndex);
|
|
467
|
+
return returnValue;
|
|
468
|
+
}
|
|
1327
469
|
|
|
1328
|
-
// node_modules/.pnpm/chalk@
|
|
1329
|
-
var
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
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;
|
|
470
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js
|
|
471
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
472
|
+
var GENERATOR = Symbol("GENERATOR");
|
|
473
|
+
var STYLER = Symbol("STYLER");
|
|
474
|
+
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
475
|
+
var levelMapping = [
|
|
476
|
+
"ansi",
|
|
477
|
+
"ansi",
|
|
478
|
+
"ansi256",
|
|
479
|
+
"ansi16m"
|
|
480
|
+
];
|
|
481
|
+
var styles2 = /* @__PURE__ */ Object.create(null);
|
|
482
|
+
var applyOptions = (object, options = {}) => {
|
|
483
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
484
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
485
|
+
}
|
|
486
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
487
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
488
|
+
};
|
|
489
|
+
var chalkFactory = (options) => {
|
|
490
|
+
const chalk2 = (...strings) => strings.join(" ");
|
|
491
|
+
applyOptions(chalk2, options);
|
|
492
|
+
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
493
|
+
return chalk2;
|
|
494
|
+
};
|
|
495
|
+
function createChalk(options) {
|
|
496
|
+
return chalkFactory(options);
|
|
497
|
+
}
|
|
498
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
499
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
500
|
+
styles2[styleName] = {
|
|
501
|
+
get() {
|
|
502
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
503
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
504
|
+
return builder;
|
|
1375
505
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
return results;
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
styles2.visible = {
|
|
509
|
+
get() {
|
|
510
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
511
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
512
|
+
return builder;
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
516
|
+
if (model === "rgb") {
|
|
517
|
+
if (level === "ansi16m") {
|
|
518
|
+
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
1390
519
|
}
|
|
1391
|
-
|
|
1392
|
-
|
|
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;
|
|
520
|
+
if (level === "ansi256") {
|
|
521
|
+
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
1409
522
|
}
|
|
1410
|
-
|
|
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("");
|
|
1439
|
-
};
|
|
523
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
1440
524
|
}
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
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
|
-
}
|
|
525
|
+
if (model === "hex") {
|
|
526
|
+
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
527
|
+
}
|
|
528
|
+
return ansi_styles_default[type][model](...arguments_);
|
|
529
|
+
};
|
|
530
|
+
var usedModels = ["rgb", "hex", "ansi256"];
|
|
531
|
+
for (const model of usedModels) {
|
|
532
|
+
styles2[model] = {
|
|
533
|
+
get() {
|
|
534
|
+
const { level } = this;
|
|
535
|
+
return function(...arguments_) {
|
|
536
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
537
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
1496
538
|
};
|
|
1497
539
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
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
|
-
}
|
|
540
|
+
};
|
|
541
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
542
|
+
styles2[bgModel] = {
|
|
543
|
+
get() {
|
|
544
|
+
const { level } = this;
|
|
545
|
+
return function(...arguments_) {
|
|
546
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
547
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
1515
548
|
};
|
|
1516
549
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
var proto = Object.defineProperties(() => {
|
|
553
|
+
}, __spreadProps(__spreadValues({}, styles2), {
|
|
554
|
+
level: {
|
|
555
|
+
enumerable: true,
|
|
556
|
+
get() {
|
|
557
|
+
return this[GENERATOR].level;
|
|
558
|
+
},
|
|
559
|
+
set(level) {
|
|
560
|
+
this[GENERATOR].level = level;
|
|
1528
561
|
}
|
|
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;
|
|
1615
562
|
}
|
|
1616
|
-
});
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
}
|
|
1627
|
-
return Boolean(process.env.CI) || Boolean(process.env.WT_SESSION) || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty";
|
|
1628
|
-
};
|
|
563
|
+
}));
|
|
564
|
+
var createStyler = (open, close, parent) => {
|
|
565
|
+
let openAll;
|
|
566
|
+
let closeAll;
|
|
567
|
+
if (parent === void 0) {
|
|
568
|
+
openAll = open;
|
|
569
|
+
closeAll = close;
|
|
570
|
+
} else {
|
|
571
|
+
openAll = parent.openAll + open;
|
|
572
|
+
closeAll = close + parent.closeAll;
|
|
1629
573
|
}
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
error: chalk.red("\xD7")
|
|
1650
|
-
};
|
|
1651
|
-
module2.exports = isUnicodeSupported() ? main : fallback;
|
|
574
|
+
return {
|
|
575
|
+
open,
|
|
576
|
+
close,
|
|
577
|
+
openAll,
|
|
578
|
+
closeAll,
|
|
579
|
+
parent
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
583
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
584
|
+
Object.setPrototypeOf(builder, proto);
|
|
585
|
+
builder[GENERATOR] = self;
|
|
586
|
+
builder[STYLER] = _styler;
|
|
587
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
588
|
+
return builder;
|
|
589
|
+
};
|
|
590
|
+
var applyStyle = (self, string) => {
|
|
591
|
+
if (self.level <= 0 || !string) {
|
|
592
|
+
return self[IS_EMPTY] ? "" : string;
|
|
1652
593
|
}
|
|
1653
|
-
|
|
594
|
+
let styler = self[STYLER];
|
|
595
|
+
if (styler === void 0) {
|
|
596
|
+
return string;
|
|
597
|
+
}
|
|
598
|
+
const { openAll, closeAll } = styler;
|
|
599
|
+
if (string.includes("\x1B")) {
|
|
600
|
+
while (styler !== void 0) {
|
|
601
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
602
|
+
styler = styler.parent;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
const lfIndex = string.indexOf("\n");
|
|
606
|
+
if (lfIndex !== -1) {
|
|
607
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
608
|
+
}
|
|
609
|
+
return openAll + string + closeAll;
|
|
610
|
+
};
|
|
611
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
|
612
|
+
var chalk = createChalk();
|
|
613
|
+
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
614
|
+
var source_default = chalk;
|
|
1654
615
|
|
|
1655
|
-
// node_modules/.pnpm/
|
|
1656
|
-
var
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
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";
|
|
616
|
+
// node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js
|
|
617
|
+
var import_node_process2 = __toESM(require("process"), 1);
|
|
618
|
+
function isUnicodeSupported() {
|
|
619
|
+
if (import_node_process2.default.platform !== "win32") {
|
|
620
|
+
return import_node_process2.default.env.TERM !== "linux";
|
|
1674
621
|
}
|
|
1675
|
-
}
|
|
622
|
+
return Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
623
|
+
}
|
|
1676
624
|
|
|
1677
|
-
//
|
|
1678
|
-
var
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
625
|
+
// node_modules/.pnpm/log-symbols@5.1.0/node_modules/log-symbols/index.js
|
|
626
|
+
var main = {
|
|
627
|
+
info: source_default.blue("\u2139"),
|
|
628
|
+
success: source_default.green("\u2714"),
|
|
629
|
+
warning: source_default.yellow("\u26A0"),
|
|
630
|
+
error: source_default.red("\u2716")
|
|
631
|
+
};
|
|
632
|
+
var fallback = {
|
|
633
|
+
info: source_default.blue("i"),
|
|
634
|
+
success: source_default.green("\u221A"),
|
|
635
|
+
warning: source_default.yellow("\u203C"),
|
|
636
|
+
error: source_default.red("\xD7")
|
|
637
|
+
};
|
|
638
|
+
var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
639
|
+
var log_symbols_default = logSymbols;
|
|
1688
640
|
|
|
1689
641
|
// src/version-bump.ts
|
|
1690
|
-
init_cjs_shims();
|
|
1691
|
-
var ezSpawn3 = __toESM(require("@jsdevtools/ez-spawn"));
|
|
1692
|
-
var import_kleur2 = require("kleur");
|
|
1693
|
-
var import_log_symbols = __toESM(require_log_symbols());
|
|
1694
642
|
var import_prompts2 = __toESM(require("prompts"));
|
|
1695
643
|
|
|
1696
644
|
// src/get-new-version.ts
|
|
1697
|
-
|
|
1698
|
-
var import_kleur = require("kleur");
|
|
645
|
+
var import_picocolors = __toESM(require_picocolors());
|
|
1699
646
|
var import_prompts = __toESM(require("prompts"));
|
|
1700
647
|
var import_semver2 = __toESM(require("semver"));
|
|
1701
648
|
|
|
1702
649
|
// src/release-type.ts
|
|
1703
|
-
init_cjs_shims();
|
|
1704
650
|
var import_semver = require("semver");
|
|
1705
651
|
var prereleaseTypes = ["premajor", "preminor", "prepatch", "prerelease"];
|
|
1706
652
|
var releaseTypes = prereleaseTypes.concat(["major", "minor", "patch"]);
|
|
@@ -1758,17 +704,17 @@ async function promptForNewVersion(operation) {
|
|
|
1758
704
|
{
|
|
1759
705
|
type: "autocomplete",
|
|
1760
706
|
name: "release",
|
|
1761
|
-
message: `Current version ${
|
|
707
|
+
message: `Current version ${import_picocolors.default.green(oldVersion)}`,
|
|
1762
708
|
initial: "next",
|
|
1763
709
|
choices: [
|
|
1764
|
-
{ value: "major", title: `${"major".padStart(PADDING, " ")} ${
|
|
1765
|
-
{ value: "minor", title: `${"minor".padStart(PADDING, " ")} ${
|
|
1766
|
-
{ value: "patch", title: `${"patch".padStart(PADDING, " ")} ${
|
|
1767
|
-
{ value: "next", title: `${"next".padStart(PADDING, " ")} ${
|
|
1768
|
-
{ value: "prepatch", title: `${"pre-patch".padStart(PADDING, " ")} ${
|
|
1769
|
-
{ value: "preminor", title: `${"pre-minor".padStart(PADDING, " ")} ${
|
|
1770
|
-
{ value: "premajor", title: `${"pre-major".padStart(PADDING, " ")} ${
|
|
1771
|
-
{ value: "none", title: `${"as-is".padStart(PADDING, " ")} ${
|
|
710
|
+
{ value: "major", title: `${"major".padStart(PADDING, " ")} ${import_picocolors.default.bold(next.major)}` },
|
|
711
|
+
{ value: "minor", title: `${"minor".padStart(PADDING, " ")} ${import_picocolors.default.bold(next.minor)}` },
|
|
712
|
+
{ value: "patch", title: `${"patch".padStart(PADDING, " ")} ${import_picocolors.default.bold(next.patch)}` },
|
|
713
|
+
{ value: "next", title: `${"next".padStart(PADDING, " ")} ${import_picocolors.default.bold(next.next)}` },
|
|
714
|
+
{ value: "prepatch", title: `${"pre-patch".padStart(PADDING, " ")} ${import_picocolors.default.bold(next.prepatch)}` },
|
|
715
|
+
{ value: "preminor", title: `${"pre-minor".padStart(PADDING, " ")} ${import_picocolors.default.bold(next.preminor)}` },
|
|
716
|
+
{ value: "premajor", title: `${"pre-major".padStart(PADDING, " ")} ${import_picocolors.default.bold(next.premajor)}` },
|
|
717
|
+
{ value: "none", title: `${"as-is".padStart(PADDING, " ")} ${import_picocolors.default.bold(oldVersion)}` },
|
|
1772
718
|
{ value: "custom", title: "custom ...".padStart(PADDING + 4, " ") }
|
|
1773
719
|
]
|
|
1774
720
|
},
|
|
@@ -1796,16 +742,13 @@ async function promptForNewVersion(operation) {
|
|
|
1796
742
|
}
|
|
1797
743
|
|
|
1798
744
|
// src/get-old-version.ts
|
|
1799
|
-
init_cjs_shims();
|
|
1800
745
|
var import_semver3 = require("semver");
|
|
1801
746
|
|
|
1802
747
|
// src/fs.ts
|
|
1803
|
-
|
|
1804
|
-
var
|
|
1805
|
-
var import_path = __toESM(require("path"));
|
|
748
|
+
var import_node_fs = __toESM(require("fs"));
|
|
749
|
+
var import_node_path = __toESM(require("path"));
|
|
1806
750
|
|
|
1807
|
-
// node_modules/.pnpm/detect-indent@7.0.
|
|
1808
|
-
init_cjs_shims();
|
|
751
|
+
// node_modules/.pnpm/detect-indent@7.0.1/node_modules/detect-indent/index.js
|
|
1809
752
|
var INDENT_REGEX = /^(?:( )+|\t+)/;
|
|
1810
753
|
var INDENT_TYPE_SPACE = "space";
|
|
1811
754
|
var INDENT_TYPE_TAB = "tab";
|
|
@@ -1820,6 +763,7 @@ function makeIndentsMap(string, ignoreSingleSpaces) {
|
|
|
1820
763
|
}
|
|
1821
764
|
let indent;
|
|
1822
765
|
let indentType;
|
|
766
|
+
let use;
|
|
1823
767
|
let weight;
|
|
1824
768
|
let entry;
|
|
1825
769
|
const matches = line.match(INDENT_REGEX);
|
|
@@ -1836,17 +780,19 @@ function makeIndentsMap(string, ignoreSingleSpaces) {
|
|
|
1836
780
|
previousSize = 0;
|
|
1837
781
|
}
|
|
1838
782
|
previousIndentType = indentType;
|
|
783
|
+
use = 1;
|
|
1839
784
|
weight = 0;
|
|
1840
785
|
const indentDifference = indent - previousSize;
|
|
1841
786
|
previousSize = indent;
|
|
1842
787
|
if (indentDifference === 0) {
|
|
1843
|
-
|
|
788
|
+
use = 0;
|
|
789
|
+
weight = 1;
|
|
1844
790
|
} else {
|
|
1845
791
|
const absoluteIndentDifference = indentDifference > 0 ? indentDifference : -indentDifference;
|
|
1846
792
|
key = encodeIndentsKey(indentType, absoluteIndentDifference);
|
|
1847
793
|
}
|
|
1848
794
|
entry = indents.get(key);
|
|
1849
|
-
entry = entry === void 0 ? [1, 0] : [
|
|
795
|
+
entry = entry === void 0 ? [1, 0] : [entry[0] + use, entry[1] + weight];
|
|
1850
796
|
indents.set(key, entry);
|
|
1851
797
|
}
|
|
1852
798
|
}
|
|
@@ -1902,13 +848,26 @@ function detectIndent(string) {
|
|
|
1902
848
|
};
|
|
1903
849
|
}
|
|
1904
850
|
|
|
851
|
+
// node_modules/.pnpm/detect-newline@4.0.0/node_modules/detect-newline/index.js
|
|
852
|
+
function detectNewline(string) {
|
|
853
|
+
if (typeof string !== "string") {
|
|
854
|
+
throw new TypeError("Expected a string");
|
|
855
|
+
}
|
|
856
|
+
const newlines = string.match(/(?:\r?\n)/g) || [];
|
|
857
|
+
if (newlines.length === 0) {
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
const crlf = newlines.filter((newline) => newline === "\r\n").length;
|
|
861
|
+
const lf = newlines.length - crlf;
|
|
862
|
+
return crlf > lf ? "\r\n" : "\n";
|
|
863
|
+
}
|
|
864
|
+
|
|
1905
865
|
// src/fs.ts
|
|
1906
|
-
var import_detect_newline = __toESM(require_detect_newline());
|
|
1907
866
|
async function readJsonFile(name, cwd) {
|
|
1908
867
|
const file = await readTextFile(name, cwd);
|
|
1909
868
|
const data = JSON.parse(file.data);
|
|
1910
869
|
const indent = detectIndent(file.data).indent;
|
|
1911
|
-
const newline = (
|
|
870
|
+
const newline = detectNewline(file.data);
|
|
1912
871
|
return __spreadProps(__spreadValues({}, file), { data, indent, newline });
|
|
1913
872
|
}
|
|
1914
873
|
async function writeJsonFile(file) {
|
|
@@ -1919,8 +878,8 @@ async function writeJsonFile(file) {
|
|
|
1919
878
|
}
|
|
1920
879
|
function readTextFile(name, cwd) {
|
|
1921
880
|
return new Promise((resolve, reject) => {
|
|
1922
|
-
const filePath =
|
|
1923
|
-
|
|
881
|
+
const filePath = import_node_path.default.join(cwd, name);
|
|
882
|
+
import_node_fs.default.readFile(filePath, "utf8", (err, text) => {
|
|
1924
883
|
if (err) {
|
|
1925
884
|
reject(err);
|
|
1926
885
|
} else {
|
|
@@ -1934,7 +893,7 @@ function readTextFile(name, cwd) {
|
|
|
1934
893
|
}
|
|
1935
894
|
function writeTextFile(file) {
|
|
1936
895
|
return new Promise((resolve, reject) => {
|
|
1937
|
-
|
|
896
|
+
import_node_fs.default.writeFile(file.path, file.data, (err) => {
|
|
1938
897
|
if (err)
|
|
1939
898
|
reject(err);
|
|
1940
899
|
else
|
|
@@ -1944,7 +903,6 @@ function writeTextFile(file) {
|
|
|
1944
903
|
}
|
|
1945
904
|
|
|
1946
905
|
// src/manifest.ts
|
|
1947
|
-
init_cjs_shims();
|
|
1948
906
|
function isManifest(obj) {
|
|
1949
907
|
return obj && typeof obj === "object" && isOptionalString(obj.name) && isOptionalString(obj.version) && isOptionalString(obj.description);
|
|
1950
908
|
}
|
|
@@ -1968,7 +926,9 @@ async function getOldVersion(operation) {
|
|
|
1968
926
|
});
|
|
1969
927
|
}
|
|
1970
928
|
}
|
|
1971
|
-
throw new Error(
|
|
929
|
+
throw new Error(
|
|
930
|
+
`Unable to determine the current version number. Checked ${filesToCheck.join(", ")}.`
|
|
931
|
+
);
|
|
1972
932
|
}
|
|
1973
933
|
async function readVersion(file, cwd) {
|
|
1974
934
|
try {
|
|
@@ -1983,11 +943,9 @@ async function readVersion(file, cwd) {
|
|
|
1983
943
|
}
|
|
1984
944
|
|
|
1985
945
|
// src/git.ts
|
|
1986
|
-
init_cjs_shims();
|
|
1987
946
|
var ezSpawn = __toESM(require("@jsdevtools/ez-spawn"));
|
|
1988
947
|
|
|
1989
948
|
// src/types/version-bump-progress.ts
|
|
1990
|
-
init_cjs_shims();
|
|
1991
949
|
var ProgressEvent = /* @__PURE__ */ ((ProgressEvent2) => {
|
|
1992
950
|
ProgressEvent2["FileUpdated"] = "file updated";
|
|
1993
951
|
ProgressEvent2["FileSkipped"] = "file skipped";
|
|
@@ -2030,7 +988,10 @@ async function gitTag(operation) {
|
|
|
2030
988
|
const { commit, tag } = operation.options;
|
|
2031
989
|
const { newVersion } = operation.state;
|
|
2032
990
|
const args = [
|
|
991
|
+
// Create an annotated tag, which is recommended for releases.
|
|
992
|
+
// See https://git-scm.com/docs/git-tag
|
|
2033
993
|
"--annotate",
|
|
994
|
+
// Use the same commit message for the tag
|
|
2034
995
|
"--message",
|
|
2035
996
|
formatVersionString(commit.message, newVersion)
|
|
2036
997
|
];
|
|
@@ -2055,11 +1016,7 @@ function formatVersionString(template, newVersion) {
|
|
|
2055
1016
|
return template + newVersion;
|
|
2056
1017
|
}
|
|
2057
1018
|
|
|
2058
|
-
// src/operation.ts
|
|
2059
|
-
init_cjs_shims();
|
|
2060
|
-
|
|
2061
1019
|
// src/normalize-options.ts
|
|
2062
|
-
init_cjs_shims();
|
|
2063
1020
|
var import_fast_glob = __toESM(require("fast-glob"));
|
|
2064
1021
|
async function normalizeOptions(raw) {
|
|
2065
1022
|
var _a;
|
|
@@ -2087,7 +1044,16 @@ async function normalizeOptions(raw) {
|
|
|
2087
1044
|
commit = { all, noVerify, message: raw.commit };
|
|
2088
1045
|
else if (raw.commit || tag || push)
|
|
2089
1046
|
commit = { all, noVerify, message: "chore: release v" };
|
|
2090
|
-
const files = await (0, import_fast_glob.default)(
|
|
1047
|
+
const files = await (0, import_fast_glob.default)(
|
|
1048
|
+
((_a = raw.files) == null ? void 0 : _a.length) ? raw.files : ["package.json", "package-lock.json"],
|
|
1049
|
+
{
|
|
1050
|
+
cwd,
|
|
1051
|
+
onlyFiles: true,
|
|
1052
|
+
ignore: [
|
|
1053
|
+
"**/{.git,node_modules,bower_components,__tests__,fixtures,fixture}/**"
|
|
1054
|
+
]
|
|
1055
|
+
}
|
|
1056
|
+
);
|
|
2091
1057
|
let ui;
|
|
2092
1058
|
if (raw.interface === false) {
|
|
2093
1059
|
ui = { input: false, output: false };
|
|
@@ -2108,7 +1074,13 @@ async function normalizeOptions(raw) {
|
|
|
2108
1074
|
|
|
2109
1075
|
// src/operation.ts
|
|
2110
1076
|
var Operation = class {
|
|
1077
|
+
/**
|
|
1078
|
+
* Private constructor. Use the `Operation.start()` static method instead.
|
|
1079
|
+
*/
|
|
2111
1080
|
constructor(options, progress) {
|
|
1081
|
+
/**
|
|
1082
|
+
* The current state of the operation.
|
|
1083
|
+
*/
|
|
2112
1084
|
this.state = {
|
|
2113
1085
|
release: void 0,
|
|
2114
1086
|
oldVersion: "",
|
|
@@ -2122,6 +1094,9 @@ var Operation = class {
|
|
|
2122
1094
|
this.options = options;
|
|
2123
1095
|
this._progress = progress;
|
|
2124
1096
|
}
|
|
1097
|
+
/**
|
|
1098
|
+
* The results of the operation.
|
|
1099
|
+
*/
|
|
2125
1100
|
get results() {
|
|
2126
1101
|
const options = this.options;
|
|
2127
1102
|
const state = this.state;
|
|
@@ -2135,10 +1110,16 @@ var Operation = class {
|
|
|
2135
1110
|
skippedFiles: state.skippedFiles.slice()
|
|
2136
1111
|
};
|
|
2137
1112
|
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Starts a new `versionBump()` operation.
|
|
1115
|
+
*/
|
|
2138
1116
|
static async start(input) {
|
|
2139
1117
|
const options = await normalizeOptions(input);
|
|
2140
1118
|
return new Operation(options, input.progress);
|
|
2141
1119
|
}
|
|
1120
|
+
/**
|
|
1121
|
+
* Updates the operation state and results, and reports the updated progress to the user.
|
|
1122
|
+
*/
|
|
2142
1123
|
update(_a) {
|
|
2143
1124
|
var _b = _a, { event, script } = _b, newState = __objRest(_b, ["event", "script"]);
|
|
2144
1125
|
Object.assign(this.state, newState);
|
|
@@ -2150,7 +1131,6 @@ var Operation = class {
|
|
|
2150
1131
|
};
|
|
2151
1132
|
|
|
2152
1133
|
// src/run-npm-script.ts
|
|
2153
|
-
init_cjs_shims();
|
|
2154
1134
|
var ezSpawn2 = __toESM(require("@jsdevtools/ez-spawn"));
|
|
2155
1135
|
async function runNpmScript(script, operation) {
|
|
2156
1136
|
const { cwd, ignoreScripts } = operation.options;
|
|
@@ -2171,7 +1151,6 @@ function hasScript(manifest, script) {
|
|
|
2171
1151
|
}
|
|
2172
1152
|
|
|
2173
1153
|
// src/update-files.ts
|
|
2174
|
-
init_cjs_shims();
|
|
2175
1154
|
var path2 = __toESM(require("path"));
|
|
2176
1155
|
async function updateFiles(operation) {
|
|
2177
1156
|
const { files } = operation.options;
|
|
@@ -2250,9 +1229,9 @@ async function versionBump(arg = {}) {
|
|
|
2250
1229
|
await runNpmScript("preversion" /* PreVersion */, operation);
|
|
2251
1230
|
await updateFiles(operation);
|
|
2252
1231
|
if (operation.options.execute) {
|
|
2253
|
-
console.log(
|
|
1232
|
+
console.log(log_symbols_default.info, "Executing script", operation.options.execute);
|
|
2254
1233
|
await ezSpawn3.async(operation.options.execute, { stdio: "inherit" });
|
|
2255
|
-
console.log(
|
|
1234
|
+
console.log(log_symbols_default.success, "Script finished");
|
|
2256
1235
|
}
|
|
2257
1236
|
await runNpmScript("version" /* Version */, operation);
|
|
2258
1237
|
await gitCommit(operation);
|
|
@@ -2263,18 +1242,18 @@ async function versionBump(arg = {}) {
|
|
|
2263
1242
|
}
|
|
2264
1243
|
function printSummary(operation) {
|
|
2265
1244
|
console.log();
|
|
2266
|
-
console.log(` files ${operation.options.files.map((i) =>
|
|
1245
|
+
console.log(` files ${operation.options.files.map((i) => import_picocolors2.default.bold(i)).join("\n ")}`);
|
|
2267
1246
|
if (operation.options.commit)
|
|
2268
|
-
console.log(` commit ${
|
|
1247
|
+
console.log(` commit ${import_picocolors2.default.bold(formatVersionString(operation.options.commit.message, operation.state.newVersion))}`);
|
|
2269
1248
|
if (operation.options.tag)
|
|
2270
|
-
console.log(` tag ${
|
|
1249
|
+
console.log(` tag ${import_picocolors2.default.bold(formatVersionString(operation.options.tag.name, operation.state.newVersion))}`);
|
|
2271
1250
|
if (operation.options.execute)
|
|
2272
|
-
console.log(` execute ${
|
|
1251
|
+
console.log(` execute ${import_picocolors2.default.bold(operation.options.execute)}`);
|
|
2273
1252
|
if (operation.options.push)
|
|
2274
|
-
console.log(` push ${
|
|
1253
|
+
console.log(` push ${import_picocolors2.default.cyan(import_picocolors2.default.bold("yes"))}`);
|
|
2275
1254
|
console.log();
|
|
2276
|
-
console.log(` from ${
|
|
2277
|
-
console.log(` to ${
|
|
1255
|
+
console.log(` from ${import_picocolors2.default.bold(operation.state.oldVersion)}`);
|
|
1256
|
+
console.log(` to ${import_picocolors2.default.green(import_picocolors2.default.bold(operation.state.newVersion))}`);
|
|
2278
1257
|
console.log();
|
|
2279
1258
|
}
|
|
2280
1259
|
async function versionBumpInfo(arg = {}) {
|
|
@@ -2286,20 +1265,42 @@ async function versionBumpInfo(arg = {}) {
|
|
|
2286
1265
|
return operation;
|
|
2287
1266
|
}
|
|
2288
1267
|
|
|
2289
|
-
// src/
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
1268
|
+
// src/config.ts
|
|
1269
|
+
var import_c12 = require("c12");
|
|
1270
|
+
var bumpConfigDefaults = {
|
|
1271
|
+
commit: true,
|
|
1272
|
+
push: true,
|
|
1273
|
+
tag: true,
|
|
1274
|
+
recursive: false,
|
|
1275
|
+
noVerify: false,
|
|
1276
|
+
confirm: true,
|
|
1277
|
+
ignoreScripts: false,
|
|
1278
|
+
all: false,
|
|
1279
|
+
files: []
|
|
1280
|
+
};
|
|
1281
|
+
async function loadBumpConfig(overrides, cwd = process.cwd()) {
|
|
1282
|
+
const { config } = await (0, import_c12.loadConfig)({
|
|
1283
|
+
name: "bump",
|
|
1284
|
+
defaults: bumpConfigDefaults,
|
|
1285
|
+
overrides: __spreadValues({}, overrides),
|
|
1286
|
+
cwd
|
|
1287
|
+
});
|
|
1288
|
+
return config;
|
|
1289
|
+
}
|
|
1290
|
+
function defineConfig(config) {
|
|
1291
|
+
return config;
|
|
1292
|
+
}
|
|
2294
1293
|
|
|
2295
1294
|
// src/index.ts
|
|
2296
1295
|
var src_default = versionBump;
|
|
2297
|
-
module.exports = __toCommonJS(src_exports);
|
|
2298
1296
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2299
1297
|
0 && (module.exports = {
|
|
2300
1298
|
NpmScript,
|
|
2301
1299
|
ProgressEvent,
|
|
2302
1300
|
ReleaseType,
|
|
1301
|
+
bumpConfigDefaults,
|
|
1302
|
+
defineConfig,
|
|
1303
|
+
loadBumpConfig,
|
|
2303
1304
|
versionBump,
|
|
2304
1305
|
versionBumpInfo
|
|
2305
1306
|
});
|