rolldown 1.0.0-beta.43 → 1.0.0-beta.44
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/bin/cli.mjs +1 -0
- package/dist/cli-setup.d.mts +1 -0
- package/dist/cli-setup.mjs +16 -0
- package/dist/cli.mjs +1049 -75
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +5 -4
- package/dist/experimental-index.d.mts +20 -5
- package/dist/experimental-index.mjs +39 -15
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -3
- package/dist/parallel-plugin-worker.mjs +4 -3
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -1
- package/dist/shared/{parse-ast-index-DkUtf7vl.mjs → binding-DkR1uPxc.mjs} +97 -360
- package/dist/shared/{binding-BkaKdpud.d.mts → binding-QBosa6N8.d.mts} +89 -14
- package/dist/shared/{define-config-BGtNx9V_.d.mts → define-config-D9LwN_tW.d.mts} +193 -87
- package/dist/shared/{load-config-CLB1MN5j.mjs → load-config-BwIN-FIB.mjs} +2 -2
- package/dist/shared/{misc-CQeo-AFx.mjs → misc-usdOVIou.mjs} +1 -1
- package/dist/shared/parse-ast-index-Dee9Dv5S.mjs +297 -0
- package/dist/shared/{prompt-B4e-jZUR.mjs → prompt-YGfbLmz5.mjs} +1 -1
- package/dist/shared/{src-DucjDcdj.mjs → src-DY4_vVWu.mjs} +85 -88
- package/package.json +19 -20
- package/dist/shared/logger-B83ocDok.mjs +0 -985
package/dist/cli.mjs
CHANGED
|
@@ -1,14 +1,993 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { loadConfig } from "./shared/load-config-
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
import
|
|
8
|
-
import { parseArgs } from "node:util";
|
|
1
|
+
import "./shared/binding-DkR1uPxc.mjs";
|
|
2
|
+
import { C as onExit, S as version, _ as validateCliOptions, a as rolldown, g as getOutputCliKeys, h as getInputCliKeys, m as getCliSchemaInfo, r as watch, x as description } from "./shared/src-DY4_vVWu.mjs";
|
|
3
|
+
import { h as styleText$1 } from "./shared/parse-ast-index-Dee9Dv5S.mjs";
|
|
4
|
+
import { t as arraify } from "./shared/misc-usdOVIou.mjs";
|
|
5
|
+
import { t as loadConfig } from "./shared/load-config-BwIN-FIB.mjs";
|
|
6
|
+
import path, { sep } from "node:path";
|
|
7
|
+
import { formatWithOptions, parseArgs } from "node:util";
|
|
9
8
|
import process$1 from "node:process";
|
|
9
|
+
import * as tty from "node:tty";
|
|
10
10
|
import { performance } from "node:perf_hooks";
|
|
11
11
|
|
|
12
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
13
|
+
const LogLevels = {
|
|
14
|
+
silent: Number.NEGATIVE_INFINITY,
|
|
15
|
+
fatal: 0,
|
|
16
|
+
error: 0,
|
|
17
|
+
warn: 1,
|
|
18
|
+
log: 2,
|
|
19
|
+
info: 3,
|
|
20
|
+
success: 3,
|
|
21
|
+
fail: 3,
|
|
22
|
+
ready: 3,
|
|
23
|
+
start: 3,
|
|
24
|
+
box: 3,
|
|
25
|
+
debug: 4,
|
|
26
|
+
trace: 5,
|
|
27
|
+
verbose: Number.POSITIVE_INFINITY
|
|
28
|
+
};
|
|
29
|
+
const LogTypes = {
|
|
30
|
+
silent: { level: -1 },
|
|
31
|
+
fatal: { level: LogLevels.fatal },
|
|
32
|
+
error: { level: LogLevels.error },
|
|
33
|
+
warn: { level: LogLevels.warn },
|
|
34
|
+
log: { level: LogLevels.log },
|
|
35
|
+
info: { level: LogLevels.info },
|
|
36
|
+
success: { level: LogLevels.success },
|
|
37
|
+
fail: { level: LogLevels.fail },
|
|
38
|
+
ready: { level: LogLevels.info },
|
|
39
|
+
start: { level: LogLevels.info },
|
|
40
|
+
box: { level: LogLevels.info },
|
|
41
|
+
debug: { level: LogLevels.debug },
|
|
42
|
+
trace: { level: LogLevels.trace },
|
|
43
|
+
verbose: { level: LogLevels.verbose }
|
|
44
|
+
};
|
|
45
|
+
function isPlainObject$1(value) {
|
|
46
|
+
if (value === null || typeof value !== "object") return false;
|
|
47
|
+
const prototype = Object.getPrototypeOf(value);
|
|
48
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
49
|
+
if (Symbol.iterator in value) return false;
|
|
50
|
+
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
54
|
+
if (!isPlainObject$1(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
55
|
+
const object = Object.assign({}, defaults);
|
|
56
|
+
for (const key in baseObject) {
|
|
57
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
58
|
+
const value = baseObject[key];
|
|
59
|
+
if (value === null || value === void 0) continue;
|
|
60
|
+
if (merger && merger(object, key, value, namespace)) continue;
|
|
61
|
+
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
62
|
+
else if (isPlainObject$1(value) && isPlainObject$1(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
63
|
+
else object[key] = value;
|
|
64
|
+
}
|
|
65
|
+
return object;
|
|
66
|
+
}
|
|
67
|
+
function createDefu(merger) {
|
|
68
|
+
return (...arguments_) => arguments_.reduce((p, c$1) => _defu(p, c$1, "", merger), {});
|
|
69
|
+
}
|
|
70
|
+
const defu = createDefu();
|
|
71
|
+
function isPlainObject(obj) {
|
|
72
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
73
|
+
}
|
|
74
|
+
function isLogObj(arg) {
|
|
75
|
+
if (!isPlainObject(arg)) return false;
|
|
76
|
+
if (!arg.message && !arg.args) return false;
|
|
77
|
+
if (arg.stack) return false;
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
let paused = false;
|
|
81
|
+
const queue = [];
|
|
82
|
+
var Consola = class Consola {
|
|
83
|
+
options;
|
|
84
|
+
_lastLog;
|
|
85
|
+
_mockFn;
|
|
86
|
+
/**
|
|
87
|
+
* Creates an instance of Consola with specified options or defaults.
|
|
88
|
+
*
|
|
89
|
+
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
90
|
+
*/
|
|
91
|
+
constructor(options$1 = {}) {
|
|
92
|
+
const types = options$1.types || LogTypes;
|
|
93
|
+
this.options = defu({
|
|
94
|
+
...options$1,
|
|
95
|
+
defaults: { ...options$1.defaults },
|
|
96
|
+
level: _normalizeLogLevel(options$1.level, types),
|
|
97
|
+
reporters: [...options$1.reporters || []]
|
|
98
|
+
}, {
|
|
99
|
+
types: LogTypes,
|
|
100
|
+
throttle: 1e3,
|
|
101
|
+
throttleMin: 5,
|
|
102
|
+
formatOptions: {
|
|
103
|
+
date: true,
|
|
104
|
+
colors: false,
|
|
105
|
+
compact: true
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
for (const type in types) {
|
|
109
|
+
const defaults = {
|
|
110
|
+
type,
|
|
111
|
+
...this.options.defaults,
|
|
112
|
+
...types[type]
|
|
113
|
+
};
|
|
114
|
+
this[type] = this._wrapLogFn(defaults);
|
|
115
|
+
this[type].raw = this._wrapLogFn(defaults, true);
|
|
116
|
+
}
|
|
117
|
+
if (this.options.mockFn) this.mockTypes();
|
|
118
|
+
this._lastLog = {};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Gets the current log level of the Consola instance.
|
|
122
|
+
*
|
|
123
|
+
* @returns {number} The current log level.
|
|
124
|
+
*/
|
|
125
|
+
get level() {
|
|
126
|
+
return this.options.level;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Sets the minimum log level that will be output by the instance.
|
|
130
|
+
*
|
|
131
|
+
* @param {number} level - The new log level to set.
|
|
132
|
+
*/
|
|
133
|
+
set level(level) {
|
|
134
|
+
this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Displays a prompt to the user and returns the response.
|
|
138
|
+
* Throw an error if `prompt` is not supported by the current configuration.
|
|
139
|
+
*
|
|
140
|
+
* @template T
|
|
141
|
+
* @param {string} message - The message to display in the prompt.
|
|
142
|
+
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
143
|
+
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
144
|
+
*/
|
|
145
|
+
prompt(message, opts) {
|
|
146
|
+
if (!this.options.prompt) throw new Error("prompt is not supported!");
|
|
147
|
+
return this.options.prompt(message, opts);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
151
|
+
*
|
|
152
|
+
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
153
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
154
|
+
*/
|
|
155
|
+
create(options$1) {
|
|
156
|
+
const instance = new Consola({
|
|
157
|
+
...this.options,
|
|
158
|
+
...options$1
|
|
159
|
+
});
|
|
160
|
+
if (this._mockFn) instance.mockTypes(this._mockFn);
|
|
161
|
+
return instance;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Creates a new Consola instance with the specified default log object properties.
|
|
165
|
+
*
|
|
166
|
+
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
167
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
168
|
+
*/
|
|
169
|
+
withDefaults(defaults) {
|
|
170
|
+
return this.create({
|
|
171
|
+
...this.options,
|
|
172
|
+
defaults: {
|
|
173
|
+
...this.options.defaults,
|
|
174
|
+
...defaults
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
180
|
+
*
|
|
181
|
+
* @param {string} tag - The tag to include in each log of the new instance.
|
|
182
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
183
|
+
*/
|
|
184
|
+
withTag(tag) {
|
|
185
|
+
return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Adds a custom reporter to the Consola instance.
|
|
189
|
+
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
190
|
+
*
|
|
191
|
+
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
192
|
+
* @returns {Consola} The current Consola instance.
|
|
193
|
+
*/
|
|
194
|
+
addReporter(reporter) {
|
|
195
|
+
this.options.reporters.push(reporter);
|
|
196
|
+
return this;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Removes a custom reporter from the Consola instance.
|
|
200
|
+
* If no reporter is specified, all reporters will be removed.
|
|
201
|
+
*
|
|
202
|
+
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
203
|
+
* @returns {Consola} The current Consola instance.
|
|
204
|
+
*/
|
|
205
|
+
removeReporter(reporter) {
|
|
206
|
+
if (reporter) {
|
|
207
|
+
const i$1 = this.options.reporters.indexOf(reporter);
|
|
208
|
+
if (i$1 !== -1) return this.options.reporters.splice(i$1, 1);
|
|
209
|
+
} else this.options.reporters.splice(0);
|
|
210
|
+
return this;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
214
|
+
*
|
|
215
|
+
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
216
|
+
* @returns {Consola} The current Consola instance.
|
|
217
|
+
*/
|
|
218
|
+
setReporters(reporters) {
|
|
219
|
+
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
220
|
+
return this;
|
|
221
|
+
}
|
|
222
|
+
wrapAll() {
|
|
223
|
+
this.wrapConsole();
|
|
224
|
+
this.wrapStd();
|
|
225
|
+
}
|
|
226
|
+
restoreAll() {
|
|
227
|
+
this.restoreConsole();
|
|
228
|
+
this.restoreStd();
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Overrides console methods with Consola logging methods for consistent logging.
|
|
232
|
+
*/
|
|
233
|
+
wrapConsole() {
|
|
234
|
+
for (const type in this.options.types) {
|
|
235
|
+
if (!console["__" + type]) console["__" + type] = console[type];
|
|
236
|
+
console[type] = this[type].raw;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Restores the original console methods, removing Consola overrides.
|
|
241
|
+
*/
|
|
242
|
+
restoreConsole() {
|
|
243
|
+
for (const type in this.options.types) if (console["__" + type]) {
|
|
244
|
+
console[type] = console["__" + type];
|
|
245
|
+
delete console["__" + type];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Overrides standard output and error streams to redirect them through Consola.
|
|
250
|
+
*/
|
|
251
|
+
wrapStd() {
|
|
252
|
+
this._wrapStream(this.options.stdout, "log");
|
|
253
|
+
this._wrapStream(this.options.stderr, "log");
|
|
254
|
+
}
|
|
255
|
+
_wrapStream(stream, type) {
|
|
256
|
+
if (!stream) return;
|
|
257
|
+
if (!stream.__write) stream.__write = stream.write;
|
|
258
|
+
stream.write = (data) => {
|
|
259
|
+
this[type].raw(String(data).trim());
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
264
|
+
*/
|
|
265
|
+
restoreStd() {
|
|
266
|
+
this._restoreStream(this.options.stdout);
|
|
267
|
+
this._restoreStream(this.options.stderr);
|
|
268
|
+
}
|
|
269
|
+
_restoreStream(stream) {
|
|
270
|
+
if (!stream) return;
|
|
271
|
+
if (stream.__write) {
|
|
272
|
+
stream.write = stream.__write;
|
|
273
|
+
delete stream.__write;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Pauses logging, queues incoming logs until resumed.
|
|
278
|
+
*/
|
|
279
|
+
pauseLogs() {
|
|
280
|
+
paused = true;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Resumes logging, processing any queued logs.
|
|
284
|
+
*/
|
|
285
|
+
resumeLogs() {
|
|
286
|
+
paused = false;
|
|
287
|
+
const _queue = queue.splice(0);
|
|
288
|
+
for (const item of _queue) item[0]._logFn(item[1], item[2]);
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Replaces logging methods with mocks if a mock function is provided.
|
|
292
|
+
*
|
|
293
|
+
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
294
|
+
*/
|
|
295
|
+
mockTypes(mockFn) {
|
|
296
|
+
const _mockFn = mockFn || this.options.mockFn;
|
|
297
|
+
this._mockFn = _mockFn;
|
|
298
|
+
if (typeof _mockFn !== "function") return;
|
|
299
|
+
for (const type in this.options.types) {
|
|
300
|
+
this[type] = _mockFn(type, this.options.types[type]) || this[type];
|
|
301
|
+
this[type].raw = this[type];
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
_wrapLogFn(defaults, isRaw) {
|
|
305
|
+
return (...args) => {
|
|
306
|
+
if (paused) {
|
|
307
|
+
queue.push([
|
|
308
|
+
this,
|
|
309
|
+
defaults,
|
|
310
|
+
args,
|
|
311
|
+
isRaw
|
|
312
|
+
]);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
return this._logFn(defaults, args, isRaw);
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
_logFn(defaults, args, isRaw) {
|
|
319
|
+
if ((defaults.level || 0) > this.level) return false;
|
|
320
|
+
const logObj = {
|
|
321
|
+
date: /* @__PURE__ */ new Date(),
|
|
322
|
+
args: [],
|
|
323
|
+
...defaults,
|
|
324
|
+
level: _normalizeLogLevel(defaults.level, this.options.types)
|
|
325
|
+
};
|
|
326
|
+
if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
|
|
327
|
+
else logObj.args = [...args];
|
|
328
|
+
if (logObj.message) {
|
|
329
|
+
logObj.args.unshift(logObj.message);
|
|
330
|
+
delete logObj.message;
|
|
331
|
+
}
|
|
332
|
+
if (logObj.additional) {
|
|
333
|
+
if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
|
|
334
|
+
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
335
|
+
delete logObj.additional;
|
|
336
|
+
}
|
|
337
|
+
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
338
|
+
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
339
|
+
const resolveLog = (newLog = false) => {
|
|
340
|
+
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
341
|
+
if (this._lastLog.object && repeated > 0) {
|
|
342
|
+
const args2 = [...this._lastLog.object.args];
|
|
343
|
+
if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
|
|
344
|
+
this._log({
|
|
345
|
+
...this._lastLog.object,
|
|
346
|
+
args: args2
|
|
347
|
+
});
|
|
348
|
+
this._lastLog.count = 1;
|
|
349
|
+
}
|
|
350
|
+
if (newLog) {
|
|
351
|
+
this._lastLog.object = logObj;
|
|
352
|
+
this._log(logObj);
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
clearTimeout(this._lastLog.timeout);
|
|
356
|
+
const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
357
|
+
this._lastLog.time = logObj.date;
|
|
358
|
+
if (diffTime < this.options.throttle) try {
|
|
359
|
+
const serializedLog = JSON.stringify([
|
|
360
|
+
logObj.type,
|
|
361
|
+
logObj.tag,
|
|
362
|
+
logObj.args
|
|
363
|
+
]);
|
|
364
|
+
const isSameLog = this._lastLog.serialized === serializedLog;
|
|
365
|
+
this._lastLog.serialized = serializedLog;
|
|
366
|
+
if (isSameLog) {
|
|
367
|
+
this._lastLog.count = (this._lastLog.count || 0) + 1;
|
|
368
|
+
if (this._lastLog.count > this.options.throttleMin) {
|
|
369
|
+
this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
} catch {}
|
|
374
|
+
resolveLog(true);
|
|
375
|
+
}
|
|
376
|
+
_log(logObj) {
|
|
377
|
+
for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
381
|
+
if (input === void 0) return defaultLevel;
|
|
382
|
+
if (typeof input === "number") return input;
|
|
383
|
+
if (types[input] && types[input].level !== void 0) return types[input].level;
|
|
384
|
+
return defaultLevel;
|
|
385
|
+
}
|
|
386
|
+
Consola.prototype.add = Consola.prototype.addReporter;
|
|
387
|
+
Consola.prototype.remove = Consola.prototype.removeReporter;
|
|
388
|
+
Consola.prototype.clear = Consola.prototype.removeReporter;
|
|
389
|
+
Consola.prototype.withScope = Consola.prototype.withTag;
|
|
390
|
+
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
391
|
+
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
392
|
+
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
393
|
+
function createConsola$1(options$1 = {}) {
|
|
394
|
+
return new Consola(options$1);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
|
|
399
|
+
function parseStack(stack, message) {
|
|
400
|
+
const cwd$1 = process.cwd() + sep;
|
|
401
|
+
return stack.split("\n").splice(message.split("\n").length).map((l$1) => l$1.trim().replace("file://", "").replace(cwd$1, ""));
|
|
402
|
+
}
|
|
403
|
+
function writeStream(data, stream) {
|
|
404
|
+
return (stream.__write || stream.write).call(stream, data);
|
|
405
|
+
}
|
|
406
|
+
const bracket = (x) => x ? `[${x}]` : "";
|
|
407
|
+
var BasicReporter = class {
|
|
408
|
+
formatStack(stack, message, opts) {
|
|
409
|
+
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
410
|
+
return indent + parseStack(stack, message).join(`
|
|
411
|
+
${indent}`);
|
|
412
|
+
}
|
|
413
|
+
formatError(err, opts) {
|
|
414
|
+
const message = err.message ?? formatWithOptions(opts, err);
|
|
415
|
+
const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
|
|
416
|
+
const level = opts?.errorLevel || 0;
|
|
417
|
+
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
|
|
418
|
+
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
|
|
419
|
+
...opts,
|
|
420
|
+
errorLevel: level + 1
|
|
421
|
+
}) : "";
|
|
422
|
+
return causedPrefix + message + "\n" + stack + causedError;
|
|
423
|
+
}
|
|
424
|
+
formatArgs(args, opts) {
|
|
425
|
+
return formatWithOptions(opts, ...args.map((arg) => {
|
|
426
|
+
if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
|
|
427
|
+
return arg;
|
|
428
|
+
}));
|
|
429
|
+
}
|
|
430
|
+
formatDate(date, opts) {
|
|
431
|
+
return opts.date ? date.toLocaleTimeString() : "";
|
|
432
|
+
}
|
|
433
|
+
filterAndJoin(arr) {
|
|
434
|
+
return arr.filter(Boolean).join(" ");
|
|
435
|
+
}
|
|
436
|
+
formatLogObj(logObj, opts) {
|
|
437
|
+
const message = this.formatArgs(logObj.args, opts);
|
|
438
|
+
if (logObj.type === "box") return "\n" + [
|
|
439
|
+
bracket(logObj.tag),
|
|
440
|
+
logObj.title && logObj.title,
|
|
441
|
+
...message.split("\n")
|
|
442
|
+
].filter(Boolean).map((l$1) => " > " + l$1).join("\n") + "\n";
|
|
443
|
+
return this.filterAndJoin([
|
|
444
|
+
bracket(logObj.type),
|
|
445
|
+
bracket(logObj.tag),
|
|
446
|
+
message
|
|
447
|
+
]);
|
|
448
|
+
}
|
|
449
|
+
log(logObj, ctx) {
|
|
450
|
+
return writeStream(this.formatLogObj(logObj, {
|
|
451
|
+
columns: ctx.options.stdout.columns || 0,
|
|
452
|
+
...ctx.options.formatOptions
|
|
453
|
+
}) + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
|
|
459
|
+
const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
460
|
+
const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
461
|
+
const isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
462
|
+
const isWindows = platform === "win32";
|
|
463
|
+
const isDumbTerminal = env.TERM === "dumb";
|
|
464
|
+
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
465
|
+
const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
466
|
+
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
467
|
+
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)) {
|
|
468
|
+
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
469
|
+
}
|
|
470
|
+
function clearBleed(index, string, open, close, replace) {
|
|
471
|
+
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
472
|
+
}
|
|
473
|
+
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
474
|
+
return (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
475
|
+
}
|
|
476
|
+
function init(open, close, replace) {
|
|
477
|
+
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
478
|
+
}
|
|
479
|
+
const colorDefs = {
|
|
480
|
+
reset: init(0, 0),
|
|
481
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
482
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
483
|
+
italic: init(3, 23),
|
|
484
|
+
underline: init(4, 24),
|
|
485
|
+
inverse: init(7, 27),
|
|
486
|
+
hidden: init(8, 28),
|
|
487
|
+
strikethrough: init(9, 29),
|
|
488
|
+
black: init(30, 39),
|
|
489
|
+
red: init(31, 39),
|
|
490
|
+
green: init(32, 39),
|
|
491
|
+
yellow: init(33, 39),
|
|
492
|
+
blue: init(34, 39),
|
|
493
|
+
magenta: init(35, 39),
|
|
494
|
+
cyan: init(36, 39),
|
|
495
|
+
white: init(37, 39),
|
|
496
|
+
gray: init(90, 39),
|
|
497
|
+
bgBlack: init(40, 49),
|
|
498
|
+
bgRed: init(41, 49),
|
|
499
|
+
bgGreen: init(42, 49),
|
|
500
|
+
bgYellow: init(43, 49),
|
|
501
|
+
bgBlue: init(44, 49),
|
|
502
|
+
bgMagenta: init(45, 49),
|
|
503
|
+
bgCyan: init(46, 49),
|
|
504
|
+
bgWhite: init(47, 49),
|
|
505
|
+
blackBright: init(90, 39),
|
|
506
|
+
redBright: init(91, 39),
|
|
507
|
+
greenBright: init(92, 39),
|
|
508
|
+
yellowBright: init(93, 39),
|
|
509
|
+
blueBright: init(94, 39),
|
|
510
|
+
magentaBright: init(95, 39),
|
|
511
|
+
cyanBright: init(96, 39),
|
|
512
|
+
whiteBright: init(97, 39),
|
|
513
|
+
bgBlackBright: init(100, 49),
|
|
514
|
+
bgRedBright: init(101, 49),
|
|
515
|
+
bgGreenBright: init(102, 49),
|
|
516
|
+
bgYellowBright: init(103, 49),
|
|
517
|
+
bgBlueBright: init(104, 49),
|
|
518
|
+
bgMagentaBright: init(105, 49),
|
|
519
|
+
bgCyanBright: init(106, 49),
|
|
520
|
+
bgWhiteBright: init(107, 49)
|
|
521
|
+
};
|
|
522
|
+
function createColors(useColor = isColorSupported) {
|
|
523
|
+
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
524
|
+
}
|
|
525
|
+
const colors = createColors();
|
|
526
|
+
function getColor$1(color, fallback = "reset") {
|
|
527
|
+
return colors[color] || colors[fallback];
|
|
528
|
+
}
|
|
529
|
+
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("|");
|
|
530
|
+
function stripAnsi(text) {
|
|
531
|
+
return text.replace(new RegExp(ansiRegex$1, "g"), "");
|
|
532
|
+
}
|
|
533
|
+
const boxStylePresets = {
|
|
534
|
+
solid: {
|
|
535
|
+
tl: "┌",
|
|
536
|
+
tr: "┐",
|
|
537
|
+
bl: "└",
|
|
538
|
+
br: "┘",
|
|
539
|
+
h: "─",
|
|
540
|
+
v: "│"
|
|
541
|
+
},
|
|
542
|
+
double: {
|
|
543
|
+
tl: "╔",
|
|
544
|
+
tr: "╗",
|
|
545
|
+
bl: "╚",
|
|
546
|
+
br: "╝",
|
|
547
|
+
h: "═",
|
|
548
|
+
v: "║"
|
|
549
|
+
},
|
|
550
|
+
doubleSingle: {
|
|
551
|
+
tl: "╓",
|
|
552
|
+
tr: "╖",
|
|
553
|
+
bl: "╙",
|
|
554
|
+
br: "╜",
|
|
555
|
+
h: "─",
|
|
556
|
+
v: "║"
|
|
557
|
+
},
|
|
558
|
+
doubleSingleRounded: {
|
|
559
|
+
tl: "╭",
|
|
560
|
+
tr: "╮",
|
|
561
|
+
bl: "╰",
|
|
562
|
+
br: "╯",
|
|
563
|
+
h: "─",
|
|
564
|
+
v: "║"
|
|
565
|
+
},
|
|
566
|
+
singleThick: {
|
|
567
|
+
tl: "┏",
|
|
568
|
+
tr: "┓",
|
|
569
|
+
bl: "┗",
|
|
570
|
+
br: "┛",
|
|
571
|
+
h: "━",
|
|
572
|
+
v: "┃"
|
|
573
|
+
},
|
|
574
|
+
singleDouble: {
|
|
575
|
+
tl: "╒",
|
|
576
|
+
tr: "╕",
|
|
577
|
+
bl: "╘",
|
|
578
|
+
br: "╛",
|
|
579
|
+
h: "═",
|
|
580
|
+
v: "│"
|
|
581
|
+
},
|
|
582
|
+
singleDoubleRounded: {
|
|
583
|
+
tl: "╭",
|
|
584
|
+
tr: "╮",
|
|
585
|
+
bl: "╰",
|
|
586
|
+
br: "╯",
|
|
587
|
+
h: "═",
|
|
588
|
+
v: "│"
|
|
589
|
+
},
|
|
590
|
+
rounded: {
|
|
591
|
+
tl: "╭",
|
|
592
|
+
tr: "╮",
|
|
593
|
+
bl: "╰",
|
|
594
|
+
br: "╯",
|
|
595
|
+
h: "─",
|
|
596
|
+
v: "│"
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
const defaultStyle = {
|
|
600
|
+
borderColor: "white",
|
|
601
|
+
borderStyle: "rounded",
|
|
602
|
+
valign: "center",
|
|
603
|
+
padding: 2,
|
|
604
|
+
marginLeft: 1,
|
|
605
|
+
marginTop: 1,
|
|
606
|
+
marginBottom: 1
|
|
607
|
+
};
|
|
608
|
+
function box(text, _opts = {}) {
|
|
609
|
+
const opts = {
|
|
610
|
+
..._opts,
|
|
611
|
+
style: {
|
|
612
|
+
...defaultStyle,
|
|
613
|
+
..._opts.style
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
const textLines = text.split("\n");
|
|
617
|
+
const boxLines = [];
|
|
618
|
+
const _color = getColor$1(opts.style.borderColor);
|
|
619
|
+
const borderStyle = { ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle };
|
|
620
|
+
if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
|
|
621
|
+
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
622
|
+
const height = textLines.length + paddingOffset;
|
|
623
|
+
const width = Math.max(...textLines.map((line) => stripAnsi(line).length), opts.title ? stripAnsi(opts.title).length : 0) + paddingOffset;
|
|
624
|
+
const widthOffset = width + paddingOffset;
|
|
625
|
+
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
626
|
+
if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
|
|
627
|
+
if (opts.title) {
|
|
628
|
+
const title = _color ? _color(opts.title) : opts.title;
|
|
629
|
+
const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
|
|
630
|
+
const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
|
|
631
|
+
boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
|
|
632
|
+
} else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
|
|
633
|
+
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
634
|
+
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}`);
|
|
635
|
+
else {
|
|
636
|
+
const line = textLines[i$1 - valignOffset];
|
|
637
|
+
const left = " ".repeat(paddingOffset);
|
|
638
|
+
const right = " ".repeat(width - stripAnsi(line).length);
|
|
639
|
+
boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
|
|
640
|
+
}
|
|
641
|
+
boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
|
|
642
|
+
if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
|
|
643
|
+
return boxLines.join("\n");
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
|
|
648
|
+
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, {
|
|
649
|
+
get(e, s$1) {
|
|
650
|
+
return i()[s$1] ?? r[s$1];
|
|
651
|
+
},
|
|
652
|
+
has(e, s$1) {
|
|
653
|
+
return s$1 in i() || s$1 in r;
|
|
654
|
+
},
|
|
655
|
+
set(e, s$1, E) {
|
|
656
|
+
const B = i(true);
|
|
657
|
+
return B[s$1] = E, true;
|
|
658
|
+
},
|
|
659
|
+
deleteProperty(e, s$1) {
|
|
660
|
+
if (!s$1) return false;
|
|
661
|
+
const E = i(true);
|
|
662
|
+
return delete E[s$1], true;
|
|
663
|
+
},
|
|
664
|
+
ownKeys() {
|
|
665
|
+
const e = i(true);
|
|
666
|
+
return Object.keys(e);
|
|
667
|
+
}
|
|
668
|
+
}), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
|
|
669
|
+
["APPVEYOR"],
|
|
670
|
+
[
|
|
671
|
+
"AWS_AMPLIFY",
|
|
672
|
+
"AWS_APP_ID",
|
|
673
|
+
{ ci: true }
|
|
674
|
+
],
|
|
675
|
+
["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
|
|
676
|
+
["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
|
|
677
|
+
["APPCIRCLE", "AC_APPCIRCLE"],
|
|
678
|
+
["BAMBOO", "bamboo_planKey"],
|
|
679
|
+
["BITBUCKET", "BITBUCKET_COMMIT"],
|
|
680
|
+
["BITRISE", "BITRISE_IO"],
|
|
681
|
+
["BUDDY", "BUDDY_WORKSPACE_ID"],
|
|
682
|
+
["BUILDKITE"],
|
|
683
|
+
["CIRCLE", "CIRCLECI"],
|
|
684
|
+
["CIRRUS", "CIRRUS_CI"],
|
|
685
|
+
[
|
|
686
|
+
"CLOUDFLARE_PAGES",
|
|
687
|
+
"CF_PAGES",
|
|
688
|
+
{ ci: true }
|
|
689
|
+
],
|
|
690
|
+
["CODEBUILD", "CODEBUILD_BUILD_ARN"],
|
|
691
|
+
["CODEFRESH", "CF_BUILD_ID"],
|
|
692
|
+
["DRONE"],
|
|
693
|
+
["DRONE", "DRONE_BUILD_EVENT"],
|
|
694
|
+
["DSARI"],
|
|
695
|
+
["GITHUB_ACTIONS"],
|
|
696
|
+
["GITLAB", "GITLAB_CI"],
|
|
697
|
+
["GITLAB", "CI_MERGE_REQUEST_ID"],
|
|
698
|
+
["GOCD", "GO_PIPELINE_LABEL"],
|
|
699
|
+
["LAYERCI"],
|
|
700
|
+
["HUDSON", "HUDSON_URL"],
|
|
701
|
+
["JENKINS", "JENKINS_URL"],
|
|
702
|
+
["MAGNUM"],
|
|
703
|
+
["NETLIFY"],
|
|
704
|
+
[
|
|
705
|
+
"NETLIFY",
|
|
706
|
+
"NETLIFY_LOCAL",
|
|
707
|
+
{ ci: false }
|
|
708
|
+
],
|
|
709
|
+
["NEVERCODE"],
|
|
710
|
+
["RENDER"],
|
|
711
|
+
["SAIL", "SAILCI"],
|
|
712
|
+
["SEMAPHORE"],
|
|
713
|
+
["SCREWDRIVER"],
|
|
714
|
+
["SHIPPABLE"],
|
|
715
|
+
["SOLANO", "TDDIUM"],
|
|
716
|
+
["STRIDER"],
|
|
717
|
+
["TEAMCITY", "TEAMCITY_VERSION"],
|
|
718
|
+
["TRAVIS"],
|
|
719
|
+
["VERCEL", "NOW_BUILDER"],
|
|
720
|
+
[
|
|
721
|
+
"VERCEL",
|
|
722
|
+
"VERCEL",
|
|
723
|
+
{ ci: false }
|
|
724
|
+
],
|
|
725
|
+
[
|
|
726
|
+
"VERCEL",
|
|
727
|
+
"VERCEL_ENV",
|
|
728
|
+
{ ci: false }
|
|
729
|
+
],
|
|
730
|
+
["APPCENTER", "APPCENTER_BUILD_ID"],
|
|
731
|
+
[
|
|
732
|
+
"CODESANDBOX",
|
|
733
|
+
"CODESANDBOX_SSE",
|
|
734
|
+
{ ci: false }
|
|
735
|
+
],
|
|
736
|
+
[
|
|
737
|
+
"CODESANDBOX",
|
|
738
|
+
"CODESANDBOX_HOST",
|
|
739
|
+
{ ci: false }
|
|
740
|
+
],
|
|
741
|
+
["STACKBLITZ"],
|
|
742
|
+
["STORMKIT"],
|
|
743
|
+
["CLEAVR"],
|
|
744
|
+
["ZEABUR"],
|
|
745
|
+
[
|
|
746
|
+
"CODESPHERE",
|
|
747
|
+
"CODESPHERE_APP_ID",
|
|
748
|
+
{ ci: true }
|
|
749
|
+
],
|
|
750
|
+
["RAILWAY", "RAILWAY_PROJECT_ID"],
|
|
751
|
+
["RAILWAY", "RAILWAY_SERVICE_ID"],
|
|
752
|
+
["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
|
|
753
|
+
[
|
|
754
|
+
"FIREBASE_APP_HOSTING",
|
|
755
|
+
"FIREBASE_APP_HOSTING",
|
|
756
|
+
{ ci: true }
|
|
757
|
+
]
|
|
758
|
+
];
|
|
759
|
+
function b() {
|
|
760
|
+
if (globalThis.process?.env) for (const e of f) {
|
|
761
|
+
const s$1 = e[1] || e[0];
|
|
762
|
+
if (globalThis.process?.env[s$1]) return {
|
|
763
|
+
name: e[0].toLowerCase(),
|
|
764
|
+
...e[2]
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? {
|
|
768
|
+
name: "stackblitz",
|
|
769
|
+
ci: false
|
|
770
|
+
} : {
|
|
771
|
+
name: "",
|
|
772
|
+
ci: false
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
const l = b();
|
|
776
|
+
l.name;
|
|
777
|
+
function n(e) {
|
|
778
|
+
return e ? e !== "false" : false;
|
|
779
|
+
}
|
|
780
|
+
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);
|
|
781
|
+
n(o.MINIMAL);
|
|
782
|
+
const A = /^win/i.test(I);
|
|
783
|
+
!n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM);
|
|
784
|
+
const C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
|
|
785
|
+
Number(C?.split(".")[0]);
|
|
786
|
+
const y = globalThis.process || Object.create(null), _ = { versions: {} };
|
|
787
|
+
new Proxy(y, { get(e, s$1) {
|
|
788
|
+
if (s$1 === "env") return o;
|
|
789
|
+
if (s$1 in e) return e[s$1];
|
|
790
|
+
if (s$1 in _) return _[s$1];
|
|
791
|
+
} });
|
|
792
|
+
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 = [
|
|
793
|
+
[S, "netlify"],
|
|
794
|
+
[u, "edge-light"],
|
|
795
|
+
[N, "workerd"],
|
|
796
|
+
[L, "fastly"],
|
|
797
|
+
[D, "deno"],
|
|
798
|
+
[O, "bun"],
|
|
799
|
+
[c, "node"]
|
|
800
|
+
];
|
|
801
|
+
function G() {
|
|
802
|
+
const e = F.find((s$1) => s$1[0]);
|
|
803
|
+
if (e) return { name: e[1] };
|
|
804
|
+
}
|
|
805
|
+
G()?.name;
|
|
806
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
807
|
+
const pattern = [`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`, "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
808
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
809
|
+
}
|
|
810
|
+
const regex = ansiRegex();
|
|
811
|
+
function stripAnsi$1(string) {
|
|
812
|
+
if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
813
|
+
return string.replace(regex, "");
|
|
814
|
+
}
|
|
815
|
+
function isAmbiguous(x) {
|
|
816
|
+
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;
|
|
817
|
+
}
|
|
818
|
+
function isFullWidth(x) {
|
|
819
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
820
|
+
}
|
|
821
|
+
function isWide(x) {
|
|
822
|
+
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;
|
|
823
|
+
}
|
|
824
|
+
function validate(codePoint) {
|
|
825
|
+
if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
826
|
+
}
|
|
827
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
828
|
+
validate(codePoint);
|
|
829
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
|
|
830
|
+
return 1;
|
|
831
|
+
}
|
|
832
|
+
const emojiRegex = () => {
|
|
833
|
+
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;
|
|
834
|
+
};
|
|
835
|
+
const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
|
|
836
|
+
const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
837
|
+
function stringWidth$1(string, options$1 = {}) {
|
|
838
|
+
if (typeof string !== "string" || string.length === 0) return 0;
|
|
839
|
+
const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options$1;
|
|
840
|
+
if (!countAnsiEscapeCodes) string = stripAnsi$1(string);
|
|
841
|
+
if (string.length === 0) return 0;
|
|
842
|
+
let width = 0;
|
|
843
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
844
|
+
for (const { segment: character } of segmenter.segment(string)) {
|
|
845
|
+
const codePoint = character.codePointAt(0);
|
|
846
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
|
|
847
|
+
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
|
|
848
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
|
|
849
|
+
if (codePoint >= 55296 && codePoint <= 57343) continue;
|
|
850
|
+
if (codePoint >= 65024 && codePoint <= 65039) continue;
|
|
851
|
+
if (defaultIgnorableCodePointRegex.test(character)) continue;
|
|
852
|
+
if (emojiRegex().test(character)) {
|
|
853
|
+
width += 2;
|
|
854
|
+
continue;
|
|
855
|
+
}
|
|
856
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
857
|
+
}
|
|
858
|
+
return width;
|
|
859
|
+
}
|
|
860
|
+
function isUnicodeSupported() {
|
|
861
|
+
const { env: env$1 } = process$1;
|
|
862
|
+
const { TERM, TERM_PROGRAM } = env$1;
|
|
863
|
+
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
864
|
+
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";
|
|
865
|
+
}
|
|
866
|
+
const TYPE_COLOR_MAP = {
|
|
867
|
+
info: "cyan",
|
|
868
|
+
fail: "red",
|
|
869
|
+
success: "green",
|
|
870
|
+
ready: "green",
|
|
871
|
+
start: "magenta"
|
|
872
|
+
};
|
|
873
|
+
const LEVEL_COLOR_MAP = {
|
|
874
|
+
0: "red",
|
|
875
|
+
1: "yellow"
|
|
876
|
+
};
|
|
877
|
+
const unicode = isUnicodeSupported();
|
|
878
|
+
const s = (c$1, fallback) => unicode ? c$1 : fallback;
|
|
879
|
+
const TYPE_ICONS = {
|
|
880
|
+
error: s("✖", "×"),
|
|
881
|
+
fatal: s("✖", "×"),
|
|
882
|
+
ready: s("✔", "√"),
|
|
883
|
+
warn: s("⚠", "‼"),
|
|
884
|
+
info: s("ℹ", "i"),
|
|
885
|
+
success: s("✔", "√"),
|
|
886
|
+
debug: s("⚙", "D"),
|
|
887
|
+
trace: s("→", "→"),
|
|
888
|
+
fail: s("✖", "×"),
|
|
889
|
+
start: s("◐", "o"),
|
|
890
|
+
log: ""
|
|
891
|
+
};
|
|
892
|
+
function stringWidth(str) {
|
|
893
|
+
if (!(typeof Intl === "object") || !Intl.Segmenter) return stripAnsi(str).length;
|
|
894
|
+
return stringWidth$1(str);
|
|
895
|
+
}
|
|
896
|
+
var FancyReporter = class extends BasicReporter {
|
|
897
|
+
formatStack(stack, message, opts) {
|
|
898
|
+
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
899
|
+
return `
|
|
900
|
+
${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_$1, m) => `(${colors.cyan(m)})`)).join(`
|
|
901
|
+
${indent}`);
|
|
902
|
+
}
|
|
903
|
+
formatType(logObj, isBadge, opts) {
|
|
904
|
+
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
905
|
+
if (isBadge) return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
|
|
906
|
+
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
907
|
+
return _type ? getColor(typeColor)(_type) : "";
|
|
908
|
+
}
|
|
909
|
+
formatLogObj(logObj, opts) {
|
|
910
|
+
const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
|
|
911
|
+
if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
|
|
912
|
+
title: logObj.title ? characterFormat(logObj.title) : void 0,
|
|
913
|
+
style: logObj.style
|
|
914
|
+
});
|
|
915
|
+
const date = this.formatDate(logObj.date, opts);
|
|
916
|
+
const coloredDate = date && colors.gray(date);
|
|
917
|
+
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
918
|
+
const type = this.formatType(logObj, isBadge, opts);
|
|
919
|
+
const tag = logObj.tag ? colors.gray(logObj.tag) : "";
|
|
920
|
+
let line;
|
|
921
|
+
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
922
|
+
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
923
|
+
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
924
|
+
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
|
|
925
|
+
line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
|
|
926
|
+
if (logObj.type === "trace") {
|
|
927
|
+
const _err = /* @__PURE__ */ new Error("Trace: " + logObj.message);
|
|
928
|
+
line += this.formatStack(_err.stack || "", _err.message);
|
|
929
|
+
}
|
|
930
|
+
return isBadge ? "\n" + line + "\n" : line;
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
function characterFormat(str) {
|
|
934
|
+
return str.replace(/`([^`]+)`/gm, (_$1, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_$1, m) => ` ${colors.underline(m)} `);
|
|
935
|
+
}
|
|
936
|
+
function getColor(color = "white") {
|
|
937
|
+
return colors[color] || colors.white;
|
|
938
|
+
}
|
|
939
|
+
function getBgColor(color = "bgWhite") {
|
|
940
|
+
return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
|
|
941
|
+
}
|
|
942
|
+
function createConsola(options$1 = {}) {
|
|
943
|
+
let level = _getDefaultLogLevel();
|
|
944
|
+
if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
|
|
945
|
+
return createConsola$1({
|
|
946
|
+
level,
|
|
947
|
+
defaults: { level },
|
|
948
|
+
stdout: process.stdout,
|
|
949
|
+
stderr: process.stderr,
|
|
950
|
+
prompt: (...args) => import("./shared/prompt-YGfbLmz5.mjs").then((m) => m.prompt(...args)),
|
|
951
|
+
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
952
|
+
...options$1
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
function _getDefaultLogLevel() {
|
|
956
|
+
if (g) return LogLevels.debug;
|
|
957
|
+
if (R) return LogLevels.warn;
|
|
958
|
+
return LogLevels.info;
|
|
959
|
+
}
|
|
960
|
+
const consola = createConsola();
|
|
961
|
+
|
|
962
|
+
//#endregion
|
|
963
|
+
//#region src/cli/logger.ts
|
|
964
|
+
/**
|
|
965
|
+
* Console logger
|
|
966
|
+
*/
|
|
967
|
+
const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
|
|
968
|
+
function createTestingLogger() {
|
|
969
|
+
const types = [
|
|
970
|
+
"silent",
|
|
971
|
+
"fatal",
|
|
972
|
+
"error",
|
|
973
|
+
"warn",
|
|
974
|
+
"log",
|
|
975
|
+
"info",
|
|
976
|
+
"success",
|
|
977
|
+
"fail",
|
|
978
|
+
"ready",
|
|
979
|
+
"start",
|
|
980
|
+
"box",
|
|
981
|
+
"debug",
|
|
982
|
+
"trace",
|
|
983
|
+
"verbose"
|
|
984
|
+
];
|
|
985
|
+
const ret = Object.create(null);
|
|
986
|
+
for (const type of types) ret[type] = console.log;
|
|
987
|
+
return ret;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
//#endregion
|
|
12
991
|
//#region src/cli/arguments/alias.ts
|
|
13
992
|
const alias = {
|
|
14
993
|
config: {
|
|
@@ -53,9 +1032,9 @@ const alias = {
|
|
|
53
1032
|
function setNestedProperty(obj, path$1, value) {
|
|
54
1033
|
const keys = path$1.split(".");
|
|
55
1034
|
let current = obj;
|
|
56
|
-
for (let i = 0; i < keys.length - 1; i++) {
|
|
57
|
-
if (!current[keys[i]]) current[keys[i]] = {};
|
|
58
|
-
current = current[keys[i]];
|
|
1035
|
+
for (let i$1 = 0; i$1 < keys.length - 1; i$1++) {
|
|
1036
|
+
if (!current[keys[i$1]]) current[keys[i$1]] = {};
|
|
1037
|
+
current = current[keys[i$1]];
|
|
59
1038
|
}
|
|
60
1039
|
const finalKey = keys[keys.length - 1];
|
|
61
1040
|
Object.defineProperty(current, finalKey, {
|
|
@@ -212,8 +1191,8 @@ function parseCliArguments() {
|
|
|
212
1191
|
}).filter((item) => {
|
|
213
1192
|
return item !== void 0;
|
|
214
1193
|
});
|
|
215
|
-
invalid_options.sort((a, b) => {
|
|
216
|
-
return a.name.localeCompare(b.name);
|
|
1194
|
+
invalid_options.sort((a$1, b$1) => {
|
|
1195
|
+
return a$1.name.localeCompare(b$1.name);
|
|
217
1196
|
});
|
|
218
1197
|
if (invalid_options.length !== 0) {
|
|
219
1198
|
let single = invalid_options.length === 1;
|
|
@@ -244,32 +1223,32 @@ function getClearScreenFunction(options$1) {
|
|
|
244
1223
|
}
|
|
245
1224
|
|
|
246
1225
|
//#endregion
|
|
247
|
-
//#region \0@oxc-project+runtime@0.
|
|
1226
|
+
//#region \0@oxc-project+runtime@0.95.0/helpers/usingCtx.js
|
|
248
1227
|
function _usingCtx() {
|
|
249
|
-
var r = "function" == typeof SuppressedError ? SuppressedError : function(r$
|
|
250
|
-
var n$
|
|
251
|
-
return n$
|
|
252
|
-
}, e = {}, n = [];
|
|
253
|
-
function using(r$
|
|
1228
|
+
var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
|
|
1229
|
+
var n$2 = Error();
|
|
1230
|
+
return n$2.name = "SuppressedError", n$2.error = r$2, n$2.suppressed = e$1, n$2;
|
|
1231
|
+
}, e = {}, n$1 = [];
|
|
1232
|
+
function using(r$2, e$1) {
|
|
254
1233
|
if (null != e$1) {
|
|
255
1234
|
if (Object(e$1) !== e$1) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
256
|
-
if (r$
|
|
257
|
-
if (void 0 === o && (o = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$
|
|
258
|
-
if ("function" != typeof o) throw new TypeError("Object is not disposable.");
|
|
259
|
-
t && (o = function o$
|
|
1235
|
+
if (r$2) var o$1 = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
|
1236
|
+
if (void 0 === o$1 && (o$1 = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$2)) var t$1 = o$1;
|
|
1237
|
+
if ("function" != typeof o$1) throw new TypeError("Object is not disposable.");
|
|
1238
|
+
t$1 && (o$1 = function o$2() {
|
|
260
1239
|
try {
|
|
261
|
-
t.call(e$1);
|
|
262
|
-
} catch (r$
|
|
263
|
-
return Promise.reject(r$
|
|
1240
|
+
t$1.call(e$1);
|
|
1241
|
+
} catch (r$3) {
|
|
1242
|
+
return Promise.reject(r$3);
|
|
264
1243
|
}
|
|
265
|
-
}), n.push({
|
|
1244
|
+
}), n$1.push({
|
|
266
1245
|
v: e$1,
|
|
267
|
-
d: o,
|
|
268
|
-
a: r$
|
|
1246
|
+
d: o$1,
|
|
1247
|
+
a: r$2
|
|
269
1248
|
});
|
|
270
|
-
} else r$
|
|
1249
|
+
} else r$2 && n$1.push({
|
|
271
1250
|
d: e$1,
|
|
272
|
-
a: r$
|
|
1251
|
+
a: r$2
|
|
273
1252
|
});
|
|
274
1253
|
return e$1;
|
|
275
1254
|
}
|
|
@@ -278,22 +1257,22 @@ function _usingCtx() {
|
|
|
278
1257
|
u: using.bind(null, !1),
|
|
279
1258
|
a: using.bind(null, !0),
|
|
280
1259
|
d: function d() {
|
|
281
|
-
var o, t = this.e, s = 0;
|
|
1260
|
+
var o$1, t$1 = this.e, s$1 = 0;
|
|
282
1261
|
function next() {
|
|
283
|
-
for (; o = n.pop();) try {
|
|
284
|
-
if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
|
|
285
|
-
if (o.d) {
|
|
286
|
-
var r$
|
|
287
|
-
if (o.a) return s |= 2, Promise.resolve(r$
|
|
288
|
-
} else s |= 1;
|
|
289
|
-
} catch (r$
|
|
290
|
-
return err(r$
|
|
1262
|
+
for (; o$1 = n$1.pop();) try {
|
|
1263
|
+
if (!o$1.a && 1 === s$1) return s$1 = 0, n$1.push(o$1), Promise.resolve().then(next);
|
|
1264
|
+
if (o$1.d) {
|
|
1265
|
+
var r$2 = o$1.d.call(o$1.v);
|
|
1266
|
+
if (o$1.a) return s$1 |= 2, Promise.resolve(r$2).then(next, err);
|
|
1267
|
+
} else s$1 |= 1;
|
|
1268
|
+
} catch (r$3) {
|
|
1269
|
+
return err(r$3);
|
|
291
1270
|
}
|
|
292
|
-
if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
|
|
293
|
-
if (t !== e) throw t;
|
|
1271
|
+
if (1 === s$1) return t$1 !== e ? Promise.reject(t$1) : Promise.resolve();
|
|
1272
|
+
if (t$1 !== e) throw t$1;
|
|
294
1273
|
}
|
|
295
|
-
function err(n$
|
|
296
|
-
return t = t !== e ? new r(n$
|
|
1274
|
+
function err(n$2) {
|
|
1275
|
+
return t$1 = t$1 !== e ? new r$1(n$2, t$1) : n$2, next();
|
|
297
1276
|
}
|
|
298
1277
|
return next();
|
|
299
1278
|
}
|
|
@@ -313,13 +1292,8 @@ async function bundleWithConfig(configPath, cliOptions, rawArgs = {}) {
|
|
|
313
1292
|
process.exit(1);
|
|
314
1293
|
}
|
|
315
1294
|
const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
|
|
316
|
-
if (cliOptions.watch)
|
|
317
|
-
|
|
318
|
-
await watchInner(resolvedConfig, cliOptions);
|
|
319
|
-
} else {
|
|
320
|
-
createTokioRuntime(4);
|
|
321
|
-
await bundleInner(resolvedConfig, cliOptions);
|
|
322
|
-
}
|
|
1295
|
+
if (cliOptions.watch) await watchInner(resolvedConfig, cliOptions);
|
|
1296
|
+
else await bundleInner(resolvedConfig, cliOptions);
|
|
323
1297
|
}
|
|
324
1298
|
async function bundleWithCliOptions(cliOptions) {
|
|
325
1299
|
try {
|
|
@@ -338,11 +1312,11 @@ async function bundleWithCliOptions(cliOptions) {
|
|
|
338
1312
|
process.exit(1);
|
|
339
1313
|
}
|
|
340
1314
|
for (const file of outputs) {
|
|
341
|
-
if (outputs.length > 1) logger.log(`\n${
|
|
1315
|
+
if (outputs.length > 1) logger.log(`\n${styleText$1(["cyan", "bold"], `|→ ${file.fileName}:`)}\n`);
|
|
342
1316
|
console.log(file.type === "asset" ? file.source : file.code);
|
|
343
1317
|
}
|
|
344
|
-
} catch (_) {
|
|
345
|
-
_usingCtx$1.e = _;
|
|
1318
|
+
} catch (_$1) {
|
|
1319
|
+
_usingCtx$1.e = _$1;
|
|
346
1320
|
} finally {
|
|
347
1321
|
await _usingCtx$1.d();
|
|
348
1322
|
}
|
|
@@ -378,12 +1352,12 @@ async function watchInner(config, cliOptions) {
|
|
|
378
1352
|
clearScreen?.();
|
|
379
1353
|
break;
|
|
380
1354
|
case "BUNDLE_START":
|
|
381
|
-
if (changedFile.length > 0) logger.log(`Found ${
|
|
1355
|
+
if (changedFile.length > 0) logger.log(`Found ${styleText$1("bold", changedFile.map(relativeId).join(", "))} changed, rebuilding...`);
|
|
382
1356
|
changedFile.length = 0;
|
|
383
1357
|
break;
|
|
384
1358
|
case "BUNDLE_END":
|
|
385
1359
|
await event.result.close();
|
|
386
|
-
logger.success(`Rebuilt ${
|
|
1360
|
+
logger.success(`Rebuilt ${styleText$1("bold", relativeId(event.output[0]))} in ${styleText$1("green", ms(event.duration))}.`);
|
|
387
1361
|
break;
|
|
388
1362
|
case "ERROR":
|
|
389
1363
|
await event.result.close();
|
|
@@ -416,7 +1390,7 @@ async function bundleInner(config, cliOptions) {
|
|
|
416
1390
|
result.forEach(printBundleOutputPretty);
|
|
417
1391
|
logger.log(``);
|
|
418
1392
|
const duration = performance.now() - startTime;
|
|
419
|
-
logger.success(`rolldown v${version} Finished in ${
|
|
1393
|
+
logger.success(`rolldown v${version} Finished in ${styleText$1("green", ms(duration))}`);
|
|
420
1394
|
}
|
|
421
1395
|
function printBundleOutputPretty(output) {
|
|
422
1396
|
const outputEntries = collectOutputEntries(output.output);
|
|
@@ -461,11 +1435,11 @@ function printOutputEntries(entries, sizeAdjustment, distPath) {
|
|
|
461
1435
|
for (const group of CHUNK_GROUPS) {
|
|
462
1436
|
const filtered = entries.filter((e) => e.type === group.type);
|
|
463
1437
|
if (!filtered.length) continue;
|
|
464
|
-
for (const entry of filtered.sort((a, z) => a.size - z.size)) {
|
|
465
|
-
let log =
|
|
466
|
-
log +=
|
|
467
|
-
log +=
|
|
468
|
-
log +=
|
|
1438
|
+
for (const entry of filtered.sort((a$1, z) => a$1.size - z.size)) {
|
|
1439
|
+
let log = styleText$1("dim", withTrailingSlash(distPath));
|
|
1440
|
+
log += styleText$1(group.color, entry.fileName.padEnd(sizeAdjustment.longest + 2));
|
|
1441
|
+
log += styleText$1("dim", entry.type);
|
|
1442
|
+
log += styleText$1("dim", ` │ size: ${displaySize(entry.size).padStart(sizeAdjustment.sizePad)}`);
|
|
469
1443
|
logger.log(log);
|
|
470
1444
|
}
|
|
471
1445
|
}
|
|
@@ -484,9 +1458,9 @@ function relativeId(id) {
|
|
|
484
1458
|
|
|
485
1459
|
//#endregion
|
|
486
1460
|
//#region src/cli/commands/help.ts
|
|
487
|
-
const introduction = `${
|
|
1461
|
+
const introduction = `${styleText$1("gray", `${description} (rolldown v${version})`)}
|
|
488
1462
|
|
|
489
|
-
${
|
|
1463
|
+
${styleText$1(["bold", "underline"], "USAGE")} ${styleText$1("cyan", "rolldown -c <config>")} or ${styleText$1("cyan", "rolldown <input> <options>")}`;
|
|
490
1464
|
const examples = [
|
|
491
1465
|
{
|
|
492
1466
|
title: "Bundle with a config file `rolldown.config.mjs`",
|
|
@@ -518,33 +1492,33 @@ const notes = [
|
|
|
518
1492
|
function showHelp() {
|
|
519
1493
|
logger.log(introduction);
|
|
520
1494
|
logger.log("");
|
|
521
|
-
logger.log(`${
|
|
1495
|
+
logger.log(`${styleText$1(["bold", "underline"], "OPTIONS")}`);
|
|
522
1496
|
logger.log("");
|
|
523
|
-
logger.log(Object.entries(options).sort(([a], [b]) => {
|
|
524
|
-
if (options[a].short && !options[b].short) return -1;
|
|
525
|
-
if (!options[a].short && options[b].short) return 1;
|
|
526
|
-
if (options[a].short && options[b].short) return options[a].short.localeCompare(options[b].short);
|
|
527
|
-
return a.localeCompare(b);
|
|
1497
|
+
logger.log(Object.entries(options).sort(([a$1], [b$1]) => {
|
|
1498
|
+
if (options[a$1].short && !options[b$1].short) return -1;
|
|
1499
|
+
if (!options[a$1].short && options[b$1].short) return 1;
|
|
1500
|
+
if (options[a$1].short && options[b$1].short) return options[a$1].short.localeCompare(options[b$1].short);
|
|
1501
|
+
return a$1.localeCompare(b$1);
|
|
528
1502
|
}).map(([option, { type, short, hint, description: description$1 }]) => {
|
|
529
1503
|
let optionStr = ` --${option} `;
|
|
530
1504
|
option = camelCaseToKebabCase(option);
|
|
531
1505
|
if (short) optionStr += `-${short}, `;
|
|
532
1506
|
if (type === "string") optionStr += `<${hint ?? option}>`;
|
|
533
1507
|
if (description$1 && description$1.length > 0) description$1 = description$1[0].toUpperCase() + description$1.slice(1);
|
|
534
|
-
return
|
|
1508
|
+
return styleText$1("cyan", optionStr.padEnd(30)) + description$1 + (description$1 && description$1?.endsWith(".") ? "" : ".");
|
|
535
1509
|
}).join("\n"));
|
|
536
1510
|
logger.log("");
|
|
537
|
-
logger.log(`${
|
|
1511
|
+
logger.log(`${styleText$1(["bold", "underline"], "EXAMPLES")}`);
|
|
538
1512
|
logger.log("");
|
|
539
1513
|
examples.forEach(({ title, command }, ord) => {
|
|
540
1514
|
logger.log(` ${ord + 1}. ${title}:`);
|
|
541
|
-
logger.log(` ${
|
|
1515
|
+
logger.log(` ${styleText$1("cyan", command)}`);
|
|
542
1516
|
logger.log("");
|
|
543
1517
|
});
|
|
544
|
-
logger.log(`${
|
|
1518
|
+
logger.log(`${styleText$1(["bold", "underline"], "NOTES")}`);
|
|
545
1519
|
logger.log("");
|
|
546
1520
|
notes.forEach((note) => {
|
|
547
|
-
logger.log(` * ${
|
|
1521
|
+
logger.log(` * ${styleText$1("gray", note)}`);
|
|
548
1522
|
});
|
|
549
1523
|
}
|
|
550
1524
|
|