create-cloudflare 0.0.0-9e4d8bcb → 0.0.0-9f021731
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +963 -1908
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -20
- package/templates/angular/c3.ts +1 -0
- package/templates/common/js/package.json +1 -1
- package/templates/common/ts/package.json +2 -2
- package/templates/common/ts/src/ab-test.ts +2 -2
- package/templates/common/ts/src/index.ts +2 -2
- package/templates/common/ts/src/proxy.ts +2 -2
- package/templates/common/ts/src/redirect.ts +2 -2
- package/templates/common/ts/tsconfig.json +1 -1
- package/templates/hello-world/c3.ts +4 -1
- package/templates/hello-world/js/package.json +3 -3
- package/templates/hello-world/js/vitest.config.js +8 -8
- package/templates/{hello-world-python → hello-world}/py/package.json +1 -1
- package/templates/hello-world/ts/package.json +4 -4
- package/templates/hello-world/ts/src/index.ts +2 -2
- package/templates/hello-world/ts/test/tsconfig.json +6 -9
- package/templates/hello-world/ts/tsconfig.json +3 -2
- package/templates/hello-world/ts/vitest.config.mts +11 -0
- package/templates/hello-world-durable-object/c3.ts +1 -1
- package/templates/hello-world-durable-object/js/package.json +1 -1
- package/templates/hello-world-durable-object/js/wrangler.toml +1 -1
- package/templates/hello-world-durable-object/ts/package.json +2 -2
- package/templates/hello-world-durable-object/ts/src/index.ts +2 -2
- package/templates/hello-world-durable-object/ts/tsconfig.json +1 -1
- package/templates/hello-world-durable-object/ts/wrangler.toml +2 -2
- package/templates/next/README.md +1 -1
- package/templates/next/c3.ts +1 -1
- package/templates/nuxt/c3.ts +5 -6
- package/templates/openapi/ts/README.md +3 -3
- package/templates/openapi/ts/package.json +5 -3
- package/templates/openapi/ts/src/endpoints/taskCreate.ts +26 -16
- package/templates/openapi/ts/src/endpoints/taskDelete.ts +20 -19
- package/templates/openapi/ts/src/endpoints/taskFetch.ts +30 -23
- package/templates/openapi/ts/src/endpoints/taskList.ts +27 -24
- package/templates/openapi/ts/src/index.ts +14 -20
- package/templates/openapi/ts/src/types.ts +9 -8
- package/templates/pre-existing/js/package.json +1 -1
- package/templates/queues/js/package.json +1 -1
- package/templates/queues/ts/package.json +2 -2
- package/templates/queues/ts/src/index.ts +3 -3
- package/templates/queues/ts/tsconfig.json +1 -1
- package/templates/scheduled/js/package.json +1 -1
- package/templates/scheduled/ts/package.json +2 -2
- package/templates/scheduled/ts/src/index.ts +2 -2
- package/templates/scheduled/ts/tsconfig.json +1 -1
- package/templates/solid/c3.ts +7 -5
- package/templates/hello-world/ts/vitest.config.ts +0 -11
- package/templates/hello-world-python/c3.ts +0 -9
- /package/templates/{hello-world-python → hello-world}/py/__dot__gitignore +0 -0
- /package/templates/{hello-world-python → hello-world}/py/src/entry.py +0 -0
- /package/templates/{hello-world-python → hello-world}/py/wrangler.toml +0 -0
package/dist/cli.js
CHANGED
|
@@ -33,1564 +33,531 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// ../../node_modules/.pnpm/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
return str.replace(matchOperatorsRe, "\\$&");
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// ../../node_modules/.pnpm/color-name@1.1.3/node_modules/color-name/index.js
|
|
51
|
-
var require_color_name = __commonJS({
|
|
52
|
-
"../../node_modules/.pnpm/color-name@1.1.3/node_modules/color-name/index.js"(exports2, module2) {
|
|
53
|
-
"use strict";
|
|
54
|
-
module2.exports = {
|
|
55
|
-
"aliceblue": [240, 248, 255],
|
|
56
|
-
"antiquewhite": [250, 235, 215],
|
|
57
|
-
"aqua": [0, 255, 255],
|
|
58
|
-
"aquamarine": [127, 255, 212],
|
|
59
|
-
"azure": [240, 255, 255],
|
|
60
|
-
"beige": [245, 245, 220],
|
|
61
|
-
"bisque": [255, 228, 196],
|
|
62
|
-
"black": [0, 0, 0],
|
|
63
|
-
"blanchedalmond": [255, 235, 205],
|
|
64
|
-
"blue": [0, 0, 255],
|
|
65
|
-
"blueviolet": [138, 43, 226],
|
|
66
|
-
"brown": [165, 42, 42],
|
|
67
|
-
"burlywood": [222, 184, 135],
|
|
68
|
-
"cadetblue": [95, 158, 160],
|
|
69
|
-
"chartreuse": [127, 255, 0],
|
|
70
|
-
"chocolate": [210, 105, 30],
|
|
71
|
-
"coral": [255, 127, 80],
|
|
72
|
-
"cornflowerblue": [100, 149, 237],
|
|
73
|
-
"cornsilk": [255, 248, 220],
|
|
74
|
-
"crimson": [220, 20, 60],
|
|
75
|
-
"cyan": [0, 255, 255],
|
|
76
|
-
"darkblue": [0, 0, 139],
|
|
77
|
-
"darkcyan": [0, 139, 139],
|
|
78
|
-
"darkgoldenrod": [184, 134, 11],
|
|
79
|
-
"darkgray": [169, 169, 169],
|
|
80
|
-
"darkgreen": [0, 100, 0],
|
|
81
|
-
"darkgrey": [169, 169, 169],
|
|
82
|
-
"darkkhaki": [189, 183, 107],
|
|
83
|
-
"darkmagenta": [139, 0, 139],
|
|
84
|
-
"darkolivegreen": [85, 107, 47],
|
|
85
|
-
"darkorange": [255, 140, 0],
|
|
86
|
-
"darkorchid": [153, 50, 204],
|
|
87
|
-
"darkred": [139, 0, 0],
|
|
88
|
-
"darksalmon": [233, 150, 122],
|
|
89
|
-
"darkseagreen": [143, 188, 143],
|
|
90
|
-
"darkslateblue": [72, 61, 139],
|
|
91
|
-
"darkslategray": [47, 79, 79],
|
|
92
|
-
"darkslategrey": [47, 79, 79],
|
|
93
|
-
"darkturquoise": [0, 206, 209],
|
|
94
|
-
"darkviolet": [148, 0, 211],
|
|
95
|
-
"deeppink": [255, 20, 147],
|
|
96
|
-
"deepskyblue": [0, 191, 255],
|
|
97
|
-
"dimgray": [105, 105, 105],
|
|
98
|
-
"dimgrey": [105, 105, 105],
|
|
99
|
-
"dodgerblue": [30, 144, 255],
|
|
100
|
-
"firebrick": [178, 34, 34],
|
|
101
|
-
"floralwhite": [255, 250, 240],
|
|
102
|
-
"forestgreen": [34, 139, 34],
|
|
103
|
-
"fuchsia": [255, 0, 255],
|
|
104
|
-
"gainsboro": [220, 220, 220],
|
|
105
|
-
"ghostwhite": [248, 248, 255],
|
|
106
|
-
"gold": [255, 215, 0],
|
|
107
|
-
"goldenrod": [218, 165, 32],
|
|
108
|
-
"gray": [128, 128, 128],
|
|
109
|
-
"green": [0, 128, 0],
|
|
110
|
-
"greenyellow": [173, 255, 47],
|
|
111
|
-
"grey": [128, 128, 128],
|
|
112
|
-
"honeydew": [240, 255, 240],
|
|
113
|
-
"hotpink": [255, 105, 180],
|
|
114
|
-
"indianred": [205, 92, 92],
|
|
115
|
-
"indigo": [75, 0, 130],
|
|
116
|
-
"ivory": [255, 255, 240],
|
|
117
|
-
"khaki": [240, 230, 140],
|
|
118
|
-
"lavender": [230, 230, 250],
|
|
119
|
-
"lavenderblush": [255, 240, 245],
|
|
120
|
-
"lawngreen": [124, 252, 0],
|
|
121
|
-
"lemonchiffon": [255, 250, 205],
|
|
122
|
-
"lightblue": [173, 216, 230],
|
|
123
|
-
"lightcoral": [240, 128, 128],
|
|
124
|
-
"lightcyan": [224, 255, 255],
|
|
125
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
126
|
-
"lightgray": [211, 211, 211],
|
|
127
|
-
"lightgreen": [144, 238, 144],
|
|
128
|
-
"lightgrey": [211, 211, 211],
|
|
129
|
-
"lightpink": [255, 182, 193],
|
|
130
|
-
"lightsalmon": [255, 160, 122],
|
|
131
|
-
"lightseagreen": [32, 178, 170],
|
|
132
|
-
"lightskyblue": [135, 206, 250],
|
|
133
|
-
"lightslategray": [119, 136, 153],
|
|
134
|
-
"lightslategrey": [119, 136, 153],
|
|
135
|
-
"lightsteelblue": [176, 196, 222],
|
|
136
|
-
"lightyellow": [255, 255, 224],
|
|
137
|
-
"lime": [0, 255, 0],
|
|
138
|
-
"limegreen": [50, 205, 50],
|
|
139
|
-
"linen": [250, 240, 230],
|
|
140
|
-
"magenta": [255, 0, 255],
|
|
141
|
-
"maroon": [128, 0, 0],
|
|
142
|
-
"mediumaquamarine": [102, 205, 170],
|
|
143
|
-
"mediumblue": [0, 0, 205],
|
|
144
|
-
"mediumorchid": [186, 85, 211],
|
|
145
|
-
"mediumpurple": [147, 112, 219],
|
|
146
|
-
"mediumseagreen": [60, 179, 113],
|
|
147
|
-
"mediumslateblue": [123, 104, 238],
|
|
148
|
-
"mediumspringgreen": [0, 250, 154],
|
|
149
|
-
"mediumturquoise": [72, 209, 204],
|
|
150
|
-
"mediumvioletred": [199, 21, 133],
|
|
151
|
-
"midnightblue": [25, 25, 112],
|
|
152
|
-
"mintcream": [245, 255, 250],
|
|
153
|
-
"mistyrose": [255, 228, 225],
|
|
154
|
-
"moccasin": [255, 228, 181],
|
|
155
|
-
"navajowhite": [255, 222, 173],
|
|
156
|
-
"navy": [0, 0, 128],
|
|
157
|
-
"oldlace": [253, 245, 230],
|
|
158
|
-
"olive": [128, 128, 0],
|
|
159
|
-
"olivedrab": [107, 142, 35],
|
|
160
|
-
"orange": [255, 165, 0],
|
|
161
|
-
"orangered": [255, 69, 0],
|
|
162
|
-
"orchid": [218, 112, 214],
|
|
163
|
-
"palegoldenrod": [238, 232, 170],
|
|
164
|
-
"palegreen": [152, 251, 152],
|
|
165
|
-
"paleturquoise": [175, 238, 238],
|
|
166
|
-
"palevioletred": [219, 112, 147],
|
|
167
|
-
"papayawhip": [255, 239, 213],
|
|
168
|
-
"peachpuff": [255, 218, 185],
|
|
169
|
-
"peru": [205, 133, 63],
|
|
170
|
-
"pink": [255, 192, 203],
|
|
171
|
-
"plum": [221, 160, 221],
|
|
172
|
-
"powderblue": [176, 224, 230],
|
|
173
|
-
"purple": [128, 0, 128],
|
|
174
|
-
"rebeccapurple": [102, 51, 153],
|
|
175
|
-
"red": [255, 0, 0],
|
|
176
|
-
"rosybrown": [188, 143, 143],
|
|
177
|
-
"royalblue": [65, 105, 225],
|
|
178
|
-
"saddlebrown": [139, 69, 19],
|
|
179
|
-
"salmon": [250, 128, 114],
|
|
180
|
-
"sandybrown": [244, 164, 96],
|
|
181
|
-
"seagreen": [46, 139, 87],
|
|
182
|
-
"seashell": [255, 245, 238],
|
|
183
|
-
"sienna": [160, 82, 45],
|
|
184
|
-
"silver": [192, 192, 192],
|
|
185
|
-
"skyblue": [135, 206, 235],
|
|
186
|
-
"slateblue": [106, 90, 205],
|
|
187
|
-
"slategray": [112, 128, 144],
|
|
188
|
-
"slategrey": [112, 128, 144],
|
|
189
|
-
"snow": [255, 250, 250],
|
|
190
|
-
"springgreen": [0, 255, 127],
|
|
191
|
-
"steelblue": [70, 130, 180],
|
|
192
|
-
"tan": [210, 180, 140],
|
|
193
|
-
"teal": [0, 128, 128],
|
|
194
|
-
"thistle": [216, 191, 216],
|
|
195
|
-
"tomato": [255, 99, 71],
|
|
196
|
-
"turquoise": [64, 224, 208],
|
|
197
|
-
"violet": [238, 130, 238],
|
|
198
|
-
"wheat": [245, 222, 179],
|
|
199
|
-
"white": [255, 255, 255],
|
|
200
|
-
"whitesmoke": [245, 245, 245],
|
|
201
|
-
"yellow": [255, 255, 0],
|
|
202
|
-
"yellowgreen": [154, 205, 50]
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
// ../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/conversions.js
|
|
208
|
-
var require_conversions = __commonJS({
|
|
209
|
-
"../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/conversions.js"(exports2, module2) {
|
|
210
|
-
var cssKeywords = require_color_name();
|
|
211
|
-
var reverseKeywords = {};
|
|
212
|
-
for (key in cssKeywords) {
|
|
213
|
-
if (cssKeywords.hasOwnProperty(key)) {
|
|
214
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
var key;
|
|
218
|
-
var convert = module2.exports = {
|
|
219
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
220
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
221
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
222
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
223
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
224
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
225
|
-
lab: { channels: 3, labels: "lab" },
|
|
226
|
-
lch: { channels: 3, labels: "lch" },
|
|
227
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
228
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
229
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
230
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
231
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
232
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
233
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
234
|
-
};
|
|
235
|
-
for (model in convert) {
|
|
236
|
-
if (convert.hasOwnProperty(model)) {
|
|
237
|
-
if (!("channels" in convert[model])) {
|
|
238
|
-
throw new Error("missing channels property: " + model);
|
|
239
|
-
}
|
|
240
|
-
if (!("labels" in convert[model])) {
|
|
241
|
-
throw new Error("missing channel labels property: " + model);
|
|
242
|
-
}
|
|
243
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
244
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
245
|
-
}
|
|
246
|
-
channels = convert[model].channels;
|
|
247
|
-
labels = convert[model].labels;
|
|
248
|
-
delete convert[model].channels;
|
|
249
|
-
delete convert[model].labels;
|
|
250
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
251
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
var channels;
|
|
255
|
-
var labels;
|
|
256
|
-
var model;
|
|
257
|
-
convert.rgb.hsl = function(rgb) {
|
|
258
|
-
var r2 = rgb[0] / 255;
|
|
259
|
-
var g2 = rgb[1] / 255;
|
|
260
|
-
var b2 = rgb[2] / 255;
|
|
261
|
-
var min = Math.min(r2, g2, b2);
|
|
262
|
-
var max = Math.max(r2, g2, b2);
|
|
263
|
-
var delta = max - min;
|
|
264
|
-
var h2;
|
|
265
|
-
var s;
|
|
266
|
-
var l2;
|
|
267
|
-
if (max === min) {
|
|
268
|
-
h2 = 0;
|
|
269
|
-
} else if (r2 === max) {
|
|
270
|
-
h2 = (g2 - b2) / delta;
|
|
271
|
-
} else if (g2 === max) {
|
|
272
|
-
h2 = 2 + (b2 - r2) / delta;
|
|
273
|
-
} else if (b2 === max) {
|
|
274
|
-
h2 = 4 + (r2 - g2) / delta;
|
|
275
|
-
}
|
|
276
|
-
h2 = Math.min(h2 * 60, 360);
|
|
277
|
-
if (h2 < 0) {
|
|
278
|
-
h2 += 360;
|
|
279
|
-
}
|
|
280
|
-
l2 = (min + max) / 2;
|
|
281
|
-
if (max === min) {
|
|
282
|
-
s = 0;
|
|
283
|
-
} else if (l2 <= 0.5) {
|
|
284
|
-
s = delta / (max + min);
|
|
285
|
-
} else {
|
|
286
|
-
s = delta / (2 - max - min);
|
|
287
|
-
}
|
|
288
|
-
return [h2, s * 100, l2 * 100];
|
|
289
|
-
};
|
|
290
|
-
convert.rgb.hsv = function(rgb) {
|
|
291
|
-
var rdif;
|
|
292
|
-
var gdif;
|
|
293
|
-
var bdif;
|
|
294
|
-
var h2;
|
|
295
|
-
var s;
|
|
296
|
-
var r2 = rgb[0] / 255;
|
|
297
|
-
var g2 = rgb[1] / 255;
|
|
298
|
-
var b2 = rgb[2] / 255;
|
|
299
|
-
var v2 = Math.max(r2, g2, b2);
|
|
300
|
-
var diff = v2 - Math.min(r2, g2, b2);
|
|
301
|
-
var diffc = function(c2) {
|
|
302
|
-
return (v2 - c2) / 6 / diff + 1 / 2;
|
|
303
|
-
};
|
|
304
|
-
if (diff === 0) {
|
|
305
|
-
h2 = s = 0;
|
|
306
|
-
} else {
|
|
307
|
-
s = diff / v2;
|
|
308
|
-
rdif = diffc(r2);
|
|
309
|
-
gdif = diffc(g2);
|
|
310
|
-
bdif = diffc(b2);
|
|
311
|
-
if (r2 === v2) {
|
|
312
|
-
h2 = bdif - gdif;
|
|
313
|
-
} else if (g2 === v2) {
|
|
314
|
-
h2 = 1 / 3 + rdif - bdif;
|
|
315
|
-
} else if (b2 === v2) {
|
|
316
|
-
h2 = 2 / 3 + gdif - rdif;
|
|
317
|
-
}
|
|
318
|
-
if (h2 < 0) {
|
|
319
|
-
h2 += 1;
|
|
320
|
-
} else if (h2 > 1) {
|
|
321
|
-
h2 -= 1;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
return [
|
|
325
|
-
h2 * 360,
|
|
326
|
-
s * 100,
|
|
327
|
-
v2 * 100
|
|
328
|
-
];
|
|
329
|
-
};
|
|
330
|
-
convert.rgb.hwb = function(rgb) {
|
|
331
|
-
var r2 = rgb[0];
|
|
332
|
-
var g2 = rgb[1];
|
|
333
|
-
var b2 = rgb[2];
|
|
334
|
-
var h2 = convert.rgb.hsl(rgb)[0];
|
|
335
|
-
var w2 = 1 / 255 * Math.min(r2, Math.min(g2, b2));
|
|
336
|
-
b2 = 1 - 1 / 255 * Math.max(r2, Math.max(g2, b2));
|
|
337
|
-
return [h2, w2 * 100, b2 * 100];
|
|
338
|
-
};
|
|
339
|
-
convert.rgb.cmyk = function(rgb) {
|
|
340
|
-
var r2 = rgb[0] / 255;
|
|
341
|
-
var g2 = rgb[1] / 255;
|
|
342
|
-
var b2 = rgb[2] / 255;
|
|
343
|
-
var c2;
|
|
344
|
-
var m2;
|
|
345
|
-
var y2;
|
|
346
|
-
var k2;
|
|
347
|
-
k2 = Math.min(1 - r2, 1 - g2, 1 - b2);
|
|
348
|
-
c2 = (1 - r2 - k2) / (1 - k2) || 0;
|
|
349
|
-
m2 = (1 - g2 - k2) / (1 - k2) || 0;
|
|
350
|
-
y2 = (1 - b2 - k2) / (1 - k2) || 0;
|
|
351
|
-
return [c2 * 100, m2 * 100, y2 * 100, k2 * 100];
|
|
352
|
-
};
|
|
353
|
-
function comparativeDistance(x2, y2) {
|
|
354
|
-
return Math.pow(x2[0] - y2[0], 2) + Math.pow(x2[1] - y2[1], 2) + Math.pow(x2[2] - y2[2], 2);
|
|
355
|
-
}
|
|
356
|
-
convert.rgb.keyword = function(rgb) {
|
|
357
|
-
var reversed = reverseKeywords[rgb];
|
|
358
|
-
if (reversed) {
|
|
359
|
-
return reversed;
|
|
360
|
-
}
|
|
361
|
-
var currentClosestDistance = Infinity;
|
|
362
|
-
var currentClosestKeyword;
|
|
363
|
-
for (var keyword in cssKeywords) {
|
|
364
|
-
if (cssKeywords.hasOwnProperty(keyword)) {
|
|
365
|
-
var value = cssKeywords[keyword];
|
|
366
|
-
var distance = comparativeDistance(rgb, value);
|
|
367
|
-
if (distance < currentClosestDistance) {
|
|
368
|
-
currentClosestDistance = distance;
|
|
369
|
-
currentClosestKeyword = keyword;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
return currentClosestKeyword;
|
|
374
|
-
};
|
|
375
|
-
convert.keyword.rgb = function(keyword) {
|
|
376
|
-
return cssKeywords[keyword];
|
|
377
|
-
};
|
|
378
|
-
convert.rgb.xyz = function(rgb) {
|
|
379
|
-
var r2 = rgb[0] / 255;
|
|
380
|
-
var g2 = rgb[1] / 255;
|
|
381
|
-
var b2 = rgb[2] / 255;
|
|
382
|
-
r2 = r2 > 0.04045 ? Math.pow((r2 + 0.055) / 1.055, 2.4) : r2 / 12.92;
|
|
383
|
-
g2 = g2 > 0.04045 ? Math.pow((g2 + 0.055) / 1.055, 2.4) : g2 / 12.92;
|
|
384
|
-
b2 = b2 > 0.04045 ? Math.pow((b2 + 0.055) / 1.055, 2.4) : b2 / 12.92;
|
|
385
|
-
var x2 = r2 * 0.4124 + g2 * 0.3576 + b2 * 0.1805;
|
|
386
|
-
var y2 = r2 * 0.2126 + g2 * 0.7152 + b2 * 0.0722;
|
|
387
|
-
var z2 = r2 * 0.0193 + g2 * 0.1192 + b2 * 0.9505;
|
|
388
|
-
return [x2 * 100, y2 * 100, z2 * 100];
|
|
389
|
-
};
|
|
390
|
-
convert.rgb.lab = function(rgb) {
|
|
391
|
-
var xyz = convert.rgb.xyz(rgb);
|
|
392
|
-
var x2 = xyz[0];
|
|
393
|
-
var y2 = xyz[1];
|
|
394
|
-
var z2 = xyz[2];
|
|
395
|
-
var l2;
|
|
396
|
-
var a;
|
|
397
|
-
var b2;
|
|
398
|
-
x2 /= 95.047;
|
|
399
|
-
y2 /= 100;
|
|
400
|
-
z2 /= 108.883;
|
|
401
|
-
x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
|
|
402
|
-
y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
403
|
-
z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
404
|
-
l2 = 116 * y2 - 16;
|
|
405
|
-
a = 500 * (x2 - y2);
|
|
406
|
-
b2 = 200 * (y2 - z2);
|
|
407
|
-
return [l2, a, b2];
|
|
408
|
-
};
|
|
409
|
-
convert.hsl.rgb = function(hsl) {
|
|
410
|
-
var h2 = hsl[0] / 360;
|
|
411
|
-
var s = hsl[1] / 100;
|
|
412
|
-
var l2 = hsl[2] / 100;
|
|
413
|
-
var t1;
|
|
414
|
-
var t2;
|
|
415
|
-
var t3;
|
|
416
|
-
var rgb;
|
|
417
|
-
var val;
|
|
418
|
-
if (s === 0) {
|
|
419
|
-
val = l2 * 255;
|
|
420
|
-
return [val, val, val];
|
|
421
|
-
}
|
|
422
|
-
if (l2 < 0.5) {
|
|
423
|
-
t2 = l2 * (1 + s);
|
|
424
|
-
} else {
|
|
425
|
-
t2 = l2 + s - l2 * s;
|
|
426
|
-
}
|
|
427
|
-
t1 = 2 * l2 - t2;
|
|
428
|
-
rgb = [0, 0, 0];
|
|
429
|
-
for (var i = 0; i < 3; i++) {
|
|
430
|
-
t3 = h2 + 1 / 3 * -(i - 1);
|
|
431
|
-
if (t3 < 0) {
|
|
432
|
-
t3++;
|
|
433
|
-
}
|
|
434
|
-
if (t3 > 1) {
|
|
435
|
-
t3--;
|
|
436
|
-
}
|
|
437
|
-
if (6 * t3 < 1) {
|
|
438
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
439
|
-
} else if (2 * t3 < 1) {
|
|
440
|
-
val = t2;
|
|
441
|
-
} else if (3 * t3 < 2) {
|
|
442
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
443
|
-
} else {
|
|
444
|
-
val = t1;
|
|
445
|
-
}
|
|
446
|
-
rgb[i] = val * 255;
|
|
447
|
-
}
|
|
448
|
-
return rgb;
|
|
449
|
-
};
|
|
450
|
-
convert.hsl.hsv = function(hsl) {
|
|
451
|
-
var h2 = hsl[0];
|
|
452
|
-
var s = hsl[1] / 100;
|
|
453
|
-
var l2 = hsl[2] / 100;
|
|
454
|
-
var smin = s;
|
|
455
|
-
var lmin = Math.max(l2, 0.01);
|
|
456
|
-
var sv;
|
|
457
|
-
var v2;
|
|
458
|
-
l2 *= 2;
|
|
459
|
-
s *= l2 <= 1 ? l2 : 2 - l2;
|
|
460
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
461
|
-
v2 = (l2 + s) / 2;
|
|
462
|
-
sv = l2 === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l2 + s);
|
|
463
|
-
return [h2, sv * 100, v2 * 100];
|
|
464
|
-
};
|
|
465
|
-
convert.hsv.rgb = function(hsv) {
|
|
466
|
-
var h2 = hsv[0] / 60;
|
|
467
|
-
var s = hsv[1] / 100;
|
|
468
|
-
var v2 = hsv[2] / 100;
|
|
469
|
-
var hi = Math.floor(h2) % 6;
|
|
470
|
-
var f = h2 - Math.floor(h2);
|
|
471
|
-
var p2 = 255 * v2 * (1 - s);
|
|
472
|
-
var q2 = 255 * v2 * (1 - s * f);
|
|
473
|
-
var t = 255 * v2 * (1 - s * (1 - f));
|
|
474
|
-
v2 *= 255;
|
|
475
|
-
switch (hi) {
|
|
476
|
-
case 0:
|
|
477
|
-
return [v2, t, p2];
|
|
478
|
-
case 1:
|
|
479
|
-
return [q2, v2, p2];
|
|
480
|
-
case 2:
|
|
481
|
-
return [p2, v2, t];
|
|
482
|
-
case 3:
|
|
483
|
-
return [p2, q2, v2];
|
|
484
|
-
case 4:
|
|
485
|
-
return [t, p2, v2];
|
|
486
|
-
case 5:
|
|
487
|
-
return [v2, p2, q2];
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
convert.hsv.hsl = function(hsv) {
|
|
491
|
-
var h2 = hsv[0];
|
|
492
|
-
var s = hsv[1] / 100;
|
|
493
|
-
var v2 = hsv[2] / 100;
|
|
494
|
-
var vmin = Math.max(v2, 0.01);
|
|
495
|
-
var lmin;
|
|
496
|
-
var sl;
|
|
497
|
-
var l2;
|
|
498
|
-
l2 = (2 - s) * v2;
|
|
499
|
-
lmin = (2 - s) * vmin;
|
|
500
|
-
sl = s * vmin;
|
|
501
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
502
|
-
sl = sl || 0;
|
|
503
|
-
l2 /= 2;
|
|
504
|
-
return [h2, sl * 100, l2 * 100];
|
|
505
|
-
};
|
|
506
|
-
convert.hwb.rgb = function(hwb) {
|
|
507
|
-
var h2 = hwb[0] / 360;
|
|
508
|
-
var wh = hwb[1] / 100;
|
|
509
|
-
var bl = hwb[2] / 100;
|
|
510
|
-
var ratio = wh + bl;
|
|
511
|
-
var i;
|
|
512
|
-
var v2;
|
|
513
|
-
var f;
|
|
514
|
-
var n2;
|
|
515
|
-
if (ratio > 1) {
|
|
516
|
-
wh /= ratio;
|
|
517
|
-
bl /= ratio;
|
|
518
|
-
}
|
|
519
|
-
i = Math.floor(6 * h2);
|
|
520
|
-
v2 = 1 - bl;
|
|
521
|
-
f = 6 * h2 - i;
|
|
522
|
-
if ((i & 1) !== 0) {
|
|
523
|
-
f = 1 - f;
|
|
524
|
-
}
|
|
525
|
-
n2 = wh + f * (v2 - wh);
|
|
526
|
-
var r2;
|
|
527
|
-
var g2;
|
|
528
|
-
var b2;
|
|
529
|
-
switch (i) {
|
|
530
|
-
default:
|
|
531
|
-
case 6:
|
|
532
|
-
case 0:
|
|
533
|
-
r2 = v2;
|
|
534
|
-
g2 = n2;
|
|
535
|
-
b2 = wh;
|
|
536
|
-
break;
|
|
537
|
-
case 1:
|
|
538
|
-
r2 = n2;
|
|
539
|
-
g2 = v2;
|
|
540
|
-
b2 = wh;
|
|
541
|
-
break;
|
|
542
|
-
case 2:
|
|
543
|
-
r2 = wh;
|
|
544
|
-
g2 = v2;
|
|
545
|
-
b2 = n2;
|
|
546
|
-
break;
|
|
547
|
-
case 3:
|
|
548
|
-
r2 = wh;
|
|
549
|
-
g2 = n2;
|
|
550
|
-
b2 = v2;
|
|
551
|
-
break;
|
|
552
|
-
case 4:
|
|
553
|
-
r2 = n2;
|
|
554
|
-
g2 = wh;
|
|
555
|
-
b2 = v2;
|
|
556
|
-
break;
|
|
557
|
-
case 5:
|
|
558
|
-
r2 = v2;
|
|
559
|
-
g2 = wh;
|
|
560
|
-
b2 = n2;
|
|
561
|
-
break;
|
|
562
|
-
}
|
|
563
|
-
return [r2 * 255, g2 * 255, b2 * 255];
|
|
564
|
-
};
|
|
565
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
566
|
-
var c2 = cmyk[0] / 100;
|
|
567
|
-
var m2 = cmyk[1] / 100;
|
|
568
|
-
var y2 = cmyk[2] / 100;
|
|
569
|
-
var k2 = cmyk[3] / 100;
|
|
570
|
-
var r2;
|
|
571
|
-
var g2;
|
|
572
|
-
var b2;
|
|
573
|
-
r2 = 1 - Math.min(1, c2 * (1 - k2) + k2);
|
|
574
|
-
g2 = 1 - Math.min(1, m2 * (1 - k2) + k2);
|
|
575
|
-
b2 = 1 - Math.min(1, y2 * (1 - k2) + k2);
|
|
576
|
-
return [r2 * 255, g2 * 255, b2 * 255];
|
|
577
|
-
};
|
|
578
|
-
convert.xyz.rgb = function(xyz) {
|
|
579
|
-
var x2 = xyz[0] / 100;
|
|
580
|
-
var y2 = xyz[1] / 100;
|
|
581
|
-
var z2 = xyz[2] / 100;
|
|
582
|
-
var r2;
|
|
583
|
-
var g2;
|
|
584
|
-
var b2;
|
|
585
|
-
r2 = x2 * 3.2406 + y2 * -1.5372 + z2 * -0.4986;
|
|
586
|
-
g2 = x2 * -0.9689 + y2 * 1.8758 + z2 * 0.0415;
|
|
587
|
-
b2 = x2 * 0.0557 + y2 * -0.204 + z2 * 1.057;
|
|
588
|
-
r2 = r2 > 31308e-7 ? 1.055 * Math.pow(r2, 1 / 2.4) - 0.055 : r2 * 12.92;
|
|
589
|
-
g2 = g2 > 31308e-7 ? 1.055 * Math.pow(g2, 1 / 2.4) - 0.055 : g2 * 12.92;
|
|
590
|
-
b2 = b2 > 31308e-7 ? 1.055 * Math.pow(b2, 1 / 2.4) - 0.055 : b2 * 12.92;
|
|
591
|
-
r2 = Math.min(Math.max(0, r2), 1);
|
|
592
|
-
g2 = Math.min(Math.max(0, g2), 1);
|
|
593
|
-
b2 = Math.min(Math.max(0, b2), 1);
|
|
594
|
-
return [r2 * 255, g2 * 255, b2 * 255];
|
|
595
|
-
};
|
|
596
|
-
convert.xyz.lab = function(xyz) {
|
|
597
|
-
var x2 = xyz[0];
|
|
598
|
-
var y2 = xyz[1];
|
|
599
|
-
var z2 = xyz[2];
|
|
600
|
-
var l2;
|
|
601
|
-
var a;
|
|
602
|
-
var b2;
|
|
603
|
-
x2 /= 95.047;
|
|
604
|
-
y2 /= 100;
|
|
605
|
-
z2 /= 108.883;
|
|
606
|
-
x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
|
|
607
|
-
y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
608
|
-
z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
609
|
-
l2 = 116 * y2 - 16;
|
|
610
|
-
a = 500 * (x2 - y2);
|
|
611
|
-
b2 = 200 * (y2 - z2);
|
|
612
|
-
return [l2, a, b2];
|
|
613
|
-
};
|
|
614
|
-
convert.lab.xyz = function(lab) {
|
|
615
|
-
var l2 = lab[0];
|
|
616
|
-
var a = lab[1];
|
|
617
|
-
var b2 = lab[2];
|
|
618
|
-
var x2;
|
|
619
|
-
var y2;
|
|
620
|
-
var z2;
|
|
621
|
-
y2 = (l2 + 16) / 116;
|
|
622
|
-
x2 = a / 500 + y2;
|
|
623
|
-
z2 = y2 - b2 / 200;
|
|
624
|
-
var y22 = Math.pow(y2, 3);
|
|
625
|
-
var x22 = Math.pow(x2, 3);
|
|
626
|
-
var z22 = Math.pow(z2, 3);
|
|
627
|
-
y2 = y22 > 8856e-6 ? y22 : (y2 - 16 / 116) / 7.787;
|
|
628
|
-
x2 = x22 > 8856e-6 ? x22 : (x2 - 16 / 116) / 7.787;
|
|
629
|
-
z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787;
|
|
630
|
-
x2 *= 95.047;
|
|
631
|
-
y2 *= 100;
|
|
632
|
-
z2 *= 108.883;
|
|
633
|
-
return [x2, y2, z2];
|
|
634
|
-
};
|
|
635
|
-
convert.lab.lch = function(lab) {
|
|
636
|
-
var l2 = lab[0];
|
|
637
|
-
var a = lab[1];
|
|
638
|
-
var b2 = lab[2];
|
|
639
|
-
var hr;
|
|
640
|
-
var h2;
|
|
641
|
-
var c2;
|
|
642
|
-
hr = Math.atan2(b2, a);
|
|
643
|
-
h2 = hr * 360 / 2 / Math.PI;
|
|
644
|
-
if (h2 < 0) {
|
|
645
|
-
h2 += 360;
|
|
646
|
-
}
|
|
647
|
-
c2 = Math.sqrt(a * a + b2 * b2);
|
|
648
|
-
return [l2, c2, h2];
|
|
649
|
-
};
|
|
650
|
-
convert.lch.lab = function(lch) {
|
|
651
|
-
var l2 = lch[0];
|
|
652
|
-
var c2 = lch[1];
|
|
653
|
-
var h2 = lch[2];
|
|
654
|
-
var a;
|
|
655
|
-
var b2;
|
|
656
|
-
var hr;
|
|
657
|
-
hr = h2 / 360 * 2 * Math.PI;
|
|
658
|
-
a = c2 * Math.cos(hr);
|
|
659
|
-
b2 = c2 * Math.sin(hr);
|
|
660
|
-
return [l2, a, b2];
|
|
661
|
-
};
|
|
662
|
-
convert.rgb.ansi16 = function(args) {
|
|
663
|
-
var r2 = args[0];
|
|
664
|
-
var g2 = args[1];
|
|
665
|
-
var b2 = args[2];
|
|
666
|
-
var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
|
|
667
|
-
value = Math.round(value / 50);
|
|
668
|
-
if (value === 0) {
|
|
669
|
-
return 30;
|
|
670
|
-
}
|
|
671
|
-
var ansi2 = 30 + (Math.round(b2 / 255) << 2 | Math.round(g2 / 255) << 1 | Math.round(r2 / 255));
|
|
672
|
-
if (value === 2) {
|
|
673
|
-
ansi2 += 60;
|
|
674
|
-
}
|
|
675
|
-
return ansi2;
|
|
676
|
-
};
|
|
677
|
-
convert.hsv.ansi16 = function(args) {
|
|
678
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
679
|
-
};
|
|
680
|
-
convert.rgb.ansi256 = function(args) {
|
|
681
|
-
var r2 = args[0];
|
|
682
|
-
var g2 = args[1];
|
|
683
|
-
var b2 = args[2];
|
|
684
|
-
if (r2 === g2 && g2 === b2) {
|
|
685
|
-
if (r2 < 8) {
|
|
686
|
-
return 16;
|
|
687
|
-
}
|
|
688
|
-
if (r2 > 248) {
|
|
689
|
-
return 231;
|
|
690
|
-
}
|
|
691
|
-
return Math.round((r2 - 8) / 247 * 24) + 232;
|
|
692
|
-
}
|
|
693
|
-
var ansi2 = 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(b2 / 255 * 5);
|
|
694
|
-
return ansi2;
|
|
695
|
-
};
|
|
696
|
-
convert.ansi16.rgb = function(args) {
|
|
697
|
-
var color = args % 10;
|
|
698
|
-
if (color === 0 || color === 7) {
|
|
699
|
-
if (args > 50) {
|
|
700
|
-
color += 3.5;
|
|
701
|
-
}
|
|
702
|
-
color = color / 10.5 * 255;
|
|
703
|
-
return [color, color, color];
|
|
704
|
-
}
|
|
705
|
-
var mult = (~~(args > 50) + 1) * 0.5;
|
|
706
|
-
var r2 = (color & 1) * mult * 255;
|
|
707
|
-
var g2 = (color >> 1 & 1) * mult * 255;
|
|
708
|
-
var b2 = (color >> 2 & 1) * mult * 255;
|
|
709
|
-
return [r2, g2, b2];
|
|
710
|
-
};
|
|
711
|
-
convert.ansi256.rgb = function(args) {
|
|
712
|
-
if (args >= 232) {
|
|
713
|
-
var c2 = (args - 232) * 10 + 8;
|
|
714
|
-
return [c2, c2, c2];
|
|
715
|
-
}
|
|
716
|
-
args -= 16;
|
|
717
|
-
var rem;
|
|
718
|
-
var r2 = Math.floor(args / 36) / 5 * 255;
|
|
719
|
-
var g2 = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
720
|
-
var b2 = rem % 6 / 5 * 255;
|
|
721
|
-
return [r2, g2, b2];
|
|
722
|
-
};
|
|
723
|
-
convert.rgb.hex = function(args) {
|
|
724
|
-
var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
725
|
-
var string = integer.toString(16).toUpperCase();
|
|
726
|
-
return "000000".substring(string.length) + string;
|
|
727
|
-
};
|
|
728
|
-
convert.hex.rgb = function(args) {
|
|
729
|
-
var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
730
|
-
if (!match) {
|
|
731
|
-
return [0, 0, 0];
|
|
732
|
-
}
|
|
733
|
-
var colorString = match[0];
|
|
734
|
-
if (match[0].length === 3) {
|
|
735
|
-
colorString = colorString.split("").map(function(char) {
|
|
736
|
-
return char + char;
|
|
737
|
-
}).join("");
|
|
738
|
-
}
|
|
739
|
-
var integer = parseInt(colorString, 16);
|
|
740
|
-
var r2 = integer >> 16 & 255;
|
|
741
|
-
var g2 = integer >> 8 & 255;
|
|
742
|
-
var b2 = integer & 255;
|
|
743
|
-
return [r2, g2, b2];
|
|
744
|
-
};
|
|
745
|
-
convert.rgb.hcg = function(rgb) {
|
|
746
|
-
var r2 = rgb[0] / 255;
|
|
747
|
-
var g2 = rgb[1] / 255;
|
|
748
|
-
var b2 = rgb[2] / 255;
|
|
749
|
-
var max = Math.max(Math.max(r2, g2), b2);
|
|
750
|
-
var min = Math.min(Math.min(r2, g2), b2);
|
|
751
|
-
var chroma = max - min;
|
|
752
|
-
var grayscale;
|
|
753
|
-
var hue;
|
|
754
|
-
if (chroma < 1) {
|
|
755
|
-
grayscale = min / (1 - chroma);
|
|
756
|
-
} else {
|
|
757
|
-
grayscale = 0;
|
|
758
|
-
}
|
|
759
|
-
if (chroma <= 0) {
|
|
760
|
-
hue = 0;
|
|
761
|
-
} else if (max === r2) {
|
|
762
|
-
hue = (g2 - b2) / chroma % 6;
|
|
763
|
-
} else if (max === g2) {
|
|
764
|
-
hue = 2 + (b2 - r2) / chroma;
|
|
765
|
-
} else {
|
|
766
|
-
hue = 4 + (r2 - g2) / chroma + 4;
|
|
767
|
-
}
|
|
768
|
-
hue /= 6;
|
|
769
|
-
hue %= 1;
|
|
770
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
771
|
-
};
|
|
772
|
-
convert.hsl.hcg = function(hsl) {
|
|
773
|
-
var s = hsl[1] / 100;
|
|
774
|
-
var l2 = hsl[2] / 100;
|
|
775
|
-
var c2 = 1;
|
|
776
|
-
var f = 0;
|
|
777
|
-
if (l2 < 0.5) {
|
|
778
|
-
c2 = 2 * s * l2;
|
|
779
|
-
} else {
|
|
780
|
-
c2 = 2 * s * (1 - l2);
|
|
781
|
-
}
|
|
782
|
-
if (c2 < 1) {
|
|
783
|
-
f = (l2 - 0.5 * c2) / (1 - c2);
|
|
784
|
-
}
|
|
785
|
-
return [hsl[0], c2 * 100, f * 100];
|
|
786
|
-
};
|
|
787
|
-
convert.hsv.hcg = function(hsv) {
|
|
788
|
-
var s = hsv[1] / 100;
|
|
789
|
-
var v2 = hsv[2] / 100;
|
|
790
|
-
var c2 = s * v2;
|
|
791
|
-
var f = 0;
|
|
792
|
-
if (c2 < 1) {
|
|
793
|
-
f = (v2 - c2) / (1 - c2);
|
|
794
|
-
}
|
|
795
|
-
return [hsv[0], c2 * 100, f * 100];
|
|
796
|
-
};
|
|
797
|
-
convert.hcg.rgb = function(hcg) {
|
|
798
|
-
var h2 = hcg[0] / 360;
|
|
799
|
-
var c2 = hcg[1] / 100;
|
|
800
|
-
var g2 = hcg[2] / 100;
|
|
801
|
-
if (c2 === 0) {
|
|
802
|
-
return [g2 * 255, g2 * 255, g2 * 255];
|
|
803
|
-
}
|
|
804
|
-
var pure = [0, 0, 0];
|
|
805
|
-
var hi = h2 % 1 * 6;
|
|
806
|
-
var v2 = hi % 1;
|
|
807
|
-
var w2 = 1 - v2;
|
|
808
|
-
var mg = 0;
|
|
809
|
-
switch (Math.floor(hi)) {
|
|
810
|
-
case 0:
|
|
811
|
-
pure[0] = 1;
|
|
812
|
-
pure[1] = v2;
|
|
813
|
-
pure[2] = 0;
|
|
814
|
-
break;
|
|
815
|
-
case 1:
|
|
816
|
-
pure[0] = w2;
|
|
817
|
-
pure[1] = 1;
|
|
818
|
-
pure[2] = 0;
|
|
819
|
-
break;
|
|
820
|
-
case 2:
|
|
821
|
-
pure[0] = 0;
|
|
822
|
-
pure[1] = 1;
|
|
823
|
-
pure[2] = v2;
|
|
824
|
-
break;
|
|
825
|
-
case 3:
|
|
826
|
-
pure[0] = 0;
|
|
827
|
-
pure[1] = w2;
|
|
828
|
-
pure[2] = 1;
|
|
829
|
-
break;
|
|
830
|
-
case 4:
|
|
831
|
-
pure[0] = v2;
|
|
832
|
-
pure[1] = 0;
|
|
833
|
-
pure[2] = 1;
|
|
834
|
-
break;
|
|
835
|
-
default:
|
|
836
|
-
pure[0] = 1;
|
|
837
|
-
pure[1] = 0;
|
|
838
|
-
pure[2] = w2;
|
|
839
|
-
}
|
|
840
|
-
mg = (1 - c2) * g2;
|
|
841
|
-
return [
|
|
842
|
-
(c2 * pure[0] + mg) * 255,
|
|
843
|
-
(c2 * pure[1] + mg) * 255,
|
|
844
|
-
(c2 * pure[2] + mg) * 255
|
|
845
|
-
];
|
|
846
|
-
};
|
|
847
|
-
convert.hcg.hsv = function(hcg) {
|
|
848
|
-
var c2 = hcg[1] / 100;
|
|
849
|
-
var g2 = hcg[2] / 100;
|
|
850
|
-
var v2 = c2 + g2 * (1 - c2);
|
|
851
|
-
var f = 0;
|
|
852
|
-
if (v2 > 0) {
|
|
853
|
-
f = c2 / v2;
|
|
854
|
-
}
|
|
855
|
-
return [hcg[0], f * 100, v2 * 100];
|
|
856
|
-
};
|
|
857
|
-
convert.hcg.hsl = function(hcg) {
|
|
858
|
-
var c2 = hcg[1] / 100;
|
|
859
|
-
var g2 = hcg[2] / 100;
|
|
860
|
-
var l2 = g2 * (1 - c2) + 0.5 * c2;
|
|
861
|
-
var s = 0;
|
|
862
|
-
if (l2 > 0 && l2 < 0.5) {
|
|
863
|
-
s = c2 / (2 * l2);
|
|
864
|
-
} else if (l2 >= 0.5 && l2 < 1) {
|
|
865
|
-
s = c2 / (2 * (1 - l2));
|
|
866
|
-
}
|
|
867
|
-
return [hcg[0], s * 100, l2 * 100];
|
|
868
|
-
};
|
|
869
|
-
convert.hcg.hwb = function(hcg) {
|
|
870
|
-
var c2 = hcg[1] / 100;
|
|
871
|
-
var g2 = hcg[2] / 100;
|
|
872
|
-
var v2 = c2 + g2 * (1 - c2);
|
|
873
|
-
return [hcg[0], (v2 - c2) * 100, (1 - v2) * 100];
|
|
874
|
-
};
|
|
875
|
-
convert.hwb.hcg = function(hwb) {
|
|
876
|
-
var w2 = hwb[1] / 100;
|
|
877
|
-
var b2 = hwb[2] / 100;
|
|
878
|
-
var v2 = 1 - b2;
|
|
879
|
-
var c2 = v2 - w2;
|
|
880
|
-
var g2 = 0;
|
|
881
|
-
if (c2 < 1) {
|
|
882
|
-
g2 = (v2 - c2) / (1 - c2);
|
|
883
|
-
}
|
|
884
|
-
return [hwb[0], c2 * 100, g2 * 100];
|
|
885
|
-
};
|
|
886
|
-
convert.apple.rgb = function(apple) {
|
|
887
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
888
|
-
};
|
|
889
|
-
convert.rgb.apple = function(rgb) {
|
|
890
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
891
|
-
};
|
|
892
|
-
convert.gray.rgb = function(args) {
|
|
893
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
894
|
-
};
|
|
895
|
-
convert.gray.hsl = convert.gray.hsv = function(args) {
|
|
896
|
-
return [0, 0, args[0]];
|
|
897
|
-
};
|
|
898
|
-
convert.gray.hwb = function(gray2) {
|
|
899
|
-
return [0, 100, gray2[0]];
|
|
900
|
-
};
|
|
901
|
-
convert.gray.cmyk = function(gray2) {
|
|
902
|
-
return [0, 0, 0, gray2[0]];
|
|
903
|
-
};
|
|
904
|
-
convert.gray.lab = function(gray2) {
|
|
905
|
-
return [gray2[0], 0, 0];
|
|
906
|
-
};
|
|
907
|
-
convert.gray.hex = function(gray2) {
|
|
908
|
-
var val = Math.round(gray2[0] / 100 * 255) & 255;
|
|
909
|
-
var integer = (val << 16) + (val << 8) + val;
|
|
910
|
-
var string = integer.toString(16).toUpperCase();
|
|
911
|
-
return "000000".substring(string.length) + string;
|
|
912
|
-
};
|
|
913
|
-
convert.rgb.gray = function(rgb) {
|
|
914
|
-
var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
915
|
-
return [val / 255 * 100];
|
|
916
|
-
};
|
|
917
|
-
}
|
|
918
|
-
});
|
|
919
|
-
|
|
920
|
-
// ../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/route.js
|
|
921
|
-
var require_route = __commonJS({
|
|
922
|
-
"../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/route.js"(exports2, module2) {
|
|
923
|
-
var conversions = require_conversions();
|
|
924
|
-
function buildGraph() {
|
|
925
|
-
var graph = {};
|
|
926
|
-
var models = Object.keys(conversions);
|
|
927
|
-
for (var len = models.length, i = 0; i < len; i++) {
|
|
928
|
-
graph[models[i]] = {
|
|
929
|
-
// http://jsperf.com/1-vs-infinity
|
|
930
|
-
// micro-opt, but this is simple.
|
|
931
|
-
distance: -1,
|
|
932
|
-
parent: null
|
|
933
|
-
};
|
|
934
|
-
}
|
|
935
|
-
return graph;
|
|
936
|
-
}
|
|
937
|
-
function deriveBFS(fromModel) {
|
|
938
|
-
var graph = buildGraph();
|
|
939
|
-
var queue = [fromModel];
|
|
940
|
-
graph[fromModel].distance = 0;
|
|
941
|
-
while (queue.length) {
|
|
942
|
-
var current = queue.pop();
|
|
943
|
-
var adjacents = Object.keys(conversions[current]);
|
|
944
|
-
for (var len = adjacents.length, i = 0; i < len; i++) {
|
|
945
|
-
var adjacent = adjacents[i];
|
|
946
|
-
var node = graph[adjacent];
|
|
947
|
-
if (node.distance === -1) {
|
|
948
|
-
node.distance = graph[current].distance + 1;
|
|
949
|
-
node.parent = current;
|
|
950
|
-
queue.unshift(adjacent);
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
return graph;
|
|
955
|
-
}
|
|
956
|
-
function link(from, to) {
|
|
957
|
-
return function(args) {
|
|
958
|
-
return to(from(args));
|
|
36
|
+
// ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
37
|
+
function assembleStyles() {
|
|
38
|
+
const codes = /* @__PURE__ */ new Map();
|
|
39
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
40
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
41
|
+
styles[styleName] = {
|
|
42
|
+
open: `\x1B[${style[0]}m`,
|
|
43
|
+
close: `\x1B[${style[1]}m`
|
|
959
44
|
};
|
|
45
|
+
group[styleName] = styles[styleName];
|
|
46
|
+
codes.set(style[0], style[1]);
|
|
960
47
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
while (graph[cur].parent) {
|
|
966
|
-
path4.unshift(graph[cur].parent);
|
|
967
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
968
|
-
cur = graph[cur].parent;
|
|
969
|
-
}
|
|
970
|
-
fn.conversion = path4;
|
|
971
|
-
return fn;
|
|
972
|
-
}
|
|
973
|
-
module2.exports = function(fromModel) {
|
|
974
|
-
var graph = deriveBFS(fromModel);
|
|
975
|
-
var conversion = {};
|
|
976
|
-
var models = Object.keys(graph);
|
|
977
|
-
for (var len = models.length, i = 0; i < len; i++) {
|
|
978
|
-
var toModel = models[i];
|
|
979
|
-
var node = graph[toModel];
|
|
980
|
-
if (node.parent === null) {
|
|
981
|
-
continue;
|
|
982
|
-
}
|
|
983
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
984
|
-
}
|
|
985
|
-
return conversion;
|
|
986
|
-
};
|
|
48
|
+
Object.defineProperty(styles, groupName, {
|
|
49
|
+
value: group,
|
|
50
|
+
enumerable: false
|
|
51
|
+
});
|
|
987
52
|
}
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
};
|
|
1007
|
-
if ("conversion" in fn) {
|
|
1008
|
-
wrappedFn.conversion = fn.conversion;
|
|
1009
|
-
}
|
|
1010
|
-
return wrappedFn;
|
|
1011
|
-
}
|
|
1012
|
-
function wrapRounded(fn) {
|
|
1013
|
-
var wrappedFn = function(args) {
|
|
1014
|
-
if (args === void 0 || args === null) {
|
|
1015
|
-
return args;
|
|
1016
|
-
}
|
|
1017
|
-
if (arguments.length > 1) {
|
|
1018
|
-
args = Array.prototype.slice.call(arguments);
|
|
1019
|
-
}
|
|
1020
|
-
var result = fn(args);
|
|
1021
|
-
if (typeof result === "object") {
|
|
1022
|
-
for (var len = result.length, i = 0; i < len; i++) {
|
|
1023
|
-
result[i] = Math.round(result[i]);
|
|
53
|
+
Object.defineProperty(styles, "codes", {
|
|
54
|
+
value: codes,
|
|
55
|
+
enumerable: false
|
|
56
|
+
});
|
|
57
|
+
styles.color.close = "\x1B[39m";
|
|
58
|
+
styles.bgColor.close = "\x1B[49m";
|
|
59
|
+
styles.color.ansi = wrapAnsi16();
|
|
60
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
61
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
62
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
63
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
64
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
65
|
+
Object.defineProperties(styles, {
|
|
66
|
+
rgbToAnsi256: {
|
|
67
|
+
value(red2, green2, blue2) {
|
|
68
|
+
if (red2 === green2 && green2 === blue2) {
|
|
69
|
+
if (red2 < 8) {
|
|
70
|
+
return 16;
|
|
1024
71
|
}
|
|
72
|
+
if (red2 > 248) {
|
|
73
|
+
return 231;
|
|
74
|
+
}
|
|
75
|
+
return Math.round((red2 - 8) / 247 * 24) + 232;
|
|
1025
76
|
}
|
|
1026
|
-
return
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
1036
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
1037
|
-
var routes = route(fromModel);
|
|
1038
|
-
var routeModels = Object.keys(routes);
|
|
1039
|
-
routeModels.forEach(function(toModel) {
|
|
1040
|
-
var fn = routes[toModel];
|
|
1041
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1042
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1043
|
-
});
|
|
1044
|
-
});
|
|
1045
|
-
module2.exports = convert;
|
|
1046
|
-
}
|
|
1047
|
-
});
|
|
1048
|
-
|
|
1049
|
-
// ../../node_modules/.pnpm/ansi-styles@3.2.1/node_modules/ansi-styles/index.js
|
|
1050
|
-
var require_ansi_styles = __commonJS({
|
|
1051
|
-
"../../node_modules/.pnpm/ansi-styles@3.2.1/node_modules/ansi-styles/index.js"(exports2, module2) {
|
|
1052
|
-
"use strict";
|
|
1053
|
-
var colorConvert = require_color_convert();
|
|
1054
|
-
var wrapAnsi162 = (fn, offset) => function() {
|
|
1055
|
-
const code = fn.apply(colorConvert, arguments);
|
|
1056
|
-
return `\x1B[${code + offset}m`;
|
|
1057
|
-
};
|
|
1058
|
-
var wrapAnsi2562 = (fn, offset) => function() {
|
|
1059
|
-
const code = fn.apply(colorConvert, arguments);
|
|
1060
|
-
return `\x1B[${38 + offset};5;${code}m`;
|
|
1061
|
-
};
|
|
1062
|
-
var wrapAnsi16m2 = (fn, offset) => function() {
|
|
1063
|
-
const rgb = fn.apply(colorConvert, arguments);
|
|
1064
|
-
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
1065
|
-
};
|
|
1066
|
-
function assembleStyles2() {
|
|
1067
|
-
const codes = /* @__PURE__ */ new Map();
|
|
1068
|
-
const styles2 = {
|
|
1069
|
-
modifier: {
|
|
1070
|
-
reset: [0, 0],
|
|
1071
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
1072
|
-
bold: [1, 22],
|
|
1073
|
-
dim: [2, 22],
|
|
1074
|
-
italic: [3, 23],
|
|
1075
|
-
underline: [4, 24],
|
|
1076
|
-
inverse: [7, 27],
|
|
1077
|
-
hidden: [8, 28],
|
|
1078
|
-
strikethrough: [9, 29]
|
|
1079
|
-
},
|
|
1080
|
-
color: {
|
|
1081
|
-
black: [30, 39],
|
|
1082
|
-
red: [31, 39],
|
|
1083
|
-
green: [32, 39],
|
|
1084
|
-
yellow: [33, 39],
|
|
1085
|
-
blue: [34, 39],
|
|
1086
|
-
magenta: [35, 39],
|
|
1087
|
-
cyan: [36, 39],
|
|
1088
|
-
white: [37, 39],
|
|
1089
|
-
gray: [90, 39],
|
|
1090
|
-
// Bright color
|
|
1091
|
-
redBright: [91, 39],
|
|
1092
|
-
greenBright: [92, 39],
|
|
1093
|
-
yellowBright: [93, 39],
|
|
1094
|
-
blueBright: [94, 39],
|
|
1095
|
-
magentaBright: [95, 39],
|
|
1096
|
-
cyanBright: [96, 39],
|
|
1097
|
-
whiteBright: [97, 39]
|
|
1098
|
-
},
|
|
1099
|
-
bgColor: {
|
|
1100
|
-
bgBlack: [40, 49],
|
|
1101
|
-
bgRed: [41, 49],
|
|
1102
|
-
bgGreen: [42, 49],
|
|
1103
|
-
bgYellow: [43, 49],
|
|
1104
|
-
bgBlue: [44, 49],
|
|
1105
|
-
bgMagenta: [45, 49],
|
|
1106
|
-
bgCyan: [46, 49],
|
|
1107
|
-
bgWhite: [47, 49],
|
|
1108
|
-
// Bright color
|
|
1109
|
-
bgBlackBright: [100, 49],
|
|
1110
|
-
bgRedBright: [101, 49],
|
|
1111
|
-
bgGreenBright: [102, 49],
|
|
1112
|
-
bgYellowBright: [103, 49],
|
|
1113
|
-
bgBlueBright: [104, 49],
|
|
1114
|
-
bgMagentaBright: [105, 49],
|
|
1115
|
-
bgCyanBright: [106, 49],
|
|
1116
|
-
bgWhiteBright: [107, 49]
|
|
77
|
+
return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5);
|
|
78
|
+
},
|
|
79
|
+
enumerable: false
|
|
80
|
+
},
|
|
81
|
+
hexToRgb: {
|
|
82
|
+
value(hex) {
|
|
83
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
84
|
+
if (!matches) {
|
|
85
|
+
return [0, 0, 0];
|
|
1117
86
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
const group = styles2[groupName];
|
|
1122
|
-
for (const styleName of Object.keys(group)) {
|
|
1123
|
-
const style = group[styleName];
|
|
1124
|
-
styles2[styleName] = {
|
|
1125
|
-
open: `\x1B[${style[0]}m`,
|
|
1126
|
-
close: `\x1B[${style[1]}m`
|
|
1127
|
-
};
|
|
1128
|
-
group[styleName] = styles2[styleName];
|
|
1129
|
-
codes.set(style[0], style[1]);
|
|
87
|
+
let [colorString] = matches;
|
|
88
|
+
if (colorString.length === 3) {
|
|
89
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
1130
90
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
styles2.color.ansi16m = {
|
|
1151
|
-
rgb: wrapAnsi16m2(rgb2rgb, 0)
|
|
1152
|
-
};
|
|
1153
|
-
styles2.bgColor.ansi = {
|
|
1154
|
-
ansi: wrapAnsi162(ansi2ansi, 10)
|
|
1155
|
-
};
|
|
1156
|
-
styles2.bgColor.ansi256 = {
|
|
1157
|
-
ansi256: wrapAnsi2562(ansi2ansi, 10)
|
|
1158
|
-
};
|
|
1159
|
-
styles2.bgColor.ansi16m = {
|
|
1160
|
-
rgb: wrapAnsi16m2(rgb2rgb, 10)
|
|
1161
|
-
};
|
|
1162
|
-
for (let key of Object.keys(colorConvert)) {
|
|
1163
|
-
if (typeof colorConvert[key] !== "object") {
|
|
1164
|
-
continue;
|
|
91
|
+
const integer = Number.parseInt(colorString, 16);
|
|
92
|
+
return [
|
|
93
|
+
/* eslint-disable no-bitwise */
|
|
94
|
+
integer >> 16 & 255,
|
|
95
|
+
integer >> 8 & 255,
|
|
96
|
+
integer & 255
|
|
97
|
+
/* eslint-enable no-bitwise */
|
|
98
|
+
];
|
|
99
|
+
},
|
|
100
|
+
enumerable: false
|
|
101
|
+
},
|
|
102
|
+
hexToAnsi256: {
|
|
103
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
104
|
+
enumerable: false
|
|
105
|
+
},
|
|
106
|
+
ansi256ToAnsi: {
|
|
107
|
+
value(code) {
|
|
108
|
+
if (code < 8) {
|
|
109
|
+
return 30 + code;
|
|
1165
110
|
}
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
key = "ansi";
|
|
111
|
+
if (code < 16) {
|
|
112
|
+
return 90 + (code - 8);
|
|
1169
113
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
114
|
+
let red2;
|
|
115
|
+
let green2;
|
|
116
|
+
let blue2;
|
|
117
|
+
if (code >= 232) {
|
|
118
|
+
red2 = ((code - 232) * 10 + 8) / 255;
|
|
119
|
+
green2 = red2;
|
|
120
|
+
blue2 = red2;
|
|
121
|
+
} else {
|
|
122
|
+
code -= 16;
|
|
123
|
+
const remainder = code % 36;
|
|
124
|
+
red2 = Math.floor(code / 36) / 5;
|
|
125
|
+
green2 = Math.floor(remainder / 6) / 5;
|
|
126
|
+
blue2 = remainder % 6 / 5;
|
|
1173
127
|
}
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
128
|
+
const value = Math.max(red2, green2, blue2) * 2;
|
|
129
|
+
if (value === 0) {
|
|
130
|
+
return 30;
|
|
1177
131
|
}
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
132
|
+
let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2));
|
|
133
|
+
if (value === 2) {
|
|
134
|
+
result += 60;
|
|
1181
135
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
136
|
+
return result;
|
|
137
|
+
},
|
|
138
|
+
enumerable: false
|
|
139
|
+
},
|
|
140
|
+
rgbToAnsi: {
|
|
141
|
+
value: (red2, green2, blue2) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red2, green2, blue2)),
|
|
142
|
+
enumerable: false
|
|
143
|
+
},
|
|
144
|
+
hexToAnsi: {
|
|
145
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
146
|
+
enumerable: false
|
|
1184
147
|
}
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
148
|
+
});
|
|
149
|
+
return styles;
|
|
150
|
+
}
|
|
151
|
+
var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
|
|
152
|
+
var init_ansi_styles = __esm({
|
|
153
|
+
"../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
|
|
154
|
+
ANSI_BACKGROUND_OFFSET = 10;
|
|
155
|
+
wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
156
|
+
wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
157
|
+
wrapAnsi16m = (offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`;
|
|
158
|
+
styles = {
|
|
159
|
+
modifier: {
|
|
160
|
+
reset: [0, 0],
|
|
161
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
162
|
+
bold: [1, 22],
|
|
163
|
+
dim: [2, 22],
|
|
164
|
+
italic: [3, 23],
|
|
165
|
+
underline: [4, 24],
|
|
166
|
+
overline: [53, 55],
|
|
167
|
+
inverse: [7, 27],
|
|
168
|
+
hidden: [8, 28],
|
|
169
|
+
strikethrough: [9, 29]
|
|
170
|
+
},
|
|
171
|
+
color: {
|
|
172
|
+
black: [30, 39],
|
|
173
|
+
red: [31, 39],
|
|
174
|
+
green: [32, 39],
|
|
175
|
+
yellow: [33, 39],
|
|
176
|
+
blue: [34, 39],
|
|
177
|
+
magenta: [35, 39],
|
|
178
|
+
cyan: [36, 39],
|
|
179
|
+
white: [37, 39],
|
|
180
|
+
// Bright color
|
|
181
|
+
blackBright: [90, 39],
|
|
182
|
+
gray: [90, 39],
|
|
183
|
+
// Alias of `blackBright`
|
|
184
|
+
grey: [90, 39],
|
|
185
|
+
// Alias of `blackBright`
|
|
186
|
+
redBright: [91, 39],
|
|
187
|
+
greenBright: [92, 39],
|
|
188
|
+
yellowBright: [93, 39],
|
|
189
|
+
blueBright: [94, 39],
|
|
190
|
+
magentaBright: [95, 39],
|
|
191
|
+
cyanBright: [96, 39],
|
|
192
|
+
whiteBright: [97, 39]
|
|
193
|
+
},
|
|
194
|
+
bgColor: {
|
|
195
|
+
bgBlack: [40, 49],
|
|
196
|
+
bgRed: [41, 49],
|
|
197
|
+
bgGreen: [42, 49],
|
|
198
|
+
bgYellow: [43, 49],
|
|
199
|
+
bgBlue: [44, 49],
|
|
200
|
+
bgMagenta: [45, 49],
|
|
201
|
+
bgCyan: [46, 49],
|
|
202
|
+
bgWhite: [47, 49],
|
|
203
|
+
// Bright color
|
|
204
|
+
bgBlackBright: [100, 49],
|
|
205
|
+
bgGray: [100, 49],
|
|
206
|
+
// Alias of `bgBlackBright`
|
|
207
|
+
bgGrey: [100, 49],
|
|
208
|
+
// Alias of `bgBlackBright`
|
|
209
|
+
bgRedBright: [101, 49],
|
|
210
|
+
bgGreenBright: [102, 49],
|
|
211
|
+
bgYellowBright: [103, 49],
|
|
212
|
+
bgBlueBright: [104, 49],
|
|
213
|
+
bgMagentaBright: [105, 49],
|
|
214
|
+
bgCyanBright: [106, 49],
|
|
215
|
+
bgWhiteBright: [107, 49]
|
|
216
|
+
}
|
|
1202
217
|
};
|
|
218
|
+
modifierNames = Object.keys(styles.modifier);
|
|
219
|
+
foregroundColorNames = Object.keys(styles.color);
|
|
220
|
+
backgroundColorNames = Object.keys(styles.bgColor);
|
|
221
|
+
colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
222
|
+
ansiStyles = assembleStyles();
|
|
223
|
+
ansi_styles_default = ansiStyles;
|
|
1203
224
|
}
|
|
1204
225
|
});
|
|
1205
226
|
|
|
1206
|
-
// ../../node_modules/.pnpm/
|
|
1207
|
-
|
|
1208
|
-
"
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
forceColor = true;
|
|
1218
|
-
}
|
|
1219
|
-
if ("FORCE_COLOR" in env2) {
|
|
1220
|
-
forceColor = env2.FORCE_COLOR.length === 0 || parseInt(env2.FORCE_COLOR, 10) !== 0;
|
|
227
|
+
// ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
228
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
|
|
229
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
230
|
+
const position = argv.indexOf(prefix + flag);
|
|
231
|
+
const terminatorPosition = argv.indexOf("--");
|
|
232
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
233
|
+
}
|
|
234
|
+
function envForceColor() {
|
|
235
|
+
if ("FORCE_COLOR" in env) {
|
|
236
|
+
if (env.FORCE_COLOR === "true") {
|
|
237
|
+
return 1;
|
|
1221
238
|
}
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
return false;
|
|
1225
|
-
}
|
|
1226
|
-
return {
|
|
1227
|
-
level,
|
|
1228
|
-
hasBasic: true,
|
|
1229
|
-
has256: level >= 2,
|
|
1230
|
-
has16m: level >= 3
|
|
1231
|
-
};
|
|
239
|
+
if (env.FORCE_COLOR === "false") {
|
|
240
|
+
return 0;
|
|
1232
241
|
}
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
}
|
|
1260
|
-
if ("TEAMCITY_VERSION" in env2) {
|
|
1261
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
1262
|
-
}
|
|
1263
|
-
if (env2.COLORTERM === "truecolor") {
|
|
1264
|
-
return 3;
|
|
1265
|
-
}
|
|
1266
|
-
if ("TERM_PROGRAM" in env2) {
|
|
1267
|
-
const version3 = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
1268
|
-
switch (env2.TERM_PROGRAM) {
|
|
1269
|
-
case "iTerm.app":
|
|
1270
|
-
return version3 >= 3 ? 3 : 2;
|
|
1271
|
-
case "Apple_Terminal":
|
|
1272
|
-
return 2;
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
1276
|
-
return 2;
|
|
1277
|
-
}
|
|
1278
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
1279
|
-
return 1;
|
|
1280
|
-
}
|
|
1281
|
-
if ("COLORTERM" in env2) {
|
|
1282
|
-
return 1;
|
|
1283
|
-
}
|
|
1284
|
-
if (env2.TERM === "dumb") {
|
|
1285
|
-
return min;
|
|
1286
|
-
}
|
|
1287
|
-
return min;
|
|
242
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function translateLevel(level) {
|
|
246
|
+
if (level === 0) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
level,
|
|
251
|
+
hasBasic: true,
|
|
252
|
+
has256: level >= 2,
|
|
253
|
+
has16m: level >= 3
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
257
|
+
const noFlagForceColor = envForceColor();
|
|
258
|
+
if (noFlagForceColor !== void 0) {
|
|
259
|
+
flagForceColor = noFlagForceColor;
|
|
260
|
+
}
|
|
261
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
262
|
+
if (forceColor === 0) {
|
|
263
|
+
return 0;
|
|
264
|
+
}
|
|
265
|
+
if (sniffFlags) {
|
|
266
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
267
|
+
return 3;
|
|
1288
268
|
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
return translateLevel(level);
|
|
269
|
+
if (hasFlag("color=256")) {
|
|
270
|
+
return 2;
|
|
1292
271
|
}
|
|
1293
|
-
module2.exports = {
|
|
1294
|
-
supportsColor: getSupportLevel,
|
|
1295
|
-
stdout: getSupportLevel(process.stdout),
|
|
1296
|
-
stderr: getSupportLevel(process.stderr)
|
|
1297
|
-
};
|
|
1298
272
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
[
|
|
1313
|
-
["b", "\b"],
|
|
1314
|
-
["f", "\f"],
|
|
1315
|
-
["v", "\v"],
|
|
1316
|
-
["0", "\0"],
|
|
1317
|
-
["\\", "\\"],
|
|
1318
|
-
["e", "\x1B"],
|
|
1319
|
-
["a", "\x07"]
|
|
1320
|
-
]);
|
|
1321
|
-
function unescape2(c2) {
|
|
1322
|
-
if (c2[0] === "u" && c2.length === 5 || c2[0] === "x" && c2.length === 3) {
|
|
1323
|
-
return String.fromCharCode(parseInt(c2.slice(1), 16));
|
|
1324
|
-
}
|
|
1325
|
-
return ESCAPES4.get(c2) || c2;
|
|
273
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
274
|
+
return 1;
|
|
275
|
+
}
|
|
276
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
277
|
+
return 0;
|
|
278
|
+
}
|
|
279
|
+
const min = forceColor || 0;
|
|
280
|
+
if (env.TERM === "dumb") {
|
|
281
|
+
return min;
|
|
282
|
+
}
|
|
283
|
+
if (import_node_process.default.platform === "win32") {
|
|
284
|
+
const osRelease = import_node_os.default.release().split(".");
|
|
285
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
286
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1326
287
|
}
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
if (!isNaN(chunk)) {
|
|
1333
|
-
results.push(Number(chunk));
|
|
1334
|
-
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
1335
|
-
results.push(matches[2].replace(ESCAPE_REGEX, (m2, escape, chr) => escape ? unescape2(escape) : chr));
|
|
1336
|
-
} else {
|
|
1337
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
return results;
|
|
288
|
+
return 1;
|
|
289
|
+
}
|
|
290
|
+
if ("CI" in env) {
|
|
291
|
+
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
292
|
+
return 3;
|
|
1341
293
|
}
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
const results = [];
|
|
1345
|
-
let matches;
|
|
1346
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
1347
|
-
const name = matches[1];
|
|
1348
|
-
if (matches[2]) {
|
|
1349
|
-
const args = parseArguments(name, matches[2]);
|
|
1350
|
-
results.push([name].concat(args));
|
|
1351
|
-
} else {
|
|
1352
|
-
results.push([name]);
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
return results;
|
|
294
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
295
|
+
return 1;
|
|
1356
296
|
}
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
297
|
+
return min;
|
|
298
|
+
}
|
|
299
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
300
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
301
|
+
}
|
|
302
|
+
if (env.COLORTERM === "truecolor") {
|
|
303
|
+
return 3;
|
|
304
|
+
}
|
|
305
|
+
if (env.TERM === "xterm-kitty") {
|
|
306
|
+
return 3;
|
|
307
|
+
}
|
|
308
|
+
if ("TERM_PROGRAM" in env) {
|
|
309
|
+
const version3 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
310
|
+
switch (env.TERM_PROGRAM) {
|
|
311
|
+
case "iTerm.app": {
|
|
312
|
+
return version3 >= 3 ? 3 : 2;
|
|
1363
313
|
}
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
if (Array.isArray(enabled[styleName])) {
|
|
1367
|
-
if (!(styleName in current)) {
|
|
1368
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
1369
|
-
}
|
|
1370
|
-
if (enabled[styleName].length > 0) {
|
|
1371
|
-
current = current[styleName].apply(current, enabled[styleName]);
|
|
1372
|
-
} else {
|
|
1373
|
-
current = current[styleName];
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
314
|
+
case "Apple_Terminal": {
|
|
315
|
+
return 2;
|
|
1376
316
|
}
|
|
1377
|
-
return current;
|
|
1378
317
|
}
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
318
|
+
}
|
|
319
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
320
|
+
return 2;
|
|
321
|
+
}
|
|
322
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
323
|
+
return 1;
|
|
324
|
+
}
|
|
325
|
+
if ("COLORTERM" in env) {
|
|
326
|
+
return 1;
|
|
327
|
+
}
|
|
328
|
+
return min;
|
|
329
|
+
}
|
|
330
|
+
function createSupportsColor(stream, options = {}) {
|
|
331
|
+
const level = _supportsColor(stream, {
|
|
332
|
+
streamIsTTY: stream && stream.isTTY,
|
|
333
|
+
...options
|
|
334
|
+
});
|
|
335
|
+
return translateLevel(level);
|
|
336
|
+
}
|
|
337
|
+
var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default;
|
|
338
|
+
var init_supports_color = __esm({
|
|
339
|
+
"../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js"() {
|
|
340
|
+
import_node_process = __toESM(require("node:process"), 1);
|
|
341
|
+
import_node_os = __toESM(require("node:os"), 1);
|
|
342
|
+
import_node_tty = __toESM(require("node:tty"), 1);
|
|
343
|
+
({ env } = import_node_process.default);
|
|
344
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
345
|
+
flagForceColor = 0;
|
|
346
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
347
|
+
flagForceColor = 1;
|
|
348
|
+
}
|
|
349
|
+
supportsColor = {
|
|
350
|
+
stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
|
|
351
|
+
stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
|
|
1408
352
|
};
|
|
353
|
+
supports_color_default = supportsColor;
|
|
1409
354
|
}
|
|
1410
355
|
});
|
|
1411
356
|
|
|
1412
|
-
// ../../node_modules/.pnpm/chalk@
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
357
|
+
// ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
|
|
358
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
359
|
+
let index = string.indexOf(substring);
|
|
360
|
+
if (index === -1) {
|
|
361
|
+
return string;
|
|
362
|
+
}
|
|
363
|
+
const substringLength = substring.length;
|
|
364
|
+
let endIndex = 0;
|
|
365
|
+
let returnValue = "";
|
|
366
|
+
do {
|
|
367
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
368
|
+
endIndex = index + substringLength;
|
|
369
|
+
index = string.indexOf(substring, endIndex);
|
|
370
|
+
} while (index !== -1);
|
|
371
|
+
returnValue += string.slice(endIndex);
|
|
372
|
+
return returnValue;
|
|
373
|
+
}
|
|
374
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
375
|
+
let endIndex = 0;
|
|
376
|
+
let returnValue = "";
|
|
377
|
+
do {
|
|
378
|
+
const gotCR = string[index - 1] === "\r";
|
|
379
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
380
|
+
endIndex = index + 1;
|
|
381
|
+
index = string.indexOf("\n", endIndex);
|
|
382
|
+
} while (index !== -1);
|
|
383
|
+
returnValue += string.slice(endIndex);
|
|
384
|
+
return returnValue;
|
|
385
|
+
}
|
|
386
|
+
var init_utilities = __esm({
|
|
387
|
+
"../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js"() {
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
// ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
|
|
392
|
+
function createChalk(options) {
|
|
393
|
+
return chalkFactory(options);
|
|
394
|
+
}
|
|
395
|
+
var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
|
|
396
|
+
var init_source = __esm({
|
|
397
|
+
"../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js"() {
|
|
398
|
+
init_ansi_styles();
|
|
399
|
+
init_supports_color();
|
|
400
|
+
init_utilities();
|
|
401
|
+
({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
|
|
402
|
+
GENERATOR = Symbol("GENERATOR");
|
|
403
|
+
STYLER = Symbol("STYLER");
|
|
404
|
+
IS_EMPTY = Symbol("IS_EMPTY");
|
|
405
|
+
levelMapping = [
|
|
406
|
+
"ansi",
|
|
407
|
+
"ansi",
|
|
408
|
+
"ansi256",
|
|
409
|
+
"ansi16m"
|
|
410
|
+
];
|
|
411
|
+
styles2 = /* @__PURE__ */ Object.create(null);
|
|
412
|
+
applyOptions = (object, options = {}) => {
|
|
413
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
414
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1442
415
|
}
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
416
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
417
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
418
|
+
};
|
|
419
|
+
chalkFactory = (options) => {
|
|
420
|
+
const chalk2 = (...strings) => strings.join(" ");
|
|
421
|
+
applyOptions(chalk2, options);
|
|
422
|
+
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
423
|
+
return chalk2;
|
|
424
|
+
};
|
|
425
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
426
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
427
|
+
styles2[styleName] = {
|
|
1451
428
|
get() {
|
|
1452
|
-
const
|
|
1453
|
-
|
|
429
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
430
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
431
|
+
return builder;
|
|
1454
432
|
}
|
|
1455
433
|
};
|
|
1456
434
|
}
|
|
1457
435
|
styles2.visible = {
|
|
1458
436
|
get() {
|
|
1459
|
-
|
|
437
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
438
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
439
|
+
return builder;
|
|
1460
440
|
}
|
|
1461
441
|
};
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
442
|
+
getModelAnsi = (model, level, type, ...arguments_) => {
|
|
443
|
+
if (model === "rgb") {
|
|
444
|
+
if (level === "ansi16m") {
|
|
445
|
+
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
446
|
+
}
|
|
447
|
+
if (level === "ansi256") {
|
|
448
|
+
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
449
|
+
}
|
|
450
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
1466
451
|
}
|
|
452
|
+
if (model === "hex") {
|
|
453
|
+
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
454
|
+
}
|
|
455
|
+
return ansi_styles_default[type][model](...arguments_);
|
|
456
|
+
};
|
|
457
|
+
usedModels = ["rgb", "hex", "ansi256"];
|
|
458
|
+
for (const model of usedModels) {
|
|
1467
459
|
styles2[model] = {
|
|
1468
460
|
get() {
|
|
1469
|
-
const level = this
|
|
1470
|
-
return function() {
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1473
|
-
open: open2,
|
|
1474
|
-
close: ansiStyles2.color.close,
|
|
1475
|
-
closeRe: ansiStyles2.color.closeRe
|
|
1476
|
-
};
|
|
1477
|
-
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
|
|
461
|
+
const { level } = this;
|
|
462
|
+
return function(...arguments_) {
|
|
463
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
464
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
1478
465
|
};
|
|
1479
466
|
}
|
|
1480
467
|
};
|
|
1481
|
-
}
|
|
1482
|
-
ansiStyles2.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles2.bgColor.close), "g");
|
|
1483
|
-
for (const model of Object.keys(ansiStyles2.bgColor.ansi)) {
|
|
1484
|
-
if (skipModels.has(model)) {
|
|
1485
|
-
continue;
|
|
1486
|
-
}
|
|
1487
468
|
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1488
469
|
styles2[bgModel] = {
|
|
1489
470
|
get() {
|
|
1490
|
-
const level = this
|
|
1491
|
-
return function() {
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1494
|
-
open: open2,
|
|
1495
|
-
close: ansiStyles2.bgColor.close,
|
|
1496
|
-
closeRe: ansiStyles2.bgColor.closeRe
|
|
1497
|
-
};
|
|
1498
|
-
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
|
|
471
|
+
const { level } = this;
|
|
472
|
+
return function(...arguments_) {
|
|
473
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
474
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
1499
475
|
};
|
|
1500
476
|
}
|
|
1501
477
|
};
|
|
1502
478
|
}
|
|
1503
|
-
|
|
1504
|
-
},
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
return applyStyle.apply(builder, arguments);
|
|
1508
|
-
};
|
|
1509
|
-
builder._styles = _styles;
|
|
1510
|
-
builder._empty = _empty;
|
|
1511
|
-
const self2 = this;
|
|
1512
|
-
Object.defineProperty(builder, "level", {
|
|
479
|
+
proto = Object.defineProperties(() => {
|
|
480
|
+
}, {
|
|
481
|
+
...styles2,
|
|
482
|
+
level: {
|
|
1513
483
|
enumerable: true,
|
|
1514
484
|
get() {
|
|
1515
|
-
return
|
|
485
|
+
return this[GENERATOR].level;
|
|
1516
486
|
},
|
|
1517
487
|
set(level) {
|
|
1518
|
-
|
|
1519
|
-
}
|
|
1520
|
-
});
|
|
1521
|
-
Object.defineProperty(builder, "enabled", {
|
|
1522
|
-
enumerable: true,
|
|
1523
|
-
get() {
|
|
1524
|
-
return self2.enabled;
|
|
1525
|
-
},
|
|
1526
|
-
set(enabled) {
|
|
1527
|
-
self2.enabled = enabled;
|
|
1528
|
-
}
|
|
1529
|
-
});
|
|
1530
|
-
builder.hasGrey = this.hasGrey || key === "gray" || key === "grey";
|
|
1531
|
-
builder.__proto__ = proto;
|
|
1532
|
-
return builder;
|
|
1533
|
-
}
|
|
1534
|
-
function applyStyle() {
|
|
1535
|
-
const args = arguments;
|
|
1536
|
-
const argsLen = args.length;
|
|
1537
|
-
let str = String(arguments[0]);
|
|
1538
|
-
if (argsLen === 0) {
|
|
1539
|
-
return "";
|
|
1540
|
-
}
|
|
1541
|
-
if (argsLen > 1) {
|
|
1542
|
-
for (let a = 1; a < argsLen; a++) {
|
|
1543
|
-
str += " " + args[a];
|
|
488
|
+
this[GENERATOR].level = level;
|
|
1544
489
|
}
|
|
1545
490
|
}
|
|
1546
|
-
|
|
1547
|
-
|
|
491
|
+
});
|
|
492
|
+
createStyler = (open2, close, parent) => {
|
|
493
|
+
let openAll;
|
|
494
|
+
let closeAll;
|
|
495
|
+
if (parent === void 0) {
|
|
496
|
+
openAll = open2;
|
|
497
|
+
closeAll = close;
|
|
498
|
+
} else {
|
|
499
|
+
openAll = parent.openAll + open2;
|
|
500
|
+
closeAll = close + parent.closeAll;
|
|
1548
501
|
}
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
502
|
+
return {
|
|
503
|
+
open: open2,
|
|
504
|
+
close,
|
|
505
|
+
openAll,
|
|
506
|
+
closeAll,
|
|
507
|
+
parent
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
createBuilder = (self2, _styler, _isEmpty) => {
|
|
511
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
512
|
+
Object.setPrototypeOf(builder, proto);
|
|
513
|
+
builder[GENERATOR] = self2;
|
|
514
|
+
builder[STYLER] = _styler;
|
|
515
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
516
|
+
return builder;
|
|
517
|
+
};
|
|
518
|
+
applyStyle = (self2, string) => {
|
|
519
|
+
if (self2.level <= 0 || !string) {
|
|
520
|
+
return self2[IS_EMPTY] ? "" : string;
|
|
1552
521
|
}
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
522
|
+
let styler = self2[STYLER];
|
|
523
|
+
if (styler === void 0) {
|
|
524
|
+
return string;
|
|
1556
525
|
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
526
|
+
const { openAll, closeAll } = styler;
|
|
527
|
+
if (string.includes("\x1B")) {
|
|
528
|
+
while (styler !== void 0) {
|
|
529
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
530
|
+
styler = styler.parent;
|
|
531
|
+
}
|
|
1563
532
|
}
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
|
|
1568
|
-
parts.push(String(strings.raw[i]));
|
|
533
|
+
const lfIndex = string.indexOf("\n");
|
|
534
|
+
if (lfIndex !== -1) {
|
|
535
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1569
536
|
}
|
|
1570
|
-
return
|
|
1571
|
-
}
|
|
1572
|
-
Object.defineProperties(
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
537
|
+
return openAll + string + closeAll;
|
|
538
|
+
};
|
|
539
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
|
540
|
+
chalk = createChalk();
|
|
541
|
+
chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
542
|
+
source_default = chalk;
|
|
1576
543
|
}
|
|
1577
544
|
});
|
|
1578
545
|
|
|
1579
546
|
// ../cli/colors.ts
|
|
1580
|
-
var
|
|
547
|
+
var white, gray, dim, hidden, bold, cyanBright, bgCyan, brandColor, black, blue, bgBlue, red, bgRed, green, bgGreen, yellow, bgYellow;
|
|
1581
548
|
var init_colors = __esm({
|
|
1582
549
|
"../cli/colors.ts"() {
|
|
1583
|
-
|
|
1584
|
-
({ white, gray, dim, hidden, bold, cyanBright, bgCyan } =
|
|
1585
|
-
brandColor =
|
|
1586
|
-
black =
|
|
1587
|
-
blue =
|
|
550
|
+
init_source();
|
|
551
|
+
({ white, gray, dim, hidden, bold, cyanBright, bgCyan } = source_default);
|
|
552
|
+
brandColor = source_default.hex("#BD5B08");
|
|
553
|
+
black = source_default.hex("#111");
|
|
554
|
+
blue = source_default.hex("#0E838F");
|
|
1588
555
|
bgBlue = black.bgHex("#0E838F");
|
|
1589
|
-
red =
|
|
556
|
+
red = source_default.hex("#AB2526");
|
|
1590
557
|
bgRed = black.bgHex("#AB2526");
|
|
1591
|
-
green =
|
|
558
|
+
green = source_default.hex("#218529");
|
|
1592
559
|
bgGreen = black.bgHex("#218529");
|
|
1593
|
-
yellow =
|
|
560
|
+
yellow = source_default.hex("#7F7322");
|
|
1594
561
|
bgYellow = black.bgHex("#7F7322");
|
|
1595
562
|
}
|
|
1596
563
|
});
|
|
@@ -1715,16 +682,17 @@ var init_cli = __esm({
|
|
|
1715
682
|
// current default for backcompat -- TODO: change default to shapes.bar once all callees have been updated
|
|
1716
683
|
shape = shapes.corners.bl,
|
|
1717
684
|
// current default for backcompat -- TODO: change default to true once all callees have been updated
|
|
1718
|
-
multiline = false
|
|
685
|
+
multiline = false,
|
|
686
|
+
newlineBefore = true
|
|
1719
687
|
} = {}) => {
|
|
1720
688
|
logRaw(
|
|
1721
689
|
format(msg, {
|
|
1722
690
|
firstLinePrefix: gray(shape) + space() + status.warning,
|
|
1723
691
|
linePrefix: gray(shapes.bar),
|
|
1724
|
-
newlineBefore: true,
|
|
1725
692
|
formatLine: (line) => dim(line),
|
|
1726
693
|
// for backcompat but it's not ideal for this to be "dim"
|
|
1727
|
-
multiline
|
|
694
|
+
multiline,
|
|
695
|
+
newlineBefore
|
|
1728
696
|
})
|
|
1729
697
|
);
|
|
1730
698
|
};
|
|
@@ -1815,8 +783,8 @@ var require_src = __commonJS({
|
|
|
1815
783
|
// ../../node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js
|
|
1816
784
|
var require_picocolors = __commonJS({
|
|
1817
785
|
"../../node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js"(exports2, module2) {
|
|
1818
|
-
var
|
|
1819
|
-
var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" ||
|
|
786
|
+
var tty2 = require("tty");
|
|
787
|
+
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);
|
|
1820
788
|
var formatter = (open2, close, replace = open2) => (input) => {
|
|
1821
789
|
let string = "" + input;
|
|
1822
790
|
let index = string.indexOf(close, open2.length);
|
|
@@ -1952,13 +920,13 @@ function eD(t) {
|
|
|
1952
920
|
function g(t, u) {
|
|
1953
921
|
t.isTTY && t.setRawMode(u);
|
|
1954
922
|
}
|
|
1955
|
-
var import_sisteransi,
|
|
923
|
+
var import_sisteransi, import_node_process2, import_node_readline, import_node_tty2, import_picocolors, m, G, K, Y, v, L, M, T, r, Z, H, q, p, J, b, W, Q, I, w, N, j, X, _, DD, uD, R, V, tD, h, sD, iD, ED, oD;
|
|
1956
924
|
var init_dist = __esm({
|
|
1957
925
|
"../../node_modules/.pnpm/@clack+core@0.3.2/node_modules/@clack/core/dist/index.mjs"() {
|
|
1958
926
|
import_sisteransi = __toESM(require_src(), 1);
|
|
1959
|
-
|
|
927
|
+
import_node_process2 = require("node:process");
|
|
1960
928
|
import_node_readline = __toESM(require("node:readline"), 1);
|
|
1961
|
-
|
|
929
|
+
import_node_tty2 = require("node:tty");
|
|
1962
930
|
import_picocolors = __toESM(require_picocolors(), 1);
|
|
1963
931
|
m = {};
|
|
1964
932
|
G = { get exports() {
|
|
@@ -2090,11 +1058,11 @@ var init_dist = __esm({
|
|
|
2090
1058
|
V = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
|
|
2091
1059
|
tD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
|
|
2092
1060
|
h = class {
|
|
2093
|
-
constructor({ render: u, input: F =
|
|
1061
|
+
constructor({ render: u, input: F = import_node_process2.stdin, output: e = import_node_process2.stdout, ...s }, C = true) {
|
|
2094
1062
|
this._track = false, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = /* @__PURE__ */ new Map(), this._prevFrame = "", this.opts = s, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C, this.input = F, this.output = e;
|
|
2095
1063
|
}
|
|
2096
1064
|
prompt() {
|
|
2097
|
-
const u = new
|
|
1065
|
+
const u = new import_node_tty2.WriteStream(0);
|
|
2098
1066
|
return u._write = (F, e, s) => {
|
|
2099
1067
|
this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s();
|
|
2100
1068
|
}, this.input.pipe(u), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e) => {
|
|
@@ -2483,11 +1451,11 @@ var require_signals = __commonJS({
|
|
|
2483
1451
|
// ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js
|
|
2484
1452
|
var require_signal_exit = __commonJS({
|
|
2485
1453
|
"../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports2, module2) {
|
|
2486
|
-
var
|
|
2487
|
-
var processOk = function(
|
|
2488
|
-
return
|
|
1454
|
+
var process6 = global.process;
|
|
1455
|
+
var processOk = function(process7) {
|
|
1456
|
+
return process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function";
|
|
2489
1457
|
};
|
|
2490
|
-
if (!processOk(
|
|
1458
|
+
if (!processOk(process6)) {
|
|
2491
1459
|
module2.exports = function() {
|
|
2492
1460
|
return function() {
|
|
2493
1461
|
};
|
|
@@ -2495,15 +1463,15 @@ var require_signal_exit = __commonJS({
|
|
|
2495
1463
|
} else {
|
|
2496
1464
|
assert = require("assert");
|
|
2497
1465
|
signals = require_signals();
|
|
2498
|
-
isWin = /^win/i.test(
|
|
1466
|
+
isWin = /^win/i.test(process6.platform);
|
|
2499
1467
|
EE = require("events");
|
|
2500
1468
|
if (typeof EE !== "function") {
|
|
2501
1469
|
EE = EE.EventEmitter;
|
|
2502
1470
|
}
|
|
2503
|
-
if (
|
|
2504
|
-
emitter =
|
|
1471
|
+
if (process6.__signal_exit_emitter__) {
|
|
1472
|
+
emitter = process6.__signal_exit_emitter__;
|
|
2505
1473
|
} else {
|
|
2506
|
-
emitter =
|
|
1474
|
+
emitter = process6.__signal_exit_emitter__ = new EE();
|
|
2507
1475
|
emitter.count = 0;
|
|
2508
1476
|
emitter.emitted = {};
|
|
2509
1477
|
}
|
|
@@ -2540,12 +1508,12 @@ var require_signal_exit = __commonJS({
|
|
|
2540
1508
|
loaded = false;
|
|
2541
1509
|
signals.forEach(function(sig) {
|
|
2542
1510
|
try {
|
|
2543
|
-
|
|
1511
|
+
process6.removeListener(sig, sigListeners[sig]);
|
|
2544
1512
|
} catch (er) {
|
|
2545
1513
|
}
|
|
2546
1514
|
});
|
|
2547
|
-
|
|
2548
|
-
|
|
1515
|
+
process6.emit = originalProcessEmit;
|
|
1516
|
+
process6.reallyExit = originalProcessReallyExit;
|
|
2549
1517
|
emitter.count -= 1;
|
|
2550
1518
|
};
|
|
2551
1519
|
module2.exports.unload = unload;
|
|
@@ -2562,7 +1530,7 @@ var require_signal_exit = __commonJS({
|
|
|
2562
1530
|
if (!processOk(global.process)) {
|
|
2563
1531
|
return;
|
|
2564
1532
|
}
|
|
2565
|
-
var listeners =
|
|
1533
|
+
var listeners = process6.listeners(sig);
|
|
2566
1534
|
if (listeners.length === emitter.count) {
|
|
2567
1535
|
unload();
|
|
2568
1536
|
emit("exit", null, sig);
|
|
@@ -2570,7 +1538,7 @@ var require_signal_exit = __commonJS({
|
|
|
2570
1538
|
if (isWin && sig === "SIGHUP") {
|
|
2571
1539
|
sig = "SIGINT";
|
|
2572
1540
|
}
|
|
2573
|
-
|
|
1541
|
+
process6.kill(process6.pid, sig);
|
|
2574
1542
|
}
|
|
2575
1543
|
};
|
|
2576
1544
|
});
|
|
@@ -2586,36 +1554,36 @@ var require_signal_exit = __commonJS({
|
|
|
2586
1554
|
emitter.count += 1;
|
|
2587
1555
|
signals = signals.filter(function(sig) {
|
|
2588
1556
|
try {
|
|
2589
|
-
|
|
1557
|
+
process6.on(sig, sigListeners[sig]);
|
|
2590
1558
|
return true;
|
|
2591
1559
|
} catch (er) {
|
|
2592
1560
|
return false;
|
|
2593
1561
|
}
|
|
2594
1562
|
});
|
|
2595
|
-
|
|
2596
|
-
|
|
1563
|
+
process6.emit = processEmit;
|
|
1564
|
+
process6.reallyExit = processReallyExit;
|
|
2597
1565
|
};
|
|
2598
1566
|
module2.exports.load = load;
|
|
2599
|
-
originalProcessReallyExit =
|
|
1567
|
+
originalProcessReallyExit = process6.reallyExit;
|
|
2600
1568
|
processReallyExit = function processReallyExit2(code) {
|
|
2601
1569
|
if (!processOk(global.process)) {
|
|
2602
1570
|
return;
|
|
2603
1571
|
}
|
|
2604
|
-
|
|
1572
|
+
process6.exitCode = code || /* istanbul ignore next */
|
|
2605
1573
|
0;
|
|
2606
|
-
emit("exit",
|
|
2607
|
-
emit("afterexit",
|
|
2608
|
-
originalProcessReallyExit.call(
|
|
1574
|
+
emit("exit", process6.exitCode, null);
|
|
1575
|
+
emit("afterexit", process6.exitCode, null);
|
|
1576
|
+
originalProcessReallyExit.call(process6, process6.exitCode);
|
|
2609
1577
|
};
|
|
2610
|
-
originalProcessEmit =
|
|
1578
|
+
originalProcessEmit = process6.emit;
|
|
2611
1579
|
processEmit = function processEmit2(ev, arg) {
|
|
2612
1580
|
if (ev === "exit" && processOk(global.process)) {
|
|
2613
1581
|
if (arg !== void 0) {
|
|
2614
|
-
|
|
1582
|
+
process6.exitCode = arg;
|
|
2615
1583
|
}
|
|
2616
1584
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
2617
|
-
emit("exit",
|
|
2618
|
-
emit("afterexit",
|
|
1585
|
+
emit("exit", process6.exitCode, null);
|
|
1586
|
+
emit("afterexit", process6.exitCode, null);
|
|
2619
1587
|
return ret;
|
|
2620
1588
|
} else {
|
|
2621
1589
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -2640,15 +1608,15 @@ var require_signal_exit = __commonJS({
|
|
|
2640
1608
|
});
|
|
2641
1609
|
|
|
2642
1610
|
// ../../node_modules/.pnpm/restore-cursor@4.0.0/node_modules/restore-cursor/index.js
|
|
2643
|
-
var
|
|
1611
|
+
var import_node_process3, import_onetime, import_signal_exit, restoreCursor, restore_cursor_default;
|
|
2644
1612
|
var init_restore_cursor = __esm({
|
|
2645
1613
|
"../../node_modules/.pnpm/restore-cursor@4.0.0/node_modules/restore-cursor/index.js"() {
|
|
2646
|
-
|
|
1614
|
+
import_node_process3 = __toESM(require("node:process"), 1);
|
|
2647
1615
|
import_onetime = __toESM(require_onetime(), 1);
|
|
2648
1616
|
import_signal_exit = __toESM(require_signal_exit(), 1);
|
|
2649
1617
|
restoreCursor = (0, import_onetime.default)(() => {
|
|
2650
1618
|
(0, import_signal_exit.default)(() => {
|
|
2651
|
-
|
|
1619
|
+
import_node_process3.default.stderr.write("\x1B[?25h");
|
|
2652
1620
|
}, { alwaysLast: true });
|
|
2653
1621
|
});
|
|
2654
1622
|
restore_cursor_default = restoreCursor;
|
|
@@ -2656,21 +1624,21 @@ var init_restore_cursor = __esm({
|
|
|
2656
1624
|
});
|
|
2657
1625
|
|
|
2658
1626
|
// ../../node_modules/.pnpm/cli-cursor@4.0.0/node_modules/cli-cursor/index.js
|
|
2659
|
-
var
|
|
1627
|
+
var import_node_process4, isHidden, cliCursor, cli_cursor_default;
|
|
2660
1628
|
var init_cli_cursor = __esm({
|
|
2661
1629
|
"../../node_modules/.pnpm/cli-cursor@4.0.0/node_modules/cli-cursor/index.js"() {
|
|
2662
|
-
|
|
1630
|
+
import_node_process4 = __toESM(require("node:process"), 1);
|
|
2663
1631
|
init_restore_cursor();
|
|
2664
1632
|
isHidden = false;
|
|
2665
1633
|
cliCursor = {};
|
|
2666
|
-
cliCursor.show = (writableStream =
|
|
1634
|
+
cliCursor.show = (writableStream = import_node_process4.default.stderr) => {
|
|
2667
1635
|
if (!writableStream.isTTY) {
|
|
2668
1636
|
return;
|
|
2669
1637
|
}
|
|
2670
1638
|
isHidden = false;
|
|
2671
1639
|
writableStream.write("\x1B[?25h");
|
|
2672
1640
|
};
|
|
2673
|
-
cliCursor.hide = (writableStream =
|
|
1641
|
+
cliCursor.hide = (writableStream = import_node_process4.default.stderr) => {
|
|
2674
1642
|
if (!writableStream.isTTY) {
|
|
2675
1643
|
return;
|
|
2676
1644
|
}
|
|
@@ -2864,35 +1832,35 @@ var init_string_width = __esm({
|
|
|
2864
1832
|
});
|
|
2865
1833
|
|
|
2866
1834
|
// ../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js
|
|
2867
|
-
function
|
|
1835
|
+
function assembleStyles2() {
|
|
2868
1836
|
const codes = /* @__PURE__ */ new Map();
|
|
2869
|
-
for (const [groupName, group] of Object.entries(
|
|
1837
|
+
for (const [groupName, group] of Object.entries(styles3)) {
|
|
2870
1838
|
for (const [styleName, style] of Object.entries(group)) {
|
|
2871
|
-
|
|
1839
|
+
styles3[styleName] = {
|
|
2872
1840
|
open: `\x1B[${style[0]}m`,
|
|
2873
1841
|
close: `\x1B[${style[1]}m`
|
|
2874
1842
|
};
|
|
2875
|
-
group[styleName] =
|
|
1843
|
+
group[styleName] = styles3[styleName];
|
|
2876
1844
|
codes.set(style[0], style[1]);
|
|
2877
1845
|
}
|
|
2878
|
-
Object.defineProperty(
|
|
1846
|
+
Object.defineProperty(styles3, groupName, {
|
|
2879
1847
|
value: group,
|
|
2880
1848
|
enumerable: false
|
|
2881
1849
|
});
|
|
2882
1850
|
}
|
|
2883
|
-
Object.defineProperty(
|
|
1851
|
+
Object.defineProperty(styles3, "codes", {
|
|
2884
1852
|
value: codes,
|
|
2885
1853
|
enumerable: false
|
|
2886
1854
|
});
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
Object.defineProperties(
|
|
1855
|
+
styles3.color.close = "\x1B[39m";
|
|
1856
|
+
styles3.bgColor.close = "\x1B[49m";
|
|
1857
|
+
styles3.color.ansi = wrapAnsi162();
|
|
1858
|
+
styles3.color.ansi256 = wrapAnsi2562();
|
|
1859
|
+
styles3.color.ansi16m = wrapAnsi16m2();
|
|
1860
|
+
styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
|
|
1861
|
+
styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
|
|
1862
|
+
styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
|
|
1863
|
+
Object.defineProperties(styles3, {
|
|
2896
1864
|
rgbToAnsi256: {
|
|
2897
1865
|
value: (red2, green2, blue2) => {
|
|
2898
1866
|
if (red2 === green2 && green2 === blue2) {
|
|
@@ -2930,7 +1898,7 @@ function assembleStyles() {
|
|
|
2930
1898
|
enumerable: false
|
|
2931
1899
|
},
|
|
2932
1900
|
hexToAnsi256: {
|
|
2933
|
-
value: (hex) =>
|
|
1901
|
+
value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)),
|
|
2934
1902
|
enumerable: false
|
|
2935
1903
|
},
|
|
2936
1904
|
ansi256ToAnsi: {
|
|
@@ -2968,24 +1936,24 @@ function assembleStyles() {
|
|
|
2968
1936
|
enumerable: false
|
|
2969
1937
|
},
|
|
2970
1938
|
rgbToAnsi: {
|
|
2971
|
-
value: (red2, green2, blue2) =>
|
|
1939
|
+
value: (red2, green2, blue2) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red2, green2, blue2)),
|
|
2972
1940
|
enumerable: false
|
|
2973
1941
|
},
|
|
2974
1942
|
hexToAnsi: {
|
|
2975
|
-
value: (hex) =>
|
|
1943
|
+
value: (hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)),
|
|
2976
1944
|
enumerable: false
|
|
2977
1945
|
}
|
|
2978
1946
|
});
|
|
2979
|
-
return
|
|
1947
|
+
return styles3;
|
|
2980
1948
|
}
|
|
2981
|
-
var
|
|
2982
|
-
var
|
|
1949
|
+
var ANSI_BACKGROUND_OFFSET2, wrapAnsi162, wrapAnsi2562, wrapAnsi16m2, styles3, modifierNames2, foregroundColorNames2, backgroundColorNames2, colorNames2, ansiStyles2, ansi_styles_default2;
|
|
1950
|
+
var init_ansi_styles2 = __esm({
|
|
2983
1951
|
"../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js"() {
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
1952
|
+
ANSI_BACKGROUND_OFFSET2 = 10;
|
|
1953
|
+
wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
1954
|
+
wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
1955
|
+
wrapAnsi16m2 = (offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`;
|
|
1956
|
+
styles3 = {
|
|
2989
1957
|
modifier: {
|
|
2990
1958
|
reset: [0, 0],
|
|
2991
1959
|
// 21 isn't widely supported and 22 does the same thing
|
|
@@ -3045,12 +2013,12 @@ var init_ansi_styles = __esm({
|
|
|
3045
2013
|
bgWhiteBright: [107, 49]
|
|
3046
2014
|
}
|
|
3047
2015
|
};
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
2016
|
+
modifierNames2 = Object.keys(styles3.modifier);
|
|
2017
|
+
foregroundColorNames2 = Object.keys(styles3.color);
|
|
2018
|
+
backgroundColorNames2 = Object.keys(styles3.bgColor);
|
|
2019
|
+
colorNames2 = [...foregroundColorNames2, ...backgroundColorNames2];
|
|
2020
|
+
ansiStyles2 = assembleStyles2();
|
|
2021
|
+
ansi_styles_default2 = ansiStyles2;
|
|
3054
2022
|
}
|
|
3055
2023
|
});
|
|
3056
2024
|
|
|
@@ -3063,7 +2031,7 @@ var init_wrap_ansi = __esm({
|
|
|
3063
2031
|
"../../node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js"() {
|
|
3064
2032
|
init_string_width();
|
|
3065
2033
|
init_strip_ansi();
|
|
3066
|
-
|
|
2034
|
+
init_ansi_styles2();
|
|
3067
2035
|
ESCAPES = /* @__PURE__ */ new Set([
|
|
3068
2036
|
"\x1B",
|
|
3069
2037
|
"\x9B"
|
|
@@ -3191,7 +2159,7 @@ var init_wrap_ansi = __esm({
|
|
|
3191
2159
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
3192
2160
|
}
|
|
3193
2161
|
}
|
|
3194
|
-
const code =
|
|
2162
|
+
const code = ansi_styles_default2.codes.get(Number(escapeCode));
|
|
3195
2163
|
if (pre[index + 1] === "\n") {
|
|
3196
2164
|
if (escapeUrl) {
|
|
3197
2165
|
returnValue += wrapAnsiHyperlink("");
|
|
@@ -3288,7 +2256,7 @@ var astralRegex, ESCAPES2, wrapAnsi2, checkAnsi;
|
|
|
3288
2256
|
var init_slice_ansi = __esm({
|
|
3289
2257
|
"../../node_modules/.pnpm/slice-ansi@5.0.0/node_modules/slice-ansi/index.js"() {
|
|
3290
2258
|
init_is_fullwidth_code_point();
|
|
3291
|
-
|
|
2259
|
+
init_ansi_styles2();
|
|
3292
2260
|
astralRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/;
|
|
3293
2261
|
ESCAPES2 = [
|
|
3294
2262
|
"\x1B",
|
|
@@ -3303,7 +2271,7 @@ var init_slice_ansi = __esm({
|
|
|
3303
2271
|
if (ansiCode.includes(";")) {
|
|
3304
2272
|
ansiCode = ansiCode.split(";")[0][0] + "0";
|
|
3305
2273
|
}
|
|
3306
|
-
const item =
|
|
2274
|
+
const item = ansi_styles_default2.codes.get(Number.parseInt(ansiCode, 10));
|
|
3307
2275
|
if (item) {
|
|
3308
2276
|
const indexEscape = ansiCodes.indexOf(item.toString());
|
|
3309
2277
|
if (indexEscape === -1) {
|
|
@@ -3321,7 +2289,7 @@ var init_slice_ansi = __esm({
|
|
|
3321
2289
|
if (isEscapes) {
|
|
3322
2290
|
output = output.filter((element, index) => output.indexOf(element) === index);
|
|
3323
2291
|
if (endAnsiCode !== void 0) {
|
|
3324
|
-
const fistEscapeCode = wrapAnsi2(
|
|
2292
|
+
const fistEscapeCode = wrapAnsi2(ansi_styles_default2.codes.get(Number.parseInt(endAnsiCode, 10)));
|
|
3325
2293
|
output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);
|
|
3326
2294
|
}
|
|
3327
2295
|
}
|
|
@@ -3371,10 +2339,10 @@ function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
|
3371
2339
|
};
|
|
3372
2340
|
return render;
|
|
3373
2341
|
}
|
|
3374
|
-
var
|
|
2342
|
+
var import_node_process5, defaultTerminalHeight, getWidth, fitToTerminalHeight, logUpdate, logUpdateStderr;
|
|
3375
2343
|
var init_log_update = __esm({
|
|
3376
2344
|
"../../node_modules/.pnpm/log-update@5.0.1/node_modules/log-update/index.js"() {
|
|
3377
|
-
|
|
2345
|
+
import_node_process5 = __toESM(require("node:process"), 1);
|
|
3378
2346
|
init_ansi_escapes();
|
|
3379
2347
|
init_cli_cursor();
|
|
3380
2348
|
init_wrap_ansi();
|
|
@@ -3400,8 +2368,8 @@ var init_log_update = __esm({
|
|
|
3400
2368
|
stripAnsi2(lines.slice(0, toRemove).join("\n")).length + 1
|
|
3401
2369
|
);
|
|
3402
2370
|
};
|
|
3403
|
-
logUpdate = createLogUpdate(
|
|
3404
|
-
logUpdateStderr = createLogUpdate(
|
|
2371
|
+
logUpdate = createLogUpdate(import_node_process5.default.stdout);
|
|
2372
|
+
logUpdateStderr = createLogUpdate(import_node_process5.default.stderr);
|
|
3405
2373
|
}
|
|
3406
2374
|
});
|
|
3407
2375
|
|
|
@@ -3902,7 +2870,7 @@ var init_args = __esm({
|
|
|
3902
2870
|
var version;
|
|
3903
2871
|
var init_package = __esm({
|
|
3904
2872
|
"package.json"() {
|
|
3905
|
-
version = "0.0.0-
|
|
2873
|
+
version = "0.0.0-9f021731";
|
|
3906
2874
|
}
|
|
3907
2875
|
});
|
|
3908
2876
|
|
|
@@ -6585,7 +5553,7 @@ var require_resolveCommand = __commonJS({
|
|
|
6585
5553
|
var which = require_which();
|
|
6586
5554
|
var getPathKey = require_path_key();
|
|
6587
5555
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
6588
|
-
const
|
|
5556
|
+
const env3 = parsed.options.env || process.env;
|
|
6589
5557
|
const cwd = process.cwd();
|
|
6590
5558
|
const hasCustomCwd = parsed.options.cwd != null;
|
|
6591
5559
|
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
@@ -6598,7 +5566,7 @@ var require_resolveCommand = __commonJS({
|
|
|
6598
5566
|
let resolved;
|
|
6599
5567
|
try {
|
|
6600
5568
|
resolved = which.sync(parsed.command, {
|
|
6601
|
-
path:
|
|
5569
|
+
path: env3[getPathKey({ env: env3 })],
|
|
6602
5570
|
pathExt: withoutPathExt ? path4.delimiter : void 0
|
|
6603
5571
|
});
|
|
6604
5572
|
} catch (e) {
|
|
@@ -7342,8 +6310,8 @@ var require_lodash = __commonJS({
|
|
|
7342
6310
|
return false;
|
|
7343
6311
|
}
|
|
7344
6312
|
function isPrototype(value) {
|
|
7345
|
-
var Ctor = value && value.constructor,
|
|
7346
|
-
return value ===
|
|
6313
|
+
var Ctor = value && value.constructor, proto2 = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
6314
|
+
return value === proto2;
|
|
7347
6315
|
}
|
|
7348
6316
|
function nativeKeysIn(object) {
|
|
7349
6317
|
var result = [];
|
|
@@ -24358,14 +23326,14 @@ var require_is_docker = __commonJS({
|
|
|
24358
23326
|
var require_is_wsl = __commonJS({
|
|
24359
23327
|
"../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports2, module2) {
|
|
24360
23328
|
"use strict";
|
|
24361
|
-
var
|
|
23329
|
+
var os2 = require("os");
|
|
24362
23330
|
var fs2 = require("fs");
|
|
24363
23331
|
var isDocker = require_is_docker();
|
|
24364
23332
|
var isWsl = () => {
|
|
24365
23333
|
if (process.platform !== "linux") {
|
|
24366
23334
|
return false;
|
|
24367
23335
|
}
|
|
24368
|
-
if (
|
|
23336
|
+
if (os2.release().toLowerCase().includes("microsoft")) {
|
|
24369
23337
|
if (isDocker()) {
|
|
24370
23338
|
return false;
|
|
24371
23339
|
}
|
|
@@ -24685,13 +23653,14 @@ var init_cli2 = __esm({
|
|
|
24685
23653
|
};
|
|
24686
23654
|
C3_DEFAULTS = {
|
|
24687
23655
|
projectName: new import_haikunator.default().haikunate({ tokenHex: true }),
|
|
23656
|
+
category: "hello-world",
|
|
24688
23657
|
type: "hello-world",
|
|
24689
23658
|
framework: "analog",
|
|
24690
23659
|
autoUpdate: true,
|
|
24691
23660
|
deploy: true,
|
|
24692
23661
|
git: true,
|
|
24693
23662
|
open: true,
|
|
24694
|
-
|
|
23663
|
+
lang: "ts",
|
|
24695
23664
|
template: "cloudflare/workers-sdk/packages/create-cloudflare/templates/hello-world"
|
|
24696
23665
|
};
|
|
24697
23666
|
WRANGLER_DEFAULTS = {
|
|
@@ -24716,18 +23685,18 @@ var init_package2 = __esm({
|
|
|
24716
23685
|
dependencies: {
|
|
24717
23686
|
"create-astro": "4.8.0",
|
|
24718
23687
|
"create-analog": "1.3.1",
|
|
24719
|
-
"@angular/create": "
|
|
24720
|
-
"create-docusaurus": "3.
|
|
24721
|
-
"create-hono": "0.
|
|
24722
|
-
"create-next-app": "14.
|
|
24723
|
-
"create-qwik": "1.5.
|
|
23688
|
+
"@angular/create": "18.1.2",
|
|
23689
|
+
"create-docusaurus": "3.4.0",
|
|
23690
|
+
"create-hono": "0.10.1",
|
|
23691
|
+
"create-next-app": "14.2.5",
|
|
23692
|
+
"create-qwik": "1.5.7",
|
|
24724
23693
|
"create-react-app": "5.0.1",
|
|
24725
|
-
"create-remix": "2.
|
|
24726
|
-
"create-solid": "0.5.
|
|
24727
|
-
"create-svelte": "6.
|
|
24728
|
-
"create-vue": "3.10.
|
|
24729
|
-
gatsby: "5.13.
|
|
24730
|
-
nuxi: "3.
|
|
23694
|
+
"create-remix": "2.10.3",
|
|
23695
|
+
"create-solid": "0.5.12",
|
|
23696
|
+
"create-svelte": "6.3.4",
|
|
23697
|
+
"create-vue": "3.10.4",
|
|
23698
|
+
gatsby: "5.13.7",
|
|
23699
|
+
nuxi: "3.12.0"
|
|
24731
23700
|
},
|
|
24732
23701
|
frameworkCliMap: {
|
|
24733
23702
|
analog: "create-analog",
|
|
@@ -24772,7 +23741,7 @@ var init_frameworks = __esm({
|
|
|
24772
23741
|
const cli = getFrameworkCli(ctx, true);
|
|
24773
23742
|
const { npm: npm14, dlx } = detectPackageManager();
|
|
24774
23743
|
const cmd = [...npm14 === "yarn" ? ["npx"] : dlx, cli, ...args];
|
|
24775
|
-
const
|
|
23744
|
+
const env3 = npm14 === "yarn" ? { npm_config_user_agent: "yarn" } : {};
|
|
24776
23745
|
if (ctx.args.additionalArgs?.length) {
|
|
24777
23746
|
cmd.push(...ctx.args.additionalArgs);
|
|
24778
23747
|
}
|
|
@@ -24782,7 +23751,7 @@ var init_frameworks = __esm({
|
|
|
24782
23751
|
)}`
|
|
24783
23752
|
);
|
|
24784
23753
|
logRaw("");
|
|
24785
|
-
await runCommand(cmd, { env:
|
|
23754
|
+
await runCommand(cmd, { env: env3 });
|
|
24786
23755
|
if (process.env.SAVE_DIFFS) {
|
|
24787
23756
|
const cmdEnv = {
|
|
24788
23757
|
silent: true,
|
|
@@ -24803,7 +23772,7 @@ var init_frameworks = __esm({
|
|
|
24803
23772
|
var version2;
|
|
24804
23773
|
var init_package3 = __esm({
|
|
24805
23774
|
"../wrangler/package.json"() {
|
|
24806
|
-
version2 = "0.0.0-
|
|
23775
|
+
version2 = "0.0.0-9f021731";
|
|
24807
23776
|
}
|
|
24808
23777
|
});
|
|
24809
23778
|
|
|
@@ -24916,16 +23885,6 @@ var init_git = __esm({
|
|
|
24916
23885
|
ctx.args.git = false;
|
|
24917
23886
|
return;
|
|
24918
23887
|
}
|
|
24919
|
-
const gitConfigured = await isGitConfigured();
|
|
24920
|
-
if (!gitConfigured) {
|
|
24921
|
-
if (ctx.args.git) {
|
|
24922
|
-
updateStatus(
|
|
24923
|
-
"Must configure `user.name` and user.email` to use git. Continuing without git."
|
|
24924
|
-
);
|
|
24925
|
-
}
|
|
24926
|
-
ctx.args.git = false;
|
|
24927
|
-
return;
|
|
24928
|
-
}
|
|
24929
23888
|
const insideGitRepo = await isInsideGitRepo(ctx.project.path);
|
|
24930
23889
|
if (insideGitRepo) {
|
|
24931
23890
|
ctx.args.git = true;
|
|
@@ -24937,9 +23896,18 @@ var init_git = __esm({
|
|
|
24937
23896
|
label: "git",
|
|
24938
23897
|
defaultValue: C3_DEFAULTS.git
|
|
24939
23898
|
});
|
|
24940
|
-
if (ctx.args.git) {
|
|
24941
|
-
|
|
23899
|
+
if (!ctx.args.git) {
|
|
23900
|
+
return;
|
|
23901
|
+
}
|
|
23902
|
+
const gitConfigured = await isGitConfigured();
|
|
23903
|
+
if (!gitConfigured) {
|
|
23904
|
+
updateStatus(
|
|
23905
|
+
"Must configure `user.name` and user.email` to use git. Continuing without git."
|
|
23906
|
+
);
|
|
23907
|
+
ctx.args.git = false;
|
|
23908
|
+
return;
|
|
24942
23909
|
}
|
|
23910
|
+
await initializeGit(ctx.project.path);
|
|
24943
23911
|
};
|
|
24944
23912
|
gitCommit = async (ctx) => {
|
|
24945
23913
|
const commitMessage = await createCommitMessage(ctx);
|
|
@@ -28748,8 +27716,8 @@ var require_index_688c5d50 = __commonJS({
|
|
|
28748
27716
|
var realZlib = require("zlib");
|
|
28749
27717
|
var util$1 = require("util");
|
|
28750
27718
|
var crypto = require("crypto");
|
|
28751
|
-
var
|
|
28752
|
-
var
|
|
27719
|
+
var os2 = require("os");
|
|
27720
|
+
var tty2 = require("tty");
|
|
28753
27721
|
var constants$1 = require("constants");
|
|
28754
27722
|
var https = require("https");
|
|
28755
27723
|
var child_process = require("child_process");
|
|
@@ -28769,8 +27737,8 @@ var require_index_688c5d50 = __commonJS({
|
|
|
28769
27737
|
var realZlib__default = /* @__PURE__ */ _interopDefaultLegacy(realZlib);
|
|
28770
27738
|
var util__default = /* @__PURE__ */ _interopDefaultLegacy(util$1);
|
|
28771
27739
|
var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto);
|
|
28772
|
-
var os__default = /* @__PURE__ */ _interopDefaultLegacy(
|
|
28773
|
-
var tty__default = /* @__PURE__ */ _interopDefaultLegacy(
|
|
27740
|
+
var os__default = /* @__PURE__ */ _interopDefaultLegacy(os2);
|
|
27741
|
+
var tty__default = /* @__PURE__ */ _interopDefaultLegacy(tty2);
|
|
28774
27742
|
var constants__default = /* @__PURE__ */ _interopDefaultLegacy(constants$1);
|
|
28775
27743
|
var https__default = /* @__PURE__ */ _interopDefaultLegacy(https);
|
|
28776
27744
|
var child_process__default = /* @__PURE__ */ _interopDefaultLegacy(child_process);
|
|
@@ -34342,16 +33310,16 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34342
33310
|
});
|
|
34343
33311
|
});
|
|
34344
33312
|
var colorConvert = convert;
|
|
34345
|
-
var
|
|
34346
|
-
const
|
|
33313
|
+
var ansiStyles3 = createCommonjsModule(function(module3) {
|
|
33314
|
+
const wrapAnsi163 = (fn, offset) => (...args) => {
|
|
34347
33315
|
const code = fn(...args);
|
|
34348
33316
|
return `\x1B[${code + offset}m`;
|
|
34349
33317
|
};
|
|
34350
|
-
const
|
|
33318
|
+
const wrapAnsi2563 = (fn, offset) => (...args) => {
|
|
34351
33319
|
const code = fn(...args);
|
|
34352
33320
|
return `\x1B[${38 + offset};5;${code}m`;
|
|
34353
33321
|
};
|
|
34354
|
-
const
|
|
33322
|
+
const wrapAnsi16m3 = (fn, offset) => (...args) => {
|
|
34355
33323
|
const rgb = fn(...args);
|
|
34356
33324
|
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
34357
33325
|
};
|
|
@@ -34378,20 +33346,20 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34378
33346
|
colorConvert$1 = colorConvert;
|
|
34379
33347
|
}
|
|
34380
33348
|
const offset = isBackground ? 10 : 0;
|
|
34381
|
-
const
|
|
33349
|
+
const styles5 = {};
|
|
34382
33350
|
for (const [sourceSpace, suite] of Object.entries(colorConvert$1)) {
|
|
34383
33351
|
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
34384
33352
|
if (sourceSpace === targetSpace) {
|
|
34385
|
-
|
|
33353
|
+
styles5[name] = wrap2(identity, offset);
|
|
34386
33354
|
} else if (typeof suite === "object") {
|
|
34387
|
-
|
|
33355
|
+
styles5[name] = wrap2(suite[targetSpace], offset);
|
|
34388
33356
|
}
|
|
34389
33357
|
}
|
|
34390
|
-
return
|
|
33358
|
+
return styles5;
|
|
34391
33359
|
};
|
|
34392
|
-
function
|
|
33360
|
+
function assembleStyles3() {
|
|
34393
33361
|
const codes = /* @__PURE__ */ new Map();
|
|
34394
|
-
const
|
|
33362
|
+
const styles5 = {
|
|
34395
33363
|
modifier: {
|
|
34396
33364
|
reset: [0, 0],
|
|
34397
33365
|
// 21 isn't widely supported and 22 does the same thing
|
|
@@ -34442,66 +33410,66 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34442
33410
|
bgWhiteBright: [107, 49]
|
|
34443
33411
|
}
|
|
34444
33412
|
};
|
|
34445
|
-
|
|
34446
|
-
|
|
34447
|
-
|
|
34448
|
-
|
|
34449
|
-
for (const [groupName, group] of Object.entries(
|
|
33413
|
+
styles5.color.gray = styles5.color.blackBright;
|
|
33414
|
+
styles5.bgColor.bgGray = styles5.bgColor.bgBlackBright;
|
|
33415
|
+
styles5.color.grey = styles5.color.blackBright;
|
|
33416
|
+
styles5.bgColor.bgGrey = styles5.bgColor.bgBlackBright;
|
|
33417
|
+
for (const [groupName, group] of Object.entries(styles5)) {
|
|
34450
33418
|
for (const [styleName, style] of Object.entries(group)) {
|
|
34451
|
-
|
|
33419
|
+
styles5[styleName] = {
|
|
34452
33420
|
open: `\x1B[${style[0]}m`,
|
|
34453
33421
|
close: `\x1B[${style[1]}m`
|
|
34454
33422
|
};
|
|
34455
|
-
group[styleName] =
|
|
33423
|
+
group[styleName] = styles5[styleName];
|
|
34456
33424
|
codes.set(style[0], style[1]);
|
|
34457
33425
|
}
|
|
34458
|
-
Object.defineProperty(
|
|
33426
|
+
Object.defineProperty(styles5, groupName, {
|
|
34459
33427
|
value: group,
|
|
34460
33428
|
enumerable: false
|
|
34461
33429
|
});
|
|
34462
33430
|
}
|
|
34463
|
-
Object.defineProperty(
|
|
33431
|
+
Object.defineProperty(styles5, "codes", {
|
|
34464
33432
|
value: codes,
|
|
34465
33433
|
enumerable: false
|
|
34466
33434
|
});
|
|
34467
|
-
|
|
34468
|
-
|
|
34469
|
-
setLazyProperty(
|
|
34470
|
-
setLazyProperty(
|
|
34471
|
-
setLazyProperty(
|
|
34472
|
-
setLazyProperty(
|
|
34473
|
-
setLazyProperty(
|
|
34474
|
-
setLazyProperty(
|
|
34475
|
-
return
|
|
33435
|
+
styles5.color.close = "\x1B[39m";
|
|
33436
|
+
styles5.bgColor.close = "\x1B[49m";
|
|
33437
|
+
setLazyProperty(styles5.color, "ansi", () => makeDynamicStyles(wrapAnsi163, "ansi16", ansi2ansi, false));
|
|
33438
|
+
setLazyProperty(styles5.color, "ansi256", () => makeDynamicStyles(wrapAnsi2563, "ansi256", ansi2ansi, false));
|
|
33439
|
+
setLazyProperty(styles5.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m3, "rgb", rgb2rgb, false));
|
|
33440
|
+
setLazyProperty(styles5.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi163, "ansi16", ansi2ansi, true));
|
|
33441
|
+
setLazyProperty(styles5.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi2563, "ansi256", ansi2ansi, true));
|
|
33442
|
+
setLazyProperty(styles5.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m3, "rgb", rgb2rgb, true));
|
|
33443
|
+
return styles5;
|
|
34476
33444
|
}
|
|
34477
33445
|
Object.defineProperty(module3, "exports", {
|
|
34478
33446
|
enumerable: true,
|
|
34479
|
-
get:
|
|
33447
|
+
get: assembleStyles3
|
|
34480
33448
|
});
|
|
34481
33449
|
});
|
|
34482
|
-
var
|
|
33450
|
+
var hasFlag2 = (flag, argv = process.argv) => {
|
|
34483
33451
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
34484
33452
|
const position = argv.indexOf(prefix + flag);
|
|
34485
33453
|
const terminatorPosition = argv.indexOf("--");
|
|
34486
33454
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
34487
33455
|
};
|
|
34488
|
-
var { env:
|
|
33456
|
+
var { env: env3 } = process;
|
|
34489
33457
|
var forceColor;
|
|
34490
|
-
if (
|
|
33458
|
+
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
|
34491
33459
|
forceColor = 0;
|
|
34492
|
-
} else if (
|
|
33460
|
+
} else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
|
|
34493
33461
|
forceColor = 1;
|
|
34494
33462
|
}
|
|
34495
|
-
if ("FORCE_COLOR" in
|
|
34496
|
-
if (
|
|
33463
|
+
if ("FORCE_COLOR" in env3) {
|
|
33464
|
+
if (env3.FORCE_COLOR === "true") {
|
|
34497
33465
|
forceColor = 1;
|
|
34498
|
-
} else if (
|
|
33466
|
+
} else if (env3.FORCE_COLOR === "false") {
|
|
34499
33467
|
forceColor = 0;
|
|
34500
33468
|
} else {
|
|
34501
|
-
forceColor =
|
|
33469
|
+
forceColor = env3.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env3.FORCE_COLOR, 10), 3);
|
|
34502
33470
|
}
|
|
34503
33471
|
}
|
|
34504
|
-
function
|
|
33472
|
+
function translateLevel2(level) {
|
|
34505
33473
|
if (level === 0) {
|
|
34506
33474
|
return false;
|
|
34507
33475
|
}
|
|
@@ -34512,21 +33480,21 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34512
33480
|
has16m: level >= 3
|
|
34513
33481
|
};
|
|
34514
33482
|
}
|
|
34515
|
-
function
|
|
33483
|
+
function supportsColor2(haveStream, streamIsTTY) {
|
|
34516
33484
|
if (forceColor === 0) {
|
|
34517
33485
|
return 0;
|
|
34518
33486
|
}
|
|
34519
|
-
if (
|
|
33487
|
+
if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
|
|
34520
33488
|
return 3;
|
|
34521
33489
|
}
|
|
34522
|
-
if (
|
|
33490
|
+
if (hasFlag2("color=256")) {
|
|
34523
33491
|
return 2;
|
|
34524
33492
|
}
|
|
34525
33493
|
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
34526
33494
|
return 0;
|
|
34527
33495
|
}
|
|
34528
33496
|
const min = forceColor || 0;
|
|
34529
|
-
if (
|
|
33497
|
+
if (env3.TERM === "dumb") {
|
|
34530
33498
|
return min;
|
|
34531
33499
|
}
|
|
34532
33500
|
if (process.platform === "win32") {
|
|
@@ -34536,46 +33504,46 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34536
33504
|
}
|
|
34537
33505
|
return 1;
|
|
34538
33506
|
}
|
|
34539
|
-
if ("CI" in
|
|
34540
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in
|
|
33507
|
+
if ("CI" in env3) {
|
|
33508
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env3) || env3.CI_NAME === "codeship") {
|
|
34541
33509
|
return 1;
|
|
34542
33510
|
}
|
|
34543
33511
|
return min;
|
|
34544
33512
|
}
|
|
34545
|
-
if ("TEAMCITY_VERSION" in
|
|
34546
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(
|
|
33513
|
+
if ("TEAMCITY_VERSION" in env3) {
|
|
33514
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0;
|
|
34547
33515
|
}
|
|
34548
|
-
if (
|
|
33516
|
+
if (env3.COLORTERM === "truecolor") {
|
|
34549
33517
|
return 3;
|
|
34550
33518
|
}
|
|
34551
|
-
if ("TERM_PROGRAM" in
|
|
34552
|
-
const version4 = parseInt((
|
|
34553
|
-
switch (
|
|
33519
|
+
if ("TERM_PROGRAM" in env3) {
|
|
33520
|
+
const version4 = parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
33521
|
+
switch (env3.TERM_PROGRAM) {
|
|
34554
33522
|
case "iTerm.app":
|
|
34555
33523
|
return version4 >= 3 ? 3 : 2;
|
|
34556
33524
|
case "Apple_Terminal":
|
|
34557
33525
|
return 2;
|
|
34558
33526
|
}
|
|
34559
33527
|
}
|
|
34560
|
-
if (/-256(color)?$/i.test(
|
|
33528
|
+
if (/-256(color)?$/i.test(env3.TERM)) {
|
|
34561
33529
|
return 2;
|
|
34562
33530
|
}
|
|
34563
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(
|
|
33531
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) {
|
|
34564
33532
|
return 1;
|
|
34565
33533
|
}
|
|
34566
|
-
if ("COLORTERM" in
|
|
33534
|
+
if ("COLORTERM" in env3) {
|
|
34567
33535
|
return 1;
|
|
34568
33536
|
}
|
|
34569
33537
|
return min;
|
|
34570
33538
|
}
|
|
34571
33539
|
function getSupportLevel(stream) {
|
|
34572
|
-
const level =
|
|
34573
|
-
return
|
|
33540
|
+
const level = supportsColor2(stream, stream && stream.isTTY);
|
|
33541
|
+
return translateLevel2(level);
|
|
34574
33542
|
}
|
|
34575
33543
|
var supportsColor_1 = {
|
|
34576
33544
|
supportsColor: getSupportLevel,
|
|
34577
|
-
stdout:
|
|
34578
|
-
stderr:
|
|
33545
|
+
stdout: translateLevel2(supportsColor2(true, tty__default["default"].isatty(1))),
|
|
33546
|
+
stderr: translateLevel2(supportsColor2(true, tty__default["default"].isatty(2)))
|
|
34579
33547
|
};
|
|
34580
33548
|
var stringReplaceAll$1 = (string, substring, replacer) => {
|
|
34581
33549
|
let index = string.indexOf(substring);
|
|
@@ -34667,27 +33635,27 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34667
33635
|
}
|
|
34668
33636
|
return results;
|
|
34669
33637
|
}
|
|
34670
|
-
function buildStyle(chalk3,
|
|
33638
|
+
function buildStyle(chalk3, styles5) {
|
|
34671
33639
|
const enabled = {};
|
|
34672
|
-
for (const layer of
|
|
33640
|
+
for (const layer of styles5) {
|
|
34673
33641
|
for (const style of layer.styles) {
|
|
34674
33642
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
34675
33643
|
}
|
|
34676
33644
|
}
|
|
34677
33645
|
let current = chalk3;
|
|
34678
|
-
for (const [styleName,
|
|
34679
|
-
if (!Array.isArray(
|
|
33646
|
+
for (const [styleName, styles6] of Object.entries(enabled)) {
|
|
33647
|
+
if (!Array.isArray(styles6)) {
|
|
34680
33648
|
continue;
|
|
34681
33649
|
}
|
|
34682
33650
|
if (!(styleName in current)) {
|
|
34683
33651
|
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
34684
33652
|
}
|
|
34685
|
-
current =
|
|
33653
|
+
current = styles6.length > 0 ? current[styleName](...styles6) : current[styleName];
|
|
34686
33654
|
}
|
|
34687
33655
|
return current;
|
|
34688
33656
|
}
|
|
34689
33657
|
var templates = (chalk3, temporary) => {
|
|
34690
|
-
const
|
|
33658
|
+
const styles5 = [];
|
|
34691
33659
|
const chunks = [];
|
|
34692
33660
|
let chunk = [];
|
|
34693
33661
|
temporary.replace(TEMPLATE_REGEX2, (m3, escapeCharacter, inverse, style, close, character) => {
|
|
@@ -34696,54 +33664,54 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34696
33664
|
} else if (style) {
|
|
34697
33665
|
const string = chunk.join("");
|
|
34698
33666
|
chunk = [];
|
|
34699
|
-
chunks.push(
|
|
34700
|
-
|
|
33667
|
+
chunks.push(styles5.length === 0 ? string : buildStyle(chalk3, styles5)(string));
|
|
33668
|
+
styles5.push({ inverse, styles: parseStyle(style) });
|
|
34701
33669
|
} else if (close) {
|
|
34702
|
-
if (
|
|
33670
|
+
if (styles5.length === 0) {
|
|
34703
33671
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
34704
33672
|
}
|
|
34705
|
-
chunks.push(buildStyle(chalk3,
|
|
33673
|
+
chunks.push(buildStyle(chalk3, styles5)(chunk.join("")));
|
|
34706
33674
|
chunk = [];
|
|
34707
|
-
|
|
33675
|
+
styles5.pop();
|
|
34708
33676
|
} else {
|
|
34709
33677
|
chunk.push(character);
|
|
34710
33678
|
}
|
|
34711
33679
|
});
|
|
34712
33680
|
chunks.push(chunk.join(""));
|
|
34713
|
-
if (
|
|
34714
|
-
const errMessage = `Chalk template literal is missing ${
|
|
33681
|
+
if (styles5.length > 0) {
|
|
33682
|
+
const errMessage = `Chalk template literal is missing ${styles5.length} closing bracket${styles5.length === 1 ? "" : "s"} (\`}\`)`;
|
|
34715
33683
|
throw new Error(errMessage);
|
|
34716
33684
|
}
|
|
34717
33685
|
return chunks.join("");
|
|
34718
33686
|
};
|
|
34719
|
-
var { stdout:
|
|
33687
|
+
var { stdout: stdoutColor2, stderr: stderrColor2 } = supportsColor_1;
|
|
34720
33688
|
var {
|
|
34721
|
-
stringReplaceAll,
|
|
34722
|
-
stringEncaseCRLFWithFirstIndex
|
|
33689
|
+
stringReplaceAll: stringReplaceAll2,
|
|
33690
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex2
|
|
34723
33691
|
} = util;
|
|
34724
33692
|
var { isArray: isArray$1 } = Array;
|
|
34725
|
-
var
|
|
33693
|
+
var levelMapping2 = [
|
|
34726
33694
|
"ansi",
|
|
34727
33695
|
"ansi",
|
|
34728
33696
|
"ansi256",
|
|
34729
33697
|
"ansi16m"
|
|
34730
33698
|
];
|
|
34731
|
-
var
|
|
34732
|
-
var
|
|
33699
|
+
var styles4 = /* @__PURE__ */ Object.create(null);
|
|
33700
|
+
var applyOptions2 = (object, options = {}) => {
|
|
34733
33701
|
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
34734
33702
|
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
34735
33703
|
}
|
|
34736
|
-
const colorLevel =
|
|
33704
|
+
const colorLevel = stdoutColor2 ? stdoutColor2.level : 0;
|
|
34737
33705
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
34738
33706
|
};
|
|
34739
33707
|
var ChalkClass = class {
|
|
34740
33708
|
constructor(options) {
|
|
34741
|
-
return
|
|
33709
|
+
return chalkFactory2(options);
|
|
34742
33710
|
}
|
|
34743
33711
|
};
|
|
34744
|
-
var
|
|
33712
|
+
var chalkFactory2 = (options) => {
|
|
34745
33713
|
const chalk3 = {};
|
|
34746
|
-
|
|
33714
|
+
applyOptions2(chalk3, options);
|
|
34747
33715
|
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
34748
33716
|
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
34749
33717
|
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
@@ -34754,51 +33722,51 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34754
33722
|
return chalk3.template;
|
|
34755
33723
|
};
|
|
34756
33724
|
function Chalk(options) {
|
|
34757
|
-
return
|
|
33725
|
+
return chalkFactory2(options);
|
|
34758
33726
|
}
|
|
34759
|
-
for (const [styleName, style] of Object.entries(
|
|
34760
|
-
|
|
33727
|
+
for (const [styleName, style] of Object.entries(ansiStyles3)) {
|
|
33728
|
+
styles4[styleName] = {
|
|
34761
33729
|
get() {
|
|
34762
|
-
const builder =
|
|
33730
|
+
const builder = createBuilder2(this, createStyler2(style.open, style.close, this._styler), this._isEmpty);
|
|
34763
33731
|
Object.defineProperty(this, styleName, { value: builder });
|
|
34764
33732
|
return builder;
|
|
34765
33733
|
}
|
|
34766
33734
|
};
|
|
34767
33735
|
}
|
|
34768
|
-
|
|
33736
|
+
styles4.visible = {
|
|
34769
33737
|
get() {
|
|
34770
|
-
const builder =
|
|
33738
|
+
const builder = createBuilder2(this, this._styler, true);
|
|
34771
33739
|
Object.defineProperty(this, "visible", { value: builder });
|
|
34772
33740
|
return builder;
|
|
34773
33741
|
}
|
|
34774
33742
|
};
|
|
34775
|
-
var
|
|
34776
|
-
for (const model of
|
|
34777
|
-
|
|
33743
|
+
var usedModels2 = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
33744
|
+
for (const model of usedModels2) {
|
|
33745
|
+
styles4[model] = {
|
|
34778
33746
|
get() {
|
|
34779
33747
|
const { level } = this;
|
|
34780
33748
|
return function(...arguments_) {
|
|
34781
|
-
const styler =
|
|
34782
|
-
return
|
|
33749
|
+
const styler = createStyler2(ansiStyles3.color[levelMapping2[level]][model](...arguments_), ansiStyles3.color.close, this._styler);
|
|
33750
|
+
return createBuilder2(this, styler, this._isEmpty);
|
|
34783
33751
|
};
|
|
34784
33752
|
}
|
|
34785
33753
|
};
|
|
34786
33754
|
}
|
|
34787
|
-
for (const model of
|
|
33755
|
+
for (const model of usedModels2) {
|
|
34788
33756
|
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
34789
|
-
|
|
33757
|
+
styles4[bgModel] = {
|
|
34790
33758
|
get() {
|
|
34791
33759
|
const { level } = this;
|
|
34792
33760
|
return function(...arguments_) {
|
|
34793
|
-
const styler =
|
|
34794
|
-
return
|
|
33761
|
+
const styler = createStyler2(ansiStyles3.bgColor[levelMapping2[level]][model](...arguments_), ansiStyles3.bgColor.close, this._styler);
|
|
33762
|
+
return createBuilder2(this, styler, this._isEmpty);
|
|
34795
33763
|
};
|
|
34796
33764
|
}
|
|
34797
33765
|
};
|
|
34798
33766
|
}
|
|
34799
|
-
var
|
|
33767
|
+
var proto2 = Object.defineProperties(() => {
|
|
34800
33768
|
}, {
|
|
34801
|
-
...
|
|
33769
|
+
...styles4,
|
|
34802
33770
|
level: {
|
|
34803
33771
|
enumerable: true,
|
|
34804
33772
|
get() {
|
|
@@ -34809,7 +33777,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34809
33777
|
}
|
|
34810
33778
|
}
|
|
34811
33779
|
});
|
|
34812
|
-
var
|
|
33780
|
+
var createStyler2 = (open2, close, parent) => {
|
|
34813
33781
|
let openAll;
|
|
34814
33782
|
let closeAll;
|
|
34815
33783
|
if (parent === void 0) {
|
|
@@ -34827,20 +33795,20 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34827
33795
|
parent
|
|
34828
33796
|
};
|
|
34829
33797
|
};
|
|
34830
|
-
var
|
|
33798
|
+
var createBuilder2 = (self2, _styler, _isEmpty) => {
|
|
34831
33799
|
const builder = (...arguments_) => {
|
|
34832
33800
|
if (isArray$1(arguments_[0]) && isArray$1(arguments_[0].raw)) {
|
|
34833
|
-
return
|
|
33801
|
+
return applyStyle2(builder, chalkTag(builder, ...arguments_));
|
|
34834
33802
|
}
|
|
34835
|
-
return
|
|
33803
|
+
return applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
34836
33804
|
};
|
|
34837
|
-
Object.setPrototypeOf(builder,
|
|
33805
|
+
Object.setPrototypeOf(builder, proto2);
|
|
34838
33806
|
builder._generator = self2;
|
|
34839
33807
|
builder._styler = _styler;
|
|
34840
33808
|
builder._isEmpty = _isEmpty;
|
|
34841
33809
|
return builder;
|
|
34842
33810
|
};
|
|
34843
|
-
var
|
|
33811
|
+
var applyStyle2 = (self2, string) => {
|
|
34844
33812
|
if (self2.level <= 0 || !string) {
|
|
34845
33813
|
return self2._isEmpty ? "" : string;
|
|
34846
33814
|
}
|
|
@@ -34851,13 +33819,13 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34851
33819
|
const { openAll, closeAll } = styler;
|
|
34852
33820
|
if (string.indexOf("\x1B") !== -1) {
|
|
34853
33821
|
while (styler !== void 0) {
|
|
34854
|
-
string =
|
|
33822
|
+
string = stringReplaceAll2(string, styler.close, styler.open);
|
|
34855
33823
|
styler = styler.parent;
|
|
34856
33824
|
}
|
|
34857
33825
|
}
|
|
34858
33826
|
const lfIndex = string.indexOf("\n");
|
|
34859
33827
|
if (lfIndex !== -1) {
|
|
34860
|
-
string =
|
|
33828
|
+
string = stringEncaseCRLFWithFirstIndex2(string, closeAll, openAll, lfIndex);
|
|
34861
33829
|
}
|
|
34862
33830
|
return openAll + string + closeAll;
|
|
34863
33831
|
};
|
|
@@ -34880,11 +33848,11 @@ var require_index_688c5d50 = __commonJS({
|
|
|
34880
33848
|
}
|
|
34881
33849
|
return template(chalk3, parts.join(""));
|
|
34882
33850
|
};
|
|
34883
|
-
Object.defineProperties(Chalk.prototype,
|
|
33851
|
+
Object.defineProperties(Chalk.prototype, styles4);
|
|
34884
33852
|
var chalk2 = Chalk();
|
|
34885
|
-
chalk2.supportsColor =
|
|
34886
|
-
chalk2.stderr = Chalk({ level:
|
|
34887
|
-
chalk2.stderr.supportsColor =
|
|
33853
|
+
chalk2.supportsColor = stdoutColor2;
|
|
33854
|
+
chalk2.stderr = Chalk({ level: stderrColor2 ? stderrColor2.level : 0 });
|
|
33855
|
+
chalk2.stderr.supportsColor = stderrColor2;
|
|
34888
33856
|
var source = chalk2;
|
|
34889
33857
|
var fs_1 = clone(fs__default["default"]);
|
|
34890
33858
|
function clone(obj) {
|
|
@@ -38277,7 +37245,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
38277
37245
|
var isPlural = msAbs >= n2 * 1.5;
|
|
38278
37246
|
return Math.round(ms2 / n2) + " " + name + (isPlural ? "s" : "");
|
|
38279
37247
|
}
|
|
38280
|
-
function setup(
|
|
37248
|
+
function setup(env4) {
|
|
38281
37249
|
createDebug.debug = createDebug;
|
|
38282
37250
|
createDebug.default = createDebug;
|
|
38283
37251
|
createDebug.coerce = coerce;
|
|
@@ -38286,8 +37254,8 @@ var require_index_688c5d50 = __commonJS({
|
|
|
38286
37254
|
createDebug.enabled = enabled;
|
|
38287
37255
|
createDebug.humanize = ms;
|
|
38288
37256
|
createDebug.destroy = destroy;
|
|
38289
|
-
Object.keys(
|
|
38290
|
-
createDebug[key] =
|
|
37257
|
+
Object.keys(env4).forEach((key) => {
|
|
37258
|
+
createDebug[key] = env4[key];
|
|
38291
37259
|
});
|
|
38292
37260
|
createDebug.names = [];
|
|
38293
37261
|
createDebug.skips = [];
|
|
@@ -38601,8 +37569,8 @@ var require_index_688c5d50 = __commonJS({
|
|
|
38601
37569
|
);
|
|
38602
37570
|
exports3.colors = [6, 2, 3, 4, 5, 1];
|
|
38603
37571
|
try {
|
|
38604
|
-
const
|
|
38605
|
-
if (
|
|
37572
|
+
const supportsColor3 = supportsColor_1;
|
|
37573
|
+
if (supportsColor3 && (supportsColor3.stderr || supportsColor3).level >= 2) {
|
|
38606
37574
|
exports3.colors = [
|
|
38607
37575
|
20,
|
|
38608
37576
|
21,
|
|
@@ -70808,7 +69776,7 @@ var require_typescript2 = __commonJS({
|
|
|
70808
69776
|
});
|
|
70809
69777
|
|
|
70810
69778
|
// src/helpers/codemod.ts
|
|
70811
|
-
var import_fs11, import_path12, recast, esprimaParser, typescriptParser, parseFile, transformFile, loadSnippets, loadTemplateSnippets;
|
|
69779
|
+
var import_fs11, import_path12, recast, esprimaParser, typescriptParser, parseFile, transformFile, loadSnippets, loadTemplateSnippets, mergeObjectProperties, getPropertyName;
|
|
70812
69780
|
var init_codemod = __esm({
|
|
70813
69781
|
"src/helpers/codemod.ts"() {
|
|
70814
69782
|
import_fs11 = require("fs");
|
|
@@ -70860,6 +69828,33 @@ var init_codemod = __esm({
|
|
|
70860
69828
|
loadTemplateSnippets = (ctx) => {
|
|
70861
69829
|
return loadSnippets(getTemplatePath(ctx));
|
|
70862
69830
|
};
|
|
69831
|
+
mergeObjectProperties = (sourceObject, newProperties) => {
|
|
69832
|
+
newProperties.forEach((newProp) => {
|
|
69833
|
+
const newPropName = getPropertyName(newProp);
|
|
69834
|
+
if (!newPropName) {
|
|
69835
|
+
return false;
|
|
69836
|
+
}
|
|
69837
|
+
const indexOfExisting = sourceObject.properties.findIndex(
|
|
69838
|
+
(p2) => p2.type === "ObjectProperty" && getPropertyName(p2) === newPropName
|
|
69839
|
+
);
|
|
69840
|
+
const existing = sourceObject.properties[indexOfExisting];
|
|
69841
|
+
if (!existing) {
|
|
69842
|
+
sourceObject.properties.push(newProp);
|
|
69843
|
+
return;
|
|
69844
|
+
}
|
|
69845
|
+
if (existing.type === "ObjectProperty" && existing.value.type === "ObjectExpression" && newProp.value.type === "ObjectExpression") {
|
|
69846
|
+
mergeObjectProperties(
|
|
69847
|
+
existing.value,
|
|
69848
|
+
newProp.value.properties
|
|
69849
|
+
);
|
|
69850
|
+
return;
|
|
69851
|
+
}
|
|
69852
|
+
sourceObject.properties[indexOfExisting] = newProp;
|
|
69853
|
+
});
|
|
69854
|
+
};
|
|
69855
|
+
getPropertyName = (newProp) => {
|
|
69856
|
+
return newProp.key.type === "Identifier" ? newProp.key.name : newProp.key.type === "StringLiteral" ? newProp.key.value : null;
|
|
69857
|
+
};
|
|
70863
69858
|
}
|
|
70864
69859
|
});
|
|
70865
69860
|
|
|
@@ -71014,6 +70009,7 @@ async function updateAppCode() {
|
|
|
71014
70009
|
const packageManifest = readJSON(packageJsonPath);
|
|
71015
70010
|
delete packageManifest["dependencies"]["@angular/ssr"];
|
|
71016
70011
|
delete packageManifest["dependencies"]["express"];
|
|
70012
|
+
delete packageManifest["devDependencies"]["@types/express"];
|
|
71017
70013
|
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
71018
70014
|
s.stop(`${brandColor(`updated`)} ${dim(`\`package.json\``)}`);
|
|
71019
70015
|
}
|
|
@@ -71377,7 +70373,7 @@ ${$1}`
|
|
|
71377
70373
|
|
|
71378
70374
|
// Here we use the @cloudflare/next-on-pages next-dev module to allow us to use bindings during local development
|
|
71379
70375
|
// (when running the application with \`next dev\`), for more information see:
|
|
71380
|
-
// https://github.com/cloudflare/next-on-pages/blob/
|
|
70376
|
+
// https://github.com/cloudflare/next-on-pages/blob/main/internal-packages/next-dev/README.md
|
|
71381
70377
|
if (process.env.NODE_ENV === 'development') {
|
|
71382
70378
|
await setupDevPlatform();
|
|
71383
70379
|
}
|
|
@@ -71604,9 +70600,10 @@ var init_c38 = __esm({
|
|
|
71604
70600
|
visitCallExpression: function(n2) {
|
|
71605
70601
|
const callee = n2.node.callee;
|
|
71606
70602
|
if (callee.name === "defineNuxtConfig") {
|
|
71607
|
-
|
|
71608
|
-
|
|
71609
|
-
|
|
70603
|
+
mergeObjectProperties(
|
|
70604
|
+
n2.node.arguments[0],
|
|
70605
|
+
[presetDef, moduleDef]
|
|
70606
|
+
);
|
|
71610
70607
|
}
|
|
71611
70608
|
return this.traverse(n2);
|
|
71612
70609
|
}
|
|
@@ -71891,8 +70888,9 @@ var init_c312 = __esm({
|
|
|
71891
70888
|
return this.traverse(n2);
|
|
71892
70889
|
}
|
|
71893
70890
|
const b2 = recast6.types.builders;
|
|
71894
|
-
|
|
71895
|
-
|
|
70891
|
+
mergeObjectProperties(
|
|
70892
|
+
n2.node.arguments[0],
|
|
70893
|
+
[
|
|
71896
70894
|
b2.objectProperty(
|
|
71897
70895
|
b2.identifier("server"),
|
|
71898
70896
|
b2.objectExpression([
|
|
@@ -71911,8 +70909,8 @@ var init_c312 = __esm({
|
|
|
71911
70909
|
)
|
|
71912
70910
|
])
|
|
71913
70911
|
)
|
|
71914
|
-
]
|
|
71915
|
-
|
|
70912
|
+
]
|
|
70913
|
+
);
|
|
71916
70914
|
return false;
|
|
71917
70915
|
}
|
|
71918
70916
|
});
|
|
@@ -71947,10 +70945,10 @@ var c3_exports13 = {};
|
|
|
71947
70945
|
__export(c3_exports13, {
|
|
71948
70946
|
default: () => c3_default13
|
|
71949
70947
|
});
|
|
71950
|
-
var
|
|
70948
|
+
var import_node_os2, recast7, npm11, generate13, configure10, updateSvelteConfig, updateTypeDefinitions, config12, c3_default13;
|
|
71951
70949
|
var init_c313 = __esm({
|
|
71952
70950
|
"templates/svelte/c3.ts"() {
|
|
71953
|
-
|
|
70951
|
+
import_node_os2 = require("node:os");
|
|
71954
70952
|
init_cli();
|
|
71955
70953
|
init_colors();
|
|
71956
70954
|
init_frameworks();
|
|
@@ -72042,7 +71040,7 @@ var init_c313 = __esm({
|
|
|
72042
71040
|
deploy: `${npm11} run build && wrangler pages deploy`
|
|
72043
71041
|
};
|
|
72044
71042
|
if (usesTypescript(ctx)) {
|
|
72045
|
-
const mv = (0,
|
|
71043
|
+
const mv = (0, import_node_os2.platform)() === "win32" ? "move" : "mv";
|
|
72046
71044
|
scripts = {
|
|
72047
71045
|
...scripts,
|
|
72048
71046
|
"cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
|
|
@@ -72103,7 +71101,7 @@ var init_c315 = __esm({
|
|
|
72103
71101
|
c3_default15 = {
|
|
72104
71102
|
configVersion: 1,
|
|
72105
71103
|
id: "hello-world",
|
|
72106
|
-
displayName:
|
|
71104
|
+
displayName: "Hello World Worker",
|
|
72107
71105
|
platform: "workers",
|
|
72108
71106
|
copyFiles: {
|
|
72109
71107
|
variants: {
|
|
@@ -72112,6 +71110,9 @@ var init_c315 = __esm({
|
|
|
72112
71110
|
},
|
|
72113
71111
|
ts: {
|
|
72114
71112
|
path: "./ts"
|
|
71113
|
+
},
|
|
71114
|
+
python: {
|
|
71115
|
+
path: "./py"
|
|
72115
71116
|
}
|
|
72116
71117
|
}
|
|
72117
71118
|
}
|
|
@@ -72119,38 +71120,45 @@ var init_c315 = __esm({
|
|
|
72119
71120
|
}
|
|
72120
71121
|
});
|
|
72121
71122
|
|
|
72122
|
-
// templates/
|
|
71123
|
+
// templates/common/c3.ts
|
|
72123
71124
|
var c3_exports16 = {};
|
|
72124
71125
|
__export(c3_exports16, {
|
|
72125
71126
|
default: () => c3_default16
|
|
72126
71127
|
});
|
|
72127
71128
|
var c3_default16;
|
|
72128
71129
|
var init_c316 = __esm({
|
|
72129
|
-
"templates/
|
|
71130
|
+
"templates/common/c3.ts"() {
|
|
72130
71131
|
c3_default16 = {
|
|
72131
71132
|
configVersion: 1,
|
|
72132
|
-
id: "
|
|
72133
|
-
displayName:
|
|
71133
|
+
id: "common",
|
|
71134
|
+
displayName: "Example router & proxy Worker",
|
|
72134
71135
|
platform: "workers",
|
|
72135
71136
|
copyFiles: {
|
|
72136
|
-
|
|
71137
|
+
variants: {
|
|
71138
|
+
js: {
|
|
71139
|
+
path: "./js"
|
|
71140
|
+
},
|
|
71141
|
+
ts: {
|
|
71142
|
+
path: "./ts"
|
|
71143
|
+
}
|
|
71144
|
+
}
|
|
72137
71145
|
}
|
|
72138
71146
|
};
|
|
72139
71147
|
}
|
|
72140
71148
|
});
|
|
72141
71149
|
|
|
72142
|
-
// templates/
|
|
71150
|
+
// templates/scheduled/c3.ts
|
|
72143
71151
|
var c3_exports17 = {};
|
|
72144
71152
|
__export(c3_exports17, {
|
|
72145
71153
|
default: () => c3_default17
|
|
72146
71154
|
});
|
|
72147
71155
|
var c3_default17;
|
|
72148
71156
|
var init_c317 = __esm({
|
|
72149
|
-
"templates/
|
|
71157
|
+
"templates/scheduled/c3.ts"() {
|
|
72150
71158
|
c3_default17 = {
|
|
72151
71159
|
configVersion: 1,
|
|
72152
|
-
id: "
|
|
72153
|
-
displayName:
|
|
71160
|
+
id: "scheduled",
|
|
71161
|
+
displayName: "Scheduled Worker (Cron Trigger)",
|
|
72154
71162
|
platform: "workers",
|
|
72155
71163
|
copyFiles: {
|
|
72156
71164
|
variants: {
|
|
@@ -72166,18 +71174,18 @@ var init_c317 = __esm({
|
|
|
72166
71174
|
}
|
|
72167
71175
|
});
|
|
72168
71176
|
|
|
72169
|
-
// templates/
|
|
71177
|
+
// templates/queues/c3.ts
|
|
72170
71178
|
var c3_exports18 = {};
|
|
72171
71179
|
__export(c3_exports18, {
|
|
72172
71180
|
default: () => c3_default18
|
|
72173
71181
|
});
|
|
72174
71182
|
var c3_default18;
|
|
72175
71183
|
var init_c318 = __esm({
|
|
72176
|
-
"templates/
|
|
71184
|
+
"templates/queues/c3.ts"() {
|
|
72177
71185
|
c3_default18 = {
|
|
72178
71186
|
configVersion: 1,
|
|
72179
|
-
id: "
|
|
72180
|
-
displayName: "
|
|
71187
|
+
id: "queues",
|
|
71188
|
+
displayName: "Queue consumer & producer Worker",
|
|
72181
71189
|
platform: "workers",
|
|
72182
71190
|
copyFiles: {
|
|
72183
71191
|
variants: {
|
|
@@ -72188,23 +71196,33 @@ var init_c318 = __esm({
|
|
|
72188
71196
|
path: "./ts"
|
|
72189
71197
|
}
|
|
72190
71198
|
}
|
|
71199
|
+
},
|
|
71200
|
+
bindings: {
|
|
71201
|
+
queues: [
|
|
71202
|
+
{
|
|
71203
|
+
boundVariable: "MY_QUEUE",
|
|
71204
|
+
defaultValue: "my-queue",
|
|
71205
|
+
producer: true,
|
|
71206
|
+
consumer: true
|
|
71207
|
+
}
|
|
71208
|
+
]
|
|
72191
71209
|
}
|
|
72192
71210
|
};
|
|
72193
71211
|
}
|
|
72194
71212
|
});
|
|
72195
71213
|
|
|
72196
|
-
// templates/
|
|
71214
|
+
// templates/hello-world-durable-object/c3.ts
|
|
72197
71215
|
var c3_exports19 = {};
|
|
72198
71216
|
__export(c3_exports19, {
|
|
72199
71217
|
default: () => c3_default19
|
|
72200
71218
|
});
|
|
72201
71219
|
var c3_default19;
|
|
72202
71220
|
var init_c319 = __esm({
|
|
72203
|
-
"templates/
|
|
71221
|
+
"templates/hello-world-durable-object/c3.ts"() {
|
|
72204
71222
|
c3_default19 = {
|
|
72205
71223
|
configVersion: 1,
|
|
72206
|
-
id: "
|
|
72207
|
-
displayName: "
|
|
71224
|
+
id: "hello-world-durable-object",
|
|
71225
|
+
displayName: "Hello World Worker Using Durable Objects",
|
|
72208
71226
|
platform: "workers",
|
|
72209
71227
|
copyFiles: {
|
|
72210
71228
|
variants: {
|
|
@@ -72220,52 +71238,15 @@ var init_c319 = __esm({
|
|
|
72220
71238
|
}
|
|
72221
71239
|
});
|
|
72222
71240
|
|
|
72223
|
-
// templates/
|
|
71241
|
+
// templates/openapi/c3.ts
|
|
72224
71242
|
var c3_exports20 = {};
|
|
72225
71243
|
__export(c3_exports20, {
|
|
72226
71244
|
default: () => c3_default20
|
|
72227
71245
|
});
|
|
72228
71246
|
var c3_default20;
|
|
72229
71247
|
var init_c320 = __esm({
|
|
72230
|
-
"templates/queues/c3.ts"() {
|
|
72231
|
-
c3_default20 = {
|
|
72232
|
-
configVersion: 1,
|
|
72233
|
-
id: "queues",
|
|
72234
|
-
displayName: "Queue consumer & producer Worker",
|
|
72235
|
-
platform: "workers",
|
|
72236
|
-
copyFiles: {
|
|
72237
|
-
variants: {
|
|
72238
|
-
js: {
|
|
72239
|
-
path: "./js"
|
|
72240
|
-
},
|
|
72241
|
-
ts: {
|
|
72242
|
-
path: "./ts"
|
|
72243
|
-
}
|
|
72244
|
-
}
|
|
72245
|
-
},
|
|
72246
|
-
bindings: {
|
|
72247
|
-
queues: [
|
|
72248
|
-
{
|
|
72249
|
-
boundVariable: "MY_QUEUE",
|
|
72250
|
-
defaultValue: "my-queue",
|
|
72251
|
-
producer: true,
|
|
72252
|
-
consumer: true
|
|
72253
|
-
}
|
|
72254
|
-
]
|
|
72255
|
-
}
|
|
72256
|
-
};
|
|
72257
|
-
}
|
|
72258
|
-
});
|
|
72259
|
-
|
|
72260
|
-
// templates/openapi/c3.ts
|
|
72261
|
-
var c3_exports21 = {};
|
|
72262
|
-
__export(c3_exports21, {
|
|
72263
|
-
default: () => c3_default21
|
|
72264
|
-
});
|
|
72265
|
-
var c3_default21;
|
|
72266
|
-
var init_c321 = __esm({
|
|
72267
71248
|
"templates/openapi/c3.ts"() {
|
|
72268
|
-
|
|
71249
|
+
c3_default20 = {
|
|
72269
71250
|
configVersion: 1,
|
|
72270
71251
|
id: "openapi",
|
|
72271
71252
|
displayName: "API starter (OpenAPI compliant)",
|
|
@@ -72278,10 +71259,10 @@ var init_c321 = __esm({
|
|
|
72278
71259
|
});
|
|
72279
71260
|
|
|
72280
71261
|
// templates/pre-existing/c3.ts
|
|
72281
|
-
var
|
|
72282
|
-
__export(
|
|
71262
|
+
var c3_exports21 = {};
|
|
71263
|
+
__export(c3_exports21, {
|
|
72283
71264
|
copyExistingWorkerFiles: () => copyExistingWorkerFiles,
|
|
72284
|
-
default: () =>
|
|
71265
|
+
default: () => c3_default21
|
|
72285
71266
|
});
|
|
72286
71267
|
async function copyExistingWorkerFiles(ctx) {
|
|
72287
71268
|
const { dlx } = detectPackageManager();
|
|
@@ -72330,8 +71311,8 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
72330
71311
|
(0, import_path14.join)(ctx.project.path, "wrangler.toml")
|
|
72331
71312
|
);
|
|
72332
71313
|
}
|
|
72333
|
-
var import_promises, import_os, import_path14,
|
|
72334
|
-
var
|
|
71314
|
+
var import_promises, import_os, import_path14, c3_default21;
|
|
71315
|
+
var init_c321 = __esm({
|
|
72335
71316
|
"templates/pre-existing/c3.ts"() {
|
|
72336
71317
|
import_promises = require("fs/promises");
|
|
72337
71318
|
import_os = require("os");
|
|
@@ -72341,7 +71322,7 @@ var init_c322 = __esm({
|
|
|
72341
71322
|
init_command();
|
|
72342
71323
|
init_packageManagers();
|
|
72343
71324
|
init_accounts();
|
|
72344
|
-
|
|
71325
|
+
c3_default21 = {
|
|
72345
71326
|
configVersion: 1,
|
|
72346
71327
|
id: "pre-existing",
|
|
72347
71328
|
displayName: "Pre-existing Worker (from Dashboard)",
|
|
@@ -72384,7 +71365,19 @@ async function copyTemplateFiles(ctx) {
|
|
|
72384
71365
|
}
|
|
72385
71366
|
s.stop(`${brandColor("files")} ${dim("copied to project directory")}`);
|
|
72386
71367
|
}
|
|
72387
|
-
|
|
71368
|
+
function inferLanguageArg(args) {
|
|
71369
|
+
if (args.ts === void 0) {
|
|
71370
|
+
return;
|
|
71371
|
+
}
|
|
71372
|
+
const language = args.ts ? "ts" : "js";
|
|
71373
|
+
if (args.lang !== void 0) {
|
|
71374
|
+
crash(
|
|
71375
|
+
"The `--ts` argument cannot be specified in conjunction with the `--lang` argument"
|
|
71376
|
+
);
|
|
71377
|
+
}
|
|
71378
|
+
args.lang = language;
|
|
71379
|
+
}
|
|
71380
|
+
var import_fs12, import_promises2, import_os2, import_path15, import_deepmerge, import_degit, defaultSelectVariant, getFrameworkMap, getTemplateMap, selectTemplate, selectFramework, selectLanguage, processRemoteTemplate, validateTemplate, validateTemplateSrcDirectory, inferTemplateConfig, inferCopyFilesDefinition, downloadRemoteTemplate, updatePackageName, updatePackageScripts, getTemplatePath, isVariantInfo, getCopyFilesDestinationDir, addWranglerToGitIgnore;
|
|
72388
71381
|
var init_templates = __esm({
|
|
72389
71382
|
"src/templates.ts"() {
|
|
72390
71383
|
import_fs12 = require("fs");
|
|
@@ -72401,8 +71394,7 @@ var init_templates = __esm({
|
|
|
72401
71394
|
init_files();
|
|
72402
71395
|
init_validators();
|
|
72403
71396
|
defaultSelectVariant = async (ctx) => {
|
|
72404
|
-
|
|
72405
|
-
return typescript ? "ts" : "js";
|
|
71397
|
+
return await selectLanguage(ctx);
|
|
72406
71398
|
};
|
|
72407
71399
|
getFrameworkMap = async () => ({
|
|
72408
71400
|
analog: (await Promise.resolve().then(() => (init_c3(), c3_exports))).default,
|
|
@@ -72423,48 +71415,88 @@ var init_templates = __esm({
|
|
|
72423
71415
|
getTemplateMap = async () => {
|
|
72424
71416
|
return {
|
|
72425
71417
|
"hello-world": (await Promise.resolve().then(() => (init_c315(), c3_exports15))).default,
|
|
72426
|
-
|
|
72427
|
-
|
|
72428
|
-
|
|
72429
|
-
"
|
|
72430
|
-
|
|
72431
|
-
|
|
72432
|
-
queues: (await Promise.resolve().then(() => (init_c320(), c3_exports20))).default,
|
|
72433
|
-
openapi: (await Promise.resolve().then(() => (init_c321(), c3_exports21))).default,
|
|
72434
|
-
// Dummy record -- actual template config resolved in `processRemoteTemplate`
|
|
72435
|
-
"remote-template": {
|
|
72436
|
-
displayName: "Worker built from a template hosted in a git repository"
|
|
72437
|
-
},
|
|
72438
|
-
"pre-existing": (await Promise.resolve().then(() => (init_c322(), c3_exports22))).default
|
|
71418
|
+
common: (await Promise.resolve().then(() => (init_c316(), c3_exports16))).default,
|
|
71419
|
+
scheduled: (await Promise.resolve().then(() => (init_c317(), c3_exports17))).default,
|
|
71420
|
+
queues: (await Promise.resolve().then(() => (init_c318(), c3_exports18))).default,
|
|
71421
|
+
"hello-world-durable-object": (await Promise.resolve().then(() => (init_c319(), c3_exports19))).default,
|
|
71422
|
+
openapi: (await Promise.resolve().then(() => (init_c320(), c3_exports20))).default,
|
|
71423
|
+
"pre-existing": (await Promise.resolve().then(() => (init_c321(), c3_exports21))).default
|
|
72439
71424
|
};
|
|
72440
71425
|
};
|
|
72441
71426
|
selectTemplate = async (args) => {
|
|
72442
|
-
if (
|
|
72443
|
-
|
|
71427
|
+
if (args.framework) {
|
|
71428
|
+
args.type ??= "web-framework";
|
|
71429
|
+
} else if (args.template) {
|
|
71430
|
+
args.type ??= "remote-template";
|
|
71431
|
+
} else if (args.existingScript) {
|
|
71432
|
+
args.type ??= "pre-existing";
|
|
71433
|
+
}
|
|
71434
|
+
switch (args.type) {
|
|
71435
|
+
case "hello-world":
|
|
71436
|
+
case "hello-world-durable-object":
|
|
71437
|
+
args.category ??= "hello-world";
|
|
71438
|
+
break;
|
|
71439
|
+
case "hello-world-python":
|
|
71440
|
+
args.category ??= "hello-world";
|
|
71441
|
+
args.type = "hello-world";
|
|
71442
|
+
args.lang = "python";
|
|
71443
|
+
break;
|
|
71444
|
+
case "webFramework":
|
|
71445
|
+
warn(
|
|
71446
|
+
"The `webFramework` type is deprecated and will be removed in a future version. Please use `web-framework` instead."
|
|
71447
|
+
);
|
|
71448
|
+
args.category ??= "web-framework";
|
|
72444
71449
|
args.type = "web-framework";
|
|
72445
|
-
|
|
72446
|
-
|
|
72447
|
-
|
|
72448
|
-
args.
|
|
72449
|
-
|
|
71450
|
+
break;
|
|
71451
|
+
case "web-framework":
|
|
71452
|
+
case "remote-template":
|
|
71453
|
+
args.category ??= args.type;
|
|
71454
|
+
break;
|
|
71455
|
+
case "common":
|
|
71456
|
+
case "scheduled":
|
|
71457
|
+
case "queues":
|
|
71458
|
+
case "openapi":
|
|
71459
|
+
args.category ??= "demo";
|
|
71460
|
+
break;
|
|
71461
|
+
case "pre-existing":
|
|
71462
|
+
args.category ??= "others";
|
|
71463
|
+
break;
|
|
72450
71464
|
}
|
|
72451
|
-
|
|
72452
|
-
|
|
72453
|
-
|
|
72454
|
-
|
|
72455
|
-
|
|
71465
|
+
const category = await processArgument(args, "category", {
|
|
71466
|
+
type: "select",
|
|
71467
|
+
question: "What would you like to start with?",
|
|
71468
|
+
label: "category",
|
|
71469
|
+
options: [
|
|
71470
|
+
{ label: "Hello World example", value: "hello-world" },
|
|
71471
|
+
{ label: "Framework Starter", value: "web-framework" },
|
|
71472
|
+
{ label: "Demo application", value: "demo" },
|
|
71473
|
+
{ label: "Template from a Github repo", value: "remote-template" },
|
|
71474
|
+
// This is used only if the type is `pre-existing`
|
|
71475
|
+
{ label: "Others", value: "others", hidden: true }
|
|
71476
|
+
],
|
|
71477
|
+
defaultValue: C3_DEFAULTS.category
|
|
71478
|
+
});
|
|
71479
|
+
if (category === "web-framework") {
|
|
71480
|
+
return selectFramework(args);
|
|
71481
|
+
}
|
|
71482
|
+
if (category === "remote-template") {
|
|
71483
|
+
return processRemoteTemplate(args);
|
|
72456
71484
|
}
|
|
72457
71485
|
const templateMap = await getTemplateMap();
|
|
72458
71486
|
const templateOptions = Object.entries(templateMap).map(
|
|
72459
|
-
([value, { displayName, hidden: hidden2 }]) =>
|
|
72460
|
-
value
|
|
72461
|
-
|
|
72462
|
-
|
|
72463
|
-
|
|
71487
|
+
([value, { displayName, hidden: hidden2 }]) => {
|
|
71488
|
+
const isHelloWorldExample = value.startsWith("hello-world");
|
|
71489
|
+
const isCategoryMatched = category === "hello-world" ? isHelloWorldExample : !isHelloWorldExample;
|
|
71490
|
+
return {
|
|
71491
|
+
value,
|
|
71492
|
+
label: displayName,
|
|
71493
|
+
hidden: hidden2 || !isCategoryMatched
|
|
71494
|
+
};
|
|
71495
|
+
}
|
|
72464
71496
|
);
|
|
72465
71497
|
const type = await processArgument(args, "type", {
|
|
72466
71498
|
type: "select",
|
|
72467
|
-
question: "
|
|
71499
|
+
question: "Which template would you like to use?",
|
|
72468
71500
|
label: "type",
|
|
72469
71501
|
options: templateOptions,
|
|
72470
71502
|
defaultValue: C3_DEFAULTS.type
|
|
@@ -72475,12 +71507,6 @@ var init_templates = __esm({
|
|
|
72475
71507
|
if (!Object.keys(templateMap).includes(type)) {
|
|
72476
71508
|
return crash(`Unknown application type provided: ${type}.`);
|
|
72477
71509
|
}
|
|
72478
|
-
if (type === "web-framework") {
|
|
72479
|
-
return selectFramework(args);
|
|
72480
|
-
}
|
|
72481
|
-
if (type === "remote-template") {
|
|
72482
|
-
return processRemoteTemplate(args);
|
|
72483
|
-
}
|
|
72484
71510
|
return templateMap[type];
|
|
72485
71511
|
};
|
|
72486
71512
|
selectFramework = async (args) => {
|
|
@@ -72513,18 +71539,26 @@ var init_templates = __esm({
|
|
|
72513
71539
|
...frameworkMap[framework]
|
|
72514
71540
|
};
|
|
72515
71541
|
};
|
|
72516
|
-
|
|
71542
|
+
selectLanguage = async (ctx) => {
|
|
72517
71543
|
if (usesTypescript(ctx)) {
|
|
72518
|
-
return
|
|
71544
|
+
return "ts";
|
|
72519
71545
|
}
|
|
72520
71546
|
if (ctx.template.generate) {
|
|
72521
|
-
return
|
|
72522
|
-
}
|
|
72523
|
-
|
|
72524
|
-
|
|
72525
|
-
|
|
72526
|
-
label: "
|
|
72527
|
-
|
|
71547
|
+
return "js";
|
|
71548
|
+
}
|
|
71549
|
+
inferLanguageArg(ctx.args);
|
|
71550
|
+
const variants = ctx.template.copyFiles && !isVariantInfo(ctx.template.copyFiles) ? Object.keys(ctx.template.copyFiles.variants) : [];
|
|
71551
|
+
const languageOptions = [
|
|
71552
|
+
{ label: "TypeScript", value: "ts" },
|
|
71553
|
+
{ label: "JavaScript", value: "js" },
|
|
71554
|
+
{ label: "Python", value: "python" }
|
|
71555
|
+
].filter((option) => variants.includes(option.value));
|
|
71556
|
+
return processArgument(ctx.args, "lang", {
|
|
71557
|
+
type: "select",
|
|
71558
|
+
question: "Which language do you want to use?",
|
|
71559
|
+
label: "lang",
|
|
71560
|
+
options: languageOptions,
|
|
71561
|
+
defaultValue: C3_DEFAULTS.lang
|
|
72528
71562
|
});
|
|
72529
71563
|
};
|
|
72530
71564
|
processRemoteTemplate = async (args) => {
|
|
@@ -72535,9 +71569,14 @@ var init_templates = __esm({
|
|
|
72535
71569
|
validate: (val) => validateTemplateUrl(val || C3_DEFAULTS.template),
|
|
72536
71570
|
defaultValue: C3_DEFAULTS.template
|
|
72537
71571
|
});
|
|
72538
|
-
|
|
71572
|
+
let src = templateUrl;
|
|
71573
|
+
if (src.startsWith("https://github.com/") && src.includes("/tree/main/")) {
|
|
71574
|
+
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
71575
|
+
}
|
|
71576
|
+
const path4 = await downloadRemoteTemplate(src);
|
|
72539
71577
|
const config14 = inferTemplateConfig(path4);
|
|
72540
71578
|
validateTemplate(path4, config14);
|
|
71579
|
+
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
72541
71580
|
return {
|
|
72542
71581
|
path: path4,
|
|
72543
71582
|
...config14
|
|
@@ -72588,9 +71627,8 @@ var init_templates = __esm({
|
|
|
72588
71627
|
return copyFiles;
|
|
72589
71628
|
};
|
|
72590
71629
|
downloadRemoteTemplate = async (src) => {
|
|
72591
|
-
const s = spinner();
|
|
72592
71630
|
try {
|
|
72593
|
-
|
|
71631
|
+
updateStatus(`Cloning template from: ${blue(src)}`);
|
|
72594
71632
|
const emitter = (0, import_degit.default)(src, {
|
|
72595
71633
|
cache: false,
|
|
72596
71634
|
verbose: false,
|
|
@@ -72598,10 +71636,9 @@ var init_templates = __esm({
|
|
|
72598
71636
|
});
|
|
72599
71637
|
const tmpDir = await (0, import_promises2.mkdtemp)((0, import_path15.join)((0, import_os2.tmpdir)(), "c3-template"));
|
|
72600
71638
|
await emitter.clone(tmpDir);
|
|
72601
|
-
s.stop(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
72602
71639
|
return tmpDir;
|
|
72603
71640
|
} catch (error2) {
|
|
72604
|
-
|
|
71641
|
+
updateStatus(`${brandColor("template")} ${dim("failed")}`);
|
|
72605
71642
|
return crash(`Failed to clone remote template: ${src}`);
|
|
72606
71643
|
}
|
|
72607
71644
|
};
|
|
@@ -72709,7 +71746,7 @@ init_args();
|
|
|
72709
71746
|
init_colors();
|
|
72710
71747
|
init_interactive();
|
|
72711
71748
|
|
|
72712
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
71749
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
72713
71750
|
var import_assert = require("assert");
|
|
72714
71751
|
|
|
72715
71752
|
// ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/index.js
|
|
@@ -73000,7 +72037,7 @@ function ui(opts) {
|
|
|
73000
72037
|
});
|
|
73001
72038
|
}
|
|
73002
72039
|
|
|
73003
|
-
// ../../node_modules/.pnpm/escalade@3.1.
|
|
72040
|
+
// ../../node_modules/.pnpm/escalade@3.1.2/node_modules/escalade/sync/index.mjs
|
|
73004
72041
|
var import_path = require("path");
|
|
73005
72042
|
var import_fs = require("fs");
|
|
73006
72043
|
function sync_default(start, callback) {
|
|
@@ -73019,7 +72056,7 @@ function sync_default(start, callback) {
|
|
|
73019
72056
|
}
|
|
73020
72057
|
}
|
|
73021
72058
|
|
|
73022
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
72059
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
73023
72060
|
var import_util3 = require("util");
|
|
73024
72061
|
var import_fs4 = require("fs");
|
|
73025
72062
|
var import_url = require("url");
|
|
@@ -73656,8 +72693,8 @@ var YargsParser = class {
|
|
|
73656
72693
|
if (typeof envPrefix === "undefined")
|
|
73657
72694
|
return;
|
|
73658
72695
|
const prefix = typeof envPrefix === "string" ? envPrefix : "";
|
|
73659
|
-
const
|
|
73660
|
-
Object.keys(
|
|
72696
|
+
const env3 = mixin2.env();
|
|
72697
|
+
Object.keys(env3).forEach(function(envVar) {
|
|
73661
72698
|
if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) {
|
|
73662
72699
|
const keys = envVar.split("__").map(function(key, i) {
|
|
73663
72700
|
if (i === 0) {
|
|
@@ -73666,7 +72703,7 @@ var YargsParser = class {
|
|
|
73666
72703
|
return camelCase(key);
|
|
73667
72704
|
});
|
|
73668
72705
|
if ((configOnly && flags.configs[keys.join(".")] || !configOnly) && !hasKey2(argv2, keys)) {
|
|
73669
|
-
setArg(keys.join("."),
|
|
72706
|
+
setArg(keys.join("."), env3[envVar]);
|
|
73670
72707
|
}
|
|
73671
72708
|
}
|
|
73672
72709
|
});
|
|
@@ -73976,11 +73013,11 @@ if (nodeVersion) {
|
|
|
73976
73013
|
throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
|
73977
73014
|
}
|
|
73978
73015
|
}
|
|
73979
|
-
var
|
|
73016
|
+
var env2 = process ? process.env : {};
|
|
73980
73017
|
var parser = new YargsParser({
|
|
73981
73018
|
cwd: process.cwd,
|
|
73982
73019
|
env: () => {
|
|
73983
|
-
return
|
|
73020
|
+
return env2;
|
|
73984
73021
|
},
|
|
73985
73022
|
format: import_util.format,
|
|
73986
73023
|
normalize: import_path2.normalize,
|
|
@@ -74009,10 +73046,10 @@ yargsParser.decamelize = decamelize;
|
|
|
74009
73046
|
yargsParser.looksLikeNumber = looksLikeNumber;
|
|
74010
73047
|
var lib_default = yargsParser;
|
|
74011
73048
|
|
|
74012
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73049
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
74013
73050
|
var import_path4 = require("path");
|
|
74014
73051
|
|
|
74015
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73052
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/process-argv.js
|
|
74016
73053
|
function getProcessArgvBinIndex() {
|
|
74017
73054
|
if (isBundledElectronApp())
|
|
74018
73055
|
return 0;
|
|
@@ -74031,7 +73068,7 @@ function getProcessArgvBin() {
|
|
|
74031
73068
|
return process.argv[getProcessArgvBinIndex()];
|
|
74032
73069
|
}
|
|
74033
73070
|
|
|
74034
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73071
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js
|
|
74035
73072
|
var YError = class extends Error {
|
|
74036
73073
|
constructor(msg) {
|
|
74037
73074
|
super(msg || "yargs error");
|
|
@@ -74229,7 +73266,7 @@ var y18n2 = (opts) => {
|
|
|
74229
73266
|
};
|
|
74230
73267
|
var y18n_default = y18n2;
|
|
74231
73268
|
|
|
74232
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73269
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
74233
73270
|
var import_meta = {};
|
|
74234
73271
|
var REQUIRE_ERROR = "require is not supported by ESM";
|
|
74235
73272
|
var REQUIRE_DIRECTORY_ERROR = "loading a directory of commands is not supported yet for ESM";
|
|
@@ -74289,7 +73326,7 @@ var esm_default = {
|
|
|
74289
73326
|
})
|
|
74290
73327
|
};
|
|
74291
73328
|
|
|
74292
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73329
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/typings/common-types.js
|
|
74293
73330
|
function assertNotStrictEqual(actual, expected, shim3, message) {
|
|
74294
73331
|
shim3.assert.notStrictEqual(actual, expected, message);
|
|
74295
73332
|
}
|
|
@@ -74300,12 +73337,12 @@ function objectKeys(object) {
|
|
|
74300
73337
|
return Object.keys(object);
|
|
74301
73338
|
}
|
|
74302
73339
|
|
|
74303
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73340
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/is-promise.js
|
|
74304
73341
|
function isPromise(maybePromise) {
|
|
74305
73342
|
return !!maybePromise && !!maybePromise.then && typeof maybePromise.then === "function";
|
|
74306
73343
|
}
|
|
74307
73344
|
|
|
74308
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73345
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/parse-command.js
|
|
74309
73346
|
function parseCommand(cmd) {
|
|
74310
73347
|
const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, " ");
|
|
74311
73348
|
const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/);
|
|
@@ -74338,7 +73375,7 @@ function parseCommand(cmd) {
|
|
|
74338
73375
|
return parsedCommand;
|
|
74339
73376
|
}
|
|
74340
73377
|
|
|
74341
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73378
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/argsert.js
|
|
74342
73379
|
var positionName = ["first", "second", "third", "fourth", "fifth", "sixth"];
|
|
74343
73380
|
function argsert(arg1, arg2, arg3) {
|
|
74344
73381
|
function parseArgs2() {
|
|
@@ -74396,7 +73433,7 @@ function argumentTypeError(observedType, allowedTypes, position) {
|
|
|
74396
73433
|
throw new YError(`Invalid ${positionName[position] || "manyith"} argument. Expected ${allowedTypes.join(" or ")} but received ${observedType}.`);
|
|
74397
73434
|
}
|
|
74398
73435
|
|
|
74399
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73436
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/middleware.js
|
|
74400
73437
|
var GlobalMiddleware = class {
|
|
74401
73438
|
constructor(yargs) {
|
|
74402
73439
|
this.globalMiddleware = [];
|
|
@@ -74478,7 +73515,7 @@ function applyMiddleware(argv, yargs, middlewares, beforeValidation) {
|
|
|
74478
73515
|
}, argv);
|
|
74479
73516
|
}
|
|
74480
73517
|
|
|
74481
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73518
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/maybe-async-result.js
|
|
74482
73519
|
function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => {
|
|
74483
73520
|
throw err;
|
|
74484
73521
|
}) {
|
|
@@ -74493,7 +73530,7 @@ function isFunction(arg) {
|
|
|
74493
73530
|
return typeof arg === "function";
|
|
74494
73531
|
}
|
|
74495
73532
|
|
|
74496
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73533
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/which-module.js
|
|
74497
73534
|
function whichModule(exported) {
|
|
74498
73535
|
if (typeof require === "undefined")
|
|
74499
73536
|
return null;
|
|
@@ -74505,7 +73542,7 @@ function whichModule(exported) {
|
|
|
74505
73542
|
return null;
|
|
74506
73543
|
}
|
|
74507
73544
|
|
|
74508
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73545
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/command.js
|
|
74509
73546
|
var DEFAULT_MARKER = /(^\*)|(^\$0)/;
|
|
74510
73547
|
var CommandInstance = class {
|
|
74511
73548
|
constructor(usage2, validation2, globalMiddleware, shim3) {
|
|
@@ -74897,7 +73934,7 @@ function isCommandHandlerDefinition(cmd) {
|
|
|
74897
73934
|
return typeof cmd === "object" && !Array.isArray(cmd);
|
|
74898
73935
|
}
|
|
74899
73936
|
|
|
74900
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73937
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/obj-filter.js
|
|
74901
73938
|
function objFilter(original = {}, filter = () => true) {
|
|
74902
73939
|
const obj = {};
|
|
74903
73940
|
objectKeys(original).forEach((key) => {
|
|
@@ -74908,7 +73945,7 @@ function objFilter(original = {}, filter = () => true) {
|
|
|
74908
73945
|
return obj;
|
|
74909
73946
|
}
|
|
74910
73947
|
|
|
74911
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73948
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/set-blocking.js
|
|
74912
73949
|
function setBlocking(blocking) {
|
|
74913
73950
|
if (typeof process === "undefined")
|
|
74914
73951
|
return;
|
|
@@ -74920,7 +73957,7 @@ function setBlocking(blocking) {
|
|
|
74920
73957
|
});
|
|
74921
73958
|
}
|
|
74922
73959
|
|
|
74923
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
73960
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/usage.js
|
|
74924
73961
|
function isBoolean(fail) {
|
|
74925
73962
|
return typeof fail === "boolean";
|
|
74926
73963
|
}
|
|
@@ -75446,7 +74483,7 @@ function getText(text) {
|
|
|
75446
74483
|
return isIndentedText(text) ? text.text : text;
|
|
75447
74484
|
}
|
|
75448
74485
|
|
|
75449
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
74486
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/completion-templates.js
|
|
75450
74487
|
var completionShTemplate = `###-begin-{{app_name}}-completions-###
|
|
75451
74488
|
#
|
|
75452
74489
|
# yargs command completion script
|
|
@@ -75497,7 +74534,7 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
75497
74534
|
###-end-{{app_name}}-completions-###
|
|
75498
74535
|
`;
|
|
75499
74536
|
|
|
75500
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
74537
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/completion.js
|
|
75501
74538
|
var Completion = class {
|
|
75502
74539
|
constructor(yargs, usage2, command2, shim3) {
|
|
75503
74540
|
var _a2, _b2, _c2;
|
|
@@ -75555,9 +74592,7 @@ var Completion = class {
|
|
|
75555
74592
|
const negable = !!options.configuration["boolean-negation"] && options.boolean.includes(key);
|
|
75556
74593
|
const isPositionalKey = positionalKeys.includes(key);
|
|
75557
74594
|
if (!isPositionalKey && !options.hiddenOptions.includes(key) && !this.argsContainKey(args, key, negable)) {
|
|
75558
|
-
this.completeOptionKey(key, completions, current);
|
|
75559
|
-
if (negable && !!options.default[key])
|
|
75560
|
-
this.completeOptionKey(`no-${key}`, completions, current);
|
|
74595
|
+
this.completeOptionKey(key, completions, current, negable && !!options.default[key]);
|
|
75561
74596
|
}
|
|
75562
74597
|
});
|
|
75563
74598
|
}
|
|
@@ -75633,22 +74668,25 @@ var Completion = class {
|
|
|
75633
74668
|
}
|
|
75634
74669
|
return false;
|
|
75635
74670
|
}
|
|
75636
|
-
completeOptionKey(key, completions, current) {
|
|
75637
|
-
var _a2, _b2, _c2;
|
|
75638
|
-
|
|
75639
|
-
|
|
75640
|
-
|
|
75641
|
-
|
|
75642
|
-
if (!this.zshShell) {
|
|
75643
|
-
completions.push(dashes + key);
|
|
75644
|
-
} else {
|
|
75645
|
-
const aliasKey = (_a2 = this === null || this === void 0 ? void 0 : this.aliases) === null || _a2 === void 0 ? void 0 : _a2[key].find((alias) => {
|
|
74671
|
+
completeOptionKey(key, completions, current, negable) {
|
|
74672
|
+
var _a2, _b2, _c2, _d;
|
|
74673
|
+
let keyWithDesc = key;
|
|
74674
|
+
if (this.zshShell) {
|
|
74675
|
+
const descs = this.usage.getDescriptions();
|
|
74676
|
+
const aliasKey = (_b2 = (_a2 = this === null || this === void 0 ? void 0 : this.aliases) === null || _a2 === void 0 ? void 0 : _a2[key]) === null || _b2 === void 0 ? void 0 : _b2.find((alias) => {
|
|
75646
74677
|
const desc2 = descs[alias];
|
|
75647
74678
|
return typeof desc2 === "string" && desc2.length > 0;
|
|
75648
74679
|
});
|
|
75649
74680
|
const descFromAlias = aliasKey ? descs[aliasKey] : void 0;
|
|
75650
|
-
const desc = (
|
|
75651
|
-
|
|
74681
|
+
const desc = (_d = (_c2 = descs[key]) !== null && _c2 !== void 0 ? _c2 : descFromAlias) !== null && _d !== void 0 ? _d : "";
|
|
74682
|
+
keyWithDesc = `${key.replace(/:/g, "\\:")}:${desc.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`;
|
|
74683
|
+
}
|
|
74684
|
+
const startsByTwoDashes = (s) => /^--/.test(s);
|
|
74685
|
+
const isShortOption = (s) => /^[^0-9]$/.test(s);
|
|
74686
|
+
const dashes = !startsByTwoDashes(current) && isShortOption(key) ? "-" : "--";
|
|
74687
|
+
completions.push(dashes + keyWithDesc);
|
|
74688
|
+
if (negable) {
|
|
74689
|
+
completions.push(dashes + "no-" + keyWithDesc);
|
|
75652
74690
|
}
|
|
75653
74691
|
}
|
|
75654
74692
|
customCompletion(args, argv, current, done) {
|
|
@@ -75709,7 +74747,7 @@ function isFallbackCompletionFunction(completionFunction) {
|
|
|
75709
74747
|
return completionFunction.length > 3;
|
|
75710
74748
|
}
|
|
75711
74749
|
|
|
75712
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
74750
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/levenshtein.js
|
|
75713
74751
|
function levenshtein(a, b2) {
|
|
75714
74752
|
if (a.length === 0)
|
|
75715
74753
|
return b2.length;
|
|
@@ -75740,7 +74778,7 @@ function levenshtein(a, b2) {
|
|
|
75740
74778
|
return matrix[b2.length][a.length];
|
|
75741
74779
|
}
|
|
75742
74780
|
|
|
75743
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
74781
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/validation.js
|
|
75744
74782
|
var specialKeys = ["$0", "--", "_"];
|
|
75745
74783
|
function validation(yargs, usage2, shim3) {
|
|
75746
74784
|
const __ = shim3.y18n.__;
|
|
@@ -76009,7 +75047,7 @@ ${customMsgs.join("\n")}` : "";
|
|
|
76009
75047
|
return self2;
|
|
76010
75048
|
}
|
|
76011
75049
|
|
|
76012
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
75050
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js
|
|
76013
75051
|
var previouslyVisitedConfigs = [];
|
|
76014
75052
|
var shim2;
|
|
76015
75053
|
function applyExtends(config14, cwd, mergeExtends, _shim) {
|
|
@@ -76062,7 +75100,7 @@ function mergeDeep(config1, config22) {
|
|
|
76062
75100
|
return target;
|
|
76063
75101
|
}
|
|
76064
75102
|
|
|
76065
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
75103
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yargs-factory.js
|
|
76066
75104
|
var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
|
|
76067
75105
|
if (kind === "m")
|
|
76068
75106
|
throw new TypeError("Private method is not writable");
|
|
@@ -77561,7 +76599,7 @@ function isYargsInstance(y2) {
|
|
|
77561
76599
|
return !!y2 && typeof y2.getInternalMethods === "function";
|
|
77562
76600
|
}
|
|
77563
76601
|
|
|
77564
|
-
// ../../node_modules/.pnpm/yargs@17.7.
|
|
76602
|
+
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/index.mjs
|
|
77565
76603
|
var Yargs = YargsFactory(esm_default);
|
|
77566
76604
|
var yargs_default = Yargs;
|
|
77567
76605
|
|
|
@@ -77676,7 +76714,7 @@ function stringWidth2(string, options = {}) {
|
|
|
77676
76714
|
|
|
77677
76715
|
// ../../node_modules/.pnpm/wrap-ansi@9.0.0/node_modules/wrap-ansi/index.js
|
|
77678
76716
|
init_strip_ansi();
|
|
77679
|
-
|
|
76717
|
+
init_ansi_styles2();
|
|
77680
76718
|
var ESCAPES3 = /* @__PURE__ */ new Set([
|
|
77681
76719
|
"\x1B",
|
|
77682
76720
|
"\x9B"
|
|
@@ -77807,7 +76845,7 @@ var exec2 = (string, columns, options = {}) => {
|
|
|
77807
76845
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
77808
76846
|
}
|
|
77809
76847
|
}
|
|
77810
|
-
const code =
|
|
76848
|
+
const code = ansi_styles_default2.codes.get(Number(escapeCode));
|
|
77811
76849
|
if (pre[index + 1] === "\n") {
|
|
77812
76850
|
if (escapeUrl) {
|
|
77813
76851
|
returnValue += wrapAnsiHyperlink2("");
|
|
@@ -77921,6 +76959,17 @@ var cliDefinition = {
|
|
|
77921
76959
|
}
|
|
77922
76960
|
],
|
|
77923
76961
|
options: [
|
|
76962
|
+
{
|
|
76963
|
+
name: "category",
|
|
76964
|
+
type: "string",
|
|
76965
|
+
description: `Specifies the kind of templates that should be created`,
|
|
76966
|
+
values: [
|
|
76967
|
+
{ name: "hello-world", description: "Hello World example" },
|
|
76968
|
+
{ name: "web-framework", description: "Framework Starter" },
|
|
76969
|
+
{ name: "demo", description: "Demo application" },
|
|
76970
|
+
{ name: "remote-template", description: "Template from a Github repo" }
|
|
76971
|
+
]
|
|
76972
|
+
},
|
|
77924
76973
|
{
|
|
77925
76974
|
name: "type",
|
|
77926
76975
|
alias: "t",
|
|
@@ -77929,13 +76978,9 @@ var cliDefinition = {
|
|
|
77929
76978
|
description: `
|
|
77930
76979
|
When using a built-in template, specifies the type of application that should be created.
|
|
77931
76980
|
|
|
77932
|
-
Note that "--
|
|
76981
|
+
Note that "--category" and "--template" are mutually exclusive options. If both are provided, "--category" will be used.
|
|
77933
76982
|
`,
|
|
77934
76983
|
values: [
|
|
77935
|
-
{
|
|
77936
|
-
name: "web-framework",
|
|
77937
|
-
description: "A website or web application."
|
|
77938
|
-
},
|
|
77939
76984
|
{
|
|
77940
76985
|
name: "hello-world",
|
|
77941
76986
|
description: "A basic \u201CHello World\u201D Cloudflare Worker."
|
|
@@ -77959,6 +77004,10 @@ var cliDefinition = {
|
|
|
77959
77004
|
{
|
|
77960
77005
|
name: "openapi",
|
|
77961
77006
|
description: "A Worker implementing an OpenAPI REST endpoint."
|
|
77007
|
+
},
|
|
77008
|
+
{
|
|
77009
|
+
name: "pre-existing",
|
|
77010
|
+
description: "Fetch a Worker initialized from the Cloudflare dashboard."
|
|
77962
77011
|
}
|
|
77963
77012
|
]
|
|
77964
77013
|
},
|
|
@@ -77967,7 +77016,7 @@ var cliDefinition = {
|
|
|
77967
77016
|
alias: "f",
|
|
77968
77017
|
type: "string",
|
|
77969
77018
|
requiresArg: true,
|
|
77970
|
-
description: `The type of framework to use to create a web application (when using this option "--
|
|
77019
|
+
description: `The type of framework to use to create a web application (when using this option "--category" is coerced to "web-framework")
|
|
77971
77020
|
|
|
77972
77021
|
When using the --framework option, C3 will dispatch to the official creation tool used by the framework (ex. "create-remix" is used for Remix).
|
|
77973
77022
|
|
|
@@ -77993,6 +77042,12 @@ var cliDefinition = {
|
|
|
77993
77042
|
{ name: "vue" }
|
|
77994
77043
|
]
|
|
77995
77044
|
},
|
|
77045
|
+
{
|
|
77046
|
+
name: "lang",
|
|
77047
|
+
type: "string",
|
|
77048
|
+
description: `The programming language of the template`,
|
|
77049
|
+
values: [{ name: "ts" }, { name: "js" }, { name: "python" }]
|
|
77050
|
+
},
|
|
77996
77051
|
{
|
|
77997
77052
|
name: "deploy",
|
|
77998
77053
|
type: "boolean",
|
|
@@ -78001,7 +77056,8 @@ var cliDefinition = {
|
|
|
78001
77056
|
{
|
|
78002
77057
|
name: "ts",
|
|
78003
77058
|
type: "boolean",
|
|
78004
|
-
description: "Use TypeScript in your application"
|
|
77059
|
+
description: "Use TypeScript in your application",
|
|
77060
|
+
hidden: true
|
|
78005
77061
|
},
|
|
78006
77062
|
{
|
|
78007
77063
|
name: "git",
|
|
@@ -78016,13 +77072,12 @@ var cliDefinition = {
|
|
|
78016
77072
|
},
|
|
78017
77073
|
{
|
|
78018
77074
|
name: "existing-script",
|
|
78019
|
-
description: `The name of an existing Cloudflare Workers script to clone locally.
|
|
77075
|
+
description: `The name of an existing Cloudflare Workers script to clone locally (when using this option "--type" is coerced to "pre-existing").
|
|
78020
77076
|
|
|
78021
77077
|
When "--existing-script" is specified, "deploy" will be ignored.
|
|
78022
77078
|
`,
|
|
78023
77079
|
type: "string",
|
|
78024
|
-
requiresArg: true
|
|
78025
|
-
hidden: true
|
|
77080
|
+
requiresArg: true
|
|
78026
77081
|
},
|
|
78027
77082
|
{
|
|
78028
77083
|
name: "template",
|
|
@@ -79363,9 +78418,9 @@ var runDeploy = async (ctx) => {
|
|
|
79363
78418
|
crash("Failed to find deployment url.");
|
|
79364
78419
|
}
|
|
79365
78420
|
if (ctx.deployment.url?.endsWith(".pages.dev")) {
|
|
79366
|
-
const [
|
|
78421
|
+
const [proto2, hostname] = ctx.deployment.url.split("://");
|
|
79367
78422
|
const hostnameWithoutSHA1 = hostname.split(".").slice(-3).join(".");
|
|
79368
|
-
ctx.deployment.url = `${
|
|
78423
|
+
ctx.deployment.url = `${proto2}://${hostnameWithoutSHA1}`;
|
|
79369
78424
|
}
|
|
79370
78425
|
};
|
|
79371
78426
|
|
|
@@ -81059,7 +80114,7 @@ var runCli = async (args) => {
|
|
|
81059
80114
|
};
|
|
81060
80115
|
const originalCWD = process.cwd();
|
|
81061
80116
|
const { name, path: path4 } = setupProjectDirectory(validatedArgs);
|
|
81062
|
-
const template = await selectTemplate(
|
|
80117
|
+
const template = await selectTemplate(validatedArgs);
|
|
81063
80118
|
const ctx = {
|
|
81064
80119
|
project: { name, path: path4 },
|
|
81065
80120
|
args: validatedArgs,
|