@rolldown/browser 1.0.0-beta.16 → 1.0.0-beta.17
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 +3 -3
- package/dist/cli.mjs +1040 -1081
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -6
- package/dist/experimental-index.browser.mjs +3 -3
- package/dist/experimental-index.cjs +2 -2
- package/dist/experimental-index.d.cts +2 -2
- package/dist/experimental-index.d.mts +2 -2
- package/dist/experimental-index.mjs +5 -17
- package/dist/filter-index.d.cts +2 -2
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -6
- package/dist/index.browser.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -4
- package/dist/parallel-plugin-worker.cjs +1 -1
- package/dist/parallel-plugin-worker.mjs +27 -33
- package/dist/parallel-plugin.d.cts +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.cts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -2
- package/dist/rolldown-binding.wasi-browser.js +3 -2
- package/dist/rolldown-binding.wasi.cjs +2 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding--Y47JZSL.d.cts → binding-CWvDTpOw.d.mts} +14 -14
- package/dist/shared/{binding-C_9au5Eg.d.mts → binding-um3VI33z.d.cts} +14 -14
- package/dist/shared/{define-config-CFPAmfEQ.d.mts → define-config-DETTMcOl.d.mts} +69 -9
- package/dist/shared/{define-config-CAyC9-af.d.cts → define-config-POPyhxOq.d.cts} +69 -9
- package/dist/shared/dist-BoWaIc-K.mjs +147 -0
- package/dist/shared/{load-config-CHic6lPj.mjs → load-config-C0FU-xTD.mjs} +14 -19
- package/dist/shared/{load-config-CKPqlbjH.cjs → load-config-Cp5Lu-qW.cjs} +1 -1
- package/dist/shared/{parse-ast-index-BjSB6ZTb.mjs → parse-ast-index-B5AmHtd5.mjs} +9 -27
- package/dist/shared/prompt-C5jz26Zn.mjs +852 -0
- package/dist/shared/{src-C_ps7iS5.mjs → src-CsIMaM6C.mjs} +1143 -1367
- package/dist/shared/{src-Cw7MpyXh.cjs → src-D8KQ1KMN.cjs} +19 -17
- package/dist/{src-UXJBOke0.js → src-Bv_xHi2_.js} +19 -17
- package/package.json +3 -2
- package/dist/shared/chunk-DSsiIF1Z.mjs +0 -30
- package/dist/shared/dist-DeDsdiza.mjs +0 -153
- package/dist/shared/prompt-C14hEutp.mjs +0 -854
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { __commonJS,
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "./shared/
|
|
5
|
-
import { init_load_config, loadConfig } from "./shared/load-config-CHic6lPj.mjs";
|
|
1
|
+
import { __commonJS, __toESM, ansis_default, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "./shared/src-CsIMaM6C.mjs";
|
|
2
|
+
import { arraify } from "./shared/dist-BoWaIc-K.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-B5AmHtd5.mjs";
|
|
4
|
+
import { loadConfig } from "./shared/load-config-C0FU-xTD.mjs";
|
|
6
5
|
import path, { sep } from "node:path";
|
|
7
6
|
import process$1 from "node:process";
|
|
8
7
|
import { formatWithOptions, parseArgs } from "node:util";
|
|
@@ -10,6 +9,38 @@ import * as tty from "node:tty";
|
|
|
10
9
|
import { performance } from "node:perf_hooks";
|
|
11
10
|
|
|
12
11
|
//#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
|
+
};
|
|
13
44
|
function isPlainObject$1(value) {
|
|
14
45
|
if (value === null || typeof value !== "object") return false;
|
|
15
46
|
const prototype = Object.getPrototypeOf(value);
|
|
@@ -35,6 +66,7 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
|
35
66
|
function createDefu(merger) {
|
|
36
67
|
return (...arguments_) => arguments_.reduce((p, c$1) => _defu(p, c$1, "", merger), {});
|
|
37
68
|
}
|
|
69
|
+
const defu = createDefu();
|
|
38
70
|
function isPlainObject(obj) {
|
|
39
71
|
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
40
72
|
}
|
|
@@ -44,358 +76,322 @@ function isLogObj(arg) {
|
|
|
44
76
|
if (arg.stack) return false;
|
|
45
77
|
return true;
|
|
46
78
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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);
|
|
127
|
-
}
|
|
128
|
-
if (this.options.mockFn) this.mockTypes();
|
|
129
|
-
this._lastLog = {};
|
|
130
|
-
}
|
|
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;
|
|
138
|
-
}
|
|
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);
|
|
146
|
-
}
|
|
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);
|
|
159
|
-
}
|
|
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;
|
|
173
|
-
}
|
|
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;
|
|
79
|
+
let paused = false;
|
|
80
|
+
const queue = [];
|
|
81
|
+
var Consola = class Consola {
|
|
82
|
+
options;
|
|
83
|
+
_lastLog;
|
|
84
|
+
_mockFn;
|
|
85
|
+
/**
|
|
86
|
+
* Creates an instance of Consola with specified options or defaults.
|
|
87
|
+
*
|
|
88
|
+
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
89
|
+
*/
|
|
90
|
+
constructor(options$1 = {}) {
|
|
91
|
+
const types = options$1.types || LogTypes;
|
|
92
|
+
this.options = defu({
|
|
93
|
+
...options$1,
|
|
94
|
+
defaults: { ...options$1.defaults },
|
|
95
|
+
level: _normalizeLogLevel(options$1.level, types),
|
|
96
|
+
reporters: [...options$1.reporters || []]
|
|
97
|
+
}, {
|
|
98
|
+
types: LogTypes,
|
|
99
|
+
throttle: 1e3,
|
|
100
|
+
throttleMin: 5,
|
|
101
|
+
formatOptions: {
|
|
102
|
+
date: true,
|
|
103
|
+
colors: false,
|
|
104
|
+
compact: true
|
|
248
105
|
}
|
|
106
|
+
});
|
|
107
|
+
for (const type in types) {
|
|
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);
|
|
249
115
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
116
|
+
if (this.options.mockFn) this.mockTypes();
|
|
117
|
+
this._lastLog = {};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Gets the current log level of the Consola instance.
|
|
121
|
+
*
|
|
122
|
+
* @returns {number} The current log level.
|
|
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
|
|
257
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;
|
|
258
236
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Restores the original console methods, removing Consola overrides.
|
|
240
|
+
*/
|
|
241
|
+
restoreConsole() {
|
|
242
|
+
for (const type in this.options.types) if (console["__" + type]) {
|
|
243
|
+
console[type] = console["__" + type];
|
|
244
|
+
delete console["__" + type];
|
|
265
245
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Overrides standard output and error streams to redirect them through Consola.
|
|
249
|
+
*/
|
|
250
|
+
wrapStd() {
|
|
251
|
+
this._wrapStream(this.options.stdout, "log");
|
|
252
|
+
this._wrapStream(this.options.stderr, "log");
|
|
253
|
+
}
|
|
254
|
+
_wrapStream(stream, type) {
|
|
255
|
+
if (!stream) return;
|
|
256
|
+
if (!stream.__write) stream.__write = stream.write;
|
|
257
|
+
stream.write = (data) => {
|
|
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;
|
|
272
273
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Pauses logging, queues incoming logs until resumed.
|
|
277
|
+
*/
|
|
278
|
+
pauseLogs() {
|
|
279
|
+
paused = true;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Resumes logging, processing any queued logs.
|
|
283
|
+
*/
|
|
284
|
+
resumeLogs() {
|
|
285
|
+
paused = false;
|
|
286
|
+
const _queue = queue.splice(0);
|
|
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];
|
|
279
301
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
302
|
+
}
|
|
303
|
+
_wrapLogFn(defaults, isRaw) {
|
|
304
|
+
return (...args) => {
|
|
305
|
+
if (paused) {
|
|
306
|
+
queue.push([
|
|
307
|
+
this,
|
|
308
|
+
defaults,
|
|
309
|
+
args,
|
|
310
|
+
isRaw
|
|
311
|
+
]);
|
|
312
|
+
return;
|
|
285
313
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
314
|
+
return this._logFn(defaults, args, isRaw);
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
_logFn(defaults, args, isRaw) {
|
|
318
|
+
if ((defaults.level || 0) > this.level) return false;
|
|
319
|
+
const logObj = {
|
|
320
|
+
date: /* @__PURE__ */ new Date(),
|
|
321
|
+
args: [],
|
|
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;
|
|
313
348
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
349
|
+
if (newLog) {
|
|
350
|
+
this._lastLog.object = logObj;
|
|
351
|
+
this._log(logObj);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
clearTimeout(this._lastLog.timeout);
|
|
355
|
+
const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
356
|
+
this._lastLog.time = logObj.date;
|
|
357
|
+
if (diffTime < this.options.throttle) try {
|
|
358
|
+
const serializedLog = JSON.stringify([
|
|
359
|
+
logObj.type,
|
|
360
|
+
logObj.tag,
|
|
361
|
+
logObj.args
|
|
362
|
+
]);
|
|
363
|
+
const isSameLog = this._lastLog.serialized === serializedLog;
|
|
364
|
+
this._lastLog.serialized = serializedLog;
|
|
365
|
+
if (isSameLog) {
|
|
366
|
+
this._lastLog.count = (this._lastLog.count || 0) + 1;
|
|
367
|
+
if (this._lastLog.count > this.options.throttleMin) {
|
|
368
|
+
this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
|
|
324
369
|
return;
|
|
325
370
|
}
|
|
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;
|
|
342
|
-
}
|
|
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
371
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
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
|
-
} });
|
|
372
|
+
} catch {}
|
|
373
|
+
resolveLog(true);
|
|
374
|
+
}
|
|
375
|
+
_log(logObj) {
|
|
376
|
+
for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
380
|
+
if (input === void 0) return defaultLevel;
|
|
381
|
+
if (typeof input === "number") return input;
|
|
382
|
+
if (types[input] && types[input].level !== void 0) return types[input].level;
|
|
383
|
+
return defaultLevel;
|
|
384
|
+
}
|
|
385
|
+
Consola.prototype.add = Consola.prototype.addReporter;
|
|
386
|
+
Consola.prototype.remove = Consola.prototype.removeReporter;
|
|
387
|
+
Consola.prototype.clear = Consola.prototype.removeReporter;
|
|
388
|
+
Consola.prototype.withScope = Consola.prototype.withTag;
|
|
389
|
+
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
390
|
+
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
391
|
+
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
392
|
+
function createConsola$1(options$1 = {}) {
|
|
393
|
+
return new Consola(options$1);
|
|
394
|
+
}
|
|
399
395
|
|
|
400
396
|
//#endregion
|
|
401
397
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
|
|
@@ -408,64 +404,69 @@ function writeStream(data, stream) {
|
|
|
408
404
|
const write = stream.__write || stream.write;
|
|
409
405
|
return write.call(stream, data);
|
|
410
406
|
}
|
|
411
|
-
|
|
412
|
-
var
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
417
|
-
return indent + parseStack(stack, message).join(`
|
|
407
|
+
const bracket = (x) => x ? `[${x}]` : "";
|
|
408
|
+
var BasicReporter = class {
|
|
409
|
+
formatStack(stack, message, opts) {
|
|
410
|
+
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
411
|
+
return indent + parseStack(stack, message).join(`
|
|
418
412
|
${indent}`);
|
|
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
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
} });
|
|
413
|
+
}
|
|
414
|
+
formatError(err, opts) {
|
|
415
|
+
const message = err.message ?? formatWithOptions(opts, err);
|
|
416
|
+
const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
|
|
417
|
+
const level = opts?.errorLevel || 0;
|
|
418
|
+
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
|
|
419
|
+
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
|
|
420
|
+
...opts,
|
|
421
|
+
errorLevel: level + 1
|
|
422
|
+
}) : "";
|
|
423
|
+
return causedPrefix + message + "\n" + stack + causedError;
|
|
424
|
+
}
|
|
425
|
+
formatArgs(args, opts) {
|
|
426
|
+
const _args = args.map((arg) => {
|
|
427
|
+
if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
|
|
428
|
+
return arg;
|
|
429
|
+
});
|
|
430
|
+
return formatWithOptions(opts, ..._args);
|
|
431
|
+
}
|
|
432
|
+
formatDate(date, opts) {
|
|
433
|
+
return opts.date ? date.toLocaleTimeString() : "";
|
|
434
|
+
}
|
|
435
|
+
filterAndJoin(arr) {
|
|
436
|
+
return arr.filter(Boolean).join(" ");
|
|
437
|
+
}
|
|
438
|
+
formatLogObj(logObj, opts) {
|
|
439
|
+
const message = this.formatArgs(logObj.args, opts);
|
|
440
|
+
if (logObj.type === "box") return "\n" + [
|
|
441
|
+
bracket(logObj.tag),
|
|
442
|
+
logObj.title && logObj.title,
|
|
443
|
+
...message.split("\n")
|
|
444
|
+
].filter(Boolean).map((l$1) => " > " + l$1).join("\n") + "\n";
|
|
445
|
+
return this.filterAndJoin([
|
|
446
|
+
bracket(logObj.type),
|
|
447
|
+
bracket(logObj.tag),
|
|
448
|
+
message
|
|
449
|
+
]);
|
|
450
|
+
}
|
|
451
|
+
log(logObj, ctx) {
|
|
452
|
+
const line = this.formatLogObj(logObj, {
|
|
453
|
+
columns: ctx.options.stdout.columns || 0,
|
|
454
|
+
...ctx.options.formatOptions
|
|
455
|
+
});
|
|
456
|
+
return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
457
|
+
}
|
|
458
|
+
};
|
|
466
459
|
|
|
467
460
|
//#endregion
|
|
468
461
|
//#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);
|
|
469
470
|
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)) {
|
|
470
471
|
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
471
472
|
}
|
|
@@ -478,15 +479,135 @@ function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
|
478
479
|
function init(open, close, replace) {
|
|
479
480
|
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
480
481
|
}
|
|
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
|
+
};
|
|
481
525
|
function createColors(useColor = isColorSupported) {
|
|
482
526
|
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
483
527
|
}
|
|
528
|
+
const colors = createColors();
|
|
484
529
|
function getColor$1(color, fallback = "reset") {
|
|
485
530
|
return colors[color] || colors[fallback];
|
|
486
531
|
}
|
|
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("|");
|
|
487
533
|
function stripAnsi(text) {
|
|
488
534
|
return text.replace(new RegExp(ansiRegex$1, "g"), "");
|
|
489
535
|
}
|
|
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
|
+
};
|
|
490
611
|
function box(text, _opts = {}) {
|
|
491
612
|
const opts = {
|
|
492
613
|
..._opts,
|
|
@@ -524,140 +645,121 @@ function box(text, _opts = {}) {
|
|
|
524
645
|
if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
|
|
525
646
|
return boxLines.join("\n");
|
|
526
647
|
}
|
|
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
|
-
} });
|
|
658
648
|
|
|
659
649
|
//#endregion
|
|
660
650
|
//#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
|
+
];
|
|
661
763
|
function b() {
|
|
662
764
|
if (globalThis.process?.env) for (const e of f) {
|
|
663
765
|
const s$1 = e[1] || e[0];
|
|
@@ -674,18 +776,44 @@ function b() {
|
|
|
674
776
|
ci: false
|
|
675
777
|
};
|
|
676
778
|
}
|
|
779
|
+
const l = b();
|
|
780
|
+
l.name;
|
|
677
781
|
function n(e) {
|
|
678
782
|
return e ? e !== "false" : false;
|
|
679
783
|
}
|
|
784
|
+
const I = globalThis.process?.platform || "", T = n(o.CI) || l.ci !== false, a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY), g = n(o.DEBUG), R = t === "test" || n(o.TEST);
|
|
785
|
+
n(o.MINIMAL);
|
|
786
|
+
const A = /^win/i.test(I);
|
|
787
|
+
!n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM);
|
|
788
|
+
const C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
|
|
789
|
+
Number(C?.split(".")[0]);
|
|
790
|
+
const y = globalThis.process || Object.create(null), _ = { versions: {} };
|
|
791
|
+
new Proxy(y, { get(e, s$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
|
+
];
|
|
680
805
|
function G() {
|
|
681
806
|
const e = F.find((s$1) => s$1[0]);
|
|
682
807
|
if (e) return { name: e[1] };
|
|
683
808
|
}
|
|
809
|
+
const P = G();
|
|
810
|
+
P?.name;
|
|
684
811
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
685
812
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
686
813
|
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("|");
|
|
687
814
|
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
688
815
|
}
|
|
816
|
+
const regex = ansiRegex();
|
|
689
817
|
function stripAnsi$1(string) {
|
|
690
818
|
if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
691
819
|
return string.replace(regex, "");
|
|
@@ -707,6 +835,11 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
707
835
|
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
|
|
708
836
|
return 1;
|
|
709
837
|
}
|
|
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;
|
|
710
843
|
function stringWidth$1(string, options$1 = {}) {
|
|
711
844
|
if (typeof string !== "string" || string.length === 0) return 0;
|
|
712
845
|
const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options$1;
|
|
@@ -736,11 +869,74 @@ function isUnicodeSupported() {
|
|
|
736
869
|
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
737
870
|
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";
|
|
738
871
|
}
|
|
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
|
+
};
|
|
739
898
|
function stringWidth(str) {
|
|
740
899
|
const hasICU = typeof Intl === "object";
|
|
741
900
|
if (!hasICU || !Intl.Segmenter) return stripAnsi(str).length;
|
|
742
901
|
return stringWidth$1(str);
|
|
743
902
|
}
|
|
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 = /* @__PURE__ */ new Error("Trace: " + logObj.message);
|
|
935
|
+
line += this.formatStack(_err.stack || "", _err.message);
|
|
936
|
+
}
|
|
937
|
+
return isBadge ? "\n" + line + "\n" : line;
|
|
938
|
+
}
|
|
939
|
+
};
|
|
744
940
|
function characterFormat(str) {
|
|
745
941
|
return str.replace(/`([^`]+)`/gm, (_$1, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_$1, m) => ` ${colors.underline(m)} `);
|
|
746
942
|
}
|
|
@@ -758,7 +954,7 @@ function createConsola(options$1 = {}) {
|
|
|
758
954
|
defaults: { level },
|
|
759
955
|
stdout: process.stdout,
|
|
760
956
|
stderr: process.stderr,
|
|
761
|
-
prompt: (...args) => import("./shared/prompt-
|
|
957
|
+
prompt: (...args) => import("./shared/prompt-C5jz26Zn.mjs").then((m) => m.prompt(...args)),
|
|
762
958
|
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
763
959
|
...options$1
|
|
764
960
|
});
|
|
@@ -769,222 +965,14 @@ function _getDefaultLogLevel() {
|
|
|
769
965
|
if (R) return LogLevels.warn;
|
|
770
966
|
return LogLevels.info;
|
|
771
967
|
}
|
|
772
|
-
|
|
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 = /* @__PURE__ */ 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
|
-
} });
|
|
968
|
+
const consola = createConsola();
|
|
985
969
|
|
|
986
970
|
//#endregion
|
|
987
971
|
//#region src/cli/logger.ts
|
|
972
|
+
/**
|
|
973
|
+
* Console logger
|
|
974
|
+
*/
|
|
975
|
+
const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
|
|
988
976
|
function createTestingLogger() {
|
|
989
977
|
const types = [
|
|
990
978
|
"silent",
|
|
@@ -1006,57 +994,56 @@ function createTestingLogger() {
|
|
|
1006
994
|
for (const type of types) ret[type] = console.log;
|
|
1007
995
|
return ret;
|
|
1008
996
|
}
|
|
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
|
-
} });
|
|
1014
997
|
|
|
1015
998
|
//#endregion
|
|
1016
999
|
//#region src/cli/arguments/alias.ts
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
moduleTypes: { hint: "types" }
|
|
1055
|
-
};
|
|
1056
|
-
} });
|
|
1000
|
+
const alias = {
|
|
1001
|
+
config: {
|
|
1002
|
+
abbreviation: "c",
|
|
1003
|
+
hint: "filename"
|
|
1004
|
+
},
|
|
1005
|
+
help: { abbreviation: "h" },
|
|
1006
|
+
version: { abbreviation: "v" },
|
|
1007
|
+
watch: { abbreviation: "w" },
|
|
1008
|
+
dir: { abbreviation: "d" },
|
|
1009
|
+
file: { abbreviation: "o" },
|
|
1010
|
+
external: { abbreviation: "e" },
|
|
1011
|
+
format: { abbreviation: "f" },
|
|
1012
|
+
name: { abbreviation: "n" },
|
|
1013
|
+
globals: { abbreviation: "g" },
|
|
1014
|
+
sourcemap: {
|
|
1015
|
+
abbreviation: "s",
|
|
1016
|
+
default: true
|
|
1017
|
+
},
|
|
1018
|
+
minify: { abbreviation: "m" },
|
|
1019
|
+
platform: { abbreviation: "p" },
|
|
1020
|
+
assetFileNames: { hint: "name" },
|
|
1021
|
+
chunkFileNames: { hint: "name" },
|
|
1022
|
+
entryFileNames: { hint: "name" },
|
|
1023
|
+
externalLiveBindings: {
|
|
1024
|
+
default: true,
|
|
1025
|
+
reverse: true
|
|
1026
|
+
},
|
|
1027
|
+
treeshake: {
|
|
1028
|
+
default: true,
|
|
1029
|
+
reverse: true
|
|
1030
|
+
},
|
|
1031
|
+
preserveEntrySignatures: {
|
|
1032
|
+
default: "strict",
|
|
1033
|
+
reverse: true
|
|
1034
|
+
},
|
|
1035
|
+
moduleTypes: { hint: "types" }
|
|
1036
|
+
};
|
|
1057
1037
|
|
|
1058
1038
|
//#endregion
|
|
1059
1039
|
//#region src/cli/arguments/utils.ts
|
|
1040
|
+
const priority = [
|
|
1041
|
+
"object",
|
|
1042
|
+
"array",
|
|
1043
|
+
"string",
|
|
1044
|
+
"number",
|
|
1045
|
+
"boolean"
|
|
1046
|
+
];
|
|
1060
1047
|
function getSchemaType(schema) {
|
|
1061
1048
|
if ("anyOf" in schema) {
|
|
1062
1049
|
const types = schema.anyOf.map(getSchemaType);
|
|
@@ -1098,16 +1085,6 @@ function camelCaseToKebabCase(str) {
|
|
|
1098
1085
|
function kebabCaseToCamelCase(str) {
|
|
1099
1086
|
return str.replace(/-./g, (match) => match[1].toUpperCase());
|
|
1100
1087
|
}
|
|
1101
|
-
var priority;
|
|
1102
|
-
var init_utils = __esm({ "src/cli/arguments/utils.ts"() {
|
|
1103
|
-
priority = [
|
|
1104
|
-
"object",
|
|
1105
|
-
"array",
|
|
1106
|
-
"string",
|
|
1107
|
-
"number",
|
|
1108
|
-
"boolean"
|
|
1109
|
-
];
|
|
1110
|
-
} });
|
|
1111
1088
|
|
|
1112
1089
|
//#endregion
|
|
1113
1090
|
//#region src/cli/arguments/normalize.ts
|
|
@@ -1150,14 +1127,27 @@ function normalizeCliOptions(cliOptions, positionals) {
|
|
|
1150
1127
|
else result.input.input = positionals;
|
|
1151
1128
|
return result;
|
|
1152
1129
|
}
|
|
1153
|
-
var init_normalize = __esm({ "src/cli/arguments/normalize.ts"() {
|
|
1154
|
-
init_validator();
|
|
1155
|
-
init_logger();
|
|
1156
|
-
init_utils();
|
|
1157
|
-
} });
|
|
1158
1130
|
|
|
1159
1131
|
//#endregion
|
|
1160
1132
|
//#region src/cli/arguments/index.ts
|
|
1133
|
+
const objectSchema = getJsonSchema();
|
|
1134
|
+
const flattenedSchema = flattenSchema(objectSchema.properties);
|
|
1135
|
+
const options = Object.fromEntries(Object.entries(flattenedSchema).filter(([_key, schema]) => getSchemaType(schema) !== "never").map(([key, schema]) => {
|
|
1136
|
+
const config = Object.getOwnPropertyDescriptor(alias, key)?.value;
|
|
1137
|
+
const type = getSchemaType(schema);
|
|
1138
|
+
const result = {
|
|
1139
|
+
type: type === "boolean" ? "boolean" : "string",
|
|
1140
|
+
description: schema?.description ?? config?.description ?? "",
|
|
1141
|
+
hint: config?.hint
|
|
1142
|
+
};
|
|
1143
|
+
if (config && config?.abbreviation) result.short = config?.abbreviation;
|
|
1144
|
+
if (config && config.reverse) {
|
|
1145
|
+
if (result.description.startsWith("enable")) result.description = result.description.replace("enable", "disable");
|
|
1146
|
+
else if (!result.description.startsWith("Avoid")) result.description = `disable ${result.description}`;
|
|
1147
|
+
}
|
|
1148
|
+
key = camelCaseToKebabCase(key);
|
|
1149
|
+
return [config?.reverse ? `no-${key}` : key, result];
|
|
1150
|
+
}));
|
|
1161
1151
|
function parseCliArguments() {
|
|
1162
1152
|
const { values, tokens, positionals } = parseArgs({
|
|
1163
1153
|
options,
|
|
@@ -1229,214 +1219,207 @@ function parseCliArguments() {
|
|
|
1229
1219
|
});
|
|
1230
1220
|
return normalizeCliOptions(values, positionals);
|
|
1231
1221
|
}
|
|
1232
|
-
var objectSchema, flattenedSchema, options;
|
|
1233
|
-
var init_arguments = __esm({ "src/cli/arguments/index.ts"() {
|
|
1234
|
-
init_validator();
|
|
1235
|
-
init_logger();
|
|
1236
|
-
init_alias();
|
|
1237
|
-
init_normalize();
|
|
1238
|
-
init_utils();
|
|
1239
|
-
objectSchema = getJsonSchema();
|
|
1240
|
-
flattenedSchema = flattenSchema(objectSchema.properties);
|
|
1241
|
-
options = Object.fromEntries(Object.entries(flattenedSchema).filter(([_key, schema]) => getSchemaType(schema) !== "never").map(([key, schema]) => {
|
|
1242
|
-
const config = Object.getOwnPropertyDescriptor(alias, key)?.value;
|
|
1243
|
-
const type = getSchemaType(schema);
|
|
1244
|
-
const result = {
|
|
1245
|
-
type: type === "boolean" ? "boolean" : "string",
|
|
1246
|
-
description: schema?.description ?? config?.description ?? "",
|
|
1247
|
-
hint: config?.hint
|
|
1248
|
-
};
|
|
1249
|
-
if (config && config?.abbreviation) result.short = config?.abbreviation;
|
|
1250
|
-
if (config && config.reverse) {
|
|
1251
|
-
if (result.description.startsWith("enable")) result.description = result.description.replace("enable", "disable");
|
|
1252
|
-
else if (!result.description.startsWith("Avoid")) result.description = `disable ${result.description}`;
|
|
1253
|
-
}
|
|
1254
|
-
key = camelCaseToKebabCase(key);
|
|
1255
|
-
return [config?.reverse ? `no-${key}` : key, result];
|
|
1256
|
-
}));
|
|
1257
|
-
} });
|
|
1258
1222
|
|
|
1259
1223
|
//#endregion
|
|
1260
1224
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1225
|
+
/**
|
|
1226
|
+
* This is not the set of all possible signals.
|
|
1227
|
+
*
|
|
1228
|
+
* It IS, however, the set of all signals that trigger
|
|
1229
|
+
* an exit on either Linux or BSD systems. Linux is a
|
|
1230
|
+
* superset of the signal names supported on BSD, and
|
|
1231
|
+
* the unknown signals just fail to register, so we can
|
|
1232
|
+
* catch that easily enough.
|
|
1233
|
+
*
|
|
1234
|
+
* Windows signals are a different set, since there are
|
|
1235
|
+
* signals that terminate Windows processes, but don't
|
|
1236
|
+
* terminate (or don't even exist) on Posix systems.
|
|
1237
|
+
*
|
|
1238
|
+
* Don't bother with SIGKILL. It's uncatchable, which
|
|
1239
|
+
* means that we can't fire any callbacks anyway.
|
|
1240
|
+
*
|
|
1241
|
+
* If a user does happen to register a handler on a non-
|
|
1242
|
+
* fatal signal like SIGWINCH or something, and then
|
|
1243
|
+
* exit, it'll end up firing `process.emit('exit')`, so
|
|
1244
|
+
* the handler will be fired anyway.
|
|
1245
|
+
*
|
|
1246
|
+
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
|
|
1247
|
+
* artificially, inherently leave the process in a
|
|
1248
|
+
* state from which it is not safe to try and enter JS
|
|
1249
|
+
* listeners.
|
|
1250
|
+
*/
|
|
1251
|
+
const signals = [];
|
|
1252
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1253
|
+
if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
1254
|
+
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1268
1255
|
|
|
1269
1256
|
//#endregion
|
|
1270
1257
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1258
|
+
const 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";
|
|
1259
|
+
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
1260
|
+
const global = globalThis;
|
|
1261
|
+
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1262
|
+
var Emitter = class {
|
|
1263
|
+
emitted = {
|
|
1264
|
+
afterExit: false,
|
|
1265
|
+
exit: false
|
|
1266
|
+
};
|
|
1267
|
+
listeners = {
|
|
1268
|
+
afterExit: [],
|
|
1269
|
+
exit: []
|
|
1270
|
+
};
|
|
1271
|
+
count = 0;
|
|
1272
|
+
id = Math.random();
|
|
1273
|
+
constructor() {
|
|
1274
|
+
if (global[kExitEmitter]) return global[kExitEmitter];
|
|
1275
|
+
ObjectDefineProperty(global, kExitEmitter, {
|
|
1276
|
+
value: this,
|
|
1277
|
+
writable: false,
|
|
1278
|
+
enumerable: false,
|
|
1279
|
+
configurable: false
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
on(ev, fn) {
|
|
1283
|
+
this.listeners[ev].push(fn);
|
|
1284
|
+
}
|
|
1285
|
+
removeListener(ev, fn) {
|
|
1286
|
+
const list = this.listeners[ev];
|
|
1287
|
+
const i$1 = list.indexOf(fn);
|
|
1288
|
+
/* c8 ignore start */
|
|
1289
|
+
if (i$1 === -1) return;
|
|
1290
|
+
/* c8 ignore stop */
|
|
1291
|
+
if (i$1 === 0 && list.length === 1) list.length = 0;
|
|
1292
|
+
else list.splice(i$1, 1);
|
|
1293
|
+
}
|
|
1294
|
+
emit(ev, code, signal) {
|
|
1295
|
+
if (this.emitted[ev]) return false;
|
|
1296
|
+
this.emitted[ev] = true;
|
|
1297
|
+
let ret = false;
|
|
1298
|
+
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
|
|
1299
|
+
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
|
|
1300
|
+
return ret;
|
|
1301
|
+
}
|
|
1302
|
+
};
|
|
1303
|
+
var SignalExitBase = class {};
|
|
1304
|
+
const signalExitWrap = (handler) => {
|
|
1305
|
+
return {
|
|
1306
|
+
onExit(cb, opts) {
|
|
1307
|
+
return handler.onExit(cb, opts);
|
|
1308
|
+
},
|
|
1309
|
+
load() {
|
|
1310
|
+
return handler.load();
|
|
1311
|
+
},
|
|
1312
|
+
unload() {
|
|
1313
|
+
return handler.unload();
|
|
1300
1314
|
}
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1315
|
+
};
|
|
1316
|
+
};
|
|
1317
|
+
var SignalExitFallback = class extends SignalExitBase {
|
|
1318
|
+
onExit() {
|
|
1319
|
+
return () => {};
|
|
1320
|
+
}
|
|
1321
|
+
load() {}
|
|
1322
|
+
unload() {}
|
|
1323
|
+
};
|
|
1324
|
+
var SignalExit = class extends SignalExitBase {
|
|
1325
|
+
/* c8 ignore start */
|
|
1326
|
+
#hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1327
|
+
/* c8 ignore stop */
|
|
1328
|
+
#emitter = new Emitter();
|
|
1329
|
+
#process;
|
|
1330
|
+
#originalProcessEmit;
|
|
1331
|
+
#originalProcessReallyExit;
|
|
1332
|
+
#sigListeners = {};
|
|
1333
|
+
#loaded = false;
|
|
1334
|
+
constructor(process$3) {
|
|
1335
|
+
super();
|
|
1336
|
+
this.#process = process$3;
|
|
1337
|
+
this.#sigListeners = {};
|
|
1338
|
+
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
1339
|
+
const listeners = this.#process.listeners(sig);
|
|
1340
|
+
let { count } = this.#emitter;
|
|
1304
1341
|
/* c8 ignore start */
|
|
1305
|
-
|
|
1342
|
+
const p = process$3;
|
|
1343
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
|
|
1306
1344
|
/* c8 ignore stop */
|
|
1307
|
-
if (
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
let ret = false;
|
|
1314
|
-
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
|
|
1315
|
-
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
|
|
1316
|
-
return ret;
|
|
1317
|
-
}
|
|
1318
|
-
};
|
|
1319
|
-
SignalExitBase = class {};
|
|
1320
|
-
signalExitWrap = (handler) => {
|
|
1321
|
-
return {
|
|
1322
|
-
onExit(cb, opts) {
|
|
1323
|
-
return handler.onExit(cb, opts);
|
|
1324
|
-
},
|
|
1325
|
-
load() {
|
|
1326
|
-
return handler.load();
|
|
1327
|
-
},
|
|
1328
|
-
unload() {
|
|
1329
|
-
return handler.unload();
|
|
1345
|
+
if (listeners.length === count) {
|
|
1346
|
+
this.unload();
|
|
1347
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
1348
|
+
/* c8 ignore start */
|
|
1349
|
+
const s$1 = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
1350
|
+
if (!ret) process$3.kill(process$3.pid, s$1);
|
|
1330
1351
|
}
|
|
1331
1352
|
};
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
}
|
|
1337
|
-
load() {}
|
|
1338
|
-
unload() {}
|
|
1339
|
-
};
|
|
1340
|
-
SignalExit = class extends SignalExitBase {
|
|
1353
|
+
this.#originalProcessReallyExit = process$3.reallyExit;
|
|
1354
|
+
this.#originalProcessEmit = process$3.emit;
|
|
1355
|
+
}
|
|
1356
|
+
onExit(cb, opts) {
|
|
1341
1357
|
/* c8 ignore start */
|
|
1342
|
-
|
|
1358
|
+
if (!processOk(this.#process)) return () => {};
|
|
1343
1359
|
/* c8 ignore stop */
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
onExit(cb, opts) {
|
|
1360
|
+
if (this.#loaded === false) this.load();
|
|
1361
|
+
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
1362
|
+
this.#emitter.on(ev, cb);
|
|
1363
|
+
return () => {
|
|
1364
|
+
this.#emitter.removeListener(ev, cb);
|
|
1365
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
load() {
|
|
1369
|
+
if (this.#loaded) return;
|
|
1370
|
+
this.#loaded = true;
|
|
1371
|
+
this.#emitter.count += 1;
|
|
1372
|
+
for (const sig of signals) try {
|
|
1373
|
+
const fn = this.#sigListeners[sig];
|
|
1374
|
+
if (fn) this.#process.on(sig, fn);
|
|
1375
|
+
} catch (_$1) {}
|
|
1376
|
+
this.#process.emit = (ev, ...a$1) => {
|
|
1377
|
+
return this.#processEmit(ev, ...a$1);
|
|
1378
|
+
};
|
|
1379
|
+
this.#process.reallyExit = (code) => {
|
|
1380
|
+
return this.#processReallyExit(code);
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
unload() {
|
|
1384
|
+
if (!this.#loaded) return;
|
|
1385
|
+
this.#loaded = false;
|
|
1386
|
+
signals.forEach((sig) => {
|
|
1387
|
+
const listener = this.#sigListeners[sig];
|
|
1373
1388
|
/* c8 ignore start */
|
|
1374
|
-
if (!
|
|
1389
|
+
if (!listener) throw new Error("Listener not defined for signal: " + sig);
|
|
1375
1390
|
/* c8 ignore stop */
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
this.#emitter.on(ev, cb);
|
|
1379
|
-
return () => {
|
|
1380
|
-
this.#emitter.removeListener(ev, cb);
|
|
1381
|
-
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
|
|
1382
|
-
};
|
|
1383
|
-
}
|
|
1384
|
-
load() {
|
|
1385
|
-
if (this.#loaded) return;
|
|
1386
|
-
this.#loaded = true;
|
|
1387
|
-
this.#emitter.count += 1;
|
|
1388
|
-
for (const sig of signals) try {
|
|
1389
|
-
const fn = this.#sigListeners[sig];
|
|
1390
|
-
if (fn) this.#process.on(sig, fn);
|
|
1391
|
+
try {
|
|
1392
|
+
this.#process.removeListener(sig, listener);
|
|
1391
1393
|
} catch (_$1) {}
|
|
1392
|
-
this.#process.emit = (ev, ...a$1) => {
|
|
1393
|
-
return this.#processEmit(ev, ...a$1);
|
|
1394
|
-
};
|
|
1395
|
-
this.#process.reallyExit = (code) => {
|
|
1396
|
-
return this.#processReallyExit(code);
|
|
1397
|
-
};
|
|
1398
|
-
}
|
|
1399
|
-
unload() {
|
|
1400
|
-
if (!this.#loaded) return;
|
|
1401
|
-
this.#loaded = false;
|
|
1402
|
-
signals.forEach((sig) => {
|
|
1403
|
-
const listener = this.#sigListeners[sig];
|
|
1404
|
-
/* c8 ignore start */
|
|
1405
|
-
if (!listener) throw new Error("Listener not defined for signal: " + sig);
|
|
1406
|
-
/* c8 ignore stop */
|
|
1407
|
-
try {
|
|
1408
|
-
this.#process.removeListener(sig, listener);
|
|
1409
|
-
} catch (_$1) {}
|
|
1410
|
-
/* c8 ignore stop */
|
|
1411
|
-
});
|
|
1412
|
-
this.#process.emit = this.#originalProcessEmit;
|
|
1413
|
-
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1414
|
-
this.#emitter.count -= 1;
|
|
1415
|
-
}
|
|
1416
|
-
#processReallyExit(code) {
|
|
1417
|
-
/* c8 ignore start */
|
|
1418
|
-
if (!processOk(this.#process)) return 0;
|
|
1419
|
-
this.#process.exitCode = code || 0;
|
|
1420
1394
|
/* c8 ignore stop */
|
|
1395
|
+
});
|
|
1396
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
1397
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1398
|
+
this.#emitter.count -= 1;
|
|
1399
|
+
}
|
|
1400
|
+
#processReallyExit(code) {
|
|
1401
|
+
/* c8 ignore start */
|
|
1402
|
+
if (!processOk(this.#process)) return 0;
|
|
1403
|
+
this.#process.exitCode = code || 0;
|
|
1404
|
+
/* c8 ignore stop */
|
|
1405
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1406
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
1407
|
+
}
|
|
1408
|
+
#processEmit(ev, ...args) {
|
|
1409
|
+
const og = this.#originalProcessEmit;
|
|
1410
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
1411
|
+
if (typeof args[0] === "number") this.#process.exitCode = args[0];
|
|
1412
|
+
/* c8 ignore start */
|
|
1413
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
1414
|
+
/* c8 ignore start */
|
|
1421
1415
|
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
const ret = og.call(this.#process, ev, ...args);
|
|
1430
|
-
/* c8 ignore start */
|
|
1431
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1432
|
-
/* c8 ignore stop */
|
|
1433
|
-
return ret;
|
|
1434
|
-
} else return og.call(this.#process, ev, ...args);
|
|
1435
|
-
}
|
|
1436
|
-
};
|
|
1437
|
-
process$2 = globalThis.process;
|
|
1438
|
-
({onExit, load, unload} = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback()));
|
|
1439
|
-
} });
|
|
1416
|
+
/* c8 ignore stop */
|
|
1417
|
+
return ret;
|
|
1418
|
+
} else return og.call(this.#process, ev, ...args);
|
|
1419
|
+
}
|
|
1420
|
+
};
|
|
1421
|
+
const process$2 = globalThis.process;
|
|
1422
|
+
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
1440
1423
|
|
|
1441
1424
|
//#endregion
|
|
1442
1425
|
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.73.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
|
|
@@ -1500,6 +1483,7 @@ var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runti
|
|
|
1500
1483
|
|
|
1501
1484
|
//#endregion
|
|
1502
1485
|
//#region src/cli/commands/bundle.ts
|
|
1486
|
+
var import_usingCtx = __toESM(require_usingCtx(), 1);
|
|
1503
1487
|
async function bundleWithConfig(configPath, cliOptions) {
|
|
1504
1488
|
if (cliOptions.watch) {
|
|
1505
1489
|
process.env.ROLLUP_WATCH = "true";
|
|
@@ -1635,9 +1619,20 @@ function collectOutputLayoutAdjustmentSizes(entries) {
|
|
|
1635
1619
|
sizePad
|
|
1636
1620
|
};
|
|
1637
1621
|
}
|
|
1622
|
+
const numberFormatter = new Intl.NumberFormat("en", {
|
|
1623
|
+
maximumFractionDigits: 2,
|
|
1624
|
+
minimumFractionDigits: 2
|
|
1625
|
+
});
|
|
1638
1626
|
function displaySize(bytes) {
|
|
1639
1627
|
return `${numberFormatter.format(bytes / 1e3)} kB`;
|
|
1640
1628
|
}
|
|
1629
|
+
const CHUNK_GROUPS = [{
|
|
1630
|
+
type: "asset",
|
|
1631
|
+
color: "green"
|
|
1632
|
+
}, {
|
|
1633
|
+
type: "chunk",
|
|
1634
|
+
color: "cyan"
|
|
1635
|
+
}];
|
|
1641
1636
|
function printOutputEntries(entries, sizeAdjustment, distPath) {
|
|
1642
1637
|
for (const group of CHUNK_GROUPS) {
|
|
1643
1638
|
const filtered = entries.filter((e) => e.type === group.type);
|
|
@@ -1662,31 +1657,40 @@ function relativeId(id) {
|
|
|
1662
1657
|
if (!path.isAbsolute(id)) return id;
|
|
1663
1658
|
return path.relative(path.resolve(), id);
|
|
1664
1659
|
}
|
|
1665
|
-
var import_usingCtx, numberFormatter, CHUNK_GROUPS;
|
|
1666
|
-
var init_bundle = __esm({ "src/cli/commands/bundle.ts"() {
|
|
1667
|
-
init_ansis();
|
|
1668
|
-
init_mjs();
|
|
1669
|
-
init_rolldown();
|
|
1670
|
-
init_watch();
|
|
1671
|
-
init_load_config();
|
|
1672
|
-
init_misc();
|
|
1673
|
-
init_logger();
|
|
1674
|
-
import_usingCtx = __toESM(require_usingCtx());
|
|
1675
|
-
numberFormatter = new Intl.NumberFormat("en", {
|
|
1676
|
-
maximumFractionDigits: 2,
|
|
1677
|
-
minimumFractionDigits: 2
|
|
1678
|
-
});
|
|
1679
|
-
CHUNK_GROUPS = [{
|
|
1680
|
-
type: "asset",
|
|
1681
|
-
color: "green"
|
|
1682
|
-
}, {
|
|
1683
|
-
type: "chunk",
|
|
1684
|
-
color: "cyan"
|
|
1685
|
-
}];
|
|
1686
|
-
} });
|
|
1687
1660
|
|
|
1688
1661
|
//#endregion
|
|
1689
1662
|
//#region src/cli/commands/help.ts
|
|
1663
|
+
const introduction = `${ansis_default.gray(`${description} (rolldown v${version})`)}
|
|
1664
|
+
|
|
1665
|
+
${ansis_default.bold(ansis_default.underline("USAGE"))} ${ansis_default.cyan("rolldown -c <config>")} or ${ansis_default.cyan("rolldown <input> <options>")}`;
|
|
1666
|
+
const examples = [
|
|
1667
|
+
{
|
|
1668
|
+
title: "Bundle with a config file `rolldown.config.mjs`",
|
|
1669
|
+
command: "rolldown -c rolldown.config.mjs"
|
|
1670
|
+
},
|
|
1671
|
+
{
|
|
1672
|
+
title: "Bundle the `src/main.ts` to `dist` with `cjs` format",
|
|
1673
|
+
command: "rolldown src/main.ts -d dist -f cjs"
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
title: "Bundle the `src/main.ts` and handle the `.png` assets to Data URL",
|
|
1677
|
+
command: "rolldown src/main.ts -d dist --moduleTypes .png=dataurl"
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
title: "Bundle the `src/main.tsx` and minify the output with sourcemap",
|
|
1681
|
+
command: "rolldown src/main.tsx -d dist -m -s"
|
|
1682
|
+
},
|
|
1683
|
+
{
|
|
1684
|
+
title: "Create self-executing IIFE using external jQuery as `$` and `_`",
|
|
1685
|
+
command: "rolldown src/main.ts -d dist -n bundle -f iife -e jQuery,window._ -g jQuery=$"
|
|
1686
|
+
}
|
|
1687
|
+
];
|
|
1688
|
+
const notes = [
|
|
1689
|
+
"Due to the API limitation, you need to pass `-s` for `.map` sourcemap file as the last argument.",
|
|
1690
|
+
"If you are using the configuration, please pass the `-c` as the last argument if you ignore the default configuration file.",
|
|
1691
|
+
"CLI options will override the configuration file.",
|
|
1692
|
+
"For more information, please visit https://rolldown.rs/."
|
|
1693
|
+
];
|
|
1690
1694
|
function showHelp() {
|
|
1691
1695
|
logger.log(introduction);
|
|
1692
1696
|
logger.log("");
|
|
@@ -1719,73 +1723,28 @@ function showHelp() {
|
|
|
1719
1723
|
logger.log(` * ${ansis_default.gray(note)}`);
|
|
1720
1724
|
});
|
|
1721
1725
|
}
|
|
1722
|
-
var introduction, examples, notes;
|
|
1723
|
-
var init_help = __esm({ "src/cli/commands/help.ts"() {
|
|
1724
|
-
init_ansis();
|
|
1725
|
-
init_arguments();
|
|
1726
|
-
init_utils();
|
|
1727
|
-
init_logger();
|
|
1728
|
-
introduction = `${ansis_default.gray(`${description} (rolldown v${version})`)}
|
|
1729
|
-
|
|
1730
|
-
${ansis_default.bold(ansis_default.underline("USAGE"))} ${ansis_default.cyan("rolldown -c <config>")} or ${ansis_default.cyan("rolldown <input> <options>")}`;
|
|
1731
|
-
examples = [
|
|
1732
|
-
{
|
|
1733
|
-
title: "Bundle with a config file `rolldown.config.mjs`",
|
|
1734
|
-
command: "rolldown -c rolldown.config.mjs"
|
|
1735
|
-
},
|
|
1736
|
-
{
|
|
1737
|
-
title: "Bundle the `src/main.ts` to `dist` with `cjs` format",
|
|
1738
|
-
command: "rolldown src/main.ts -d dist -f cjs"
|
|
1739
|
-
},
|
|
1740
|
-
{
|
|
1741
|
-
title: "Bundle the `src/main.ts` and handle the `.png` assets to Data URL",
|
|
1742
|
-
command: "rolldown src/main.ts -d dist --moduleTypes .png=dataurl"
|
|
1743
|
-
},
|
|
1744
|
-
{
|
|
1745
|
-
title: "Bundle the `src/main.tsx` and minify the output with sourcemap",
|
|
1746
|
-
command: "rolldown src/main.tsx -d dist -m -s"
|
|
1747
|
-
},
|
|
1748
|
-
{
|
|
1749
|
-
title: "Create self-executing IIFE using external jQuery as `$` and `_`",
|
|
1750
|
-
command: "rolldown src/main.ts -d dist -n bundle -f iife -e jQuery,window._ -g jQuery=$"
|
|
1751
|
-
}
|
|
1752
|
-
];
|
|
1753
|
-
notes = [
|
|
1754
|
-
"Due to the API limitation, you need to pass `-s` for `.map` sourcemap file as the last argument.",
|
|
1755
|
-
"If you are using the configuration, please pass the `-c` as the last argument if you ignore the default configuration file.",
|
|
1756
|
-
"CLI options will override the configuration file.",
|
|
1757
|
-
"For more information, please visit https://rolldown.rs/."
|
|
1758
|
-
];
|
|
1759
|
-
} });
|
|
1760
1726
|
|
|
1761
1727
|
//#endregion
|
|
1762
1728
|
//#region src/cli/index.ts
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
async function main() {
|
|
1769
|
-
const cliOptions = parseCliArguments();
|
|
1770
|
-
if (cliOptions.config || cliOptions.config === "") {
|
|
1771
|
-
await bundleWithConfig(cliOptions.config, cliOptions);
|
|
1772
|
-
return;
|
|
1773
|
-
}
|
|
1774
|
-
if ("input" in cliOptions.input) {
|
|
1775
|
-
await bundleWithCliOptions(cliOptions);
|
|
1776
|
-
return;
|
|
1777
|
-
}
|
|
1778
|
-
if (cliOptions.version) {
|
|
1779
|
-
logger.log(`rolldown v${version}`);
|
|
1780
|
-
return;
|
|
1781
|
-
}
|
|
1782
|
-
showHelp();
|
|
1729
|
+
async function main() {
|
|
1730
|
+
const cliOptions = parseCliArguments();
|
|
1731
|
+
if (cliOptions.config || cliOptions.config === "") {
|
|
1732
|
+
await bundleWithConfig(cliOptions.config, cliOptions);
|
|
1733
|
+
return;
|
|
1783
1734
|
}
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1735
|
+
if ("input" in cliOptions.input) {
|
|
1736
|
+
await bundleWithCliOptions(cliOptions);
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
if (cliOptions.version) {
|
|
1740
|
+
logger.log(`rolldown v${version}`);
|
|
1741
|
+
return;
|
|
1742
|
+
}
|
|
1743
|
+
showHelp();
|
|
1744
|
+
}
|
|
1745
|
+
main().catch((err) => {
|
|
1746
|
+
logger.error(err);
|
|
1747
|
+
process$1.exit(1);
|
|
1748
|
+
});
|
|
1789
1749
|
|
|
1790
|
-
//#endregion
|
|
1791
|
-
export default require_cli();
|
|
1750
|
+
//#endregion
|