@voidzero-dev/vite-plus-core 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +36 -177
- package/dist/rolldown/cli.mjs +33 -29
- package/dist/rolldown/config.d.mts +3 -3
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.d.mts +29 -29
- package/dist/rolldown/experimental-index.mjs +8 -8
- package/dist/rolldown/experimental-runtime-types.d.ts +39 -7
- package/dist/rolldown/experimental-runtime.d.ts +39 -7
- package/dist/rolldown/experimental-runtime.mjs +284 -255
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/index.d.mts +3 -3
- package/dist/rolldown/index.mjs +4 -4
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +3 -3
- package/dist/rolldown/parse-ast-index.d.mts +6 -7
- package/dist/rolldown/parse-ast-index.mjs +1 -1
- package/dist/rolldown/plugins-index.d.mts +5 -5
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-BY0qR5iS.mjs → binding-DlR5d34p.mjs} +27 -28
- package/dist/rolldown/shared/{binding-BTa6BPQe.d.mts → binding-tzp6Hc_3.d.mts} +1 -1
- package/dist/rolldown/shared/{bindingify-input-options-B8JHmN6_.mjs → bindingify-input-options-DhjlrWZE.mjs} +203 -20
- package/dist/rolldown/shared/{constructors-xEvVj3lN.mjs → constructors-B2hkJoIA.mjs} +1 -1
- package/dist/rolldown/shared/{constructors-DuOq7MqW.d.mts → constructors-Dw9H1IvX.d.mts} +2 -2
- package/dist/rolldown/shared/{create-bundler-option-COco-7P6.mjs → create-bundler-option-1AEe_J0o.mjs} +36 -10
- package/dist/rolldown/shared/{define-config-C7HCoqY8.d.mts → define-config-CGhm2DU-.d.mts} +94 -5
- package/dist/rolldown/shared/{error-C7pxws0W.mjs → error-Dsqzw0Oa.mjs} +2 -1
- package/dist/rolldown/shared/{load-config-DkUBnDsI.mjs → load-config-bvw8z7Ft.mjs} +2 -2
- package/dist/rolldown/shared/{normalize-string-or-regex-F14uvr6D.mjs → normalize-string-or-regex-B7Gsiuz7.mjs} +1 -1
- package/dist/rolldown/shared/{parse-BWeE7Vr9.mjs → parse-BCSSrLHf.mjs} +2 -2
- package/dist/rolldown/shared/{resolve-tsconfig-DHwpIs5e.mjs → resolve-tsconfig-DyR2RUTm.mjs} +2 -2
- package/dist/rolldown/shared/{rolldown-Bue0gNT5.mjs → rolldown-C8QomUuX.mjs} +4 -4
- package/dist/rolldown/shared/{transform-DK_nCt9j.d.mts → transform-D4RDjIPI.d.mts} +1 -1
- package/dist/rolldown/shared/{watch-RXhXN1aG.mjs → watch-CPI70Lkn.mjs} +4 -4
- package/dist/rolldown/utils-index.d.mts +5 -5
- package/dist/rolldown/utils-index.mjs +5 -5
- package/dist/tsdown/{build-JVmLFaZt-DRlLhpV3.js → build-KEepWO_k-BOsPZ2cH.js} +26 -25
- package/dist/tsdown/{debug-CpC4hV25-C-OYr2iI.js → debug-DKTolR2K-BMJOFfj2.js} +4 -5
- package/dist/tsdown/{detect-Bg-d8iUV-Du8LljhG.js → detect-DHDepxVX-CpWW52Jd.js} +38 -34
- package/dist/tsdown/dist-BebyOHRu.js +6224 -0
- package/dist/tsdown/index-types.d.ts +216 -216
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/{main-CyNcZUzu.js → main-Du9xCnhX.js} +105 -19
- package/dist/tsdown/npm_entry_picomatch.cjs +36 -25
- package/dist/tsdown/{resolver-DE0_sy8o-Bi3xbRxi.js → resolver-DE0_sy8o-DNoi-dFQ.js} +3 -2
- package/dist/tsdown/run.js +28 -26
- package/dist/tsdown/{src-pN7Bl6zo.js → src-CBWRkeF5.js} +4 -4
- package/dist/tsdown/{target-DgdLrXba-DpO9JXxB.js → target-HZbF5Cux-Cmv1LI5D.js} +175 -9
- package/dist/tsdown/{tsc-BLb4pSBY.js → tsc-YwU2b8yT.js} +4 -4
- package/dist/tsdown/tsdown-css.js +4 -4
- package/dist/tsdown/tsdown-exe.js +5 -43
- package/dist/vite/client/bundledDevClient.mjs +109 -345
- package/dist/vite/client/client.mjs +80 -28
- package/dist/vite/node/chunks/build.js +19 -19
- package/dist/vite/node/chunks/node.js +5210 -4942
- package/dist/vite/node/chunks/postcss-import.js +10 -10
- package/dist/vite/node/cli.js +24 -21
- package/dist/vite/node/index.d.ts +5 -2
- package/dist/vite/node/index.js +1 -2
- package/dist/vite/node/internal.js +1 -2
- package/dist/vite/node/module-runner.d.ts +1 -0
- package/dist/vite/node/module-runner.js +32 -27
- package/package.json +46 -30
- package/dist/rolldown/experimental-default-runtime.mjs +0 -116
- package/dist/rolldown/experimental-runtime-base.mjs +0 -95
- package/dist/tsdown/dist-VDcV1Qyy.js +0 -2952
- package/dist/tsdown/require-BbBF8Ii0-BDaWJgzA.js +0 -320
- package/dist/tsdown/style-DiMP8pYv-DIC5PXeH.js +0 -88
- package/dist/tsdown/version-CQ98ZBpL-D6GAHapk.js +0 -169
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import process$1, { cwd } from "node:process";
|
|
3
|
+
import { formatWithOptions, inspect, styleText } from "node:util";
|
|
3
4
|
import readline from "node:readline";
|
|
4
5
|
import { isatty } from "node:tty";
|
|
5
6
|
import { spawn } from "node:child_process";
|
|
@@ -8,7 +9,91 @@ import { fileURLToPath } from "node:url";
|
|
|
8
9
|
import { pipeline } from "node:stream/promises";
|
|
9
10
|
import { PassThrough } from "node:stream";
|
|
10
11
|
import { closeSync, openSync, readSync, statSync } from "node:fs";
|
|
11
|
-
|
|
12
|
+
const picomatch = createRequire(import.meta.url)("./npm_entry_picomatch.cjs");
|
|
13
|
+
function toArray(val, defaultValue) {
|
|
14
|
+
if (Array.isArray(val)) return val;
|
|
15
|
+
else if (val == null) {
|
|
16
|
+
if (defaultValue) return [defaultValue];
|
|
17
|
+
return [];
|
|
18
|
+
} else return [val];
|
|
19
|
+
}
|
|
20
|
+
function resolveComma(arr) {
|
|
21
|
+
return arr.flatMap((format) => format.split(","));
|
|
22
|
+
}
|
|
23
|
+
function resolveRegex(str) {
|
|
24
|
+
if (typeof str === "string" && str.length > 2 && str[0] === "/" && str.at(-1) === "/") return new RegExp(str.slice(1, -1));
|
|
25
|
+
return str;
|
|
26
|
+
}
|
|
27
|
+
function slash(string) {
|
|
28
|
+
return string.replaceAll("\\", "/");
|
|
29
|
+
}
|
|
30
|
+
const noop = (v) => v;
|
|
31
|
+
function matchPattern(id, patterns) {
|
|
32
|
+
return patterns.some((pattern) => {
|
|
33
|
+
if (pattern instanceof RegExp) {
|
|
34
|
+
pattern.lastIndex = 0;
|
|
35
|
+
return pattern.test(id);
|
|
36
|
+
}
|
|
37
|
+
return id === pattern || picomatch(pattern)(id);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function pkgExists(moduleName) {
|
|
41
|
+
try {
|
|
42
|
+
import.meta.resolve(moduleName);
|
|
43
|
+
return true;
|
|
44
|
+
} catch {}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
async function importWithError(moduleName) {
|
|
48
|
+
try {
|
|
49
|
+
return await import(moduleName);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
throw new Error(`Failed to import module "${moduleName}". Please ensure it is installed.`, { cause: error });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function createConcurrencyExecutor(concurrency) {
|
|
55
|
+
if (concurrency == null) return (task) => task();
|
|
56
|
+
if (!Number.isInteger(concurrency) || concurrency < 1) throw new TypeError("`--concurrency` must be a positive integer");
|
|
57
|
+
const queue = [];
|
|
58
|
+
let active = 0;
|
|
59
|
+
return async (task) => {
|
|
60
|
+
if (active >= concurrency) await new Promise((resolve) => queue.push(resolve));
|
|
61
|
+
else active++;
|
|
62
|
+
try {
|
|
63
|
+
return await task();
|
|
64
|
+
} finally {
|
|
65
|
+
const next = queue.shift();
|
|
66
|
+
if (next) next();
|
|
67
|
+
else active--;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function debounce(fn, delay) {
|
|
72
|
+
let timer;
|
|
73
|
+
const debounced = (...args) => {
|
|
74
|
+
clearTimeout(timer);
|
|
75
|
+
timer = setTimeout(() => fn(...args), delay);
|
|
76
|
+
};
|
|
77
|
+
debounced.cancel = () => clearTimeout(timer);
|
|
78
|
+
return debounced;
|
|
79
|
+
}
|
|
80
|
+
let supportRGB = !!process$1.stdout.hasColors?.(2 ** 24);
|
|
81
|
+
if (supportRGB) try {
|
|
82
|
+
styleText("#000", "");
|
|
83
|
+
} catch {
|
|
84
|
+
supportRGB = false;
|
|
85
|
+
}
|
|
86
|
+
const factory = (...formats) => new Proxy(styleText.bind(void 0, formats), { get: (_, format) => {
|
|
87
|
+
if (format[0] === "#") {
|
|
88
|
+
const [color, fallback] = format.split(",", 2);
|
|
89
|
+
if (!supportRGB) return fallback ? factory(...formats, fallback) : factory(...formats);
|
|
90
|
+
return factory(...formats, color);
|
|
91
|
+
}
|
|
92
|
+
return factory(...formats, format);
|
|
93
|
+
} });
|
|
94
|
+
const styleText$1 = factory();
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region ../../node_modules/.pnpm/obug@3.0.0/node_modules/obug/dist/core.js
|
|
12
97
|
/**
|
|
13
98
|
* Coerce `value`.
|
|
14
99
|
*/
|
|
@@ -37,15 +122,16 @@ function matchesTemplate(search, template) {
|
|
|
37
122
|
let templateIndex = 0;
|
|
38
123
|
let starIndex = -1;
|
|
39
124
|
let matchIndex = 0;
|
|
40
|
-
while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*"))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
125
|
+
while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
126
|
+
if (template[templateIndex] === "*") {
|
|
127
|
+
starIndex = templateIndex;
|
|
128
|
+
matchIndex = searchIndex;
|
|
129
|
+
templateIndex++;
|
|
130
|
+
} else {
|
|
131
|
+
searchIndex++;
|
|
132
|
+
templateIndex++;
|
|
133
|
+
}
|
|
134
|
+
} else if (starIndex !== -1) {
|
|
49
135
|
templateIndex = starIndex + 1;
|
|
50
136
|
matchIndex++;
|
|
51
137
|
searchIndex = matchIndex;
|
|
@@ -69,7 +155,7 @@ function createDebug$1(namespace, options) {
|
|
|
69
155
|
let enableOverride;
|
|
70
156
|
let namespacesCache;
|
|
71
157
|
let enabledCache;
|
|
72
|
-
const debug = (...args) => {
|
|
158
|
+
const debug = ((...args) => {
|
|
73
159
|
if (!debug.enabled) return;
|
|
74
160
|
const curr = Date.now();
|
|
75
161
|
const diff = curr - (prevTime || curr);
|
|
@@ -91,7 +177,7 @@ function createDebug$1(namespace, options) {
|
|
|
91
177
|
});
|
|
92
178
|
options.formatArgs.call(debug, diff, args);
|
|
93
179
|
debug.log(...args);
|
|
94
|
-
};
|
|
180
|
+
});
|
|
95
181
|
debug.extend = function(namespace, delimiter = ":") {
|
|
96
182
|
return createDebug$1(this.namespace + delimiter + namespace, {
|
|
97
183
|
useColors: this.useColors,
|
|
@@ -141,7 +227,7 @@ function enabled(name) {
|
|
|
141
227
|
return false;
|
|
142
228
|
}
|
|
143
229
|
//#endregion
|
|
144
|
-
//#region ../../node_modules/.pnpm/obug@
|
|
230
|
+
//#region ../../node_modules/.pnpm/obug@3.0.0/node_modules/obug/dist/ansi.js
|
|
145
231
|
let env = {};
|
|
146
232
|
try {
|
|
147
233
|
process.env.DEBUG;
|
|
@@ -260,10 +346,10 @@ function formatArgs(diff, args) {
|
|
|
260
346
|
const { namespace: name, useColors } = this;
|
|
261
347
|
if (useColors) {
|
|
262
348
|
const c = this.color;
|
|
263
|
-
const colorCode = `\
|
|
264
|
-
const prefix = ` ${colorCode};1m${name} \
|
|
349
|
+
const colorCode = `\u{1B}[3${c < 8 ? c : `8;5;${c}`}`;
|
|
350
|
+
const prefix = ` ${colorCode};1m${name} \u{1B}[0m`;
|
|
265
351
|
args[0] = prefix + args[0].split("\n").join(`\n${prefix}`);
|
|
266
|
-
args.push(`${colorCode}m+${this.humanize(diff)}\
|
|
352
|
+
args.push(`${colorCode}m+${this.humanize(diff)}\u{1B}[0m`);
|
|
267
353
|
} else args[0] = `${getDate()}${name} ${args[0]}`;
|
|
268
354
|
}
|
|
269
355
|
function log(...args) {
|
|
@@ -652,4 +738,4 @@ const x = (command, args, userOptions) => {
|
|
|
652
738
|
};
|
|
653
739
|
const exec = x;
|
|
654
740
|
//#endregion
|
|
655
|
-
export { namespaces as a, enable as i, x as n, createDebug as r, exec as t };
|
|
741
|
+
export { namespaces as a, importWithError as c, pkgExists as d, resolveComma as f, toArray as g, styleText$1 as h, enable as i, matchPattern as l, slash as m, x as n, createConcurrencyExecutor as o, resolveRegex as p, createDebug as r, debounce as s, exec as t, noop as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./npm_cjs_chunk_rolldown-runtime.cjs");
|
|
2
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
2
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/constants.js
|
|
3
3
|
var require_constants = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
|
|
4
4
|
const WIN_SLASH = "\\\\/";
|
|
5
5
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
@@ -168,7 +168,7 @@ var require_constants = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin((
|
|
|
168
168
|
};
|
|
169
169
|
}));
|
|
170
170
|
//#endregion
|
|
171
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
171
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/utils.js
|
|
172
172
|
var require_utils = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
|
|
173
173
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
174
174
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
@@ -216,7 +216,7 @@ var require_utils = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exp
|
|
|
216
216
|
};
|
|
217
217
|
}));
|
|
218
218
|
//#endregion
|
|
219
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
219
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/scan.js
|
|
220
220
|
var require_scan = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
|
|
221
221
|
const utils = require_utils();
|
|
222
222
|
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
|
|
@@ -245,7 +245,7 @@ var require_scan = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((expo
|
|
|
245
245
|
const scan = (input, options) => {
|
|
246
246
|
const opts = options || {};
|
|
247
247
|
const length = input.length - 1;
|
|
248
|
-
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
248
|
+
const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
|
|
249
249
|
const slashes = [];
|
|
250
250
|
const tokens = [];
|
|
251
251
|
const parts = [];
|
|
@@ -348,14 +348,18 @@ var require_scan = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((expo
|
|
|
348
348
|
finished = true;
|
|
349
349
|
if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
|
|
350
350
|
if (scanToEnd === true) {
|
|
351
|
+
let parens = 0;
|
|
351
352
|
while (eos() !== true && (code = advance())) {
|
|
352
353
|
if (code === CHAR_BACKWARD_SLASH) {
|
|
353
354
|
backslashes = token.backslashes = true;
|
|
354
|
-
|
|
355
|
+
advance();
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
359
|
+
parens++;
|
|
355
360
|
continue;
|
|
356
361
|
}
|
|
357
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
358
|
-
isGlob = token.isGlob = true;
|
|
362
|
+
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
|
|
359
363
|
finished = true;
|
|
360
364
|
break;
|
|
361
365
|
}
|
|
@@ -403,13 +407,18 @@ var require_scan = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((expo
|
|
|
403
407
|
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
404
408
|
isGlob = token.isGlob = true;
|
|
405
409
|
if (scanToEnd === true) {
|
|
410
|
+
let parens = 1;
|
|
406
411
|
while (eos() !== true && (code = advance())) {
|
|
407
|
-
if (code ===
|
|
412
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
408
413
|
backslashes = token.backslashes = true;
|
|
409
|
-
|
|
414
|
+
advance();
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
418
|
+
parens++;
|
|
410
419
|
continue;
|
|
411
420
|
}
|
|
412
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
421
|
+
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
|
|
413
422
|
finished = true;
|
|
414
423
|
break;
|
|
415
424
|
}
|
|
@@ -472,7 +481,7 @@ var require_scan = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((expo
|
|
|
472
481
|
if (opts.parts === true || opts.tokens === true) {
|
|
473
482
|
let prevIndex;
|
|
474
483
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
475
|
-
const n = prevIndex ? prevIndex + 1 : start;
|
|
484
|
+
const n = prevIndex !== void 0 ? prevIndex + 1 : start;
|
|
476
485
|
const i = slashes[idx];
|
|
477
486
|
const value = input.slice(n, i);
|
|
478
487
|
if (opts.tokens) {
|
|
@@ -483,18 +492,19 @@ var require_scan = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((expo
|
|
|
483
492
|
depth(tokens[idx]);
|
|
484
493
|
state.maxDepth += tokens[idx].depth;
|
|
485
494
|
}
|
|
486
|
-
if (
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
if (prevIndex && prevIndex + 1 < input.length) {
|
|
490
|
-
const value = input.slice(prevIndex + 1);
|
|
491
|
-
parts.push(value);
|
|
492
|
-
if (opts.tokens) {
|
|
493
|
-
tokens[tokens.length - 1].value = value;
|
|
494
|
-
depth(tokens[tokens.length - 1]);
|
|
495
|
-
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
495
|
+
if (i >= start) {
|
|
496
|
+
parts.push(value);
|
|
497
|
+
prevIndex = i;
|
|
496
498
|
}
|
|
497
499
|
}
|
|
500
|
+
const n = prevIndex !== void 0 ? prevIndex + 1 : start;
|
|
501
|
+
const value = input.slice(n);
|
|
502
|
+
parts.push(value);
|
|
503
|
+
if (opts.tokens && prevIndex && prevIndex + 1 < input.length) {
|
|
504
|
+
tokens[tokens.length - 1].value = value;
|
|
505
|
+
depth(tokens[tokens.length - 1]);
|
|
506
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
507
|
+
}
|
|
498
508
|
state.slashes = slashes;
|
|
499
509
|
state.parts = parts;
|
|
500
510
|
}
|
|
@@ -503,7 +513,7 @@ var require_scan = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((expo
|
|
|
503
513
|
module.exports = scan;
|
|
504
514
|
}));
|
|
505
515
|
//#endregion
|
|
506
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
516
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/parse.js
|
|
507
517
|
var require_parse = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
|
|
508
518
|
const constants = require_constants();
|
|
509
519
|
const utils = require_utils();
|
|
@@ -1405,6 +1415,7 @@ var require_parse = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exp
|
|
|
1405
1415
|
rest = rest.slice(3);
|
|
1406
1416
|
consume("/**", 3);
|
|
1407
1417
|
}
|
|
1418
|
+
const isEnd = eos() || state.parens > 0 && rest === ")".repeat(state.parens) && !extglobs.some((extglob) => extglob.type === "negate");
|
|
1408
1419
|
if (prior.type === "bos" && eos()) {
|
|
1409
1420
|
prev.type = "globstar";
|
|
1410
1421
|
prev.value += value;
|
|
@@ -1414,7 +1425,7 @@ var require_parse = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exp
|
|
|
1414
1425
|
consume(value);
|
|
1415
1426
|
continue;
|
|
1416
1427
|
}
|
|
1417
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar &&
|
|
1428
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && isEnd) {
|
|
1418
1429
|
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
1419
1430
|
prior.output = `(?:${prior.output}`;
|
|
1420
1431
|
prev.type = "globstar";
|
|
@@ -1579,7 +1590,7 @@ var require_parse = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exp
|
|
|
1579
1590
|
module.exports = parse;
|
|
1580
1591
|
}));
|
|
1581
1592
|
//#endregion
|
|
1582
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
1593
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/picomatch.js
|
|
1583
1594
|
var require_picomatch$1 = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
|
|
1584
1595
|
const scan = require_scan();
|
|
1585
1596
|
const parse = require_parse();
|
|
@@ -1893,7 +1904,7 @@ var require_picomatch$1 = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin
|
|
|
1893
1904
|
module.exports = picomatch;
|
|
1894
1905
|
}));
|
|
1895
1906
|
//#endregion
|
|
1896
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
1907
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/index.js
|
|
1897
1908
|
var require_picomatch = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
|
|
1898
1909
|
const pico = require_picomatch$1();
|
|
1899
1910
|
const utils = require_utils();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as createDebug } from "./main-Du9xCnhX.js";
|
|
2
|
+
import { t as requireTSApi } from "./dist-BebyOHRu.js";
|
|
2
3
|
import path from "node:path";
|
|
3
|
-
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.28.
|
|
4
|
+
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.28.8_@typescript+native-preview@7.0.0-dev.20260707.2_@volar+types_4c1d5de710c0092ce9c83871c07b3140/node_modules/rolldown-plugin-dts/dist/resolver-DE0_sy8o.mjs
|
|
4
5
|
const debug = createDebug("rolldown-plugin-dts:tsc-resolver");
|
|
5
6
|
const ts = requireTSApi();
|
|
6
7
|
function tscResolve(id, importer, cwd, tsconfig, tsconfigRaw, reference) {
|
package/dist/tsdown/run.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { c as globalLogger, n as version, t as enableDebug } from "./debug-
|
|
4
|
-
import { n as x } from "./main-CyNcZUzu.js";
|
|
2
|
+
import { h as styleText$1, n as x } from "./main-Du9xCnhX.js";
|
|
3
|
+
import { c as globalLogger, n as version, t as enableDebug } from "./debug-DKTolR2K-BMJOFfj2.js";
|
|
5
4
|
import module from "node:module";
|
|
6
5
|
import process$1 from "node:process";
|
|
7
6
|
import { VERSION } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
8
|
-
//#region ../../node_modules/.pnpm/cac@7.0.
|
|
7
|
+
//#region ../../node_modules/.pnpm/cac@7.0.1/node_modules/cac/dist/index.js
|
|
9
8
|
function toArr(any) {
|
|
10
9
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
11
10
|
}
|
|
@@ -106,23 +105,23 @@ function findAllBrackets(v) {
|
|
|
106
105
|
}
|
|
107
106
|
function getMriOptions(options) {
|
|
108
107
|
const result = {
|
|
109
|
-
alias:
|
|
108
|
+
alias: Object.create(null),
|
|
110
109
|
boolean: []
|
|
111
110
|
};
|
|
112
111
|
for (const [index, option] of options.entries()) {
|
|
113
112
|
if (option.names.length > 1) result.alias[option.names[0]] = option.names.slice(1);
|
|
114
|
-
if (option.isBoolean)
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
if (option.isBoolean) {
|
|
114
|
+
if (option.negated) {
|
|
115
|
+
if (!options.some((o, i) => {
|
|
116
|
+
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
|
|
117
|
+
})) result.boolean.push(option.names[0]);
|
|
118
|
+
} else result.boolean.push(option.names[0]);
|
|
119
|
+
}
|
|
119
120
|
}
|
|
120
121
|
return result;
|
|
121
122
|
}
|
|
122
123
|
function findLongest(arr) {
|
|
123
|
-
return arr.sort((a, b) =>
|
|
124
|
-
return a.length > b.length ? -1 : 1;
|
|
125
|
-
})[0];
|
|
124
|
+
return arr.sort((a, b) => b.length - a.length)[0];
|
|
126
125
|
}
|
|
127
126
|
function padRight(str, length) {
|
|
128
127
|
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
|
|
@@ -132,7 +131,13 @@ function camelcase(input) {
|
|
|
132
131
|
return p1 + p2.toUpperCase();
|
|
133
132
|
});
|
|
134
133
|
}
|
|
134
|
+
const UNSAFE_KEYS = /* @__PURE__ */ new Set([
|
|
135
|
+
"__proto__",
|
|
136
|
+
"constructor",
|
|
137
|
+
"prototype"
|
|
138
|
+
]);
|
|
135
139
|
function setDotProp(obj, keys, val) {
|
|
140
|
+
if (keys.some((key) => UNSAFE_KEYS.has(key))) return;
|
|
136
141
|
let current = obj;
|
|
137
142
|
for (let i = 0; i < keys.length; i++) {
|
|
138
143
|
const key = keys[i];
|
|
@@ -148,12 +153,9 @@ function setDotProp(obj, keys, val) {
|
|
|
148
153
|
}
|
|
149
154
|
}
|
|
150
155
|
function setByType(obj, transforms) {
|
|
151
|
-
for (const key of Object.
|
|
152
|
-
|
|
153
|
-
if (transform.
|
|
154
|
-
obj[key] = [obj[key]].flat();
|
|
155
|
-
if (typeof transform.transformFunction === "function") obj[key] = obj[key].map(transform.transformFunction);
|
|
156
|
-
}
|
|
156
|
+
for (const [key, transform] of Object.entries(transforms)) if (transform.shouldTransform) {
|
|
157
|
+
obj[key] = [obj[key]].flat();
|
|
158
|
+
if (typeof transform.transformFunction === "function") obj[key] = obj[key].map(transform.transformFunction);
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
161
|
function getFileName(input) {
|
|
@@ -196,7 +198,7 @@ var Option = class {
|
|
|
196
198
|
name = name.replace(/^no-/, "");
|
|
197
199
|
}
|
|
198
200
|
return camelcaseOptionName(name);
|
|
199
|
-
}).sort((a, b) => a.length
|
|
201
|
+
}).sort((a, b) => a.length - b.length);
|
|
200
202
|
this.name = this.names.at(-1);
|
|
201
203
|
if (this.negated && this.config.default == null) this.config.default = true;
|
|
202
204
|
if (rawName.includes("<")) this.required = true;
|
|
@@ -299,7 +301,7 @@ var Command = class {
|
|
|
299
301
|
* @param name Option name
|
|
300
302
|
*/
|
|
301
303
|
hasOption(name) {
|
|
302
|
-
name = name.split(".")[0];
|
|
304
|
+
name = name.split(".", 1)[0];
|
|
303
305
|
return this.options.find((option) => {
|
|
304
306
|
return option.names.includes(name);
|
|
305
307
|
});
|
|
@@ -374,7 +376,7 @@ var Command = class {
|
|
|
374
376
|
const { options: parsedOptions, globalCommand } = this.cli;
|
|
375
377
|
const options = [...globalCommand.options, ...this.options];
|
|
376
378
|
for (const option of options) {
|
|
377
|
-
const value = parsedOptions[option.name.split(".")[0]];
|
|
379
|
+
const value = parsedOptions[option.name.split(".", 1)[0]];
|
|
378
380
|
if (option.required) {
|
|
379
381
|
const hasNegated = options.some((o) => o.negated && o.names.includes(option.name));
|
|
380
382
|
if (value === true || value === false && !hasNegated) throw new CACError(`option \`${option.rawName}\` value is missing`);
|
|
@@ -593,8 +595,8 @@ var CAC = class extends EventTarget {
|
|
|
593
595
|
transforms[cliOption.name].transformFunction = cliOption.config.type[0];
|
|
594
596
|
}
|
|
595
597
|
}
|
|
596
|
-
for (const key of Object.
|
|
597
|
-
setDotProp(options, key.split("."),
|
|
598
|
+
for (const [key, value] of Object.entries(parsed)) if (key !== "_") {
|
|
599
|
+
setDotProp(options, key.split("."), value);
|
|
598
600
|
setByType(options, transforms);
|
|
599
601
|
}
|
|
600
602
|
return {
|
|
@@ -623,7 +625,7 @@ var CAC = class extends EventTarget {
|
|
|
623
625
|
*/
|
|
624
626
|
const cac = (name = "") => new CAC(name);
|
|
625
627
|
//#endregion
|
|
626
|
-
//#region ../../node_modules/.pnpm/tsdown@0.23.
|
|
628
|
+
//#region ../../node_modules/.pnpm/tsdown@0.23.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.1_@tsdown+exe@0.23.1_@type_1c5668b23b89ab367f1fd43e24d0d72d/node_modules/tsdown/dist/run.mjs
|
|
627
629
|
const cli = cac("tsdown");
|
|
628
630
|
cli.help().version(version);
|
|
629
631
|
cli.command("[...files]", "Bundle files", {
|
|
@@ -632,7 +634,7 @@ cli.command("[...files]", "Bundle files", {
|
|
|
632
634
|
}).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, tsx, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--deps.never-bundle <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims ", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: "TSDOWN_" }).option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("--root <dir>", "Root directory of input files").option("--exe", "Bundle as executable").option("-W, --workspace [dir]", "Enable workspace mode").option("--concurrency <count>", "Maximum number of Rolldown builds to run in parallel").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate package exports for package.json").action(async (input, flags) => {
|
|
633
635
|
globalLogger.level = flags.logLevel || "info";
|
|
634
636
|
globalLogger.info(`${styleText$1.blue(`tsdown v${version}`)} powered by ${styleText$1["#ff7e17,yellow"](`rolldown v${VERSION}`)}`);
|
|
635
|
-
const { build } = await import("./build-
|
|
637
|
+
const { build } = await import("./build-KEepWO_k-BOsPZ2cH.js").then((n) => n.r).then((n) => n.r);
|
|
636
638
|
if (input.length > 0) flags.entry = input;
|
|
637
639
|
await build(flags);
|
|
638
640
|
});
|
|
@@ -345,7 +345,7 @@ var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
345
345
|
};
|
|
346
346
|
}));
|
|
347
347
|
//#endregion
|
|
348
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
348
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.29_tsx@4.23.15_yaml@2.9.1/node_modules/postcss-load-config/src/req.js
|
|
349
349
|
var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
350
350
|
const { createRequire } = __require("node:module");
|
|
351
351
|
const { pathToFileURL } = __require("node:url");
|
|
@@ -387,7 +387,7 @@ var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
387
387
|
module.exports = req;
|
|
388
388
|
}));
|
|
389
389
|
//#endregion
|
|
390
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
390
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.29_tsx@4.23.15_yaml@2.9.1/node_modules/postcss-load-config/src/options.js
|
|
391
391
|
var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
392
392
|
const req = require_req();
|
|
393
393
|
/**
|
|
@@ -421,7 +421,7 @@ var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
421
421
|
module.exports = options;
|
|
422
422
|
}));
|
|
423
423
|
//#endregion
|
|
424
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
424
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.29_tsx@4.23.15_yaml@2.9.1/node_modules/postcss-load-config/src/plugins.js
|
|
425
425
|
var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
426
426
|
const req = require_req();
|
|
427
427
|
/**
|
|
@@ -475,7 +475,7 @@ var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
475
475
|
module.exports = plugins;
|
|
476
476
|
}));
|
|
477
477
|
//#endregion
|
|
478
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
478
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.29_tsx@4.23.15_yaml@2.9.1/node_modules/postcss-load-config/src/index.js
|
|
479
479
|
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
480
480
|
const { resolve } = __require("node:path");
|
|
481
481
|
const config = require_src$1();
|