rolldown 1.0.0-beta.1-commit.1d4a330 → 1.0.0-beta.1-commit.298dd8b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli.cjs +32 -33
- package/dist/cjs/experimental-index.cjs +4 -2
- package/dist/cjs/index.cjs +2 -1
- package/dist/cjs/parallel-plugin-worker.cjs +3 -2
- package/dist/cjs/parse-ast-index.cjs +59 -0
- package/dist/esm/cli.mjs +16 -17
- package/dist/esm/experimental-index.mjs +3 -2
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/parallel-plugin-worker.mjs +2 -1
- package/dist/esm/parse-ast-index.mjs +56 -0
- package/dist/shared/binding-D5MBYAdC.cjs +660 -0
- package/dist/shared/binding-DLjQWzkm.mjs +609 -0
- package/dist/shared/{consola_36c0034f-rAZL9aWp.mjs → consola_36c0034f-Cx52UqEq.mjs} +2 -2
- package/dist/shared/{consola_36c0034f-CnRr1OYk.cjs → consola_36c0034f-CynBWXXO.cjs} +2 -2
- package/dist/shared/{prompt-CvISMk2k.cjs → prompt-B58MxVuU.cjs} +2 -2
- package/dist/shared/{prompt-BN0wKILJ.mjs → prompt-DjjlOckE.mjs} +1 -1
- package/dist/shared/{src-B7GNdu2r.cjs → src-BYsFiN-a.cjs} +403 -960
- package/dist/shared/{src-BKtzXvhI.mjs → src-BiKHJ1rU.mjs} +374 -953
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/binding.d.ts +257 -5
- package/dist/types/builtin-plugin/constructors.d.ts +5 -1
- package/dist/types/experimental-index.d.ts +1 -1
- package/dist/types/log/logs.d.ts +1 -0
- package/dist/types/parse-ast-index.d.ts +4 -0
- package/dist/types/plugin/plugin-context.d.ts +8 -1
- package/dist/types/plugin/plugin-driver.d.ts +2 -2
- package/package.json +21 -15
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
import { createRequire } from "module";
|
|
2
|
+
import { env } from "node:process";
|
|
3
|
+
import * as tty from "tty";
|
|
4
|
+
|
|
5
|
+
//#region rolldown:runtime
|
|
6
|
+
var __create = Object.create;
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __commonJS = (cb, mod) => function() {
|
|
13
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
|
+
key = keys[i];
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: ((k) => from[k]).bind(null, key),
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
28
|
+
}) : target, mod));
|
|
29
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/utils/code-frame.ts
|
|
33
|
+
function spaces(index) {
|
|
34
|
+
let result = "";
|
|
35
|
+
while (index--) result += " ";
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
function tabsToSpaces(value) {
|
|
39
|
+
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
40
|
+
}
|
|
41
|
+
const LINE_TRUNCATE_LENGTH = 120;
|
|
42
|
+
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
43
|
+
const ELLIPSIS = "...";
|
|
44
|
+
function getCodeFrame(source, line, column) {
|
|
45
|
+
let lines = source.split("\n");
|
|
46
|
+
if (line > lines.length) return "";
|
|
47
|
+
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + ELLIPSIS.length, LINE_TRUNCATE_LENGTH);
|
|
48
|
+
const frameStart = Math.max(0, line - 3);
|
|
49
|
+
let frameEnd = Math.min(line + 2, lines.length);
|
|
50
|
+
lines = lines.slice(frameStart, frameEnd);
|
|
51
|
+
while (!/\S/.test(lines[lines.length - 1])) {
|
|
52
|
+
lines.pop();
|
|
53
|
+
frameEnd -= 1;
|
|
54
|
+
}
|
|
55
|
+
const digits = String(frameEnd).length;
|
|
56
|
+
return lines.map((sourceLine, index) => {
|
|
57
|
+
const isErrorLine = frameStart + index + 1 === line;
|
|
58
|
+
let lineNumber = String(index + frameStart + 1);
|
|
59
|
+
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
|
|
60
|
+
let displayedLine = tabsToSpaces(sourceLine);
|
|
61
|
+
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`;
|
|
62
|
+
if (isErrorLine) {
|
|
63
|
+
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
|
|
64
|
+
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
|
65
|
+
}
|
|
66
|
+
return `${lineNumber}: ${displayedLine}`;
|
|
67
|
+
}).join("\n");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/log/locate-character/index.js
|
|
72
|
+
/** @typedef {import('./types').Location} Location */
|
|
73
|
+
/**
|
|
74
|
+
* @param {import('./types').Range} range
|
|
75
|
+
* @param {number} index
|
|
76
|
+
*/
|
|
77
|
+
function rangeContains(range, index) {
|
|
78
|
+
return range.start <= index && index < range.end;
|
|
79
|
+
}
|
|
80
|
+
function getLocator(source, options = {}) {
|
|
81
|
+
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
82
|
+
let start = 0;
|
|
83
|
+
const ranges = source.split("\n").map((line, i$1) => {
|
|
84
|
+
const end = start + line.length + 1;
|
|
85
|
+
/** @type {import('./types').Range} */
|
|
86
|
+
const range = {
|
|
87
|
+
start,
|
|
88
|
+
end,
|
|
89
|
+
line: i$1
|
|
90
|
+
};
|
|
91
|
+
start = end;
|
|
92
|
+
return range;
|
|
93
|
+
});
|
|
94
|
+
let i = 0;
|
|
95
|
+
/**
|
|
96
|
+
* @param {string | number} search
|
|
97
|
+
* @param {number} [index]
|
|
98
|
+
* @returns {Location | undefined}
|
|
99
|
+
*/
|
|
100
|
+
function locator(search, index) {
|
|
101
|
+
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
102
|
+
if (search === -1) return undefined;
|
|
103
|
+
let range = ranges[i];
|
|
104
|
+
const d = search >= range.end ? 1 : -1;
|
|
105
|
+
while (range) {
|
|
106
|
+
if (rangeContains(range, search)) return {
|
|
107
|
+
line: offsetLine + range.line,
|
|
108
|
+
column: offsetColumn + search - range.start,
|
|
109
|
+
character: search
|
|
110
|
+
};
|
|
111
|
+
i += d;
|
|
112
|
+
range = ranges[i];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return locator;
|
|
116
|
+
}
|
|
117
|
+
function locate(source, search, options) {
|
|
118
|
+
return getLocator(source, options)(search, options && options.startIndex);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
|
|
123
|
+
const { env: env$1 = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
124
|
+
const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
|
|
125
|
+
const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
|
|
126
|
+
const isWindows = platform === "win32";
|
|
127
|
+
const isDumbTerminal = env$1.TERM === "dumb";
|
|
128
|
+
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
|
|
129
|
+
const isCI = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
|
|
130
|
+
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
131
|
+
const replaceClose = (index, string, close, replace, head = string.substring(0, index) + replace, tail = string.substring(index + close.length), next = tail.indexOf(close)) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
132
|
+
const clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
133
|
+
const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
134
|
+
const init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
135
|
+
const colors$1 = {
|
|
136
|
+
reset: init(0, 0),
|
|
137
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
138
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
139
|
+
italic: init(3, 23),
|
|
140
|
+
underline: init(4, 24),
|
|
141
|
+
inverse: init(7, 27),
|
|
142
|
+
hidden: init(8, 28),
|
|
143
|
+
strikethrough: init(9, 29),
|
|
144
|
+
black: init(30, 39),
|
|
145
|
+
red: init(31, 39),
|
|
146
|
+
green: init(32, 39),
|
|
147
|
+
yellow: init(33, 39),
|
|
148
|
+
blue: init(34, 39),
|
|
149
|
+
magenta: init(35, 39),
|
|
150
|
+
cyan: init(36, 39),
|
|
151
|
+
white: init(37, 39),
|
|
152
|
+
gray: init(90, 39),
|
|
153
|
+
bgBlack: init(40, 49),
|
|
154
|
+
bgRed: init(41, 49),
|
|
155
|
+
bgGreen: init(42, 49),
|
|
156
|
+
bgYellow: init(43, 49),
|
|
157
|
+
bgBlue: init(44, 49),
|
|
158
|
+
bgMagenta: init(45, 49),
|
|
159
|
+
bgCyan: init(46, 49),
|
|
160
|
+
bgWhite: init(47, 49),
|
|
161
|
+
blackBright: init(90, 39),
|
|
162
|
+
redBright: init(91, 39),
|
|
163
|
+
greenBright: init(92, 39),
|
|
164
|
+
yellowBright: init(93, 39),
|
|
165
|
+
blueBright: init(94, 39),
|
|
166
|
+
magentaBright: init(95, 39),
|
|
167
|
+
cyanBright: init(96, 39),
|
|
168
|
+
whiteBright: init(97, 39),
|
|
169
|
+
bgBlackBright: init(100, 49),
|
|
170
|
+
bgRedBright: init(101, 49),
|
|
171
|
+
bgGreenBright: init(102, 49),
|
|
172
|
+
bgYellowBright: init(103, 49),
|
|
173
|
+
bgBlueBright: init(104, 49),
|
|
174
|
+
bgMagentaBright: init(105, 49),
|
|
175
|
+
bgCyanBright: init(106, 49),
|
|
176
|
+
bgWhiteBright: init(107, 49)
|
|
177
|
+
};
|
|
178
|
+
const createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors$1 : Object.keys(colors$1).reduce((colors$2, key) => ({
|
|
179
|
+
...colors$2,
|
|
180
|
+
[key]: String
|
|
181
|
+
}), {});
|
|
182
|
+
const { reset, bold: bold$1, dim: dim$1, italic, underline: underline$1, inverse, hidden, strikethrough, black, red: red$1, green: green$1, yellow: yellow$1, blue, magenta, cyan: cyan$1, white, gray: gray$1, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = createColors();
|
|
183
|
+
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/cli/colors.ts
|
|
186
|
+
const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ useColor: env.FORCE_COLOR !== "0" && !env.NO_COLOR });
|
|
187
|
+
const colors = {
|
|
188
|
+
bold,
|
|
189
|
+
cyan,
|
|
190
|
+
dim,
|
|
191
|
+
gray,
|
|
192
|
+
green,
|
|
193
|
+
red,
|
|
194
|
+
underline,
|
|
195
|
+
yellow
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/log/logs.ts
|
|
200
|
+
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", MINIFY_WARNING = "MINIFY_WARNING", PARSE_ERROR = "PARSE_ERROR";
|
|
201
|
+
function logParseError(message) {
|
|
202
|
+
return {
|
|
203
|
+
code: PARSE_ERROR,
|
|
204
|
+
message
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function logMinifyWarning() {
|
|
208
|
+
return {
|
|
209
|
+
code: MINIFY_WARNING,
|
|
210
|
+
message: colors.yellow("The built-in minifier is still under development. Setting \"minify: true\" is not recommended for production use.")
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function logInvalidLogPosition(pluginName) {
|
|
214
|
+
return {
|
|
215
|
+
code: INVALID_LOG_POSITION,
|
|
216
|
+
message: `Plugin "${pluginName}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function logInputHookInOutputPlugin(pluginName, hookName) {
|
|
220
|
+
return {
|
|
221
|
+
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
|
222
|
+
message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function logCycleLoading(pluginName, moduleId) {
|
|
226
|
+
return {
|
|
227
|
+
code: CYCLE_LOADING,
|
|
228
|
+
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function logMultiplyNotifyOption() {
|
|
232
|
+
return {
|
|
233
|
+
code: MULTIPLY_NOTIFY_OPTION,
|
|
234
|
+
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function logPluginError(error$1, plugin, { hook, id } = {}) {
|
|
238
|
+
const code = error$1.code;
|
|
239
|
+
if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
|
|
240
|
+
error$1.code = PLUGIN_ERROR;
|
|
241
|
+
error$1.plugin = plugin;
|
|
242
|
+
if (hook) error$1.hook = hook;
|
|
243
|
+
if (id) error$1.id = id;
|
|
244
|
+
return error$1;
|
|
245
|
+
}
|
|
246
|
+
function error(base) {
|
|
247
|
+
if (!(base instanceof Error)) {
|
|
248
|
+
base = Object.assign(new Error(base.message), base);
|
|
249
|
+
Object.defineProperty(base, "name", {
|
|
250
|
+
value: "RollupError",
|
|
251
|
+
writable: true
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
throw base;
|
|
255
|
+
}
|
|
256
|
+
function augmentCodeLocation(properties, pos, source, id) {
|
|
257
|
+
if (typeof pos === "object") {
|
|
258
|
+
const { line, column } = pos;
|
|
259
|
+
properties.loc = {
|
|
260
|
+
column,
|
|
261
|
+
file: id,
|
|
262
|
+
line
|
|
263
|
+
};
|
|
264
|
+
} else {
|
|
265
|
+
properties.pos = pos;
|
|
266
|
+
const location = locate(source, pos, { offsetLine: 1 });
|
|
267
|
+
if (!location) return;
|
|
268
|
+
const { line, column } = location;
|
|
269
|
+
properties.loc = {
|
|
270
|
+
column,
|
|
271
|
+
file: id,
|
|
272
|
+
line
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
if (properties.frame === undefined) {
|
|
276
|
+
const { line, column } = properties.loc;
|
|
277
|
+
properties.frame = getCodeFrame(source, line, column);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/binding.js
|
|
283
|
+
var require_binding = __commonJS({ "src/binding.js"(exports, module) {
|
|
284
|
+
const { createRequire: createRequire$1 } = __require("node:module");
|
|
285
|
+
const { readFileSync } = __require("node:fs");
|
|
286
|
+
let nativeBinding = null;
|
|
287
|
+
const loadErrors = [];
|
|
288
|
+
const isMusl = () => {
|
|
289
|
+
let musl = false;
|
|
290
|
+
if (process.platform === "linux") {
|
|
291
|
+
musl = isMuslFromFilesystem();
|
|
292
|
+
if (musl === null) musl = isMuslFromReport();
|
|
293
|
+
if (musl === null) musl = isMuslFromChildProcess();
|
|
294
|
+
}
|
|
295
|
+
return musl;
|
|
296
|
+
};
|
|
297
|
+
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
298
|
+
const isMuslFromFilesystem = () => {
|
|
299
|
+
try {
|
|
300
|
+
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
|
|
301
|
+
} catch {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
const isMuslFromReport = () => {
|
|
306
|
+
const report = typeof process.report.getReport === "function" ? process.report.getReport() : null;
|
|
307
|
+
if (!report) return null;
|
|
308
|
+
if (report.header && report.header.glibcVersionRuntime) return false;
|
|
309
|
+
if (Array.isArray(report.sharedObjects)) {
|
|
310
|
+
if (report.sharedObjects.some(isFileMusl)) return true;
|
|
311
|
+
}
|
|
312
|
+
return false;
|
|
313
|
+
};
|
|
314
|
+
const isMuslFromChildProcess = () => {
|
|
315
|
+
try {
|
|
316
|
+
return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
|
|
317
|
+
} catch (e) {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
function requireNative() {
|
|
322
|
+
if (process.platform === "android") if (process.arch === "arm64") {
|
|
323
|
+
try {
|
|
324
|
+
return __require("./rolldown-binding.android-arm64.node");
|
|
325
|
+
} catch (e) {
|
|
326
|
+
loadErrors.push(e);
|
|
327
|
+
}
|
|
328
|
+
try {
|
|
329
|
+
return __require("@rolldown/binding-android-arm64");
|
|
330
|
+
} catch (e) {
|
|
331
|
+
loadErrors.push(e);
|
|
332
|
+
}
|
|
333
|
+
} else if (process.arch === "arm") {
|
|
334
|
+
try {
|
|
335
|
+
return __require("./rolldown-binding.android-arm-eabi.node");
|
|
336
|
+
} catch (e) {
|
|
337
|
+
loadErrors.push(e);
|
|
338
|
+
}
|
|
339
|
+
try {
|
|
340
|
+
return __require("@rolldown/binding-android-arm-eabi");
|
|
341
|
+
} catch (e) {
|
|
342
|
+
loadErrors.push(e);
|
|
343
|
+
}
|
|
344
|
+
} else loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
345
|
+
else if (process.platform === "win32") if (process.arch === "x64") {
|
|
346
|
+
try {
|
|
347
|
+
return __require("./rolldown-binding.win32-x64-msvc.node");
|
|
348
|
+
} catch (e) {
|
|
349
|
+
loadErrors.push(e);
|
|
350
|
+
}
|
|
351
|
+
try {
|
|
352
|
+
return __require("@rolldown/binding-win32-x64-msvc");
|
|
353
|
+
} catch (e) {
|
|
354
|
+
loadErrors.push(e);
|
|
355
|
+
}
|
|
356
|
+
} else if (process.arch === "ia32") {
|
|
357
|
+
try {
|
|
358
|
+
return __require("./rolldown-binding.win32-ia32-msvc.node");
|
|
359
|
+
} catch (e) {
|
|
360
|
+
loadErrors.push(e);
|
|
361
|
+
}
|
|
362
|
+
try {
|
|
363
|
+
return __require("@rolldown/binding-win32-ia32-msvc");
|
|
364
|
+
} catch (e) {
|
|
365
|
+
loadErrors.push(e);
|
|
366
|
+
}
|
|
367
|
+
} else if (process.arch === "arm64") {
|
|
368
|
+
try {
|
|
369
|
+
return __require("./rolldown-binding.win32-arm64-msvc.node");
|
|
370
|
+
} catch (e) {
|
|
371
|
+
loadErrors.push(e);
|
|
372
|
+
}
|
|
373
|
+
try {
|
|
374
|
+
return __require("@rolldown/binding-win32-arm64-msvc");
|
|
375
|
+
} catch (e) {
|
|
376
|
+
loadErrors.push(e);
|
|
377
|
+
}
|
|
378
|
+
} else loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
379
|
+
else if (process.platform === "darwin") {
|
|
380
|
+
try {
|
|
381
|
+
return __require("./rolldown-binding.darwin-universal.node");
|
|
382
|
+
} catch (e) {
|
|
383
|
+
loadErrors.push(e);
|
|
384
|
+
}
|
|
385
|
+
try {
|
|
386
|
+
return __require("@rolldown/binding-darwin-universal");
|
|
387
|
+
} catch (e) {
|
|
388
|
+
loadErrors.push(e);
|
|
389
|
+
}
|
|
390
|
+
if (process.arch === "x64") {
|
|
391
|
+
try {
|
|
392
|
+
return __require("./rolldown-binding.darwin-x64.node");
|
|
393
|
+
} catch (e) {
|
|
394
|
+
loadErrors.push(e);
|
|
395
|
+
}
|
|
396
|
+
try {
|
|
397
|
+
return __require("@rolldown/binding-darwin-x64");
|
|
398
|
+
} catch (e) {
|
|
399
|
+
loadErrors.push(e);
|
|
400
|
+
}
|
|
401
|
+
} else if (process.arch === "arm64") {
|
|
402
|
+
try {
|
|
403
|
+
return __require("./rolldown-binding.darwin-arm64.node");
|
|
404
|
+
} catch (e) {
|
|
405
|
+
loadErrors.push(e);
|
|
406
|
+
}
|
|
407
|
+
try {
|
|
408
|
+
return __require("@rolldown/binding-darwin-arm64");
|
|
409
|
+
} catch (e) {
|
|
410
|
+
loadErrors.push(e);
|
|
411
|
+
}
|
|
412
|
+
} else loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
413
|
+
} else if (process.platform === "freebsd") if (process.arch === "x64") {
|
|
414
|
+
try {
|
|
415
|
+
return __require("./rolldown-binding.freebsd-x64.node");
|
|
416
|
+
} catch (e) {
|
|
417
|
+
loadErrors.push(e);
|
|
418
|
+
}
|
|
419
|
+
try {
|
|
420
|
+
return __require("@rolldown/binding-freebsd-x64");
|
|
421
|
+
} catch (e) {
|
|
422
|
+
loadErrors.push(e);
|
|
423
|
+
}
|
|
424
|
+
} else if (process.arch === "arm64") {
|
|
425
|
+
try {
|
|
426
|
+
return __require("./rolldown-binding.freebsd-arm64.node");
|
|
427
|
+
} catch (e) {
|
|
428
|
+
loadErrors.push(e);
|
|
429
|
+
}
|
|
430
|
+
try {
|
|
431
|
+
return __require("@rolldown/binding-freebsd-arm64");
|
|
432
|
+
} catch (e) {
|
|
433
|
+
loadErrors.push(e);
|
|
434
|
+
}
|
|
435
|
+
} else loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
436
|
+
else if (process.platform === "linux") if (process.arch === "x64") if (isMusl()) {
|
|
437
|
+
try {
|
|
438
|
+
return __require("./rolldown-binding.linux-x64-musl.node");
|
|
439
|
+
} catch (e) {
|
|
440
|
+
loadErrors.push(e);
|
|
441
|
+
}
|
|
442
|
+
try {
|
|
443
|
+
return __require("@rolldown/binding-linux-x64-musl");
|
|
444
|
+
} catch (e) {
|
|
445
|
+
loadErrors.push(e);
|
|
446
|
+
}
|
|
447
|
+
} else {
|
|
448
|
+
try {
|
|
449
|
+
return __require("./rolldown-binding.linux-x64-gnu.node");
|
|
450
|
+
} catch (e) {
|
|
451
|
+
loadErrors.push(e);
|
|
452
|
+
}
|
|
453
|
+
try {
|
|
454
|
+
return __require("@rolldown/binding-linux-x64-gnu");
|
|
455
|
+
} catch (e) {
|
|
456
|
+
loadErrors.push(e);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
else if (process.arch === "arm64") if (isMusl()) {
|
|
460
|
+
try {
|
|
461
|
+
return __require("./rolldown-binding.linux-arm64-musl.node");
|
|
462
|
+
} catch (e) {
|
|
463
|
+
loadErrors.push(e);
|
|
464
|
+
}
|
|
465
|
+
try {
|
|
466
|
+
return __require("@rolldown/binding-linux-arm64-musl");
|
|
467
|
+
} catch (e) {
|
|
468
|
+
loadErrors.push(e);
|
|
469
|
+
}
|
|
470
|
+
} else {
|
|
471
|
+
try {
|
|
472
|
+
return __require("./rolldown-binding.linux-arm64-gnu.node");
|
|
473
|
+
} catch (e) {
|
|
474
|
+
loadErrors.push(e);
|
|
475
|
+
}
|
|
476
|
+
try {
|
|
477
|
+
return __require("@rolldown/binding-linux-arm64-gnu");
|
|
478
|
+
} catch (e) {
|
|
479
|
+
loadErrors.push(e);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
else if (process.arch === "arm") if (isMusl()) {
|
|
483
|
+
try {
|
|
484
|
+
return __require("./rolldown-binding.linux-arm-musleabihf.node");
|
|
485
|
+
} catch (e) {
|
|
486
|
+
loadErrors.push(e);
|
|
487
|
+
}
|
|
488
|
+
try {
|
|
489
|
+
return __require("@rolldown/binding-linux-arm-musleabihf");
|
|
490
|
+
} catch (e) {
|
|
491
|
+
loadErrors.push(e);
|
|
492
|
+
}
|
|
493
|
+
} else {
|
|
494
|
+
try {
|
|
495
|
+
return __require("./rolldown-binding.linux-arm-gnueabihf.node");
|
|
496
|
+
} catch (e) {
|
|
497
|
+
loadErrors.push(e);
|
|
498
|
+
}
|
|
499
|
+
try {
|
|
500
|
+
return __require("@rolldown/binding-linux-arm-gnueabihf");
|
|
501
|
+
} catch (e) {
|
|
502
|
+
loadErrors.push(e);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
else if (process.arch === "riscv64") if (isMusl()) {
|
|
506
|
+
try {
|
|
507
|
+
return __require("./rolldown-binding.linux-riscv64-musl.node");
|
|
508
|
+
} catch (e) {
|
|
509
|
+
loadErrors.push(e);
|
|
510
|
+
}
|
|
511
|
+
try {
|
|
512
|
+
return __require("@rolldown/binding-linux-riscv64-musl");
|
|
513
|
+
} catch (e) {
|
|
514
|
+
loadErrors.push(e);
|
|
515
|
+
}
|
|
516
|
+
} else {
|
|
517
|
+
try {
|
|
518
|
+
return __require("./rolldown-binding.linux-riscv64-gnu.node");
|
|
519
|
+
} catch (e) {
|
|
520
|
+
loadErrors.push(e);
|
|
521
|
+
}
|
|
522
|
+
try {
|
|
523
|
+
return __require("@rolldown/binding-linux-riscv64-gnu");
|
|
524
|
+
} catch (e) {
|
|
525
|
+
loadErrors.push(e);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
else if (process.arch === "ppc64") {
|
|
529
|
+
try {
|
|
530
|
+
return __require("./rolldown-binding.linux-ppc64-gnu.node");
|
|
531
|
+
} catch (e) {
|
|
532
|
+
loadErrors.push(e);
|
|
533
|
+
}
|
|
534
|
+
try {
|
|
535
|
+
return __require("@rolldown/binding-linux-ppc64-gnu");
|
|
536
|
+
} catch (e) {
|
|
537
|
+
loadErrors.push(e);
|
|
538
|
+
}
|
|
539
|
+
} else if (process.arch === "s390x") {
|
|
540
|
+
try {
|
|
541
|
+
return __require("./rolldown-binding.linux-s390x-gnu.node");
|
|
542
|
+
} catch (e) {
|
|
543
|
+
loadErrors.push(e);
|
|
544
|
+
}
|
|
545
|
+
try {
|
|
546
|
+
return __require("@rolldown/binding-linux-s390x-gnu");
|
|
547
|
+
} catch (e) {
|
|
548
|
+
loadErrors.push(e);
|
|
549
|
+
}
|
|
550
|
+
} else loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
551
|
+
else loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
552
|
+
}
|
|
553
|
+
nativeBinding = requireNative();
|
|
554
|
+
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
555
|
+
try {
|
|
556
|
+
nativeBinding = __require("./rolldown-binding.wasi.cjs");
|
|
557
|
+
} catch (err) {
|
|
558
|
+
if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
|
|
559
|
+
}
|
|
560
|
+
if (!nativeBinding) try {
|
|
561
|
+
nativeBinding = __require("@rolldown/binding-wasm32-wasi");
|
|
562
|
+
} catch (err) {
|
|
563
|
+
if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
if (!nativeBinding) {
|
|
567
|
+
if (loadErrors.length > 0) throw new Error("Failed to load native binding", { cause: loadErrors });
|
|
568
|
+
throw new Error(`Failed to load native binding`);
|
|
569
|
+
}
|
|
570
|
+
module.exports.BindingBundleEndEventData = nativeBinding.BindingBundleEndEventData;
|
|
571
|
+
module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
|
|
572
|
+
module.exports.BindingError = nativeBinding.BindingError;
|
|
573
|
+
module.exports.BindingLog = nativeBinding.BindingLog;
|
|
574
|
+
module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
|
|
575
|
+
module.exports.BindingNormalizedOptions = nativeBinding.BindingNormalizedOptions;
|
|
576
|
+
module.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset;
|
|
577
|
+
module.exports.BindingOutputChunk = nativeBinding.BindingOutputChunk;
|
|
578
|
+
module.exports.BindingOutputs = nativeBinding.BindingOutputs;
|
|
579
|
+
module.exports.BindingPluginContext = nativeBinding.BindingPluginContext;
|
|
580
|
+
module.exports.BindingRenderedModule = nativeBinding.BindingRenderedModule;
|
|
581
|
+
module.exports.BindingTransformPluginContext = nativeBinding.BindingTransformPluginContext;
|
|
582
|
+
module.exports.BindingWatcher = nativeBinding.BindingWatcher;
|
|
583
|
+
module.exports.BindingWatcherChangeData = nativeBinding.BindingWatcherChangeData;
|
|
584
|
+
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
|
|
585
|
+
module.exports.Bundler = nativeBinding.Bundler;
|
|
586
|
+
module.exports.MagicString = nativeBinding.MagicString;
|
|
587
|
+
module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
|
|
588
|
+
module.exports.ParseResult = nativeBinding.ParseResult;
|
|
589
|
+
module.exports.RenderedChunk = nativeBinding.RenderedChunk;
|
|
590
|
+
module.exports.BindingBuiltinPluginName = nativeBinding.BindingBuiltinPluginName;
|
|
591
|
+
module.exports.BindingHookSideEffects = nativeBinding.BindingHookSideEffects;
|
|
592
|
+
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
|
|
593
|
+
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
|
|
594
|
+
module.exports.ExportExportNameKind = nativeBinding.ExportExportNameKind;
|
|
595
|
+
module.exports.ExportImportNameKind = nativeBinding.ExportImportNameKind;
|
|
596
|
+
module.exports.ExportLocalNameKind = nativeBinding.ExportLocalNameKind;
|
|
597
|
+
module.exports.HelperMode = nativeBinding.HelperMode;
|
|
598
|
+
module.exports.ImportNameKind = nativeBinding.ImportNameKind;
|
|
599
|
+
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
|
|
600
|
+
module.exports.parseAsync = nativeBinding.parseAsync;
|
|
601
|
+
module.exports.parseSync = nativeBinding.parseSync;
|
|
602
|
+
module.exports.parseWithoutReturn = nativeBinding.parseWithoutReturn;
|
|
603
|
+
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
604
|
+
module.exports.Severity = nativeBinding.Severity;
|
|
605
|
+
module.exports.transform = nativeBinding.transform;
|
|
606
|
+
} });
|
|
607
|
+
|
|
608
|
+
//#endregion
|
|
609
|
+
export { __toESM, augmentCodeLocation, colors, error, getCodeFrame, locate, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logParseError, logPluginError, require_binding };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { sep } from "node:path";
|
|
2
1
|
import process$1 from "node:process";
|
|
2
|
+
import { sep } from "node:path";
|
|
3
3
|
import { formatWithOptions } from "node:util";
|
|
4
4
|
import * as tty from "node:tty";
|
|
5
5
|
|
|
@@ -815,7 +815,7 @@ function createConsola(options = {}) {
|
|
|
815
815
|
defaults: { level },
|
|
816
816
|
stdout: process.stdout,
|
|
817
817
|
stderr: process.stderr,
|
|
818
|
-
prompt: (...args) => import("./prompt-
|
|
818
|
+
prompt: (...args) => import("./prompt-DjjlOckE.mjs").then((m) => m.prompt(...args)),
|
|
819
819
|
reporters: options.reporters || [options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()],
|
|
820
820
|
...options
|
|
821
821
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
|
-
const node_path = require_chunk.__toESM(require("node:path"));
|
|
4
3
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
4
|
+
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
6
6
|
const node_tty = require_chunk.__toESM(require("node:tty"));
|
|
7
7
|
|
|
@@ -818,7 +818,7 @@ function createConsola(options = {}) {
|
|
|
818
818
|
stdout: process.stdout,
|
|
819
819
|
stderr: process.stderr,
|
|
820
820
|
prompt: (...args) => Promise.resolve().then(function() {
|
|
821
|
-
return require("./prompt-
|
|
821
|
+
return require("./prompt-B58MxVuU.cjs");
|
|
822
822
|
}).then((m) => m.prompt(...args)),
|
|
823
823
|
reporters: options.reporters || [options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()],
|
|
824
824
|
...options
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_consola_36c0034f = require('./consola_36c0034f-
|
|
4
|
-
const node_path = require_chunk.__toESM(require("node:path"));
|
|
3
|
+
const require_consola_36c0034f = require('./consola_36c0034f-CynBWXXO.cjs');
|
|
5
4
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
6
5
|
const tty = require_chunk.__toESM(require("tty"));
|
|
6
|
+
const node_path = require_chunk.__toESM(require("node:path"));
|
|
7
7
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
8
8
|
const node_tty = require_chunk.__toESM(require("node:tty"));
|
|
9
9
|
const node_readline = require_chunk.__toESM(require("node:readline"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colors$1 as colors, getDefaultExportFromCjs, isUnicodeSupported } from "./consola_36c0034f-
|
|
1
|
+
import { colors$1 as colors, getDefaultExportFromCjs, isUnicodeSupported } from "./consola_36c0034f-Cx52UqEq.mjs";
|
|
2
2
|
import { stdin, stdout } from "node:process";
|
|
3
3
|
import require$$0 from "tty";
|
|
4
4
|
import { WriteStream } from "node:tty";
|