@rolldown/browser 1.0.0-beta.10-commit.885ee53 → 1.0.0-beta.10-commit.bf212da
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +5 -5
- package/dist/cli.mjs +1077 -1036
- package/dist/config.cjs +3 -3
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +5 -4
- package/dist/experimental-index.browser.mjs +1 -1
- package/dist/experimental-index.cjs +2 -2
- package/dist/experimental-index.d.mts +2 -2
- package/dist/experimental-index.mjs +14 -3
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +2 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -3
- package/dist/parallel-plugin-worker.cjs +2 -2
- package/dist/parallel-plugin-worker.mjs +33 -27
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/chunk-DSsiIF1Z.mjs +30 -0
- package/dist/shared/{define-config-cqCLLLZ-.d.mts → define-config-BIXBk1MV.d.mts} +1 -1
- package/dist/shared/dist-DeDsdiza.mjs +153 -0
- package/dist/shared/{load-config-F7nMcxMb.mjs → load-config--2oCCJCi.mjs} +19 -14
- package/dist/shared/{load-config-0bnuUeT5.cjs → load-config-CrWUKkBw.cjs} +1 -1
- package/dist/shared/{parse-ast-index-C31FpvkE.mjs → parse-ast-index-B3Tue26H.mjs} +28 -10
- package/dist/shared/{parse-ast-index-BuelS_NF.cjs → parse-ast-index-DL8_b_QU.cjs} +1 -1
- package/dist/shared/prompt-jPdbaKAj.mjs +854 -0
- package/dist/shared/{src-6t_bV_L5.mjs → src-_MeBFVb3.mjs} +1422 -1132
- package/dist/shared/{src-B3FAi7gC.cjs → src-heZFfrWc.cjs} +86 -16
- package/dist/{src-1eaUHc8G.js → src-DOq2164b.js} +6 -6
- package/package.json +1 -1
- package/dist/shared/dist-BoWaIc-K.mjs +0 -147
- package/dist/shared/prompt-C3zHEaSG.mjs +0 -852
- /package/dist/shared/{binding-Dod8fhx9.d.mts → binding-CHPrEDXp.d.mts} +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { __commonJS,
|
|
2
|
-
import {
|
|
3
|
-
import "./shared/
|
|
4
|
-
import
|
|
1
|
+
import { __commonJS, __esm, __toESM } from "./shared/chunk-DSsiIF1Z.mjs";
|
|
2
|
+
import { ansis_default, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_ansis, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-_MeBFVb3.mjs";
|
|
3
|
+
import { arraify, init_misc } from "./shared/dist-DeDsdiza.mjs";
|
|
4
|
+
import "./shared/parse-ast-index-B3Tue26H.mjs";
|
|
5
|
+
import { init_load_config, loadConfig } from "./shared/load-config--2oCCJCi.mjs";
|
|
5
6
|
import path, { sep } from "node:path";
|
|
6
7
|
import process$1 from "node:process";
|
|
7
8
|
import { formatWithOptions, parseArgs } from "node:util";
|
|
@@ -9,38 +10,6 @@ import * as tty from "node:tty";
|
|
|
9
10
|
import { performance } from "node:perf_hooks";
|
|
10
11
|
|
|
11
12
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
12
|
-
const LogLevels = {
|
|
13
|
-
silent: Number.NEGATIVE_INFINITY,
|
|
14
|
-
fatal: 0,
|
|
15
|
-
error: 0,
|
|
16
|
-
warn: 1,
|
|
17
|
-
log: 2,
|
|
18
|
-
info: 3,
|
|
19
|
-
success: 3,
|
|
20
|
-
fail: 3,
|
|
21
|
-
ready: 3,
|
|
22
|
-
start: 3,
|
|
23
|
-
box: 3,
|
|
24
|
-
debug: 4,
|
|
25
|
-
trace: 5,
|
|
26
|
-
verbose: Number.POSITIVE_INFINITY
|
|
27
|
-
};
|
|
28
|
-
const LogTypes = {
|
|
29
|
-
silent: { level: -1 },
|
|
30
|
-
fatal: { level: LogLevels.fatal },
|
|
31
|
-
error: { level: LogLevels.error },
|
|
32
|
-
warn: { level: LogLevels.warn },
|
|
33
|
-
log: { level: LogLevels.log },
|
|
34
|
-
info: { level: LogLevels.info },
|
|
35
|
-
success: { level: LogLevels.success },
|
|
36
|
-
fail: { level: LogLevels.fail },
|
|
37
|
-
ready: { level: LogLevels.info },
|
|
38
|
-
start: { level: LogLevels.info },
|
|
39
|
-
box: { level: LogLevels.info },
|
|
40
|
-
debug: { level: LogLevels.debug },
|
|
41
|
-
trace: { level: LogLevels.trace },
|
|
42
|
-
verbose: { level: LogLevels.verbose }
|
|
43
|
-
};
|
|
44
13
|
function isPlainObject$1(value) {
|
|
45
14
|
if (value === null || typeof value !== "object") return false;
|
|
46
15
|
const prototype = Object.getPrototypeOf(value);
|
|
@@ -66,7 +35,6 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
|
66
35
|
function createDefu(merger) {
|
|
67
36
|
return (...arguments_) => arguments_.reduce((p, c$1) => _defu(p, c$1, "", merger), {});
|
|
68
37
|
}
|
|
69
|
-
const defu = createDefu();
|
|
70
38
|
function isPlainObject(obj) {
|
|
71
39
|
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
72
40
|
}
|
|
@@ -76,322 +44,358 @@ function isLogObj(arg) {
|
|
|
76
44
|
if (arg.stack) return false;
|
|
77
45
|
return true;
|
|
78
46
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
47
|
+
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
48
|
+
if (input === void 0) return defaultLevel;
|
|
49
|
+
if (typeof input === "number") return input;
|
|
50
|
+
if (types[input] && types[input].level !== void 0) return types[input].level;
|
|
51
|
+
return defaultLevel;
|
|
52
|
+
}
|
|
53
|
+
function createConsola$1(options$1 = {}) {
|
|
54
|
+
return new Consola(options$1);
|
|
55
|
+
}
|
|
56
|
+
var LogLevels, LogTypes, defu, paused, queue, Consola;
|
|
57
|
+
var init_core = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs"() {
|
|
58
|
+
LogLevels = {
|
|
59
|
+
silent: Number.NEGATIVE_INFINITY,
|
|
60
|
+
fatal: 0,
|
|
61
|
+
error: 0,
|
|
62
|
+
warn: 1,
|
|
63
|
+
log: 2,
|
|
64
|
+
info: 3,
|
|
65
|
+
success: 3,
|
|
66
|
+
fail: 3,
|
|
67
|
+
ready: 3,
|
|
68
|
+
start: 3,
|
|
69
|
+
box: 3,
|
|
70
|
+
debug: 4,
|
|
71
|
+
trace: 5,
|
|
72
|
+
verbose: Number.POSITIVE_INFINITY
|
|
73
|
+
};
|
|
74
|
+
LogTypes = {
|
|
75
|
+
silent: { level: -1 },
|
|
76
|
+
fatal: { level: LogLevels.fatal },
|
|
77
|
+
error: { level: LogLevels.error },
|
|
78
|
+
warn: { level: LogLevels.warn },
|
|
79
|
+
log: { level: LogLevels.log },
|
|
80
|
+
info: { level: LogLevels.info },
|
|
81
|
+
success: { level: LogLevels.success },
|
|
82
|
+
fail: { level: LogLevels.fail },
|
|
83
|
+
ready: { level: LogLevels.info },
|
|
84
|
+
start: { level: LogLevels.info },
|
|
85
|
+
box: { level: LogLevels.info },
|
|
86
|
+
debug: { level: LogLevels.debug },
|
|
87
|
+
trace: { level: LogLevels.trace },
|
|
88
|
+
verbose: { level: LogLevels.verbose }
|
|
89
|
+
};
|
|
90
|
+
defu = createDefu();
|
|
91
|
+
paused = false;
|
|
92
|
+
queue = [];
|
|
93
|
+
Consola = class Consola {
|
|
94
|
+
options;
|
|
95
|
+
_lastLog;
|
|
96
|
+
_mockFn;
|
|
97
|
+
/**
|
|
98
|
+
* Creates an instance of Consola with specified options or defaults.
|
|
99
|
+
*
|
|
100
|
+
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
101
|
+
*/
|
|
102
|
+
constructor(options$1 = {}) {
|
|
103
|
+
const types = options$1.types || LogTypes;
|
|
104
|
+
this.options = defu({
|
|
105
|
+
...options$1,
|
|
106
|
+
defaults: { ...options$1.defaults },
|
|
107
|
+
level: _normalizeLogLevel(options$1.level, types),
|
|
108
|
+
reporters: [...options$1.reporters || []]
|
|
109
|
+
}, {
|
|
110
|
+
types: LogTypes,
|
|
111
|
+
throttle: 1e3,
|
|
112
|
+
throttleMin: 5,
|
|
113
|
+
formatOptions: {
|
|
114
|
+
date: true,
|
|
115
|
+
colors: false,
|
|
116
|
+
compact: true
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
for (const type in types) {
|
|
120
|
+
const defaults = {
|
|
121
|
+
type,
|
|
122
|
+
...this.options.defaults,
|
|
123
|
+
...types[type]
|
|
124
|
+
};
|
|
125
|
+
this[type] = this._wrapLogFn(defaults);
|
|
126
|
+
this[type].raw = this._wrapLogFn(defaults, true);
|
|
105
127
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const defaults = {
|
|
109
|
-
type,
|
|
110
|
-
...this.options.defaults,
|
|
111
|
-
...types[type]
|
|
112
|
-
};
|
|
113
|
-
this[type] = this._wrapLogFn(defaults);
|
|
114
|
-
this[type].raw = this._wrapLogFn(defaults, true);
|
|
128
|
+
if (this.options.mockFn) this.mockTypes();
|
|
129
|
+
this._lastLog = {};
|
|
115
130
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
*/
|
|
124
|
-
get level() {
|
|
125
|
-
return this.options.level;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Sets the minimum log level that will be output by the instance.
|
|
129
|
-
*
|
|
130
|
-
* @param {number} level - The new log level to set.
|
|
131
|
-
*/
|
|
132
|
-
set level(level) {
|
|
133
|
-
this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Displays a prompt to the user and returns the response.
|
|
137
|
-
* Throw an error if `prompt` is not supported by the current configuration.
|
|
138
|
-
*
|
|
139
|
-
* @template T
|
|
140
|
-
* @param {string} message - The message to display in the prompt.
|
|
141
|
-
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
142
|
-
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
143
|
-
*/
|
|
144
|
-
prompt(message, opts) {
|
|
145
|
-
if (!this.options.prompt) throw new Error("prompt is not supported!");
|
|
146
|
-
return this.options.prompt(message, opts);
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
150
|
-
*
|
|
151
|
-
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
152
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
153
|
-
*/
|
|
154
|
-
create(options$1) {
|
|
155
|
-
const instance = new Consola({
|
|
156
|
-
...this.options,
|
|
157
|
-
...options$1
|
|
158
|
-
});
|
|
159
|
-
if (this._mockFn) instance.mockTypes(this._mockFn);
|
|
160
|
-
return instance;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Creates a new Consola instance with the specified default log object properties.
|
|
164
|
-
*
|
|
165
|
-
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
166
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
167
|
-
*/
|
|
168
|
-
withDefaults(defaults) {
|
|
169
|
-
return this.create({
|
|
170
|
-
...this.options,
|
|
171
|
-
defaults: {
|
|
172
|
-
...this.options.defaults,
|
|
173
|
-
...defaults
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
179
|
-
*
|
|
180
|
-
* @param {string} tag - The tag to include in each log of the new instance.
|
|
181
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
182
|
-
*/
|
|
183
|
-
withTag(tag) {
|
|
184
|
-
return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Adds a custom reporter to the Consola instance.
|
|
188
|
-
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
189
|
-
*
|
|
190
|
-
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
191
|
-
* @returns {Consola} The current Consola instance.
|
|
192
|
-
*/
|
|
193
|
-
addReporter(reporter) {
|
|
194
|
-
this.options.reporters.push(reporter);
|
|
195
|
-
return this;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Removes a custom reporter from the Consola instance.
|
|
199
|
-
* If no reporter is specified, all reporters will be removed.
|
|
200
|
-
*
|
|
201
|
-
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
202
|
-
* @returns {Consola} The current Consola instance.
|
|
203
|
-
*/
|
|
204
|
-
removeReporter(reporter) {
|
|
205
|
-
if (reporter) {
|
|
206
|
-
const i$1 = this.options.reporters.indexOf(reporter);
|
|
207
|
-
if (i$1 !== -1) return this.options.reporters.splice(i$1, 1);
|
|
208
|
-
} else this.options.reporters.splice(0);
|
|
209
|
-
return this;
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
213
|
-
*
|
|
214
|
-
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
215
|
-
* @returns {Consola} The current Consola instance.
|
|
216
|
-
*/
|
|
217
|
-
setReporters(reporters) {
|
|
218
|
-
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
219
|
-
return this;
|
|
220
|
-
}
|
|
221
|
-
wrapAll() {
|
|
222
|
-
this.wrapConsole();
|
|
223
|
-
this.wrapStd();
|
|
224
|
-
}
|
|
225
|
-
restoreAll() {
|
|
226
|
-
this.restoreConsole();
|
|
227
|
-
this.restoreStd();
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Overrides console methods with Consola logging methods for consistent logging.
|
|
231
|
-
*/
|
|
232
|
-
wrapConsole() {
|
|
233
|
-
for (const type in this.options.types) {
|
|
234
|
-
if (!console["__" + type]) console["__" + type] = console[type];
|
|
235
|
-
console[type] = this[type].raw;
|
|
131
|
+
/**
|
|
132
|
+
* Gets the current log level of the Consola instance.
|
|
133
|
+
*
|
|
134
|
+
* @returns {number} The current log level.
|
|
135
|
+
*/
|
|
136
|
+
get level() {
|
|
137
|
+
return this.options.level;
|
|
236
138
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
delete console["__" + type];
|
|
139
|
+
/**
|
|
140
|
+
* Sets the minimum log level that will be output by the instance.
|
|
141
|
+
*
|
|
142
|
+
* @param {number} level - The new log level to set.
|
|
143
|
+
*/
|
|
144
|
+
set level(level) {
|
|
145
|
+
this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
|
|
245
146
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
this[type].raw(String(data).trim());
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
263
|
-
*/
|
|
264
|
-
restoreStd() {
|
|
265
|
-
this._restoreStream(this.options.stdout);
|
|
266
|
-
this._restoreStream(this.options.stderr);
|
|
267
|
-
}
|
|
268
|
-
_restoreStream(stream) {
|
|
269
|
-
if (!stream) return;
|
|
270
|
-
if (stream.__write) {
|
|
271
|
-
stream.write = stream.__write;
|
|
272
|
-
delete stream.__write;
|
|
147
|
+
/**
|
|
148
|
+
* Displays a prompt to the user and returns the response.
|
|
149
|
+
* Throw an error if `prompt` is not supported by the current configuration.
|
|
150
|
+
*
|
|
151
|
+
* @template T
|
|
152
|
+
* @param {string} message - The message to display in the prompt.
|
|
153
|
+
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
154
|
+
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
155
|
+
*/
|
|
156
|
+
prompt(message, opts) {
|
|
157
|
+
if (!this.options.prompt) throw new Error("prompt is not supported!");
|
|
158
|
+
return this.options.prompt(message, opts);
|
|
273
159
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
for (const item of _queue) item[0]._logFn(item[1], item[2]);
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Replaces logging methods with mocks if a mock function is provided.
|
|
291
|
-
*
|
|
292
|
-
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
293
|
-
*/
|
|
294
|
-
mockTypes(mockFn) {
|
|
295
|
-
const _mockFn = mockFn || this.options.mockFn;
|
|
296
|
-
this._mockFn = _mockFn;
|
|
297
|
-
if (typeof _mockFn !== "function") return;
|
|
298
|
-
for (const type in this.options.types) {
|
|
299
|
-
this[type] = _mockFn(type, this.options.types[type]) || this[type];
|
|
300
|
-
this[type].raw = this[type];
|
|
160
|
+
/**
|
|
161
|
+
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
162
|
+
*
|
|
163
|
+
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
164
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
165
|
+
*/
|
|
166
|
+
create(options$1) {
|
|
167
|
+
const instance = new Consola({
|
|
168
|
+
...this.options,
|
|
169
|
+
...options$1
|
|
170
|
+
});
|
|
171
|
+
if (this._mockFn) instance.mockTypes(this._mockFn);
|
|
172
|
+
return instance;
|
|
301
173
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Creates a new Consola instance with the specified default log object properties.
|
|
176
|
+
*
|
|
177
|
+
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
178
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
179
|
+
*/
|
|
180
|
+
withDefaults(defaults) {
|
|
181
|
+
return this.create({
|
|
182
|
+
...this.options,
|
|
183
|
+
defaults: {
|
|
184
|
+
...this.options.defaults,
|
|
185
|
+
...defaults
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
191
|
+
*
|
|
192
|
+
* @param {string} tag - The tag to include in each log of the new instance.
|
|
193
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
194
|
+
*/
|
|
195
|
+
withTag(tag) {
|
|
196
|
+
return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Adds a custom reporter to the Consola instance.
|
|
200
|
+
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
201
|
+
*
|
|
202
|
+
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
203
|
+
* @returns {Consola} The current Consola instance.
|
|
204
|
+
*/
|
|
205
|
+
addReporter(reporter) {
|
|
206
|
+
this.options.reporters.push(reporter);
|
|
207
|
+
return this;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Removes a custom reporter from the Consola instance.
|
|
211
|
+
* If no reporter is specified, all reporters will be removed.
|
|
212
|
+
*
|
|
213
|
+
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
214
|
+
* @returns {Consola} The current Consola instance.
|
|
215
|
+
*/
|
|
216
|
+
removeReporter(reporter) {
|
|
217
|
+
if (reporter) {
|
|
218
|
+
const i$1 = this.options.reporters.indexOf(reporter);
|
|
219
|
+
if (i$1 !== -1) return this.options.reporters.splice(i$1, 1);
|
|
220
|
+
} else this.options.reporters.splice(0);
|
|
221
|
+
return this;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
225
|
+
*
|
|
226
|
+
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
227
|
+
* @returns {Consola} The current Consola instance.
|
|
228
|
+
*/
|
|
229
|
+
setReporters(reporters) {
|
|
230
|
+
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
231
|
+
return this;
|
|
232
|
+
}
|
|
233
|
+
wrapAll() {
|
|
234
|
+
this.wrapConsole();
|
|
235
|
+
this.wrapStd();
|
|
236
|
+
}
|
|
237
|
+
restoreAll() {
|
|
238
|
+
this.restoreConsole();
|
|
239
|
+
this.restoreStd();
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Overrides console methods with Consola logging methods for consistent logging.
|
|
243
|
+
*/
|
|
244
|
+
wrapConsole() {
|
|
245
|
+
for (const type in this.options.types) {
|
|
246
|
+
if (!console["__" + type]) console["__" + type] = console[type];
|
|
247
|
+
console[type] = this[type].raw;
|
|
313
248
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
...defaults,
|
|
323
|
-
level: _normalizeLogLevel(defaults.level, this.options.types)
|
|
324
|
-
};
|
|
325
|
-
if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
|
|
326
|
-
else logObj.args = [...args];
|
|
327
|
-
if (logObj.message) {
|
|
328
|
-
logObj.args.unshift(logObj.message);
|
|
329
|
-
delete logObj.message;
|
|
330
|
-
}
|
|
331
|
-
if (logObj.additional) {
|
|
332
|
-
if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
|
|
333
|
-
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
334
|
-
delete logObj.additional;
|
|
335
|
-
}
|
|
336
|
-
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
337
|
-
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
338
|
-
const resolveLog = (newLog = false) => {
|
|
339
|
-
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
340
|
-
if (this._lastLog.object && repeated > 0) {
|
|
341
|
-
const args2 = [...this._lastLog.object.args];
|
|
342
|
-
if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
|
|
343
|
-
this._log({
|
|
344
|
-
...this._lastLog.object,
|
|
345
|
-
args: args2
|
|
346
|
-
});
|
|
347
|
-
this._lastLog.count = 1;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Restores the original console methods, removing Consola overrides.
|
|
252
|
+
*/
|
|
253
|
+
restoreConsole() {
|
|
254
|
+
for (const type in this.options.types) if (console["__" + type]) {
|
|
255
|
+
console[type] = console["__" + type];
|
|
256
|
+
delete console["__" + type];
|
|
348
257
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Overrides standard output and error streams to redirect them through Consola.
|
|
261
|
+
*/
|
|
262
|
+
wrapStd() {
|
|
263
|
+
this._wrapStream(this.options.stdout, "log");
|
|
264
|
+
this._wrapStream(this.options.stderr, "log");
|
|
265
|
+
}
|
|
266
|
+
_wrapStream(stream, type) {
|
|
267
|
+
if (!stream) return;
|
|
268
|
+
if (!stream.__write) stream.__write = stream.write;
|
|
269
|
+
stream.write = (data) => {
|
|
270
|
+
this[type].raw(String(data).trim());
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
275
|
+
*/
|
|
276
|
+
restoreStd() {
|
|
277
|
+
this._restoreStream(this.options.stdout);
|
|
278
|
+
this._restoreStream(this.options.stderr);
|
|
279
|
+
}
|
|
280
|
+
_restoreStream(stream) {
|
|
281
|
+
if (!stream) return;
|
|
282
|
+
if (stream.__write) {
|
|
283
|
+
stream.write = stream.__write;
|
|
284
|
+
delete stream.__write;
|
|
352
285
|
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Pauses logging, queues incoming logs until resumed.
|
|
289
|
+
*/
|
|
290
|
+
pauseLogs() {
|
|
291
|
+
paused = true;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Resumes logging, processing any queued logs.
|
|
295
|
+
*/
|
|
296
|
+
resumeLogs() {
|
|
297
|
+
paused = false;
|
|
298
|
+
const _queue = queue.splice(0);
|
|
299
|
+
for (const item of _queue) item[0]._logFn(item[1], item[2]);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Replaces logging methods with mocks if a mock function is provided.
|
|
303
|
+
*
|
|
304
|
+
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
305
|
+
*/
|
|
306
|
+
mockTypes(mockFn) {
|
|
307
|
+
const _mockFn = mockFn || this.options.mockFn;
|
|
308
|
+
this._mockFn = _mockFn;
|
|
309
|
+
if (typeof _mockFn !== "function") return;
|
|
310
|
+
for (const type in this.options.types) {
|
|
311
|
+
this[type] = _mockFn(type, this.options.types[type]) || this[type];
|
|
312
|
+
this[type].raw = this[type];
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
_wrapLogFn(defaults, isRaw) {
|
|
316
|
+
return (...args) => {
|
|
317
|
+
if (paused) {
|
|
318
|
+
queue.push([
|
|
319
|
+
this,
|
|
320
|
+
defaults,
|
|
321
|
+
args,
|
|
322
|
+
isRaw
|
|
323
|
+
]);
|
|
369
324
|
return;
|
|
370
325
|
}
|
|
326
|
+
return this._logFn(defaults, args, isRaw);
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
_logFn(defaults, args, isRaw) {
|
|
330
|
+
if ((defaults.level || 0) > this.level) return false;
|
|
331
|
+
const logObj = {
|
|
332
|
+
date: /* @__PURE__ */ new Date(),
|
|
333
|
+
args: [],
|
|
334
|
+
...defaults,
|
|
335
|
+
level: _normalizeLogLevel(defaults.level, this.options.types)
|
|
336
|
+
};
|
|
337
|
+
if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
|
|
338
|
+
else logObj.args = [...args];
|
|
339
|
+
if (logObj.message) {
|
|
340
|
+
logObj.args.unshift(logObj.message);
|
|
341
|
+
delete logObj.message;
|
|
371
342
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
343
|
+
if (logObj.additional) {
|
|
344
|
+
if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
|
|
345
|
+
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
346
|
+
delete logObj.additional;
|
|
347
|
+
}
|
|
348
|
+
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
349
|
+
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
350
|
+
const resolveLog = (newLog = false) => {
|
|
351
|
+
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
352
|
+
if (this._lastLog.object && repeated > 0) {
|
|
353
|
+
const args2 = [...this._lastLog.object.args];
|
|
354
|
+
if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
|
|
355
|
+
this._log({
|
|
356
|
+
...this._lastLog.object,
|
|
357
|
+
args: args2
|
|
358
|
+
});
|
|
359
|
+
this._lastLog.count = 1;
|
|
360
|
+
}
|
|
361
|
+
if (newLog) {
|
|
362
|
+
this._lastLog.object = logObj;
|
|
363
|
+
this._log(logObj);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
clearTimeout(this._lastLog.timeout);
|
|
367
|
+
const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
368
|
+
this._lastLog.time = logObj.date;
|
|
369
|
+
if (diffTime < this.options.throttle) try {
|
|
370
|
+
const serializedLog = JSON.stringify([
|
|
371
|
+
logObj.type,
|
|
372
|
+
logObj.tag,
|
|
373
|
+
logObj.args
|
|
374
|
+
]);
|
|
375
|
+
const isSameLog = this._lastLog.serialized === serializedLog;
|
|
376
|
+
this._lastLog.serialized = serializedLog;
|
|
377
|
+
if (isSameLog) {
|
|
378
|
+
this._lastLog.count = (this._lastLog.count || 0) + 1;
|
|
379
|
+
if (this._lastLog.count > this.options.throttleMin) {
|
|
380
|
+
this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
} catch {}
|
|
385
|
+
resolveLog(true);
|
|
386
|
+
}
|
|
387
|
+
_log(logObj) {
|
|
388
|
+
for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
Consola.prototype.add = Consola.prototype.addReporter;
|
|
392
|
+
Consola.prototype.remove = Consola.prototype.removeReporter;
|
|
393
|
+
Consola.prototype.clear = Consola.prototype.removeReporter;
|
|
394
|
+
Consola.prototype.withScope = Consola.prototype.withTag;
|
|
395
|
+
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
396
|
+
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
397
|
+
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
398
|
+
} });
|
|
395
399
|
|
|
396
400
|
//#endregion
|
|
397
401
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
|
|
@@ -404,69 +408,64 @@ function writeStream(data, stream) {
|
|
|
404
408
|
const write = stream.__write || stream.write;
|
|
405
409
|
return write.call(stream, data);
|
|
406
410
|
}
|
|
407
|
-
|
|
408
|
-
var
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
411
|
+
var bracket, BasicReporter;
|
|
412
|
+
var init_consola_DRwqZj3T = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs"() {
|
|
413
|
+
bracket = (x) => x ? `[${x}]` : "";
|
|
414
|
+
BasicReporter = class {
|
|
415
|
+
formatStack(stack, message, opts) {
|
|
416
|
+
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
417
|
+
return indent + parseStack(stack, message).join(`
|
|
412
418
|
${indent}`);
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
};
|
|
419
|
+
}
|
|
420
|
+
formatError(err, opts) {
|
|
421
|
+
const message = err.message ?? formatWithOptions(opts, err);
|
|
422
|
+
const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
|
|
423
|
+
const level = opts?.errorLevel || 0;
|
|
424
|
+
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
|
|
425
|
+
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
|
|
426
|
+
...opts,
|
|
427
|
+
errorLevel: level + 1
|
|
428
|
+
}) : "";
|
|
429
|
+
return causedPrefix + message + "\n" + stack + causedError;
|
|
430
|
+
}
|
|
431
|
+
formatArgs(args, opts) {
|
|
432
|
+
const _args = args.map((arg) => {
|
|
433
|
+
if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
|
|
434
|
+
return arg;
|
|
435
|
+
});
|
|
436
|
+
return formatWithOptions(opts, ..._args);
|
|
437
|
+
}
|
|
438
|
+
formatDate(date, opts) {
|
|
439
|
+
return opts.date ? date.toLocaleTimeString() : "";
|
|
440
|
+
}
|
|
441
|
+
filterAndJoin(arr) {
|
|
442
|
+
return arr.filter(Boolean).join(" ");
|
|
443
|
+
}
|
|
444
|
+
formatLogObj(logObj, opts) {
|
|
445
|
+
const message = this.formatArgs(logObj.args, opts);
|
|
446
|
+
if (logObj.type === "box") return "\n" + [
|
|
447
|
+
bracket(logObj.tag),
|
|
448
|
+
logObj.title && logObj.title,
|
|
449
|
+
...message.split("\n")
|
|
450
|
+
].filter(Boolean).map((l$1) => " > " + l$1).join("\n") + "\n";
|
|
451
|
+
return this.filterAndJoin([
|
|
452
|
+
bracket(logObj.type),
|
|
453
|
+
bracket(logObj.tag),
|
|
454
|
+
message
|
|
455
|
+
]);
|
|
456
|
+
}
|
|
457
|
+
log(logObj, ctx) {
|
|
458
|
+
const line = this.formatLogObj(logObj, {
|
|
459
|
+
columns: ctx.options.stdout.columns || 0,
|
|
460
|
+
...ctx.options.formatOptions
|
|
461
|
+
});
|
|
462
|
+
return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
} });
|
|
459
466
|
|
|
460
467
|
//#endregion
|
|
461
468
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
|
|
462
|
-
const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
463
|
-
const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
464
|
-
const isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
465
|
-
const isWindows = platform === "win32";
|
|
466
|
-
const isDumbTerminal = env.TERM === "dumb";
|
|
467
|
-
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
468
|
-
const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
469
|
-
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
470
469
|
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)) {
|
|
471
470
|
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
472
471
|
}
|
|
@@ -479,135 +478,15 @@ function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
|
479
478
|
function init(open, close, replace) {
|
|
480
479
|
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
481
480
|
}
|
|
482
|
-
const colorDefs = {
|
|
483
|
-
reset: init(0, 0),
|
|
484
|
-
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
485
|
-
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
486
|
-
italic: init(3, 23),
|
|
487
|
-
underline: init(4, 24),
|
|
488
|
-
inverse: init(7, 27),
|
|
489
|
-
hidden: init(8, 28),
|
|
490
|
-
strikethrough: init(9, 29),
|
|
491
|
-
black: init(30, 39),
|
|
492
|
-
red: init(31, 39),
|
|
493
|
-
green: init(32, 39),
|
|
494
|
-
yellow: init(33, 39),
|
|
495
|
-
blue: init(34, 39),
|
|
496
|
-
magenta: init(35, 39),
|
|
497
|
-
cyan: init(36, 39),
|
|
498
|
-
white: init(37, 39),
|
|
499
|
-
gray: init(90, 39),
|
|
500
|
-
bgBlack: init(40, 49),
|
|
501
|
-
bgRed: init(41, 49),
|
|
502
|
-
bgGreen: init(42, 49),
|
|
503
|
-
bgYellow: init(43, 49),
|
|
504
|
-
bgBlue: init(44, 49),
|
|
505
|
-
bgMagenta: init(45, 49),
|
|
506
|
-
bgCyan: init(46, 49),
|
|
507
|
-
bgWhite: init(47, 49),
|
|
508
|
-
blackBright: init(90, 39),
|
|
509
|
-
redBright: init(91, 39),
|
|
510
|
-
greenBright: init(92, 39),
|
|
511
|
-
yellowBright: init(93, 39),
|
|
512
|
-
blueBright: init(94, 39),
|
|
513
|
-
magentaBright: init(95, 39),
|
|
514
|
-
cyanBright: init(96, 39),
|
|
515
|
-
whiteBright: init(97, 39),
|
|
516
|
-
bgBlackBright: init(100, 49),
|
|
517
|
-
bgRedBright: init(101, 49),
|
|
518
|
-
bgGreenBright: init(102, 49),
|
|
519
|
-
bgYellowBright: init(103, 49),
|
|
520
|
-
bgBlueBright: init(104, 49),
|
|
521
|
-
bgMagentaBright: init(105, 49),
|
|
522
|
-
bgCyanBright: init(106, 49),
|
|
523
|
-
bgWhiteBright: init(107, 49)
|
|
524
|
-
};
|
|
525
481
|
function createColors(useColor = isColorSupported) {
|
|
526
482
|
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
527
483
|
}
|
|
528
|
-
const colors = createColors();
|
|
529
484
|
function getColor$1(color, fallback = "reset") {
|
|
530
485
|
return colors[color] || colors[fallback];
|
|
531
486
|
}
|
|
532
|
-
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("|");
|
|
533
487
|
function stripAnsi(text) {
|
|
534
488
|
return text.replace(new RegExp(ansiRegex$1, "g"), "");
|
|
535
489
|
}
|
|
536
|
-
const boxStylePresets = {
|
|
537
|
-
solid: {
|
|
538
|
-
tl: "┌",
|
|
539
|
-
tr: "┐",
|
|
540
|
-
bl: "└",
|
|
541
|
-
br: "┘",
|
|
542
|
-
h: "─",
|
|
543
|
-
v: "│"
|
|
544
|
-
},
|
|
545
|
-
double: {
|
|
546
|
-
tl: "╔",
|
|
547
|
-
tr: "╗",
|
|
548
|
-
bl: "╚",
|
|
549
|
-
br: "╝",
|
|
550
|
-
h: "═",
|
|
551
|
-
v: "║"
|
|
552
|
-
},
|
|
553
|
-
doubleSingle: {
|
|
554
|
-
tl: "╓",
|
|
555
|
-
tr: "╖",
|
|
556
|
-
bl: "╙",
|
|
557
|
-
br: "╜",
|
|
558
|
-
h: "─",
|
|
559
|
-
v: "║"
|
|
560
|
-
},
|
|
561
|
-
doubleSingleRounded: {
|
|
562
|
-
tl: "╭",
|
|
563
|
-
tr: "╮",
|
|
564
|
-
bl: "╰",
|
|
565
|
-
br: "╯",
|
|
566
|
-
h: "─",
|
|
567
|
-
v: "║"
|
|
568
|
-
},
|
|
569
|
-
singleThick: {
|
|
570
|
-
tl: "┏",
|
|
571
|
-
tr: "┓",
|
|
572
|
-
bl: "┗",
|
|
573
|
-
br: "┛",
|
|
574
|
-
h: "━",
|
|
575
|
-
v: "┃"
|
|
576
|
-
},
|
|
577
|
-
singleDouble: {
|
|
578
|
-
tl: "╒",
|
|
579
|
-
tr: "╕",
|
|
580
|
-
bl: "╘",
|
|
581
|
-
br: "╛",
|
|
582
|
-
h: "═",
|
|
583
|
-
v: "│"
|
|
584
|
-
},
|
|
585
|
-
singleDoubleRounded: {
|
|
586
|
-
tl: "╭",
|
|
587
|
-
tr: "╮",
|
|
588
|
-
bl: "╰",
|
|
589
|
-
br: "╯",
|
|
590
|
-
h: "═",
|
|
591
|
-
v: "│"
|
|
592
|
-
},
|
|
593
|
-
rounded: {
|
|
594
|
-
tl: "╭",
|
|
595
|
-
tr: "╮",
|
|
596
|
-
bl: "╰",
|
|
597
|
-
br: "╯",
|
|
598
|
-
h: "─",
|
|
599
|
-
v: "│"
|
|
600
|
-
}
|
|
601
|
-
};
|
|
602
|
-
const defaultStyle = {
|
|
603
|
-
borderColor: "white",
|
|
604
|
-
borderStyle: "rounded",
|
|
605
|
-
valign: "center",
|
|
606
|
-
padding: 2,
|
|
607
|
-
marginLeft: 1,
|
|
608
|
-
marginTop: 1,
|
|
609
|
-
marginBottom: 1
|
|
610
|
-
};
|
|
611
490
|
function box(text, _opts = {}) {
|
|
612
491
|
const opts = {
|
|
613
492
|
..._opts,
|
|
@@ -645,121 +524,140 @@ function box(text, _opts = {}) {
|
|
|
645
524
|
if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
|
|
646
525
|
return boxLines.join("\n");
|
|
647
526
|
}
|
|
527
|
+
var env, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, colorDefs, colors, ansiRegex$1, boxStylePresets, defaultStyle;
|
|
528
|
+
var init_consola_DXBYu_KD = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs"() {
|
|
529
|
+
({env = {}, argv = [], platform = ""} = typeof process === "undefined" ? {} : process);
|
|
530
|
+
isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
531
|
+
isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
532
|
+
isWindows = platform === "win32";
|
|
533
|
+
isDumbTerminal = env.TERM === "dumb";
|
|
534
|
+
isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
535
|
+
isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
536
|
+
isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
537
|
+
colorDefs = {
|
|
538
|
+
reset: init(0, 0),
|
|
539
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
540
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
541
|
+
italic: init(3, 23),
|
|
542
|
+
underline: init(4, 24),
|
|
543
|
+
inverse: init(7, 27),
|
|
544
|
+
hidden: init(8, 28),
|
|
545
|
+
strikethrough: init(9, 29),
|
|
546
|
+
black: init(30, 39),
|
|
547
|
+
red: init(31, 39),
|
|
548
|
+
green: init(32, 39),
|
|
549
|
+
yellow: init(33, 39),
|
|
550
|
+
blue: init(34, 39),
|
|
551
|
+
magenta: init(35, 39),
|
|
552
|
+
cyan: init(36, 39),
|
|
553
|
+
white: init(37, 39),
|
|
554
|
+
gray: init(90, 39),
|
|
555
|
+
bgBlack: init(40, 49),
|
|
556
|
+
bgRed: init(41, 49),
|
|
557
|
+
bgGreen: init(42, 49),
|
|
558
|
+
bgYellow: init(43, 49),
|
|
559
|
+
bgBlue: init(44, 49),
|
|
560
|
+
bgMagenta: init(45, 49),
|
|
561
|
+
bgCyan: init(46, 49),
|
|
562
|
+
bgWhite: init(47, 49),
|
|
563
|
+
blackBright: init(90, 39),
|
|
564
|
+
redBright: init(91, 39),
|
|
565
|
+
greenBright: init(92, 39),
|
|
566
|
+
yellowBright: init(93, 39),
|
|
567
|
+
blueBright: init(94, 39),
|
|
568
|
+
magentaBright: init(95, 39),
|
|
569
|
+
cyanBright: init(96, 39),
|
|
570
|
+
whiteBright: init(97, 39),
|
|
571
|
+
bgBlackBright: init(100, 49),
|
|
572
|
+
bgRedBright: init(101, 49),
|
|
573
|
+
bgGreenBright: init(102, 49),
|
|
574
|
+
bgYellowBright: init(103, 49),
|
|
575
|
+
bgBlueBright: init(104, 49),
|
|
576
|
+
bgMagentaBright: init(105, 49),
|
|
577
|
+
bgCyanBright: init(106, 49),
|
|
578
|
+
bgWhiteBright: init(107, 49)
|
|
579
|
+
};
|
|
580
|
+
colors = createColors();
|
|
581
|
+
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("|");
|
|
582
|
+
boxStylePresets = {
|
|
583
|
+
solid: {
|
|
584
|
+
tl: "┌",
|
|
585
|
+
tr: "┐",
|
|
586
|
+
bl: "└",
|
|
587
|
+
br: "┘",
|
|
588
|
+
h: "─",
|
|
589
|
+
v: "│"
|
|
590
|
+
},
|
|
591
|
+
double: {
|
|
592
|
+
tl: "╔",
|
|
593
|
+
tr: "╗",
|
|
594
|
+
bl: "╚",
|
|
595
|
+
br: "╝",
|
|
596
|
+
h: "═",
|
|
597
|
+
v: "║"
|
|
598
|
+
},
|
|
599
|
+
doubleSingle: {
|
|
600
|
+
tl: "╓",
|
|
601
|
+
tr: "╖",
|
|
602
|
+
bl: "╙",
|
|
603
|
+
br: "╜",
|
|
604
|
+
h: "─",
|
|
605
|
+
v: "║"
|
|
606
|
+
},
|
|
607
|
+
doubleSingleRounded: {
|
|
608
|
+
tl: "╭",
|
|
609
|
+
tr: "╮",
|
|
610
|
+
bl: "╰",
|
|
611
|
+
br: "╯",
|
|
612
|
+
h: "─",
|
|
613
|
+
v: "║"
|
|
614
|
+
},
|
|
615
|
+
singleThick: {
|
|
616
|
+
tl: "┏",
|
|
617
|
+
tr: "┓",
|
|
618
|
+
bl: "┗",
|
|
619
|
+
br: "┛",
|
|
620
|
+
h: "━",
|
|
621
|
+
v: "┃"
|
|
622
|
+
},
|
|
623
|
+
singleDouble: {
|
|
624
|
+
tl: "╒",
|
|
625
|
+
tr: "╕",
|
|
626
|
+
bl: "╘",
|
|
627
|
+
br: "╛",
|
|
628
|
+
h: "═",
|
|
629
|
+
v: "│"
|
|
630
|
+
},
|
|
631
|
+
singleDoubleRounded: {
|
|
632
|
+
tl: "╭",
|
|
633
|
+
tr: "╮",
|
|
634
|
+
bl: "╰",
|
|
635
|
+
br: "╯",
|
|
636
|
+
h: "═",
|
|
637
|
+
v: "│"
|
|
638
|
+
},
|
|
639
|
+
rounded: {
|
|
640
|
+
tl: "╭",
|
|
641
|
+
tr: "╮",
|
|
642
|
+
bl: "╰",
|
|
643
|
+
br: "╯",
|
|
644
|
+
h: "─",
|
|
645
|
+
v: "│"
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
defaultStyle = {
|
|
649
|
+
borderColor: "white",
|
|
650
|
+
borderStyle: "rounded",
|
|
651
|
+
valign: "center",
|
|
652
|
+
padding: 2,
|
|
653
|
+
marginLeft: 1,
|
|
654
|
+
marginTop: 1,
|
|
655
|
+
marginBottom: 1
|
|
656
|
+
};
|
|
657
|
+
} });
|
|
648
658
|
|
|
649
659
|
//#endregion
|
|
650
660
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
|
|
651
|
-
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, {
|
|
652
|
-
get(e, s$1) {
|
|
653
|
-
return i()[s$1] ?? r[s$1];
|
|
654
|
-
},
|
|
655
|
-
has(e, s$1) {
|
|
656
|
-
const E = i();
|
|
657
|
-
return s$1 in E || s$1 in r;
|
|
658
|
-
},
|
|
659
|
-
set(e, s$1, E) {
|
|
660
|
-
const B = i(true);
|
|
661
|
-
return B[s$1] = E, true;
|
|
662
|
-
},
|
|
663
|
-
deleteProperty(e, s$1) {
|
|
664
|
-
if (!s$1) return false;
|
|
665
|
-
const E = i(true);
|
|
666
|
-
return delete E[s$1], 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
661
|
function b() {
|
|
764
662
|
if (globalThis.process?.env) for (const e of f) {
|
|
765
663
|
const s$1 = e[1] || e[0];
|
|
@@ -776,44 +674,18 @@ function b() {
|
|
|
776
674
|
ci: false
|
|
777
675
|
};
|
|
778
676
|
}
|
|
779
|
-
const l = b();
|
|
780
|
-
l.name;
|
|
781
677
|
function n(e) {
|
|
782
678
|
return e ? e !== "false" : false;
|
|
783
679
|
}
|
|
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$1) {
|
|
792
|
-
if (s$1 === "env") return o;
|
|
793
|
-
if (s$1 in e) return e[s$1];
|
|
794
|
-
if (s$1 in _) return _[s$1];
|
|
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
680
|
function G() {
|
|
806
681
|
const e = F.find((s$1) => s$1[0]);
|
|
807
682
|
if (e) return { name: e[1] };
|
|
808
683
|
}
|
|
809
|
-
const P = G();
|
|
810
|
-
P?.name;
|
|
811
684
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
812
685
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
813
686
|
const pattern = [`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`, "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
814
687
|
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
815
688
|
}
|
|
816
|
-
const regex = ansiRegex();
|
|
817
689
|
function stripAnsi$1(string) {
|
|
818
690
|
if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
819
691
|
return string.replace(regex, "");
|
|
@@ -835,11 +707,6 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
835
707
|
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
|
|
836
708
|
return 1;
|
|
837
709
|
}
|
|
838
|
-
const emojiRegex = () => {
|
|
839
|
-
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;
|
|
840
|
-
};
|
|
841
|
-
const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
|
|
842
|
-
const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
843
710
|
function stringWidth$1(string, options$1 = {}) {
|
|
844
711
|
if (typeof string !== "string" || string.length === 0) return 0;
|
|
845
712
|
const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options$1;
|
|
@@ -869,74 +736,11 @@ function isUnicodeSupported() {
|
|
|
869
736
|
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
870
737
|
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";
|
|
871
738
|
}
|
|
872
|
-
const TYPE_COLOR_MAP = {
|
|
873
|
-
info: "cyan",
|
|
874
|
-
fail: "red",
|
|
875
|
-
success: "green",
|
|
876
|
-
ready: "green",
|
|
877
|
-
start: "magenta"
|
|
878
|
-
};
|
|
879
|
-
const LEVEL_COLOR_MAP = {
|
|
880
|
-
0: "red",
|
|
881
|
-
1: "yellow"
|
|
882
|
-
};
|
|
883
|
-
const unicode = isUnicodeSupported();
|
|
884
|
-
const s = (c$1, fallback) => unicode ? c$1 : fallback;
|
|
885
|
-
const TYPE_ICONS = {
|
|
886
|
-
error: s("✖", "×"),
|
|
887
|
-
fatal: s("✖", "×"),
|
|
888
|
-
ready: s("✔", "√"),
|
|
889
|
-
warn: s("⚠", "‼"),
|
|
890
|
-
info: s("ℹ", "i"),
|
|
891
|
-
success: s("✔", "√"),
|
|
892
|
-
debug: s("⚙", "D"),
|
|
893
|
-
trace: s("→", "→"),
|
|
894
|
-
fail: s("✖", "×"),
|
|
895
|
-
start: s("◐", "o"),
|
|
896
|
-
log: ""
|
|
897
|
-
};
|
|
898
739
|
function stringWidth(str) {
|
|
899
740
|
const hasICU = typeof Intl === "object";
|
|
900
741
|
if (!hasICU || !Intl.Segmenter) return stripAnsi(str).length;
|
|
901
742
|
return stringWidth$1(str);
|
|
902
743
|
}
|
|
903
|
-
var FancyReporter = class extends BasicReporter {
|
|
904
|
-
formatStack(stack, message, opts) {
|
|
905
|
-
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
906
|
-
return `
|
|
907
|
-
${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_$1, m) => `(${colors.cyan(m)})`)).join(`
|
|
908
|
-
${indent}`);
|
|
909
|
-
}
|
|
910
|
-
formatType(logObj, isBadge, opts) {
|
|
911
|
-
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
912
|
-
if (isBadge) return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
|
|
913
|
-
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
914
|
-
return _type ? getColor(typeColor)(_type) : "";
|
|
915
|
-
}
|
|
916
|
-
formatLogObj(logObj, opts) {
|
|
917
|
-
const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
|
|
918
|
-
if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
|
|
919
|
-
title: logObj.title ? characterFormat(logObj.title) : void 0,
|
|
920
|
-
style: logObj.style
|
|
921
|
-
});
|
|
922
|
-
const date = this.formatDate(logObj.date, opts);
|
|
923
|
-
const coloredDate = date && colors.gray(date);
|
|
924
|
-
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
925
|
-
const type = this.formatType(logObj, isBadge, opts);
|
|
926
|
-
const tag = logObj.tag ? colors.gray(logObj.tag) : "";
|
|
927
|
-
let line;
|
|
928
|
-
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
929
|
-
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
930
|
-
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
931
|
-
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
|
|
932
|
-
line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
|
|
933
|
-
if (logObj.type === "trace") {
|
|
934
|
-
const _err = new Error("Trace: " + logObj.message);
|
|
935
|
-
line += this.formatStack(_err.stack || "", _err.message);
|
|
936
|
-
}
|
|
937
|
-
return isBadge ? "\n" + line + "\n" : line;
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
744
|
function characterFormat(str) {
|
|
941
745
|
return str.replace(/`([^`]+)`/gm, (_$1, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_$1, m) => ` ${colors.underline(m)} `);
|
|
942
746
|
}
|
|
@@ -954,7 +758,7 @@ function createConsola(options$1 = {}) {
|
|
|
954
758
|
defaults: { level },
|
|
955
759
|
stdout: process.stdout,
|
|
956
760
|
stderr: process.stderr,
|
|
957
|
-
prompt: (...args) => import("./shared/prompt-
|
|
761
|
+
prompt: (...args) => import("./shared/prompt-jPdbaKAj.mjs").then((m) => m.prompt(...args)),
|
|
958
762
|
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
959
763
|
...options$1
|
|
960
764
|
});
|
|
@@ -965,14 +769,222 @@ function _getDefaultLogLevel() {
|
|
|
965
769
|
if (R) return LogLevels.warn;
|
|
966
770
|
return LogLevels.info;
|
|
967
771
|
}
|
|
968
|
-
|
|
772
|
+
var r, i, o, t, f, l, I, T, a, g, R, A, C, y, _, c, O, D, L, S, u, N, F, P, regex, emojiRegex, segmenter, defaultIgnorableCodePointRegex, TYPE_COLOR_MAP, LEVEL_COLOR_MAP, unicode, s, TYPE_ICONS, FancyReporter, consola;
|
|
773
|
+
var init_dist = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs"() {
|
|
774
|
+
init_core();
|
|
775
|
+
init_consola_DRwqZj3T();
|
|
776
|
+
init_consola_DXBYu_KD();
|
|
777
|
+
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, {
|
|
778
|
+
get(e, s$1) {
|
|
779
|
+
return i()[s$1] ?? r[s$1];
|
|
780
|
+
},
|
|
781
|
+
has(e, s$1) {
|
|
782
|
+
const E = i();
|
|
783
|
+
return s$1 in E || s$1 in r;
|
|
784
|
+
},
|
|
785
|
+
set(e, s$1, E) {
|
|
786
|
+
const B = i(true);
|
|
787
|
+
return B[s$1] = E, true;
|
|
788
|
+
},
|
|
789
|
+
deleteProperty(e, s$1) {
|
|
790
|
+
if (!s$1) return false;
|
|
791
|
+
const E = i(true);
|
|
792
|
+
return delete E[s$1], true;
|
|
793
|
+
},
|
|
794
|
+
ownKeys() {
|
|
795
|
+
const e = i(true);
|
|
796
|
+
return Object.keys(e);
|
|
797
|
+
}
|
|
798
|
+
}), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
|
|
799
|
+
["APPVEYOR"],
|
|
800
|
+
[
|
|
801
|
+
"AWS_AMPLIFY",
|
|
802
|
+
"AWS_APP_ID",
|
|
803
|
+
{ ci: true }
|
|
804
|
+
],
|
|
805
|
+
["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
|
|
806
|
+
["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
|
|
807
|
+
["APPCIRCLE", "AC_APPCIRCLE"],
|
|
808
|
+
["BAMBOO", "bamboo_planKey"],
|
|
809
|
+
["BITBUCKET", "BITBUCKET_COMMIT"],
|
|
810
|
+
["BITRISE", "BITRISE_IO"],
|
|
811
|
+
["BUDDY", "BUDDY_WORKSPACE_ID"],
|
|
812
|
+
["BUILDKITE"],
|
|
813
|
+
["CIRCLE", "CIRCLECI"],
|
|
814
|
+
["CIRRUS", "CIRRUS_CI"],
|
|
815
|
+
[
|
|
816
|
+
"CLOUDFLARE_PAGES",
|
|
817
|
+
"CF_PAGES",
|
|
818
|
+
{ ci: true }
|
|
819
|
+
],
|
|
820
|
+
["CODEBUILD", "CODEBUILD_BUILD_ARN"],
|
|
821
|
+
["CODEFRESH", "CF_BUILD_ID"],
|
|
822
|
+
["DRONE"],
|
|
823
|
+
["DRONE", "DRONE_BUILD_EVENT"],
|
|
824
|
+
["DSARI"],
|
|
825
|
+
["GITHUB_ACTIONS"],
|
|
826
|
+
["GITLAB", "GITLAB_CI"],
|
|
827
|
+
["GITLAB", "CI_MERGE_REQUEST_ID"],
|
|
828
|
+
["GOCD", "GO_PIPELINE_LABEL"],
|
|
829
|
+
["LAYERCI"],
|
|
830
|
+
["HUDSON", "HUDSON_URL"],
|
|
831
|
+
["JENKINS", "JENKINS_URL"],
|
|
832
|
+
["MAGNUM"],
|
|
833
|
+
["NETLIFY"],
|
|
834
|
+
[
|
|
835
|
+
"NETLIFY",
|
|
836
|
+
"NETLIFY_LOCAL",
|
|
837
|
+
{ ci: false }
|
|
838
|
+
],
|
|
839
|
+
["NEVERCODE"],
|
|
840
|
+
["RENDER"],
|
|
841
|
+
["SAIL", "SAILCI"],
|
|
842
|
+
["SEMAPHORE"],
|
|
843
|
+
["SCREWDRIVER"],
|
|
844
|
+
["SHIPPABLE"],
|
|
845
|
+
["SOLANO", "TDDIUM"],
|
|
846
|
+
["STRIDER"],
|
|
847
|
+
["TEAMCITY", "TEAMCITY_VERSION"],
|
|
848
|
+
["TRAVIS"],
|
|
849
|
+
["VERCEL", "NOW_BUILDER"],
|
|
850
|
+
[
|
|
851
|
+
"VERCEL",
|
|
852
|
+
"VERCEL",
|
|
853
|
+
{ ci: false }
|
|
854
|
+
],
|
|
855
|
+
[
|
|
856
|
+
"VERCEL",
|
|
857
|
+
"VERCEL_ENV",
|
|
858
|
+
{ ci: false }
|
|
859
|
+
],
|
|
860
|
+
["APPCENTER", "APPCENTER_BUILD_ID"],
|
|
861
|
+
[
|
|
862
|
+
"CODESANDBOX",
|
|
863
|
+
"CODESANDBOX_SSE",
|
|
864
|
+
{ ci: false }
|
|
865
|
+
],
|
|
866
|
+
[
|
|
867
|
+
"CODESANDBOX",
|
|
868
|
+
"CODESANDBOX_HOST",
|
|
869
|
+
{ ci: false }
|
|
870
|
+
],
|
|
871
|
+
["STACKBLITZ"],
|
|
872
|
+
["STORMKIT"],
|
|
873
|
+
["CLEAVR"],
|
|
874
|
+
["ZEABUR"],
|
|
875
|
+
[
|
|
876
|
+
"CODESPHERE",
|
|
877
|
+
"CODESPHERE_APP_ID",
|
|
878
|
+
{ ci: true }
|
|
879
|
+
],
|
|
880
|
+
["RAILWAY", "RAILWAY_PROJECT_ID"],
|
|
881
|
+
["RAILWAY", "RAILWAY_SERVICE_ID"],
|
|
882
|
+
["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
|
|
883
|
+
[
|
|
884
|
+
"FIREBASE_APP_HOSTING",
|
|
885
|
+
"FIREBASE_APP_HOSTING",
|
|
886
|
+
{ ci: true }
|
|
887
|
+
]
|
|
888
|
+
];
|
|
889
|
+
l = b();
|
|
890
|
+
l.name;
|
|
891
|
+
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);
|
|
892
|
+
n(o.MINIMAL);
|
|
893
|
+
A = /^win/i.test(I);
|
|
894
|
+
!n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM);
|
|
895
|
+
C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
|
|
896
|
+
Number(C?.split(".")[0]);
|
|
897
|
+
y = globalThis.process || Object.create(null), _ = { versions: {} };
|
|
898
|
+
new Proxy(y, { get(e, s$1) {
|
|
899
|
+
if (s$1 === "env") return o;
|
|
900
|
+
if (s$1 in e) return e[s$1];
|
|
901
|
+
if (s$1 in _) return _[s$1];
|
|
902
|
+
} });
|
|
903
|
+
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 = [
|
|
904
|
+
[S, "netlify"],
|
|
905
|
+
[u, "edge-light"],
|
|
906
|
+
[N, "workerd"],
|
|
907
|
+
[L, "fastly"],
|
|
908
|
+
[D, "deno"],
|
|
909
|
+
[O, "bun"],
|
|
910
|
+
[c, "node"]
|
|
911
|
+
];
|
|
912
|
+
P = G();
|
|
913
|
+
P?.name;
|
|
914
|
+
regex = ansiRegex();
|
|
915
|
+
emojiRegex = () => {
|
|
916
|
+
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;
|
|
917
|
+
};
|
|
918
|
+
segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
|
|
919
|
+
defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
920
|
+
TYPE_COLOR_MAP = {
|
|
921
|
+
info: "cyan",
|
|
922
|
+
fail: "red",
|
|
923
|
+
success: "green",
|
|
924
|
+
ready: "green",
|
|
925
|
+
start: "magenta"
|
|
926
|
+
};
|
|
927
|
+
LEVEL_COLOR_MAP = {
|
|
928
|
+
0: "red",
|
|
929
|
+
1: "yellow"
|
|
930
|
+
};
|
|
931
|
+
unicode = isUnicodeSupported();
|
|
932
|
+
s = (c$1, fallback) => unicode ? c$1 : fallback;
|
|
933
|
+
TYPE_ICONS = {
|
|
934
|
+
error: s("✖", "×"),
|
|
935
|
+
fatal: s("✖", "×"),
|
|
936
|
+
ready: s("✔", "√"),
|
|
937
|
+
warn: s("⚠", "‼"),
|
|
938
|
+
info: s("ℹ", "i"),
|
|
939
|
+
success: s("✔", "√"),
|
|
940
|
+
debug: s("⚙", "D"),
|
|
941
|
+
trace: s("→", "→"),
|
|
942
|
+
fail: s("✖", "×"),
|
|
943
|
+
start: s("◐", "o"),
|
|
944
|
+
log: ""
|
|
945
|
+
};
|
|
946
|
+
FancyReporter = class extends BasicReporter {
|
|
947
|
+
formatStack(stack, message, opts) {
|
|
948
|
+
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
949
|
+
return `
|
|
950
|
+
${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_$1, m) => `(${colors.cyan(m)})`)).join(`
|
|
951
|
+
${indent}`);
|
|
952
|
+
}
|
|
953
|
+
formatType(logObj, isBadge, opts) {
|
|
954
|
+
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
955
|
+
if (isBadge) return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
|
|
956
|
+
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
957
|
+
return _type ? getColor(typeColor)(_type) : "";
|
|
958
|
+
}
|
|
959
|
+
formatLogObj(logObj, opts) {
|
|
960
|
+
const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
|
|
961
|
+
if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
|
|
962
|
+
title: logObj.title ? characterFormat(logObj.title) : void 0,
|
|
963
|
+
style: logObj.style
|
|
964
|
+
});
|
|
965
|
+
const date = this.formatDate(logObj.date, opts);
|
|
966
|
+
const coloredDate = date && colors.gray(date);
|
|
967
|
+
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
968
|
+
const type = this.formatType(logObj, isBadge, opts);
|
|
969
|
+
const tag = logObj.tag ? colors.gray(logObj.tag) : "";
|
|
970
|
+
let line;
|
|
971
|
+
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
972
|
+
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
973
|
+
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
974
|
+
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
|
|
975
|
+
line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
|
|
976
|
+
if (logObj.type === "trace") {
|
|
977
|
+
const _err = new Error("Trace: " + logObj.message);
|
|
978
|
+
line += this.formatStack(_err.stack || "", _err.message);
|
|
979
|
+
}
|
|
980
|
+
return isBadge ? "\n" + line + "\n" : line;
|
|
981
|
+
}
|
|
982
|
+
};
|
|
983
|
+
consola = createConsola();
|
|
984
|
+
} });
|
|
969
985
|
|
|
970
986
|
//#endregion
|
|
971
987
|
//#region src/cli/logger.ts
|
|
972
|
-
/**
|
|
973
|
-
* Console logger
|
|
974
|
-
*/
|
|
975
|
-
const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
|
|
976
988
|
function createTestingLogger() {
|
|
977
989
|
const types = [
|
|
978
990
|
"silent",
|
|
@@ -994,52 +1006,53 @@ function createTestingLogger() {
|
|
|
994
1006
|
for (const type of types) ret[type] = console.log;
|
|
995
1007
|
return ret;
|
|
996
1008
|
}
|
|
1009
|
+
var logger;
|
|
1010
|
+
var init_logger = __esm({ "src/cli/logger.ts"() {
|
|
1011
|
+
init_dist();
|
|
1012
|
+
logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
|
|
1013
|
+
} });
|
|
997
1014
|
|
|
998
1015
|
//#endregion
|
|
999
1016
|
//#region src/cli/arguments/alias.ts
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
abbreviation: "
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
}
|
|
1017
|
+
var alias;
|
|
1018
|
+
var init_alias = __esm({ "src/cli/arguments/alias.ts"() {
|
|
1019
|
+
alias = {
|
|
1020
|
+
config: {
|
|
1021
|
+
abbreviation: "c",
|
|
1022
|
+
hint: "filename"
|
|
1023
|
+
},
|
|
1024
|
+
help: { abbreviation: "h" },
|
|
1025
|
+
version: { abbreviation: "v" },
|
|
1026
|
+
watch: { abbreviation: "w" },
|
|
1027
|
+
dir: { abbreviation: "d" },
|
|
1028
|
+
file: { abbreviation: "o" },
|
|
1029
|
+
external: { abbreviation: "e" },
|
|
1030
|
+
format: { abbreviation: "f" },
|
|
1031
|
+
name: { abbreviation: "n" },
|
|
1032
|
+
globals: { abbreviation: "g" },
|
|
1033
|
+
sourcemap: {
|
|
1034
|
+
abbreviation: "s",
|
|
1035
|
+
default: true
|
|
1036
|
+
},
|
|
1037
|
+
minify: { abbreviation: "m" },
|
|
1038
|
+
platform: { abbreviation: "p" },
|
|
1039
|
+
assetFileNames: { hint: "name" },
|
|
1040
|
+
chunkFileNames: { hint: "name" },
|
|
1041
|
+
entryFileNames: { hint: "name" },
|
|
1042
|
+
externalLiveBindings: {
|
|
1043
|
+
default: true,
|
|
1044
|
+
reverse: true
|
|
1045
|
+
},
|
|
1046
|
+
treeshake: {
|
|
1047
|
+
default: true,
|
|
1048
|
+
reverse: true
|
|
1049
|
+
},
|
|
1050
|
+
moduleTypes: { hint: "types" }
|
|
1051
|
+
};
|
|
1052
|
+
} });
|
|
1033
1053
|
|
|
1034
1054
|
//#endregion
|
|
1035
1055
|
//#region src/cli/arguments/utils.ts
|
|
1036
|
-
const priority = [
|
|
1037
|
-
"object",
|
|
1038
|
-
"array",
|
|
1039
|
-
"string",
|
|
1040
|
-
"number",
|
|
1041
|
-
"boolean"
|
|
1042
|
-
];
|
|
1043
1056
|
function getSchemaType(schema) {
|
|
1044
1057
|
if ("anyOf" in schema) {
|
|
1045
1058
|
const types = schema.anyOf.map(getSchemaType);
|
|
@@ -1081,6 +1094,16 @@ function camelCaseToKebabCase(str) {
|
|
|
1081
1094
|
function kebabCaseToCamelCase(str) {
|
|
1082
1095
|
return str.replace(/-./g, (match) => match[1].toUpperCase());
|
|
1083
1096
|
}
|
|
1097
|
+
var priority;
|
|
1098
|
+
var init_utils = __esm({ "src/cli/arguments/utils.ts"() {
|
|
1099
|
+
priority = [
|
|
1100
|
+
"object",
|
|
1101
|
+
"array",
|
|
1102
|
+
"string",
|
|
1103
|
+
"number",
|
|
1104
|
+
"boolean"
|
|
1105
|
+
];
|
|
1106
|
+
} });
|
|
1084
1107
|
|
|
1085
1108
|
//#endregion
|
|
1086
1109
|
//#region src/cli/arguments/normalize.ts
|
|
@@ -1123,25 +1146,14 @@ function normalizeCliOptions(cliOptions, positionals) {
|
|
|
1123
1146
|
else result.input.input = positionals;
|
|
1124
1147
|
return result;
|
|
1125
1148
|
}
|
|
1149
|
+
var init_normalize = __esm({ "src/cli/arguments/normalize.ts"() {
|
|
1150
|
+
init_validator();
|
|
1151
|
+
init_logger();
|
|
1152
|
+
init_utils();
|
|
1153
|
+
} });
|
|
1126
1154
|
|
|
1127
1155
|
//#endregion
|
|
1128
1156
|
//#region src/cli/arguments/index.ts
|
|
1129
|
-
const objectSchema = getJsonSchema();
|
|
1130
|
-
const flattenedSchema = flattenSchema(objectSchema.properties);
|
|
1131
|
-
const options = Object.fromEntries(Object.entries(flattenedSchema).filter(([_key, schema]) => getSchemaType(schema) !== "never").map(([key, schema]) => {
|
|
1132
|
-
const config = Object.getOwnPropertyDescriptor(alias, key)?.value;
|
|
1133
|
-
const type = getSchemaType(schema);
|
|
1134
|
-
const result = {
|
|
1135
|
-
type: type === "boolean" ? "boolean" : "string",
|
|
1136
|
-
description: schema?.description ?? config?.description ?? "",
|
|
1137
|
-
hint: config?.hint
|
|
1138
|
-
};
|
|
1139
|
-
if (config && config?.abbreviation) result.short = config?.abbreviation;
|
|
1140
|
-
if (config && config.reverse) if (result.description.startsWith("enable")) result.description = result.description.replace("enable", "disable");
|
|
1141
|
-
else result.description = `disable ${result.description}`;
|
|
1142
|
-
key = camelCaseToKebabCase(key);
|
|
1143
|
-
return [config?.reverse ? `no-${key}` : key, result];
|
|
1144
|
-
}));
|
|
1145
1157
|
function parseCliArguments() {
|
|
1146
1158
|
const { values, tokens, positionals } = parseArgs({
|
|
1147
1159
|
options,
|
|
@@ -1213,211 +1225,216 @@ function parseCliArguments() {
|
|
|
1213
1225
|
});
|
|
1214
1226
|
return normalizeCliOptions(values, positionals);
|
|
1215
1227
|
}
|
|
1228
|
+
var objectSchema, flattenedSchema, options;
|
|
1229
|
+
var init_arguments = __esm({ "src/cli/arguments/index.ts"() {
|
|
1230
|
+
init_validator();
|
|
1231
|
+
init_logger();
|
|
1232
|
+
init_alias();
|
|
1233
|
+
init_normalize();
|
|
1234
|
+
init_utils();
|
|
1235
|
+
objectSchema = getJsonSchema();
|
|
1236
|
+
flattenedSchema = flattenSchema(objectSchema.properties);
|
|
1237
|
+
options = Object.fromEntries(Object.entries(flattenedSchema).filter(([_key, schema]) => getSchemaType(schema) !== "never").map(([key, schema]) => {
|
|
1238
|
+
const config = Object.getOwnPropertyDescriptor(alias, key)?.value;
|
|
1239
|
+
const type = getSchemaType(schema);
|
|
1240
|
+
const result = {
|
|
1241
|
+
type: type === "boolean" ? "boolean" : "string",
|
|
1242
|
+
description: schema?.description ?? config?.description ?? "",
|
|
1243
|
+
hint: config?.hint
|
|
1244
|
+
};
|
|
1245
|
+
if (config && config?.abbreviation) result.short = config?.abbreviation;
|
|
1246
|
+
if (config && config.reverse) if (result.description.startsWith("enable")) result.description = result.description.replace("enable", "disable");
|
|
1247
|
+
else result.description = `disable ${result.description}`;
|
|
1248
|
+
key = camelCaseToKebabCase(key);
|
|
1249
|
+
return [config?.reverse ? `no-${key}` : key, result];
|
|
1250
|
+
}));
|
|
1251
|
+
} });
|
|
1216
1252
|
|
|
1217
1253
|
//#endregion
|
|
1218
1254
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
* catch that easily enough.
|
|
1227
|
-
*
|
|
1228
|
-
* Windows signals are a different set, since there are
|
|
1229
|
-
* signals that terminate Windows processes, but don't
|
|
1230
|
-
* terminate (or don't even exist) on Posix systems.
|
|
1231
|
-
*
|
|
1232
|
-
* Don't bother with SIGKILL. It's uncatchable, which
|
|
1233
|
-
* means that we can't fire any callbacks anyway.
|
|
1234
|
-
*
|
|
1235
|
-
* If a user does happen to register a handler on a non-
|
|
1236
|
-
* fatal signal like SIGWINCH or something, and then
|
|
1237
|
-
* exit, it'll end up firing `process.emit('exit')`, so
|
|
1238
|
-
* the handler will be fired anyway.
|
|
1239
|
-
*
|
|
1240
|
-
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
|
|
1241
|
-
* artificially, inherently leave the process in a
|
|
1242
|
-
* state from which it is not safe to try and enter JS
|
|
1243
|
-
* listeners.
|
|
1244
|
-
*/
|
|
1245
|
-
const signals = [];
|
|
1246
|
-
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1247
|
-
if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
1248
|
-
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1255
|
+
var signals;
|
|
1256
|
+
var init_signals = __esm({ "../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js"() {
|
|
1257
|
+
signals = [];
|
|
1258
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1259
|
+
if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
1260
|
+
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1261
|
+
} });
|
|
1249
1262
|
|
|
1250
1263
|
//#endregion
|
|
1251
1264
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
}
|
|
1279
|
-
removeListener(ev, fn) {
|
|
1280
|
-
const list = this.listeners[ev];
|
|
1281
|
-
const i$1 = list.indexOf(fn);
|
|
1282
|
-
/* c8 ignore start */
|
|
1283
|
-
if (i$1 === -1) return;
|
|
1284
|
-
/* c8 ignore stop */
|
|
1285
|
-
if (i$1 === 0 && list.length === 1) list.length = 0;
|
|
1286
|
-
else list.splice(i$1, 1);
|
|
1287
|
-
}
|
|
1288
|
-
emit(ev, code, signal) {
|
|
1289
|
-
if (this.emitted[ev]) return false;
|
|
1290
|
-
this.emitted[ev] = true;
|
|
1291
|
-
let ret = false;
|
|
1292
|
-
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
|
|
1293
|
-
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
|
|
1294
|
-
return ret;
|
|
1295
|
-
}
|
|
1296
|
-
};
|
|
1297
|
-
var SignalExitBase = class {};
|
|
1298
|
-
const signalExitWrap = (handler) => {
|
|
1299
|
-
return {
|
|
1300
|
-
onExit(cb, opts) {
|
|
1301
|
-
return handler.onExit(cb, opts);
|
|
1302
|
-
},
|
|
1303
|
-
load() {
|
|
1304
|
-
return handler.load();
|
|
1305
|
-
},
|
|
1306
|
-
unload() {
|
|
1307
|
-
return handler.unload();
|
|
1265
|
+
var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process$2, onExit, load, unload;
|
|
1266
|
+
var init_mjs = __esm({ "../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
|
|
1267
|
+
init_signals();
|
|
1268
|
+
processOk = (process$3) => !!process$3 && typeof process$3 === "object" && typeof process$3.removeListener === "function" && typeof process$3.emit === "function" && typeof process$3.reallyExit === "function" && typeof process$3.listeners === "function" && typeof process$3.kill === "function" && typeof process$3.pid === "number" && typeof process$3.on === "function";
|
|
1269
|
+
kExitEmitter = Symbol.for("signal-exit emitter");
|
|
1270
|
+
global = globalThis;
|
|
1271
|
+
ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1272
|
+
Emitter = class {
|
|
1273
|
+
emitted = {
|
|
1274
|
+
afterExit: false,
|
|
1275
|
+
exit: false
|
|
1276
|
+
};
|
|
1277
|
+
listeners = {
|
|
1278
|
+
afterExit: [],
|
|
1279
|
+
exit: []
|
|
1280
|
+
};
|
|
1281
|
+
count = 0;
|
|
1282
|
+
id = Math.random();
|
|
1283
|
+
constructor() {
|
|
1284
|
+
if (global[kExitEmitter]) return global[kExitEmitter];
|
|
1285
|
+
ObjectDefineProperty(global, kExitEmitter, {
|
|
1286
|
+
value: this,
|
|
1287
|
+
writable: false,
|
|
1288
|
+
enumerable: false,
|
|
1289
|
+
configurable: false
|
|
1290
|
+
});
|
|
1308
1291
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
load() {}
|
|
1316
|
-
unload() {}
|
|
1317
|
-
};
|
|
1318
|
-
var SignalExit = class extends SignalExitBase {
|
|
1319
|
-
/* c8 ignore start */
|
|
1320
|
-
#hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1321
|
-
/* c8 ignore stop */
|
|
1322
|
-
#emitter = new Emitter();
|
|
1323
|
-
#process;
|
|
1324
|
-
#originalProcessEmit;
|
|
1325
|
-
#originalProcessReallyExit;
|
|
1326
|
-
#sigListeners = {};
|
|
1327
|
-
#loaded = false;
|
|
1328
|
-
constructor(process$3) {
|
|
1329
|
-
super();
|
|
1330
|
-
this.#process = process$3;
|
|
1331
|
-
this.#sigListeners = {};
|
|
1332
|
-
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
1333
|
-
const listeners = this.#process.listeners(sig);
|
|
1334
|
-
let { count } = this.#emitter;
|
|
1292
|
+
on(ev, fn) {
|
|
1293
|
+
this.listeners[ev].push(fn);
|
|
1294
|
+
}
|
|
1295
|
+
removeListener(ev, fn) {
|
|
1296
|
+
const list = this.listeners[ev];
|
|
1297
|
+
const i$1 = list.indexOf(fn);
|
|
1335
1298
|
/* c8 ignore start */
|
|
1336
|
-
|
|
1337
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
|
|
1299
|
+
if (i$1 === -1) return;
|
|
1338
1300
|
/* c8 ignore stop */
|
|
1339
|
-
if (
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1301
|
+
if (i$1 === 0 && list.length === 1) list.length = 0;
|
|
1302
|
+
else list.splice(i$1, 1);
|
|
1303
|
+
}
|
|
1304
|
+
emit(ev, code, signal) {
|
|
1305
|
+
if (this.emitted[ev]) return false;
|
|
1306
|
+
this.emitted[ev] = true;
|
|
1307
|
+
let ret = false;
|
|
1308
|
+
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
|
|
1309
|
+
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
|
|
1310
|
+
return ret;
|
|
1311
|
+
}
|
|
1312
|
+
};
|
|
1313
|
+
SignalExitBase = class {};
|
|
1314
|
+
signalExitWrap = (handler) => {
|
|
1315
|
+
return {
|
|
1316
|
+
onExit(cb, opts) {
|
|
1317
|
+
return handler.onExit(cb, opts);
|
|
1318
|
+
},
|
|
1319
|
+
load() {
|
|
1320
|
+
return handler.load();
|
|
1321
|
+
},
|
|
1322
|
+
unload() {
|
|
1323
|
+
return handler.unload();
|
|
1345
1324
|
}
|
|
1346
1325
|
};
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1326
|
+
};
|
|
1327
|
+
SignalExitFallback = class extends SignalExitBase {
|
|
1328
|
+
onExit() {
|
|
1329
|
+
return () => {};
|
|
1330
|
+
}
|
|
1331
|
+
load() {}
|
|
1332
|
+
unload() {}
|
|
1333
|
+
};
|
|
1334
|
+
SignalExit = class extends SignalExitBase {
|
|
1351
1335
|
/* c8 ignore start */
|
|
1352
|
-
|
|
1336
|
+
#hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1353
1337
|
/* c8 ignore stop */
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1338
|
+
#emitter = new Emitter();
|
|
1339
|
+
#process;
|
|
1340
|
+
#originalProcessEmit;
|
|
1341
|
+
#originalProcessReallyExit;
|
|
1342
|
+
#sigListeners = {};
|
|
1343
|
+
#loaded = false;
|
|
1344
|
+
constructor(process$3) {
|
|
1345
|
+
super();
|
|
1346
|
+
this.#process = process$3;
|
|
1347
|
+
this.#sigListeners = {};
|
|
1348
|
+
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
1349
|
+
const listeners = this.#process.listeners(sig);
|
|
1350
|
+
let { count } = this.#emitter;
|
|
1351
|
+
/* c8 ignore start */
|
|
1352
|
+
const p = process$3;
|
|
1353
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
|
|
1354
|
+
/* c8 ignore stop */
|
|
1355
|
+
if (listeners.length === count) {
|
|
1356
|
+
this.unload();
|
|
1357
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
1358
|
+
/* c8 ignore start */
|
|
1359
|
+
const s$1 = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
1360
|
+
if (!ret) process$3.kill(process$3.pid, s$1);
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
this.#originalProcessReallyExit = process$3.reallyExit;
|
|
1364
|
+
this.#originalProcessEmit = process$3.emit;
|
|
1365
|
+
}
|
|
1366
|
+
onExit(cb, opts) {
|
|
1382
1367
|
/* c8 ignore start */
|
|
1383
|
-
if (!
|
|
1368
|
+
if (!processOk(this.#process)) return () => {};
|
|
1384
1369
|
/* c8 ignore stop */
|
|
1385
|
-
|
|
1386
|
-
|
|
1370
|
+
if (this.#loaded === false) this.load();
|
|
1371
|
+
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
1372
|
+
this.#emitter.on(ev, cb);
|
|
1373
|
+
return () => {
|
|
1374
|
+
this.#emitter.removeListener(ev, cb);
|
|
1375
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
load() {
|
|
1379
|
+
if (this.#loaded) return;
|
|
1380
|
+
this.#loaded = true;
|
|
1381
|
+
this.#emitter.count += 1;
|
|
1382
|
+
for (const sig of signals) try {
|
|
1383
|
+
const fn = this.#sigListeners[sig];
|
|
1384
|
+
if (fn) this.#process.on(sig, fn);
|
|
1387
1385
|
} catch (_$1) {}
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1386
|
+
this.#process.emit = (ev, ...a$1) => {
|
|
1387
|
+
return this.#processEmit(ev, ...a$1);
|
|
1388
|
+
};
|
|
1389
|
+
this.#process.reallyExit = (code) => {
|
|
1390
|
+
return this.#processReallyExit(code);
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
unload() {
|
|
1394
|
+
if (!this.#loaded) return;
|
|
1395
|
+
this.#loaded = false;
|
|
1396
|
+
signals.forEach((sig) => {
|
|
1397
|
+
const listener = this.#sigListeners[sig];
|
|
1398
|
+
/* c8 ignore start */
|
|
1399
|
+
if (!listener) throw new Error("Listener not defined for signal: " + sig);
|
|
1400
|
+
/* c8 ignore stop */
|
|
1401
|
+
try {
|
|
1402
|
+
this.#process.removeListener(sig, listener);
|
|
1403
|
+
} catch (_$1) {}
|
|
1404
|
+
/* c8 ignore stop */
|
|
1405
|
+
});
|
|
1406
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
1407
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1408
|
+
this.#emitter.count -= 1;
|
|
1409
|
+
}
|
|
1410
|
+
#processReallyExit(code) {
|
|
1408
1411
|
/* c8 ignore start */
|
|
1409
|
-
|
|
1412
|
+
if (!processOk(this.#process)) return 0;
|
|
1413
|
+
this.#process.exitCode = code || 0;
|
|
1410
1414
|
/* c8 ignore stop */
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1415
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1416
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
1417
|
+
}
|
|
1418
|
+
#processEmit(ev, ...args) {
|
|
1419
|
+
const og = this.#originalProcessEmit;
|
|
1420
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
1421
|
+
if (typeof args[0] === "number") this.#process.exitCode = args[0];
|
|
1422
|
+
/* c8 ignore start */
|
|
1423
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
1424
|
+
/* c8 ignore start */
|
|
1425
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1426
|
+
/* c8 ignore stop */
|
|
1427
|
+
return ret;
|
|
1428
|
+
} else return og.call(this.#process, ev, ...args);
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1431
|
+
process$2 = globalThis.process;
|
|
1432
|
+
({onExit, load, unload} = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback()));
|
|
1433
|
+
} });
|
|
1417
1434
|
|
|
1418
1435
|
//#endregion
|
|
1419
|
-
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.
|
|
1420
|
-
var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.
|
|
1436
|
+
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
|
|
1437
|
+
var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
|
|
1421
1438
|
function _usingCtx() {
|
|
1422
1439
|
var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
|
|
1423
1440
|
var n$2 = Error();
|
|
@@ -1477,7 +1494,6 @@ var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runti
|
|
|
1477
1494
|
|
|
1478
1495
|
//#endregion
|
|
1479
1496
|
//#region src/cli/commands/bundle.ts
|
|
1480
|
-
var import_usingCtx = __toESM(require_usingCtx());
|
|
1481
1497
|
async function bundleWithConfig(configPath, cliOptions) {
|
|
1482
1498
|
if (cliOptions.watch) {
|
|
1483
1499
|
process.env.ROLLUP_WATCH = "true";
|
|
@@ -1613,20 +1629,9 @@ function collectOutputLayoutAdjustmentSizes(entries) {
|
|
|
1613
1629
|
sizePad
|
|
1614
1630
|
};
|
|
1615
1631
|
}
|
|
1616
|
-
const numberFormatter = new Intl.NumberFormat("en", {
|
|
1617
|
-
maximumFractionDigits: 2,
|
|
1618
|
-
minimumFractionDigits: 2
|
|
1619
|
-
});
|
|
1620
1632
|
function displaySize(bytes) {
|
|
1621
1633
|
return `${numberFormatter.format(bytes / 1e3)} kB`;
|
|
1622
1634
|
}
|
|
1623
|
-
const CHUNK_GROUPS = [{
|
|
1624
|
-
type: "asset",
|
|
1625
|
-
color: "green"
|
|
1626
|
-
}, {
|
|
1627
|
-
type: "chunk",
|
|
1628
|
-
color: "cyan"
|
|
1629
|
-
}];
|
|
1630
1635
|
function printOutputEntries(entries, sizeAdjustment, distPath) {
|
|
1631
1636
|
for (const group of CHUNK_GROUPS) {
|
|
1632
1637
|
const filtered = entries.filter((e) => e.type === group.type);
|
|
@@ -1651,40 +1656,31 @@ function relativeId(id) {
|
|
|
1651
1656
|
if (!path.isAbsolute(id)) return id;
|
|
1652
1657
|
return path.relative(path.resolve(), id);
|
|
1653
1658
|
}
|
|
1659
|
+
var import_usingCtx, numberFormatter, CHUNK_GROUPS;
|
|
1660
|
+
var init_bundle = __esm({ "src/cli/commands/bundle.ts"() {
|
|
1661
|
+
init_ansis();
|
|
1662
|
+
init_mjs();
|
|
1663
|
+
init_rolldown();
|
|
1664
|
+
init_watch();
|
|
1665
|
+
init_load_config();
|
|
1666
|
+
init_misc();
|
|
1667
|
+
init_logger();
|
|
1668
|
+
import_usingCtx = __toESM(require_usingCtx());
|
|
1669
|
+
numberFormatter = new Intl.NumberFormat("en", {
|
|
1670
|
+
maximumFractionDigits: 2,
|
|
1671
|
+
minimumFractionDigits: 2
|
|
1672
|
+
});
|
|
1673
|
+
CHUNK_GROUPS = [{
|
|
1674
|
+
type: "asset",
|
|
1675
|
+
color: "green"
|
|
1676
|
+
}, {
|
|
1677
|
+
type: "chunk",
|
|
1678
|
+
color: "cyan"
|
|
1679
|
+
}];
|
|
1680
|
+
} });
|
|
1654
1681
|
|
|
1655
1682
|
//#endregion
|
|
1656
1683
|
//#region src/cli/commands/help.ts
|
|
1657
|
-
const introduction = `${ansis_default.gray(`${description} (rolldown v${version})`)}
|
|
1658
|
-
|
|
1659
|
-
${ansis_default.bold(ansis_default.underline("USAGE"))} ${ansis_default.cyan("rolldown -c <config>")} or ${ansis_default.cyan("rolldown <input> <options>")}`;
|
|
1660
|
-
const examples = [
|
|
1661
|
-
{
|
|
1662
|
-
title: "Bundle with a config file `rolldown.config.mjs`",
|
|
1663
|
-
command: "rolldown -c rolldown.config.mjs"
|
|
1664
|
-
},
|
|
1665
|
-
{
|
|
1666
|
-
title: "Bundle the `src/main.ts` to `dist` with `cjs` format",
|
|
1667
|
-
command: "rolldown src/main.ts -d dist -f cjs"
|
|
1668
|
-
},
|
|
1669
|
-
{
|
|
1670
|
-
title: "Bundle the `src/main.ts` and handle the `.png` assets to Data URL",
|
|
1671
|
-
command: "rolldown src/main.ts -d dist --moduleTypes .png=dataurl"
|
|
1672
|
-
},
|
|
1673
|
-
{
|
|
1674
|
-
title: "Bundle the `src/main.tsx` and minify the output with sourcemap",
|
|
1675
|
-
command: "rolldown src/main.tsx -d dist -m -s"
|
|
1676
|
-
},
|
|
1677
|
-
{
|
|
1678
|
-
title: "Create self-executing IIFE using external jQuery as `$` and `_`",
|
|
1679
|
-
command: "rolldown src/main.ts -d dist -n bundle -f iife -e jQuery,window._ -g jQuery=$"
|
|
1680
|
-
}
|
|
1681
|
-
];
|
|
1682
|
-
const notes = [
|
|
1683
|
-
"Due to the API limitation, you need to pass `-s` for `.map` sourcemap file as the last argument.",
|
|
1684
|
-
"If you are using the configuration, please pass the `-c` as the last argument if you ignore the default configuration file.",
|
|
1685
|
-
"CLI options will override the configuration file.",
|
|
1686
|
-
"For more information, please visit https://rolldown.rs/."
|
|
1687
|
-
];
|
|
1688
1684
|
function showHelp() {
|
|
1689
1685
|
logger.log(introduction);
|
|
1690
1686
|
logger.log("");
|
|
@@ -1717,28 +1713,73 @@ function showHelp() {
|
|
|
1717
1713
|
logger.log(` * ${ansis_default.gray(note)}`);
|
|
1718
1714
|
});
|
|
1719
1715
|
}
|
|
1716
|
+
var introduction, examples, notes;
|
|
1717
|
+
var init_help = __esm({ "src/cli/commands/help.ts"() {
|
|
1718
|
+
init_ansis();
|
|
1719
|
+
init_arguments();
|
|
1720
|
+
init_utils();
|
|
1721
|
+
init_logger();
|
|
1722
|
+
introduction = `${ansis_default.gray(`${description} (rolldown v${version})`)}
|
|
1723
|
+
|
|
1724
|
+
${ansis_default.bold(ansis_default.underline("USAGE"))} ${ansis_default.cyan("rolldown -c <config>")} or ${ansis_default.cyan("rolldown <input> <options>")}`;
|
|
1725
|
+
examples = [
|
|
1726
|
+
{
|
|
1727
|
+
title: "Bundle with a config file `rolldown.config.mjs`",
|
|
1728
|
+
command: "rolldown -c rolldown.config.mjs"
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
title: "Bundle the `src/main.ts` to `dist` with `cjs` format",
|
|
1732
|
+
command: "rolldown src/main.ts -d dist -f cjs"
|
|
1733
|
+
},
|
|
1734
|
+
{
|
|
1735
|
+
title: "Bundle the `src/main.ts` and handle the `.png` assets to Data URL",
|
|
1736
|
+
command: "rolldown src/main.ts -d dist --moduleTypes .png=dataurl"
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
title: "Bundle the `src/main.tsx` and minify the output with sourcemap",
|
|
1740
|
+
command: "rolldown src/main.tsx -d dist -m -s"
|
|
1741
|
+
},
|
|
1742
|
+
{
|
|
1743
|
+
title: "Create self-executing IIFE using external jQuery as `$` and `_`",
|
|
1744
|
+
command: "rolldown src/main.ts -d dist -n bundle -f iife -e jQuery,window._ -g jQuery=$"
|
|
1745
|
+
}
|
|
1746
|
+
];
|
|
1747
|
+
notes = [
|
|
1748
|
+
"Due to the API limitation, you need to pass `-s` for `.map` sourcemap file as the last argument.",
|
|
1749
|
+
"If you are using the configuration, please pass the `-c` as the last argument if you ignore the default configuration file.",
|
|
1750
|
+
"CLI options will override the configuration file.",
|
|
1751
|
+
"For more information, please visit https://rolldown.rs/."
|
|
1752
|
+
];
|
|
1753
|
+
} });
|
|
1720
1754
|
|
|
1721
1755
|
//#endregion
|
|
1722
1756
|
//#region src/cli/index.ts
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1757
|
+
var require_cli = __commonJS({ "src/cli/index.ts"() {
|
|
1758
|
+
init_arguments();
|
|
1759
|
+
init_bundle();
|
|
1760
|
+
init_help();
|
|
1761
|
+
init_logger();
|
|
1762
|
+
async function main() {
|
|
1763
|
+
const cliOptions = parseCliArguments();
|
|
1764
|
+
if (cliOptions.config || cliOptions.config === "") {
|
|
1765
|
+
await bundleWithConfig(cliOptions.config, cliOptions);
|
|
1766
|
+
return;
|
|
1767
|
+
}
|
|
1768
|
+
if ("input" in cliOptions.input) {
|
|
1769
|
+
await bundleWithCliOptions(cliOptions);
|
|
1770
|
+
return;
|
|
1771
|
+
}
|
|
1772
|
+
if (cliOptions.version) {
|
|
1773
|
+
logger.log(`rolldown v${version}`);
|
|
1774
|
+
return;
|
|
1775
|
+
}
|
|
1776
|
+
showHelp();
|
|
1736
1777
|
}
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
});
|
|
1778
|
+
main().catch((err) => {
|
|
1779
|
+
logger.error(err);
|
|
1780
|
+
process$1.exit(1);
|
|
1781
|
+
});
|
|
1782
|
+
} });
|
|
1743
1783
|
|
|
1744
|
-
//#endregion
|
|
1784
|
+
//#endregion
|
|
1785
|
+
export default require_cli();
|