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