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