rolldown 0.15.0-snapshot-b2570e7-20241204003545 → 0.15.0-snapshot-993c4a1-20241205003858
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 +164 -151
- package/dist/cjs/experimental-index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +1 -1
- package/dist/esm/cli.mjs +165 -152
- package/dist/esm/experimental-index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/{consola_36c0034f-DWsVjwtA.mjs → consola_36c0034f--bn5jvdH.mjs} +1 -1
- package/dist/shared/consola_36c0034f-_8_dG1Nr.cjs +1 -1
- package/dist/shared/{prompt-DGW8ZJmn.mjs → prompt-DHyJur3_.mjs} +2 -2
- package/dist/shared/{prompt-RFvZMmjc.cjs → prompt-DkiZzbTg.cjs} +1 -1
- package/dist/shared/{src-1jxF0vle.cjs → src-BIbmsUlX.cjs} +14 -7
- package/dist/shared/{src-Cm19F5A9.mjs → src-qgo__dKA.mjs} +14 -7
- package/dist/types/binding.d.ts +9 -5
- package/dist/types/cli/arguments/schema.d.ts +6 -6
- package/dist/types/options/input-options-schema.d.ts +16 -16
- package/dist/types/options/input-options.d.ts +1 -0
- package/dist/types/rollup.d.ts +4 -0
- package/dist/types/treeshake/module-side-effects.d.ts +8 -8
- package/dist/types/types/rolldown-output.d.ts +4 -0
- package/package.json +14 -14
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,143 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-BIbmsUlX.cjs');
|
|
4
4
|
const require_consola_36c0034f = require('../shared/consola_36c0034f-_8_dG1Nr.cjs');
|
|
5
5
|
const zod = require_chunk.__toESM(require("zod"));
|
|
6
6
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
7
7
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
8
8
|
const node_perf_hooks = require_chunk.__toESM(require("node:perf_hooks"));
|
|
9
|
+
const tty = require_chunk.__toESM(require("tty"));
|
|
9
10
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
10
11
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
11
12
|
const node_tty = require_chunk.__toESM(require("node:tty"));
|
|
12
|
-
const tty = require_chunk.__toESM(require("tty"));
|
|
13
|
-
|
|
14
|
-
//#region src/cli/utils.ts
|
|
15
|
-
const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : require_consola_36c0034f.createConsola({ formatOptions: { date: false } });
|
|
16
|
-
function createTestingLogger() {
|
|
17
|
-
const types = [
|
|
18
|
-
"silent",
|
|
19
|
-
"fatal",
|
|
20
|
-
"error",
|
|
21
|
-
"warn",
|
|
22
|
-
"log",
|
|
23
|
-
"info",
|
|
24
|
-
"success",
|
|
25
|
-
"fail",
|
|
26
|
-
"ready",
|
|
27
|
-
"start",
|
|
28
|
-
"box",
|
|
29
|
-
"debug",
|
|
30
|
-
"trace",
|
|
31
|
-
"verbose"
|
|
32
|
-
];
|
|
33
|
-
const ret = Object.create(null);
|
|
34
|
-
for (const type of types) ret[type] = console.log;
|
|
35
|
-
return ret;
|
|
36
|
-
}
|
|
37
|
-
async function ensureConfig(configPath) {
|
|
38
|
-
const fileUrl = (0, node_url.pathToFileURL)(configPath).toString();
|
|
39
|
-
let configExports;
|
|
40
|
-
try {
|
|
41
|
-
configExports = await import(fileUrl);
|
|
42
|
-
} catch (err) {
|
|
43
|
-
let errorMessage = "Error happened while loading config.";
|
|
44
|
-
if (!isSupportedFormat(configPath)) errorMessage += ` Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${node_path.default.extname(configPath)}\``;
|
|
45
|
-
throw new Error(errorMessage, { cause: err });
|
|
46
|
-
}
|
|
47
|
-
return configExports.default;
|
|
48
|
-
}
|
|
49
|
-
const SUPPORTED_CONFIG_FORMATS = [
|
|
50
|
-
".js",
|
|
51
|
-
".mjs",
|
|
52
|
-
".cjs"
|
|
53
|
-
];
|
|
54
|
-
/**
|
|
55
|
-
* Check whether the configuration file is supported
|
|
56
|
-
*/
|
|
57
|
-
function isSupportedFormat(configPath) {
|
|
58
|
-
const ext = node_path.default.extname(configPath);
|
|
59
|
-
return SUPPORTED_CONFIG_FORMATS.includes(ext);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
|
|
64
|
-
const { env: env$1 = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
65
|
-
const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
|
|
66
|
-
const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
|
|
67
|
-
const isWindows = platform === "win32";
|
|
68
|
-
const isDumbTerminal = env$1.TERM === "dumb";
|
|
69
|
-
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
|
|
70
|
-
const isCI = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
|
|
71
|
-
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
72
|
-
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));
|
|
73
|
-
const clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
74
|
-
const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
75
|
-
const init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
76
|
-
const colors = {
|
|
77
|
-
reset: init(0, 0),
|
|
78
|
-
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
79
|
-
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
80
|
-
italic: init(3, 23),
|
|
81
|
-
underline: init(4, 24),
|
|
82
|
-
inverse: init(7, 27),
|
|
83
|
-
hidden: init(8, 28),
|
|
84
|
-
strikethrough: init(9, 29),
|
|
85
|
-
black: init(30, 39),
|
|
86
|
-
red: init(31, 39),
|
|
87
|
-
green: init(32, 39),
|
|
88
|
-
yellow: init(33, 39),
|
|
89
|
-
blue: init(34, 39),
|
|
90
|
-
magenta: init(35, 39),
|
|
91
|
-
cyan: init(36, 39),
|
|
92
|
-
white: init(37, 39),
|
|
93
|
-
gray: init(90, 39),
|
|
94
|
-
bgBlack: init(40, 49),
|
|
95
|
-
bgRed: init(41, 49),
|
|
96
|
-
bgGreen: init(42, 49),
|
|
97
|
-
bgYellow: init(43, 49),
|
|
98
|
-
bgBlue: init(44, 49),
|
|
99
|
-
bgMagenta: init(45, 49),
|
|
100
|
-
bgCyan: init(46, 49),
|
|
101
|
-
bgWhite: init(47, 49),
|
|
102
|
-
blackBright: init(90, 39),
|
|
103
|
-
redBright: init(91, 39),
|
|
104
|
-
greenBright: init(92, 39),
|
|
105
|
-
yellowBright: init(93, 39),
|
|
106
|
-
blueBright: init(94, 39),
|
|
107
|
-
magentaBright: init(95, 39),
|
|
108
|
-
cyanBright: init(96, 39),
|
|
109
|
-
whiteBright: init(97, 39),
|
|
110
|
-
bgBlackBright: init(100, 49),
|
|
111
|
-
bgRedBright: init(101, 49),
|
|
112
|
-
bgGreenBright: init(102, 49),
|
|
113
|
-
bgYellowBright: init(103, 49),
|
|
114
|
-
bgBlueBright: init(104, 49),
|
|
115
|
-
bgMagentaBright: init(105, 49),
|
|
116
|
-
bgCyanBright: init(106, 49),
|
|
117
|
-
bgWhiteBright: init(107, 49)
|
|
118
|
-
};
|
|
119
|
-
const createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors : Object.keys(colors).reduce((colors$1, key) => ({
|
|
120
|
-
...colors$1,
|
|
121
|
-
[key]: String
|
|
122
|
-
}), {});
|
|
123
|
-
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();
|
|
124
|
-
|
|
125
|
-
//#endregion
|
|
126
|
-
//#region src/cli/colors.ts
|
|
127
|
-
var colors_exports = {};
|
|
128
|
-
__export(colors_exports, {
|
|
129
|
-
bold: () => bold,
|
|
130
|
-
cyan: () => cyan,
|
|
131
|
-
dim: () => dim,
|
|
132
|
-
gray: () => gray,
|
|
133
|
-
green: () => green,
|
|
134
|
-
red: () => red,
|
|
135
|
-
underline: () => underline,
|
|
136
|
-
yellow: () => yellow
|
|
137
|
-
});
|
|
138
|
-
const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ useColor: node_process.env.FORCE_COLOR !== "0" && !node_process.env.NO_COLOR });
|
|
139
13
|
|
|
140
|
-
//#endregion
|
|
141
14
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
142
15
|
const signals = [];
|
|
143
16
|
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
@@ -309,6 +182,133 @@ var SignalExit = class extends SignalExitBase {
|
|
|
309
182
|
const process$2 = globalThis.process;
|
|
310
183
|
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
311
184
|
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
|
|
187
|
+
const { env: env$1 = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
188
|
+
const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
|
|
189
|
+
const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
|
|
190
|
+
const isWindows = platform === "win32";
|
|
191
|
+
const isDumbTerminal = env$1.TERM === "dumb";
|
|
192
|
+
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
|
|
193
|
+
const isCI = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
|
|
194
|
+
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
195
|
+
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));
|
|
196
|
+
const clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
197
|
+
const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
198
|
+
const init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
199
|
+
const colors = {
|
|
200
|
+
reset: init(0, 0),
|
|
201
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
202
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
203
|
+
italic: init(3, 23),
|
|
204
|
+
underline: init(4, 24),
|
|
205
|
+
inverse: init(7, 27),
|
|
206
|
+
hidden: init(8, 28),
|
|
207
|
+
strikethrough: init(9, 29),
|
|
208
|
+
black: init(30, 39),
|
|
209
|
+
red: init(31, 39),
|
|
210
|
+
green: init(32, 39),
|
|
211
|
+
yellow: init(33, 39),
|
|
212
|
+
blue: init(34, 39),
|
|
213
|
+
magenta: init(35, 39),
|
|
214
|
+
cyan: init(36, 39),
|
|
215
|
+
white: init(37, 39),
|
|
216
|
+
gray: init(90, 39),
|
|
217
|
+
bgBlack: init(40, 49),
|
|
218
|
+
bgRed: init(41, 49),
|
|
219
|
+
bgGreen: init(42, 49),
|
|
220
|
+
bgYellow: init(43, 49),
|
|
221
|
+
bgBlue: init(44, 49),
|
|
222
|
+
bgMagenta: init(45, 49),
|
|
223
|
+
bgCyan: init(46, 49),
|
|
224
|
+
bgWhite: init(47, 49),
|
|
225
|
+
blackBright: init(90, 39),
|
|
226
|
+
redBright: init(91, 39),
|
|
227
|
+
greenBright: init(92, 39),
|
|
228
|
+
yellowBright: init(93, 39),
|
|
229
|
+
blueBright: init(94, 39),
|
|
230
|
+
magentaBright: init(95, 39),
|
|
231
|
+
cyanBright: init(96, 39),
|
|
232
|
+
whiteBright: init(97, 39),
|
|
233
|
+
bgBlackBright: init(100, 49),
|
|
234
|
+
bgRedBright: init(101, 49),
|
|
235
|
+
bgGreenBright: init(102, 49),
|
|
236
|
+
bgYellowBright: init(103, 49),
|
|
237
|
+
bgBlueBright: init(104, 49),
|
|
238
|
+
bgMagentaBright: init(105, 49),
|
|
239
|
+
bgCyanBright: init(106, 49),
|
|
240
|
+
bgWhiteBright: init(107, 49)
|
|
241
|
+
};
|
|
242
|
+
const createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors : Object.keys(colors).reduce((colors$1, key) => ({
|
|
243
|
+
...colors$1,
|
|
244
|
+
[key]: String
|
|
245
|
+
}), {});
|
|
246
|
+
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();
|
|
247
|
+
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/cli/colors.ts
|
|
250
|
+
var colors_exports = {};
|
|
251
|
+
__export(colors_exports, {
|
|
252
|
+
bold: () => bold,
|
|
253
|
+
cyan: () => cyan,
|
|
254
|
+
dim: () => dim,
|
|
255
|
+
gray: () => gray,
|
|
256
|
+
green: () => green,
|
|
257
|
+
red: () => red,
|
|
258
|
+
underline: () => underline,
|
|
259
|
+
yellow: () => yellow
|
|
260
|
+
});
|
|
261
|
+
const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ useColor: node_process.env.FORCE_COLOR !== "0" && !node_process.env.NO_COLOR });
|
|
262
|
+
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/cli/utils.ts
|
|
265
|
+
const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : require_consola_36c0034f.createConsola({ formatOptions: { date: false } });
|
|
266
|
+
function createTestingLogger() {
|
|
267
|
+
const types = [
|
|
268
|
+
"silent",
|
|
269
|
+
"fatal",
|
|
270
|
+
"error",
|
|
271
|
+
"warn",
|
|
272
|
+
"log",
|
|
273
|
+
"info",
|
|
274
|
+
"success",
|
|
275
|
+
"fail",
|
|
276
|
+
"ready",
|
|
277
|
+
"start",
|
|
278
|
+
"box",
|
|
279
|
+
"debug",
|
|
280
|
+
"trace",
|
|
281
|
+
"verbose"
|
|
282
|
+
];
|
|
283
|
+
const ret = Object.create(null);
|
|
284
|
+
for (const type of types) ret[type] = console.log;
|
|
285
|
+
return ret;
|
|
286
|
+
}
|
|
287
|
+
async function ensureConfig(configPath) {
|
|
288
|
+
const fileUrl = (0, node_url.pathToFileURL)(configPath).toString();
|
|
289
|
+
let configExports;
|
|
290
|
+
try {
|
|
291
|
+
configExports = await import(fileUrl);
|
|
292
|
+
} catch (err) {
|
|
293
|
+
let errorMessage = "Error happened while loading config.";
|
|
294
|
+
if (!isSupportedFormat(configPath)) errorMessage += ` Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${node_path.default.extname(configPath)}\``;
|
|
295
|
+
throw new Error(errorMessage, { cause: err });
|
|
296
|
+
}
|
|
297
|
+
return configExports.default;
|
|
298
|
+
}
|
|
299
|
+
const SUPPORTED_CONFIG_FORMATS = [
|
|
300
|
+
".js",
|
|
301
|
+
".mjs",
|
|
302
|
+
".cjs"
|
|
303
|
+
];
|
|
304
|
+
/**
|
|
305
|
+
* Check whether the configuration file is supported
|
|
306
|
+
*/
|
|
307
|
+
function isSupportedFormat(configPath) {
|
|
308
|
+
const ext = node_path.default.extname(configPath);
|
|
309
|
+
return SUPPORTED_CONFIG_FORMATS.includes(ext);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/cli/commands/bundle.ts
|
|
314
314
|
async function bundleWithConfig(configPath, cliOptions) {
|
|
@@ -318,24 +318,33 @@ async function bundleWithConfig(configPath, cliOptions) {
|
|
|
318
318
|
process.exit(1);
|
|
319
319
|
}
|
|
320
320
|
const configList = require_src.arraify(config);
|
|
321
|
-
|
|
321
|
+
const operation = cliOptions.watch ? watchInner : bundleInner;
|
|
322
|
+
for (const config$1 of configList) await operation(config$1, cliOptions);
|
|
322
323
|
}
|
|
323
324
|
async function bundleWithCliOptions(cliOptions) {
|
|
324
|
-
if (cliOptions.output.dir)
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
process.exit(1);
|
|
331
|
-
} else if (output.length === 0) {
|
|
332
|
-
logger.error("No output generated");
|
|
333
|
-
process.exit(1);
|
|
334
|
-
} else logger.log(output[0].code);
|
|
335
|
-
} else {
|
|
325
|
+
if (cliOptions.output.dir) {
|
|
326
|
+
const operation = cliOptions.watch ? watchInner : bundleInner;
|
|
327
|
+
await operation({}, cliOptions);
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
if (cliOptions.watch) {
|
|
336
331
|
logger.error("You must specify `output.dir` to use watch mode");
|
|
337
332
|
process.exit(1);
|
|
338
333
|
}
|
|
334
|
+
const build = await require_src.rolldown(cliOptions.input);
|
|
335
|
+
try {
|
|
336
|
+
const { output: outputs } = await build.generate(cliOptions.output);
|
|
337
|
+
if (outputs.length === 0) {
|
|
338
|
+
logger.error("No output generated");
|
|
339
|
+
process.exit(1);
|
|
340
|
+
}
|
|
341
|
+
for (const file of outputs) {
|
|
342
|
+
if (outputs.length > 1) logger.log(`\n${cyan(bold(`|→ ${file.fileName}:`))}\n`);
|
|
343
|
+
logger.log(file.type === "asset" ? file.source : file.code);
|
|
344
|
+
}
|
|
345
|
+
} finally {
|
|
346
|
+
await build.close();
|
|
347
|
+
}
|
|
339
348
|
}
|
|
340
349
|
async function watchInner(options$1, cliOptions) {
|
|
341
350
|
const watcher = await require_src.watch({
|
|
@@ -375,15 +384,19 @@ async function bundleInner(options$1, cliOptions) {
|
|
|
375
384
|
...options$1,
|
|
376
385
|
...cliOptions.input
|
|
377
386
|
});
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
+
try {
|
|
388
|
+
const bundleOutput = await build.write({
|
|
389
|
+
...options$1?.output,
|
|
390
|
+
...cliOptions.output
|
|
391
|
+
});
|
|
392
|
+
const endTime = node_perf_hooks.performance.now();
|
|
393
|
+
printBundleOutputPretty(bundleOutput);
|
|
394
|
+
logger.log(``);
|
|
395
|
+
const duration = endTime - startTime;
|
|
396
|
+
logger.success(`Finished in ${bold(ms(duration))}`);
|
|
397
|
+
} finally {
|
|
398
|
+
await build.close();
|
|
399
|
+
}
|
|
387
400
|
}
|
|
388
401
|
function printBundleOutputPretty(output) {
|
|
389
402
|
const outputEntries = collectOutputEntries(output.output);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-BIbmsUlX.cjs');
|
|
4
4
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
5
5
|
|
|
6
6
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-BIbmsUlX.cjs');
|
|
4
4
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,140 +1,13 @@
|
|
|
1
|
-
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src-
|
|
2
|
-
import { createConsola } from "../shared/consola_36c0034f
|
|
1
|
+
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src-qgo__dKA.mjs";
|
|
2
|
+
import { createConsola } from "../shared/consola_36c0034f--bn5jvdH.mjs";
|
|
3
3
|
import { ZodFirstPartyTypeKind, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$1, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$2, z, z as z$1, z as z$2, z as z$3 } from "zod";
|
|
4
4
|
import nodePath, { default as path } from "node:path";
|
|
5
5
|
import process$1, { env } from "node:process";
|
|
6
6
|
import { performance } from "node:perf_hooks";
|
|
7
|
+
import * as tty from "tty";
|
|
7
8
|
import { pathToFileURL } from "node:url";
|
|
8
9
|
import { parseArgs } from "node:util";
|
|
9
|
-
import * as tty from "tty";
|
|
10
|
-
|
|
11
|
-
//#region src/cli/utils.ts
|
|
12
|
-
const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
|
|
13
|
-
function createTestingLogger() {
|
|
14
|
-
const types = [
|
|
15
|
-
"silent",
|
|
16
|
-
"fatal",
|
|
17
|
-
"error",
|
|
18
|
-
"warn",
|
|
19
|
-
"log",
|
|
20
|
-
"info",
|
|
21
|
-
"success",
|
|
22
|
-
"fail",
|
|
23
|
-
"ready",
|
|
24
|
-
"start",
|
|
25
|
-
"box",
|
|
26
|
-
"debug",
|
|
27
|
-
"trace",
|
|
28
|
-
"verbose"
|
|
29
|
-
];
|
|
30
|
-
const ret = Object.create(null);
|
|
31
|
-
for (const type of types) ret[type] = console.log;
|
|
32
|
-
return ret;
|
|
33
|
-
}
|
|
34
|
-
async function ensureConfig(configPath) {
|
|
35
|
-
const fileUrl = pathToFileURL(configPath).toString();
|
|
36
|
-
let configExports;
|
|
37
|
-
try {
|
|
38
|
-
configExports = await import(fileUrl);
|
|
39
|
-
} catch (err) {
|
|
40
|
-
let errorMessage = "Error happened while loading config.";
|
|
41
|
-
if (!isSupportedFormat(configPath)) errorMessage += ` Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${nodePath.extname(configPath)}\``;
|
|
42
|
-
throw new Error(errorMessage, { cause: err });
|
|
43
|
-
}
|
|
44
|
-
return configExports.default;
|
|
45
|
-
}
|
|
46
|
-
const SUPPORTED_CONFIG_FORMATS = [
|
|
47
|
-
".js",
|
|
48
|
-
".mjs",
|
|
49
|
-
".cjs"
|
|
50
|
-
];
|
|
51
|
-
/**
|
|
52
|
-
* Check whether the configuration file is supported
|
|
53
|
-
*/
|
|
54
|
-
function isSupportedFormat(configPath) {
|
|
55
|
-
const ext = nodePath.extname(configPath);
|
|
56
|
-
return SUPPORTED_CONFIG_FORMATS.includes(ext);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
|
|
61
|
-
const { env: env$1 = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
62
|
-
const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
|
|
63
|
-
const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
|
|
64
|
-
const isWindows = platform === "win32";
|
|
65
|
-
const isDumbTerminal = env$1.TERM === "dumb";
|
|
66
|
-
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
|
|
67
|
-
const isCI = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
|
|
68
|
-
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
69
|
-
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));
|
|
70
|
-
const clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
71
|
-
const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
72
|
-
const init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
73
|
-
const colors = {
|
|
74
|
-
reset: init(0, 0),
|
|
75
|
-
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
76
|
-
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
77
|
-
italic: init(3, 23),
|
|
78
|
-
underline: init(4, 24),
|
|
79
|
-
inverse: init(7, 27),
|
|
80
|
-
hidden: init(8, 28),
|
|
81
|
-
strikethrough: init(9, 29),
|
|
82
|
-
black: init(30, 39),
|
|
83
|
-
red: init(31, 39),
|
|
84
|
-
green: init(32, 39),
|
|
85
|
-
yellow: init(33, 39),
|
|
86
|
-
blue: init(34, 39),
|
|
87
|
-
magenta: init(35, 39),
|
|
88
|
-
cyan: init(36, 39),
|
|
89
|
-
white: init(37, 39),
|
|
90
|
-
gray: init(90, 39),
|
|
91
|
-
bgBlack: init(40, 49),
|
|
92
|
-
bgRed: init(41, 49),
|
|
93
|
-
bgGreen: init(42, 49),
|
|
94
|
-
bgYellow: init(43, 49),
|
|
95
|
-
bgBlue: init(44, 49),
|
|
96
|
-
bgMagenta: init(45, 49),
|
|
97
|
-
bgCyan: init(46, 49),
|
|
98
|
-
bgWhite: init(47, 49),
|
|
99
|
-
blackBright: init(90, 39),
|
|
100
|
-
redBright: init(91, 39),
|
|
101
|
-
greenBright: init(92, 39),
|
|
102
|
-
yellowBright: init(93, 39),
|
|
103
|
-
blueBright: init(94, 39),
|
|
104
|
-
magentaBright: init(95, 39),
|
|
105
|
-
cyanBright: init(96, 39),
|
|
106
|
-
whiteBright: init(97, 39),
|
|
107
|
-
bgBlackBright: init(100, 49),
|
|
108
|
-
bgRedBright: init(101, 49),
|
|
109
|
-
bgGreenBright: init(102, 49),
|
|
110
|
-
bgYellowBright: init(103, 49),
|
|
111
|
-
bgBlueBright: init(104, 49),
|
|
112
|
-
bgMagentaBright: init(105, 49),
|
|
113
|
-
bgCyanBright: init(106, 49),
|
|
114
|
-
bgWhiteBright: init(107, 49)
|
|
115
|
-
};
|
|
116
|
-
const createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors : Object.keys(colors).reduce((colors$1, key) => ({
|
|
117
|
-
...colors$1,
|
|
118
|
-
[key]: String
|
|
119
|
-
}), {});
|
|
120
|
-
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();
|
|
121
|
-
|
|
122
|
-
//#endregion
|
|
123
|
-
//#region src/cli/colors.ts
|
|
124
|
-
var colors_exports = {};
|
|
125
|
-
__export(colors_exports, {
|
|
126
|
-
bold: () => bold,
|
|
127
|
-
cyan: () => cyan,
|
|
128
|
-
dim: () => dim,
|
|
129
|
-
gray: () => gray,
|
|
130
|
-
green: () => green,
|
|
131
|
-
red: () => red,
|
|
132
|
-
underline: () => underline,
|
|
133
|
-
yellow: () => yellow
|
|
134
|
-
});
|
|
135
|
-
const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ useColor: env.FORCE_COLOR !== "0" && !env.NO_COLOR });
|
|
136
10
|
|
|
137
|
-
//#endregion
|
|
138
11
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
139
12
|
const signals = [];
|
|
140
13
|
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
@@ -306,6 +179,133 @@ var SignalExit = class extends SignalExitBase {
|
|
|
306
179
|
const process$2 = globalThis.process;
|
|
307
180
|
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
308
181
|
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
|
|
184
|
+
const { env: env$1 = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
185
|
+
const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
|
|
186
|
+
const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
|
|
187
|
+
const isWindows = platform === "win32";
|
|
188
|
+
const isDumbTerminal = env$1.TERM === "dumb";
|
|
189
|
+
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
|
|
190
|
+
const isCI = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
|
|
191
|
+
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
192
|
+
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));
|
|
193
|
+
const clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
194
|
+
const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
195
|
+
const init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
196
|
+
const colors = {
|
|
197
|
+
reset: init(0, 0),
|
|
198
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
199
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
200
|
+
italic: init(3, 23),
|
|
201
|
+
underline: init(4, 24),
|
|
202
|
+
inverse: init(7, 27),
|
|
203
|
+
hidden: init(8, 28),
|
|
204
|
+
strikethrough: init(9, 29),
|
|
205
|
+
black: init(30, 39),
|
|
206
|
+
red: init(31, 39),
|
|
207
|
+
green: init(32, 39),
|
|
208
|
+
yellow: init(33, 39),
|
|
209
|
+
blue: init(34, 39),
|
|
210
|
+
magenta: init(35, 39),
|
|
211
|
+
cyan: init(36, 39),
|
|
212
|
+
white: init(37, 39),
|
|
213
|
+
gray: init(90, 39),
|
|
214
|
+
bgBlack: init(40, 49),
|
|
215
|
+
bgRed: init(41, 49),
|
|
216
|
+
bgGreen: init(42, 49),
|
|
217
|
+
bgYellow: init(43, 49),
|
|
218
|
+
bgBlue: init(44, 49),
|
|
219
|
+
bgMagenta: init(45, 49),
|
|
220
|
+
bgCyan: init(46, 49),
|
|
221
|
+
bgWhite: init(47, 49),
|
|
222
|
+
blackBright: init(90, 39),
|
|
223
|
+
redBright: init(91, 39),
|
|
224
|
+
greenBright: init(92, 39),
|
|
225
|
+
yellowBright: init(93, 39),
|
|
226
|
+
blueBright: init(94, 39),
|
|
227
|
+
magentaBright: init(95, 39),
|
|
228
|
+
cyanBright: init(96, 39),
|
|
229
|
+
whiteBright: init(97, 39),
|
|
230
|
+
bgBlackBright: init(100, 49),
|
|
231
|
+
bgRedBright: init(101, 49),
|
|
232
|
+
bgGreenBright: init(102, 49),
|
|
233
|
+
bgYellowBright: init(103, 49),
|
|
234
|
+
bgBlueBright: init(104, 49),
|
|
235
|
+
bgMagentaBright: init(105, 49),
|
|
236
|
+
bgCyanBright: init(106, 49),
|
|
237
|
+
bgWhiteBright: init(107, 49)
|
|
238
|
+
};
|
|
239
|
+
const createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors : Object.keys(colors).reduce((colors$1, key) => ({
|
|
240
|
+
...colors$1,
|
|
241
|
+
[key]: String
|
|
242
|
+
}), {});
|
|
243
|
+
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();
|
|
244
|
+
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/cli/colors.ts
|
|
247
|
+
var colors_exports = {};
|
|
248
|
+
__export(colors_exports, {
|
|
249
|
+
bold: () => bold,
|
|
250
|
+
cyan: () => cyan,
|
|
251
|
+
dim: () => dim,
|
|
252
|
+
gray: () => gray,
|
|
253
|
+
green: () => green,
|
|
254
|
+
red: () => red,
|
|
255
|
+
underline: () => underline,
|
|
256
|
+
yellow: () => yellow
|
|
257
|
+
});
|
|
258
|
+
const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ useColor: env.FORCE_COLOR !== "0" && !env.NO_COLOR });
|
|
259
|
+
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/cli/utils.ts
|
|
262
|
+
const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
|
|
263
|
+
function createTestingLogger() {
|
|
264
|
+
const types = [
|
|
265
|
+
"silent",
|
|
266
|
+
"fatal",
|
|
267
|
+
"error",
|
|
268
|
+
"warn",
|
|
269
|
+
"log",
|
|
270
|
+
"info",
|
|
271
|
+
"success",
|
|
272
|
+
"fail",
|
|
273
|
+
"ready",
|
|
274
|
+
"start",
|
|
275
|
+
"box",
|
|
276
|
+
"debug",
|
|
277
|
+
"trace",
|
|
278
|
+
"verbose"
|
|
279
|
+
];
|
|
280
|
+
const ret = Object.create(null);
|
|
281
|
+
for (const type of types) ret[type] = console.log;
|
|
282
|
+
return ret;
|
|
283
|
+
}
|
|
284
|
+
async function ensureConfig(configPath) {
|
|
285
|
+
const fileUrl = pathToFileURL(configPath).toString();
|
|
286
|
+
let configExports;
|
|
287
|
+
try {
|
|
288
|
+
configExports = await import(fileUrl);
|
|
289
|
+
} catch (err) {
|
|
290
|
+
let errorMessage = "Error happened while loading config.";
|
|
291
|
+
if (!isSupportedFormat(configPath)) errorMessage += ` Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${nodePath.extname(configPath)}\``;
|
|
292
|
+
throw new Error(errorMessage, { cause: err });
|
|
293
|
+
}
|
|
294
|
+
return configExports.default;
|
|
295
|
+
}
|
|
296
|
+
const SUPPORTED_CONFIG_FORMATS = [
|
|
297
|
+
".js",
|
|
298
|
+
".mjs",
|
|
299
|
+
".cjs"
|
|
300
|
+
];
|
|
301
|
+
/**
|
|
302
|
+
* Check whether the configuration file is supported
|
|
303
|
+
*/
|
|
304
|
+
function isSupportedFormat(configPath) {
|
|
305
|
+
const ext = nodePath.extname(configPath);
|
|
306
|
+
return SUPPORTED_CONFIG_FORMATS.includes(ext);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
309
|
//#endregion
|
|
310
310
|
//#region src/cli/commands/bundle.ts
|
|
311
311
|
async function bundleWithConfig(configPath, cliOptions) {
|
|
@@ -315,24 +315,33 @@ async function bundleWithConfig(configPath, cliOptions) {
|
|
|
315
315
|
process.exit(1);
|
|
316
316
|
}
|
|
317
317
|
const configList = arraify(config);
|
|
318
|
-
|
|
318
|
+
const operation = cliOptions.watch ? watchInner : bundleInner;
|
|
319
|
+
for (const config$1 of configList) await operation(config$1, cliOptions);
|
|
319
320
|
}
|
|
320
321
|
async function bundleWithCliOptions(cliOptions) {
|
|
321
|
-
if (cliOptions.output.dir)
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
process.exit(1);
|
|
328
|
-
} else if (output.length === 0) {
|
|
329
|
-
logger.error("No output generated");
|
|
330
|
-
process.exit(1);
|
|
331
|
-
} else logger.log(output[0].code);
|
|
332
|
-
} else {
|
|
322
|
+
if (cliOptions.output.dir) {
|
|
323
|
+
const operation = cliOptions.watch ? watchInner : bundleInner;
|
|
324
|
+
await operation({}, cliOptions);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
if (cliOptions.watch) {
|
|
333
328
|
logger.error("You must specify `output.dir` to use watch mode");
|
|
334
329
|
process.exit(1);
|
|
335
330
|
}
|
|
331
|
+
const build = await rolldown(cliOptions.input);
|
|
332
|
+
try {
|
|
333
|
+
const { output: outputs } = await build.generate(cliOptions.output);
|
|
334
|
+
if (outputs.length === 0) {
|
|
335
|
+
logger.error("No output generated");
|
|
336
|
+
process.exit(1);
|
|
337
|
+
}
|
|
338
|
+
for (const file of outputs) {
|
|
339
|
+
if (outputs.length > 1) logger.log(`\n${cyan(bold(`|→ ${file.fileName}:`))}\n`);
|
|
340
|
+
logger.log(file.type === "asset" ? file.source : file.code);
|
|
341
|
+
}
|
|
342
|
+
} finally {
|
|
343
|
+
await build.close();
|
|
344
|
+
}
|
|
336
345
|
}
|
|
337
346
|
async function watchInner(options$1, cliOptions) {
|
|
338
347
|
const watcher = await watch({
|
|
@@ -372,15 +381,19 @@ async function bundleInner(options$1, cliOptions) {
|
|
|
372
381
|
...options$1,
|
|
373
382
|
...cliOptions.input
|
|
374
383
|
});
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
+
try {
|
|
385
|
+
const bundleOutput = await build.write({
|
|
386
|
+
...options$1?.output,
|
|
387
|
+
...cliOptions.output
|
|
388
|
+
});
|
|
389
|
+
const endTime = performance.now();
|
|
390
|
+
printBundleOutputPretty(bundleOutput);
|
|
391
|
+
logger.log(``);
|
|
392
|
+
const duration = endTime - startTime;
|
|
393
|
+
logger.success(`Finished in ${bold(ms(duration))}`);
|
|
394
|
+
} finally {
|
|
395
|
+
await build.close();
|
|
396
|
+
}
|
|
384
397
|
}
|
|
385
398
|
function printBundleOutputPretty(output) {
|
|
386
399
|
const outputEntries = collectOutputEntries(output.output);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-
|
|
1
|
+
import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-qgo__dKA.mjs";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-
|
|
1
|
+
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-qgo__dKA.mjs";
|
|
2
2
|
import { parentPort, workerData } from "node:worker_threads";
|
|
3
3
|
|
|
4
4
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -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-DHyJur3_.mjs").then((m) => m.prompt(...args)),
|
|
819
819
|
reporters: options.reporters || [options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()],
|
|
820
820
|
...options
|
|
821
821
|
});
|
|
@@ -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-DkiZzbTg.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,7 +1,7 @@
|
|
|
1
|
-
import { colors, getDefaultExportFromCjs, isUnicodeSupported } from "./consola_36c0034f
|
|
1
|
+
import { colors, getDefaultExportFromCjs, isUnicodeSupported } from "./consola_36c0034f--bn5jvdH.mjs";
|
|
2
2
|
import { stdin, stdout } from "node:process";
|
|
3
|
-
import { WriteStream } from "node:tty";
|
|
4
3
|
import require$$0 from "tty";
|
|
4
|
+
import { WriteStream } from "node:tty";
|
|
5
5
|
import f from "node:readline";
|
|
6
6
|
|
|
7
7
|
//#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs
|
|
@@ -3,9 +3,9 @@ const require_chunk = require('./chunk-BK2Ye-xa.cjs');
|
|
|
3
3
|
const require_consola_36c0034f = require('./consola_36c0034f-_8_dG1Nr.cjs');
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
6
|
+
const tty = require_chunk.__toESM(require("tty"));
|
|
6
7
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
7
8
|
const node_tty = require_chunk.__toESM(require("node:tty"));
|
|
8
|
-
const tty = require_chunk.__toESM(require("tty"));
|
|
9
9
|
const node_readline = require_chunk.__toESM(require("node:readline"));
|
|
10
10
|
|
|
11
11
|
//#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs
|
|
@@ -155,10 +155,12 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
|
|
|
155
155
|
type: "asset",
|
|
156
156
|
fileName: bindingAsset.fileName,
|
|
157
157
|
originalFileName: bindingAsset.originalFileName || null,
|
|
158
|
+
originalFileNames: bindingAsset.originalFileNames,
|
|
158
159
|
get source() {
|
|
159
160
|
return transformAssetSource(bindingAsset.source);
|
|
160
161
|
},
|
|
161
|
-
name: bindingAsset.name ?? undefined
|
|
162
|
+
name: bindingAsset.name ?? undefined,
|
|
163
|
+
names: bindingAsset.names
|
|
162
164
|
};
|
|
163
165
|
const cache = {};
|
|
164
166
|
return new Proxy(asset, {
|
|
@@ -197,9 +199,9 @@ function collectChangedBundle(changed, bundle) {
|
|
|
197
199
|
const item = bundle[key];
|
|
198
200
|
if (item.type === "asset") assets.push({
|
|
199
201
|
filename: item.fileName,
|
|
200
|
-
|
|
202
|
+
originalFileNames: item.originalFileNames,
|
|
201
203
|
source: bindingAssetSource(item.source),
|
|
202
|
-
|
|
204
|
+
names: item.names
|
|
203
205
|
});
|
|
204
206
|
else chunks.push({
|
|
205
207
|
code: item.code,
|
|
@@ -1084,7 +1086,7 @@ const ModuleSideEffectsRuleSchema = zod.z.object({
|
|
|
1084
1086
|
}).refine((data) => {
|
|
1085
1087
|
return data.test !== undefined || data.external !== undefined;
|
|
1086
1088
|
}, "Either `test` or `external` should be set.");
|
|
1087
|
-
const ModuleSideEffectsOptionSchema = zod.z.boolean().or(zod.z.array(ModuleSideEffectsRuleSchema)).or(zod.z.literal("no-external"));
|
|
1089
|
+
const ModuleSideEffectsOptionSchema = zod.z.boolean().or(zod.z.array(ModuleSideEffectsRuleSchema)).or(zod.z.function().args(zod.z.string(), zod.z.boolean()).returns(zod.z.boolean().optional())).or(zod.z.literal("no-external"));
|
|
1088
1090
|
const TreeshakingOptionsSchema = zod.z.object({
|
|
1089
1091
|
moduleSideEffects: ModuleSideEffectsOptionSchema.optional(),
|
|
1090
1092
|
annotations: zod.z.boolean().optional()
|
|
@@ -1964,7 +1966,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog,
|
|
|
1964
1966
|
profilerNames: inputOptions?.profilerNames,
|
|
1965
1967
|
jsx: bindingifyJsx(inputOptions.jsx),
|
|
1966
1968
|
watch: bindingifyWatch(inputOptions.watch),
|
|
1967
|
-
dropLabels: inputOptions.dropLabels
|
|
1969
|
+
dropLabels: inputOptions.dropLabels,
|
|
1970
|
+
keepNames: inputOptions.keepNames
|
|
1968
1971
|
};
|
|
1969
1972
|
}
|
|
1970
1973
|
function bindingifyExternal(external) {
|
|
@@ -2744,8 +2747,12 @@ async function build(options) {
|
|
|
2744
2747
|
else {
|
|
2745
2748
|
const { output, write = true,...inputOptions } = options;
|
|
2746
2749
|
const build$1 = await rolldown(inputOptions);
|
|
2747
|
-
|
|
2748
|
-
|
|
2750
|
+
try {
|
|
2751
|
+
if (write) return await build$1.write(output);
|
|
2752
|
+
else return await build$1.generate(output);
|
|
2753
|
+
} finally {
|
|
2754
|
+
await build$1.close();
|
|
2755
|
+
}
|
|
2749
2756
|
}
|
|
2750
2757
|
}
|
|
2751
2758
|
|
|
@@ -188,10 +188,12 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
|
|
|
188
188
|
type: "asset",
|
|
189
189
|
fileName: bindingAsset.fileName,
|
|
190
190
|
originalFileName: bindingAsset.originalFileName || null,
|
|
191
|
+
originalFileNames: bindingAsset.originalFileNames,
|
|
191
192
|
get source() {
|
|
192
193
|
return transformAssetSource(bindingAsset.source);
|
|
193
194
|
},
|
|
194
|
-
name: bindingAsset.name ?? undefined
|
|
195
|
+
name: bindingAsset.name ?? undefined,
|
|
196
|
+
names: bindingAsset.names
|
|
195
197
|
};
|
|
196
198
|
const cache = {};
|
|
197
199
|
return new Proxy(asset, {
|
|
@@ -230,9 +232,9 @@ function collectChangedBundle(changed, bundle) {
|
|
|
230
232
|
const item = bundle[key];
|
|
231
233
|
if (item.type === "asset") assets.push({
|
|
232
234
|
filename: item.fileName,
|
|
233
|
-
|
|
235
|
+
originalFileNames: item.originalFileNames,
|
|
234
236
|
source: bindingAssetSource(item.source),
|
|
235
|
-
|
|
237
|
+
names: item.names
|
|
236
238
|
});
|
|
237
239
|
else chunks.push({
|
|
238
240
|
code: item.code,
|
|
@@ -1116,7 +1118,7 @@ const ModuleSideEffectsRuleSchema = z.object({
|
|
|
1116
1118
|
}).refine((data) => {
|
|
1117
1119
|
return data.test !== undefined || data.external !== undefined;
|
|
1118
1120
|
}, "Either `test` or `external` should be set.");
|
|
1119
|
-
const ModuleSideEffectsOptionSchema = z.boolean().or(z.array(ModuleSideEffectsRuleSchema)).or(z.literal("no-external"));
|
|
1121
|
+
const ModuleSideEffectsOptionSchema = z.boolean().or(z.array(ModuleSideEffectsRuleSchema)).or(z.function().args(z.string(), z.boolean()).returns(z.boolean().optional())).or(z.literal("no-external"));
|
|
1120
1122
|
const TreeshakingOptionsSchema = z.object({
|
|
1121
1123
|
moduleSideEffects: ModuleSideEffectsOptionSchema.optional(),
|
|
1122
1124
|
annotations: z.boolean().optional()
|
|
@@ -1996,7 +1998,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog,
|
|
|
1996
1998
|
profilerNames: inputOptions?.profilerNames,
|
|
1997
1999
|
jsx: bindingifyJsx(inputOptions.jsx),
|
|
1998
2000
|
watch: bindingifyWatch(inputOptions.watch),
|
|
1999
|
-
dropLabels: inputOptions.dropLabels
|
|
2001
|
+
dropLabels: inputOptions.dropLabels,
|
|
2002
|
+
keepNames: inputOptions.keepNames
|
|
2000
2003
|
};
|
|
2001
2004
|
}
|
|
2002
2005
|
function bindingifyExternal(external) {
|
|
@@ -2776,8 +2779,12 @@ async function build(options) {
|
|
|
2776
2779
|
else {
|
|
2777
2780
|
const { output, write = true,...inputOptions } = options;
|
|
2778
2781
|
const build$1 = await rolldown(inputOptions);
|
|
2779
|
-
|
|
2780
|
-
|
|
2782
|
+
try {
|
|
2783
|
+
if (write) return await build$1.write(output);
|
|
2784
|
+
else return await build$1.generate(output);
|
|
2785
|
+
} finally {
|
|
2786
|
+
await build$1.close();
|
|
2787
|
+
}
|
|
2781
2788
|
}
|
|
2782
2789
|
}
|
|
2783
2790
|
|
package/dist/types/binding.d.ts
CHANGED
|
@@ -68,8 +68,10 @@ export declare class BindingNormalizedOptions {
|
|
|
68
68
|
export declare class BindingOutputAsset {
|
|
69
69
|
get fileName(): string
|
|
70
70
|
get originalFileName(): string | null
|
|
71
|
+
get originalFileNames(): Array<string>
|
|
71
72
|
get source(): BindingAssetSource
|
|
72
73
|
get name(): string | null
|
|
74
|
+
get names(): Array<string>
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
export declare class BindingOutputChunk {
|
|
@@ -325,6 +327,7 @@ export interface BindingInputOptions {
|
|
|
325
327
|
profilerNames?: boolean
|
|
326
328
|
jsx?: JsxOptions
|
|
327
329
|
watch?: BindingWatchOption
|
|
330
|
+
keepNames?: boolean
|
|
328
331
|
}
|
|
329
332
|
|
|
330
333
|
export interface BindingJsonPluginConfig {
|
|
@@ -524,11 +527,12 @@ export interface BindingTransformPluginConfig {
|
|
|
524
527
|
exclude?: Array<BindingStringOrRegex>
|
|
525
528
|
jsxInject?: string
|
|
526
529
|
reactRefresh?: boolean
|
|
527
|
-
|
|
530
|
+
target?: string
|
|
531
|
+
browserslist?: string
|
|
528
532
|
}
|
|
529
533
|
|
|
530
534
|
export interface BindingTreeshake {
|
|
531
|
-
moduleSideEffects: boolean | BindingModuleSideEffectsRule[]
|
|
535
|
+
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined)
|
|
532
536
|
annotations?: boolean
|
|
533
537
|
}
|
|
534
538
|
|
|
@@ -537,7 +541,7 @@ export interface BindingViteResolvePluginConfig {
|
|
|
537
541
|
environmentConsumer: string
|
|
538
542
|
environmentName: string
|
|
539
543
|
external: true | string[]
|
|
540
|
-
noExternal: true | string
|
|
544
|
+
noExternal: true | Array<string | RegExp>
|
|
541
545
|
finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>
|
|
542
546
|
finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>
|
|
543
547
|
runtime: string
|
|
@@ -606,8 +610,8 @@ export interface JsChangedOutputs {
|
|
|
606
610
|
}
|
|
607
611
|
|
|
608
612
|
export interface JsOutputAsset {
|
|
609
|
-
|
|
610
|
-
|
|
613
|
+
names: Array<string>
|
|
614
|
+
originalFileNames: Array<string>
|
|
611
615
|
filename: string
|
|
612
616
|
source: BindingAssetSource
|
|
613
617
|
}
|
|
@@ -50,7 +50,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
50
50
|
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
|
|
51
51
|
shimMissingExports: z.ZodOptional<z.ZodBoolean>;
|
|
52
52
|
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
53
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
53
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
54
54
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
55
55
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
56
56
|
sideEffects: z.ZodBoolean;
|
|
@@ -70,10 +70,10 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
70
70
|
sideEffects: boolean;
|
|
71
71
|
external?: boolean | undefined;
|
|
72
72
|
test?: RegExp | undefined;
|
|
73
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
73
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
74
74
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
75
75
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
76
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
76
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
77
77
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
78
78
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
79
79
|
sideEffects: z.ZodBoolean;
|
|
@@ -93,10 +93,10 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
93
93
|
sideEffects: boolean;
|
|
94
94
|
external?: boolean | undefined;
|
|
95
95
|
test?: RegExp | undefined;
|
|
96
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
96
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
97
97
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
98
98
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
99
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
99
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
100
100
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
101
101
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
102
102
|
sideEffects: z.ZodBoolean;
|
|
@@ -116,7 +116,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
116
116
|
sideEffects: boolean;
|
|
117
117
|
external?: boolean | undefined;
|
|
118
118
|
test?: RegExp | undefined;
|
|
119
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
119
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
120
120
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
121
121
|
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
122
122
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
|
@@ -45,7 +45,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
45
45
|
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
|
|
46
46
|
shimMissingExports: z.ZodOptional<z.ZodBoolean>;
|
|
47
47
|
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
48
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
48
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
49
49
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
50
50
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
51
51
|
sideEffects: z.ZodBoolean;
|
|
@@ -65,10 +65,10 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
65
65
|
sideEffects: boolean;
|
|
66
66
|
external?: boolean | undefined;
|
|
67
67
|
test?: RegExp | undefined;
|
|
68
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
68
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
69
69
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
70
70
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
71
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
71
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
72
72
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
73
73
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
74
74
|
sideEffects: z.ZodBoolean;
|
|
@@ -88,10 +88,10 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
88
88
|
sideEffects: boolean;
|
|
89
89
|
external?: boolean | undefined;
|
|
90
90
|
test?: RegExp | undefined;
|
|
91
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
91
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
92
92
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
93
93
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
94
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
94
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
95
95
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
96
96
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
97
97
|
sideEffects: z.ZodBoolean;
|
|
@@ -111,7 +111,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
111
111
|
sideEffects: boolean;
|
|
112
112
|
external?: boolean | undefined;
|
|
113
113
|
test?: RegExp | undefined;
|
|
114
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
114
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
115
115
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
116
116
|
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
117
117
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
|
@@ -228,7 +228,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
228
228
|
} | undefined;
|
|
229
229
|
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
230
230
|
treeshake?: boolean | z.objectOutputType<{
|
|
231
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
231
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
232
232
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
233
233
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
234
234
|
sideEffects: z.ZodBoolean;
|
|
@@ -248,7 +248,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
248
248
|
sideEffects: boolean;
|
|
249
249
|
external?: boolean | undefined;
|
|
250
250
|
test?: RegExp | undefined;
|
|
251
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
251
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
252
252
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
253
253
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
254
254
|
inject?: Record<string, string | [string, string]> | undefined;
|
|
@@ -305,7 +305,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
305
305
|
} | undefined;
|
|
306
306
|
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
307
307
|
treeshake?: boolean | z.objectInputType<{
|
|
308
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
308
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
309
309
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
310
310
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
311
311
|
sideEffects: z.ZodBoolean;
|
|
@@ -325,7 +325,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
325
325
|
sideEffects: boolean;
|
|
326
326
|
external?: boolean | undefined;
|
|
327
327
|
test?: RegExp | undefined;
|
|
328
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
328
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
329
329
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
330
330
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
331
331
|
inject?: Record<string, string | [string, string]> | undefined;
|
|
@@ -397,7 +397,7 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
397
397
|
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
|
|
398
398
|
shimMissingExports: z.ZodOptional<z.ZodBoolean>;
|
|
399
399
|
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
400
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
400
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
401
401
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
402
402
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
403
403
|
sideEffects: z.ZodBoolean;
|
|
@@ -417,10 +417,10 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
417
417
|
sideEffects: boolean;
|
|
418
418
|
external?: boolean | undefined;
|
|
419
419
|
test?: RegExp | undefined;
|
|
420
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
420
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
421
421
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
422
422
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
423
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
423
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
424
424
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
425
425
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
426
426
|
sideEffects: z.ZodBoolean;
|
|
@@ -440,10 +440,10 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
440
440
|
sideEffects: boolean;
|
|
441
441
|
external?: boolean | undefined;
|
|
442
442
|
test?: RegExp | undefined;
|
|
443
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
443
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
444
444
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
445
445
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
446
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
446
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
447
447
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
448
448
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
449
449
|
sideEffects: z.ZodBoolean;
|
|
@@ -463,7 +463,7 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
463
463
|
sideEffects: boolean;
|
|
464
464
|
external?: boolean | undefined;
|
|
465
465
|
test?: RegExp | undefined;
|
|
466
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
466
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
467
467
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
468
468
|
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
469
469
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
package/dist/types/rollup.d.ts
CHANGED
|
@@ -906,8 +906,12 @@ export interface SerializedTimings {
|
|
|
906
906
|
}
|
|
907
907
|
|
|
908
908
|
export interface PreRenderedAsset {
|
|
909
|
+
/** @deprecated Use "names" instead. */
|
|
909
910
|
name: string | undefined
|
|
911
|
+
names: string[]
|
|
912
|
+
/** @deprecated Use "originalFileNames" instead. */
|
|
910
913
|
originalFileName: string | null
|
|
914
|
+
originalFileNames: string[]
|
|
911
915
|
source: string | Uint8Array
|
|
912
916
|
type: 'asset'
|
|
913
917
|
}
|
|
@@ -21,7 +21,7 @@ export declare const ModuleSideEffectsRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
21
21
|
external?: boolean | undefined;
|
|
22
22
|
test?: RegExp | undefined;
|
|
23
23
|
}>;
|
|
24
|
-
export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
24
|
+
export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
25
25
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
26
26
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
27
27
|
sideEffects: z.ZodBoolean;
|
|
@@ -41,9 +41,9 @@ export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodUnion<[z.Zo
|
|
|
41
41
|
sideEffects: boolean;
|
|
42
42
|
external?: boolean | undefined;
|
|
43
43
|
test?: RegExp | undefined;
|
|
44
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>;
|
|
44
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>;
|
|
45
45
|
export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
46
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
46
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
47
47
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
48
48
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
49
49
|
sideEffects: z.ZodBoolean;
|
|
@@ -63,10 +63,10 @@ export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
63
63
|
sideEffects: boolean;
|
|
64
64
|
external?: boolean | undefined;
|
|
65
65
|
test?: RegExp | undefined;
|
|
66
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
66
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
67
67
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
68
68
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
69
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
69
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
70
70
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
71
71
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
72
72
|
sideEffects: z.ZodBoolean;
|
|
@@ -86,10 +86,10 @@ export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
86
86
|
sideEffects: boolean;
|
|
87
87
|
external?: boolean | undefined;
|
|
88
88
|
test?: RegExp | undefined;
|
|
89
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
89
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
90
90
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
91
91
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
92
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
92
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
93
93
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
94
94
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
95
95
|
sideEffects: z.ZodBoolean;
|
|
@@ -109,7 +109,7 @@ export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
109
109
|
sideEffects: boolean;
|
|
110
110
|
external?: boolean | undefined;
|
|
111
111
|
test?: RegExp | undefined;
|
|
112
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
112
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
113
113
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
114
114
|
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>;
|
|
115
115
|
export type TreeshakingOptions = z.infer<typeof TreeshakingOptionsSchema>;
|
|
@@ -3,9 +3,13 @@ import type { RenderedChunk } from '../binding';
|
|
|
3
3
|
export interface RolldownOutputAsset {
|
|
4
4
|
type: 'asset';
|
|
5
5
|
fileName: string;
|
|
6
|
+
/** @deprecated Use "originalFileNames" instead. */
|
|
6
7
|
originalFileName: string | null;
|
|
8
|
+
originalFileNames: string[];
|
|
7
9
|
source: AssetSource;
|
|
10
|
+
/** @deprecated Use "names" instead. */
|
|
8
11
|
name: string | undefined;
|
|
12
|
+
names: string[];
|
|
9
13
|
}
|
|
10
14
|
export interface SourceMap {
|
|
11
15
|
file: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "0.15.0-snapshot-
|
|
3
|
+
"version": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -113,21 +113,21 @@
|
|
|
113
113
|
"why-is-node-running": "^3.0.0",
|
|
114
114
|
"zod-to-json-schema": "^3.23.2",
|
|
115
115
|
"@rolldown/testing": "0.0.1",
|
|
116
|
-
"rolldown": "0.15.0-snapshot-
|
|
116
|
+
"rolldown": "0.15.0-snapshot-993c4a1-20241205003858"
|
|
117
117
|
},
|
|
118
118
|
"optionalDependencies": {
|
|
119
|
-
"@rolldown/binding-darwin-
|
|
120
|
-
"@rolldown/binding-
|
|
121
|
-
"@rolldown/binding-
|
|
122
|
-
"@rolldown/binding-linux-arm-gnueabihf": "0.15.0-snapshot-
|
|
123
|
-
"@rolldown/binding-linux-arm64-gnu": "0.15.0-snapshot-
|
|
124
|
-
"@rolldown/binding-linux-
|
|
125
|
-
"@rolldown/binding-linux-
|
|
126
|
-
"@rolldown/binding-
|
|
127
|
-
"@rolldown/binding-
|
|
128
|
-
"@rolldown/binding-win32-ia32-msvc": "0.15.0-snapshot-
|
|
129
|
-
"@rolldown/binding-
|
|
130
|
-
"@rolldown/binding-win32-
|
|
119
|
+
"@rolldown/binding-darwin-arm64": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
120
|
+
"@rolldown/binding-darwin-x64": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
121
|
+
"@rolldown/binding-freebsd-x64": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
122
|
+
"@rolldown/binding-linux-arm-gnueabihf": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
123
|
+
"@rolldown/binding-linux-arm64-gnu": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
124
|
+
"@rolldown/binding-linux-x64-gnu": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
125
|
+
"@rolldown/binding-linux-arm64-musl": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
126
|
+
"@rolldown/binding-linux-x64-musl": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
127
|
+
"@rolldown/binding-win32-arm64-msvc": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
128
|
+
"@rolldown/binding-win32-ia32-msvc": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
129
|
+
"@rolldown/binding-wasm32-wasi": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
130
|
+
"@rolldown/binding-win32-x64-msvc": "0.15.0-snapshot-993c4a1-20241205003858"
|
|
131
131
|
},
|
|
132
132
|
"scripts": {
|
|
133
133
|
"# Scrips for binding #": "_",
|