rolldown 1.0.0-beta.35 → 1.0.0-beta.37
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.mjs +95 -1068
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.d.mts +43 -5
- package/dist/experimental-index.mjs +31 -8
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.mjs +3 -4
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/shared/{binding-9k0egz6L.d.mts → binding-Cjs27cfu.d.mts} +1 -0
- package/dist/shared/{define-config-DhrkZ_o7.d.cts → define-config-CV3aiNwN.d.mts} +9 -9
- package/dist/shared/{load-config-C93_L4MP.mjs → load-config-BOVuTpJm.mjs} +4 -6
- package/dist/{cli.cjs → shared/logger-CiCY7ucm.mjs} +44 -829
- package/dist/shared/parse-ast-index-B5HcAOhq.mjs +10847 -0
- package/dist/shared/{prompt-C5jz26Zn.mjs → prompt-D2FxOcB5.mjs} +4 -7
- package/dist/shared/{src-D954P1TH.mjs → src-BtNlw_84.mjs} +88 -69
- package/package.json +32 -46
- package/dist/cli.d.cts +0 -1
- package/dist/config.cjs +0 -12
- package/dist/config.d.cts +0 -10
- package/dist/experimental-index.cjs +0 -154
- package/dist/experimental-index.d.cts +0 -99
- package/dist/filter-index.cjs +0 -106
- package/dist/filter-index.d.cts +0 -4
- package/dist/index.cjs +0 -9
- package/dist/index.d.cts +0 -3
- package/dist/parallel-plugin-worker.cjs +0 -33
- package/dist/parallel-plugin-worker.d.cts +0 -1
- package/dist/parallel-plugin.cjs +0 -8
- package/dist/parallel-plugin.d.cts +0 -14
- package/dist/parse-ast-index.cjs +0 -4
- package/dist/parse-ast-index.d.cts +0 -8
- package/dist/shared/binding-D13M6Llu.d.cts +0 -1425
- package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
- package/dist/shared/define-config-3arq8OPE.d.mts +0 -1421
- package/dist/shared/load-config-S_ofSLrj.cjs +0 -130
- package/dist/shared/misc-DksvspN4.cjs +0 -58
- package/dist/shared/parse-ast-index-BadydpMA.mjs +0 -725
- package/dist/shared/parse-ast-index-cePJvlvW.cjs +0 -871
- package/dist/shared/prompt-Q05EYrFb.cjs +0 -858
- package/dist/shared/src-BBMxhaqf.cjs +0 -4673
package/dist/cli.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { __commonJS, __toESM } from "./shared/parse-ast-index-
|
|
2
|
-
import { description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "./shared/src-
|
|
1
|
+
import { __commonJS, __toESM } from "./shared/parse-ast-index-B5HcAOhq.mjs";
|
|
2
|
+
import { description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "./shared/src-BtNlw_84.mjs";
|
|
3
3
|
import { arraify } from "./shared/misc-CQeo-AFx.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { logger } from "./shared/logger-CiCY7ucm.mjs";
|
|
5
|
+
import { loadConfig } from "./shared/load-config-BOVuTpJm.mjs";
|
|
6
|
+
import path from "node:path";
|
|
6
7
|
import colors from "ansis";
|
|
8
|
+
import { parseArgs } from "node:util";
|
|
7
9
|
import process$1 from "node:process";
|
|
8
|
-
import { formatWithOptions, parseArgs } from "node:util";
|
|
9
|
-
import * as tty from "node:tty";
|
|
10
10
|
import { performance } from "node:perf_hooks";
|
|
11
11
|
|
|
12
12
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
@@ -72,12 +72,12 @@ var Emitter = class {
|
|
|
72
72
|
}
|
|
73
73
|
removeListener(ev, fn) {
|
|
74
74
|
const list = this.listeners[ev];
|
|
75
|
-
const i
|
|
75
|
+
const i = list.indexOf(fn);
|
|
76
76
|
/* c8 ignore start */
|
|
77
|
-
if (i
|
|
77
|
+
if (i === -1) return;
|
|
78
78
|
/* c8 ignore stop */
|
|
79
|
-
if (i
|
|
80
|
-
else list.splice(i
|
|
79
|
+
if (i === 0 && list.length === 1) list.length = 0;
|
|
80
|
+
else list.splice(i, 1);
|
|
81
81
|
}
|
|
82
82
|
emit(ev, code, signal) {
|
|
83
83
|
if (this.emitted[ev]) return false;
|
|
@@ -134,8 +134,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
134
134
|
this.unload();
|
|
135
135
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
136
136
|
/* c8 ignore start */
|
|
137
|
-
const s
|
|
138
|
-
if (!ret) process$3.kill(process$3.pid, s
|
|
137
|
+
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
138
|
+
if (!ret) process$3.kill(process$3.pid, s);
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
141
|
this.#originalProcessReallyExit = process$3.reallyExit;
|
|
@@ -160,9 +160,9 @@ var SignalExit = class extends SignalExitBase {
|
|
|
160
160
|
for (const sig of signals) try {
|
|
161
161
|
const fn = this.#sigListeners[sig];
|
|
162
162
|
if (fn) this.#process.on(sig, fn);
|
|
163
|
-
} catch (_
|
|
164
|
-
this.#process.emit = (ev, ...a
|
|
165
|
-
return this.#processEmit(ev, ...a
|
|
163
|
+
} catch (_) {}
|
|
164
|
+
this.#process.emit = (ev, ...a) => {
|
|
165
|
+
return this.#processEmit(ev, ...a);
|
|
166
166
|
};
|
|
167
167
|
this.#process.reallyExit = (code) => {
|
|
168
168
|
return this.#processReallyExit(code);
|
|
@@ -178,7 +178,7 @@ var SignalExit = class extends SignalExitBase {
|
|
|
178
178
|
/* c8 ignore stop */
|
|
179
179
|
try {
|
|
180
180
|
this.#process.removeListener(sig, listener);
|
|
181
|
-
} catch (_
|
|
181
|
+
} catch (_) {}
|
|
182
182
|
/* c8 ignore stop */
|
|
183
183
|
});
|
|
184
184
|
this.#process.emit = this.#originalProcessEmit;
|
|
@@ -209,994 +209,6 @@ var SignalExit = class extends SignalExitBase {
|
|
|
209
209
|
const process$2 = globalThis.process;
|
|
210
210
|
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
211
211
|
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
214
|
-
const LogLevels = {
|
|
215
|
-
silent: Number.NEGATIVE_INFINITY,
|
|
216
|
-
fatal: 0,
|
|
217
|
-
error: 0,
|
|
218
|
-
warn: 1,
|
|
219
|
-
log: 2,
|
|
220
|
-
info: 3,
|
|
221
|
-
success: 3,
|
|
222
|
-
fail: 3,
|
|
223
|
-
ready: 3,
|
|
224
|
-
start: 3,
|
|
225
|
-
box: 3,
|
|
226
|
-
debug: 4,
|
|
227
|
-
trace: 5,
|
|
228
|
-
verbose: Number.POSITIVE_INFINITY
|
|
229
|
-
};
|
|
230
|
-
const LogTypes = {
|
|
231
|
-
silent: { level: -1 },
|
|
232
|
-
fatal: { level: LogLevels.fatal },
|
|
233
|
-
error: { level: LogLevels.error },
|
|
234
|
-
warn: { level: LogLevels.warn },
|
|
235
|
-
log: { level: LogLevels.log },
|
|
236
|
-
info: { level: LogLevels.info },
|
|
237
|
-
success: { level: LogLevels.success },
|
|
238
|
-
fail: { level: LogLevels.fail },
|
|
239
|
-
ready: { level: LogLevels.info },
|
|
240
|
-
start: { level: LogLevels.info },
|
|
241
|
-
box: { level: LogLevels.info },
|
|
242
|
-
debug: { level: LogLevels.debug },
|
|
243
|
-
trace: { level: LogLevels.trace },
|
|
244
|
-
verbose: { level: LogLevels.verbose }
|
|
245
|
-
};
|
|
246
|
-
function isPlainObject$1(value) {
|
|
247
|
-
if (value === null || typeof value !== "object") return false;
|
|
248
|
-
const prototype = Object.getPrototypeOf(value);
|
|
249
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
250
|
-
if (Symbol.iterator in value) return false;
|
|
251
|
-
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
252
|
-
return true;
|
|
253
|
-
}
|
|
254
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
255
|
-
if (!isPlainObject$1(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
256
|
-
const object = Object.assign({}, defaults);
|
|
257
|
-
for (const key in baseObject) {
|
|
258
|
-
if (key === "__proto__" || key === "constructor") continue;
|
|
259
|
-
const value = baseObject[key];
|
|
260
|
-
if (value === null || value === void 0) continue;
|
|
261
|
-
if (merger && merger(object, key, value, namespace)) continue;
|
|
262
|
-
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
263
|
-
else if (isPlainObject$1(value) && isPlainObject$1(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
264
|
-
else object[key] = value;
|
|
265
|
-
}
|
|
266
|
-
return object;
|
|
267
|
-
}
|
|
268
|
-
function createDefu(merger) {
|
|
269
|
-
return (...arguments_) => arguments_.reduce((p, c$1) => _defu(p, c$1, "", merger), {});
|
|
270
|
-
}
|
|
271
|
-
const defu = createDefu();
|
|
272
|
-
function isPlainObject(obj) {
|
|
273
|
-
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
274
|
-
}
|
|
275
|
-
function isLogObj(arg) {
|
|
276
|
-
if (!isPlainObject(arg)) return false;
|
|
277
|
-
if (!arg.message && !arg.args) return false;
|
|
278
|
-
if (arg.stack) return false;
|
|
279
|
-
return true;
|
|
280
|
-
}
|
|
281
|
-
let paused = false;
|
|
282
|
-
const queue = [];
|
|
283
|
-
var Consola = class Consola {
|
|
284
|
-
options;
|
|
285
|
-
_lastLog;
|
|
286
|
-
_mockFn;
|
|
287
|
-
/**
|
|
288
|
-
* Creates an instance of Consola with specified options or defaults.
|
|
289
|
-
*
|
|
290
|
-
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
291
|
-
*/
|
|
292
|
-
constructor(options$1 = {}) {
|
|
293
|
-
const types = options$1.types || LogTypes;
|
|
294
|
-
this.options = defu({
|
|
295
|
-
...options$1,
|
|
296
|
-
defaults: { ...options$1.defaults },
|
|
297
|
-
level: _normalizeLogLevel(options$1.level, types),
|
|
298
|
-
reporters: [...options$1.reporters || []]
|
|
299
|
-
}, {
|
|
300
|
-
types: LogTypes,
|
|
301
|
-
throttle: 1e3,
|
|
302
|
-
throttleMin: 5,
|
|
303
|
-
formatOptions: {
|
|
304
|
-
date: true,
|
|
305
|
-
colors: false,
|
|
306
|
-
compact: true
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
for (const type in types) {
|
|
310
|
-
const defaults = {
|
|
311
|
-
type,
|
|
312
|
-
...this.options.defaults,
|
|
313
|
-
...types[type]
|
|
314
|
-
};
|
|
315
|
-
this[type] = this._wrapLogFn(defaults);
|
|
316
|
-
this[type].raw = this._wrapLogFn(defaults, true);
|
|
317
|
-
}
|
|
318
|
-
if (this.options.mockFn) this.mockTypes();
|
|
319
|
-
this._lastLog = {};
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Gets the current log level of the Consola instance.
|
|
323
|
-
*
|
|
324
|
-
* @returns {number} The current log level.
|
|
325
|
-
*/
|
|
326
|
-
get level() {
|
|
327
|
-
return this.options.level;
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Sets the minimum log level that will be output by the instance.
|
|
331
|
-
*
|
|
332
|
-
* @param {number} level - The new log level to set.
|
|
333
|
-
*/
|
|
334
|
-
set level(level) {
|
|
335
|
-
this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Displays a prompt to the user and returns the response.
|
|
339
|
-
* Throw an error if `prompt` is not supported by the current configuration.
|
|
340
|
-
*
|
|
341
|
-
* @template T
|
|
342
|
-
* @param {string} message - The message to display in the prompt.
|
|
343
|
-
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
344
|
-
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
345
|
-
*/
|
|
346
|
-
prompt(message, opts) {
|
|
347
|
-
if (!this.options.prompt) throw new Error("prompt is not supported!");
|
|
348
|
-
return this.options.prompt(message, opts);
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
352
|
-
*
|
|
353
|
-
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
354
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
355
|
-
*/
|
|
356
|
-
create(options$1) {
|
|
357
|
-
const instance = new Consola({
|
|
358
|
-
...this.options,
|
|
359
|
-
...options$1
|
|
360
|
-
});
|
|
361
|
-
if (this._mockFn) instance.mockTypes(this._mockFn);
|
|
362
|
-
return instance;
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* Creates a new Consola instance with the specified default log object properties.
|
|
366
|
-
*
|
|
367
|
-
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
368
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
369
|
-
*/
|
|
370
|
-
withDefaults(defaults) {
|
|
371
|
-
return this.create({
|
|
372
|
-
...this.options,
|
|
373
|
-
defaults: {
|
|
374
|
-
...this.options.defaults,
|
|
375
|
-
...defaults
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
381
|
-
*
|
|
382
|
-
* @param {string} tag - The tag to include in each log of the new instance.
|
|
383
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
384
|
-
*/
|
|
385
|
-
withTag(tag) {
|
|
386
|
-
return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Adds a custom reporter to the Consola instance.
|
|
390
|
-
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
391
|
-
*
|
|
392
|
-
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
393
|
-
* @returns {Consola} The current Consola instance.
|
|
394
|
-
*/
|
|
395
|
-
addReporter(reporter) {
|
|
396
|
-
this.options.reporters.push(reporter);
|
|
397
|
-
return this;
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Removes a custom reporter from the Consola instance.
|
|
401
|
-
* If no reporter is specified, all reporters will be removed.
|
|
402
|
-
*
|
|
403
|
-
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
404
|
-
* @returns {Consola} The current Consola instance.
|
|
405
|
-
*/
|
|
406
|
-
removeReporter(reporter) {
|
|
407
|
-
if (reporter) {
|
|
408
|
-
const i$1 = this.options.reporters.indexOf(reporter);
|
|
409
|
-
if (i$1 !== -1) return this.options.reporters.splice(i$1, 1);
|
|
410
|
-
} else this.options.reporters.splice(0);
|
|
411
|
-
return this;
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
415
|
-
*
|
|
416
|
-
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
417
|
-
* @returns {Consola} The current Consola instance.
|
|
418
|
-
*/
|
|
419
|
-
setReporters(reporters) {
|
|
420
|
-
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
421
|
-
return this;
|
|
422
|
-
}
|
|
423
|
-
wrapAll() {
|
|
424
|
-
this.wrapConsole();
|
|
425
|
-
this.wrapStd();
|
|
426
|
-
}
|
|
427
|
-
restoreAll() {
|
|
428
|
-
this.restoreConsole();
|
|
429
|
-
this.restoreStd();
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Overrides console methods with Consola logging methods for consistent logging.
|
|
433
|
-
*/
|
|
434
|
-
wrapConsole() {
|
|
435
|
-
for (const type in this.options.types) {
|
|
436
|
-
if (!console["__" + type]) console["__" + type] = console[type];
|
|
437
|
-
console[type] = this[type].raw;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* Restores the original console methods, removing Consola overrides.
|
|
442
|
-
*/
|
|
443
|
-
restoreConsole() {
|
|
444
|
-
for (const type in this.options.types) if (console["__" + type]) {
|
|
445
|
-
console[type] = console["__" + type];
|
|
446
|
-
delete console["__" + type];
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Overrides standard output and error streams to redirect them through Consola.
|
|
451
|
-
*/
|
|
452
|
-
wrapStd() {
|
|
453
|
-
this._wrapStream(this.options.stdout, "log");
|
|
454
|
-
this._wrapStream(this.options.stderr, "log");
|
|
455
|
-
}
|
|
456
|
-
_wrapStream(stream, type) {
|
|
457
|
-
if (!stream) return;
|
|
458
|
-
if (!stream.__write) stream.__write = stream.write;
|
|
459
|
-
stream.write = (data) => {
|
|
460
|
-
this[type].raw(String(data).trim());
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
465
|
-
*/
|
|
466
|
-
restoreStd() {
|
|
467
|
-
this._restoreStream(this.options.stdout);
|
|
468
|
-
this._restoreStream(this.options.stderr);
|
|
469
|
-
}
|
|
470
|
-
_restoreStream(stream) {
|
|
471
|
-
if (!stream) return;
|
|
472
|
-
if (stream.__write) {
|
|
473
|
-
stream.write = stream.__write;
|
|
474
|
-
delete stream.__write;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Pauses logging, queues incoming logs until resumed.
|
|
479
|
-
*/
|
|
480
|
-
pauseLogs() {
|
|
481
|
-
paused = true;
|
|
482
|
-
}
|
|
483
|
-
/**
|
|
484
|
-
* Resumes logging, processing any queued logs.
|
|
485
|
-
*/
|
|
486
|
-
resumeLogs() {
|
|
487
|
-
paused = false;
|
|
488
|
-
const _queue = queue.splice(0);
|
|
489
|
-
for (const item of _queue) item[0]._logFn(item[1], item[2]);
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Replaces logging methods with mocks if a mock function is provided.
|
|
493
|
-
*
|
|
494
|
-
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
495
|
-
*/
|
|
496
|
-
mockTypes(mockFn) {
|
|
497
|
-
const _mockFn = mockFn || this.options.mockFn;
|
|
498
|
-
this._mockFn = _mockFn;
|
|
499
|
-
if (typeof _mockFn !== "function") return;
|
|
500
|
-
for (const type in this.options.types) {
|
|
501
|
-
this[type] = _mockFn(type, this.options.types[type]) || this[type];
|
|
502
|
-
this[type].raw = this[type];
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
_wrapLogFn(defaults, isRaw) {
|
|
506
|
-
return (...args) => {
|
|
507
|
-
if (paused) {
|
|
508
|
-
queue.push([
|
|
509
|
-
this,
|
|
510
|
-
defaults,
|
|
511
|
-
args,
|
|
512
|
-
isRaw
|
|
513
|
-
]);
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
return this._logFn(defaults, args, isRaw);
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
_logFn(defaults, args, isRaw) {
|
|
520
|
-
if ((defaults.level || 0) > this.level) return false;
|
|
521
|
-
const logObj = {
|
|
522
|
-
date: /* @__PURE__ */ new Date(),
|
|
523
|
-
args: [],
|
|
524
|
-
...defaults,
|
|
525
|
-
level: _normalizeLogLevel(defaults.level, this.options.types)
|
|
526
|
-
};
|
|
527
|
-
if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
|
|
528
|
-
else logObj.args = [...args];
|
|
529
|
-
if (logObj.message) {
|
|
530
|
-
logObj.args.unshift(logObj.message);
|
|
531
|
-
delete logObj.message;
|
|
532
|
-
}
|
|
533
|
-
if (logObj.additional) {
|
|
534
|
-
if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
|
|
535
|
-
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
536
|
-
delete logObj.additional;
|
|
537
|
-
}
|
|
538
|
-
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
539
|
-
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
540
|
-
const resolveLog = (newLog = false) => {
|
|
541
|
-
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
542
|
-
if (this._lastLog.object && repeated > 0) {
|
|
543
|
-
const args2 = [...this._lastLog.object.args];
|
|
544
|
-
if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
|
|
545
|
-
this._log({
|
|
546
|
-
...this._lastLog.object,
|
|
547
|
-
args: args2
|
|
548
|
-
});
|
|
549
|
-
this._lastLog.count = 1;
|
|
550
|
-
}
|
|
551
|
-
if (newLog) {
|
|
552
|
-
this._lastLog.object = logObj;
|
|
553
|
-
this._log(logObj);
|
|
554
|
-
}
|
|
555
|
-
};
|
|
556
|
-
clearTimeout(this._lastLog.timeout);
|
|
557
|
-
const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
558
|
-
this._lastLog.time = logObj.date;
|
|
559
|
-
if (diffTime < this.options.throttle) try {
|
|
560
|
-
const serializedLog = JSON.stringify([
|
|
561
|
-
logObj.type,
|
|
562
|
-
logObj.tag,
|
|
563
|
-
logObj.args
|
|
564
|
-
]);
|
|
565
|
-
const isSameLog = this._lastLog.serialized === serializedLog;
|
|
566
|
-
this._lastLog.serialized = serializedLog;
|
|
567
|
-
if (isSameLog) {
|
|
568
|
-
this._lastLog.count = (this._lastLog.count || 0) + 1;
|
|
569
|
-
if (this._lastLog.count > this.options.throttleMin) {
|
|
570
|
-
this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
} catch {}
|
|
575
|
-
resolveLog(true);
|
|
576
|
-
}
|
|
577
|
-
_log(logObj) {
|
|
578
|
-
for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
|
|
579
|
-
}
|
|
580
|
-
};
|
|
581
|
-
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
582
|
-
if (input === void 0) return defaultLevel;
|
|
583
|
-
if (typeof input === "number") return input;
|
|
584
|
-
if (types[input] && types[input].level !== void 0) return types[input].level;
|
|
585
|
-
return defaultLevel;
|
|
586
|
-
}
|
|
587
|
-
Consola.prototype.add = Consola.prototype.addReporter;
|
|
588
|
-
Consola.prototype.remove = Consola.prototype.removeReporter;
|
|
589
|
-
Consola.prototype.clear = Consola.prototype.removeReporter;
|
|
590
|
-
Consola.prototype.withScope = Consola.prototype.withTag;
|
|
591
|
-
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
592
|
-
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
593
|
-
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
594
|
-
function createConsola$1(options$1 = {}) {
|
|
595
|
-
return new Consola(options$1);
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
//#endregion
|
|
599
|
-
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
|
|
600
|
-
function parseStack(stack, message) {
|
|
601
|
-
const cwd$1 = process.cwd() + sep;
|
|
602
|
-
const lines = stack.split("\n").splice(message.split("\n").length).map((l$1) => l$1.trim().replace("file://", "").replace(cwd$1, ""));
|
|
603
|
-
return lines;
|
|
604
|
-
}
|
|
605
|
-
function writeStream(data, stream) {
|
|
606
|
-
const write = stream.__write || stream.write;
|
|
607
|
-
return write.call(stream, data);
|
|
608
|
-
}
|
|
609
|
-
const bracket = (x) => x ? `[${x}]` : "";
|
|
610
|
-
var BasicReporter = class {
|
|
611
|
-
formatStack(stack, message, opts) {
|
|
612
|
-
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
613
|
-
return indent + parseStack(stack, message).join(`
|
|
614
|
-
${indent}`);
|
|
615
|
-
}
|
|
616
|
-
formatError(err, opts) {
|
|
617
|
-
const message = err.message ?? formatWithOptions(opts, err);
|
|
618
|
-
const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
|
|
619
|
-
const level = opts?.errorLevel || 0;
|
|
620
|
-
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
|
|
621
|
-
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
|
|
622
|
-
...opts,
|
|
623
|
-
errorLevel: level + 1
|
|
624
|
-
}) : "";
|
|
625
|
-
return causedPrefix + message + "\n" + stack + causedError;
|
|
626
|
-
}
|
|
627
|
-
formatArgs(args, opts) {
|
|
628
|
-
const _args = args.map((arg) => {
|
|
629
|
-
if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
|
|
630
|
-
return arg;
|
|
631
|
-
});
|
|
632
|
-
return formatWithOptions(opts, ..._args);
|
|
633
|
-
}
|
|
634
|
-
formatDate(date, opts) {
|
|
635
|
-
return opts.date ? date.toLocaleTimeString() : "";
|
|
636
|
-
}
|
|
637
|
-
filterAndJoin(arr) {
|
|
638
|
-
return arr.filter(Boolean).join(" ");
|
|
639
|
-
}
|
|
640
|
-
formatLogObj(logObj, opts) {
|
|
641
|
-
const message = this.formatArgs(logObj.args, opts);
|
|
642
|
-
if (logObj.type === "box") return "\n" + [
|
|
643
|
-
bracket(logObj.tag),
|
|
644
|
-
logObj.title && logObj.title,
|
|
645
|
-
...message.split("\n")
|
|
646
|
-
].filter(Boolean).map((l$1) => " > " + l$1).join("\n") + "\n";
|
|
647
|
-
return this.filterAndJoin([
|
|
648
|
-
bracket(logObj.type),
|
|
649
|
-
bracket(logObj.tag),
|
|
650
|
-
message
|
|
651
|
-
]);
|
|
652
|
-
}
|
|
653
|
-
log(logObj, ctx) {
|
|
654
|
-
const line = this.formatLogObj(logObj, {
|
|
655
|
-
columns: ctx.options.stdout.columns || 0,
|
|
656
|
-
...ctx.options.formatOptions
|
|
657
|
-
});
|
|
658
|
-
return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
659
|
-
}
|
|
660
|
-
};
|
|
661
|
-
|
|
662
|
-
//#endregion
|
|
663
|
-
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
|
|
664
|
-
const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
665
|
-
const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
666
|
-
const isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
667
|
-
const isWindows = platform === "win32";
|
|
668
|
-
const isDumbTerminal = env.TERM === "dumb";
|
|
669
|
-
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
670
|
-
const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
671
|
-
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
672
|
-
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)) {
|
|
673
|
-
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
674
|
-
}
|
|
675
|
-
function clearBleed(index, string, open, close, replace) {
|
|
676
|
-
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
677
|
-
}
|
|
678
|
-
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
679
|
-
return (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
680
|
-
}
|
|
681
|
-
function init(open, close, replace) {
|
|
682
|
-
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
683
|
-
}
|
|
684
|
-
const colorDefs = {
|
|
685
|
-
reset: init(0, 0),
|
|
686
|
-
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
687
|
-
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
688
|
-
italic: init(3, 23),
|
|
689
|
-
underline: init(4, 24),
|
|
690
|
-
inverse: init(7, 27),
|
|
691
|
-
hidden: init(8, 28),
|
|
692
|
-
strikethrough: init(9, 29),
|
|
693
|
-
black: init(30, 39),
|
|
694
|
-
red: init(31, 39),
|
|
695
|
-
green: init(32, 39),
|
|
696
|
-
yellow: init(33, 39),
|
|
697
|
-
blue: init(34, 39),
|
|
698
|
-
magenta: init(35, 39),
|
|
699
|
-
cyan: init(36, 39),
|
|
700
|
-
white: init(37, 39),
|
|
701
|
-
gray: init(90, 39),
|
|
702
|
-
bgBlack: init(40, 49),
|
|
703
|
-
bgRed: init(41, 49),
|
|
704
|
-
bgGreen: init(42, 49),
|
|
705
|
-
bgYellow: init(43, 49),
|
|
706
|
-
bgBlue: init(44, 49),
|
|
707
|
-
bgMagenta: init(45, 49),
|
|
708
|
-
bgCyan: init(46, 49),
|
|
709
|
-
bgWhite: init(47, 49),
|
|
710
|
-
blackBright: init(90, 39),
|
|
711
|
-
redBright: init(91, 39),
|
|
712
|
-
greenBright: init(92, 39),
|
|
713
|
-
yellowBright: init(93, 39),
|
|
714
|
-
blueBright: init(94, 39),
|
|
715
|
-
magentaBright: init(95, 39),
|
|
716
|
-
cyanBright: init(96, 39),
|
|
717
|
-
whiteBright: init(97, 39),
|
|
718
|
-
bgBlackBright: init(100, 49),
|
|
719
|
-
bgRedBright: init(101, 49),
|
|
720
|
-
bgGreenBright: init(102, 49),
|
|
721
|
-
bgYellowBright: init(103, 49),
|
|
722
|
-
bgBlueBright: init(104, 49),
|
|
723
|
-
bgMagentaBright: init(105, 49),
|
|
724
|
-
bgCyanBright: init(106, 49),
|
|
725
|
-
bgWhiteBright: init(107, 49)
|
|
726
|
-
};
|
|
727
|
-
function createColors(useColor = isColorSupported) {
|
|
728
|
-
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
729
|
-
}
|
|
730
|
-
const colors$1 = createColors();
|
|
731
|
-
function getColor$1(color, fallback = "reset") {
|
|
732
|
-
return colors$1[color] || colors$1[fallback];
|
|
733
|
-
}
|
|
734
|
-
const ansiRegex$1 = [String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`, String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");
|
|
735
|
-
function stripAnsi(text) {
|
|
736
|
-
return text.replace(new RegExp(ansiRegex$1, "g"), "");
|
|
737
|
-
}
|
|
738
|
-
const boxStylePresets = {
|
|
739
|
-
solid: {
|
|
740
|
-
tl: "┌",
|
|
741
|
-
tr: "┐",
|
|
742
|
-
bl: "└",
|
|
743
|
-
br: "┘",
|
|
744
|
-
h: "─",
|
|
745
|
-
v: "│"
|
|
746
|
-
},
|
|
747
|
-
double: {
|
|
748
|
-
tl: "╔",
|
|
749
|
-
tr: "╗",
|
|
750
|
-
bl: "╚",
|
|
751
|
-
br: "╝",
|
|
752
|
-
h: "═",
|
|
753
|
-
v: "║"
|
|
754
|
-
},
|
|
755
|
-
doubleSingle: {
|
|
756
|
-
tl: "╓",
|
|
757
|
-
tr: "╖",
|
|
758
|
-
bl: "╙",
|
|
759
|
-
br: "╜",
|
|
760
|
-
h: "─",
|
|
761
|
-
v: "║"
|
|
762
|
-
},
|
|
763
|
-
doubleSingleRounded: {
|
|
764
|
-
tl: "╭",
|
|
765
|
-
tr: "╮",
|
|
766
|
-
bl: "╰",
|
|
767
|
-
br: "╯",
|
|
768
|
-
h: "─",
|
|
769
|
-
v: "║"
|
|
770
|
-
},
|
|
771
|
-
singleThick: {
|
|
772
|
-
tl: "┏",
|
|
773
|
-
tr: "┓",
|
|
774
|
-
bl: "┗",
|
|
775
|
-
br: "┛",
|
|
776
|
-
h: "━",
|
|
777
|
-
v: "┃"
|
|
778
|
-
},
|
|
779
|
-
singleDouble: {
|
|
780
|
-
tl: "╒",
|
|
781
|
-
tr: "╕",
|
|
782
|
-
bl: "╘",
|
|
783
|
-
br: "╛",
|
|
784
|
-
h: "═",
|
|
785
|
-
v: "│"
|
|
786
|
-
},
|
|
787
|
-
singleDoubleRounded: {
|
|
788
|
-
tl: "╭",
|
|
789
|
-
tr: "╮",
|
|
790
|
-
bl: "╰",
|
|
791
|
-
br: "╯",
|
|
792
|
-
h: "═",
|
|
793
|
-
v: "│"
|
|
794
|
-
},
|
|
795
|
-
rounded: {
|
|
796
|
-
tl: "╭",
|
|
797
|
-
tr: "╮",
|
|
798
|
-
bl: "╰",
|
|
799
|
-
br: "╯",
|
|
800
|
-
h: "─",
|
|
801
|
-
v: "│"
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
const defaultStyle = {
|
|
805
|
-
borderColor: "white",
|
|
806
|
-
borderStyle: "rounded",
|
|
807
|
-
valign: "center",
|
|
808
|
-
padding: 2,
|
|
809
|
-
marginLeft: 1,
|
|
810
|
-
marginTop: 1,
|
|
811
|
-
marginBottom: 1
|
|
812
|
-
};
|
|
813
|
-
function box(text, _opts = {}) {
|
|
814
|
-
const opts = {
|
|
815
|
-
..._opts,
|
|
816
|
-
style: {
|
|
817
|
-
...defaultStyle,
|
|
818
|
-
..._opts.style
|
|
819
|
-
}
|
|
820
|
-
};
|
|
821
|
-
const textLines = text.split("\n");
|
|
822
|
-
const boxLines = [];
|
|
823
|
-
const _color = getColor$1(opts.style.borderColor);
|
|
824
|
-
const borderStyle = { ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle };
|
|
825
|
-
if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
|
|
826
|
-
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
827
|
-
const height = textLines.length + paddingOffset;
|
|
828
|
-
const width = Math.max(...textLines.map((line) => stripAnsi(line).length), opts.title ? stripAnsi(opts.title).length : 0) + paddingOffset;
|
|
829
|
-
const widthOffset = width + paddingOffset;
|
|
830
|
-
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
831
|
-
if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
|
|
832
|
-
if (opts.title) {
|
|
833
|
-
const title = _color ? _color(opts.title) : opts.title;
|
|
834
|
-
const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
|
|
835
|
-
const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
|
|
836
|
-
boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
|
|
837
|
-
} else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
|
|
838
|
-
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
839
|
-
for (let i$1 = 0; i$1 < height; i$1++) if (i$1 < valignOffset || i$1 >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
|
|
840
|
-
else {
|
|
841
|
-
const line = textLines[i$1 - valignOffset];
|
|
842
|
-
const left = " ".repeat(paddingOffset);
|
|
843
|
-
const right = " ".repeat(width - stripAnsi(line).length);
|
|
844
|
-
boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
|
|
845
|
-
}
|
|
846
|
-
boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
|
|
847
|
-
if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
|
|
848
|
-
return boxLines.join("\n");
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
//#endregion
|
|
852
|
-
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
|
|
853
|
-
const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? r : globalThis), o = new Proxy(r, {
|
|
854
|
-
get(e, s$1) {
|
|
855
|
-
return i()[s$1] ?? r[s$1];
|
|
856
|
-
},
|
|
857
|
-
has(e, s$1) {
|
|
858
|
-
const E = i();
|
|
859
|
-
return s$1 in E || s$1 in r;
|
|
860
|
-
},
|
|
861
|
-
set(e, s$1, E) {
|
|
862
|
-
const B = i(true);
|
|
863
|
-
return B[s$1] = E, true;
|
|
864
|
-
},
|
|
865
|
-
deleteProperty(e, s$1) {
|
|
866
|
-
if (!s$1) return false;
|
|
867
|
-
const E = i(true);
|
|
868
|
-
return delete E[s$1], true;
|
|
869
|
-
},
|
|
870
|
-
ownKeys() {
|
|
871
|
-
const e = i(true);
|
|
872
|
-
return Object.keys(e);
|
|
873
|
-
}
|
|
874
|
-
}), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
|
|
875
|
-
["APPVEYOR"],
|
|
876
|
-
[
|
|
877
|
-
"AWS_AMPLIFY",
|
|
878
|
-
"AWS_APP_ID",
|
|
879
|
-
{ ci: true }
|
|
880
|
-
],
|
|
881
|
-
["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
|
|
882
|
-
["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
|
|
883
|
-
["APPCIRCLE", "AC_APPCIRCLE"],
|
|
884
|
-
["BAMBOO", "bamboo_planKey"],
|
|
885
|
-
["BITBUCKET", "BITBUCKET_COMMIT"],
|
|
886
|
-
["BITRISE", "BITRISE_IO"],
|
|
887
|
-
["BUDDY", "BUDDY_WORKSPACE_ID"],
|
|
888
|
-
["BUILDKITE"],
|
|
889
|
-
["CIRCLE", "CIRCLECI"],
|
|
890
|
-
["CIRRUS", "CIRRUS_CI"],
|
|
891
|
-
[
|
|
892
|
-
"CLOUDFLARE_PAGES",
|
|
893
|
-
"CF_PAGES",
|
|
894
|
-
{ ci: true }
|
|
895
|
-
],
|
|
896
|
-
["CODEBUILD", "CODEBUILD_BUILD_ARN"],
|
|
897
|
-
["CODEFRESH", "CF_BUILD_ID"],
|
|
898
|
-
["DRONE"],
|
|
899
|
-
["DRONE", "DRONE_BUILD_EVENT"],
|
|
900
|
-
["DSARI"],
|
|
901
|
-
["GITHUB_ACTIONS"],
|
|
902
|
-
["GITLAB", "GITLAB_CI"],
|
|
903
|
-
["GITLAB", "CI_MERGE_REQUEST_ID"],
|
|
904
|
-
["GOCD", "GO_PIPELINE_LABEL"],
|
|
905
|
-
["LAYERCI"],
|
|
906
|
-
["HUDSON", "HUDSON_URL"],
|
|
907
|
-
["JENKINS", "JENKINS_URL"],
|
|
908
|
-
["MAGNUM"],
|
|
909
|
-
["NETLIFY"],
|
|
910
|
-
[
|
|
911
|
-
"NETLIFY",
|
|
912
|
-
"NETLIFY_LOCAL",
|
|
913
|
-
{ ci: false }
|
|
914
|
-
],
|
|
915
|
-
["NEVERCODE"],
|
|
916
|
-
["RENDER"],
|
|
917
|
-
["SAIL", "SAILCI"],
|
|
918
|
-
["SEMAPHORE"],
|
|
919
|
-
["SCREWDRIVER"],
|
|
920
|
-
["SHIPPABLE"],
|
|
921
|
-
["SOLANO", "TDDIUM"],
|
|
922
|
-
["STRIDER"],
|
|
923
|
-
["TEAMCITY", "TEAMCITY_VERSION"],
|
|
924
|
-
["TRAVIS"],
|
|
925
|
-
["VERCEL", "NOW_BUILDER"],
|
|
926
|
-
[
|
|
927
|
-
"VERCEL",
|
|
928
|
-
"VERCEL",
|
|
929
|
-
{ ci: false }
|
|
930
|
-
],
|
|
931
|
-
[
|
|
932
|
-
"VERCEL",
|
|
933
|
-
"VERCEL_ENV",
|
|
934
|
-
{ ci: false }
|
|
935
|
-
],
|
|
936
|
-
["APPCENTER", "APPCENTER_BUILD_ID"],
|
|
937
|
-
[
|
|
938
|
-
"CODESANDBOX",
|
|
939
|
-
"CODESANDBOX_SSE",
|
|
940
|
-
{ ci: false }
|
|
941
|
-
],
|
|
942
|
-
[
|
|
943
|
-
"CODESANDBOX",
|
|
944
|
-
"CODESANDBOX_HOST",
|
|
945
|
-
{ ci: false }
|
|
946
|
-
],
|
|
947
|
-
["STACKBLITZ"],
|
|
948
|
-
["STORMKIT"],
|
|
949
|
-
["CLEAVR"],
|
|
950
|
-
["ZEABUR"],
|
|
951
|
-
[
|
|
952
|
-
"CODESPHERE",
|
|
953
|
-
"CODESPHERE_APP_ID",
|
|
954
|
-
{ ci: true }
|
|
955
|
-
],
|
|
956
|
-
["RAILWAY", "RAILWAY_PROJECT_ID"],
|
|
957
|
-
["RAILWAY", "RAILWAY_SERVICE_ID"],
|
|
958
|
-
["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
|
|
959
|
-
[
|
|
960
|
-
"FIREBASE_APP_HOSTING",
|
|
961
|
-
"FIREBASE_APP_HOSTING",
|
|
962
|
-
{ ci: true }
|
|
963
|
-
]
|
|
964
|
-
];
|
|
965
|
-
function b() {
|
|
966
|
-
if (globalThis.process?.env) for (const e of f) {
|
|
967
|
-
const s$1 = e[1] || e[0];
|
|
968
|
-
if (globalThis.process?.env[s$1]) return {
|
|
969
|
-
name: e[0].toLowerCase(),
|
|
970
|
-
...e[2]
|
|
971
|
-
};
|
|
972
|
-
}
|
|
973
|
-
return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? {
|
|
974
|
-
name: "stackblitz",
|
|
975
|
-
ci: false
|
|
976
|
-
} : {
|
|
977
|
-
name: "",
|
|
978
|
-
ci: false
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
const l = b();
|
|
982
|
-
l.name;
|
|
983
|
-
function n(e) {
|
|
984
|
-
return e ? e !== "false" : false;
|
|
985
|
-
}
|
|
986
|
-
const I = globalThis.process?.platform || "", T = n(o.CI) || l.ci !== false, a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY), g = n(o.DEBUG), R = t === "test" || n(o.TEST);
|
|
987
|
-
n(o.MINIMAL);
|
|
988
|
-
const A = /^win/i.test(I);
|
|
989
|
-
!n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM);
|
|
990
|
-
const C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
|
|
991
|
-
Number(C?.split(".")[0]);
|
|
992
|
-
const y = globalThis.process || Object.create(null), _ = { versions: {} };
|
|
993
|
-
new Proxy(y, { get(e, s$1) {
|
|
994
|
-
if (s$1 === "env") return o;
|
|
995
|
-
if (s$1 in e) return e[s$1];
|
|
996
|
-
if (s$1 in _) return _[s$1];
|
|
997
|
-
} });
|
|
998
|
-
const c = globalThis.process?.release?.name === "node", O = !!globalThis.Bun || !!globalThis.process?.versions?.bun, D = !!globalThis.Deno, L = !!globalThis.fastly, S = !!globalThis.Netlify, u = !!globalThis.EdgeRuntime, N = globalThis.navigator?.userAgent === "Cloudflare-Workers", F = [
|
|
999
|
-
[S, "netlify"],
|
|
1000
|
-
[u, "edge-light"],
|
|
1001
|
-
[N, "workerd"],
|
|
1002
|
-
[L, "fastly"],
|
|
1003
|
-
[D, "deno"],
|
|
1004
|
-
[O, "bun"],
|
|
1005
|
-
[c, "node"]
|
|
1006
|
-
];
|
|
1007
|
-
function G() {
|
|
1008
|
-
const e = F.find((s$1) => s$1[0]);
|
|
1009
|
-
if (e) return { name: e[1] };
|
|
1010
|
-
}
|
|
1011
|
-
const P = G();
|
|
1012
|
-
P?.name;
|
|
1013
|
-
function ansiRegex({ onlyFirst = false } = {}) {
|
|
1014
|
-
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
1015
|
-
const pattern = [`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`, "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
1016
|
-
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
1017
|
-
}
|
|
1018
|
-
const regex = ansiRegex();
|
|
1019
|
-
function stripAnsi$1(string) {
|
|
1020
|
-
if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
1021
|
-
return string.replace(regex, "");
|
|
1022
|
-
}
|
|
1023
|
-
function isAmbiguous(x) {
|
|
1024
|
-
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
1025
|
-
}
|
|
1026
|
-
function isFullWidth(x) {
|
|
1027
|
-
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
1028
|
-
}
|
|
1029
|
-
function isWide(x) {
|
|
1030
|
-
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
1031
|
-
}
|
|
1032
|
-
function validate(codePoint) {
|
|
1033
|
-
if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
1034
|
-
}
|
|
1035
|
-
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
1036
|
-
validate(codePoint);
|
|
1037
|
-
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
|
|
1038
|
-
return 1;
|
|
1039
|
-
}
|
|
1040
|
-
const emojiRegex = () => {
|
|
1041
|
-
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\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](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\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]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\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])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\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-\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]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\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(?:[\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\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\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-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\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;
|
|
1042
|
-
};
|
|
1043
|
-
const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
|
|
1044
|
-
const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
1045
|
-
function stringWidth$1(string, options$1 = {}) {
|
|
1046
|
-
if (typeof string !== "string" || string.length === 0) return 0;
|
|
1047
|
-
const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options$1;
|
|
1048
|
-
if (!countAnsiEscapeCodes) string = stripAnsi$1(string);
|
|
1049
|
-
if (string.length === 0) return 0;
|
|
1050
|
-
let width = 0;
|
|
1051
|
-
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
1052
|
-
for (const { segment: character } of segmenter.segment(string)) {
|
|
1053
|
-
const codePoint = character.codePointAt(0);
|
|
1054
|
-
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
|
|
1055
|
-
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
|
|
1056
|
-
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
|
|
1057
|
-
if (codePoint >= 55296 && codePoint <= 57343) continue;
|
|
1058
|
-
if (codePoint >= 65024 && codePoint <= 65039) continue;
|
|
1059
|
-
if (defaultIgnorableCodePointRegex.test(character)) continue;
|
|
1060
|
-
if (emojiRegex().test(character)) {
|
|
1061
|
-
width += 2;
|
|
1062
|
-
continue;
|
|
1063
|
-
}
|
|
1064
|
-
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
1065
|
-
}
|
|
1066
|
-
return width;
|
|
1067
|
-
}
|
|
1068
|
-
function isUnicodeSupported() {
|
|
1069
|
-
const { env: env$1 } = process$1;
|
|
1070
|
-
const { TERM, TERM_PROGRAM } = env$1;
|
|
1071
|
-
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
1072
|
-
return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1073
|
-
}
|
|
1074
|
-
const TYPE_COLOR_MAP = {
|
|
1075
|
-
info: "cyan",
|
|
1076
|
-
fail: "red",
|
|
1077
|
-
success: "green",
|
|
1078
|
-
ready: "green",
|
|
1079
|
-
start: "magenta"
|
|
1080
|
-
};
|
|
1081
|
-
const LEVEL_COLOR_MAP = {
|
|
1082
|
-
0: "red",
|
|
1083
|
-
1: "yellow"
|
|
1084
|
-
};
|
|
1085
|
-
const unicode = isUnicodeSupported();
|
|
1086
|
-
const s = (c$1, fallback) => unicode ? c$1 : fallback;
|
|
1087
|
-
const TYPE_ICONS = {
|
|
1088
|
-
error: s("✖", "×"),
|
|
1089
|
-
fatal: s("✖", "×"),
|
|
1090
|
-
ready: s("✔", "√"),
|
|
1091
|
-
warn: s("⚠", "‼"),
|
|
1092
|
-
info: s("ℹ", "i"),
|
|
1093
|
-
success: s("✔", "√"),
|
|
1094
|
-
debug: s("⚙", "D"),
|
|
1095
|
-
trace: s("→", "→"),
|
|
1096
|
-
fail: s("✖", "×"),
|
|
1097
|
-
start: s("◐", "o"),
|
|
1098
|
-
log: ""
|
|
1099
|
-
};
|
|
1100
|
-
function stringWidth(str) {
|
|
1101
|
-
const hasICU = typeof Intl === "object";
|
|
1102
|
-
if (!hasICU || !Intl.Segmenter) return stripAnsi(str).length;
|
|
1103
|
-
return stringWidth$1(str);
|
|
1104
|
-
}
|
|
1105
|
-
var FancyReporter = class extends BasicReporter {
|
|
1106
|
-
formatStack(stack, message, opts) {
|
|
1107
|
-
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
1108
|
-
return `
|
|
1109
|
-
${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors$1.gray(m)).replace(/\((.+)\)/, (_$1, m) => `(${colors$1.cyan(m)})`)).join(`
|
|
1110
|
-
${indent}`);
|
|
1111
|
-
}
|
|
1112
|
-
formatType(logObj, isBadge, opts) {
|
|
1113
|
-
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
1114
|
-
if (isBadge) return getBgColor(typeColor)(colors$1.black(` ${logObj.type.toUpperCase()} `));
|
|
1115
|
-
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
1116
|
-
return _type ? getColor(typeColor)(_type) : "";
|
|
1117
|
-
}
|
|
1118
|
-
formatLogObj(logObj, opts) {
|
|
1119
|
-
const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
|
|
1120
|
-
if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
|
|
1121
|
-
title: logObj.title ? characterFormat(logObj.title) : void 0,
|
|
1122
|
-
style: logObj.style
|
|
1123
|
-
});
|
|
1124
|
-
const date = this.formatDate(logObj.date, opts);
|
|
1125
|
-
const coloredDate = date && colors$1.gray(date);
|
|
1126
|
-
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
1127
|
-
const type = this.formatType(logObj, isBadge, opts);
|
|
1128
|
-
const tag = logObj.tag ? colors$1.gray(logObj.tag) : "";
|
|
1129
|
-
let line;
|
|
1130
|
-
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
1131
|
-
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
1132
|
-
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
1133
|
-
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors$1.gray(`[${right}]`)} ` : "") + left;
|
|
1134
|
-
line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
|
|
1135
|
-
if (logObj.type === "trace") {
|
|
1136
|
-
const _err = /* @__PURE__ */ new Error("Trace: " + logObj.message);
|
|
1137
|
-
line += this.formatStack(_err.stack || "", _err.message);
|
|
1138
|
-
}
|
|
1139
|
-
return isBadge ? "\n" + line + "\n" : line;
|
|
1140
|
-
}
|
|
1141
|
-
};
|
|
1142
|
-
function characterFormat(str) {
|
|
1143
|
-
return str.replace(/`([^`]+)`/gm, (_$1, m) => colors$1.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_$1, m) => ` ${colors$1.underline(m)} `);
|
|
1144
|
-
}
|
|
1145
|
-
function getColor(color = "white") {
|
|
1146
|
-
return colors$1[color] || colors$1.white;
|
|
1147
|
-
}
|
|
1148
|
-
function getBgColor(color = "bgWhite") {
|
|
1149
|
-
return colors$1[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors$1.bgWhite;
|
|
1150
|
-
}
|
|
1151
|
-
function createConsola(options$1 = {}) {
|
|
1152
|
-
let level = _getDefaultLogLevel();
|
|
1153
|
-
if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
|
|
1154
|
-
const consola2 = createConsola$1({
|
|
1155
|
-
level,
|
|
1156
|
-
defaults: { level },
|
|
1157
|
-
stdout: process.stdout,
|
|
1158
|
-
stderr: process.stderr,
|
|
1159
|
-
prompt: (...args) => import("./shared/prompt-C5jz26Zn.mjs").then((m) => m.prompt(...args)),
|
|
1160
|
-
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
1161
|
-
...options$1
|
|
1162
|
-
});
|
|
1163
|
-
return consola2;
|
|
1164
|
-
}
|
|
1165
|
-
function _getDefaultLogLevel() {
|
|
1166
|
-
if (g) return LogLevels.debug;
|
|
1167
|
-
if (R) return LogLevels.warn;
|
|
1168
|
-
return LogLevels.info;
|
|
1169
|
-
}
|
|
1170
|
-
const consola = createConsola();
|
|
1171
|
-
|
|
1172
|
-
//#endregion
|
|
1173
|
-
//#region src/cli/logger.ts
|
|
1174
|
-
/**
|
|
1175
|
-
* Console logger
|
|
1176
|
-
*/
|
|
1177
|
-
const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
|
|
1178
|
-
function createTestingLogger() {
|
|
1179
|
-
const types = [
|
|
1180
|
-
"silent",
|
|
1181
|
-
"fatal",
|
|
1182
|
-
"error",
|
|
1183
|
-
"warn",
|
|
1184
|
-
"log",
|
|
1185
|
-
"info",
|
|
1186
|
-
"success",
|
|
1187
|
-
"fail",
|
|
1188
|
-
"ready",
|
|
1189
|
-
"start",
|
|
1190
|
-
"box",
|
|
1191
|
-
"debug",
|
|
1192
|
-
"trace",
|
|
1193
|
-
"verbose"
|
|
1194
|
-
];
|
|
1195
|
-
const ret = Object.create(null);
|
|
1196
|
-
for (const type of types) ret[type] = console.log;
|
|
1197
|
-
return ret;
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
212
|
//#endregion
|
|
1201
213
|
//#region src/cli/arguments/alias.ts
|
|
1202
214
|
const alias = {
|
|
@@ -1269,9 +281,9 @@ function flattenSchema(schema, base = {}, parent = "") {
|
|
|
1269
281
|
function setNestedProperty(obj, path$1, value) {
|
|
1270
282
|
const keys = path$1.split(".");
|
|
1271
283
|
let current = obj;
|
|
1272
|
-
for (let i
|
|
1273
|
-
if (!current[keys[i
|
|
1274
|
-
current = current[keys[i
|
|
284
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
285
|
+
if (!current[keys[i]]) current[keys[i]] = {};
|
|
286
|
+
current = current[keys[i]];
|
|
1275
287
|
}
|
|
1276
288
|
const finalKey = keys[keys.length - 1];
|
|
1277
289
|
Object.defineProperty(current, finalKey, {
|
|
@@ -1316,8 +328,7 @@ function normalizeCliOptions(cliOptions, positionals) {
|
|
|
1316
328
|
"watch"
|
|
1317
329
|
];
|
|
1318
330
|
for (let [key, value] of Object.entries(options$1)) {
|
|
1319
|
-
const
|
|
1320
|
-
const [primary] = keys;
|
|
331
|
+
const [primary] = key.split(".");
|
|
1321
332
|
if (keysOfInput.includes(primary)) setNestedProperty(result.input, key, value);
|
|
1322
333
|
else if (keysOfOutput.includes(primary)) setNestedProperty(result.output, key, value);
|
|
1323
334
|
else if (!reservedKeys.includes(key)) {
|
|
@@ -1336,9 +347,8 @@ const objectSchema = getJsonSchema();
|
|
|
1336
347
|
const flattenedSchema = flattenSchema(objectSchema.properties);
|
|
1337
348
|
const options = Object.fromEntries(Object.entries(flattenedSchema).filter(([_key, schema]) => getSchemaType(schema) !== "never").map(([key, schema]) => {
|
|
1338
349
|
const config = Object.getOwnPropertyDescriptor(alias, key)?.value;
|
|
1339
|
-
const type = getSchemaType(schema);
|
|
1340
350
|
const result = {
|
|
1341
|
-
type:
|
|
351
|
+
type: getSchemaType(schema) === "boolean" ? "boolean" : "string",
|
|
1342
352
|
description: schema?.description ?? config?.description ?? "",
|
|
1343
353
|
hint: config?.hint
|
|
1344
354
|
};
|
|
@@ -1357,7 +367,7 @@ function parseCliArguments() {
|
|
|
1357
367
|
allowPositionals: true,
|
|
1358
368
|
strict: false
|
|
1359
369
|
});
|
|
1360
|
-
tokens.filter((token) => token.kind === "option").
|
|
370
|
+
let invalid_options = tokens.filter((token) => token.kind === "option").map((option) => {
|
|
1361
371
|
let negative = false;
|
|
1362
372
|
if (option.name.startsWith("no-")) {
|
|
1363
373
|
const name = kebabCaseToCamelCase(option.name.substring(3));
|
|
@@ -1370,10 +380,10 @@ function parseCliArguments() {
|
|
|
1370
380
|
delete values[option.name];
|
|
1371
381
|
option.name = kebabCaseToCamelCase(option.name);
|
|
1372
382
|
let originalType = flattenedSchema[option.name];
|
|
1373
|
-
if (!originalType) {
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
}
|
|
383
|
+
if (!originalType) return {
|
|
384
|
+
name: option.name,
|
|
385
|
+
value: option.value
|
|
386
|
+
};
|
|
1377
387
|
let type = getSchemaType(originalType);
|
|
1378
388
|
if (type === "string" && typeof option.value !== "string") {
|
|
1379
389
|
let opt = option;
|
|
@@ -1418,8 +428,27 @@ function parseCliArguments() {
|
|
|
1418
428
|
configurable: true,
|
|
1419
429
|
writable: true
|
|
1420
430
|
});
|
|
431
|
+
}).filter((item) => {
|
|
432
|
+
return item !== void 0;
|
|
1421
433
|
});
|
|
1422
|
-
|
|
434
|
+
invalid_options.sort((a, b) => {
|
|
435
|
+
return a.name.localeCompare(b.name);
|
|
436
|
+
});
|
|
437
|
+
if (invalid_options.length !== 0) {
|
|
438
|
+
let single = invalid_options.length === 1;
|
|
439
|
+
logger.warn(`Option \`${invalid_options.map((item) => item.name).join(",")}\` ${single ? "is" : "are"} unrecognized. We will ignore ${single ? "this" : "those"} option${single ? "" : "s"}.`);
|
|
440
|
+
}
|
|
441
|
+
let rawArgs = {
|
|
442
|
+
...values,
|
|
443
|
+
...invalid_options.reduce((acc, cur) => {
|
|
444
|
+
acc[cur.name] = cur.value;
|
|
445
|
+
return acc;
|
|
446
|
+
}, Object.create(null))
|
|
447
|
+
};
|
|
448
|
+
return {
|
|
449
|
+
...normalizeCliOptions(values, positionals),
|
|
450
|
+
rawArgs
|
|
451
|
+
};
|
|
1423
452
|
}
|
|
1424
453
|
|
|
1425
454
|
//#endregion
|
|
@@ -1434,33 +463,33 @@ function getClearScreenFunction(options$1) {
|
|
|
1434
463
|
}
|
|
1435
464
|
|
|
1436
465
|
//#endregion
|
|
1437
|
-
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.
|
|
1438
|
-
var require_usingCtx = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.
|
|
466
|
+
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.87.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
|
|
467
|
+
var require_usingCtx = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.87.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js": ((exports, module) => {
|
|
1439
468
|
function _usingCtx() {
|
|
1440
|
-
var r
|
|
1441
|
-
var n$
|
|
1442
|
-
return n$
|
|
1443
|
-
}, e = {}, n
|
|
1444
|
-
function using(r$
|
|
469
|
+
var r = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {
|
|
470
|
+
var n$1 = Error();
|
|
471
|
+
return n$1.name = "SuppressedError", n$1.error = r$1, n$1.suppressed = e$1, n$1;
|
|
472
|
+
}, e = {}, n = [];
|
|
473
|
+
function using(r$1, e$1) {
|
|
1445
474
|
if (null != e$1) {
|
|
1446
475
|
if (Object(e$1) !== e$1) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
1447
|
-
if (r$
|
|
1448
|
-
if (void 0 === o
|
|
1449
|
-
if ("function" != typeof o
|
|
1450
|
-
t
|
|
476
|
+
if (r$1) var o = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
|
477
|
+
if (void 0 === o && (o = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$1)) var t = o;
|
|
478
|
+
if ("function" != typeof o) throw new TypeError("Object is not disposable.");
|
|
479
|
+
t && (o = function o$1() {
|
|
1451
480
|
try {
|
|
1452
|
-
t
|
|
1453
|
-
} catch (r$
|
|
1454
|
-
return Promise.reject(r$
|
|
481
|
+
t.call(e$1);
|
|
482
|
+
} catch (r$2) {
|
|
483
|
+
return Promise.reject(r$2);
|
|
1455
484
|
}
|
|
1456
|
-
}), n
|
|
485
|
+
}), n.push({
|
|
1457
486
|
v: e$1,
|
|
1458
|
-
d: o
|
|
1459
|
-
a: r$
|
|
487
|
+
d: o,
|
|
488
|
+
a: r$1
|
|
1460
489
|
});
|
|
1461
|
-
} else r$
|
|
490
|
+
} else r$1 && n.push({
|
|
1462
491
|
d: e$1,
|
|
1463
|
-
a: r$
|
|
492
|
+
a: r$1
|
|
1464
493
|
});
|
|
1465
494
|
return e$1;
|
|
1466
495
|
}
|
|
@@ -1469,22 +498,22 @@ var require_usingCtx = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@o
|
|
|
1469
498
|
u: using.bind(null, !1),
|
|
1470
499
|
a: using.bind(null, !0),
|
|
1471
500
|
d: function d() {
|
|
1472
|
-
var o
|
|
501
|
+
var o, t = this.e, s = 0;
|
|
1473
502
|
function next() {
|
|
1474
|
-
for (; o
|
|
1475
|
-
if (!o
|
|
1476
|
-
if (o
|
|
1477
|
-
var r$
|
|
1478
|
-
if (o
|
|
1479
|
-
} else s
|
|
1480
|
-
} catch (r$
|
|
1481
|
-
return err(r$
|
|
503
|
+
for (; o = n.pop();) try {
|
|
504
|
+
if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
|
|
505
|
+
if (o.d) {
|
|
506
|
+
var r$1 = o.d.call(o.v);
|
|
507
|
+
if (o.a) return s |= 2, Promise.resolve(r$1).then(next, err);
|
|
508
|
+
} else s |= 1;
|
|
509
|
+
} catch (r$2) {
|
|
510
|
+
return err(r$2);
|
|
1482
511
|
}
|
|
1483
|
-
if (1 === s
|
|
1484
|
-
if (t
|
|
512
|
+
if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
|
|
513
|
+
if (t !== e) throw t;
|
|
1485
514
|
}
|
|
1486
|
-
function err(n$
|
|
1487
|
-
return t
|
|
515
|
+
function err(n$1) {
|
|
516
|
+
return t = t !== e ? new r(n$1, t) : n$1, next();
|
|
1488
517
|
}
|
|
1489
518
|
return next();
|
|
1490
519
|
}
|
|
@@ -1496,7 +525,7 @@ var require_usingCtx = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@o
|
|
|
1496
525
|
//#endregion
|
|
1497
526
|
//#region src/cli/commands/bundle.ts
|
|
1498
527
|
var import_usingCtx = /* @__PURE__ */ __toESM(require_usingCtx(), 1);
|
|
1499
|
-
async function bundleWithConfig(configPath, cliOptions) {
|
|
528
|
+
async function bundleWithConfig(configPath, cliOptions, rawArgs = {}) {
|
|
1500
529
|
if (cliOptions.watch) {
|
|
1501
530
|
process.env.ROLLUP_WATCH = "true";
|
|
1502
531
|
process.env.ROLLDOWN_WATCH = "true";
|
|
@@ -1506,23 +535,22 @@ async function bundleWithConfig(configPath, cliOptions) {
|
|
|
1506
535
|
logger.error(`No configuration found at ${config}`);
|
|
1507
536
|
process.exit(1);
|
|
1508
537
|
}
|
|
1509
|
-
|
|
1510
|
-
|
|
538
|
+
const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
|
|
539
|
+
if (cliOptions.watch) await watchInner(resolvedConfig, cliOptions);
|
|
540
|
+
else await bundleInner(resolvedConfig, cliOptions);
|
|
1511
541
|
}
|
|
1512
542
|
async function bundleWithCliOptions(cliOptions) {
|
|
1513
543
|
try {
|
|
1514
544
|
var _usingCtx$1 = (0, import_usingCtx.default)();
|
|
1515
545
|
if (cliOptions.output.dir || cliOptions.output.file) {
|
|
1516
|
-
|
|
1517
|
-
await operation({}, cliOptions);
|
|
546
|
+
await (cliOptions.watch ? watchInner : bundleInner)({}, cliOptions);
|
|
1518
547
|
return;
|
|
1519
548
|
}
|
|
1520
549
|
if (cliOptions.watch) {
|
|
1521
550
|
logger.error("You must specify `output.dir` to use watch mode");
|
|
1522
551
|
process.exit(1);
|
|
1523
552
|
}
|
|
1524
|
-
const
|
|
1525
|
-
const { output: outputs } = await build.generate(cliOptions.output);
|
|
553
|
+
const { output: outputs } = await _usingCtx$1.a(await rolldown(cliOptions.input)).generate(cliOptions.output);
|
|
1526
554
|
if (outputs.length === 0) {
|
|
1527
555
|
logger.error("No output generated");
|
|
1528
556
|
process.exit(1);
|
|
@@ -1531,8 +559,8 @@ async function bundleWithCliOptions(cliOptions) {
|
|
|
1531
559
|
if (outputs.length > 1) logger.log(`\n${colors.cyan(colors.bold(`|→ ${file.fileName}:`))}\n`);
|
|
1532
560
|
console.log(file.type === "asset" ? file.source : file.code);
|
|
1533
561
|
}
|
|
1534
|
-
} catch (_
|
|
1535
|
-
_usingCtx$1.e = _
|
|
562
|
+
} catch (_) {
|
|
563
|
+
_usingCtx$1.e = _;
|
|
1536
564
|
} finally {
|
|
1537
565
|
await _usingCtx$1.d();
|
|
1538
566
|
}
|
|
@@ -1605,8 +633,7 @@ async function bundleInner(config, cliOptions) {
|
|
|
1605
633
|
}
|
|
1606
634
|
result.forEach(printBundleOutputPretty);
|
|
1607
635
|
logger.log(``);
|
|
1608
|
-
const
|
|
1609
|
-
const duration = endTime - startTime;
|
|
636
|
+
const duration = performance.now() - startTime;
|
|
1610
637
|
logger.success(`rolldown v${version} Finished in ${colors.green(ms(duration))}`);
|
|
1611
638
|
}
|
|
1612
639
|
function printBundleOutputPretty(output) {
|
|
@@ -1653,7 +680,7 @@ function printOutputEntries(entries, sizeAdjustment, distPath) {
|
|
|
1653
680
|
for (const group of CHUNK_GROUPS) {
|
|
1654
681
|
const filtered = entries.filter((e) => e.type === group.type);
|
|
1655
682
|
if (!filtered.length) continue;
|
|
1656
|
-
for (const entry of filtered.sort((a
|
|
683
|
+
for (const entry of filtered.sort((a, z) => a.size - z.size)) {
|
|
1657
684
|
let log = colors.dim(withTrailingSlash(distPath));
|
|
1658
685
|
log += colors[group.color](entry.fileName.padEnd(sizeAdjustment.longest + 2));
|
|
1659
686
|
log += colors.dim(entry.type);
|
|
@@ -1712,11 +739,11 @@ function showHelp() {
|
|
|
1712
739
|
logger.log("");
|
|
1713
740
|
logger.log(`${colors.bold(colors.underline("OPTIONS"))}`);
|
|
1714
741
|
logger.log("");
|
|
1715
|
-
logger.log(Object.entries(options).sort(([a
|
|
1716
|
-
if (options[a
|
|
1717
|
-
if (!options[a
|
|
1718
|
-
if (options[a
|
|
1719
|
-
return a
|
|
742
|
+
logger.log(Object.entries(options).sort(([a], [b]) => {
|
|
743
|
+
if (options[a].short && !options[b].short) return -1;
|
|
744
|
+
if (!options[a].short && options[b].short) return 1;
|
|
745
|
+
if (options[a].short && options[b].short) return options[a].short.localeCompare(options[b].short);
|
|
746
|
+
return a.localeCompare(b);
|
|
1720
747
|
}).map(([option, { type, short, hint, description: description$1 }]) => {
|
|
1721
748
|
let optionStr = ` --${option} `;
|
|
1722
749
|
option = camelCaseToKebabCase(option);
|
|
@@ -1743,9 +770,9 @@ function showHelp() {
|
|
|
1743
770
|
//#endregion
|
|
1744
771
|
//#region src/cli/index.ts
|
|
1745
772
|
async function main() {
|
|
1746
|
-
const cliOptions = parseCliArguments();
|
|
773
|
+
const { rawArgs,...cliOptions } = parseCliArguments();
|
|
1747
774
|
if (cliOptions.config || cliOptions.config === "") {
|
|
1748
|
-
await bundleWithConfig(cliOptions.config, cliOptions);
|
|
775
|
+
await bundleWithConfig(cliOptions.config, cliOptions, rawArgs);
|
|
1749
776
|
return;
|
|
1750
777
|
}
|
|
1751
778
|
if ("input" in cliOptions.input) {
|