@rolldown/browser 1.0.0-beta.7-commit.a0a7d95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +25 -0
- package/bin/cli.mjs +2 -0
- package/dist/browser-bundler.mjs +3514 -0
- package/dist/browser.js +4626 -0
- package/dist/cli.cjs +1759 -0
- package/dist/cli.mjs +1828 -0
- package/dist/experimental-index.cjs +87 -0
- package/dist/experimental-index.mjs +67 -0
- package/dist/index.cjs +9 -0
- package/dist/index.mjs +5 -0
- package/dist/parallel-plugin-worker.cjs +43 -0
- package/dist/parallel-plugin-worker.mjs +48 -0
- package/dist/parallel-plugin.cjs +9 -0
- package/dist/parallel-plugin.mjs +8 -0
- package/dist/parse-ast-index.cjs +4 -0
- package/dist/parse-ast-index.mjs +4 -0
- package/dist/rolldown-binding.wasi-browser.js +102 -0
- package/dist/rolldown-binding.wasi.cjs +127 -0
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/chunk-BuCFLigr.mjs +12 -0
- package/dist/shared/chunk-Dc32QXFI.cjs +31 -0
- package/dist/shared/parse-ast-index-C29iO6Jv.cjs +316 -0
- package/dist/shared/parse-ast-index-GcZLh6_d.mjs +273 -0
- package/dist/shared/prompt-B3VJLbs9.mjs +854 -0
- package/dist/shared/prompt-wpCBKCzA.cjs +855 -0
- package/dist/shared/src-6_rb-jCl.cjs +3147 -0
- package/dist/shared/src-QrPvO0Ec.mjs +4375 -0
- package/dist/types/api/build.d.ts +18 -0
- package/dist/types/api/experimental.d.ts +7 -0
- package/dist/types/api/rolldown/index.d.ts +3 -0
- package/dist/types/api/rolldown/rolldown-build.d.ts +15 -0
- package/dist/types/api/watch/index.d.ts +3 -0
- package/dist/types/api/watch/watch-emitter.d.ts +31 -0
- package/dist/types/api/watch/watcher.d.ts +13 -0
- package/dist/types/binding.d.ts +1504 -0
- package/dist/types/builtin-plugin/alias-plugin.d.ts +10 -0
- package/dist/types/builtin-plugin/constructors.d.ts +22 -0
- package/dist/types/builtin-plugin/replace-plugin.d.ts +27 -0
- package/dist/types/builtin-plugin/transform-plugin.d.ts +9 -0
- package/dist/types/builtin-plugin/utils.d.ts +8 -0
- package/dist/types/cli/arguments/alias.d.ts +16 -0
- package/dist/types/cli/arguments/index.d.ts +15 -0
- package/dist/types/cli/arguments/normalize.d.ts +16 -0
- package/dist/types/cli/arguments/utils.d.ts +8 -0
- package/dist/types/cli/commands/bundle.d.ts +3 -0
- package/dist/types/cli/commands/help.d.ts +1 -0
- package/dist/types/cli/index.d.ts +1 -0
- package/dist/types/cli/load-config.d.ts +5 -0
- package/dist/types/cli/logger.d.ts +5 -0
- package/dist/types/constants/plugin-context.d.ts +7 -0
- package/dist/types/constants/plugin.d.ts +45 -0
- package/dist/types/experimental-index.d.ts +9 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/log/log-handler.d.ts +4 -0
- package/dist/types/log/logger.d.ts +6 -0
- package/dist/types/log/logging.d.ts +12 -0
- package/dist/types/log/logs.d.ts +18 -0
- package/dist/types/options/generated/checks-options.d.ts +57 -0
- package/dist/types/options/input-options.d.ts +185 -0
- package/dist/types/options/normalized-input-options.d.ts +18 -0
- package/dist/types/options/normalized-output-options.d.ts +70 -0
- package/dist/types/options/output-options.d.ts +182 -0
- package/dist/types/options/watch-options.d.ts +5 -0
- package/dist/types/parallel-plugin-worker.d.ts +1 -0
- package/dist/types/parallel-plugin.d.ts +1 -0
- package/dist/types/parse-ast-index.d.ts +5 -0
- package/dist/types/plugin/bindingify-build-hooks.d.ts +10 -0
- package/dist/types/plugin/bindingify-hook-filter.d.ts +7 -0
- package/dist/types/plugin/bindingify-output-hooks.d.ts +14 -0
- package/dist/types/plugin/bindingify-plugin-hook-meta.d.ts +8 -0
- package/dist/types/plugin/bindingify-plugin.d.ts +17 -0
- package/dist/types/plugin/bindingify-watch-hooks.d.ts +5 -0
- package/dist/types/plugin/hook-filter.d.ts +49 -0
- package/dist/types/plugin/index.d.ts +141 -0
- package/dist/types/plugin/minimal-plugin-context.d.ts +24 -0
- package/dist/types/plugin/parallel-plugin-implementation.d.ts +10 -0
- package/dist/types/plugin/parallel-plugin.d.ts +9 -0
- package/dist/types/plugin/plugin-context-data.d.ts +21 -0
- package/dist/types/plugin/plugin-context.d.ts +67 -0
- package/dist/types/plugin/plugin-driver.d.ts +10 -0
- package/dist/types/plugin/transform-plugin-context.d.ts +28 -0
- package/dist/types/plugin/with-filter.d.ts +10 -0
- package/dist/types/types/assert.d.ts +14 -0
- package/dist/types/types/config-export.d.ts +5 -0
- package/dist/types/types/misc.d.ts +40 -0
- package/dist/types/types/module-info.d.ts +15 -0
- package/dist/types/types/module-side-effects.d.ts +12 -0
- package/dist/types/types/output-bundle.d.ts +4 -0
- package/dist/types/types/rolldown-options.d.ts +5 -0
- package/dist/types/types/rolldown-output.d.ts +66 -0
- package/dist/types/types/schema.d.ts +33 -0
- package/dist/types/types/sourcemap.d.ts +14 -0
- package/dist/types/types/utils.d.ts +13 -0
- package/dist/types/types.d.ts +7 -0
- package/dist/types/utils/asset-source.d.ts +4 -0
- package/dist/types/utils/async-flatten.d.ts +1 -0
- package/dist/types/utils/bindingify-input-options.d.ts +7 -0
- package/dist/types/utils/bindingify-output-options.d.ts +5 -0
- package/dist/types/utils/code-frame.d.ts +1 -0
- package/dist/types/utils/compose-js-plugins.d.ts +2 -0
- package/dist/types/utils/create-bundler-option.d.ts +11 -0
- package/dist/types/utils/create-bundler.d.ts +9 -0
- package/dist/types/utils/define-config.d.ts +5 -0
- package/dist/types/utils/error.d.ts +2 -0
- package/dist/types/utils/initialize-parallel-plugins.d.ts +17 -0
- package/dist/types/utils/misc.d.ts +7 -0
- package/dist/types/utils/normalize-hook.d.ts +7 -0
- package/dist/types/utils/normalize-plugin-option.d.ts +13 -0
- package/dist/types/utils/normalize-string-or-regex.d.ts +2 -0
- package/dist/types/utils/plugin/index.d.ts +2 -0
- package/dist/types/utils/resolved-external.d.ts +4 -0
- package/dist/types/utils/transform-module-info.d.ts +4 -0
- package/dist/types/utils/transform-rendered-chunk.d.ts +4 -0
- package/dist/types/utils/transform-rendered-module.d.ts +3 -0
- package/dist/types/utils/transform-side-effects.d.ts +3 -0
- package/dist/types/utils/transform-sourcemap.d.ts +3 -0
- package/dist/types/utils/transform-to-rollup-output.d.ts +11 -0
- package/dist/types/utils/validator.d.ts +6 -0
- package/dist/wasi-worker-browser.mjs +39 -0
- package/dist/wasi-worker.mjs +63 -0
- package/package.json +85 -0
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,1828 @@
|
|
|
1
|
+
import { __commonJS, __esm } from "./shared/chunk-BuCFLigr.mjs";
|
|
2
|
+
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_misc, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-QrPvO0Ec.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-GcZLh6_d.mjs";
|
|
4
|
+
import path, { sep } from "node:path";
|
|
5
|
+
import colors from "ansis";
|
|
6
|
+
import process$1, { cwd } from "node:process";
|
|
7
|
+
import { formatWithOptions, parseArgs } from "node:util";
|
|
8
|
+
import * as tty from "node:tty";
|
|
9
|
+
import { performance } from "node:perf_hooks";
|
|
10
|
+
import fs from "node:fs";
|
|
11
|
+
import { readdir } from "node:fs/promises";
|
|
12
|
+
import { pathToFileURL } from "node:url";
|
|
13
|
+
|
|
14
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
15
|
+
function isPlainObject$1(value) {
|
|
16
|
+
if (value === null || typeof value !== "object") return false;
|
|
17
|
+
const prototype = Object.getPrototypeOf(value);
|
|
18
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
19
|
+
if (Symbol.iterator in value) return false;
|
|
20
|
+
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
24
|
+
if (!isPlainObject$1(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
25
|
+
const object = Object.assign({}, defaults);
|
|
26
|
+
for (const key in baseObject) {
|
|
27
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
28
|
+
const value = baseObject[key];
|
|
29
|
+
if (value === null || value === void 0) continue;
|
|
30
|
+
if (merger && merger(object, key, value, namespace)) continue;
|
|
31
|
+
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
32
|
+
else if (isPlainObject$1(value) && isPlainObject$1(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
33
|
+
else object[key] = value;
|
|
34
|
+
}
|
|
35
|
+
return object;
|
|
36
|
+
}
|
|
37
|
+
function createDefu(merger) {
|
|
38
|
+
return (...arguments_) => arguments_.reduce((p, c$1) => _defu(p, c$1, "", merger), {});
|
|
39
|
+
}
|
|
40
|
+
function isPlainObject(obj) {
|
|
41
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
42
|
+
}
|
|
43
|
+
function isLogObj(arg) {
|
|
44
|
+
if (!isPlainObject(arg)) return false;
|
|
45
|
+
if (!arg.message && !arg.args) return false;
|
|
46
|
+
if (arg.stack) return false;
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
50
|
+
if (input === void 0) return defaultLevel;
|
|
51
|
+
if (typeof input === "number") return input;
|
|
52
|
+
if (types[input] && types[input].level !== void 0) return types[input].level;
|
|
53
|
+
return defaultLevel;
|
|
54
|
+
}
|
|
55
|
+
function createConsola$1(options$1 = {}) {
|
|
56
|
+
return new Consola(options$1);
|
|
57
|
+
}
|
|
58
|
+
var LogLevels, LogTypes, defu, paused, queue, Consola;
|
|
59
|
+
var init_core = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs"() {
|
|
60
|
+
LogLevels = {
|
|
61
|
+
silent: Number.NEGATIVE_INFINITY,
|
|
62
|
+
fatal: 0,
|
|
63
|
+
error: 0,
|
|
64
|
+
warn: 1,
|
|
65
|
+
log: 2,
|
|
66
|
+
info: 3,
|
|
67
|
+
success: 3,
|
|
68
|
+
fail: 3,
|
|
69
|
+
ready: 3,
|
|
70
|
+
start: 3,
|
|
71
|
+
box: 3,
|
|
72
|
+
debug: 4,
|
|
73
|
+
trace: 5,
|
|
74
|
+
verbose: Number.POSITIVE_INFINITY
|
|
75
|
+
};
|
|
76
|
+
LogTypes = {
|
|
77
|
+
silent: { level: -1 },
|
|
78
|
+
fatal: { level: LogLevels.fatal },
|
|
79
|
+
error: { level: LogLevels.error },
|
|
80
|
+
warn: { level: LogLevels.warn },
|
|
81
|
+
log: { level: LogLevels.log },
|
|
82
|
+
info: { level: LogLevels.info },
|
|
83
|
+
success: { level: LogLevels.success },
|
|
84
|
+
fail: { level: LogLevels.fail },
|
|
85
|
+
ready: { level: LogLevels.info },
|
|
86
|
+
start: { level: LogLevels.info },
|
|
87
|
+
box: { level: LogLevels.info },
|
|
88
|
+
debug: { level: LogLevels.debug },
|
|
89
|
+
trace: { level: LogLevels.trace },
|
|
90
|
+
verbose: { level: LogLevels.verbose }
|
|
91
|
+
};
|
|
92
|
+
defu = createDefu();
|
|
93
|
+
paused = false;
|
|
94
|
+
queue = [];
|
|
95
|
+
Consola = class Consola {
|
|
96
|
+
options;
|
|
97
|
+
_lastLog;
|
|
98
|
+
_mockFn;
|
|
99
|
+
/**
|
|
100
|
+
* Creates an instance of Consola with specified options or defaults.
|
|
101
|
+
*
|
|
102
|
+
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
103
|
+
*/
|
|
104
|
+
constructor(options$1 = {}) {
|
|
105
|
+
const types = options$1.types || LogTypes;
|
|
106
|
+
this.options = defu({
|
|
107
|
+
...options$1,
|
|
108
|
+
defaults: { ...options$1.defaults },
|
|
109
|
+
level: _normalizeLogLevel(options$1.level, types),
|
|
110
|
+
reporters: [...options$1.reporters || []]
|
|
111
|
+
}, {
|
|
112
|
+
types: LogTypes,
|
|
113
|
+
throttle: 1e3,
|
|
114
|
+
throttleMin: 5,
|
|
115
|
+
formatOptions: {
|
|
116
|
+
date: true,
|
|
117
|
+
colors: false,
|
|
118
|
+
compact: true
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
for (const type in types) {
|
|
122
|
+
const defaults = {
|
|
123
|
+
type,
|
|
124
|
+
...this.options.defaults,
|
|
125
|
+
...types[type]
|
|
126
|
+
};
|
|
127
|
+
this[type] = this._wrapLogFn(defaults);
|
|
128
|
+
this[type].raw = this._wrapLogFn(defaults, true);
|
|
129
|
+
}
|
|
130
|
+
if (this.options.mockFn) this.mockTypes();
|
|
131
|
+
this._lastLog = {};
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Gets the current log level of the Consola instance.
|
|
135
|
+
*
|
|
136
|
+
* @returns {number} The current log level.
|
|
137
|
+
*/
|
|
138
|
+
get level() {
|
|
139
|
+
return this.options.level;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Sets the minimum log level that will be output by the instance.
|
|
143
|
+
*
|
|
144
|
+
* @param {number} level - The new log level to set.
|
|
145
|
+
*/
|
|
146
|
+
set level(level) {
|
|
147
|
+
this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Displays a prompt to the user and returns the response.
|
|
151
|
+
* Throw an error if `prompt` is not supported by the current configuration.
|
|
152
|
+
*
|
|
153
|
+
* @template T
|
|
154
|
+
* @param {string} message - The message to display in the prompt.
|
|
155
|
+
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
156
|
+
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
157
|
+
*/
|
|
158
|
+
prompt(message, opts) {
|
|
159
|
+
if (!this.options.prompt) throw new Error("prompt is not supported!");
|
|
160
|
+
return this.options.prompt(message, opts);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
164
|
+
*
|
|
165
|
+
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
166
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
167
|
+
*/
|
|
168
|
+
create(options$1) {
|
|
169
|
+
const instance = new Consola({
|
|
170
|
+
...this.options,
|
|
171
|
+
...options$1
|
|
172
|
+
});
|
|
173
|
+
if (this._mockFn) instance.mockTypes(this._mockFn);
|
|
174
|
+
return instance;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Creates a new Consola instance with the specified default log object properties.
|
|
178
|
+
*
|
|
179
|
+
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
180
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
181
|
+
*/
|
|
182
|
+
withDefaults(defaults) {
|
|
183
|
+
return this.create({
|
|
184
|
+
...this.options,
|
|
185
|
+
defaults: {
|
|
186
|
+
...this.options.defaults,
|
|
187
|
+
...defaults
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
193
|
+
*
|
|
194
|
+
* @param {string} tag - The tag to include in each log of the new instance.
|
|
195
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
196
|
+
*/
|
|
197
|
+
withTag(tag) {
|
|
198
|
+
return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Adds a custom reporter to the Consola instance.
|
|
202
|
+
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
203
|
+
*
|
|
204
|
+
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
205
|
+
* @returns {Consola} The current Consola instance.
|
|
206
|
+
*/
|
|
207
|
+
addReporter(reporter) {
|
|
208
|
+
this.options.reporters.push(reporter);
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Removes a custom reporter from the Consola instance.
|
|
213
|
+
* If no reporter is specified, all reporters will be removed.
|
|
214
|
+
*
|
|
215
|
+
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
216
|
+
* @returns {Consola} The current Consola instance.
|
|
217
|
+
*/
|
|
218
|
+
removeReporter(reporter) {
|
|
219
|
+
if (reporter) {
|
|
220
|
+
const i$1 = this.options.reporters.indexOf(reporter);
|
|
221
|
+
if (i$1 !== -1) return this.options.reporters.splice(i$1, 1);
|
|
222
|
+
} else this.options.reporters.splice(0);
|
|
223
|
+
return this;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
227
|
+
*
|
|
228
|
+
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
229
|
+
* @returns {Consola} The current Consola instance.
|
|
230
|
+
*/
|
|
231
|
+
setReporters(reporters) {
|
|
232
|
+
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
233
|
+
return this;
|
|
234
|
+
}
|
|
235
|
+
wrapAll() {
|
|
236
|
+
this.wrapConsole();
|
|
237
|
+
this.wrapStd();
|
|
238
|
+
}
|
|
239
|
+
restoreAll() {
|
|
240
|
+
this.restoreConsole();
|
|
241
|
+
this.restoreStd();
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Overrides console methods with Consola logging methods for consistent logging.
|
|
245
|
+
*/
|
|
246
|
+
wrapConsole() {
|
|
247
|
+
for (const type in this.options.types) {
|
|
248
|
+
if (!console["__" + type]) console["__" + type] = console[type];
|
|
249
|
+
console[type] = this[type].raw;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Restores the original console methods, removing Consola overrides.
|
|
254
|
+
*/
|
|
255
|
+
restoreConsole() {
|
|
256
|
+
for (const type in this.options.types) if (console["__" + type]) {
|
|
257
|
+
console[type] = console["__" + type];
|
|
258
|
+
delete console["__" + type];
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Overrides standard output and error streams to redirect them through Consola.
|
|
263
|
+
*/
|
|
264
|
+
wrapStd() {
|
|
265
|
+
this._wrapStream(this.options.stdout, "log");
|
|
266
|
+
this._wrapStream(this.options.stderr, "log");
|
|
267
|
+
}
|
|
268
|
+
_wrapStream(stream, type) {
|
|
269
|
+
if (!stream) return;
|
|
270
|
+
if (!stream.__write) stream.__write = stream.write;
|
|
271
|
+
stream.write = (data) => {
|
|
272
|
+
this[type].raw(String(data).trim());
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
277
|
+
*/
|
|
278
|
+
restoreStd() {
|
|
279
|
+
this._restoreStream(this.options.stdout);
|
|
280
|
+
this._restoreStream(this.options.stderr);
|
|
281
|
+
}
|
|
282
|
+
_restoreStream(stream) {
|
|
283
|
+
if (!stream) return;
|
|
284
|
+
if (stream.__write) {
|
|
285
|
+
stream.write = stream.__write;
|
|
286
|
+
delete stream.__write;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Pauses logging, queues incoming logs until resumed.
|
|
291
|
+
*/
|
|
292
|
+
pauseLogs() {
|
|
293
|
+
paused = true;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Resumes logging, processing any queued logs.
|
|
297
|
+
*/
|
|
298
|
+
resumeLogs() {
|
|
299
|
+
paused = false;
|
|
300
|
+
const _queue = queue.splice(0);
|
|
301
|
+
for (const item of _queue) item[0]._logFn(item[1], item[2]);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Replaces logging methods with mocks if a mock function is provided.
|
|
305
|
+
*
|
|
306
|
+
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
307
|
+
*/
|
|
308
|
+
mockTypes(mockFn) {
|
|
309
|
+
const _mockFn = mockFn || this.options.mockFn;
|
|
310
|
+
this._mockFn = _mockFn;
|
|
311
|
+
if (typeof _mockFn !== "function") return;
|
|
312
|
+
for (const type in this.options.types) {
|
|
313
|
+
this[type] = _mockFn(type, this.options.types[type]) || this[type];
|
|
314
|
+
this[type].raw = this[type];
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
_wrapLogFn(defaults, isRaw) {
|
|
318
|
+
return (...args) => {
|
|
319
|
+
if (paused) {
|
|
320
|
+
queue.push([
|
|
321
|
+
this,
|
|
322
|
+
defaults,
|
|
323
|
+
args,
|
|
324
|
+
isRaw
|
|
325
|
+
]);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
return this._logFn(defaults, args, isRaw);
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
_logFn(defaults, args, isRaw) {
|
|
332
|
+
if ((defaults.level || 0) > this.level) return false;
|
|
333
|
+
const logObj = {
|
|
334
|
+
date: /* @__PURE__ */ new Date(),
|
|
335
|
+
args: [],
|
|
336
|
+
...defaults,
|
|
337
|
+
level: _normalizeLogLevel(defaults.level, this.options.types)
|
|
338
|
+
};
|
|
339
|
+
if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
|
|
340
|
+
else logObj.args = [...args];
|
|
341
|
+
if (logObj.message) {
|
|
342
|
+
logObj.args.unshift(logObj.message);
|
|
343
|
+
delete logObj.message;
|
|
344
|
+
}
|
|
345
|
+
if (logObj.additional) {
|
|
346
|
+
if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
|
|
347
|
+
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
348
|
+
delete logObj.additional;
|
|
349
|
+
}
|
|
350
|
+
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
351
|
+
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
352
|
+
const resolveLog = (newLog = false) => {
|
|
353
|
+
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
354
|
+
if (this._lastLog.object && repeated > 0) {
|
|
355
|
+
const args2 = [...this._lastLog.object.args];
|
|
356
|
+
if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
|
|
357
|
+
this._log({
|
|
358
|
+
...this._lastLog.object,
|
|
359
|
+
args: args2
|
|
360
|
+
});
|
|
361
|
+
this._lastLog.count = 1;
|
|
362
|
+
}
|
|
363
|
+
if (newLog) {
|
|
364
|
+
this._lastLog.object = logObj;
|
|
365
|
+
this._log(logObj);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
clearTimeout(this._lastLog.timeout);
|
|
369
|
+
const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
370
|
+
this._lastLog.time = logObj.date;
|
|
371
|
+
if (diffTime < this.options.throttle) try {
|
|
372
|
+
const serializedLog = JSON.stringify([
|
|
373
|
+
logObj.type,
|
|
374
|
+
logObj.tag,
|
|
375
|
+
logObj.args
|
|
376
|
+
]);
|
|
377
|
+
const isSameLog = this._lastLog.serialized === serializedLog;
|
|
378
|
+
this._lastLog.serialized = serializedLog;
|
|
379
|
+
if (isSameLog) {
|
|
380
|
+
this._lastLog.count = (this._lastLog.count || 0) + 1;
|
|
381
|
+
if (this._lastLog.count > this.options.throttleMin) {
|
|
382
|
+
this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
} catch {}
|
|
387
|
+
resolveLog(true);
|
|
388
|
+
}
|
|
389
|
+
_log(logObj) {
|
|
390
|
+
for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
Consola.prototype.add = Consola.prototype.addReporter;
|
|
394
|
+
Consola.prototype.remove = Consola.prototype.removeReporter;
|
|
395
|
+
Consola.prototype.clear = Consola.prototype.removeReporter;
|
|
396
|
+
Consola.prototype.withScope = Consola.prototype.withTag;
|
|
397
|
+
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
398
|
+
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
399
|
+
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
400
|
+
} });
|
|
401
|
+
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
|
|
404
|
+
function parseStack(stack, message) {
|
|
405
|
+
const cwd$1 = process.cwd() + sep;
|
|
406
|
+
const lines = stack.split("\n").splice(message.split("\n").length).map((l$1) => l$1.trim().replace("file://", "").replace(cwd$1, ""));
|
|
407
|
+
return lines;
|
|
408
|
+
}
|
|
409
|
+
function writeStream(data, stream) {
|
|
410
|
+
const write = stream.__write || stream.write;
|
|
411
|
+
return write.call(stream, data);
|
|
412
|
+
}
|
|
413
|
+
var bracket, BasicReporter;
|
|
414
|
+
var init_consola_DRwqZj3T = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs"() {
|
|
415
|
+
bracket = (x) => x ? `[${x}]` : "";
|
|
416
|
+
BasicReporter = class {
|
|
417
|
+
formatStack(stack, message, opts) {
|
|
418
|
+
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
419
|
+
return indent + parseStack(stack, message).join(`
|
|
420
|
+
${indent}`);
|
|
421
|
+
}
|
|
422
|
+
formatError(err, opts) {
|
|
423
|
+
const message = err.message ?? formatWithOptions(opts, err);
|
|
424
|
+
const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
|
|
425
|
+
const level = opts?.errorLevel || 0;
|
|
426
|
+
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
|
|
427
|
+
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
|
|
428
|
+
...opts,
|
|
429
|
+
errorLevel: level + 1
|
|
430
|
+
}) : "";
|
|
431
|
+
return causedPrefix + message + "\n" + stack + causedError;
|
|
432
|
+
}
|
|
433
|
+
formatArgs(args, opts) {
|
|
434
|
+
const _args = args.map((arg) => {
|
|
435
|
+
if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
|
|
436
|
+
return arg;
|
|
437
|
+
});
|
|
438
|
+
return formatWithOptions(opts, ..._args);
|
|
439
|
+
}
|
|
440
|
+
formatDate(date, opts) {
|
|
441
|
+
return opts.date ? date.toLocaleTimeString() : "";
|
|
442
|
+
}
|
|
443
|
+
filterAndJoin(arr) {
|
|
444
|
+
return arr.filter(Boolean).join(" ");
|
|
445
|
+
}
|
|
446
|
+
formatLogObj(logObj, opts) {
|
|
447
|
+
const message = this.formatArgs(logObj.args, opts);
|
|
448
|
+
if (logObj.type === "box") return "\n" + [
|
|
449
|
+
bracket(logObj.tag),
|
|
450
|
+
logObj.title && logObj.title,
|
|
451
|
+
...message.split("\n")
|
|
452
|
+
].filter(Boolean).map((l$1) => " > " + l$1).join("\n") + "\n";
|
|
453
|
+
return this.filterAndJoin([
|
|
454
|
+
bracket(logObj.type),
|
|
455
|
+
bracket(logObj.tag),
|
|
456
|
+
message
|
|
457
|
+
]);
|
|
458
|
+
}
|
|
459
|
+
log(logObj, ctx) {
|
|
460
|
+
const line = this.formatLogObj(logObj, {
|
|
461
|
+
columns: ctx.options.stdout.columns || 0,
|
|
462
|
+
...ctx.options.formatOptions
|
|
463
|
+
});
|
|
464
|
+
return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
} });
|
|
468
|
+
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
|
|
471
|
+
function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
|
|
472
|
+
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
473
|
+
}
|
|
474
|
+
function clearBleed(index, string, open, close, replace) {
|
|
475
|
+
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
476
|
+
}
|
|
477
|
+
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
478
|
+
return (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
479
|
+
}
|
|
480
|
+
function init(open, close, replace) {
|
|
481
|
+
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
482
|
+
}
|
|
483
|
+
function createColors(useColor = isColorSupported) {
|
|
484
|
+
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
485
|
+
}
|
|
486
|
+
function getColor$1(color, fallback = "reset") {
|
|
487
|
+
return colors$1[color] || colors$1[fallback];
|
|
488
|
+
}
|
|
489
|
+
function stripAnsi(text) {
|
|
490
|
+
return text.replace(new RegExp(ansiRegex$1, "g"), "");
|
|
491
|
+
}
|
|
492
|
+
function box(text, _opts = {}) {
|
|
493
|
+
const opts = {
|
|
494
|
+
..._opts,
|
|
495
|
+
style: {
|
|
496
|
+
...defaultStyle,
|
|
497
|
+
..._opts.style
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
const textLines = text.split("\n");
|
|
501
|
+
const boxLines = [];
|
|
502
|
+
const _color = getColor$1(opts.style.borderColor);
|
|
503
|
+
const borderStyle = { ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle };
|
|
504
|
+
if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
|
|
505
|
+
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
506
|
+
const height = textLines.length + paddingOffset;
|
|
507
|
+
const width = Math.max(...textLines.map((line) => stripAnsi(line).length), opts.title ? stripAnsi(opts.title).length : 0) + paddingOffset;
|
|
508
|
+
const widthOffset = width + paddingOffset;
|
|
509
|
+
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
510
|
+
if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
|
|
511
|
+
if (opts.title) {
|
|
512
|
+
const title = _color ? _color(opts.title) : opts.title;
|
|
513
|
+
const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
|
|
514
|
+
const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
|
|
515
|
+
boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
|
|
516
|
+
} else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
|
|
517
|
+
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
518
|
+
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}`);
|
|
519
|
+
else {
|
|
520
|
+
const line = textLines[i$1 - valignOffset];
|
|
521
|
+
const left = " ".repeat(paddingOffset);
|
|
522
|
+
const right = " ".repeat(width - stripAnsi(line).length);
|
|
523
|
+
boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
|
|
524
|
+
}
|
|
525
|
+
boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
|
|
526
|
+
if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
|
|
527
|
+
return boxLines.join("\n");
|
|
528
|
+
}
|
|
529
|
+
var env, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, colorDefs, colors$1, ansiRegex$1, boxStylePresets, defaultStyle;
|
|
530
|
+
var init_consola_DXBYu_KD = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs"() {
|
|
531
|
+
({env = {}, argv = [], platform = ""} = typeof process === "undefined" ? {} : process);
|
|
532
|
+
isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
533
|
+
isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
534
|
+
isWindows = platform === "win32";
|
|
535
|
+
isDumbTerminal = env.TERM === "dumb";
|
|
536
|
+
isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
537
|
+
isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
538
|
+
isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
539
|
+
colorDefs = {
|
|
540
|
+
reset: init(0, 0),
|
|
541
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
542
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
543
|
+
italic: init(3, 23),
|
|
544
|
+
underline: init(4, 24),
|
|
545
|
+
inverse: init(7, 27),
|
|
546
|
+
hidden: init(8, 28),
|
|
547
|
+
strikethrough: init(9, 29),
|
|
548
|
+
black: init(30, 39),
|
|
549
|
+
red: init(31, 39),
|
|
550
|
+
green: init(32, 39),
|
|
551
|
+
yellow: init(33, 39),
|
|
552
|
+
blue: init(34, 39),
|
|
553
|
+
magenta: init(35, 39),
|
|
554
|
+
cyan: init(36, 39),
|
|
555
|
+
white: init(37, 39),
|
|
556
|
+
gray: init(90, 39),
|
|
557
|
+
bgBlack: init(40, 49),
|
|
558
|
+
bgRed: init(41, 49),
|
|
559
|
+
bgGreen: init(42, 49),
|
|
560
|
+
bgYellow: init(43, 49),
|
|
561
|
+
bgBlue: init(44, 49),
|
|
562
|
+
bgMagenta: init(45, 49),
|
|
563
|
+
bgCyan: init(46, 49),
|
|
564
|
+
bgWhite: init(47, 49),
|
|
565
|
+
blackBright: init(90, 39),
|
|
566
|
+
redBright: init(91, 39),
|
|
567
|
+
greenBright: init(92, 39),
|
|
568
|
+
yellowBright: init(93, 39),
|
|
569
|
+
blueBright: init(94, 39),
|
|
570
|
+
magentaBright: init(95, 39),
|
|
571
|
+
cyanBright: init(96, 39),
|
|
572
|
+
whiteBright: init(97, 39),
|
|
573
|
+
bgBlackBright: init(100, 49),
|
|
574
|
+
bgRedBright: init(101, 49),
|
|
575
|
+
bgGreenBright: init(102, 49),
|
|
576
|
+
bgYellowBright: init(103, 49),
|
|
577
|
+
bgBlueBright: init(104, 49),
|
|
578
|
+
bgMagentaBright: init(105, 49),
|
|
579
|
+
bgCyanBright: init(106, 49),
|
|
580
|
+
bgWhiteBright: init(107, 49)
|
|
581
|
+
};
|
|
582
|
+
colors$1 = createColors();
|
|
583
|
+
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("|");
|
|
584
|
+
boxStylePresets = {
|
|
585
|
+
solid: {
|
|
586
|
+
tl: "┌",
|
|
587
|
+
tr: "┐",
|
|
588
|
+
bl: "└",
|
|
589
|
+
br: "┘",
|
|
590
|
+
h: "─",
|
|
591
|
+
v: "│"
|
|
592
|
+
},
|
|
593
|
+
double: {
|
|
594
|
+
tl: "╔",
|
|
595
|
+
tr: "╗",
|
|
596
|
+
bl: "╚",
|
|
597
|
+
br: "╝",
|
|
598
|
+
h: "═",
|
|
599
|
+
v: "║"
|
|
600
|
+
},
|
|
601
|
+
doubleSingle: {
|
|
602
|
+
tl: "╓",
|
|
603
|
+
tr: "╖",
|
|
604
|
+
bl: "╙",
|
|
605
|
+
br: "╜",
|
|
606
|
+
h: "─",
|
|
607
|
+
v: "║"
|
|
608
|
+
},
|
|
609
|
+
doubleSingleRounded: {
|
|
610
|
+
tl: "╭",
|
|
611
|
+
tr: "╮",
|
|
612
|
+
bl: "╰",
|
|
613
|
+
br: "╯",
|
|
614
|
+
h: "─",
|
|
615
|
+
v: "║"
|
|
616
|
+
},
|
|
617
|
+
singleThick: {
|
|
618
|
+
tl: "┏",
|
|
619
|
+
tr: "┓",
|
|
620
|
+
bl: "┗",
|
|
621
|
+
br: "┛",
|
|
622
|
+
h: "━",
|
|
623
|
+
v: "┃"
|
|
624
|
+
},
|
|
625
|
+
singleDouble: {
|
|
626
|
+
tl: "╒",
|
|
627
|
+
tr: "╕",
|
|
628
|
+
bl: "╘",
|
|
629
|
+
br: "╛",
|
|
630
|
+
h: "═",
|
|
631
|
+
v: "│"
|
|
632
|
+
},
|
|
633
|
+
singleDoubleRounded: {
|
|
634
|
+
tl: "╭",
|
|
635
|
+
tr: "╮",
|
|
636
|
+
bl: "╰",
|
|
637
|
+
br: "╯",
|
|
638
|
+
h: "═",
|
|
639
|
+
v: "│"
|
|
640
|
+
},
|
|
641
|
+
rounded: {
|
|
642
|
+
tl: "╭",
|
|
643
|
+
tr: "╮",
|
|
644
|
+
bl: "╰",
|
|
645
|
+
br: "╯",
|
|
646
|
+
h: "─",
|
|
647
|
+
v: "│"
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
defaultStyle = {
|
|
651
|
+
borderColor: "white",
|
|
652
|
+
borderStyle: "rounded",
|
|
653
|
+
valign: "center",
|
|
654
|
+
padding: 2,
|
|
655
|
+
marginLeft: 1,
|
|
656
|
+
marginTop: 1,
|
|
657
|
+
marginBottom: 1
|
|
658
|
+
};
|
|
659
|
+
} });
|
|
660
|
+
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
|
|
663
|
+
function b() {
|
|
664
|
+
if (globalThis.process?.env) for (const e of f) {
|
|
665
|
+
const s$1 = e[1] || e[0];
|
|
666
|
+
if (globalThis.process?.env[s$1]) return {
|
|
667
|
+
name: e[0].toLowerCase(),
|
|
668
|
+
...e[2]
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? {
|
|
672
|
+
name: "stackblitz",
|
|
673
|
+
ci: false
|
|
674
|
+
} : {
|
|
675
|
+
name: "",
|
|
676
|
+
ci: false
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
function n(e) {
|
|
680
|
+
return e ? e !== "false" : false;
|
|
681
|
+
}
|
|
682
|
+
function G() {
|
|
683
|
+
const e = F.find((s$1) => s$1[0]);
|
|
684
|
+
if (e) return { name: e[1] };
|
|
685
|
+
}
|
|
686
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
687
|
+
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
688
|
+
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("|");
|
|
689
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
690
|
+
}
|
|
691
|
+
function stripAnsi$1(string) {
|
|
692
|
+
if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
693
|
+
return string.replace(regex, "");
|
|
694
|
+
}
|
|
695
|
+
function isAmbiguous(x) {
|
|
696
|
+
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
697
|
+
}
|
|
698
|
+
function isFullWidth(x) {
|
|
699
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
700
|
+
}
|
|
701
|
+
function isWide(x) {
|
|
702
|
+
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
703
|
+
}
|
|
704
|
+
function validate(codePoint) {
|
|
705
|
+
if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
706
|
+
}
|
|
707
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
708
|
+
validate(codePoint);
|
|
709
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
|
|
710
|
+
return 1;
|
|
711
|
+
}
|
|
712
|
+
function stringWidth$1(string, options$1 = {}) {
|
|
713
|
+
if (typeof string !== "string" || string.length === 0) return 0;
|
|
714
|
+
const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options$1;
|
|
715
|
+
if (!countAnsiEscapeCodes) string = stripAnsi$1(string);
|
|
716
|
+
if (string.length === 0) return 0;
|
|
717
|
+
let width = 0;
|
|
718
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
719
|
+
for (const { segment: character } of segmenter.segment(string)) {
|
|
720
|
+
const codePoint = character.codePointAt(0);
|
|
721
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
|
|
722
|
+
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
|
|
723
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
|
|
724
|
+
if (codePoint >= 55296 && codePoint <= 57343) continue;
|
|
725
|
+
if (codePoint >= 65024 && codePoint <= 65039) continue;
|
|
726
|
+
if (defaultIgnorableCodePointRegex.test(character)) continue;
|
|
727
|
+
if (emojiRegex().test(character)) {
|
|
728
|
+
width += 2;
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
732
|
+
}
|
|
733
|
+
return width;
|
|
734
|
+
}
|
|
735
|
+
function isUnicodeSupported() {
|
|
736
|
+
const { env: env$1 } = process$1;
|
|
737
|
+
const { TERM, TERM_PROGRAM } = env$1;
|
|
738
|
+
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
739
|
+
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";
|
|
740
|
+
}
|
|
741
|
+
function stringWidth(str) {
|
|
742
|
+
const hasICU = typeof Intl === "object";
|
|
743
|
+
if (!hasICU || !Intl.Segmenter) return stripAnsi(str).length;
|
|
744
|
+
return stringWidth$1(str);
|
|
745
|
+
}
|
|
746
|
+
function characterFormat(str) {
|
|
747
|
+
return str.replace(/`([^`]+)`/gm, (_$1, m) => colors$1.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_$1, m) => ` ${colors$1.underline(m)} `);
|
|
748
|
+
}
|
|
749
|
+
function getColor(color = "white") {
|
|
750
|
+
return colors$1[color] || colors$1.white;
|
|
751
|
+
}
|
|
752
|
+
function getBgColor(color = "bgWhite") {
|
|
753
|
+
return colors$1[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors$1.bgWhite;
|
|
754
|
+
}
|
|
755
|
+
function createConsola(options$1 = {}) {
|
|
756
|
+
let level = _getDefaultLogLevel();
|
|
757
|
+
if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
|
|
758
|
+
const consola2 = createConsola$1({
|
|
759
|
+
level,
|
|
760
|
+
defaults: { level },
|
|
761
|
+
stdout: process.stdout,
|
|
762
|
+
stderr: process.stderr,
|
|
763
|
+
prompt: (...args) => import("./shared/prompt-B3VJLbs9.mjs").then((m) => m.prompt(...args)),
|
|
764
|
+
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
765
|
+
...options$1
|
|
766
|
+
});
|
|
767
|
+
return consola2;
|
|
768
|
+
}
|
|
769
|
+
function _getDefaultLogLevel() {
|
|
770
|
+
if (g) return LogLevels.debug;
|
|
771
|
+
if (R) return LogLevels.warn;
|
|
772
|
+
return LogLevels.info;
|
|
773
|
+
}
|
|
774
|
+
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;
|
|
775
|
+
var init_dist = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs"() {
|
|
776
|
+
init_core();
|
|
777
|
+
init_consola_DRwqZj3T();
|
|
778
|
+
init_consola_DXBYu_KD();
|
|
779
|
+
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, {
|
|
780
|
+
get(e, s$1) {
|
|
781
|
+
return i()[s$1] ?? r[s$1];
|
|
782
|
+
},
|
|
783
|
+
has(e, s$1) {
|
|
784
|
+
const E = i();
|
|
785
|
+
return s$1 in E || s$1 in r;
|
|
786
|
+
},
|
|
787
|
+
set(e, s$1, E) {
|
|
788
|
+
const B = i(true);
|
|
789
|
+
return B[s$1] = E, true;
|
|
790
|
+
},
|
|
791
|
+
deleteProperty(e, s$1) {
|
|
792
|
+
if (!s$1) return false;
|
|
793
|
+
const E = i(true);
|
|
794
|
+
return delete E[s$1], true;
|
|
795
|
+
},
|
|
796
|
+
ownKeys() {
|
|
797
|
+
const e = i(true);
|
|
798
|
+
return Object.keys(e);
|
|
799
|
+
}
|
|
800
|
+
}), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
|
|
801
|
+
["APPVEYOR"],
|
|
802
|
+
[
|
|
803
|
+
"AWS_AMPLIFY",
|
|
804
|
+
"AWS_APP_ID",
|
|
805
|
+
{ ci: true }
|
|
806
|
+
],
|
|
807
|
+
["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
|
|
808
|
+
["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
|
|
809
|
+
["APPCIRCLE", "AC_APPCIRCLE"],
|
|
810
|
+
["BAMBOO", "bamboo_planKey"],
|
|
811
|
+
["BITBUCKET", "BITBUCKET_COMMIT"],
|
|
812
|
+
["BITRISE", "BITRISE_IO"],
|
|
813
|
+
["BUDDY", "BUDDY_WORKSPACE_ID"],
|
|
814
|
+
["BUILDKITE"],
|
|
815
|
+
["CIRCLE", "CIRCLECI"],
|
|
816
|
+
["CIRRUS", "CIRRUS_CI"],
|
|
817
|
+
[
|
|
818
|
+
"CLOUDFLARE_PAGES",
|
|
819
|
+
"CF_PAGES",
|
|
820
|
+
{ ci: true }
|
|
821
|
+
],
|
|
822
|
+
["CODEBUILD", "CODEBUILD_BUILD_ARN"],
|
|
823
|
+
["CODEFRESH", "CF_BUILD_ID"],
|
|
824
|
+
["DRONE"],
|
|
825
|
+
["DRONE", "DRONE_BUILD_EVENT"],
|
|
826
|
+
["DSARI"],
|
|
827
|
+
["GITHUB_ACTIONS"],
|
|
828
|
+
["GITLAB", "GITLAB_CI"],
|
|
829
|
+
["GITLAB", "CI_MERGE_REQUEST_ID"],
|
|
830
|
+
["GOCD", "GO_PIPELINE_LABEL"],
|
|
831
|
+
["LAYERCI"],
|
|
832
|
+
["HUDSON", "HUDSON_URL"],
|
|
833
|
+
["JENKINS", "JENKINS_URL"],
|
|
834
|
+
["MAGNUM"],
|
|
835
|
+
["NETLIFY"],
|
|
836
|
+
[
|
|
837
|
+
"NETLIFY",
|
|
838
|
+
"NETLIFY_LOCAL",
|
|
839
|
+
{ ci: false }
|
|
840
|
+
],
|
|
841
|
+
["NEVERCODE"],
|
|
842
|
+
["RENDER"],
|
|
843
|
+
["SAIL", "SAILCI"],
|
|
844
|
+
["SEMAPHORE"],
|
|
845
|
+
["SCREWDRIVER"],
|
|
846
|
+
["SHIPPABLE"],
|
|
847
|
+
["SOLANO", "TDDIUM"],
|
|
848
|
+
["STRIDER"],
|
|
849
|
+
["TEAMCITY", "TEAMCITY_VERSION"],
|
|
850
|
+
["TRAVIS"],
|
|
851
|
+
["VERCEL", "NOW_BUILDER"],
|
|
852
|
+
[
|
|
853
|
+
"VERCEL",
|
|
854
|
+
"VERCEL",
|
|
855
|
+
{ ci: false }
|
|
856
|
+
],
|
|
857
|
+
[
|
|
858
|
+
"VERCEL",
|
|
859
|
+
"VERCEL_ENV",
|
|
860
|
+
{ ci: false }
|
|
861
|
+
],
|
|
862
|
+
["APPCENTER", "APPCENTER_BUILD_ID"],
|
|
863
|
+
[
|
|
864
|
+
"CODESANDBOX",
|
|
865
|
+
"CODESANDBOX_SSE",
|
|
866
|
+
{ ci: false }
|
|
867
|
+
],
|
|
868
|
+
[
|
|
869
|
+
"CODESANDBOX",
|
|
870
|
+
"CODESANDBOX_HOST",
|
|
871
|
+
{ ci: false }
|
|
872
|
+
],
|
|
873
|
+
["STACKBLITZ"],
|
|
874
|
+
["STORMKIT"],
|
|
875
|
+
["CLEAVR"],
|
|
876
|
+
["ZEABUR"],
|
|
877
|
+
[
|
|
878
|
+
"CODESPHERE",
|
|
879
|
+
"CODESPHERE_APP_ID",
|
|
880
|
+
{ ci: true }
|
|
881
|
+
],
|
|
882
|
+
["RAILWAY", "RAILWAY_PROJECT_ID"],
|
|
883
|
+
["RAILWAY", "RAILWAY_SERVICE_ID"],
|
|
884
|
+
["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
|
|
885
|
+
[
|
|
886
|
+
"FIREBASE_APP_HOSTING",
|
|
887
|
+
"FIREBASE_APP_HOSTING",
|
|
888
|
+
{ ci: true }
|
|
889
|
+
]
|
|
890
|
+
];
|
|
891
|
+
l = b();
|
|
892
|
+
l.name;
|
|
893
|
+
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);
|
|
894
|
+
n(o.MINIMAL);
|
|
895
|
+
A = /^win/i.test(I);
|
|
896
|
+
!n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM);
|
|
897
|
+
C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
|
|
898
|
+
Number(C?.split(".")[0]);
|
|
899
|
+
y = globalThis.process || Object.create(null), _ = { versions: {} };
|
|
900
|
+
new Proxy(y, { get(e, s$1) {
|
|
901
|
+
if (s$1 === "env") return o;
|
|
902
|
+
if (s$1 in e) return e[s$1];
|
|
903
|
+
if (s$1 in _) return _[s$1];
|
|
904
|
+
} });
|
|
905
|
+
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 = [
|
|
906
|
+
[S, "netlify"],
|
|
907
|
+
[u, "edge-light"],
|
|
908
|
+
[N, "workerd"],
|
|
909
|
+
[L, "fastly"],
|
|
910
|
+
[D, "deno"],
|
|
911
|
+
[O, "bun"],
|
|
912
|
+
[c, "node"]
|
|
913
|
+
];
|
|
914
|
+
P = G();
|
|
915
|
+
P?.name;
|
|
916
|
+
regex = ansiRegex();
|
|
917
|
+
emojiRegex = () => {
|
|
918
|
+
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;
|
|
919
|
+
};
|
|
920
|
+
segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
|
|
921
|
+
defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
922
|
+
TYPE_COLOR_MAP = {
|
|
923
|
+
info: "cyan",
|
|
924
|
+
fail: "red",
|
|
925
|
+
success: "green",
|
|
926
|
+
ready: "green",
|
|
927
|
+
start: "magenta"
|
|
928
|
+
};
|
|
929
|
+
LEVEL_COLOR_MAP = {
|
|
930
|
+
0: "red",
|
|
931
|
+
1: "yellow"
|
|
932
|
+
};
|
|
933
|
+
unicode = isUnicodeSupported();
|
|
934
|
+
s = (c$1, fallback) => unicode ? c$1 : fallback;
|
|
935
|
+
TYPE_ICONS = {
|
|
936
|
+
error: s("✖", "×"),
|
|
937
|
+
fatal: s("✖", "×"),
|
|
938
|
+
ready: s("✔", "√"),
|
|
939
|
+
warn: s("⚠", "‼"),
|
|
940
|
+
info: s("ℹ", "i"),
|
|
941
|
+
success: s("✔", "√"),
|
|
942
|
+
debug: s("⚙", "D"),
|
|
943
|
+
trace: s("→", "→"),
|
|
944
|
+
fail: s("✖", "×"),
|
|
945
|
+
start: s("◐", "o"),
|
|
946
|
+
log: ""
|
|
947
|
+
};
|
|
948
|
+
FancyReporter = class extends BasicReporter {
|
|
949
|
+
formatStack(stack, message, opts) {
|
|
950
|
+
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
951
|
+
return `
|
|
952
|
+
${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors$1.gray(m)).replace(/\((.+)\)/, (_$1, m) => `(${colors$1.cyan(m)})`)).join(`
|
|
953
|
+
${indent}`);
|
|
954
|
+
}
|
|
955
|
+
formatType(logObj, isBadge, opts) {
|
|
956
|
+
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
957
|
+
if (isBadge) return getBgColor(typeColor)(colors$1.black(` ${logObj.type.toUpperCase()} `));
|
|
958
|
+
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
959
|
+
return _type ? getColor(typeColor)(_type) : "";
|
|
960
|
+
}
|
|
961
|
+
formatLogObj(logObj, opts) {
|
|
962
|
+
const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
|
|
963
|
+
if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
|
|
964
|
+
title: logObj.title ? characterFormat(logObj.title) : void 0,
|
|
965
|
+
style: logObj.style
|
|
966
|
+
});
|
|
967
|
+
const date = this.formatDate(logObj.date, opts);
|
|
968
|
+
const coloredDate = date && colors$1.gray(date);
|
|
969
|
+
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
970
|
+
const type = this.formatType(logObj, isBadge, opts);
|
|
971
|
+
const tag = logObj.tag ? colors$1.gray(logObj.tag) : "";
|
|
972
|
+
let line;
|
|
973
|
+
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
974
|
+
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
975
|
+
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
976
|
+
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors$1.gray(`[${right}]`)} ` : "") + left;
|
|
977
|
+
line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
|
|
978
|
+
if (logObj.type === "trace") {
|
|
979
|
+
const _err = new Error("Trace: " + logObj.message);
|
|
980
|
+
line += this.formatStack(_err.stack || "", _err.message);
|
|
981
|
+
}
|
|
982
|
+
return isBadge ? "\n" + line + "\n" : line;
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
consola = createConsola();
|
|
986
|
+
} });
|
|
987
|
+
|
|
988
|
+
//#endregion
|
|
989
|
+
//#region src/cli/logger.ts
|
|
990
|
+
function createTestingLogger() {
|
|
991
|
+
const types = [
|
|
992
|
+
"silent",
|
|
993
|
+
"fatal",
|
|
994
|
+
"error",
|
|
995
|
+
"warn",
|
|
996
|
+
"log",
|
|
997
|
+
"info",
|
|
998
|
+
"success",
|
|
999
|
+
"fail",
|
|
1000
|
+
"ready",
|
|
1001
|
+
"start",
|
|
1002
|
+
"box",
|
|
1003
|
+
"debug",
|
|
1004
|
+
"trace",
|
|
1005
|
+
"verbose"
|
|
1006
|
+
];
|
|
1007
|
+
const ret = Object.create(null);
|
|
1008
|
+
for (const type of types) ret[type] = console.log;
|
|
1009
|
+
return ret;
|
|
1010
|
+
}
|
|
1011
|
+
var logger;
|
|
1012
|
+
var init_logger = __esm({ "src/cli/logger.ts"() {
|
|
1013
|
+
init_dist();
|
|
1014
|
+
logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
|
|
1015
|
+
} });
|
|
1016
|
+
|
|
1017
|
+
//#endregion
|
|
1018
|
+
//#region src/cli/arguments/alias.ts
|
|
1019
|
+
var alias;
|
|
1020
|
+
var init_alias = __esm({ "src/cli/arguments/alias.ts"() {
|
|
1021
|
+
alias = {
|
|
1022
|
+
config: {
|
|
1023
|
+
abbreviation: "c",
|
|
1024
|
+
hint: "filename"
|
|
1025
|
+
},
|
|
1026
|
+
help: { abbreviation: "h" },
|
|
1027
|
+
version: { abbreviation: "v" },
|
|
1028
|
+
watch: { abbreviation: "w" },
|
|
1029
|
+
dir: { abbreviation: "d" },
|
|
1030
|
+
file: { abbreviation: "o" },
|
|
1031
|
+
external: { abbreviation: "e" },
|
|
1032
|
+
format: { abbreviation: "f" },
|
|
1033
|
+
name: { abbreviation: "n" },
|
|
1034
|
+
globals: { abbreviation: "g" },
|
|
1035
|
+
sourcemap: {
|
|
1036
|
+
abbreviation: "s",
|
|
1037
|
+
default: true
|
|
1038
|
+
},
|
|
1039
|
+
minify: { abbreviation: "m" },
|
|
1040
|
+
platform: { abbreviation: "p" },
|
|
1041
|
+
assetFileNames: { hint: "name" },
|
|
1042
|
+
chunkFileNames: { hint: "name" },
|
|
1043
|
+
entryFileNames: { hint: "name" },
|
|
1044
|
+
externalLiveBindings: {
|
|
1045
|
+
default: true,
|
|
1046
|
+
reverse: true
|
|
1047
|
+
},
|
|
1048
|
+
treeshake: {
|
|
1049
|
+
default: true,
|
|
1050
|
+
reverse: true
|
|
1051
|
+
},
|
|
1052
|
+
moduleTypes: { hint: "types" }
|
|
1053
|
+
};
|
|
1054
|
+
} });
|
|
1055
|
+
|
|
1056
|
+
//#endregion
|
|
1057
|
+
//#region src/cli/arguments/utils.ts
|
|
1058
|
+
function getSchemaType(schema) {
|
|
1059
|
+
if ("anyOf" in schema) {
|
|
1060
|
+
const types = schema.anyOf.map(getSchemaType);
|
|
1061
|
+
let result = priority.find((type) => types.includes(type));
|
|
1062
|
+
if (result) return result;
|
|
1063
|
+
}
|
|
1064
|
+
if ("type" in schema) return schema.type;
|
|
1065
|
+
if ("const" in schema) return typeof schema.const;
|
|
1066
|
+
return "object";
|
|
1067
|
+
}
|
|
1068
|
+
function flattenSchema(schema, base = {}, parent = "") {
|
|
1069
|
+
if (schema === void 0) return base;
|
|
1070
|
+
for (const [k, value] of Object.entries(schema)) {
|
|
1071
|
+
const key = parent ? `${parent}.${k}` : k;
|
|
1072
|
+
if (getSchemaType(value) === "object") if ("properties" in value) flattenSchema(value.properties, base, key);
|
|
1073
|
+
else base[key] = value;
|
|
1074
|
+
else base[key] = value;
|
|
1075
|
+
}
|
|
1076
|
+
return base;
|
|
1077
|
+
}
|
|
1078
|
+
function setNestedProperty(obj, path$1, value) {
|
|
1079
|
+
const keys = path$1.split(".");
|
|
1080
|
+
let current = obj;
|
|
1081
|
+
for (let i$1 = 0; i$1 < keys.length - 1; i$1++) {
|
|
1082
|
+
if (!current[keys[i$1]]) current[keys[i$1]] = {};
|
|
1083
|
+
current = current[keys[i$1]];
|
|
1084
|
+
}
|
|
1085
|
+
const finalKey = keys[keys.length - 1];
|
|
1086
|
+
Object.defineProperty(current, finalKey, {
|
|
1087
|
+
value,
|
|
1088
|
+
writable: true,
|
|
1089
|
+
enumerable: true,
|
|
1090
|
+
configurable: true
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
function camelCaseToKebabCase(str) {
|
|
1094
|
+
return str.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
|
|
1095
|
+
}
|
|
1096
|
+
function kebabCaseToCamelCase(str) {
|
|
1097
|
+
return str.replace(/-./g, (match) => match[1].toUpperCase());
|
|
1098
|
+
}
|
|
1099
|
+
var priority;
|
|
1100
|
+
var init_utils = __esm({ "src/cli/arguments/utils.ts"() {
|
|
1101
|
+
priority = [
|
|
1102
|
+
"object",
|
|
1103
|
+
"array",
|
|
1104
|
+
"string",
|
|
1105
|
+
"number",
|
|
1106
|
+
"boolean"
|
|
1107
|
+
];
|
|
1108
|
+
} });
|
|
1109
|
+
|
|
1110
|
+
//#endregion
|
|
1111
|
+
//#region src/cli/arguments/normalize.ts
|
|
1112
|
+
function normalizeCliOptions(cliOptions, positionals) {
|
|
1113
|
+
const [data, errors] = validateCliOptions(cliOptions);
|
|
1114
|
+
if (errors?.length) {
|
|
1115
|
+
errors.forEach((error) => {
|
|
1116
|
+
logger.error(`${error}. You can use \`rolldown -h\` to see the help.`);
|
|
1117
|
+
});
|
|
1118
|
+
process.exit(1);
|
|
1119
|
+
}
|
|
1120
|
+
const options$1 = data ?? {};
|
|
1121
|
+
const result = {
|
|
1122
|
+
input: {},
|
|
1123
|
+
output: {},
|
|
1124
|
+
help: options$1.help ?? false,
|
|
1125
|
+
version: options$1.version ?? false,
|
|
1126
|
+
watch: options$1.watch ?? false
|
|
1127
|
+
};
|
|
1128
|
+
if (typeof options$1.config === "string") result.config = options$1.config;
|
|
1129
|
+
const keysOfInput = getInputCliKeys();
|
|
1130
|
+
const keysOfOutput = getOutputCliKeys();
|
|
1131
|
+
const reservedKeys = [
|
|
1132
|
+
"help",
|
|
1133
|
+
"version",
|
|
1134
|
+
"config",
|
|
1135
|
+
"watch"
|
|
1136
|
+
];
|
|
1137
|
+
for (let [key, value] of Object.entries(options$1)) {
|
|
1138
|
+
const keys = key.split(".");
|
|
1139
|
+
const [primary] = keys;
|
|
1140
|
+
if (keysOfInput.includes(primary)) setNestedProperty(result.input, key, value);
|
|
1141
|
+
else if (keysOfOutput.includes(primary)) setNestedProperty(result.output, key, value);
|
|
1142
|
+
else if (!reservedKeys.includes(key)) {
|
|
1143
|
+
logger.error(`Unknown option: ${key}`);
|
|
1144
|
+
process.exit(1);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
if (!result.config && positionals.length > 0) result.input.input = positionals;
|
|
1148
|
+
return result;
|
|
1149
|
+
}
|
|
1150
|
+
var init_normalize = __esm({ "src/cli/arguments/normalize.ts"() {
|
|
1151
|
+
init_validator();
|
|
1152
|
+
init_logger();
|
|
1153
|
+
init_utils();
|
|
1154
|
+
} });
|
|
1155
|
+
|
|
1156
|
+
//#endregion
|
|
1157
|
+
//#region src/cli/arguments/index.ts
|
|
1158
|
+
function parseCliArguments() {
|
|
1159
|
+
const { values, tokens, positionals } = parseArgs({
|
|
1160
|
+
options,
|
|
1161
|
+
tokens: true,
|
|
1162
|
+
allowPositionals: true,
|
|
1163
|
+
strict: false
|
|
1164
|
+
});
|
|
1165
|
+
tokens.filter((token) => token.kind === "option").forEach((option) => {
|
|
1166
|
+
let negative = false;
|
|
1167
|
+
if (option.name.startsWith("no-")) {
|
|
1168
|
+
const name = kebabCaseToCamelCase(option.name.substring(3));
|
|
1169
|
+
if (name in flattenedSchema) {
|
|
1170
|
+
delete values[option.name];
|
|
1171
|
+
option.name = name;
|
|
1172
|
+
negative = true;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
delete values[option.name];
|
|
1176
|
+
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);
|
|
1183
|
+
if (type === "string" && typeof option.value !== "string") {
|
|
1184
|
+
let opt = option;
|
|
1185
|
+
let defaultValue = Object.getOwnPropertyDescriptor(alias, opt.name)?.value;
|
|
1186
|
+
Object.defineProperty(values, opt.name, {
|
|
1187
|
+
value: defaultValue.default ?? "",
|
|
1188
|
+
enumerable: true,
|
|
1189
|
+
configurable: true,
|
|
1190
|
+
writable: true
|
|
1191
|
+
});
|
|
1192
|
+
} else if (type === "object" && typeof option.value === "string") {
|
|
1193
|
+
const [key, value] = option.value.split(",").map((x) => x.split("="))[0];
|
|
1194
|
+
if (!values[option.name]) Object.defineProperty(values, option.name, {
|
|
1195
|
+
value: {},
|
|
1196
|
+
enumerable: true,
|
|
1197
|
+
configurable: true,
|
|
1198
|
+
writable: true
|
|
1199
|
+
});
|
|
1200
|
+
if (key && value) Object.defineProperty(values[option.name], key, {
|
|
1201
|
+
value,
|
|
1202
|
+
enumerable: true,
|
|
1203
|
+
configurable: true,
|
|
1204
|
+
writable: true
|
|
1205
|
+
});
|
|
1206
|
+
} else if (type === "array" && typeof option.value === "string") {
|
|
1207
|
+
if (!values[option.name]) Object.defineProperty(values, option.name, {
|
|
1208
|
+
value: [],
|
|
1209
|
+
enumerable: true,
|
|
1210
|
+
configurable: true,
|
|
1211
|
+
writable: true
|
|
1212
|
+
});
|
|
1213
|
+
values[option.name].push(option.value);
|
|
1214
|
+
} else if (type === "boolean") Object.defineProperty(values, option.name, {
|
|
1215
|
+
value: !negative,
|
|
1216
|
+
enumerable: true,
|
|
1217
|
+
configurable: true,
|
|
1218
|
+
writable: true
|
|
1219
|
+
});
|
|
1220
|
+
else Object.defineProperty(values, option.name, {
|
|
1221
|
+
value: option.value ?? "",
|
|
1222
|
+
enumerable: true,
|
|
1223
|
+
configurable: true,
|
|
1224
|
+
writable: true
|
|
1225
|
+
});
|
|
1226
|
+
});
|
|
1227
|
+
return normalizeCliOptions(values, positionals);
|
|
1228
|
+
}
|
|
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).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(
|
|
1261
|
+
"SIGALRM",
|
|
1262
|
+
"SIGABRT",
|
|
1263
|
+
"SIGVTALRM",
|
|
1264
|
+
"SIGXCPU",
|
|
1265
|
+
"SIGXFSZ",
|
|
1266
|
+
"SIGUSR2",
|
|
1267
|
+
"SIGTRAP",
|
|
1268
|
+
"SIGSYS",
|
|
1269
|
+
"SIGQUIT",
|
|
1270
|
+
"SIGIOT"
|
|
1271
|
+
// should detect profiler and enable/disable accordingly.
|
|
1272
|
+
// see #21
|
|
1273
|
+
// 'SIGPROF'
|
|
1274
|
+
);
|
|
1275
|
+
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1276
|
+
} });
|
|
1277
|
+
|
|
1278
|
+
//#endregion
|
|
1279
|
+
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
1280
|
+
var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process$2, onExit, load, unload;
|
|
1281
|
+
var init_mjs = __esm({ "../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
|
|
1282
|
+
init_signals();
|
|
1283
|
+
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";
|
|
1284
|
+
kExitEmitter = Symbol.for("signal-exit emitter");
|
|
1285
|
+
global = globalThis;
|
|
1286
|
+
ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1287
|
+
Emitter = class {
|
|
1288
|
+
emitted = {
|
|
1289
|
+
afterExit: false,
|
|
1290
|
+
exit: false
|
|
1291
|
+
};
|
|
1292
|
+
listeners = {
|
|
1293
|
+
afterExit: [],
|
|
1294
|
+
exit: []
|
|
1295
|
+
};
|
|
1296
|
+
count = 0;
|
|
1297
|
+
id = Math.random();
|
|
1298
|
+
constructor() {
|
|
1299
|
+
if (global[kExitEmitter]) return global[kExitEmitter];
|
|
1300
|
+
ObjectDefineProperty(global, kExitEmitter, {
|
|
1301
|
+
value: this,
|
|
1302
|
+
writable: false,
|
|
1303
|
+
enumerable: false,
|
|
1304
|
+
configurable: false
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
on(ev, fn) {
|
|
1308
|
+
this.listeners[ev].push(fn);
|
|
1309
|
+
}
|
|
1310
|
+
removeListener(ev, fn) {
|
|
1311
|
+
const list = this.listeners[ev];
|
|
1312
|
+
const i$1 = list.indexOf(fn);
|
|
1313
|
+
if (i$1 === -1) return;
|
|
1314
|
+
if (i$1 === 0 && list.length === 1) list.length = 0;
|
|
1315
|
+
else list.splice(i$1, 1);
|
|
1316
|
+
}
|
|
1317
|
+
emit(ev, code, signal) {
|
|
1318
|
+
if (this.emitted[ev]) return false;
|
|
1319
|
+
this.emitted[ev] = true;
|
|
1320
|
+
let ret = false;
|
|
1321
|
+
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
|
|
1322
|
+
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
|
|
1323
|
+
return ret;
|
|
1324
|
+
}
|
|
1325
|
+
};
|
|
1326
|
+
SignalExitBase = class {};
|
|
1327
|
+
signalExitWrap = (handler) => {
|
|
1328
|
+
return {
|
|
1329
|
+
onExit(cb, opts) {
|
|
1330
|
+
return handler.onExit(cb, opts);
|
|
1331
|
+
},
|
|
1332
|
+
load() {
|
|
1333
|
+
return handler.load();
|
|
1334
|
+
},
|
|
1335
|
+
unload() {
|
|
1336
|
+
return handler.unload();
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
};
|
|
1340
|
+
SignalExitFallback = class extends SignalExitBase {
|
|
1341
|
+
onExit() {
|
|
1342
|
+
return () => {};
|
|
1343
|
+
}
|
|
1344
|
+
load() {}
|
|
1345
|
+
unload() {}
|
|
1346
|
+
};
|
|
1347
|
+
SignalExit = class extends SignalExitBase {
|
|
1348
|
+
#hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1349
|
+
#emitter = new Emitter();
|
|
1350
|
+
#process;
|
|
1351
|
+
#originalProcessEmit;
|
|
1352
|
+
#originalProcessReallyExit;
|
|
1353
|
+
#sigListeners = {};
|
|
1354
|
+
#loaded = false;
|
|
1355
|
+
constructor(process$3) {
|
|
1356
|
+
super();
|
|
1357
|
+
this.#process = process$3;
|
|
1358
|
+
this.#sigListeners = {};
|
|
1359
|
+
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
1360
|
+
const listeners = this.#process.listeners(sig);
|
|
1361
|
+
let { count } = this.#emitter;
|
|
1362
|
+
const p = process$3;
|
|
1363
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
|
|
1364
|
+
if (listeners.length === count) {
|
|
1365
|
+
this.unload();
|
|
1366
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
1367
|
+
const s$1 = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
1368
|
+
if (!ret) process$3.kill(process$3.pid, s$1);
|
|
1369
|
+
}
|
|
1370
|
+
};
|
|
1371
|
+
this.#originalProcessReallyExit = process$3.reallyExit;
|
|
1372
|
+
this.#originalProcessEmit = process$3.emit;
|
|
1373
|
+
}
|
|
1374
|
+
onExit(cb, opts) {
|
|
1375
|
+
if (!processOk(this.#process)) return () => {};
|
|
1376
|
+
if (this.#loaded === false) this.load();
|
|
1377
|
+
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
1378
|
+
this.#emitter.on(ev, cb);
|
|
1379
|
+
return () => {
|
|
1380
|
+
this.#emitter.removeListener(ev, cb);
|
|
1381
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
load() {
|
|
1385
|
+
if (this.#loaded) return;
|
|
1386
|
+
this.#loaded = true;
|
|
1387
|
+
this.#emitter.count += 1;
|
|
1388
|
+
for (const sig of signals) try {
|
|
1389
|
+
const fn = this.#sigListeners[sig];
|
|
1390
|
+
if (fn) this.#process.on(sig, fn);
|
|
1391
|
+
} catch (_$1) {}
|
|
1392
|
+
this.#process.emit = (ev, ...a$1) => {
|
|
1393
|
+
return this.#processEmit(ev, ...a$1);
|
|
1394
|
+
};
|
|
1395
|
+
this.#process.reallyExit = (code) => {
|
|
1396
|
+
return this.#processReallyExit(code);
|
|
1397
|
+
};
|
|
1398
|
+
}
|
|
1399
|
+
unload() {
|
|
1400
|
+
if (!this.#loaded) return;
|
|
1401
|
+
this.#loaded = false;
|
|
1402
|
+
signals.forEach((sig) => {
|
|
1403
|
+
const listener = this.#sigListeners[sig];
|
|
1404
|
+
if (!listener) throw new Error("Listener not defined for signal: " + sig);
|
|
1405
|
+
try {
|
|
1406
|
+
this.#process.removeListener(sig, listener);
|
|
1407
|
+
} catch (_$1) {}
|
|
1408
|
+
});
|
|
1409
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
1410
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1411
|
+
this.#emitter.count -= 1;
|
|
1412
|
+
}
|
|
1413
|
+
#processReallyExit(code) {
|
|
1414
|
+
if (!processOk(this.#process)) return 0;
|
|
1415
|
+
this.#process.exitCode = code || 0;
|
|
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
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
1424
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1425
|
+
return ret;
|
|
1426
|
+
} else return og.call(this.#process, ev, ...args);
|
|
1427
|
+
}
|
|
1428
|
+
};
|
|
1429
|
+
process$2 = globalThis.process;
|
|
1430
|
+
({onExit, load, unload} = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback()));
|
|
1431
|
+
} });
|
|
1432
|
+
|
|
1433
|
+
//#endregion
|
|
1434
|
+
//#region src/cli/load-config.ts
|
|
1435
|
+
async function bundleTsConfig(configFile, isEsm) {
|
|
1436
|
+
const dirnameVarName = "injected_original_dirname";
|
|
1437
|
+
const filenameVarName = "injected_original_filename";
|
|
1438
|
+
const importMetaUrlVarName = "injected_original_import_meta_url";
|
|
1439
|
+
const bundle = await rolldown({
|
|
1440
|
+
input: configFile,
|
|
1441
|
+
platform: "node",
|
|
1442
|
+
resolve: { mainFields: ["main"] },
|
|
1443
|
+
define: {
|
|
1444
|
+
__dirname: dirnameVarName,
|
|
1445
|
+
__filename: filenameVarName,
|
|
1446
|
+
"import.meta.url": importMetaUrlVarName,
|
|
1447
|
+
"import.meta.dirname": dirnameVarName,
|
|
1448
|
+
"import.meta.filename": filenameVarName
|
|
1449
|
+
},
|
|
1450
|
+
treeshake: false,
|
|
1451
|
+
external: [/^[\w@][^:]/],
|
|
1452
|
+
plugins: [{
|
|
1453
|
+
name: "inject-file-scope-variables",
|
|
1454
|
+
transform: {
|
|
1455
|
+
filter: { id: /\.[cm]?[jt]s$/ },
|
|
1456
|
+
async handler(code, id) {
|
|
1457
|
+
const injectValues = `const ${dirnameVarName} = ${JSON.stringify(path.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(id).href)};`;
|
|
1458
|
+
return {
|
|
1459
|
+
code: injectValues + code,
|
|
1460
|
+
map: null
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
}]
|
|
1465
|
+
});
|
|
1466
|
+
const outputDir = path.dirname(configFile);
|
|
1467
|
+
const result = await bundle.write({
|
|
1468
|
+
dir: outputDir,
|
|
1469
|
+
format: isEsm ? "esm" : "cjs",
|
|
1470
|
+
sourcemap: "inline",
|
|
1471
|
+
entryFileNames: `rolldown.config.[hash]${path.extname(configFile).replace("ts", "js")}`
|
|
1472
|
+
});
|
|
1473
|
+
const fileName = result.output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
1474
|
+
return path.join(outputDir, fileName);
|
|
1475
|
+
}
|
|
1476
|
+
async function findConfigFileNameInCwd() {
|
|
1477
|
+
const filesInWorkingDirectory = new Set(await readdir(cwd()));
|
|
1478
|
+
for (const extension of SUPPORTED_CONFIG_FORMATS) {
|
|
1479
|
+
const fileName = `${DEFAULT_CONFIG_BASE}${extension}`;
|
|
1480
|
+
if (filesInWorkingDirectory.has(fileName)) return fileName;
|
|
1481
|
+
}
|
|
1482
|
+
throw new Error("No `rolldown.config` configuration file found.");
|
|
1483
|
+
}
|
|
1484
|
+
async function loadTsConfig(configFile) {
|
|
1485
|
+
const isEsm = isFilePathESM(configFile);
|
|
1486
|
+
const file = await bundleTsConfig(configFile, isEsm);
|
|
1487
|
+
try {
|
|
1488
|
+
return (await import(pathToFileURL(file).href)).default;
|
|
1489
|
+
} finally {
|
|
1490
|
+
fs.unlink(file, () => {});
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
function isFilePathESM(filePath) {
|
|
1494
|
+
if (/\.m[jt]s$/.test(filePath)) return true;
|
|
1495
|
+
else if (/\.c[jt]s$/.test(filePath)) return false;
|
|
1496
|
+
else {
|
|
1497
|
+
const pkg = findNearestPackageData(path.dirname(filePath));
|
|
1498
|
+
if (pkg) return pkg.type === "module";
|
|
1499
|
+
return false;
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
function findNearestPackageData(basedir) {
|
|
1503
|
+
while (basedir) {
|
|
1504
|
+
const pkgPath = path.join(basedir, "package.json");
|
|
1505
|
+
if (tryStatSync(pkgPath)?.isFile()) try {
|
|
1506
|
+
return JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
1507
|
+
} catch {}
|
|
1508
|
+
const nextBasedir = path.dirname(basedir);
|
|
1509
|
+
if (nextBasedir === basedir) break;
|
|
1510
|
+
basedir = nextBasedir;
|
|
1511
|
+
}
|
|
1512
|
+
return null;
|
|
1513
|
+
}
|
|
1514
|
+
function tryStatSync(file) {
|
|
1515
|
+
try {
|
|
1516
|
+
return fs.statSync(file, { throwIfNoEntry: false });
|
|
1517
|
+
} catch {}
|
|
1518
|
+
}
|
|
1519
|
+
async function loadConfig(configPath) {
|
|
1520
|
+
const ext = path.extname(configPath = configPath || await findConfigFileNameInCwd());
|
|
1521
|
+
try {
|
|
1522
|
+
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import(pathToFileURL(configPath).href)).default;
|
|
1523
|
+
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) {
|
|
1524
|
+
const rawConfigPath = path.resolve(configPath);
|
|
1525
|
+
return await loadTsConfig(rawConfigPath);
|
|
1526
|
+
} else throw new Error(`Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${ext}\``);
|
|
1527
|
+
} catch (err) {
|
|
1528
|
+
throw new Error("Error happened while loading config.", { cause: err });
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
var SUPPORTED_JS_CONFIG_FORMATS, SUPPORTED_TS_CONFIG_FORMATS, SUPPORTED_CONFIG_FORMATS, DEFAULT_CONFIG_BASE;
|
|
1532
|
+
var init_load_config = __esm({ "src/cli/load-config.ts"() {
|
|
1533
|
+
init_rolldown();
|
|
1534
|
+
SUPPORTED_JS_CONFIG_FORMATS = [
|
|
1535
|
+
".js",
|
|
1536
|
+
".mjs",
|
|
1537
|
+
".cjs"
|
|
1538
|
+
];
|
|
1539
|
+
SUPPORTED_TS_CONFIG_FORMATS = [
|
|
1540
|
+
".ts",
|
|
1541
|
+
".mts",
|
|
1542
|
+
".cts"
|
|
1543
|
+
];
|
|
1544
|
+
SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
|
1545
|
+
DEFAULT_CONFIG_BASE = "rolldown.config";
|
|
1546
|
+
} });
|
|
1547
|
+
|
|
1548
|
+
//#endregion
|
|
1549
|
+
//#region src/cli/commands/bundle.ts
|
|
1550
|
+
async function bundleWithConfig(configPath, cliOptions) {
|
|
1551
|
+
const config = await loadConfig(configPath);
|
|
1552
|
+
if (!config) {
|
|
1553
|
+
logger.error(`No configuration found at ${config}`);
|
|
1554
|
+
process.exit(1);
|
|
1555
|
+
}
|
|
1556
|
+
if (cliOptions.watch) await watchInner(config, cliOptions);
|
|
1557
|
+
else await bundleInner(config, cliOptions);
|
|
1558
|
+
}
|
|
1559
|
+
async function bundleWithCliOptions(cliOptions) {
|
|
1560
|
+
if (cliOptions.output.dir || cliOptions.output.file) {
|
|
1561
|
+
const operation = cliOptions.watch ? watchInner : bundleInner;
|
|
1562
|
+
await operation({}, cliOptions);
|
|
1563
|
+
return;
|
|
1564
|
+
}
|
|
1565
|
+
if (cliOptions.watch) {
|
|
1566
|
+
logger.error("You must specify `output.dir` to use watch mode");
|
|
1567
|
+
process.exit(1);
|
|
1568
|
+
}
|
|
1569
|
+
const build = await rolldown(cliOptions.input);
|
|
1570
|
+
try {
|
|
1571
|
+
const { output: outputs } = await build.generate(cliOptions.output);
|
|
1572
|
+
if (outputs.length === 0) {
|
|
1573
|
+
logger.error("No output generated");
|
|
1574
|
+
process.exit(1);
|
|
1575
|
+
}
|
|
1576
|
+
for (const file of outputs) {
|
|
1577
|
+
if (outputs.length > 1) logger.log(`\n${colors.cyan(colors.bold(`|→ ${file.fileName}:`))}\n`);
|
|
1578
|
+
console.log(file.type === "asset" ? file.source : file.code);
|
|
1579
|
+
}
|
|
1580
|
+
} finally {
|
|
1581
|
+
await build.close();
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
async function watchInner(config, cliOptions) {
|
|
1585
|
+
process.env.ROLLUP_WATCH = "true";
|
|
1586
|
+
process.env.ROLLDOWN_WATCH = "true";
|
|
1587
|
+
let normalizedConfig = arraify(config).map((option) => {
|
|
1588
|
+
return {
|
|
1589
|
+
...option,
|
|
1590
|
+
...cliOptions.input,
|
|
1591
|
+
output: arraify(option.output || {}).map((output) => {
|
|
1592
|
+
return {
|
|
1593
|
+
...output,
|
|
1594
|
+
...cliOptions.output
|
|
1595
|
+
};
|
|
1596
|
+
})
|
|
1597
|
+
};
|
|
1598
|
+
});
|
|
1599
|
+
const watcher = await watch(normalizedConfig);
|
|
1600
|
+
onExit((code) => {
|
|
1601
|
+
Promise.resolve(watcher.close()).finally(() => {
|
|
1602
|
+
process.exit(typeof code === "number" ? code : 0);
|
|
1603
|
+
});
|
|
1604
|
+
return true;
|
|
1605
|
+
});
|
|
1606
|
+
const changedFile = [];
|
|
1607
|
+
watcher.on("change", (id, event) => {
|
|
1608
|
+
if (event.event === "update") changedFile.push(id);
|
|
1609
|
+
});
|
|
1610
|
+
watcher.on("event", (event) => {
|
|
1611
|
+
switch (event.code) {
|
|
1612
|
+
case "BUNDLE_START":
|
|
1613
|
+
if (changedFile.length > 0) logger.log(`Found ${colors.bold(changedFile.map(relativeId).join(", "))} changed, rebuilding...`);
|
|
1614
|
+
changedFile.length = 0;
|
|
1615
|
+
break;
|
|
1616
|
+
case "BUNDLE_END":
|
|
1617
|
+
logger.success(`Rebuilt ${colors.bold(relativeId(event.output[0]))} in ${colors.bold(ms(event.duration))}.`);
|
|
1618
|
+
break;
|
|
1619
|
+
case "ERROR":
|
|
1620
|
+
logger.error(event.error);
|
|
1621
|
+
break;
|
|
1622
|
+
default: break;
|
|
1623
|
+
}
|
|
1624
|
+
});
|
|
1625
|
+
logger.log(`Waiting for changes...`);
|
|
1626
|
+
}
|
|
1627
|
+
async function bundleInner(config, cliOptions) {
|
|
1628
|
+
const startTime = performance.now();
|
|
1629
|
+
const result = [];
|
|
1630
|
+
const configList = arraify(config);
|
|
1631
|
+
for (const config$1 of configList) {
|
|
1632
|
+
const outputList = arraify(config$1.output || {});
|
|
1633
|
+
const build = await rolldown({
|
|
1634
|
+
...config$1,
|
|
1635
|
+
...cliOptions.input
|
|
1636
|
+
});
|
|
1637
|
+
for (const output of outputList) try {
|
|
1638
|
+
result.push(await build.write({
|
|
1639
|
+
...output,
|
|
1640
|
+
...cliOptions.output
|
|
1641
|
+
}));
|
|
1642
|
+
} finally {
|
|
1643
|
+
await build.close();
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
result.forEach(printBundleOutputPretty);
|
|
1647
|
+
logger.log(``);
|
|
1648
|
+
const endTime = performance.now();
|
|
1649
|
+
const duration = endTime - startTime;
|
|
1650
|
+
logger.success(`Finished in ${colors.bold(ms(duration))}`);
|
|
1651
|
+
}
|
|
1652
|
+
function printBundleOutputPretty(output) {
|
|
1653
|
+
const outputEntries = collectOutputEntries(output.output);
|
|
1654
|
+
const outputLayoutSizes = collectOutputLayoutAdjustmentSizes(outputEntries);
|
|
1655
|
+
printOutputEntries(outputEntries, outputLayoutSizes, "<DIR>");
|
|
1656
|
+
}
|
|
1657
|
+
function collectOutputEntries(output) {
|
|
1658
|
+
return output.map((chunk) => ({
|
|
1659
|
+
type: chunk.type,
|
|
1660
|
+
fileName: chunk.fileName,
|
|
1661
|
+
size: chunk.type === "chunk" ? Buffer.byteLength(chunk.code) : Buffer.byteLength(chunk.source)
|
|
1662
|
+
}));
|
|
1663
|
+
}
|
|
1664
|
+
function collectOutputLayoutAdjustmentSizes(entries) {
|
|
1665
|
+
let longest = 0;
|
|
1666
|
+
let biggestSize = 0;
|
|
1667
|
+
for (const entry of entries) {
|
|
1668
|
+
if (entry.fileName.length > longest) longest = entry.fileName.length;
|
|
1669
|
+
if (entry.size > biggestSize) biggestSize = entry.size;
|
|
1670
|
+
}
|
|
1671
|
+
const sizePad = displaySize(biggestSize).length;
|
|
1672
|
+
return {
|
|
1673
|
+
longest,
|
|
1674
|
+
biggestSize,
|
|
1675
|
+
sizePad
|
|
1676
|
+
};
|
|
1677
|
+
}
|
|
1678
|
+
function displaySize(bytes) {
|
|
1679
|
+
return `${numberFormatter.format(bytes / 1e3)} kB`;
|
|
1680
|
+
}
|
|
1681
|
+
function printOutputEntries(entries, sizeAdjustment, distPath) {
|
|
1682
|
+
for (const group of CHUNK_GROUPS) {
|
|
1683
|
+
const filtered = entries.filter((e) => e.type === group.type);
|
|
1684
|
+
if (!filtered.length) continue;
|
|
1685
|
+
for (const entry of filtered.sort((a$1, z) => a$1.size - z.size)) {
|
|
1686
|
+
let log = colors.dim(withTrailingSlash(distPath));
|
|
1687
|
+
log += colors[group.color](entry.fileName.padEnd(sizeAdjustment.longest + 2));
|
|
1688
|
+
log += colors.dim(entry.type);
|
|
1689
|
+
log += colors.dim(` │ size: ${displaySize(entry.size).padStart(sizeAdjustment.sizePad)}`);
|
|
1690
|
+
logger.log(log);
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
function withTrailingSlash(path$1) {
|
|
1695
|
+
if (path$1[path$1.length - 1] !== "/") return `${path$1}/`;
|
|
1696
|
+
return path$1;
|
|
1697
|
+
}
|
|
1698
|
+
function ms(duration) {
|
|
1699
|
+
return duration < 1e3 ? `${duration.toFixed(2)} ms` : `${(duration / 1e3).toFixed(2)} s`;
|
|
1700
|
+
}
|
|
1701
|
+
function relativeId(id) {
|
|
1702
|
+
if (!path.isAbsolute(id)) return id;
|
|
1703
|
+
return path.relative(path.resolve(), id);
|
|
1704
|
+
}
|
|
1705
|
+
var numberFormatter, CHUNK_GROUPS;
|
|
1706
|
+
var init_bundle = __esm({ "src/cli/commands/bundle.ts"() {
|
|
1707
|
+
init_mjs();
|
|
1708
|
+
init_rolldown();
|
|
1709
|
+
init_watch();
|
|
1710
|
+
init_misc();
|
|
1711
|
+
init_load_config();
|
|
1712
|
+
init_logger();
|
|
1713
|
+
numberFormatter = new Intl.NumberFormat("en", {
|
|
1714
|
+
maximumFractionDigits: 2,
|
|
1715
|
+
minimumFractionDigits: 2
|
|
1716
|
+
});
|
|
1717
|
+
CHUNK_GROUPS = [{
|
|
1718
|
+
type: "asset",
|
|
1719
|
+
color: "green"
|
|
1720
|
+
}, {
|
|
1721
|
+
type: "chunk",
|
|
1722
|
+
color: "cyan"
|
|
1723
|
+
}];
|
|
1724
|
+
} });
|
|
1725
|
+
|
|
1726
|
+
//#endregion
|
|
1727
|
+
//#region src/cli/commands/help.ts
|
|
1728
|
+
function showHelp() {
|
|
1729
|
+
logger.log(introduction);
|
|
1730
|
+
logger.log("");
|
|
1731
|
+
logger.log(`${colors.bold(colors.underline("OPTIONS"))}`);
|
|
1732
|
+
logger.log("");
|
|
1733
|
+
logger.log(Object.entries(options).sort(([a$1], [b$1]) => {
|
|
1734
|
+
if (options[a$1].short && !options[b$1].short) return -1;
|
|
1735
|
+
if (!options[a$1].short && options[b$1].short) return 1;
|
|
1736
|
+
if (options[a$1].short && options[b$1].short) return options[a$1].short.localeCompare(options[b$1].short);
|
|
1737
|
+
return a$1.localeCompare(b$1);
|
|
1738
|
+
}).map(([option, { type, short, hint, description: description$1 }]) => {
|
|
1739
|
+
let optionStr = ` --${option} `;
|
|
1740
|
+
option = camelCaseToKebabCase(option);
|
|
1741
|
+
if (short) optionStr += `-${short}, `;
|
|
1742
|
+
if (type === "string") optionStr += `<${hint ?? option}>`;
|
|
1743
|
+
if (description$1 && description$1.length > 0) description$1 = description$1[0].toUpperCase() + description$1.slice(1);
|
|
1744
|
+
return colors.cyan(optionStr.padEnd(30)) + description$1 + (description$1 && description$1?.endsWith(".") ? "" : ".");
|
|
1745
|
+
}).join("\n"));
|
|
1746
|
+
logger.log("");
|
|
1747
|
+
logger.log(`${colors.bold(colors.underline("EXAMPLES"))}`);
|
|
1748
|
+
logger.log("");
|
|
1749
|
+
examples.forEach(({ title, command }, ord) => {
|
|
1750
|
+
logger.log(` ${ord + 1}. ${title}:`);
|
|
1751
|
+
logger.log(` ${colors.cyan(command)}`);
|
|
1752
|
+
logger.log("");
|
|
1753
|
+
});
|
|
1754
|
+
logger.log(`${colors.bold(colors.underline("NOTES"))}`);
|
|
1755
|
+
logger.log("");
|
|
1756
|
+
notes.forEach((note) => {
|
|
1757
|
+
logger.log(` * ${colors.gray(note)}`);
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
var introduction, examples, notes;
|
|
1761
|
+
var init_help = __esm({ "src/cli/commands/help.ts"() {
|
|
1762
|
+
init_arguments();
|
|
1763
|
+
init_utils();
|
|
1764
|
+
init_logger();
|
|
1765
|
+
introduction = `${colors.gray(`${description} (rolldown v${version})`)}
|
|
1766
|
+
|
|
1767
|
+
${colors.bold(colors.underline("USAGE"))} ${colors.cyan("rolldown -c <config>")} or ${colors.cyan("rolldown <input> <options>")}`;
|
|
1768
|
+
examples = [
|
|
1769
|
+
{
|
|
1770
|
+
title: "Bundle with a config file `rolldown.config.mjs`",
|
|
1771
|
+
command: "rolldown -c rolldown.config.mjs"
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
title: "Bundle the `src/main.ts` to `dist` with `cjs` format",
|
|
1775
|
+
command: "rolldown src/main.ts -d dist -f cjs"
|
|
1776
|
+
},
|
|
1777
|
+
{
|
|
1778
|
+
title: "Bundle the `src/main.ts` and handle the `.png` assets to Data URL",
|
|
1779
|
+
command: "rolldown src/main.ts -d dist --moduleTypes .png=dataurl"
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
title: "Bundle the `src/main.tsx` and minify the output with sourcemap",
|
|
1783
|
+
command: "rolldown src/main.tsx -d dist -m -s"
|
|
1784
|
+
},
|
|
1785
|
+
{
|
|
1786
|
+
title: "Create self-executing IIFE using external jQuery as `$` and `_`",
|
|
1787
|
+
command: "rolldown src/main.ts -d dist -n bundle -f iife -e jQuery,window._ -g jQuery=$"
|
|
1788
|
+
}
|
|
1789
|
+
];
|
|
1790
|
+
notes = [
|
|
1791
|
+
"Due to the API limitation, you need to pass `-s` for `.map` sourcemap file as the last argument.",
|
|
1792
|
+
"If you are using the configuration, please pass the `-c` as the last argument if you ignore the default configuration file.",
|
|
1793
|
+
"CLI options will override the configuration file.",
|
|
1794
|
+
"For more information, please visit https://rolldown.rs/."
|
|
1795
|
+
];
|
|
1796
|
+
} });
|
|
1797
|
+
|
|
1798
|
+
//#endregion
|
|
1799
|
+
//#region src/cli/index.ts
|
|
1800
|
+
var require_cli = __commonJS({ "src/cli/index.ts"() {
|
|
1801
|
+
init_arguments();
|
|
1802
|
+
init_bundle();
|
|
1803
|
+
init_help();
|
|
1804
|
+
init_logger();
|
|
1805
|
+
async function main() {
|
|
1806
|
+
const cliOptions = parseCliArguments();
|
|
1807
|
+
if (cliOptions.config || cliOptions.config === "") {
|
|
1808
|
+
await bundleWithConfig(cliOptions.config, cliOptions);
|
|
1809
|
+
return;
|
|
1810
|
+
}
|
|
1811
|
+
if ("input" in cliOptions.input) {
|
|
1812
|
+
await bundleWithCliOptions(cliOptions);
|
|
1813
|
+
return;
|
|
1814
|
+
}
|
|
1815
|
+
if (cliOptions.version) {
|
|
1816
|
+
logger.log(`rolldown v${version}`);
|
|
1817
|
+
return;
|
|
1818
|
+
}
|
|
1819
|
+
showHelp();
|
|
1820
|
+
}
|
|
1821
|
+
main().catch((err) => {
|
|
1822
|
+
logger.error(err);
|
|
1823
|
+
process$1.exit(1);
|
|
1824
|
+
});
|
|
1825
|
+
} });
|
|
1826
|
+
|
|
1827
|
+
//#endregion
|
|
1828
|
+
export default require_cli();
|