@rolldown/browser 1.0.0-beta.9-commit.0ec9e7d → 1.0.0-rc.1

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.
Files changed (73) hide show
  1. package/dist/cli-setup.mjs +16 -0
  2. package/dist/cli.mjs +1084 -1281
  3. package/dist/config.d.mts +1 -3
  4. package/dist/config.mjs +7 -5
  5. package/dist/constructors-B8gqcrFr.js +61 -0
  6. package/dist/experimental-index.browser.mjs +225 -50
  7. package/dist/experimental-index.d.mts +164 -76
  8. package/dist/experimental-index.mjs +220 -60
  9. package/dist/experimental-runtime-types.d.ts +98 -0
  10. package/dist/filter-index.d.mts +104 -2
  11. package/dist/filter-index.mjs +123 -3
  12. package/dist/get-log-filter.d.mts +7 -0
  13. package/dist/get-log-filter.mjs +48 -0
  14. package/dist/index.browser.mjs +242 -2
  15. package/dist/index.d.mts +4 -3
  16. package/dist/index.mjs +54 -5
  17. package/dist/{shared/parse-ast-index-BHaE0ECV.cjs → normalize-string-or-regex-CL-PJZI7.js} +70 -137
  18. package/dist/parallel-plugin-worker.mjs +26 -33
  19. package/dist/parallel-plugin.d.mts +7 -7
  20. package/dist/parse-ast-index.d.mts +5 -6
  21. package/dist/parse-ast-index.mjs +1 -2
  22. package/dist/plugins-index.browser.mjs +39 -0
  23. package/dist/plugins-index.d.mts +30 -0
  24. package/dist/plugins-index.mjs +39 -0
  25. package/dist/rolldown-binding.wasi-browser.js +41 -24
  26. package/dist/rolldown-binding.wasi.cjs +62 -24
  27. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  28. package/dist/rolldown-build-C4tDS_XC.js +5055 -0
  29. package/dist/shared/bindingify-input-options-Bp2kpiI8.mjs +2231 -0
  30. package/dist/shared/composable-filters-CIxSuZSM.mjs +227 -0
  31. package/dist/shared/constructors-5bt5oBhE.d.mts +28 -0
  32. package/dist/shared/constructors-BTW-c3jX.mjs +61 -0
  33. package/dist/shared/define-config-CDlEOpr1.d.mts +3531 -0
  34. package/dist/shared/define-config-Dlptvz3X.mjs +7 -0
  35. package/dist/shared/{load-config-D7UduHRZ.mjs → load-config-BBZgIUGN.mjs} +23 -33
  36. package/dist/shared/logging-Nvu645a7.d.mts +50 -0
  37. package/dist/shared/{parse-ast-index-vu376yZ1.mjs → logs-B2CASPcx.mjs} +21 -116
  38. package/dist/shared/normalize-string-or-regex-DIwprzLy.mjs +60 -0
  39. package/dist/shared/parse-ast-index-2ahkCVK6.mjs +98 -0
  40. package/dist/shared/{prompt-CxjDC0Gn.cjs → prompt-B6NrDD1-.mjs} +301 -308
  41. package/dist/shared/rolldown-C0_W0QdY.mjs +42 -0
  42. package/dist/shared/rolldown-build-DLuUhuNw.mjs +2368 -0
  43. package/dist/shared/types-CIYK49jr.d.mts +1300 -0
  44. package/dist/shared/utils-CqMTwlsR.d.mts +22 -0
  45. package/dist/shared/watch-eIop0yN6.mjs +378 -0
  46. package/package.json +33 -38
  47. package/dist/cli.cjs +0 -1748
  48. package/dist/config.cjs +0 -12
  49. package/dist/config.d.cts +0 -11
  50. package/dist/experimental-index.cjs +0 -129
  51. package/dist/experimental-index.d.cts +0 -96
  52. package/dist/filter-index.cjs +0 -53
  53. package/dist/filter-index.d.cts +0 -3
  54. package/dist/index.cjs +0 -9
  55. package/dist/index.d.cts +0 -3
  56. package/dist/parallel-plugin-worker.cjs +0 -33
  57. package/dist/parallel-plugin-worker.d.cts +0 -1
  58. package/dist/parallel-plugin.cjs +0 -8
  59. package/dist/parallel-plugin.d.cts +0 -14
  60. package/dist/parse-ast-index.cjs +0 -4
  61. package/dist/parse-ast-index.d.cts +0 -9
  62. package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
  63. package/dist/shared/chunk-DSsiIF1Z.mjs +0 -30
  64. package/dist/shared/define-config.d-D4lKXE9V.d.cts +0 -1165
  65. package/dist/shared/define-config.d-Dm9iNdt9.d.mts +0 -1165
  66. package/dist/shared/dist-BMVjvV-v.cjs +0 -249
  67. package/dist/shared/dist-CAn6dxW6.mjs +0 -153
  68. package/dist/shared/load-config-CtKjQ8Mn.cjs +0 -125
  69. package/dist/shared/prompt-GFYxfPw7.mjs +0 -854
  70. package/dist/shared/src-D0nc44MQ.mjs +0 -4691
  71. package/dist/shared/src-s89s870G.cjs +0 -4647
  72. package/dist/src-CeWghjQt.js +0 -4329
  73. /package/dist/{cli.d.cts → cli-setup.d.mts} +0 -0
package/dist/cli.mjs CHANGED
@@ -1,16 +1,50 @@
1
- import { __commonJS, __esm, __toESM } from "./shared/chunk-DSsiIF1Z.mjs";
2
- import { description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-D0nc44MQ.mjs";
3
- import { arraify, init_misc } from "./shared/dist-CAn6dxW6.mjs";
4
- import "./shared/parse-ast-index-vu376yZ1.mjs";
5
- import { init_load_config, loadConfig } from "./shared/load-config-D7UduHRZ.mjs";
1
+ import { n as onExit, t as watch } from "./shared/watch-eIop0yN6.mjs";
2
+ import "./shared/normalize-string-or-regex-DIwprzLy.mjs";
3
+ import { C as description, w as version } from "./shared/bindingify-input-options-Bp2kpiI8.mjs";
4
+ import { h as arraify } from "./shared/composable-filters-CIxSuZSM.mjs";
5
+ import { a as getOutputCliKeys, c as styleText$1, i as getInputCliKeys, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/rolldown-build-DLuUhuNw.mjs";
6
+ import "./shared/parse-ast-index-2ahkCVK6.mjs";
7
+ import { t as rolldown } from "./shared/rolldown-C0_W0QdY.mjs";
8
+ import { t as loadConfig } from "./shared/load-config-BBZgIUGN.mjs";
6
9
  import path, { sep } from "node:path";
7
- import colors from "ansis";
8
- import process$1 from "node:process";
9
10
  import { formatWithOptions, parseArgs } from "node:util";
11
+ import process$1 from "node:process";
10
12
  import * as tty from "node:tty";
11
13
  import { performance } from "node:perf_hooks";
12
14
 
13
15
  //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
16
+ const LogLevels = {
17
+ silent: Number.NEGATIVE_INFINITY,
18
+ fatal: 0,
19
+ error: 0,
20
+ warn: 1,
21
+ log: 2,
22
+ info: 3,
23
+ success: 3,
24
+ fail: 3,
25
+ ready: 3,
26
+ start: 3,
27
+ box: 3,
28
+ debug: 4,
29
+ trace: 5,
30
+ verbose: Number.POSITIVE_INFINITY
31
+ };
32
+ const LogTypes = {
33
+ silent: { level: -1 },
34
+ fatal: { level: LogLevels.fatal },
35
+ error: { level: LogLevels.error },
36
+ warn: { level: LogLevels.warn },
37
+ log: { level: LogLevels.log },
38
+ info: { level: LogLevels.info },
39
+ success: { level: LogLevels.success },
40
+ fail: { level: LogLevels.fail },
41
+ ready: { level: LogLevels.info },
42
+ start: { level: LogLevels.info },
43
+ box: { level: LogLevels.info },
44
+ debug: { level: LogLevels.debug },
45
+ trace: { level: LogLevels.trace },
46
+ verbose: { level: LogLevels.verbose }
47
+ };
14
48
  function isPlainObject$1(value) {
15
49
  if (value === null || typeof value !== "object") return false;
16
50
  const prototype = Object.getPrototypeOf(value);
@@ -34,8 +68,9 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
34
68
  return object;
35
69
  }
36
70
  function createDefu(merger) {
37
- return (...arguments_) => arguments_.reduce((p, c$1) => _defu(p, c$1, "", merger), {});
71
+ return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
38
72
  }
73
+ const defu = createDefu();
39
74
  function isPlainObject(obj) {
40
75
  return Object.prototype.toString.call(obj) === "[object Object]";
41
76
  }
@@ -45,428 +80,393 @@ function isLogObj(arg) {
45
80
  if (arg.stack) return false;
46
81
  return true;
47
82
  }
48
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
49
- if (input === void 0) return defaultLevel;
50
- if (typeof input === "number") return input;
51
- if (types[input] && types[input].level !== void 0) return types[input].level;
52
- return defaultLevel;
53
- }
54
- function createConsola$1(options$1 = {}) {
55
- return new Consola(options$1);
56
- }
57
- var LogLevels, LogTypes, defu, paused, queue, Consola;
58
- var init_core = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs"() {
59
- LogLevels = {
60
- silent: Number.NEGATIVE_INFINITY,
61
- fatal: 0,
62
- error: 0,
63
- warn: 1,
64
- log: 2,
65
- info: 3,
66
- success: 3,
67
- fail: 3,
68
- ready: 3,
69
- start: 3,
70
- box: 3,
71
- debug: 4,
72
- trace: 5,
73
- verbose: Number.POSITIVE_INFINITY
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;
83
+ let paused = false;
84
+ const queue = [];
85
+ var Consola = class Consola {
86
+ options;
87
+ _lastLog;
88
+ _mockFn;
89
+ /**
90
+ * Creates an instance of Consola with specified options or defaults.
91
+ *
92
+ * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
93
+ */
94
+ constructor(options = {}) {
95
+ const types = options.types || LogTypes;
96
+ this.options = defu({
97
+ ...options,
98
+ defaults: { ...options.defaults },
99
+ level: _normalizeLogLevel(options.level, types),
100
+ reporters: [...options.reporters || []]
101
+ }, {
102
+ types: LogTypes,
103
+ throttle: 1e3,
104
+ throttleMin: 5,
105
+ formatOptions: {
106
+ date: true,
107
+ colors: false,
108
+ compact: true
249
109
  }
110
+ });
111
+ for (const type in types) {
112
+ const defaults = {
113
+ type,
114
+ ...this.options.defaults,
115
+ ...types[type]
116
+ };
117
+ this[type] = this._wrapLogFn(defaults);
118
+ this[type].raw = this._wrapLogFn(defaults, true);
250
119
  }
251
- /**
252
- * Restores the original console methods, removing Consola overrides.
253
- */
254
- restoreConsole() {
255
- for (const type in this.options.types) if (console["__" + type]) {
256
- console[type] = console["__" + type];
257
- delete console["__" + type];
120
+ if (this.options.mockFn) this.mockTypes();
121
+ this._lastLog = {};
122
+ }
123
+ /**
124
+ * Gets the current log level of the Consola instance.
125
+ *
126
+ * @returns {number} The current log level.
127
+ */
128
+ get level() {
129
+ return this.options.level;
130
+ }
131
+ /**
132
+ * Sets the minimum log level that will be output by the instance.
133
+ *
134
+ * @param {number} level - The new log level to set.
135
+ */
136
+ set level(level) {
137
+ this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
138
+ }
139
+ /**
140
+ * Displays a prompt to the user and returns the response.
141
+ * Throw an error if `prompt` is not supported by the current configuration.
142
+ *
143
+ * @template T
144
+ * @param {string} message - The message to display in the prompt.
145
+ * @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
146
+ * @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
147
+ */
148
+ prompt(message, opts) {
149
+ if (!this.options.prompt) throw new Error("prompt is not supported!");
150
+ return this.options.prompt(message, opts);
151
+ }
152
+ /**
153
+ * Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
154
+ *
155
+ * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
156
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
157
+ */
158
+ create(options) {
159
+ const instance = new Consola({
160
+ ...this.options,
161
+ ...options
162
+ });
163
+ if (this._mockFn) instance.mockTypes(this._mockFn);
164
+ return instance;
165
+ }
166
+ /**
167
+ * Creates a new Consola instance with the specified default log object properties.
168
+ *
169
+ * @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
170
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
171
+ */
172
+ withDefaults(defaults) {
173
+ return this.create({
174
+ ...this.options,
175
+ defaults: {
176
+ ...this.options.defaults,
177
+ ...defaults
258
178
  }
179
+ });
180
+ }
181
+ /**
182
+ * Creates a new Consola instance with a specified tag, which will be included in every log.
183
+ *
184
+ * @param {string} tag - The tag to include in each log of the new instance.
185
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
186
+ */
187
+ withTag(tag) {
188
+ return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
189
+ }
190
+ /**
191
+ * Adds a custom reporter to the Consola instance.
192
+ * Reporters will be called for each log message, depending on their implementation and log level.
193
+ *
194
+ * @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
195
+ * @returns {Consola} The current Consola instance.
196
+ */
197
+ addReporter(reporter) {
198
+ this.options.reporters.push(reporter);
199
+ return this;
200
+ }
201
+ /**
202
+ * Removes a custom reporter from the Consola instance.
203
+ * If no reporter is specified, all reporters will be removed.
204
+ *
205
+ * @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
206
+ * @returns {Consola} The current Consola instance.
207
+ */
208
+ removeReporter(reporter) {
209
+ if (reporter) {
210
+ const i = this.options.reporters.indexOf(reporter);
211
+ if (i !== -1) return this.options.reporters.splice(i, 1);
212
+ } else this.options.reporters.splice(0);
213
+ return this;
214
+ }
215
+ /**
216
+ * Replaces all reporters of the Consola instance with the specified array of reporters.
217
+ *
218
+ * @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
219
+ * @returns {Consola} The current Consola instance.
220
+ */
221
+ setReporters(reporters) {
222
+ this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
223
+ return this;
224
+ }
225
+ wrapAll() {
226
+ this.wrapConsole();
227
+ this.wrapStd();
228
+ }
229
+ restoreAll() {
230
+ this.restoreConsole();
231
+ this.restoreStd();
232
+ }
233
+ /**
234
+ * Overrides console methods with Consola logging methods for consistent logging.
235
+ */
236
+ wrapConsole() {
237
+ for (const type in this.options.types) {
238
+ if (!console["__" + type]) console["__" + type] = console[type];
239
+ console[type] = this[type].raw;
259
240
  }
260
- /**
261
- * Overrides standard output and error streams to redirect them through Consola.
262
- */
263
- wrapStd() {
264
- this._wrapStream(this.options.stdout, "log");
265
- this._wrapStream(this.options.stderr, "log");
241
+ }
242
+ /**
243
+ * Restores the original console methods, removing Consola overrides.
244
+ */
245
+ restoreConsole() {
246
+ for (const type in this.options.types) if (console["__" + type]) {
247
+ console[type] = console["__" + type];
248
+ delete console["__" + type];
266
249
  }
267
- _wrapStream(stream, type) {
268
- if (!stream) return;
269
- if (!stream.__write) stream.__write = stream.write;
270
- stream.write = (data) => {
271
- this[type].raw(String(data).trim());
272
- };
250
+ }
251
+ /**
252
+ * Overrides standard output and error streams to redirect them through Consola.
253
+ */
254
+ wrapStd() {
255
+ this._wrapStream(this.options.stdout, "log");
256
+ this._wrapStream(this.options.stderr, "log");
257
+ }
258
+ _wrapStream(stream, type) {
259
+ if (!stream) return;
260
+ if (!stream.__write) stream.__write = stream.write;
261
+ stream.write = (data) => {
262
+ this[type].raw(String(data).trim());
263
+ };
264
+ }
265
+ /**
266
+ * Restores the original standard output and error streams, removing the Consola redirection.
267
+ */
268
+ restoreStd() {
269
+ this._restoreStream(this.options.stdout);
270
+ this._restoreStream(this.options.stderr);
271
+ }
272
+ _restoreStream(stream) {
273
+ if (!stream) return;
274
+ if (stream.__write) {
275
+ stream.write = stream.__write;
276
+ delete stream.__write;
273
277
  }
274
- /**
275
- * Restores the original standard output and error streams, removing the Consola redirection.
276
- */
277
- restoreStd() {
278
- this._restoreStream(this.options.stdout);
279
- this._restoreStream(this.options.stderr);
278
+ }
279
+ /**
280
+ * Pauses logging, queues incoming logs until resumed.
281
+ */
282
+ pauseLogs() {
283
+ paused = true;
284
+ }
285
+ /**
286
+ * Resumes logging, processing any queued logs.
287
+ */
288
+ resumeLogs() {
289
+ paused = false;
290
+ const _queue = queue.splice(0);
291
+ for (const item of _queue) item[0]._logFn(item[1], item[2]);
292
+ }
293
+ /**
294
+ * Replaces logging methods with mocks if a mock function is provided.
295
+ *
296
+ * @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
297
+ */
298
+ mockTypes(mockFn) {
299
+ const _mockFn = mockFn || this.options.mockFn;
300
+ this._mockFn = _mockFn;
301
+ if (typeof _mockFn !== "function") return;
302
+ for (const type in this.options.types) {
303
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
304
+ this[type].raw = this[type];
280
305
  }
281
- _restoreStream(stream) {
282
- if (!stream) return;
283
- if (stream.__write) {
284
- stream.write = stream.__write;
285
- delete stream.__write;
306
+ }
307
+ _wrapLogFn(defaults, isRaw) {
308
+ return (...args) => {
309
+ if (paused) {
310
+ queue.push([
311
+ this,
312
+ defaults,
313
+ args,
314
+ isRaw
315
+ ]);
316
+ return;
286
317
  }
287
- }
288
- /**
289
- * Pauses logging, queues incoming logs until resumed.
290
- */
291
- pauseLogs() {
292
- paused = true;
293
- }
294
- /**
295
- * Resumes logging, processing any queued logs.
296
- */
297
- resumeLogs() {
298
- paused = false;
299
- const _queue = queue.splice(0);
300
- for (const item of _queue) item[0]._logFn(item[1], item[2]);
301
- }
302
- /**
303
- * Replaces logging methods with mocks if a mock function is provided.
304
- *
305
- * @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
306
- */
307
- mockTypes(mockFn) {
308
- const _mockFn = mockFn || this.options.mockFn;
309
- this._mockFn = _mockFn;
310
- if (typeof _mockFn !== "function") return;
311
- for (const type in this.options.types) {
312
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
313
- this[type].raw = this[type];
318
+ return this._logFn(defaults, args, isRaw);
319
+ };
320
+ }
321
+ _logFn(defaults, args, isRaw) {
322
+ if ((defaults.level || 0) > this.level) return false;
323
+ const logObj = {
324
+ date: /* @__PURE__ */ new Date(),
325
+ args: [],
326
+ ...defaults,
327
+ level: _normalizeLogLevel(defaults.level, this.options.types)
328
+ };
329
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
330
+ else logObj.args = [...args];
331
+ if (logObj.message) {
332
+ logObj.args.unshift(logObj.message);
333
+ delete logObj.message;
334
+ }
335
+ if (logObj.additional) {
336
+ if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
337
+ logObj.args.push("\n" + logObj.additional.join("\n"));
338
+ delete logObj.additional;
339
+ }
340
+ logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
341
+ logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
342
+ const resolveLog = (newLog = false) => {
343
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
344
+ if (this._lastLog.object && repeated > 0) {
345
+ const args2 = [...this._lastLog.object.args];
346
+ if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
347
+ this._log({
348
+ ...this._lastLog.object,
349
+ args: args2
350
+ });
351
+ this._lastLog.count = 1;
314
352
  }
315
- }
316
- _wrapLogFn(defaults, isRaw) {
317
- return (...args) => {
318
- if (paused) {
319
- queue.push([
320
- this,
321
- defaults,
322
- args,
323
- isRaw
324
- ]);
353
+ if (newLog) {
354
+ this._lastLog.object = logObj;
355
+ this._log(logObj);
356
+ }
357
+ };
358
+ clearTimeout(this._lastLog.timeout);
359
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
360
+ this._lastLog.time = logObj.date;
361
+ if (diffTime < this.options.throttle) try {
362
+ const serializedLog = JSON.stringify([
363
+ logObj.type,
364
+ logObj.tag,
365
+ logObj.args
366
+ ]);
367
+ const isSameLog = this._lastLog.serialized === serializedLog;
368
+ this._lastLog.serialized = serializedLog;
369
+ if (isSameLog) {
370
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
371
+ if (this._lastLog.count > this.options.throttleMin) {
372
+ this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
325
373
  return;
326
374
  }
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
375
  }
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
- }
349
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
350
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
351
- const resolveLog = (newLog = false) => {
352
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
353
- if (this._lastLog.object && repeated > 0) {
354
- const args2 = [...this._lastLog.object.args];
355
- if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
356
- this._log({
357
- ...this._lastLog.object,
358
- args: args2
359
- });
360
- this._lastLog.count = 1;
361
- }
362
- if (newLog) {
363
- this._lastLog.object = logObj;
364
- this._log(logObj);
365
- }
366
- };
367
- clearTimeout(this._lastLog.timeout);
368
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
369
- this._lastLog.time = logObj.date;
370
- if (diffTime < this.options.throttle) try {
371
- const serializedLog = JSON.stringify([
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
- } });
376
+ } catch {}
377
+ resolveLog(true);
378
+ }
379
+ _log(logObj) {
380
+ for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
381
+ }
382
+ };
383
+ function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
384
+ if (input === void 0) return defaultLevel;
385
+ if (typeof input === "number") return input;
386
+ if (types[input] && types[input].level !== void 0) return types[input].level;
387
+ return defaultLevel;
388
+ }
389
+ Consola.prototype.add = Consola.prototype.addReporter;
390
+ Consola.prototype.remove = Consola.prototype.removeReporter;
391
+ Consola.prototype.clear = Consola.prototype.removeReporter;
392
+ Consola.prototype.withScope = Consola.prototype.withTag;
393
+ Consola.prototype.mock = Consola.prototype.mockTypes;
394
+ Consola.prototype.pause = Consola.prototype.pauseLogs;
395
+ Consola.prototype.resume = Consola.prototype.resumeLogs;
396
+ function createConsola$1(options = {}) {
397
+ return new Consola(options);
398
+ }
400
399
 
401
400
  //#endregion
402
401
  //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
403
402
  function parseStack(stack, message) {
404
- const cwd$1 = process.cwd() + sep;
405
- const lines = stack.split("\n").splice(message.split("\n").length).map((l$1) => l$1.trim().replace("file://", "").replace(cwd$1, ""));
406
- return lines;
403
+ const cwd = process.cwd() + sep;
404
+ return stack.split("\n").splice(message.split("\n").length).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
407
405
  }
408
406
  function writeStream(data, stream) {
409
- const write = stream.__write || stream.write;
410
- return write.call(stream, data);
407
+ return (stream.__write || stream.write).call(stream, data);
411
408
  }
412
- var bracket, BasicReporter;
413
- var init_consola_DRwqZj3T = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs"() {
414
- bracket = (x) => x ? `[${x}]` : "";
415
- BasicReporter = class {
416
- formatStack(stack, message, opts) {
417
- const indent = " ".repeat((opts?.errorLevel || 0) + 1);
418
- return indent + parseStack(stack, message).join(`
409
+ const bracket = (x) => x ? `[${x}]` : "";
410
+ var BasicReporter = class {
411
+ formatStack(stack, message, opts) {
412
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
413
+ return indent + parseStack(stack, message).join(`
419
414
  ${indent}`);
420
- }
421
- formatError(err, opts) {
422
- const message = err.message ?? formatWithOptions(opts, err);
423
- const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
424
- const level = opts?.errorLevel || 0;
425
- const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
426
- const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
427
- ...opts,
428
- errorLevel: level + 1
429
- }) : "";
430
- return causedPrefix + message + "\n" + stack + causedError;
431
- }
432
- formatArgs(args, opts) {
433
- const _args = args.map((arg) => {
434
- if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
435
- return arg;
436
- });
437
- return formatWithOptions(opts, ..._args);
438
- }
439
- formatDate(date, opts) {
440
- return opts.date ? date.toLocaleTimeString() : "";
441
- }
442
- filterAndJoin(arr) {
443
- return arr.filter(Boolean).join(" ");
444
- }
445
- formatLogObj(logObj, opts) {
446
- const message = this.formatArgs(logObj.args, opts);
447
- if (logObj.type === "box") return "\n" + [
448
- bracket(logObj.tag),
449
- logObj.title && logObj.title,
450
- ...message.split("\n")
451
- ].filter(Boolean).map((l$1) => " > " + l$1).join("\n") + "\n";
452
- return this.filterAndJoin([
453
- bracket(logObj.type),
454
- bracket(logObj.tag),
455
- message
456
- ]);
457
- }
458
- log(logObj, ctx) {
459
- const line = this.formatLogObj(logObj, {
460
- columns: ctx.options.stdout.columns || 0,
461
- ...ctx.options.formatOptions
462
- });
463
- return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
464
- }
465
- };
466
- } });
415
+ }
416
+ formatError(err, opts) {
417
+ const message = err.message ?? formatWithOptions(opts, err);
418
+ const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
419
+ const level = opts?.errorLevel || 0;
420
+ const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
421
+ const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
422
+ ...opts,
423
+ errorLevel: level + 1
424
+ }) : "";
425
+ return causedPrefix + message + "\n" + stack + causedError;
426
+ }
427
+ formatArgs(args, opts) {
428
+ return formatWithOptions(opts, ...args.map((arg) => {
429
+ if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
430
+ return arg;
431
+ }));
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) => " > " + l).join("\n") + "\n";
446
+ return this.filterAndJoin([
447
+ bracket(logObj.type),
448
+ bracket(logObj.tag),
449
+ message
450
+ ]);
451
+ }
452
+ log(logObj, ctx) {
453
+ return writeStream(this.formatLogObj(logObj, {
454
+ columns: ctx.options.stdout.columns || 0,
455
+ ...ctx.options.formatOptions
456
+ }) + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
457
+ }
458
+ };
467
459
 
468
460
  //#endregion
469
461
  //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
462
+ const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
463
+ const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
464
+ const isForced = "FORCE_COLOR" in env || argv.includes("--color");
465
+ const isWindows = platform === "win32";
466
+ const isDumbTerminal = env.TERM === "dumb";
467
+ const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
468
+ const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
469
+ const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
470
470
  function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
471
471
  return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
472
472
  }
@@ -479,15 +479,135 @@ function filterEmpty(open, close, replace = open, at = open.length + 1) {
479
479
  function init(open, close, replace) {
480
480
  return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
481
481
  }
482
+ const colorDefs = {
483
+ reset: init(0, 0),
484
+ bold: init(1, 22, "\x1B[22m\x1B[1m"),
485
+ dim: init(2, 22, "\x1B[22m\x1B[2m"),
486
+ italic: init(3, 23),
487
+ underline: init(4, 24),
488
+ inverse: init(7, 27),
489
+ hidden: init(8, 28),
490
+ strikethrough: init(9, 29),
491
+ black: init(30, 39),
492
+ red: init(31, 39),
493
+ green: init(32, 39),
494
+ yellow: init(33, 39),
495
+ blue: init(34, 39),
496
+ magenta: init(35, 39),
497
+ cyan: init(36, 39),
498
+ white: init(37, 39),
499
+ gray: init(90, 39),
500
+ bgBlack: init(40, 49),
501
+ bgRed: init(41, 49),
502
+ bgGreen: init(42, 49),
503
+ bgYellow: init(43, 49),
504
+ bgBlue: init(44, 49),
505
+ bgMagenta: init(45, 49),
506
+ bgCyan: init(46, 49),
507
+ bgWhite: init(47, 49),
508
+ blackBright: init(90, 39),
509
+ redBright: init(91, 39),
510
+ greenBright: init(92, 39),
511
+ yellowBright: init(93, 39),
512
+ blueBright: init(94, 39),
513
+ magentaBright: init(95, 39),
514
+ cyanBright: init(96, 39),
515
+ whiteBright: init(97, 39),
516
+ bgBlackBright: init(100, 49),
517
+ bgRedBright: init(101, 49),
518
+ bgGreenBright: init(102, 49),
519
+ bgYellowBright: init(103, 49),
520
+ bgBlueBright: init(104, 49),
521
+ bgMagentaBright: init(105, 49),
522
+ bgCyanBright: init(106, 49),
523
+ bgWhiteBright: init(107, 49)
524
+ };
482
525
  function createColors(useColor = isColorSupported) {
483
526
  return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
484
527
  }
528
+ const colors = createColors();
485
529
  function getColor$1(color, fallback = "reset") {
486
- return colors$1[color] || colors$1[fallback];
530
+ return colors[color] || colors[fallback];
487
531
  }
488
- function stripAnsi(text) {
532
+ const ansiRegex$1 = [String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`, String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");
533
+ function stripAnsi$1(text) {
489
534
  return text.replace(new RegExp(ansiRegex$1, "g"), "");
490
535
  }
536
+ const boxStylePresets = {
537
+ solid: {
538
+ tl: "┌",
539
+ tr: "┐",
540
+ bl: "└",
541
+ br: "┘",
542
+ h: "─",
543
+ v: "│"
544
+ },
545
+ double: {
546
+ tl: "╔",
547
+ tr: "╗",
548
+ bl: "╚",
549
+ br: "╝",
550
+ h: "═",
551
+ v: "║"
552
+ },
553
+ doubleSingle: {
554
+ tl: "╓",
555
+ tr: "╖",
556
+ bl: "╙",
557
+ br: "╜",
558
+ h: "─",
559
+ v: "║"
560
+ },
561
+ doubleSingleRounded: {
562
+ tl: "╭",
563
+ tr: "╮",
564
+ bl: "╰",
565
+ br: "╯",
566
+ h: "─",
567
+ v: "║"
568
+ },
569
+ singleThick: {
570
+ tl: "┏",
571
+ tr: "┓",
572
+ bl: "┗",
573
+ br: "┛",
574
+ h: "━",
575
+ v: "┃"
576
+ },
577
+ singleDouble: {
578
+ tl: "╒",
579
+ tr: "╕",
580
+ bl: "╘",
581
+ br: "╛",
582
+ h: "═",
583
+ v: "│"
584
+ },
585
+ singleDoubleRounded: {
586
+ tl: "╭",
587
+ tr: "╮",
588
+ bl: "╰",
589
+ br: "╯",
590
+ h: "═",
591
+ v: "│"
592
+ },
593
+ rounded: {
594
+ tl: "╭",
595
+ tr: "╮",
596
+ bl: "╰",
597
+ br: "╯",
598
+ h: "─",
599
+ v: "│"
600
+ }
601
+ };
602
+ const defaultStyle = {
603
+ borderColor: "white",
604
+ borderStyle: "rounded",
605
+ valign: "center",
606
+ padding: 2,
607
+ marginLeft: 1,
608
+ marginTop: 1,
609
+ marginBottom: 1
610
+ };
491
611
  function box(text, _opts = {}) {
492
612
  const opts = {
493
613
  ..._opts,
@@ -503,166 +623,146 @@ function box(text, _opts = {}) {
503
623
  if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
504
624
  const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
505
625
  const height = textLines.length + paddingOffset;
506
- const width = Math.max(...textLines.map((line) => stripAnsi(line).length), opts.title ? stripAnsi(opts.title).length : 0) + paddingOffset;
626
+ const width = Math.max(...textLines.map((line) => stripAnsi$1(line).length), opts.title ? stripAnsi$1(opts.title).length : 0) + paddingOffset;
507
627
  const widthOffset = width + paddingOffset;
508
628
  const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
509
629
  if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
510
630
  if (opts.title) {
511
631
  const title = _color ? _color(opts.title) : opts.title;
512
- const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
513
- const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
632
+ const left = borderStyle.h.repeat(Math.floor((width - stripAnsi$1(opts.title).length) / 2));
633
+ const right = borderStyle.h.repeat(width - stripAnsi$1(opts.title).length - stripAnsi$1(left).length + paddingOffset);
514
634
  boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
515
635
  } else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
516
636
  const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
517
- for (let i$1 = 0; i$1 < height; i$1++) if (i$1 < valignOffset || i$1 >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
637
+ for (let i = 0; i < height; i++) if (i < valignOffset || i >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
518
638
  else {
519
- const line = textLines[i$1 - valignOffset];
639
+ const line = textLines[i - valignOffset];
520
640
  const left = " ".repeat(paddingOffset);
521
- const right = " ".repeat(width - stripAnsi(line).length);
641
+ const right = " ".repeat(width - stripAnsi$1(line).length);
522
642
  boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
523
643
  }
524
644
  boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
525
645
  if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
526
646
  return boxLines.join("\n");
527
647
  }
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
648
 
660
649
  //#endregion
661
650
  //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
651
+ const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? r : globalThis), o = new Proxy(r, {
652
+ get(e, s) {
653
+ return i()[s] ?? r[s];
654
+ },
655
+ has(e, s) {
656
+ return s in i() || s in r;
657
+ },
658
+ set(e, s, E) {
659
+ const B = i(true);
660
+ return B[s] = E, true;
661
+ },
662
+ deleteProperty(e, s) {
663
+ if (!s) return false;
664
+ const E = i(true);
665
+ return delete E[s], true;
666
+ },
667
+ ownKeys() {
668
+ const e = i(true);
669
+ return Object.keys(e);
670
+ }
671
+ }), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
672
+ ["APPVEYOR"],
673
+ [
674
+ "AWS_AMPLIFY",
675
+ "AWS_APP_ID",
676
+ { ci: true }
677
+ ],
678
+ ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
679
+ ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
680
+ ["APPCIRCLE", "AC_APPCIRCLE"],
681
+ ["BAMBOO", "bamboo_planKey"],
682
+ ["BITBUCKET", "BITBUCKET_COMMIT"],
683
+ ["BITRISE", "BITRISE_IO"],
684
+ ["BUDDY", "BUDDY_WORKSPACE_ID"],
685
+ ["BUILDKITE"],
686
+ ["CIRCLE", "CIRCLECI"],
687
+ ["CIRRUS", "CIRRUS_CI"],
688
+ [
689
+ "CLOUDFLARE_PAGES",
690
+ "CF_PAGES",
691
+ { ci: true }
692
+ ],
693
+ ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
694
+ ["CODEFRESH", "CF_BUILD_ID"],
695
+ ["DRONE"],
696
+ ["DRONE", "DRONE_BUILD_EVENT"],
697
+ ["DSARI"],
698
+ ["GITHUB_ACTIONS"],
699
+ ["GITLAB", "GITLAB_CI"],
700
+ ["GITLAB", "CI_MERGE_REQUEST_ID"],
701
+ ["GOCD", "GO_PIPELINE_LABEL"],
702
+ ["LAYERCI"],
703
+ ["HUDSON", "HUDSON_URL"],
704
+ ["JENKINS", "JENKINS_URL"],
705
+ ["MAGNUM"],
706
+ ["NETLIFY"],
707
+ [
708
+ "NETLIFY",
709
+ "NETLIFY_LOCAL",
710
+ { ci: false }
711
+ ],
712
+ ["NEVERCODE"],
713
+ ["RENDER"],
714
+ ["SAIL", "SAILCI"],
715
+ ["SEMAPHORE"],
716
+ ["SCREWDRIVER"],
717
+ ["SHIPPABLE"],
718
+ ["SOLANO", "TDDIUM"],
719
+ ["STRIDER"],
720
+ ["TEAMCITY", "TEAMCITY_VERSION"],
721
+ ["TRAVIS"],
722
+ ["VERCEL", "NOW_BUILDER"],
723
+ [
724
+ "VERCEL",
725
+ "VERCEL",
726
+ { ci: false }
727
+ ],
728
+ [
729
+ "VERCEL",
730
+ "VERCEL_ENV",
731
+ { ci: false }
732
+ ],
733
+ ["APPCENTER", "APPCENTER_BUILD_ID"],
734
+ [
735
+ "CODESANDBOX",
736
+ "CODESANDBOX_SSE",
737
+ { ci: false }
738
+ ],
739
+ [
740
+ "CODESANDBOX",
741
+ "CODESANDBOX_HOST",
742
+ { ci: false }
743
+ ],
744
+ ["STACKBLITZ"],
745
+ ["STORMKIT"],
746
+ ["CLEAVR"],
747
+ ["ZEABUR"],
748
+ [
749
+ "CODESPHERE",
750
+ "CODESPHERE_APP_ID",
751
+ { ci: true }
752
+ ],
753
+ ["RAILWAY", "RAILWAY_PROJECT_ID"],
754
+ ["RAILWAY", "RAILWAY_SERVICE_ID"],
755
+ ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
756
+ [
757
+ "FIREBASE_APP_HOSTING",
758
+ "FIREBASE_APP_HOSTING",
759
+ { ci: true }
760
+ ]
761
+ ];
662
762
  function b() {
663
763
  if (globalThis.process?.env) for (const e of f) {
664
- const s$1 = e[1] || e[0];
665
- if (globalThis.process?.env[s$1]) return {
764
+ const s = e[1] || e[0];
765
+ if (globalThis.process?.env[s]) return {
666
766
  name: e[0].toLowerCase(),
667
767
  ...e[2]
668
768
  };
@@ -675,19 +775,43 @@ function b() {
675
775
  ci: false
676
776
  };
677
777
  }
778
+ const l = b();
779
+ l.name;
678
780
  function n(e) {
679
781
  return e ? e !== "false" : false;
680
782
  }
783
+ 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);
784
+ n(o.MINIMAL);
785
+ const A = /^win/i.test(I);
786
+ !n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM);
787
+ const C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
788
+ Number(C?.split(".")[0]);
789
+ const y = globalThis.process || Object.create(null), _ = { versions: {} };
790
+ new Proxy(y, { get(e, s) {
791
+ if (s === "env") return o;
792
+ if (s in e) return e[s];
793
+ if (s in _) return _[s];
794
+ } });
795
+ 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 = [
796
+ [S, "netlify"],
797
+ [u, "edge-light"],
798
+ [N, "workerd"],
799
+ [L, "fastly"],
800
+ [D, "deno"],
801
+ [O, "bun"],
802
+ [c, "node"]
803
+ ];
681
804
  function G() {
682
- const e = F.find((s$1) => s$1[0]);
805
+ const e = F.find((s) => s[0]);
683
806
  if (e) return { name: e[1] };
684
807
  }
808
+ G()?.name;
685
809
  function ansiRegex({ onlyFirst = false } = {}) {
686
- const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
687
- 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("|");
810
+ const pattern = [`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`, "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
688
811
  return new RegExp(pattern, onlyFirst ? void 0 : "g");
689
812
  }
690
- function stripAnsi$1(string) {
813
+ const regex = ansiRegex();
814
+ function stripAnsi(string) {
691
815
  if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
692
816
  return string.replace(regex, "");
693
817
  }
@@ -708,10 +832,15 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
708
832
  if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
709
833
  return 1;
710
834
  }
711
- function stringWidth$1(string, options$1 = {}) {
835
+ const emojiRegex = () => {
836
+ 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;
837
+ };
838
+ const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
839
+ const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
840
+ function stringWidth$1(string, options = {}) {
712
841
  if (typeof string !== "string" || string.length === 0) return 0;
713
- const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options$1;
714
- if (!countAnsiEscapeCodes) string = stripAnsi$1(string);
842
+ const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
843
+ if (!countAnsiEscapeCodes) string = stripAnsi(string);
715
844
  if (string.length === 0) return 0;
716
845
  let width = 0;
717
846
  const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
@@ -732,260 +861,113 @@ function stringWidth$1(string, options$1 = {}) {
732
861
  return width;
733
862
  }
734
863
  function isUnicodeSupported() {
735
- const { env: env$1 } = process$1;
736
- const { TERM, TERM_PROGRAM } = env$1;
864
+ const { env } = process$1;
865
+ const { TERM, TERM_PROGRAM } = env;
737
866
  if (process$1.platform !== "win32") return TERM !== "linux";
738
- 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";
867
+ return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
739
868
  }
869
+ const TYPE_COLOR_MAP = {
870
+ info: "cyan",
871
+ fail: "red",
872
+ success: "green",
873
+ ready: "green",
874
+ start: "magenta"
875
+ };
876
+ const LEVEL_COLOR_MAP = {
877
+ 0: "red",
878
+ 1: "yellow"
879
+ };
880
+ const unicode = isUnicodeSupported();
881
+ const s = (c, fallback) => unicode ? c : fallback;
882
+ const TYPE_ICONS = {
883
+ error: s("✖", "×"),
884
+ fatal: s("✖", "×"),
885
+ ready: s("✔", "√"),
886
+ warn: s("⚠", "‼"),
887
+ info: s("ℹ", "i"),
888
+ success: s("✔", "√"),
889
+ debug: s("⚙", "D"),
890
+ trace: s("→", "→"),
891
+ fail: s("✖", "×"),
892
+ start: s("◐", "o"),
893
+ log: ""
894
+ };
740
895
  function stringWidth(str) {
741
- const hasICU = typeof Intl === "object";
742
- if (!hasICU || !Intl.Segmenter) return stripAnsi(str).length;
896
+ if (!(typeof Intl === "object") || !Intl.Segmenter) return stripAnsi$1(str).length;
743
897
  return stringWidth$1(str);
744
898
  }
899
+ var FancyReporter = class extends BasicReporter {
900
+ formatStack(stack, message, opts) {
901
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
902
+ return `
903
+ ${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)).join(`
904
+ ${indent}`);
905
+ }
906
+ formatType(logObj, isBadge, opts) {
907
+ const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
908
+ if (isBadge) return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
909
+ const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
910
+ return _type ? getColor(typeColor)(_type) : "";
911
+ }
912
+ formatLogObj(logObj, opts) {
913
+ const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
914
+ if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
915
+ title: logObj.title ? characterFormat(logObj.title) : void 0,
916
+ style: logObj.style
917
+ });
918
+ const date = this.formatDate(logObj.date, opts);
919
+ const coloredDate = date && colors.gray(date);
920
+ const isBadge = logObj.badge ?? logObj.level < 2;
921
+ const type = this.formatType(logObj, isBadge, opts);
922
+ const tag = logObj.tag ? colors.gray(logObj.tag) : "";
923
+ let line;
924
+ const left = this.filterAndJoin([type, characterFormat(message)]);
925
+ const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
926
+ const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
927
+ line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
928
+ line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
929
+ if (logObj.type === "trace") {
930
+ const _err = /* @__PURE__ */ new Error("Trace: " + logObj.message);
931
+ line += this.formatStack(_err.stack || "", _err.message);
932
+ }
933
+ return isBadge ? "\n" + line + "\n" : line;
934
+ }
935
+ };
745
936
  function characterFormat(str) {
746
- return str.replace(/`([^`]+)`/gm, (_$1, m) => colors$1.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_$1, m) => ` ${colors$1.underline(m)} `);
937
+ return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
747
938
  }
748
939
  function getColor(color = "white") {
749
- return colors$1[color] || colors$1.white;
940
+ return colors[color] || colors.white;
750
941
  }
751
942
  function getBgColor(color = "bgWhite") {
752
- return colors$1[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors$1.bgWhite;
943
+ return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
753
944
  }
754
- function createConsola(options$1 = {}) {
945
+ function createConsola(options = {}) {
755
946
  let level = _getDefaultLogLevel();
756
947
  if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
757
- const consola2 = createConsola$1({
948
+ return createConsola$1({
758
949
  level,
759
950
  defaults: { level },
760
951
  stdout: process.stdout,
761
952
  stderr: process.stderr,
762
- prompt: (...args) => import("./shared/prompt-GFYxfPw7.mjs").then((m) => m.prompt(...args)),
763
- reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
764
- ...options$1
953
+ prompt: (...args) => import("./shared/prompt-B6NrDD1-.mjs").then((m) => m.prompt(...args)),
954
+ reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
955
+ ...options
765
956
  });
766
- return consola2;
767
957
  }
768
958
  function _getDefaultLogLevel() {
769
959
  if (g) return LogLevels.debug;
770
960
  if (R) return LogLevels.warn;
771
961
  return LogLevels.info;
772
962
  }
773
- var r, i, o, t, f, l, I, T, a, g, R, A, C, y, _, c, O, D, L, S, u, N, F, P, regex, emojiRegex, segmenter, defaultIgnorableCodePointRegex, TYPE_COLOR_MAP, LEVEL_COLOR_MAP, unicode, s, TYPE_ICONS, FancyReporter, consola;
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 = 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
- } });
963
+ const consola = createConsola();
986
964
 
987
965
  //#endregion
988
966
  //#region src/cli/logger.ts
967
+ /**
968
+ * Console logger
969
+ */
970
+ const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
989
971
  function createTestingLogger() {
990
972
  const types = [
991
973
  "silent",
@@ -1007,79 +989,55 @@ function createTestingLogger() {
1007
989
  for (const type of types) ret[type] = console.log;
1008
990
  return ret;
1009
991
  }
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
992
 
1016
993
  //#endregion
1017
994
  //#region src/cli/arguments/alias.ts
1018
- var alias;
1019
- var init_alias = __esm({ "src/cli/arguments/alias.ts"() {
1020
- alias = {
1021
- config: {
1022
- abbreviation: "c",
1023
- hint: "filename"
1024
- },
1025
- help: { abbreviation: "h" },
1026
- version: { abbreviation: "v" },
1027
- watch: { abbreviation: "w" },
1028
- dir: { abbreviation: "d" },
1029
- file: { abbreviation: "o" },
1030
- external: { abbreviation: "e" },
1031
- format: { abbreviation: "f" },
1032
- name: { abbreviation: "n" },
1033
- globals: { abbreviation: "g" },
1034
- sourcemap: {
1035
- abbreviation: "s",
1036
- default: true
1037
- },
1038
- minify: { abbreviation: "m" },
1039
- platform: { abbreviation: "p" },
1040
- assetFileNames: { hint: "name" },
1041
- chunkFileNames: { hint: "name" },
1042
- entryFileNames: { hint: "name" },
1043
- externalLiveBindings: {
1044
- default: true,
1045
- reverse: true
1046
- },
1047
- treeshake: {
1048
- default: true,
1049
- reverse: true
1050
- },
1051
- moduleTypes: { hint: "types" }
1052
- };
1053
- } });
995
+ const alias = {
996
+ config: {
997
+ abbreviation: "c",
998
+ hint: "filename"
999
+ },
1000
+ help: { abbreviation: "h" },
1001
+ version: { abbreviation: "v" },
1002
+ watch: { abbreviation: "w" },
1003
+ dir: { abbreviation: "d" },
1004
+ file: { abbreviation: "o" },
1005
+ external: { abbreviation: "e" },
1006
+ format: { abbreviation: "f" },
1007
+ name: { abbreviation: "n" },
1008
+ globals: { abbreviation: "g" },
1009
+ sourcemap: {
1010
+ abbreviation: "s",
1011
+ default: true
1012
+ },
1013
+ minify: { abbreviation: "m" },
1014
+ platform: { abbreviation: "p" },
1015
+ assetFileNames: { hint: "name" },
1016
+ chunkFileNames: { hint: "name" },
1017
+ entryFileNames: { hint: "name" },
1018
+ externalLiveBindings: {
1019
+ default: true,
1020
+ reverse: true
1021
+ },
1022
+ treeshake: {
1023
+ default: true,
1024
+ reverse: true
1025
+ },
1026
+ preserveEntrySignatures: {
1027
+ default: "strict",
1028
+ reverse: true
1029
+ },
1030
+ moduleTypes: { hint: "types" }
1031
+ };
1054
1032
 
1055
1033
  //#endregion
1056
1034
  //#region src/cli/arguments/utils.ts
1057
- function getSchemaType(schema) {
1058
- if ("anyOf" in schema) {
1059
- const types = schema.anyOf.map(getSchemaType);
1060
- let result = priority.find((type) => types.includes(type));
1061
- if (result) return result;
1062
- }
1063
- if ("type" in schema) return schema.type;
1064
- if ("const" in schema) return typeof schema.const;
1065
- return "never";
1066
- }
1067
- function flattenSchema(schema, base = {}, parent = "") {
1068
- if (schema === void 0) return base;
1069
- for (const [k, value] of Object.entries(schema)) {
1070
- const key = parent ? `${parent}.${k}` : k;
1071
- if (getSchemaType(value) === "object") if ("properties" in value) flattenSchema(value.properties, base, key);
1072
- else base[key] = value;
1073
- else base[key] = value;
1074
- }
1075
- return base;
1076
- }
1077
- function setNestedProperty(obj, path$1, value) {
1078
- const keys = path$1.split(".");
1035
+ function setNestedProperty(obj, path, value) {
1036
+ const keys = path.split(".");
1079
1037
  let current = obj;
1080
- for (let i$1 = 0; i$1 < keys.length - 1; i$1++) {
1081
- if (!current[keys[i$1]]) current[keys[i$1]] = {};
1082
- current = current[keys[i$1]];
1038
+ for (let i = 0; i < keys.length - 1; i++) {
1039
+ if (!current[keys[i]]) current[keys[i]] = {};
1040
+ current = current[keys[i]];
1083
1041
  }
1084
1042
  const finalKey = keys[keys.length - 1];
1085
1043
  Object.defineProperty(current, finalKey, {
@@ -1095,47 +1053,49 @@ function camelCaseToKebabCase(str) {
1095
1053
  function kebabCaseToCamelCase(str) {
1096
1054
  return str.replace(/-./g, (match) => match[1].toUpperCase());
1097
1055
  }
1098
- var priority;
1099
- var init_utils = __esm({ "src/cli/arguments/utils.ts"() {
1100
- priority = [
1101
- "object",
1102
- "array",
1103
- "string",
1104
- "number",
1105
- "boolean"
1106
- ];
1107
- } });
1108
1056
 
1109
1057
  //#endregion
1110
1058
  //#region src/cli/arguments/normalize.ts
1111
1059
  function normalizeCliOptions(cliOptions, positionals) {
1112
- const [data, errors] = validateCliOptions(cliOptions);
1060
+ const prototypePollutionKeys = [
1061
+ "__proto__",
1062
+ "constructor",
1063
+ "prototype"
1064
+ ];
1065
+ const unflattenedCliOptions = {};
1066
+ for (let [key, value] of Object.entries(cliOptions)) if (prototypePollutionKeys.includes(key)) {} else if (key.includes(".")) {
1067
+ const [parentKey] = key.split(".");
1068
+ unflattenedCliOptions[parentKey] ??= {};
1069
+ setNestedProperty(unflattenedCliOptions, key, value);
1070
+ } else unflattenedCliOptions[key] = value;
1071
+ const [data, errors] = validateCliOptions(unflattenedCliOptions);
1113
1072
  if (errors?.length) {
1114
1073
  errors.forEach((error) => {
1115
1074
  logger.error(`${error}. You can use \`rolldown -h\` to see the help.`);
1116
1075
  });
1117
1076
  process.exit(1);
1118
1077
  }
1119
- const options$1 = data ?? {};
1078
+ const options = data ?? {};
1120
1079
  const result = {
1121
1080
  input: {},
1122
1081
  output: {},
1123
- help: options$1.help ?? false,
1124
- version: options$1.version ?? false,
1125
- watch: options$1.watch ?? false
1082
+ help: options.help ?? false,
1083
+ version: options.version ?? false,
1084
+ watch: options.watch ?? false
1126
1085
  };
1127
- if (typeof options$1.config === "string") result.config = options$1.config;
1086
+ if (typeof options.config === "string") result.config = options.config;
1087
+ if (options.environment !== void 0) result.environment = options.environment;
1128
1088
  const keysOfInput = getInputCliKeys();
1129
1089
  const keysOfOutput = getOutputCliKeys();
1130
1090
  const reservedKeys = [
1131
1091
  "help",
1132
1092
  "version",
1133
1093
  "config",
1134
- "watch"
1094
+ "watch",
1095
+ "environment"
1135
1096
  ];
1136
- for (let [key, value] of Object.entries(options$1)) {
1137
- const keys = key.split(".");
1138
- const [primary] = keys;
1097
+ for (let [key, value] of Object.entries(options)) {
1098
+ const [primary] = key.split(".");
1139
1099
  if (keysOfInput.includes(primary)) setNestedProperty(result.input, key, value);
1140
1100
  else if (keysOfOutput.includes(primary)) setNestedProperty(result.output, key, value);
1141
1101
  else if (!reservedKeys.includes(key)) {
@@ -1147,14 +1107,25 @@ function normalizeCliOptions(cliOptions, positionals) {
1147
1107
  else result.input.input = positionals;
1148
1108
  return result;
1149
1109
  }
1150
- var init_normalize = __esm({ "src/cli/arguments/normalize.ts"() {
1151
- init_validator();
1152
- init_logger();
1153
- init_utils();
1154
- } });
1155
1110
 
1156
1111
  //#endregion
1157
1112
  //#region src/cli/arguments/index.ts
1113
+ const schemaInfo = getCliSchemaInfo();
1114
+ const options = Object.fromEntries(Object.entries(schemaInfo).filter(([_key, info]) => info.type !== "never").map(([key, info]) => {
1115
+ const config = Object.getOwnPropertyDescriptor(alias, key)?.value;
1116
+ const result = {
1117
+ type: info.type === "boolean" ? "boolean" : "string",
1118
+ description: info?.description ?? config?.description ?? "",
1119
+ hint: config?.hint
1120
+ };
1121
+ if (config && config?.abbreviation) result.short = config?.abbreviation;
1122
+ if (config && config.reverse) {
1123
+ if (result.description.startsWith("enable")) result.description = result.description.replace("enable", "disable");
1124
+ else if (!result.description.startsWith("Avoid")) result.description = `disable ${result.description}`;
1125
+ }
1126
+ key = camelCaseToKebabCase(key);
1127
+ return [config?.reverse ? `no-${key}` : key, result];
1128
+ }));
1158
1129
  function parseCliArguments() {
1159
1130
  const { values, tokens, positionals } = parseArgs({
1160
1131
  options,
@@ -1162,11 +1133,11 @@ function parseCliArguments() {
1162
1133
  allowPositionals: true,
1163
1134
  strict: false
1164
1135
  });
1165
- tokens.filter((token) => token.kind === "option").forEach((option) => {
1136
+ let invalid_options = tokens.filter((token) => token.kind === "option").map((option) => {
1166
1137
  let negative = false;
1167
1138
  if (option.name.startsWith("no-")) {
1168
1139
  const name = kebabCaseToCamelCase(option.name.substring(3));
1169
- if (name in flattenedSchema) {
1140
+ if (name in schemaInfo) {
1170
1141
  delete values[option.name];
1171
1142
  option.name = name;
1172
1143
  negative = true;
@@ -1174,12 +1145,12 @@ function parseCliArguments() {
1174
1145
  }
1175
1146
  delete values[option.name];
1176
1147
  option.name = kebabCaseToCamelCase(option.name);
1177
- let originalType = flattenedSchema[option.name];
1178
- if (!originalType) {
1179
- logger.error(`Invalid option: ${option.rawName}. We will ignore this option.`);
1180
- process.exit(1);
1181
- }
1182
- let type = getSchemaType(originalType);
1148
+ let originalInfo = schemaInfo[option.name];
1149
+ if (!originalInfo) return {
1150
+ name: option.name,
1151
+ value: option.value
1152
+ };
1153
+ let type = originalInfo.type;
1183
1154
  if (type === "string" && typeof option.value !== "string") {
1184
1155
  let opt = option;
1185
1156
  let defaultValue = Object.getOwnPropertyDescriptor(alias, opt.name)?.value;
@@ -1190,14 +1161,14 @@ function parseCliArguments() {
1190
1161
  writable: true
1191
1162
  });
1192
1163
  } else if (type === "object" && typeof option.value === "string") {
1193
- const [key, value] = option.value.split(",").map((x) => x.split("="))[0];
1164
+ const pairs = option.value.split(",").map((x) => x.split("="));
1194
1165
  if (!values[option.name]) Object.defineProperty(values, option.name, {
1195
1166
  value: {},
1196
1167
  enumerable: true,
1197
1168
  configurable: true,
1198
1169
  writable: true
1199
1170
  });
1200
- if (key && value) Object.defineProperty(values[option.name], key, {
1171
+ for (const [key, value] of pairs) if (key && value) Object.defineProperty(values[option.name], key, {
1201
1172
  value,
1202
1173
  enumerable: true,
1203
1174
  configurable: true,
@@ -1217,321 +1188,149 @@ function parseCliArguments() {
1217
1188
  configurable: true,
1218
1189
  writable: true
1219
1190
  });
1220
- else Object.defineProperty(values, option.name, {
1191
+ else if (type === "union") {
1192
+ let defaultValue = Object.getOwnPropertyDescriptor(alias, option.name)?.value;
1193
+ Object.defineProperty(values, option.name, {
1194
+ value: option.value ?? defaultValue?.default ?? "",
1195
+ enumerable: true,
1196
+ configurable: true,
1197
+ writable: true
1198
+ });
1199
+ } else Object.defineProperty(values, option.name, {
1221
1200
  value: option.value ?? "",
1222
1201
  enumerable: true,
1223
1202
  configurable: true,
1224
1203
  writable: true
1225
1204
  });
1205
+ }).filter((item) => {
1206
+ return item !== void 0;
1207
+ });
1208
+ invalid_options.sort((a, b) => {
1209
+ return a.name.localeCompare(b.name);
1226
1210
  });
1227
- return normalizeCliOptions(values, positionals);
1211
+ if (invalid_options.length !== 0) {
1212
+ let single = invalid_options.length === 1;
1213
+ logger.warn(`Option \`${invalid_options.map((item) => item.name).join(",")}\` ${single ? "is" : "are"} unrecognized. We will ignore ${single ? "this" : "those"} option${single ? "" : "s"}.`);
1214
+ }
1215
+ let rawArgs = {
1216
+ ...values,
1217
+ ...invalid_options.reduce((acc, cur) => {
1218
+ acc[cur.name] = cur.value;
1219
+ return acc;
1220
+ }, Object.create(null))
1221
+ };
1222
+ return {
1223
+ ...normalizeCliOptions(values, positionals),
1224
+ rawArgs
1225
+ };
1228
1226
  }
1229
- var objectSchema, flattenedSchema, options;
1230
- var init_arguments = __esm({ "src/cli/arguments/index.ts"() {
1231
- init_validator();
1232
- init_logger();
1233
- init_alias();
1234
- init_normalize();
1235
- init_utils();
1236
- objectSchema = getJsonSchema();
1237
- flattenedSchema = flattenSchema(objectSchema.properties);
1238
- options = Object.fromEntries(Object.entries(flattenedSchema).filter(([_key, schema]) => getSchemaType(schema) !== "never").map(([key, schema]) => {
1239
- const config = Object.getOwnPropertyDescriptor(alias, key)?.value;
1240
- const type = getSchemaType(schema);
1241
- const result = {
1242
- type: type === "boolean" ? "boolean" : "string",
1243
- description: schema?.description ?? config?.description ?? "",
1244
- hint: config?.hint
1245
- };
1246
- if (config && config?.abbreviation) result.short = config?.abbreviation;
1247
- if (config && config.reverse) if (result.description.startsWith("enable")) result.description = result.description.replace("enable", "disable");
1248
- else result.description = `disable ${result.description}`;
1249
- key = camelCaseToKebabCase(key);
1250
- return [config?.reverse ? `no-${key}` : key, result];
1251
- }));
1252
- } });
1253
-
1254
- //#endregion
1255
- //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
1256
- var signals;
1257
- var init_signals = __esm({ "../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js"() {
1258
- signals = [];
1259
- signals.push("SIGHUP", "SIGINT", "SIGTERM");
1260
- if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
1261
- if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
1262
- } });
1263
1227
 
1264
1228
  //#endregion
1265
- //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
1266
- var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process$2, onExit, load, unload;
1267
- var init_mjs = __esm({ "../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
1268
- init_signals();
1269
- 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";
1270
- kExitEmitter = Symbol.for("signal-exit emitter");
1271
- global = globalThis;
1272
- ObjectDefineProperty = Object.defineProperty.bind(Object);
1273
- Emitter = class {
1274
- emitted = {
1275
- afterExit: false,
1276
- exit: false
1277
- };
1278
- listeners = {
1279
- afterExit: [],
1280
- exit: []
1281
- };
1282
- count = 0;
1283
- id = Math.random();
1284
- constructor() {
1285
- if (global[kExitEmitter]) return global[kExitEmitter];
1286
- ObjectDefineProperty(global, kExitEmitter, {
1287
- value: this,
1288
- writable: false,
1289
- enumerable: false,
1290
- configurable: false
1291
- });
1292
- }
1293
- on(ev, fn) {
1294
- this.listeners[ev].push(fn);
1295
- }
1296
- removeListener(ev, fn) {
1297
- const list = this.listeners[ev];
1298
- const i$1 = list.indexOf(fn);
1299
- /* c8 ignore start */
1300
- if (i$1 === -1) return;
1301
- /* c8 ignore stop */
1302
- if (i$1 === 0 && list.length === 1) list.length = 0;
1303
- else list.splice(i$1, 1);
1304
- }
1305
- emit(ev, code, signal) {
1306
- if (this.emitted[ev]) return false;
1307
- this.emitted[ev] = true;
1308
- let ret = false;
1309
- for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
1310
- if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
1311
- return ret;
1312
- }
1229
+ //#region src/utils/clear-screen.ts
1230
+ const CLEAR_SCREEN = "\x1Bc";
1231
+ function getClearScreenFunction(options) {
1232
+ const isTTY = process.stdout.isTTY;
1233
+ const isAnyOptionNotAllowingClearScreen = arraify(options).some(({ watch }) => watch === false || watch?.clearScreen === false);
1234
+ if (isTTY && !isAnyOptionNotAllowingClearScreen) return () => {
1235
+ process.stdout.write(CLEAR_SCREEN);
1313
1236
  };
1314
- SignalExitBase = class {};
1315
- signalExitWrap = (handler) => {
1316
- return {
1317
- onExit(cb, opts) {
1318
- return handler.onExit(cb, opts);
1319
- },
1320
- load() {
1321
- return handler.load();
1322
- },
1323
- unload() {
1324
- return handler.unload();
1325
- }
1326
- };
1327
- };
1328
- SignalExitFallback = class extends SignalExitBase {
1329
- onExit() {
1330
- return () => {};
1331
- }
1332
- load() {}
1333
- unload() {}
1334
- };
1335
- SignalExit = class extends SignalExitBase {
1336
- /* c8 ignore start */
1337
- #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
1338
- /* c8 ignore stop */
1339
- #emitter = new Emitter();
1340
- #process;
1341
- #originalProcessEmit;
1342
- #originalProcessReallyExit;
1343
- #sigListeners = {};
1344
- #loaded = false;
1345
- constructor(process$3) {
1346
- super();
1347
- this.#process = process$3;
1348
- this.#sigListeners = {};
1349
- for (const sig of signals) this.#sigListeners[sig] = () => {
1350
- const listeners = this.#process.listeners(sig);
1351
- let { count } = this.#emitter;
1352
- /* c8 ignore start */
1353
- const p = process$3;
1354
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
1355
- /* c8 ignore stop */
1356
- if (listeners.length === count) {
1357
- this.unload();
1358
- const ret = this.#emitter.emit("exit", null, sig);
1359
- /* c8 ignore start */
1360
- const s$1 = sig === "SIGHUP" ? this.#hupSig : sig;
1361
- if (!ret) process$3.kill(process$3.pid, s$1);
1362
- }
1363
- };
1364
- this.#originalProcessReallyExit = process$3.reallyExit;
1365
- this.#originalProcessEmit = process$3.emit;
1366
- }
1367
- onExit(cb, opts) {
1368
- /* c8 ignore start */
1369
- if (!processOk(this.#process)) return () => {};
1370
- /* c8 ignore stop */
1371
- if (this.#loaded === false) this.load();
1372
- const ev = opts?.alwaysLast ? "afterExit" : "exit";
1373
- this.#emitter.on(ev, cb);
1374
- return () => {
1375
- this.#emitter.removeListener(ev, cb);
1376
- if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
1377
- };
1378
- }
1379
- load() {
1380
- if (this.#loaded) return;
1381
- this.#loaded = true;
1382
- this.#emitter.count += 1;
1383
- for (const sig of signals) try {
1384
- const fn = this.#sigListeners[sig];
1385
- if (fn) this.#process.on(sig, fn);
1386
- } catch (_$1) {}
1387
- this.#process.emit = (ev, ...a$1) => {
1388
- return this.#processEmit(ev, ...a$1);
1389
- };
1390
- this.#process.reallyExit = (code) => {
1391
- return this.#processReallyExit(code);
1392
- };
1393
- }
1394
- unload() {
1395
- if (!this.#loaded) return;
1396
- this.#loaded = false;
1397
- signals.forEach((sig) => {
1398
- const listener = this.#sigListeners[sig];
1399
- /* c8 ignore start */
1400
- if (!listener) throw new Error("Listener not defined for signal: " + sig);
1401
- /* c8 ignore stop */
1402
- try {
1403
- this.#process.removeListener(sig, listener);
1404
- } catch (_$1) {}
1405
- /* c8 ignore stop */
1406
- });
1407
- this.#process.emit = this.#originalProcessEmit;
1408
- this.#process.reallyExit = this.#originalProcessReallyExit;
1409
- this.#emitter.count -= 1;
1410
- }
1411
- #processReallyExit(code) {
1412
- /* c8 ignore start */
1413
- if (!processOk(this.#process)) return 0;
1414
- this.#process.exitCode = code || 0;
1415
- /* c8 ignore stop */
1416
- this.#emitter.emit("exit", this.#process.exitCode, null);
1417
- return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
1418
- }
1419
- #processEmit(ev, ...args) {
1420
- const og = this.#originalProcessEmit;
1421
- if (ev === "exit" && processOk(this.#process)) {
1422
- if (typeof args[0] === "number") this.#process.exitCode = args[0];
1423
- /* c8 ignore start */
1424
- const ret = og.call(this.#process, ev, ...args);
1425
- /* c8 ignore start */
1426
- this.#emitter.emit("exit", this.#process.exitCode, null);
1427
- /* c8 ignore stop */
1428
- return ret;
1429
- } else return og.call(this.#process, ev, ...args);
1430
- }
1431
- };
1432
- process$2 = globalThis.process;
1433
- ({onExit, load, unload} = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback()));
1434
- } });
1237
+ }
1435
1238
 
1436
1239
  //#endregion
1437
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
1438
- var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
1439
- function _usingCtx() {
1440
- var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
1441
- var n$2 = Error();
1442
- return n$2.name = "SuppressedError", n$2.error = r$2, n$2.suppressed = e$1, n$2;
1443
- }, e = {}, n$1 = [];
1444
- function using(r$2, e$1) {
1445
- if (null != e$1) {
1446
- if (Object(e$1) !== e$1) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
1447
- if (r$2) var o$1 = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
1448
- if (void 0 === o$1 && (o$1 = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$2)) var t$1 = o$1;
1449
- if ("function" != typeof o$1) throw new TypeError("Object is not disposable.");
1450
- t$1 && (o$1 = function o$2() {
1451
- try {
1452
- t$1.call(e$1);
1453
- } catch (r$3) {
1454
- return Promise.reject(r$3);
1455
- }
1456
- }), n$1.push({
1457
- v: e$1,
1458
- d: o$1,
1459
- a: r$2
1460
- });
1461
- } else r$2 && n$1.push({
1462
- d: e$1,
1463
- a: r$2
1464
- });
1465
- return e$1;
1466
- }
1467
- return {
1468
- e,
1469
- u: using.bind(null, !1),
1470
- a: using.bind(null, !0),
1471
- d: function d() {
1472
- var o$1, t$1 = this.e, s$1 = 0;
1473
- function next() {
1474
- for (; o$1 = n$1.pop();) try {
1475
- if (!o$1.a && 1 === s$1) return s$1 = 0, n$1.push(o$1), Promise.resolve().then(next);
1476
- if (o$1.d) {
1477
- var r$2 = o$1.d.call(o$1.v);
1478
- if (o$1.a) return s$1 |= 2, Promise.resolve(r$2).then(next, err);
1479
- } else s$1 |= 1;
1480
- } catch (r$3) {
1481
- return err(r$3);
1482
- }
1483
- if (1 === s$1) return t$1 !== e ? Promise.reject(t$1) : Promise.resolve();
1484
- if (t$1 !== e) throw t$1;
1240
+ //#region \0@oxc-project+runtime@0.110.0/helpers/usingCtx.js
1241
+ function _usingCtx() {
1242
+ var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
1243
+ var n = Error();
1244
+ return n.name = "SuppressedError", n.error = r, n.suppressed = e, n;
1245
+ }, e = {}, n = [];
1246
+ function using(r, e) {
1247
+ if (null != e) {
1248
+ if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
1249
+ if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
1250
+ if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o;
1251
+ if ("function" != typeof o) throw new TypeError("Object is not disposable.");
1252
+ t && (o = function o() {
1253
+ try {
1254
+ t.call(e);
1255
+ } catch (r) {
1256
+ return Promise.reject(r);
1485
1257
  }
1486
- function err(n$2) {
1487
- return t$1 = t$1 !== e ? new r$1(n$2, t$1) : n$2, next();
1258
+ }), n.push({
1259
+ v: e,
1260
+ d: o,
1261
+ a: r
1262
+ });
1263
+ } else r && n.push({
1264
+ d: e,
1265
+ a: r
1266
+ });
1267
+ return e;
1268
+ }
1269
+ return {
1270
+ e,
1271
+ u: using.bind(null, !1),
1272
+ a: using.bind(null, !0),
1273
+ d: function d() {
1274
+ var o, t = this.e, s = 0;
1275
+ function next() {
1276
+ for (; o = n.pop();) try {
1277
+ if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
1278
+ if (o.d) {
1279
+ var r = o.d.call(o.v);
1280
+ if (o.a) return s |= 2, Promise.resolve(r).then(next, err);
1281
+ } else s |= 1;
1282
+ } catch (r) {
1283
+ return err(r);
1488
1284
  }
1489
- return next();
1285
+ if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
1286
+ if (t !== e) throw t;
1490
1287
  }
1491
- };
1492
- }
1493
- module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports;
1494
- } });
1288
+ function err(n) {
1289
+ return t = t !== e ? new r(n, t) : n, next();
1290
+ }
1291
+ return next();
1292
+ }
1293
+ };
1294
+ }
1495
1295
 
1496
1296
  //#endregion
1497
1297
  //#region src/cli/commands/bundle.ts
1498
- async function bundleWithConfig(configPath, cliOptions) {
1298
+ async function bundleWithConfig(configPath, cliOptions, rawArgs = {}) {
1499
1299
  if (cliOptions.watch) {
1500
1300
  process.env.ROLLUP_WATCH = "true";
1501
1301
  process.env.ROLLDOWN_WATCH = "true";
1502
1302
  }
1503
1303
  const config = await loadConfig(configPath);
1504
- if (!config) {
1505
- logger.error(`No configuration found at ${config}`);
1304
+ const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
1305
+ if (typeof resolvedConfig !== "object" || resolvedConfig === null) {
1306
+ logger.error(`Invalid configuration from ${configPath}: expected object or array, got ${resolvedConfig}`);
1506
1307
  process.exit(1);
1507
1308
  }
1508
- if (cliOptions.watch) await watchInner(config, cliOptions);
1509
- else await bundleInner(config, cliOptions);
1309
+ if (cliOptions.watch) await watchInner(resolvedConfig, cliOptions);
1310
+ else await bundleInner(resolvedConfig, cliOptions);
1510
1311
  }
1511
1312
  async function bundleWithCliOptions(cliOptions) {
1512
1313
  try {
1513
- var _usingCtx$1 = (0, import_usingCtx.default)();
1314
+ var _usingCtx$1 = _usingCtx();
1514
1315
  if (cliOptions.output.dir || cliOptions.output.file) {
1515
- const operation = cliOptions.watch ? watchInner : bundleInner;
1516
- await operation({}, cliOptions);
1316
+ await (cliOptions.watch ? watchInner : bundleInner)({}, cliOptions);
1517
1317
  return;
1518
1318
  }
1519
1319
  if (cliOptions.watch) {
1520
1320
  logger.error("You must specify `output.dir` to use watch mode");
1521
1321
  process.exit(1);
1522
1322
  }
1523
- const build = _usingCtx$1.a(await rolldown(cliOptions.input));
1524
- const { output: outputs } = await build.generate(cliOptions.output);
1323
+ const { output: outputs } = await _usingCtx$1.a(await rolldown(cliOptions.input)).generate(cliOptions.output);
1525
1324
  if (outputs.length === 0) {
1526
1325
  logger.error("No output generated");
1527
1326
  process.exit(1);
1528
1327
  }
1529
1328
  for (const file of outputs) {
1530
- if (outputs.length > 1) logger.log(`\n${colors.cyan(colors.bold(`|→ ${file.fileName}:`))}\n`);
1329
+ if (outputs.length > 1) logger.log(`\n${styleText$1(["cyan", "bold"], `|→ ${file.fileName}:`)}\n`);
1531
1330
  console.log(file.type === "asset" ? file.source : file.code);
1532
1331
  }
1533
- } catch (_$1) {
1534
- _usingCtx$1.e = _$1;
1332
+ } catch (_) {
1333
+ _usingCtx$1.e = _;
1535
1334
  } finally {
1536
1335
  await _usingCtx$1.d();
1537
1336
  }
@@ -1549,7 +1348,7 @@ async function watchInner(config, cliOptions) {
1549
1348
  })
1550
1349
  };
1551
1350
  });
1552
- const watcher = await watch(normalizedConfig);
1351
+ const watcher = watch(normalizedConfig);
1553
1352
  onExit((code) => {
1554
1353
  Promise.resolve(watcher.close()).finally(() => {
1555
1354
  process.exit(typeof code === "number" ? code : 0);
@@ -1560,15 +1359,19 @@ async function watchInner(config, cliOptions) {
1560
1359
  watcher.on("change", (id, event) => {
1561
1360
  if (event.event === "update") changedFile.push(id);
1562
1361
  });
1362
+ const clearScreen = getClearScreenFunction(normalizedConfig);
1563
1363
  watcher.on("event", async (event) => {
1564
1364
  switch (event.code) {
1365
+ case "START":
1366
+ clearScreen?.();
1367
+ break;
1565
1368
  case "BUNDLE_START":
1566
- if (changedFile.length > 0) logger.log(`Found ${colors.bold(changedFile.map(relativeId).join(", "))} changed, rebuilding...`);
1369
+ if (changedFile.length > 0) logger.log(`Found ${styleText$1("bold", changedFile.map(relativeId).join(", "))} changed, rebuilding...`);
1567
1370
  changedFile.length = 0;
1568
1371
  break;
1569
1372
  case "BUNDLE_END":
1570
1373
  await event.result.close();
1571
- logger.success(`Rebuilt ${colors.bold(relativeId(event.output[0]))} in ${colors.bold(ms(event.duration))}.`);
1374
+ logger.success(`Rebuilt ${styleText$1("bold", relativeId(event.output[0]))} in ${styleText$1("green", ms(event.duration))}.`);
1572
1375
  break;
1573
1376
  case "ERROR":
1574
1377
  await event.result.close();
@@ -1583,14 +1386,14 @@ async function bundleInner(config, cliOptions) {
1583
1386
  const startTime = performance.now();
1584
1387
  const result = [];
1585
1388
  const configList = arraify(config);
1586
- for (const config$1 of configList) {
1587
- const outputList = arraify(config$1.output || {});
1389
+ for (const config of configList) {
1390
+ const outputList = arraify(config.output || {});
1588
1391
  const build = await rolldown({
1589
- ...config$1,
1392
+ ...config,
1590
1393
  ...cliOptions.input
1591
1394
  });
1592
- for (const output of outputList) try {
1593
- result.push(await build.write({
1395
+ try {
1396
+ for (const output of outputList) result.push(await build.write({
1594
1397
  ...output,
1595
1398
  ...cliOptions.output
1596
1399
  }));
@@ -1600,14 +1403,12 @@ async function bundleInner(config, cliOptions) {
1600
1403
  }
1601
1404
  result.forEach(printBundleOutputPretty);
1602
1405
  logger.log(``);
1603
- const endTime = performance.now();
1604
- const duration = endTime - startTime;
1605
- logger.success(`Finished in ${colors.bold(ms(duration))}`);
1406
+ const duration = performance.now() - startTime;
1407
+ logger.success(`rolldown v${version} Finished in ${styleText$1("green", ms(duration))}`);
1606
1408
  }
1607
1409
  function printBundleOutputPretty(output) {
1608
1410
  const outputEntries = collectOutputEntries(output.output);
1609
- const outputLayoutSizes = collectOutputLayoutAdjustmentSizes(outputEntries);
1610
- printOutputEntries(outputEntries, outputLayoutSizes, "<DIR>");
1411
+ printOutputEntries(outputEntries, collectOutputLayoutAdjustmentSizes(outputEntries), "<DIR>");
1611
1412
  }
1612
1413
  function collectOutputEntries(output) {
1613
1414
  return output.map((chunk) => ({
@@ -1630,25 +1431,36 @@ function collectOutputLayoutAdjustmentSizes(entries) {
1630
1431
  sizePad
1631
1432
  };
1632
1433
  }
1434
+ const numberFormatter = new Intl.NumberFormat("en", {
1435
+ maximumFractionDigits: 2,
1436
+ minimumFractionDigits: 2
1437
+ });
1633
1438
  function displaySize(bytes) {
1634
1439
  return `${numberFormatter.format(bytes / 1e3)} kB`;
1635
1440
  }
1441
+ const CHUNK_GROUPS = [{
1442
+ type: "asset",
1443
+ color: "green"
1444
+ }, {
1445
+ type: "chunk",
1446
+ color: "cyan"
1447
+ }];
1636
1448
  function printOutputEntries(entries, sizeAdjustment, distPath) {
1637
1449
  for (const group of CHUNK_GROUPS) {
1638
1450
  const filtered = entries.filter((e) => e.type === group.type);
1639
1451
  if (!filtered.length) continue;
1640
- for (const entry of filtered.sort((a$1, z) => a$1.size - z.size)) {
1641
- let log = colors.dim(withTrailingSlash(distPath));
1642
- log += colors[group.color](entry.fileName.padEnd(sizeAdjustment.longest + 2));
1643
- log += colors.dim(entry.type);
1644
- log += colors.dim(` │ size: ${displaySize(entry.size).padStart(sizeAdjustment.sizePad)}`);
1452
+ for (const entry of filtered.sort((a, z) => a.size - z.size)) {
1453
+ let log = styleText$1("dim", withTrailingSlash(distPath));
1454
+ log += styleText$1(group.color, entry.fileName.padEnd(sizeAdjustment.longest + 2));
1455
+ log += styleText$1("dim", entry.type);
1456
+ log += styleText$1("dim", ` │ size: ${displaySize(entry.size).padStart(sizeAdjustment.sizePad)}`);
1645
1457
  logger.log(log);
1646
1458
  }
1647
1459
  }
1648
1460
  }
1649
- function withTrailingSlash(path$1) {
1650
- if (path$1[path$1.length - 1] !== "/") return `${path$1}/`;
1651
- return path$1;
1461
+ function withTrailingSlash(path) {
1462
+ if (path[path.length - 1] !== "/") return `${path}/`;
1463
+ return path;
1652
1464
  }
1653
1465
  function ms(duration) {
1654
1466
  return duration < 1e3 ? `${duration.toFixed(2)} ms` : `${(duration / 1e3).toFixed(2)} s`;
@@ -1657,128 +1469,119 @@ function relativeId(id) {
1657
1469
  if (!path.isAbsolute(id)) return id;
1658
1470
  return path.relative(path.resolve(), id);
1659
1471
  }
1660
- var import_usingCtx, numberFormatter, CHUNK_GROUPS;
1661
- var init_bundle = __esm({ "src/cli/commands/bundle.ts"() {
1662
- init_mjs();
1663
- init_rolldown();
1664
- init_watch();
1665
- init_load_config();
1666
- init_misc();
1667
- init_logger();
1668
- import_usingCtx = __toESM(require_usingCtx());
1669
- numberFormatter = new Intl.NumberFormat("en", {
1670
- maximumFractionDigits: 2,
1671
- minimumFractionDigits: 2
1672
- });
1673
- CHUNK_GROUPS = [{
1674
- type: "asset",
1675
- color: "green"
1676
- }, {
1677
- type: "chunk",
1678
- color: "cyan"
1679
- }];
1680
- } });
1681
1472
 
1682
1473
  //#endregion
1683
1474
  //#region src/cli/commands/help.ts
1684
- function showHelp() {
1685
- logger.log(introduction);
1686
- logger.log("");
1687
- logger.log(`${colors.bold(colors.underline("OPTIONS"))}`);
1688
- logger.log("");
1689
- logger.log(Object.entries(options).sort(([a$1], [b$1]) => {
1690
- if (options[a$1].short && !options[b$1].short) return -1;
1691
- if (!options[a$1].short && options[b$1].short) return 1;
1692
- if (options[a$1].short && options[b$1].short) return options[a$1].short.localeCompare(options[b$1].short);
1693
- return a$1.localeCompare(b$1);
1694
- }).map(([option, { type, short, hint, description: description$1 }]) => {
1475
+ const examples = [
1476
+ {
1477
+ title: "Bundle with a config file `rolldown.config.mjs`",
1478
+ command: "rolldown -c rolldown.config.mjs"
1479
+ },
1480
+ {
1481
+ title: "Bundle the `src/main.ts` to `dist` with `cjs` format",
1482
+ command: "rolldown src/main.ts -d dist -f cjs"
1483
+ },
1484
+ {
1485
+ title: "Bundle the `src/main.ts` and handle the `.png` assets to Data URL",
1486
+ command: "rolldown src/main.ts -d dist --moduleTypes .png=dataurl"
1487
+ },
1488
+ {
1489
+ title: "Bundle the `src/main.tsx` and minify the output with sourcemap",
1490
+ command: "rolldown src/main.tsx -d dist -m -s"
1491
+ },
1492
+ {
1493
+ title: "Create self-executing IIFE using external jQuery as `$` and `_`",
1494
+ command: "rolldown src/main.ts -d dist -n bundle -f iife -e jQuery,window._ -g jQuery=$"
1495
+ }
1496
+ ];
1497
+ const notes = [
1498
+ "Due to the API limitation, you need to pass `-s` for `.map` sourcemap file as the last argument.",
1499
+ "If you are using the configuration, please pass the `-c` as the last argument if you ignore the default configuration file.",
1500
+ "CLI options will override the configuration file.",
1501
+ "For more information, please visit https://rolldown.rs/."
1502
+ ];
1503
+ /**
1504
+ * Generates the CLI help text as a string.
1505
+ */
1506
+ function generateHelpText() {
1507
+ const lines = [];
1508
+ lines.push(`${styleText$1("gray", `${description} (rolldown v${version})`)}`);
1509
+ lines.push("");
1510
+ lines.push(`${styleText$1(["bold", "underline"], "USAGE")} ${styleText$1("cyan", "rolldown -c <config>")} or ${styleText$1("cyan", "rolldown <input> <options>")}`);
1511
+ lines.push("");
1512
+ lines.push(`${styleText$1(["bold", "underline"], "OPTIONS")}`);
1513
+ lines.push("");
1514
+ lines.push(Object.entries(options).sort(([a], [b]) => {
1515
+ if (options[a].short && !options[b].short) return -1;
1516
+ if (!options[a].short && options[b].short) return 1;
1517
+ if (options[a].short && options[b].short) return options[a].short.localeCompare(options[b].short);
1518
+ return a.localeCompare(b);
1519
+ }).map(([option, { type, short, hint, description }]) => {
1695
1520
  let optionStr = ` --${option} `;
1696
1521
  option = camelCaseToKebabCase(option);
1697
1522
  if (short) optionStr += `-${short}, `;
1698
1523
  if (type === "string") optionStr += `<${hint ?? option}>`;
1699
- if (description$1 && description$1.length > 0) description$1 = description$1[0].toUpperCase() + description$1.slice(1);
1700
- return colors.cyan(optionStr.padEnd(30)) + description$1 + (description$1 && description$1?.endsWith(".") ? "" : ".");
1524
+ if (description && description.length > 0) description = description[0].toUpperCase() + description.slice(1);
1525
+ return styleText$1("cyan", optionStr.padEnd(30)) + description + (description && description?.endsWith(".") ? "" : ".");
1701
1526
  }).join("\n"));
1702
- logger.log("");
1703
- logger.log(`${colors.bold(colors.underline("EXAMPLES"))}`);
1704
- logger.log("");
1527
+ lines.push("");
1528
+ lines.push(`${styleText$1(["bold", "underline"], "EXAMPLES")}`);
1529
+ lines.push("");
1705
1530
  examples.forEach(({ title, command }, ord) => {
1706
- logger.log(` ${ord + 1}. ${title}:`);
1707
- logger.log(` ${colors.cyan(command)}`);
1708
- logger.log("");
1531
+ lines.push(` ${ord + 1}. ${title}:`);
1532
+ lines.push(` ${styleText$1("cyan", command)}`);
1533
+ lines.push("");
1709
1534
  });
1710
- logger.log(`${colors.bold(colors.underline("NOTES"))}`);
1711
- logger.log("");
1535
+ lines.push(`${styleText$1(["bold", "underline"], "NOTES")}`);
1536
+ lines.push("");
1712
1537
  notes.forEach((note) => {
1713
- logger.log(` * ${colors.gray(note)}`);
1538
+ lines.push(` * ${styleText$1("gray", note)}`);
1714
1539
  });
1540
+ return lines.join("\n");
1541
+ }
1542
+ function showHelp() {
1543
+ logger.log(generateHelpText());
1715
1544
  }
1716
- var introduction, examples, notes;
1717
- var init_help = __esm({ "src/cli/commands/help.ts"() {
1718
- init_arguments();
1719
- init_utils();
1720
- init_logger();
1721
- introduction = `${colors.gray(`${description} (rolldown v${version})`)}
1722
1545
 
1723
- ${colors.bold(colors.underline("USAGE"))} ${colors.cyan("rolldown -c <config>")} or ${colors.cyan("rolldown <input> <options>")}`;
1724
- examples = [
1725
- {
1726
- title: "Bundle with a config file `rolldown.config.mjs`",
1727
- command: "rolldown -c rolldown.config.mjs"
1728
- },
1729
- {
1730
- title: "Bundle the `src/main.ts` to `dist` with `cjs` format",
1731
- command: "rolldown src/main.ts -d dist -f cjs"
1732
- },
1733
- {
1734
- title: "Bundle the `src/main.ts` and handle the `.png` assets to Data URL",
1735
- command: "rolldown src/main.ts -d dist --moduleTypes .png=dataurl"
1736
- },
1737
- {
1738
- title: "Bundle the `src/main.tsx` and minify the output with sourcemap",
1739
- command: "rolldown src/main.tsx -d dist -m -s"
1740
- },
1741
- {
1742
- title: "Create self-executing IIFE using external jQuery as `$` and `_`",
1743
- command: "rolldown src/main.ts -d dist -n bundle -f iife -e jQuery,window._ -g jQuery=$"
1744
- }
1745
- ];
1746
- notes = [
1747
- "Due to the API limitation, you need to pass `-s` for `.map` sourcemap file as the last argument.",
1748
- "If you are using the configuration, please pass the `-c` as the last argument if you ignore the default configuration file.",
1749
- "CLI options will override the configuration file.",
1750
- "For more information, please visit https://rolldown.rs/."
1751
- ];
1752
- } });
1546
+ //#endregion
1547
+ //#region src/cli/version-check.ts
1548
+ function checkNodeVersion(nodeVersion) {
1549
+ const currentVersion = nodeVersion.split(".");
1550
+ const major = parseInt(currentVersion[0], 10);
1551
+ const minor = parseInt(currentVersion[1], 10);
1552
+ return major === 20 && minor >= 19 || major === 22 && minor >= 12 || major > 22;
1553
+ }
1753
1554
 
1754
1555
  //#endregion
1755
1556
  //#region src/cli/index.ts
1756
- var require_cli = __commonJS({ "src/cli/index.ts"() {
1757
- init_arguments();
1758
- init_bundle();
1759
- init_help();
1760
- init_logger();
1761
- async function main() {
1762
- const cliOptions = parseCliArguments();
1763
- if (cliOptions.config || cliOptions.config === "") {
1764
- await bundleWithConfig(cliOptions.config, cliOptions);
1765
- return;
1766
- }
1767
- if ("input" in cliOptions.input) {
1768
- await bundleWithCliOptions(cliOptions);
1769
- return;
1770
- }
1771
- if (cliOptions.version) {
1772
- logger.log(`rolldown v${version}`);
1773
- return;
1557
+ if (!checkNodeVersion(process$1.versions.node)) logger.warn(`You are using Node.js ${process$1.versions.node}. Rolldown requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.`);
1558
+ async function main() {
1559
+ const { rawArgs, ...cliOptions } = parseCliArguments();
1560
+ if (cliOptions.environment) {
1561
+ const environment = Array.isArray(cliOptions.environment) ? cliOptions.environment : [cliOptions.environment];
1562
+ for (const argument of environment) for (const pair of argument.split(",")) {
1563
+ const [key, ...value] = pair.split(":");
1564
+ process$1.env[key] = value.length === 0 ? String(true) : value.join(":");
1774
1565
  }
1775
- showHelp();
1776
1566
  }
1777
- main().catch((err) => {
1778
- logger.error(err);
1779
- process$1.exit(1);
1780
- });
1781
- } });
1567
+ if (cliOptions.config || cliOptions.config === "") {
1568
+ await bundleWithConfig(cliOptions.config, cliOptions, rawArgs);
1569
+ return;
1570
+ }
1571
+ if ("input" in cliOptions.input) {
1572
+ await bundleWithCliOptions(cliOptions);
1573
+ return;
1574
+ }
1575
+ if (cliOptions.version) {
1576
+ logger.log(`rolldown v${version}`);
1577
+ return;
1578
+ }
1579
+ showHelp();
1580
+ }
1581
+ main().catch((err) => {
1582
+ logger.error(err);
1583
+ process$1.exit(1);
1584
+ });
1782
1585
 
1783
1586
  //#endregion
1784
- export default require_cli();
1587
+ export { };