rolldown 0.12.2 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli.cjs +1552 -584
- package/dist/cjs/experimental-index.cjs +40 -0
- package/dist/cjs/index.cjs +5 -22
- package/dist/cjs/parallel-plugin-worker.cjs +7 -7
- package/dist/cjs/parallel-plugin.cjs +1 -1
- package/dist/esm/cli.mjs +1549 -583
- package/dist/esm/experimental-index.mjs +23 -0
- package/dist/esm/index.mjs +5 -17
- package/dist/esm/parallel-plugin-worker.mjs +6 -6
- package/dist/esm/parallel-plugin.mjs +1 -1
- package/dist/shared/{chunk-1xb6WR3y.cjs → chunk-gQ4GMlVi.cjs} +3 -2
- package/dist/shared/{consola.36c0034f-N8xiTrv3.cjs → consola.36c0034f-eps_ogJv.cjs} +188 -188
- package/dist/shared/{consola.36c0034f-jtHhMkSX.mjs → consola.36c0034f-m5cABVv4.mjs} +187 -187
- package/dist/shared/package-3VR4tEG7.mjs +9 -0
- package/dist/shared/package-OJCNSbf0.cjs +11 -0
- package/dist/shared/plugin-context-data-dIOrw9yH.cjs +1436 -0
- package/dist/shared/plugin-context-data-nhjzqlNd.mjs +1444 -0
- package/dist/shared/{prompt-pjyLzLci.mjs → prompt-9VjtYvi_.mjs} +182 -182
- package/dist/shared/{prompt-1K6oCkIU.cjs → prompt-Ah5G71p-.cjs} +183 -183
- package/dist/shared/rolldown-KvxnG5lF.mjs +1107 -0
- package/dist/shared/rolldown-PHdfa5m8.cjs +1123 -0
- package/dist/shared/rolldown-binding.wasi.cjs +70 -51
- package/dist/types/binding.d.ts +329 -14
- package/dist/types/cli/arguments/alias.d.ts +8 -0
- package/dist/types/cli/arguments/index.d.ts +13 -0
- package/dist/types/cli/arguments/normalize.d.ts +15 -0
- package/dist/types/cli/arguments/schema.d.ts +161 -0
- package/dist/types/cli/arguments/utils.d.ts +6 -0
- package/dist/types/cli/commands/bundle.d.ts +3 -1
- package/dist/types/cli/commands/help.d.ts +1 -0
- package/dist/types/cli/utils.d.ts +1 -1
- package/dist/types/constants/plugin-context.d.ts +7 -0
- package/dist/types/constants/plugin.d.ts +36 -0
- package/dist/types/experimental-index.d.ts +5 -0
- package/dist/types/index.d.ts +8 -8
- package/dist/types/options/input-options.d.ts +139 -27
- package/dist/types/options/normalized-alias-plugin-config.d.ts +10 -0
- package/dist/types/options/normalized-ecma-transform-plugin-config.d.ts +8 -0
- package/dist/types/options/normalized-output-options.d.ts +8 -3
- package/dist/types/options/output-options.d.ts +102 -11
- package/dist/types/options/utils.d.ts +2 -0
- package/dist/types/plugin/bindingify-build-hooks.d.ts +9 -8
- package/dist/types/plugin/bindingify-hook-filter.d.ts +5 -0
- package/dist/types/plugin/bindingify-output-hooks.d.ts +11 -7
- package/dist/types/plugin/bindingify-plugin-hook-meta.d.ts +8 -0
- package/dist/types/plugin/bindingify-plugin.d.ts +2 -1
- package/dist/types/plugin/builtin-plugin.d.ts +75 -7
- package/dist/types/plugin/index.d.ts +68 -28
- package/dist/types/plugin/plugin-context-data.d.ts +6 -0
- package/dist/types/plugin/plugin-context.d.ts +18 -8
- package/dist/types/plugin/plugin-driver.d.ts +2 -2
- package/dist/types/rollup.d.ts +1 -0
- package/dist/types/types/rolldown-output.d.ts +1 -0
- package/dist/types/utils/compose-js-plugins.d.ts +2 -0
- package/dist/types/utils/misc.d.ts +1 -0
- package/dist/types/utils/normalize-hook.d.ts +7 -5
- package/dist/types/utils/plugin/index.d.ts +2 -0
- package/dist/types/utils/type-assert.d.ts +1 -0
- package/package.json +30 -22
- package/dist/shared/rolldown-SCF5NBN_.cjs +0 -49
- package/dist/shared/rolldown-kYz4BvAA.mjs +0 -48
- package/dist/shared/utils_index-_DFpKlu1.mjs +0 -1582
- package/dist/shared/utils_index-xb2NoRNm.cjs +0 -1557
- package/dist/types/cli/constants.d.ts +0 -1
- package/dist/types/utils/ensure-array.d.ts +0 -1
- package/dist/types/utils/index.d.ts +0 -9
- /package/dist/types/plugin/{transfrom-plugin-context.d.ts → transform-plugin-context.d.ts} +0 -0
|
@@ -39,15 +39,15 @@ const LogTypes = {
|
|
|
39
39
|
verbose: {level: LogLevels.verbose}
|
|
40
40
|
};
|
|
41
41
|
function isObject(value) {
|
|
42
|
-
return value !== null && typeof value ===
|
|
42
|
+
return value !== null && typeof value === "object";
|
|
43
43
|
}
|
|
44
|
-
function _defu(baseObject, defaults, namespace =
|
|
44
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
45
45
|
if (!isObject(defaults)) {
|
|
46
46
|
return _defu(baseObject, {}, namespace, merger);
|
|
47
47
|
}
|
|
48
48
|
const object = Object.assign({}, defaults);
|
|
49
49
|
for (const key in baseObject) {
|
|
50
|
-
if (key ===
|
|
50
|
+
if (key === "__proto__" || key === "constructor") {
|
|
51
51
|
continue;
|
|
52
52
|
}
|
|
53
53
|
const value = baseObject[key];
|
|
@@ -60,7 +60,7 @@ function _defu(baseObject, defaults, namespace = '.', merger) {
|
|
|
60
60
|
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
61
61
|
object[key] = [...value, ...object[key]];
|
|
62
62
|
} else if (isObject(value) && isObject(object[key])) {
|
|
63
|
-
object[key] = _defu(value, object[key], (namespace ? `${namespace}.` :
|
|
63
|
+
object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
64
64
|
} else {
|
|
65
65
|
object[key] = value;
|
|
66
66
|
}
|
|
@@ -68,11 +68,11 @@ function _defu(baseObject, defaults, namespace = '.', merger) {
|
|
|
68
68
|
return object;
|
|
69
69
|
}
|
|
70
70
|
function createDefu(merger) {
|
|
71
|
-
return (...arguments_) =>
|
|
71
|
+
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
72
72
|
}
|
|
73
73
|
const defu = createDefu();
|
|
74
74
|
function isPlainObject(obj) {
|
|
75
|
-
return Object.prototype.toString.call(obj) ===
|
|
75
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
76
76
|
}
|
|
77
77
|
function isLogObj(arg) {
|
|
78
78
|
if (!isPlainObject(arg)) {
|
|
@@ -128,7 +128,7 @@ class Consola {
|
|
|
128
128
|
}
|
|
129
129
|
prompt(message, opts) {
|
|
130
130
|
if (!this.options.prompt) {
|
|
131
|
-
throw new Error(
|
|
131
|
+
throw new Error("prompt is not supported!");
|
|
132
132
|
}
|
|
133
133
|
return this.options.prompt(message, opts);
|
|
134
134
|
}
|
|
@@ -152,7 +152,7 @@ class Consola {
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
withTag(tag) {
|
|
155
|
-
return this.withDefaults({tag: this.options.defaults.tag ? this.options.defaults.tag +
|
|
155
|
+
return this.withDefaults({tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag});
|
|
156
156
|
}
|
|
157
157
|
addReporter(reporter) {
|
|
158
158
|
this.options.reporters.push(reporter);
|
|
@@ -183,23 +183,23 @@ class Consola {
|
|
|
183
183
|
}
|
|
184
184
|
wrapConsole() {
|
|
185
185
|
for (const type in this.options.types) {
|
|
186
|
-
if (!console[
|
|
187
|
-
console[
|
|
186
|
+
if (!console["__" + type]) {
|
|
187
|
+
console["__" + type] = console[type];
|
|
188
188
|
}
|
|
189
189
|
console[type] = this[type].raw;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
restoreConsole() {
|
|
193
193
|
for (const type in this.options.types) {
|
|
194
|
-
if (console[
|
|
195
|
-
console[type] = console[
|
|
196
|
-
delete console[
|
|
194
|
+
if (console["__" + type]) {
|
|
195
|
+
console[type] = console["__" + type];
|
|
196
|
+
delete console["__" + type];
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
wrapStd() {
|
|
201
|
-
this._wrapStream(this.options.stdout,
|
|
202
|
-
this._wrapStream(this.options.stderr,
|
|
201
|
+
this._wrapStream(this.options.stdout, "log");
|
|
202
|
+
this._wrapStream(this.options.stderr, "log");
|
|
203
203
|
}
|
|
204
204
|
_wrapStream(stream, type) {
|
|
205
205
|
if (!stream) {
|
|
@@ -209,7 +209,7 @@ class Consola {
|
|
|
209
209
|
stream.__write = stream.write;
|
|
210
210
|
}
|
|
211
211
|
stream.write = (data) => {
|
|
212
|
-
this[type].raw(String(data).trim());
|
|
212
|
+
this[type].raw((String(data)).trim());
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
restoreStd() {
|
|
@@ -238,7 +238,7 @@ class Consola {
|
|
|
238
238
|
mockTypes(mockFn) {
|
|
239
239
|
const _mockFn = mockFn || this.options.mockFn;
|
|
240
240
|
this._mockFn = _mockFn;
|
|
241
|
-
if (typeof _mockFn !==
|
|
241
|
+
if (typeof _mockFn !== "function") {
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
244
|
for (const type in this.options.types) {
|
|
@@ -276,13 +276,13 @@ class Consola {
|
|
|
276
276
|
}
|
|
277
277
|
if (logObj.additional) {
|
|
278
278
|
if (!Array.isArray(logObj.additional)) {
|
|
279
|
-
logObj.additional = logObj.additional.split(
|
|
279
|
+
logObj.additional = logObj.additional.split("\n");
|
|
280
280
|
}
|
|
281
|
-
logObj.args.push(
|
|
281
|
+
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
282
282
|
delete logObj.additional;
|
|
283
283
|
}
|
|
284
|
-
logObj.type = typeof logObj.type ===
|
|
285
|
-
logObj.tag = typeof logObj.tag ===
|
|
284
|
+
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
285
|
+
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
286
286
|
const resolveLog = (newLog = false) => {
|
|
287
287
|
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
288
288
|
if (this._lastLog.object && repeated > 0) {
|
|
@@ -330,7 +330,7 @@ function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
|
330
330
|
if (input === void 0) {
|
|
331
331
|
return defaultLevel;
|
|
332
332
|
}
|
|
333
|
-
if (typeof input ===
|
|
333
|
+
if (typeof input === "number") {
|
|
334
334
|
return input;
|
|
335
335
|
}
|
|
336
336
|
if (types[input] && types[input].level !== void 0) {
|
|
@@ -353,37 +353,37 @@ function createConsola$1(options = {}) {
|
|
|
353
353
|
//#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.06ad8a64.mjs
|
|
354
354
|
function parseStack(stack) {
|
|
355
355
|
const cwd = process.cwd() + sep;
|
|
356
|
-
const lines = stack.split(
|
|
356
|
+
const lines = ((stack.split("\n")).splice(1)).map((l) => ((l.trim()).replace("file://", "")).replace(cwd, ""));
|
|
357
357
|
return lines;
|
|
358
358
|
}
|
|
359
359
|
function writeStream(data, stream) {
|
|
360
360
|
const write = stream.__write || stream.write;
|
|
361
361
|
return write.call(stream, data);
|
|
362
362
|
}
|
|
363
|
-
const bracket = (x) => x ? `[${x}]` :
|
|
363
|
+
const bracket = (x) => x ? `[${x}]` : "";
|
|
364
364
|
class BasicReporter {
|
|
365
365
|
formatStack(stack, opts) {
|
|
366
|
-
return
|
|
366
|
+
return " " + (parseStack(stack)).join("\n ");
|
|
367
367
|
}
|
|
368
368
|
formatArgs(args, opts) {
|
|
369
369
|
const _args = args.map((arg) => {
|
|
370
|
-
if (arg && typeof arg.stack ===
|
|
371
|
-
return arg.message +
|
|
370
|
+
if (arg && typeof arg.stack === "string") {
|
|
371
|
+
return arg.message + "\n" + this.formatStack(arg.stack, opts);
|
|
372
372
|
}
|
|
373
373
|
return arg;
|
|
374
374
|
});
|
|
375
375
|
return formatWithOptions(opts, ..._args);
|
|
376
376
|
}
|
|
377
377
|
formatDate(date, opts) {
|
|
378
|
-
return opts.date ? date.toLocaleTimeString() :
|
|
378
|
+
return opts.date ? date.toLocaleTimeString() : "";
|
|
379
379
|
}
|
|
380
380
|
filterAndJoin(arr) {
|
|
381
|
-
return arr.filter(Boolean).join(
|
|
381
|
+
return (arr.filter(Boolean)).join(" ");
|
|
382
382
|
}
|
|
383
383
|
formatLogObj(logObj, opts) {
|
|
384
384
|
const message = this.formatArgs(logObj.args, opts);
|
|
385
|
-
if (logObj.type ===
|
|
386
|
-
return
|
|
385
|
+
if (logObj.type === "box") {
|
|
386
|
+
return "\n" + (([bracket(logObj.tag), logObj.title && logObj.title, ...message.split("\n")].filter(Boolean)).map((l) => " > " + l)).join("\n") + "\n";
|
|
387
387
|
}
|
|
388
388
|
return this.filterAndJoin([bracket(logObj.type), bracket(logObj.tag), message]);
|
|
389
389
|
}
|
|
@@ -392,19 +392,19 @@ class BasicReporter {
|
|
|
392
392
|
columns: ctx.options.stdout.columns || 0,
|
|
393
393
|
...ctx.options.formatOptions
|
|
394
394
|
});
|
|
395
|
-
return writeStream(line +
|
|
395
|
+
return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
//#endregion
|
|
400
400
|
//#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/utils.mjs
|
|
401
|
-
const { env = {}, argv = [], platform =
|
|
402
|
-
const isDisabled =
|
|
403
|
-
const isForced =
|
|
404
|
-
const isWindows = platform ===
|
|
405
|
-
const isDumbTerminal = env.TERM ===
|
|
401
|
+
const { env: env = {}, argv: argv = [], platform: platform = "" } = typeof process === "undefined" ? {} : process;
|
|
402
|
+
const isDisabled = "NO_COLOR"in env || argv.includes("--no-color");
|
|
403
|
+
const isForced = "FORCE_COLOR"in env || argv.includes("--color");
|
|
404
|
+
const isWindows = platform === "win32";
|
|
405
|
+
const isDumbTerminal = env.TERM === "dumb";
|
|
406
406
|
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
407
|
-
const isCI$1 =
|
|
407
|
+
const isCI$1 = "CI"in env && ("GITHUB_ACTIONS"in env || "GITLAB_CI"in env || "CIRCLECI"in env);
|
|
408
408
|
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI$1);
|
|
409
409
|
function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
|
|
410
410
|
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
@@ -413,15 +413,15 @@ function clearBleed(index, string, open, close, replace) {
|
|
|
413
413
|
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
414
414
|
}
|
|
415
415
|
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
416
|
-
return (string) => string || !(string ===
|
|
416
|
+
return (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
417
417
|
}
|
|
418
418
|
function init(open, close, replace) {
|
|
419
419
|
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
420
420
|
}
|
|
421
421
|
const colorDefs = {
|
|
422
422
|
reset: init(0, 0),
|
|
423
|
-
bold: init(1, 22,
|
|
424
|
-
dim: init(2, 22,
|
|
423
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
424
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
425
425
|
italic: init(3, 23),
|
|
426
426
|
underline: init(4, 24),
|
|
427
427
|
inverse: init(7, 27),
|
|
@@ -462,86 +462,86 @@ const colorDefs = {
|
|
|
462
462
|
bgWhiteBright: init(107, 49)
|
|
463
463
|
};
|
|
464
464
|
function createColors(useColor = isColorSupported) {
|
|
465
|
-
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
465
|
+
return useColor ? colorDefs : Object.fromEntries((Object.keys(colorDefs)).map((key) => [key, String]));
|
|
466
466
|
}
|
|
467
467
|
const colors = createColors();
|
|
468
|
-
function getColor$1(color, fallback =
|
|
468
|
+
function getColor$1(color, fallback = "reset") {
|
|
469
469
|
return colors[color] || colors[fallback];
|
|
470
470
|
}
|
|
471
|
-
const ansiRegex$1 = [
|
|
471
|
+
const ansiRegex$1 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
472
472
|
function stripAnsi$1(text) {
|
|
473
|
-
return text.replace(new RegExp(ansiRegex$1,
|
|
473
|
+
return text.replace(new RegExp(ansiRegex$1, "g"), "");
|
|
474
474
|
}
|
|
475
475
|
const boxStylePresets = {
|
|
476
476
|
solid: {
|
|
477
|
-
tl:
|
|
478
|
-
tr:
|
|
479
|
-
bl:
|
|
480
|
-
br:
|
|
481
|
-
h:
|
|
482
|
-
v:
|
|
477
|
+
tl: "┌",
|
|
478
|
+
tr: "┐",
|
|
479
|
+
bl: "└",
|
|
480
|
+
br: "┘",
|
|
481
|
+
h: "─",
|
|
482
|
+
v: "│"
|
|
483
483
|
},
|
|
484
484
|
double: {
|
|
485
|
-
tl:
|
|
486
|
-
tr:
|
|
487
|
-
bl:
|
|
488
|
-
br:
|
|
489
|
-
h:
|
|
490
|
-
v:
|
|
485
|
+
tl: "╔",
|
|
486
|
+
tr: "╗",
|
|
487
|
+
bl: "╚",
|
|
488
|
+
br: "╝",
|
|
489
|
+
h: "═",
|
|
490
|
+
v: "║"
|
|
491
491
|
},
|
|
492
492
|
doubleSingle: {
|
|
493
|
-
tl:
|
|
494
|
-
tr:
|
|
495
|
-
bl:
|
|
496
|
-
br:
|
|
497
|
-
h:
|
|
498
|
-
v:
|
|
493
|
+
tl: "╓",
|
|
494
|
+
tr: "╖",
|
|
495
|
+
bl: "╙",
|
|
496
|
+
br: "╜",
|
|
497
|
+
h: "─",
|
|
498
|
+
v: "║"
|
|
499
499
|
},
|
|
500
500
|
doubleSingleRounded: {
|
|
501
|
-
tl:
|
|
502
|
-
tr:
|
|
503
|
-
bl:
|
|
504
|
-
br:
|
|
505
|
-
h:
|
|
506
|
-
v:
|
|
501
|
+
tl: "╭",
|
|
502
|
+
tr: "╮",
|
|
503
|
+
bl: "╰",
|
|
504
|
+
br: "╯",
|
|
505
|
+
h: "─",
|
|
506
|
+
v: "║"
|
|
507
507
|
},
|
|
508
508
|
singleThick: {
|
|
509
|
-
tl:
|
|
510
|
-
tr:
|
|
511
|
-
bl:
|
|
512
|
-
br:
|
|
513
|
-
h:
|
|
514
|
-
v:
|
|
509
|
+
tl: "┏",
|
|
510
|
+
tr: "┓",
|
|
511
|
+
bl: "┗",
|
|
512
|
+
br: "┛",
|
|
513
|
+
h: "━",
|
|
514
|
+
v: "┃"
|
|
515
515
|
},
|
|
516
516
|
singleDouble: {
|
|
517
|
-
tl:
|
|
518
|
-
tr:
|
|
519
|
-
bl:
|
|
520
|
-
br:
|
|
521
|
-
h:
|
|
522
|
-
v:
|
|
517
|
+
tl: "╒",
|
|
518
|
+
tr: "╕",
|
|
519
|
+
bl: "╘",
|
|
520
|
+
br: "╛",
|
|
521
|
+
h: "═",
|
|
522
|
+
v: "│"
|
|
523
523
|
},
|
|
524
524
|
singleDoubleRounded: {
|
|
525
|
-
tl:
|
|
526
|
-
tr:
|
|
527
|
-
bl:
|
|
528
|
-
br:
|
|
529
|
-
h:
|
|
530
|
-
v:
|
|
525
|
+
tl: "╭",
|
|
526
|
+
tr: "╮",
|
|
527
|
+
bl: "╰",
|
|
528
|
+
br: "╯",
|
|
529
|
+
h: "═",
|
|
530
|
+
v: "│"
|
|
531
531
|
},
|
|
532
532
|
rounded: {
|
|
533
|
-
tl:
|
|
534
|
-
tr:
|
|
535
|
-
bl:
|
|
536
|
-
br:
|
|
537
|
-
h:
|
|
538
|
-
v:
|
|
533
|
+
tl: "╭",
|
|
534
|
+
tr: "╮",
|
|
535
|
+
bl: "╰",
|
|
536
|
+
br: "╯",
|
|
537
|
+
h: "─",
|
|
538
|
+
v: "│"
|
|
539
539
|
}
|
|
540
540
|
};
|
|
541
541
|
const defaultStyle = {
|
|
542
|
-
borderColor:
|
|
543
|
-
borderStyle:
|
|
544
|
-
valign:
|
|
542
|
+
borderColor: "white",
|
|
543
|
+
borderStyle: "rounded",
|
|
544
|
+
valign: "center",
|
|
545
545
|
padding: 2,
|
|
546
546
|
marginLeft: 1,
|
|
547
547
|
marginTop: 1,
|
|
@@ -555,10 +555,10 @@ function box(text, _opts = {}) {
|
|
|
555
555
|
..._opts.style
|
|
556
556
|
}
|
|
557
557
|
};
|
|
558
|
-
const textLines = text.split(
|
|
558
|
+
const textLines = text.split("\n");
|
|
559
559
|
const boxLines = [];
|
|
560
560
|
const _color = getColor$1(opts.style.borderColor);
|
|
561
|
-
const borderStyle = {...typeof opts.style.borderStyle ===
|
|
561
|
+
const borderStyle = {...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle};
|
|
562
562
|
if (_color) {
|
|
563
563
|
for (const key in borderStyle) {
|
|
564
564
|
borderStyle[key] = _color(borderStyle[key]);
|
|
@@ -568,38 +568,38 @@ function box(text, _opts = {}) {
|
|
|
568
568
|
const height = textLines.length + paddingOffset;
|
|
569
569
|
const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
|
|
570
570
|
const widthOffset = width + paddingOffset;
|
|
571
|
-
const leftSpace = opts.style.marginLeft > 0 ?
|
|
571
|
+
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
572
572
|
if (opts.style.marginTop > 0) {
|
|
573
|
-
boxLines.push(
|
|
573
|
+
boxLines.push("".repeat(opts.style.marginTop));
|
|
574
574
|
}
|
|
575
575
|
if (opts.title) {
|
|
576
|
-
const left = borderStyle.h.repeat(Math.floor((width - stripAnsi$1(opts.title).length) / 2));
|
|
577
|
-
const right = borderStyle.h.repeat(width - stripAnsi$1(opts.title).length - stripAnsi$1(left).length + paddingOffset);
|
|
576
|
+
const left = borderStyle.h.repeat(Math.floor((width - (stripAnsi$1(opts.title)).length) / 2));
|
|
577
|
+
const right = borderStyle.h.repeat(width - (stripAnsi$1(opts.title)).length - (stripAnsi$1(left)).length + paddingOffset);
|
|
578
578
|
boxLines.push(`${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`);
|
|
579
579
|
} else {
|
|
580
580
|
boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
|
|
581
581
|
}
|
|
582
|
-
const valignOffset = opts.style.valign ===
|
|
582
|
+
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
583
583
|
for (let i = 0; i < height; i++) {
|
|
584
584
|
if (i < valignOffset || i >= valignOffset + textLines.length) {
|
|
585
|
-
boxLines.push(`${leftSpace}${borderStyle.v}${
|
|
585
|
+
boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
|
|
586
586
|
} else {
|
|
587
587
|
const line = textLines[i - valignOffset];
|
|
588
|
-
const left =
|
|
589
|
-
const right =
|
|
588
|
+
const left = " ".repeat(paddingOffset);
|
|
589
|
+
const right = " ".repeat(width - (stripAnsi$1(line)).length);
|
|
590
590
|
boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
593
|
boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
|
|
594
594
|
if (opts.style.marginBottom > 0) {
|
|
595
|
-
boxLines.push(
|
|
595
|
+
boxLines.push("".repeat(opts.style.marginBottom));
|
|
596
596
|
}
|
|
597
|
-
return boxLines.join(
|
|
597
|
+
return boxLines.join("\n");
|
|
598
598
|
}
|
|
599
599
|
|
|
600
600
|
//#endregion
|
|
601
601
|
//#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.36c0034f.mjs
|
|
602
|
-
const providers = [[
|
|
602
|
+
const providers = [["APPVEYOR"], ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"], ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"], ["APPCIRCLE", "AC_APPCIRCLE"], ["BAMBOO", "bamboo_planKey"], ["BITBUCKET", "BITBUCKET_COMMIT"], ["BITRISE", "BITRISE_IO"], ["BUDDY", "BUDDY_WORKSPACE_ID"], ["BUILDKITE"], ["CIRCLE", "CIRCLECI"], ["CIRRUS", "CIRRUS_CI"], ["CLOUDFLARE_PAGES", "CF_PAGES", {ci: true}], ["CODEBUILD", "CODEBUILD_BUILD_ARN"], ["CODEFRESH", "CF_BUILD_ID"], ["DRONE"], ["DRONE", "DRONE_BUILD_EVENT"], ["DSARI"], ["GITHUB_ACTIONS"], ["GITLAB", "GITLAB_CI"], ["GITLAB", "CI_MERGE_REQUEST_ID"], ["GOCD", "GO_PIPELINE_LABEL"], ["LAYERCI"], ["HUDSON", "HUDSON_URL"], ["JENKINS", "JENKINS_URL"], ["MAGNUM"], ["NETLIFY"], ["NETLIFY", "NETLIFY_LOCAL", {ci: false}], ["NEVERCODE"], ["RENDER"], ["SAIL", "SAILCI"], ["SEMAPHORE"], ["SCREWDRIVER"], ["SHIPPABLE"], ["SOLANO", "TDDIUM"], ["STRIDER"], ["TEAMCITY", "TEAMCITY_VERSION"], ["TRAVIS"], ["VERCEL", "NOW_BUILDER"], ["APPCENTER", "APPCENTER_BUILD_ID"], ["CODESANDBOX", "CODESANDBOX_SSE", {ci: false}], ["STACKBLITZ"], ["STORMKIT"], ["CLEAVR"]];
|
|
603
603
|
function detectProvider(env$1) {
|
|
604
604
|
for (const provider of providers) {
|
|
605
605
|
const envName = provider[1] || provider[0];
|
|
@@ -610,44 +610,44 @@ function detectProvider(env$1) {
|
|
|
610
610
|
};
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
if (env$1.SHELL && env$1.SHELL ===
|
|
613
|
+
if (env$1.SHELL && env$1.SHELL === "/bin/jsh") {
|
|
614
614
|
return {
|
|
615
|
-
name:
|
|
615
|
+
name: "stackblitz",
|
|
616
616
|
ci: false
|
|
617
617
|
};
|
|
618
618
|
}
|
|
619
619
|
return {
|
|
620
|
-
name:
|
|
620
|
+
name: "",
|
|
621
621
|
ci: false
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
|
-
const processShim = typeof process !==
|
|
624
|
+
const processShim = typeof process !== "undefined" ? process : {};
|
|
625
625
|
const envShim = processShim.env || {};
|
|
626
626
|
const providerInfo = detectProvider(envShim);
|
|
627
|
-
const nodeENV = typeof process !==
|
|
627
|
+
const nodeENV = typeof process !== "undefined" && process.env && process.env.NODE_ENV || "";
|
|
628
628
|
processShim.platform;
|
|
629
629
|
providerInfo.name;
|
|
630
630
|
const isCI = toBoolean(envShim.CI) || providerInfo.ci !== false;
|
|
631
631
|
const hasTTY = toBoolean(processShim.stdout && processShim.stdout.isTTY);
|
|
632
632
|
const isDebug = toBoolean(envShim.DEBUG);
|
|
633
|
-
const isTest = nodeENV ===
|
|
633
|
+
const isTest = nodeENV === "test" || toBoolean(envShim.TEST);
|
|
634
634
|
toBoolean(envShim.MINIMAL) || isCI || isTest || !hasTTY;
|
|
635
635
|
function toBoolean(val) {
|
|
636
|
-
return val ? val !==
|
|
636
|
+
return val ? val !== "false" : false;
|
|
637
637
|
}
|
|
638
|
-
function ansiRegex({ onlyFirst = false } = {}) {
|
|
639
|
-
const pattern = [
|
|
640
|
-
return new RegExp(pattern, onlyFirst ? undefined :
|
|
638
|
+
function ansiRegex({ onlyFirst: onlyFirst = false } = {}) {
|
|
639
|
+
const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
|
|
640
|
+
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
641
641
|
}
|
|
642
642
|
const regex = ansiRegex();
|
|
643
643
|
function stripAnsi(string) {
|
|
644
|
-
if (typeof string !==
|
|
644
|
+
if (typeof string !== "string") {
|
|
645
645
|
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
646
646
|
}
|
|
647
|
-
return string.replace(regex,
|
|
647
|
+
return string.replace(regex, "");
|
|
648
648
|
}
|
|
649
649
|
function getDefaultExportFromCjs(x) {
|
|
650
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x,
|
|
650
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
651
651
|
}
|
|
652
652
|
var eastasianwidth = {exports: {}};
|
|
653
653
|
(function(module) {
|
|
@@ -657,34 +657,34 @@ var eastasianwidth = {exports: {}};
|
|
|
657
657
|
}
|
|
658
658
|
eaw.eastAsianWidth = function(character) {
|
|
659
659
|
var x = character.charCodeAt(0);
|
|
660
|
-
var y =
|
|
660
|
+
var y = character.length == 2 ? character.charCodeAt(1) : 0;
|
|
661
661
|
var codePoint = x;
|
|
662
|
-
if (
|
|
662
|
+
if (0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF) {
|
|
663
663
|
x &= 0x3FF;
|
|
664
664
|
y &= 0x3FF;
|
|
665
|
-
codePoint =
|
|
665
|
+
codePoint = x << 10 | y;
|
|
666
666
|
codePoint += 0x10000;
|
|
667
667
|
}
|
|
668
|
-
if (
|
|
669
|
-
return
|
|
668
|
+
if (0x3000 == codePoint || 0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6) {
|
|
669
|
+
return "F";
|
|
670
670
|
}
|
|
671
|
-
if (
|
|
672
|
-
return
|
|
671
|
+
if (0x20A9 == codePoint || 0xFF61 <= codePoint && codePoint <= 0xFFBE || 0xFFC2 <= codePoint && codePoint <= 0xFFC7 || 0xFFCA <= codePoint && codePoint <= 0xFFCF || 0xFFD2 <= codePoint && codePoint <= 0xFFD7 || 0xFFDA <= codePoint && codePoint <= 0xFFDC || 0xFFE8 <= codePoint && codePoint <= 0xFFEE) {
|
|
672
|
+
return "H";
|
|
673
673
|
}
|
|
674
|
-
if (
|
|
675
|
-
return
|
|
674
|
+
if (0x1100 <= codePoint && codePoint <= 0x115F || 0x11A3 <= codePoint && codePoint <= 0x11A7 || 0x11FA <= codePoint && codePoint <= 0x11FF || 0x2329 <= codePoint && codePoint <= 0x232A || 0x2E80 <= codePoint && codePoint <= 0x2E99 || 0x2E9B <= codePoint && codePoint <= 0x2EF3 || 0x2F00 <= codePoint && codePoint <= 0x2FD5 || 0x2FF0 <= codePoint && codePoint <= 0x2FFB || 0x3001 <= codePoint && codePoint <= 0x303E || 0x3041 <= codePoint && codePoint <= 0x3096 || 0x3099 <= codePoint && codePoint <= 0x30FF || 0x3105 <= codePoint && codePoint <= 0x312D || 0x3131 <= codePoint && codePoint <= 0x318E || 0x3190 <= codePoint && codePoint <= 0x31BA || 0x31C0 <= codePoint && codePoint <= 0x31E3 || 0x31F0 <= codePoint && codePoint <= 0x321E || 0x3220 <= codePoint && codePoint <= 0x3247 || 0x3250 <= codePoint && codePoint <= 0x32FE || 0x3300 <= codePoint && codePoint <= 0x4DBF || 0x4E00 <= codePoint && codePoint <= 0xA48C || 0xA490 <= codePoint && codePoint <= 0xA4C6 || 0xA960 <= codePoint && codePoint <= 0xA97C || 0xAC00 <= codePoint && codePoint <= 0xD7A3 || 0xD7B0 <= codePoint && codePoint <= 0xD7C6 || 0xD7CB <= codePoint && codePoint <= 0xD7FB || 0xF900 <= codePoint && codePoint <= 0xFAFF || 0xFE10 <= codePoint && codePoint <= 0xFE19 || 0xFE30 <= codePoint && codePoint <= 0xFE52 || 0xFE54 <= codePoint && codePoint <= 0xFE66 || 0xFE68 <= codePoint && codePoint <= 0xFE6B || 0x1B000 <= codePoint && codePoint <= 0x1B001 || 0x1F200 <= codePoint && codePoint <= 0x1F202 || 0x1F210 <= codePoint && codePoint <= 0x1F23A || 0x1F240 <= codePoint && codePoint <= 0x1F248 || 0x1F250 <= codePoint && codePoint <= 0x1F251 || 0x20000 <= codePoint && codePoint <= 0x2F73F || 0x2B740 <= codePoint && codePoint <= 0x2FFFD || 0x30000 <= codePoint && codePoint <= 0x3FFFD) {
|
|
675
|
+
return "W";
|
|
676
676
|
}
|
|
677
|
-
if (
|
|
678
|
-
return
|
|
677
|
+
if (0x0020 <= codePoint && codePoint <= 0x007E || 0x00A2 <= codePoint && codePoint <= 0x00A3 || 0x00A5 <= codePoint && codePoint <= 0x00A6 || 0x00AC == codePoint || 0x00AF == codePoint || 0x27E6 <= codePoint && codePoint <= 0x27ED || 0x2985 <= codePoint && codePoint <= 0x2986) {
|
|
678
|
+
return "Na";
|
|
679
679
|
}
|
|
680
|
-
if (
|
|
681
|
-
return
|
|
680
|
+
if (0x00A1 == codePoint || 0x00A4 == codePoint || 0x00A7 <= codePoint && codePoint <= 0x00A8 || 0x00AA == codePoint || 0x00AD <= codePoint && codePoint <= 0x00AE || 0x00B0 <= codePoint && codePoint <= 0x00B4 || 0x00B6 <= codePoint && codePoint <= 0x00BA || 0x00BC <= codePoint && codePoint <= 0x00BF || 0x00C6 == codePoint || 0x00D0 == codePoint || 0x00D7 <= codePoint && codePoint <= 0x00D8 || 0x00DE <= codePoint && codePoint <= 0x00E1 || 0x00E6 == codePoint || 0x00E8 <= codePoint && codePoint <= 0x00EA || 0x00EC <= codePoint && codePoint <= 0x00ED || 0x00F0 == codePoint || 0x00F2 <= codePoint && codePoint <= 0x00F3 || 0x00F7 <= codePoint && codePoint <= 0x00FA || 0x00FC == codePoint || 0x00FE == codePoint || 0x0101 == codePoint || 0x0111 == codePoint || 0x0113 == codePoint || 0x011B == codePoint || 0x0126 <= codePoint && codePoint <= 0x0127 || 0x012B == codePoint || 0x0131 <= codePoint && codePoint <= 0x0133 || 0x0138 == codePoint || 0x013F <= codePoint && codePoint <= 0x0142 || 0x0144 == codePoint || 0x0148 <= codePoint && codePoint <= 0x014B || 0x014D == codePoint || 0x0152 <= codePoint && codePoint <= 0x0153 || 0x0166 <= codePoint && codePoint <= 0x0167 || 0x016B == codePoint || 0x01CE == codePoint || 0x01D0 == codePoint || 0x01D2 == codePoint || 0x01D4 == codePoint || 0x01D6 == codePoint || 0x01D8 == codePoint || 0x01DA == codePoint || 0x01DC == codePoint || 0x0251 == codePoint || 0x0261 == codePoint || 0x02C4 == codePoint || 0x02C7 == codePoint || 0x02C9 <= codePoint && codePoint <= 0x02CB || 0x02CD == codePoint || 0x02D0 == codePoint || 0x02D8 <= codePoint && codePoint <= 0x02DB || 0x02DD == codePoint || 0x02DF == codePoint || 0x0300 <= codePoint && codePoint <= 0x036F || 0x0391 <= codePoint && codePoint <= 0x03A1 || 0x03A3 <= codePoint && codePoint <= 0x03A9 || 0x03B1 <= codePoint && codePoint <= 0x03C1 || 0x03C3 <= codePoint && codePoint <= 0x03C9 || 0x0401 == codePoint || 0x0410 <= codePoint && codePoint <= 0x044F || 0x0451 == codePoint || 0x2010 == codePoint || 0x2013 <= codePoint && codePoint <= 0x2016 || 0x2018 <= codePoint && codePoint <= 0x2019 || 0x201C <= codePoint && codePoint <= 0x201D || 0x2020 <= codePoint && codePoint <= 0x2022 || 0x2024 <= codePoint && codePoint <= 0x2027 || 0x2030 == codePoint || 0x2032 <= codePoint && codePoint <= 0x2033 || 0x2035 == codePoint || 0x203B == codePoint || 0x203E == codePoint || 0x2074 == codePoint || 0x207F == codePoint || 0x2081 <= codePoint && codePoint <= 0x2084 || 0x20AC == codePoint || 0x2103 == codePoint || 0x2105 == codePoint || 0x2109 == codePoint || 0x2113 == codePoint || 0x2116 == codePoint || 0x2121 <= codePoint && codePoint <= 0x2122 || 0x2126 == codePoint || 0x212B == codePoint || 0x2153 <= codePoint && codePoint <= 0x2154 || 0x215B <= codePoint && codePoint <= 0x215E || 0x2160 <= codePoint && codePoint <= 0x216B || 0x2170 <= codePoint && codePoint <= 0x2179 || 0x2189 == codePoint || 0x2190 <= codePoint && codePoint <= 0x2199 || 0x21B8 <= codePoint && codePoint <= 0x21B9 || 0x21D2 == codePoint || 0x21D4 == codePoint || 0x21E7 == codePoint || 0x2200 == codePoint || 0x2202 <= codePoint && codePoint <= 0x2203 || 0x2207 <= codePoint && codePoint <= 0x2208 || 0x220B == codePoint || 0x220F == codePoint || 0x2211 == codePoint || 0x2215 == codePoint || 0x221A == codePoint || 0x221D <= codePoint && codePoint <= 0x2220 || 0x2223 == codePoint || 0x2225 == codePoint || 0x2227 <= codePoint && codePoint <= 0x222C || 0x222E == codePoint || 0x2234 <= codePoint && codePoint <= 0x2237 || 0x223C <= codePoint && codePoint <= 0x223D || 0x2248 == codePoint || 0x224C == codePoint || 0x2252 == codePoint || 0x2260 <= codePoint && codePoint <= 0x2261 || 0x2264 <= codePoint && codePoint <= 0x2267 || 0x226A <= codePoint && codePoint <= 0x226B || 0x226E <= codePoint && codePoint <= 0x226F || 0x2282 <= codePoint && codePoint <= 0x2283 || 0x2286 <= codePoint && codePoint <= 0x2287 || 0x2295 == codePoint || 0x2299 == codePoint || 0x22A5 == codePoint || 0x22BF == codePoint || 0x2312 == codePoint || 0x2460 <= codePoint && codePoint <= 0x24E9 || 0x24EB <= codePoint && codePoint <= 0x254B || 0x2550 <= codePoint && codePoint <= 0x2573 || 0x2580 <= codePoint && codePoint <= 0x258F || 0x2592 <= codePoint && codePoint <= 0x2595 || 0x25A0 <= codePoint && codePoint <= 0x25A1 || 0x25A3 <= codePoint && codePoint <= 0x25A9 || 0x25B2 <= codePoint && codePoint <= 0x25B3 || 0x25B6 <= codePoint && codePoint <= 0x25B7 || 0x25BC <= codePoint && codePoint <= 0x25BD || 0x25C0 <= codePoint && codePoint <= 0x25C1 || 0x25C6 <= codePoint && codePoint <= 0x25C8 || 0x25CB == codePoint || 0x25CE <= codePoint && codePoint <= 0x25D1 || 0x25E2 <= codePoint && codePoint <= 0x25E5 || 0x25EF == codePoint || 0x2605 <= codePoint && codePoint <= 0x2606 || 0x2609 == codePoint || 0x260E <= codePoint && codePoint <= 0x260F || 0x2614 <= codePoint && codePoint <= 0x2615 || 0x261C == codePoint || 0x261E == codePoint || 0x2640 == codePoint || 0x2642 == codePoint || 0x2660 <= codePoint && codePoint <= 0x2661 || 0x2663 <= codePoint && codePoint <= 0x2665 || 0x2667 <= codePoint && codePoint <= 0x266A || 0x266C <= codePoint && codePoint <= 0x266D || 0x266F == codePoint || 0x269E <= codePoint && codePoint <= 0x269F || 0x26BE <= codePoint && codePoint <= 0x26BF || 0x26C4 <= codePoint && codePoint <= 0x26CD || 0x26CF <= codePoint && codePoint <= 0x26E1 || 0x26E3 == codePoint || 0x26E8 <= codePoint && codePoint <= 0x26FF || 0x273D == codePoint || 0x2757 == codePoint || 0x2776 <= codePoint && codePoint <= 0x277F || 0x2B55 <= codePoint && codePoint <= 0x2B59 || 0x3248 <= codePoint && codePoint <= 0x324F || 0xE000 <= codePoint && codePoint <= 0xF8FF || 0xFE00 <= codePoint && codePoint <= 0xFE0F || 0xFFFD == codePoint || 0x1F100 <= codePoint && codePoint <= 0x1F10A || 0x1F110 <= codePoint && codePoint <= 0x1F12D || 0x1F130 <= codePoint && codePoint <= 0x1F169 || 0x1F170 <= codePoint && codePoint <= 0x1F19A || 0xE0100 <= codePoint && codePoint <= 0xE01EF || 0xF0000 <= codePoint && codePoint <= 0xFFFFD || 0x100000 <= codePoint && codePoint <= 0x10FFFD) {
|
|
681
|
+
return "A";
|
|
682
682
|
}
|
|
683
|
-
return
|
|
683
|
+
return "N";
|
|
684
684
|
};
|
|
685
685
|
eaw.characterLength = function(character) {
|
|
686
686
|
var code = this.eastAsianWidth(character);
|
|
687
|
-
if (code ==
|
|
687
|
+
if (code == "F" || code == "W" || code == "A") {
|
|
688
688
|
return 2;
|
|
689
689
|
} else {
|
|
690
690
|
return 1;
|
|
@@ -711,7 +711,7 @@ var eastasianwidth = {exports: {}};
|
|
|
711
711
|
if (end < 0) {
|
|
712
712
|
end = textLen + end;
|
|
713
713
|
}
|
|
714
|
-
var result =
|
|
714
|
+
var result = "";
|
|
715
715
|
var eawLen = 0;
|
|
716
716
|
var chars = stringToArray(text);
|
|
717
717
|
for (var i = 0; i < chars.length; i++) {
|
|
@@ -728,14 +728,14 @@ var eastasianwidth = {exports: {}};
|
|
|
728
728
|
}
|
|
729
729
|
return result;
|
|
730
730
|
};
|
|
731
|
-
}(eastasianwidth)
|
|
731
|
+
})(eastasianwidth);
|
|
732
732
|
var eastasianwidthExports = eastasianwidth.exports;
|
|
733
733
|
const eastAsianWidth = /*@__PURE__*/ getDefaultExportFromCjs(eastasianwidthExports);
|
|
734
734
|
const emojiRegex = () => {
|
|
735
735
|
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
736
736
|
};
|
|
737
737
|
function stringWidth$1(string, options) {
|
|
738
|
-
if (typeof string !==
|
|
738
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
739
739
|
return 0;
|
|
740
740
|
}
|
|
741
741
|
options = {
|
|
@@ -751,26 +751,26 @@ function stringWidth$1(string, options) {
|
|
|
751
751
|
}
|
|
752
752
|
const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
|
|
753
753
|
let width = 0;
|
|
754
|
-
for (const { segment: character } of new Intl.Segmenter().segment(string)) {
|
|
754
|
+
for (const { segment: character } of (new Intl.Segmenter()).segment(string)) {
|
|
755
755
|
const codePoint = character.codePointAt(0);
|
|
756
|
-
if (codePoint <= 0x1F ||
|
|
756
|
+
if (codePoint <= 0x1F || codePoint >= 0x7F && codePoint <= 0x9F) {
|
|
757
757
|
continue;
|
|
758
758
|
}
|
|
759
759
|
if (codePoint >= 0x3_00 && codePoint <= 0x3_6F) {
|
|
760
760
|
continue;
|
|
761
761
|
}
|
|
762
|
-
if (emojiRegex().test(character)) {
|
|
762
|
+
if ((emojiRegex()).test(character)) {
|
|
763
763
|
width += 2;
|
|
764
764
|
continue;
|
|
765
765
|
}
|
|
766
766
|
const code = eastAsianWidth.eastAsianWidth(character);
|
|
767
767
|
switch (code) {
|
|
768
|
-
case
|
|
769
|
-
case
|
|
768
|
+
case "F":
|
|
769
|
+
case "W": {
|
|
770
770
|
width += 2;
|
|
771
771
|
break;
|
|
772
772
|
}
|
|
773
|
-
case
|
|
773
|
+
case "A": {
|
|
774
774
|
width += ambiguousCharacterWidth;
|
|
775
775
|
break;
|
|
776
776
|
}
|
|
@@ -782,59 +782,59 @@ function stringWidth$1(string, options) {
|
|
|
782
782
|
return width;
|
|
783
783
|
}
|
|
784
784
|
function isUnicodeSupported() {
|
|
785
|
-
if (process$1.platform !==
|
|
786
|
-
return process$1.env.TERM !==
|
|
785
|
+
if (process$1.platform !== "win32") {
|
|
786
|
+
return process$1.env.TERM !== "linux";
|
|
787
787
|
}
|
|
788
|
-
return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask ===
|
|
788
|
+
return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
789
789
|
}
|
|
790
790
|
const TYPE_COLOR_MAP = {
|
|
791
|
-
info:
|
|
792
|
-
fail:
|
|
793
|
-
success:
|
|
794
|
-
ready:
|
|
795
|
-
start:
|
|
791
|
+
info: "cyan",
|
|
792
|
+
fail: "red",
|
|
793
|
+
success: "green",
|
|
794
|
+
ready: "green",
|
|
795
|
+
start: "magenta"
|
|
796
796
|
};
|
|
797
797
|
const LEVEL_COLOR_MAP = {
|
|
798
|
-
0:
|
|
799
|
-
1:
|
|
798
|
+
0: "red",
|
|
799
|
+
1: "yellow"
|
|
800
800
|
};
|
|
801
801
|
const unicode = isUnicodeSupported();
|
|
802
802
|
const s = (c, fallback) => unicode ? c : fallback;
|
|
803
803
|
const TYPE_ICONS = {
|
|
804
|
-
error: s(
|
|
805
|
-
fatal: s(
|
|
806
|
-
ready: s(
|
|
807
|
-
warn: s(
|
|
808
|
-
info: s(
|
|
809
|
-
success: s(
|
|
810
|
-
debug: s(
|
|
811
|
-
trace: s(
|
|
812
|
-
fail: s(
|
|
813
|
-
start: s(
|
|
814
|
-
log:
|
|
804
|
+
error: s("✖", "×"),
|
|
805
|
+
fatal: s("✖", "×"),
|
|
806
|
+
ready: s("✔", "√"),
|
|
807
|
+
warn: s("⚠", "‼"),
|
|
808
|
+
info: s("ℹ", "i"),
|
|
809
|
+
success: s("✔", "√"),
|
|
810
|
+
debug: s("⚙", "D"),
|
|
811
|
+
trace: s("→", "→"),
|
|
812
|
+
fail: s("✖", "×"),
|
|
813
|
+
start: s("◐", "o"),
|
|
814
|
+
log: ""
|
|
815
815
|
};
|
|
816
816
|
function stringWidth(str) {
|
|
817
817
|
if (!Intl.Segmenter) {
|
|
818
|
-
return stripAnsi$1(str).length;
|
|
818
|
+
return (stripAnsi$1(str)).length;
|
|
819
819
|
}
|
|
820
820
|
return stringWidth$1(str);
|
|
821
821
|
}
|
|
822
822
|
class FancyReporter extends BasicReporter {
|
|
823
823
|
formatStack(stack) {
|
|
824
|
-
return
|
|
824
|
+
return "\n" + ((parseStack(stack)).map((line) => " " + (line.replace(/^at +/, (m) => colors.gray(m))).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`))).join("\n");
|
|
825
825
|
}
|
|
826
826
|
formatType(logObj, isBadge, opts) {
|
|
827
|
-
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] ||
|
|
827
|
+
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
828
828
|
if (isBadge) {
|
|
829
829
|
return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
|
|
830
830
|
}
|
|
831
|
-
const _type = typeof TYPE_ICONS[logObj.type] ===
|
|
832
|
-
return _type ? getColor(typeColor)(_type) :
|
|
831
|
+
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
832
|
+
return _type ? getColor(typeColor)(_type) : "";
|
|
833
833
|
}
|
|
834
834
|
formatLogObj(logObj, opts) {
|
|
835
|
-
const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
|
|
836
|
-
if (logObj.type ===
|
|
837
|
-
return box(characterFormat(message + (additional.length > 0 ?
|
|
835
|
+
const [message, ...additional] = (this.formatArgs(logObj.args, opts)).split("\n");
|
|
836
|
+
if (logObj.type === "box") {
|
|
837
|
+
return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
|
|
838
838
|
title: logObj.title ? characterFormat(logObj.title) : void 0,
|
|
839
839
|
style: logObj.style
|
|
840
840
|
});
|
|
@@ -843,27 +843,27 @@ class FancyReporter extends BasicReporter {
|
|
|
843
843
|
const coloredDate = date && colors.gray(date);
|
|
844
844
|
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
845
845
|
const type = this.formatType(logObj, isBadge, opts);
|
|
846
|
-
const tag = logObj.tag ? colors.gray(logObj.tag) :
|
|
846
|
+
const tag = logObj.tag ? colors.gray(logObj.tag) : "";
|
|
847
847
|
let line;
|
|
848
848
|
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
849
849
|
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
850
850
|
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
851
|
-
line = space > 0 && (opts.columns || 0) >= 80 ? left +
|
|
852
|
-
line += characterFormat(additional.length > 0 ?
|
|
853
|
-
if (logObj.type ===
|
|
854
|
-
const _err = new Error(
|
|
855
|
-
line += this.formatStack(_err.stack ||
|
|
851
|
+
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
|
|
852
|
+
line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
|
|
853
|
+
if (logObj.type === "trace") {
|
|
854
|
+
const _err = new Error("Trace: " + logObj.message);
|
|
855
|
+
line += this.formatStack(_err.stack || "");
|
|
856
856
|
}
|
|
857
|
-
return isBadge ?
|
|
857
|
+
return isBadge ? "\n" + line + "\n" : line;
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
function characterFormat(str) {
|
|
861
|
-
return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
|
|
861
|
+
return (str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m))).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
|
|
862
862
|
}
|
|
863
|
-
function getColor(color =
|
|
863
|
+
function getColor(color = "white") {
|
|
864
864
|
return colors[color] || colors.white;
|
|
865
865
|
}
|
|
866
|
-
function getBgColor(color =
|
|
866
|
+
function getBgColor(color = "bgWhite") {
|
|
867
867
|
return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
|
|
868
868
|
}
|
|
869
869
|
function createConsola(options = {}) {
|
|
@@ -876,7 +876,7 @@ function createConsola(options = {}) {
|
|
|
876
876
|
defaults: {level},
|
|
877
877
|
stdout: process.stdout,
|
|
878
878
|
stderr: process.stderr,
|
|
879
|
-
prompt: (...args) => import(
|
|
879
|
+
prompt: (...args) => (import("./prompt-9VjtYvi_.mjs")).then((m) => m.prompt(...args)),
|
|
880
880
|
reporters: options.reporters || [options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()],
|
|
881
881
|
...options
|
|
882
882
|
});
|
|
@@ -894,4 +894,4 @@ function _getDefaultLogLevel() {
|
|
|
894
894
|
const consola = createConsola();
|
|
895
895
|
|
|
896
896
|
//#endregion
|
|
897
|
-
export { colors,
|
|
897
|
+
export { colors, createConsola, getDefaultExportFromCjs, isUnicodeSupported };
|