@rolldown/browser 1.0.0-beta.42 → 1.0.0-beta.44
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/cli-setup.d.mts +1 -0
- package/dist/cli-setup.mjs +16 -0
- package/dist/cli.mjs +1046 -67
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.browser.mjs +51 -453
- package/dist/experimental-index.d.mts +26 -5
- package/dist/experimental-index.mjs +56 -16
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/parallel-plugin-worker.mjs +3 -3
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasi-browser.js +2 -3
- package/dist/rolldown-binding.wasi.cjs +2 -3
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-CtbNz6TD.d.mts → binding-0m41EAn-.d.mts} +108 -17
- package/dist/shared/{define-config-xBdWOg15.d.mts → define-config-BbwLmCDX.d.mts} +250 -87
- package/dist/shared/{dist-CU0dSkK2.mjs → dist-DNFKY37q.mjs} +1 -1
- package/dist/shared/{load-config-B4-CoeU7.mjs → load-config-B3FsKQ_6.mjs} +2 -2
- package/dist/shared/{parse-ast-index-Gktxd-oi.mjs → parse-ast-index-Ck5SwMSC.mjs} +37 -6
- package/dist/shared/{prompt-B4e-jZUR.mjs → prompt-BDwA3jSr.mjs} +1 -1
- package/dist/shared/{src-DbG0hppv.mjs → src-BnIhK3nA.mjs} +234 -328
- package/dist/{src-D_rsgcbb.js → src-CIeG_TGR.js} +506 -570
- package/package.json +1 -1
- package/dist/shared/logger-B83ocDok.mjs +0 -985
|
@@ -1,33 +1,7 @@
|
|
|
1
|
-
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy,
|
|
1
|
+
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingMagicString as BindingMagicString$1, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
2
2
|
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __commonJS = (cb, mod) => function() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i$1 = 0, n$2 = keys.length, key; i$1 < n$2; i$1++) {
|
|
15
|
-
key = keys[i$1];
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
-
get: ((k) => from[k]).bind(null, key),
|
|
18
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
-
value: mod,
|
|
25
|
-
enumerable: true
|
|
26
|
-
}) : target, mod));
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
3
|
//#region package.json
|
|
30
|
-
var version = "1.0.0-beta.
|
|
4
|
+
var version = "1.0.0-beta.44";
|
|
31
5
|
|
|
32
6
|
//#endregion
|
|
33
7
|
//#region src/utils/code-frame.ts
|
|
@@ -68,6 +42,12 @@ function getCodeFrame(source, line, column) {
|
|
|
68
42
|
}).join("\n");
|
|
69
43
|
}
|
|
70
44
|
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/utils/style-text.ts
|
|
47
|
+
function styleText(...args$1) {
|
|
48
|
+
return args$1[1];
|
|
49
|
+
}
|
|
50
|
+
|
|
71
51
|
//#endregion
|
|
72
52
|
//#region src/log/locate-character/index.js
|
|
73
53
|
/** @typedef {import('./types').Location} Location */
|
|
@@ -85,18 +65,18 @@ function rangeContains(range, index) {
|
|
|
85
65
|
function getLocator(source, options = {}) {
|
|
86
66
|
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
87
67
|
let start = 0;
|
|
88
|
-
const ranges = source.split("\n").map((line, i$
|
|
68
|
+
const ranges = source.split("\n").map((line, i$1) => {
|
|
89
69
|
const end = start + line.length + 1;
|
|
90
70
|
/** @type {import('./types').Range} */
|
|
91
71
|
const range = {
|
|
92
72
|
start,
|
|
93
73
|
end,
|
|
94
|
-
line: i$
|
|
74
|
+
line: i$1
|
|
95
75
|
};
|
|
96
76
|
start = end;
|
|
97
77
|
return range;
|
|
98
78
|
});
|
|
99
|
-
let i
|
|
79
|
+
let i = 0;
|
|
100
80
|
/**
|
|
101
81
|
* @param {string | number} search
|
|
102
82
|
* @param {number} [index]
|
|
@@ -105,16 +85,16 @@ function getLocator(source, options = {}) {
|
|
|
105
85
|
function locator(search, index) {
|
|
106
86
|
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
107
87
|
if (search === -1) return void 0;
|
|
108
|
-
let range = ranges[i
|
|
109
|
-
const d
|
|
88
|
+
let range = ranges[i];
|
|
89
|
+
const d = search >= range.end ? 1 : -1;
|
|
110
90
|
while (range) {
|
|
111
91
|
if (rangeContains(range, search)) return {
|
|
112
92
|
line: offsetLine + range.line,
|
|
113
93
|
column: offsetColumn + search - range.start,
|
|
114
94
|
character: search
|
|
115
95
|
};
|
|
116
|
-
i
|
|
117
|
-
range = ranges[i
|
|
96
|
+
i += d;
|
|
97
|
+
range = ranges[i];
|
|
118
98
|
}
|
|
119
99
|
}
|
|
120
100
|
return locator;
|
|
@@ -131,7 +111,7 @@ function locate(source, search, options) {
|
|
|
131
111
|
|
|
132
112
|
//#endregion
|
|
133
113
|
//#region src/log/logs.ts
|
|
134
|
-
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR",
|
|
114
|
+
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER", DEPRECATED_DEFINE = "DEPRECATED_DEFINE", DEPRECATED_INJECT = "DEPRECATED_INJECT", DEPRECATED_PROFILER_NAMES = "DEPRECATED_PROFILER_NAMES", DEPRECATED_KEEP_NAMES = "DEPRECATED_KEEP_NAMES", DEPRECATED_DROP_LABELS = "DEPRECATED_DROP_LABELS";
|
|
135
115
|
function logParseError(message) {
|
|
136
116
|
return {
|
|
137
117
|
code: PARSE_ERROR,
|
|
@@ -162,18 +142,42 @@ function logMultiplyNotifyOption() {
|
|
|
162
142
|
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
163
143
|
};
|
|
164
144
|
}
|
|
165
|
-
function logDuplicateJsxConfig() {
|
|
166
|
-
return {
|
|
167
|
-
code: DUPLICATE_JSX_CONFIG,
|
|
168
|
-
message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
145
|
function logNoFileSystemInBrowser(method) {
|
|
172
146
|
return {
|
|
173
147
|
code: NO_FS_IN_BROWSER,
|
|
174
148
|
message: `Cannot access the file system (via "${method}") when using the browser build of Rolldown.`
|
|
175
149
|
};
|
|
176
150
|
}
|
|
151
|
+
function logDeprecatedDefine() {
|
|
152
|
+
return {
|
|
153
|
+
code: DEPRECATED_DEFINE,
|
|
154
|
+
message: `${styleText(["yellow", "bold"], "⚠ Deprecation Warning:")} The top-level "define" option is deprecated. Use "transform.define" instead.`
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function logDeprecatedInject() {
|
|
158
|
+
return {
|
|
159
|
+
code: DEPRECATED_INJECT,
|
|
160
|
+
message: `${styleText(["yellow", "bold"], "⚠ Deprecation Warning:")} The top-level "inject" option is deprecated. Use "transform.inject" instead.`
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function logDeprecatedProfilerNames() {
|
|
164
|
+
return {
|
|
165
|
+
code: DEPRECATED_PROFILER_NAMES,
|
|
166
|
+
message: "The top-level \"profilerNames\" option is deprecated. Use \"output.generatedCode.profilerNames\" instead."
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function logDeprecatedKeepNames() {
|
|
170
|
+
return {
|
|
171
|
+
code: DEPRECATED_KEEP_NAMES,
|
|
172
|
+
message: "The top-level \"keepNames\" option is deprecated. Use \"output.keepNames\" instead."
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function logDeprecatedDropLabels() {
|
|
176
|
+
return {
|
|
177
|
+
code: DEPRECATED_DROP_LABELS,
|
|
178
|
+
message: `${styleText(["yellow", "bold"], "⚠ Deprecation Warning:")} The top-level "dropLabels" option is deprecated. Use "transform.dropLabels" instead.`
|
|
179
|
+
};
|
|
180
|
+
}
|
|
177
181
|
function logPluginError(error$1, plugin, { hook, id: id$1 } = {}) {
|
|
178
182
|
try {
|
|
179
183
|
const code$1 = error$1.code;
|
|
@@ -235,9 +239,9 @@ function makeBuiltinPluginCallable(plugin) {
|
|
|
235
239
|
for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
|
|
236
240
|
try {
|
|
237
241
|
return await callablePlugin[key](...args$1);
|
|
238
|
-
} catch (e$
|
|
239
|
-
if (e$
|
|
240
|
-
return error(logPluginError(e$
|
|
242
|
+
} catch (e$1) {
|
|
243
|
+
if (e$1 instanceof Error && !e$1.stack?.includes("at ")) Error.captureStackTrace(e$1, wrappedPlugin[key]);
|
|
244
|
+
return error(logPluginError(e$1, plugin.name, {
|
|
241
245
|
hook: key,
|
|
242
246
|
id: key === "transform" ? args$1[2] : void 0
|
|
243
247
|
}));
|
|
@@ -256,187 +260,187 @@ function bindingifyBuiltInPlugin(plugin) {
|
|
|
256
260
|
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
257
261
|
let _lazyMatch = () => {
|
|
258
262
|
var __lib__ = (() => {
|
|
259
|
-
var m
|
|
260
|
-
for (var n$
|
|
261
|
-
get: e$
|
|
263
|
+
var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e$1) => {
|
|
264
|
+
for (var n$1 in e$1) m(r, n$1, {
|
|
265
|
+
get: e$1[n$1],
|
|
262
266
|
enumerable: true
|
|
263
267
|
});
|
|
264
|
-
}, H = (r
|
|
265
|
-
if (e$
|
|
266
|
-
get: () => e$
|
|
267
|
-
enumerable: !(a
|
|
268
|
+
}, H = (r, e$1, n$1, a) => {
|
|
269
|
+
if (e$1 && typeof e$1 == "object" || typeof e$1 == "function") for (let t$2 of G(e$1)) !T.call(r, t$2) && t$2 !== n$1 && m(r, t$2, {
|
|
270
|
+
get: () => e$1[t$2],
|
|
271
|
+
enumerable: !(a = V(e$1, t$2)) || a.enumerable
|
|
268
272
|
});
|
|
269
|
-
return r
|
|
270
|
-
}, J = (r
|
|
271
|
-
q(w
|
|
272
|
-
var A = (r
|
|
273
|
-
const e$
|
|
274
|
-
return (n$
|
|
275
|
-
const a
|
|
276
|
-
if (a
|
|
277
|
-
const t$
|
|
278
|
-
return e$
|
|
273
|
+
return r;
|
|
274
|
+
}, J = (r) => H(m({}, "__esModule", { value: true }), r), w = {};
|
|
275
|
+
q(w, { default: () => re });
|
|
276
|
+
var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
|
|
277
|
+
const e$1 = /* @__PURE__ */ new Map();
|
|
278
|
+
return (n$1) => {
|
|
279
|
+
const a = e$1.get(n$1);
|
|
280
|
+
if (a) return a;
|
|
281
|
+
const t$2 = r(n$1);
|
|
282
|
+
return e$1.set(n$1, t$2), t$2;
|
|
279
283
|
};
|
|
280
|
-
}, rr = (r
|
|
281
|
-
const a
|
|
284
|
+
}, rr = (r, e$1, n$1 = {}) => {
|
|
285
|
+
const a = {
|
|
282
286
|
cache: {},
|
|
283
|
-
input: r
|
|
287
|
+
input: r,
|
|
284
288
|
index: 0,
|
|
285
289
|
indexMax: 0,
|
|
286
|
-
options: n$
|
|
290
|
+
options: n$1,
|
|
287
291
|
output: []
|
|
288
292
|
};
|
|
289
|
-
if (v(e$
|
|
290
|
-
throw new Error(`Failed to parse at index ${a
|
|
291
|
-
}, i
|
|
292
|
-
const n$
|
|
293
|
-
for (const a
|
|
294
|
-
if (a
|
|
295
|
-
const t$
|
|
296
|
-
n$
|
|
293
|
+
if (v(e$1)(a) && a.index === r.length) return a.output;
|
|
294
|
+
throw new Error(`Failed to parse at index ${a.indexMax}`);
|
|
295
|
+
}, i = (r, e$1) => A(r) ? er(r, e$1) : b(r) ? ar(r, e$1) : nr(r, e$1), er = (r, e$1) => {
|
|
296
|
+
const n$1 = {};
|
|
297
|
+
for (const a of r) {
|
|
298
|
+
if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
|
|
299
|
+
const t$2 = a.charCodeAt(0);
|
|
300
|
+
n$1[t$2] = true;
|
|
297
301
|
}
|
|
298
|
-
return (a
|
|
299
|
-
const t$
|
|
300
|
-
for (; a
|
|
301
|
-
const u
|
|
302
|
-
if (u
|
|
303
|
-
if (!h
|
|
304
|
-
const s
|
|
305
|
-
h
|
|
302
|
+
return (a) => {
|
|
303
|
+
const t$2 = a.index, o = a.input;
|
|
304
|
+
for (; a.index < o.length && o.charCodeAt(a.index) in n$1;) a.index += 1;
|
|
305
|
+
const u = a.index;
|
|
306
|
+
if (u > t$2) {
|
|
307
|
+
if (!h(e$1) && !a.options.silent) {
|
|
308
|
+
const s = a.input.slice(t$2, u), c = d(e$1) ? e$1(s, o, String(t$2)) : e$1;
|
|
309
|
+
h(c) || a.output.push(c);
|
|
306
310
|
}
|
|
307
|
-
a
|
|
311
|
+
a.indexMax = Math.max(a.indexMax, a.index);
|
|
308
312
|
}
|
|
309
313
|
return true;
|
|
310
314
|
};
|
|
311
|
-
}, nr = (r
|
|
312
|
-
const n$
|
|
313
|
-
return g
|
|
314
|
-
t$
|
|
315
|
-
const u
|
|
316
|
-
if (u
|
|
317
|
-
if (!h
|
|
318
|
-
const s
|
|
319
|
-
h
|
|
315
|
+
}, nr = (r, e$1) => {
|
|
316
|
+
const n$1 = r.source, a = r.flags.replace(/y|$/, "y"), t$2 = new RegExp(n$1, a);
|
|
317
|
+
return g((o) => {
|
|
318
|
+
t$2.lastIndex = o.index;
|
|
319
|
+
const u = t$2.exec(o.input);
|
|
320
|
+
if (u) {
|
|
321
|
+
if (!h(e$1) && !o.options.silent) {
|
|
322
|
+
const s = d(e$1) ? e$1(...u, o.input, String(o.index)) : e$1;
|
|
323
|
+
h(s) || o.output.push(s);
|
|
320
324
|
}
|
|
321
|
-
return o
|
|
325
|
+
return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
|
|
322
326
|
} else return false;
|
|
323
327
|
});
|
|
324
|
-
}, ar = (r
|
|
325
|
-
if (n$
|
|
326
|
-
if (!h
|
|
327
|
-
const t$
|
|
328
|
-
h
|
|
328
|
+
}, ar = (r, e$1) => (n$1) => {
|
|
329
|
+
if (n$1.input.startsWith(r, n$1.index)) {
|
|
330
|
+
if (!h(e$1) && !n$1.options.silent) {
|
|
331
|
+
const t$2 = d(e$1) ? e$1(r, n$1.input, String(n$1.index)) : e$1;
|
|
332
|
+
h(t$2) || n$1.output.push(t$2);
|
|
329
333
|
}
|
|
330
|
-
return n$
|
|
334
|
+
return n$1.index += r.length, n$1.indexMax = Math.max(n$1.indexMax, n$1.index), true;
|
|
331
335
|
} else return false;
|
|
332
|
-
}, C = (r
|
|
333
|
-
const t$
|
|
334
|
-
return g
|
|
335
|
-
let u
|
|
336
|
-
for (; u
|
|
337
|
-
const s
|
|
338
|
-
if (!t$
|
|
336
|
+
}, C = (r, e$1, n$1, a) => {
|
|
337
|
+
const t$2 = v(r);
|
|
338
|
+
return g(_(M((o) => {
|
|
339
|
+
let u = 0;
|
|
340
|
+
for (; u < n$1;) {
|
|
341
|
+
const s = o.index;
|
|
342
|
+
if (!t$2(o) || (u += 1, o.index === s)) break;
|
|
339
343
|
}
|
|
340
|
-
return u
|
|
344
|
+
return u >= e$1;
|
|
341
345
|
})));
|
|
342
|
-
}, tr = (r
|
|
343
|
-
const n$
|
|
344
|
-
return g
|
|
345
|
-
for (let t$
|
|
346
|
+
}, tr = (r, e$1) => C(r, 0, 1), f = (r, e$1) => C(r, 0, Infinity), x = (r, e$1) => {
|
|
347
|
+
const n$1 = r.map(v);
|
|
348
|
+
return g(_(M((a) => {
|
|
349
|
+
for (let t$2 = 0, o = n$1.length; t$2 < o; t$2++) if (!n$1[t$2](a)) return false;
|
|
346
350
|
return true;
|
|
347
351
|
})));
|
|
348
|
-
}, l
|
|
349
|
-
const n$
|
|
350
|
-
return g
|
|
351
|
-
for (let t$
|
|
352
|
+
}, l = (r, e$1) => {
|
|
353
|
+
const n$1 = r.map(v);
|
|
354
|
+
return g(_((a) => {
|
|
355
|
+
for (let t$2 = 0, o = n$1.length; t$2 < o; t$2++) if (n$1[t$2](a)) return true;
|
|
352
356
|
return false;
|
|
353
357
|
}));
|
|
354
|
-
}, M = (r
|
|
355
|
-
const n$
|
|
356
|
-
return (a
|
|
357
|
-
const t$
|
|
358
|
-
return (!u
|
|
358
|
+
}, M = (r, e$1 = false) => {
|
|
359
|
+
const n$1 = v(r);
|
|
360
|
+
return (a) => {
|
|
361
|
+
const t$2 = a.index, o = a.output.length, u = n$1(a);
|
|
362
|
+
return (!u || e$1) && (a.index = t$2, a.output.length !== o && (a.output.length = o)), u;
|
|
359
363
|
};
|
|
360
|
-
}, _ = (r
|
|
361
|
-
return v(r
|
|
362
|
-
}, g
|
|
363
|
-
let r
|
|
364
|
-
return (e$
|
|
365
|
-
const n$
|
|
366
|
-
return (t$
|
|
367
|
-
var o
|
|
368
|
-
if (t$
|
|
369
|
-
const u
|
|
370
|
-
if (c
|
|
371
|
-
if (W(c
|
|
372
|
-
if (c
|
|
364
|
+
}, _ = (r, e$1) => {
|
|
365
|
+
return v(r);
|
|
366
|
+
}, g = (() => {
|
|
367
|
+
let r = 0;
|
|
368
|
+
return (e$1) => {
|
|
369
|
+
const n$1 = v(e$1), a = r += 1;
|
|
370
|
+
return (t$2) => {
|
|
371
|
+
var o;
|
|
372
|
+
if (t$2.options.memoization === false) return n$1(t$2);
|
|
373
|
+
const u = t$2.index, s = (o = t$2.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
|
|
374
|
+
if (c === false) return false;
|
|
375
|
+
if (W(c)) return t$2.index = c, true;
|
|
376
|
+
if (c) return t$2.index = c.index, c.output?.length && t$2.output.push(...c.output), true;
|
|
373
377
|
{
|
|
374
|
-
const Z = t$
|
|
375
|
-
if (n$
|
|
376
|
-
const D = t$
|
|
378
|
+
const Z = t$2.output.length;
|
|
379
|
+
if (n$1(t$2)) {
|
|
380
|
+
const D = t$2.index, U = t$2.output.length;
|
|
377
381
|
if (U > Z) {
|
|
378
|
-
const ee = t$
|
|
379
|
-
s
|
|
382
|
+
const ee = t$2.output.slice(Z, U);
|
|
383
|
+
s.set(u, {
|
|
380
384
|
index: D,
|
|
381
385
|
output: ee
|
|
382
386
|
});
|
|
383
|
-
} else s
|
|
387
|
+
} else s.set(u, D);
|
|
384
388
|
return true;
|
|
385
|
-
} else return s
|
|
389
|
+
} else return s.set(u, false), false;
|
|
386
390
|
}
|
|
387
391
|
};
|
|
388
392
|
};
|
|
389
|
-
})(), E = (r
|
|
390
|
-
let e$
|
|
391
|
-
return (n$
|
|
392
|
-
}, v = Y((r
|
|
393
|
-
if (d
|
|
394
|
-
if (b
|
|
395
|
-
if (A(r
|
|
396
|
-
if (K(r
|
|
393
|
+
})(), E = (r) => {
|
|
394
|
+
let e$1;
|
|
395
|
+
return (n$1) => (e$1 || (e$1 = v(r())), e$1(n$1));
|
|
396
|
+
}, v = Y((r) => {
|
|
397
|
+
if (d(r)) return Q(r) ? E(r) : r;
|
|
398
|
+
if (b(r) || X(r)) return i(r);
|
|
399
|
+
if (A(r)) return x(r);
|
|
400
|
+
if (K(r)) return l(Object.values(r));
|
|
397
401
|
throw new Error("Invalid rule");
|
|
398
|
-
}), P = "abcdefghijklmnopqrstuvwxyz", ir = (r
|
|
399
|
-
let e$
|
|
400
|
-
for (; r
|
|
401
|
-
return e$
|
|
402
|
-
}, O
|
|
403
|
-
let e$
|
|
404
|
-
for (let n$
|
|
405
|
-
return e$
|
|
406
|
-
}, S = (r
|
|
407
|
-
if (e$
|
|
408
|
-
const n$
|
|
409
|
-
for (; r
|
|
410
|
-
return n$
|
|
411
|
-
}, or$1 = (r
|
|
412
|
-
const e$
|
|
413
|
-
return (n$
|
|
414
|
-
}, sr = i
|
|
415
|
-
i
|
|
416
|
-
i
|
|
417
|
-
i
|
|
418
|
-
i
|
|
419
|
-
]), N = l
|
|
402
|
+
}), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
|
|
403
|
+
let e$1 = "";
|
|
404
|
+
for (; r > 0;) e$1 = P[(r - 1) % 26] + e$1, r = Math.floor((r - 1) / 26);
|
|
405
|
+
return e$1;
|
|
406
|
+
}, O = (r) => {
|
|
407
|
+
let e$1 = 0;
|
|
408
|
+
for (let n$1 = 0, a = r.length; n$1 < a; n$1++) e$1 = e$1 * 26 + P.indexOf(r[n$1]) + 1;
|
|
409
|
+
return e$1;
|
|
410
|
+
}, S = (r, e$1) => {
|
|
411
|
+
if (e$1 < r) return S(e$1, r);
|
|
412
|
+
const n$1 = [];
|
|
413
|
+
for (; r <= e$1;) n$1.push(r++);
|
|
414
|
+
return n$1;
|
|
415
|
+
}, or$1 = (r, e$1, n$1) => S(r, e$1).map((a) => String(a).padStart(n$1, "0")), R = (r, e$1) => S(O(r), O(e$1)).map(ir), p = (r) => r, z = (r) => ur((e$1) => rr(e$1, r, { memoization: false }).join("")), ur = (r) => {
|
|
416
|
+
const e$1 = {};
|
|
417
|
+
return (n$1) => e$1[n$1] ?? (e$1[n$1] = r(n$1));
|
|
418
|
+
}, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e$1, n$1) => `.*${e$1 ? "" : "(?:^|/)"}${n$1.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e$1, n$1, a) => `.*${e$1 ? "" : "(?:^|/)"}${n$1.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), fr = l([i(/^(?:!!)*!(.*)$/, (r, e$1) => `(?!^${L(e$1)}$).*?`), i(/^(!!)+/, "")]), j = l([
|
|
419
|
+
i(/\/(\*\*\/)+/, "(?:/.+/|/)"),
|
|
420
|
+
i(/^(\*\*\/)+/, "(?:^|.*/)"),
|
|
421
|
+
i(/\/(\*\*)$/, "(?:/.*|$)"),
|
|
422
|
+
i(/\*\*/, ".*")
|
|
423
|
+
]), N = l([i(/\*\/(?!\*\*\/)/, "[^/]*/"), i(/\*/, "[^/]*")]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Er = l([
|
|
420
424
|
y,
|
|
421
|
-
i
|
|
425
|
+
i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`),
|
|
422
426
|
br,
|
|
423
|
-
i
|
|
427
|
+
i(/[^\]]/, p)
|
|
424
428
|
]), B = x([
|
|
425
429
|
$r,
|
|
426
430
|
tr(Ar),
|
|
427
|
-
f
|
|
431
|
+
f(Er),
|
|
428
432
|
wr
|
|
429
|
-
]), Pr = i
|
|
433
|
+
]), Pr = i("{", "(?:"), Or$1 = i("}", ")"), I = x([
|
|
430
434
|
Pr,
|
|
431
|
-
l
|
|
432
|
-
i
|
|
433
|
-
i
|
|
434
|
-
i
|
|
435
|
+
l([
|
|
436
|
+
i(/(\d+)\.\.(\d+)/, (r, e$1, n$1) => or$1(+e$1, +n$1, Math.min(e$1.length, n$1.length)).join("|")),
|
|
437
|
+
i(/([a-z]+)\.\.([a-z]+)/, (r, e$1, n$1) => R(e$1, n$1).join("|")),
|
|
438
|
+
i(/([A-Z]+)\.\.([A-Z]+)/, (r, e$1, n$1) => R(e$1.toLowerCase(), n$1.toLowerCase()).join("|").toUpperCase())
|
|
435
439
|
]),
|
|
436
440
|
Or$1
|
|
437
|
-
]), kr = i
|
|
441
|
+
]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), F = x([
|
|
438
442
|
kr,
|
|
439
|
-
f
|
|
443
|
+
f(l([
|
|
440
444
|
j,
|
|
441
445
|
N,
|
|
442
446
|
k,
|
|
@@ -449,7 +453,7 @@ let _lazyMatch = () => {
|
|
|
449
453
|
Lr
|
|
450
454
|
])),
|
|
451
455
|
Br
|
|
452
|
-
]), L = z(f
|
|
456
|
+
]), L = z(f(l([
|
|
453
457
|
sr,
|
|
454
458
|
cr,
|
|
455
459
|
lr,
|
|
@@ -463,21 +467,21 @@ let _lazyMatch = () => {
|
|
|
463
467
|
y,
|
|
464
468
|
pr,
|
|
465
469
|
vr
|
|
466
|
-
]))), Tr = i
|
|
470
|
+
]))), Tr = i(/\\./, p), qr = i(/./, p), Yr = z(f(l([
|
|
467
471
|
Tr,
|
|
468
|
-
i
|
|
469
|
-
i
|
|
470
|
-
i
|
|
472
|
+
i(/\*\*\*+/, "*"),
|
|
473
|
+
i(/([^/{[(!])\*\*/, (r, e$1) => `${e$1}*`),
|
|
474
|
+
i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e$1) => `${e$1}*`),
|
|
471
475
|
qr
|
|
472
|
-
]))), $ = (r
|
|
473
|
-
const n$
|
|
474
|
-
if (!n$
|
|
475
|
-
const a
|
|
476
|
-
return a
|
|
476
|
+
]))), $ = (r, e$1) => {
|
|
477
|
+
const n$1 = Array.isArray(r) ? r : [r];
|
|
478
|
+
if (!n$1.length) return false;
|
|
479
|
+
const a = n$1.map($.compile), t$2 = n$1.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e$1.replace(/[\\\/]+/g, "/").replace(/\/$/, t$2 ? "/" : "");
|
|
480
|
+
return a.some((s) => s.test(o));
|
|
477
481
|
};
|
|
478
|
-
$.compile = (r
|
|
482
|
+
$.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
|
|
479
483
|
var re = $;
|
|
480
|
-
return J(w
|
|
484
|
+
return J(w);
|
|
481
485
|
})();
|
|
482
486
|
return __lib__.default || __lib__;
|
|
483
487
|
};
|
|
@@ -492,7 +496,7 @@ const zeptomatch = (path, pattern) => {
|
|
|
492
496
|
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
493
497
|
function normalizeWindowsPath(input = "") {
|
|
494
498
|
if (!input) return input;
|
|
495
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r
|
|
499
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
496
500
|
}
|
|
497
501
|
const _UNC_REGEX = /^[/\\]{2}/;
|
|
498
502
|
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
@@ -601,15 +605,15 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
601
605
|
}
|
|
602
606
|
return res;
|
|
603
607
|
}
|
|
604
|
-
const isAbsolute = function(p
|
|
605
|
-
return _IS_ABSOLUTE_RE.test(p
|
|
608
|
+
const isAbsolute = function(p) {
|
|
609
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
606
610
|
};
|
|
607
|
-
const toNamespacedPath = function(p
|
|
608
|
-
return normalizeWindowsPath(p
|
|
611
|
+
const toNamespacedPath = function(p) {
|
|
612
|
+
return normalizeWindowsPath(p);
|
|
609
613
|
};
|
|
610
|
-
const extname = function(p
|
|
611
|
-
if (p
|
|
612
|
-
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p
|
|
614
|
+
const extname = function(p) {
|
|
615
|
+
if (p === "..") return "";
|
|
616
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
613
617
|
return match && match[1] || "";
|
|
614
618
|
};
|
|
615
619
|
const relative = function(from, to) {
|
|
@@ -624,25 +628,25 @@ const relative = function(from, to) {
|
|
|
624
628
|
}
|
|
625
629
|
return [..._from.map(() => ".."), ..._to].join("/");
|
|
626
630
|
};
|
|
627
|
-
const dirname = function(p
|
|
628
|
-
const segments = normalizeWindowsPath(p
|
|
631
|
+
const dirname = function(p) {
|
|
632
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
629
633
|
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
630
|
-
return segments.join("/") || (isAbsolute(p
|
|
634
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
631
635
|
};
|
|
632
|
-
const format = function(p
|
|
633
|
-
const ext = p
|
|
636
|
+
const format = function(p) {
|
|
637
|
+
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
634
638
|
const segments = [
|
|
635
|
-
p
|
|
636
|
-
p
|
|
637
|
-
p
|
|
639
|
+
p.root,
|
|
640
|
+
p.dir,
|
|
641
|
+
p.base ?? (p.name ?? "") + ext
|
|
638
642
|
].filter(Boolean);
|
|
639
|
-
return normalizeWindowsPath(p
|
|
643
|
+
return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
|
|
640
644
|
};
|
|
641
|
-
const basename = function(p
|
|
642
|
-
const segments = normalizeWindowsPath(p
|
|
645
|
+
const basename = function(p, extension) {
|
|
646
|
+
const segments = normalizeWindowsPath(p).split("/");
|
|
643
647
|
let lastSegment = "";
|
|
644
|
-
for (let i
|
|
645
|
-
const val = segments[i
|
|
648
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
649
|
+
const val = segments[i];
|
|
646
650
|
if (val) {
|
|
647
651
|
lastSegment = val;
|
|
648
652
|
break;
|
|
@@ -650,13 +654,13 @@ const basename = function(p$1, extension) {
|
|
|
650
654
|
}
|
|
651
655
|
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
652
656
|
};
|
|
653
|
-
const parse = function(p
|
|
654
|
-
const root = _PATH_ROOT_RE.exec(p
|
|
655
|
-
const base = basename(p
|
|
657
|
+
const parse = function(p) {
|
|
658
|
+
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
659
|
+
const base = basename(p);
|
|
656
660
|
const extension = extname(base);
|
|
657
661
|
return {
|
|
658
662
|
root,
|
|
659
|
-
dir: dirname(p
|
|
663
|
+
dir: dirname(p),
|
|
660
664
|
base,
|
|
661
665
|
ext: extension,
|
|
662
666
|
name: base.slice(0, base.length - extension.length)
|
|
@@ -959,8 +963,8 @@ var MinimalPluginContextImpl = class {
|
|
|
959
963
|
watchMode
|
|
960
964
|
};
|
|
961
965
|
}
|
|
962
|
-
error(e$
|
|
963
|
-
return error(logPluginError(normalizeLog(e$
|
|
966
|
+
error(e$1) {
|
|
967
|
+
return error(logPluginError(normalizeLog(e$1), this.pluginName, { hook: this.hookName }));
|
|
964
968
|
}
|
|
965
969
|
};
|
|
966
970
|
|
|
@@ -1031,117 +1035,6 @@ function getSortedPlugins(hookName, plugins) {
|
|
|
1031
1035
|
];
|
|
1032
1036
|
}
|
|
1033
1037
|
|
|
1034
|
-
//#endregion
|
|
1035
|
-
//#region ../../node_modules/.pnpm/ansis@4.2.0/node_modules/ansis/index.cjs
|
|
1036
|
-
var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis@4.2.0/node_modules/ansis/index.cjs": ((exports, module) => {
|
|
1037
|
-
let e$1, t$2, r, { defineProperty: l, setPrototypeOf: n$1, create: o, keys: s } = Object, i = "", { round: c, max: a$1 } = Math, p = (e$2) => {
|
|
1038
|
-
let t$3 = /([a-f\d]{3,6})/i.exec(e$2)?.[1], r$1 = t$3?.length, l$1 = parseInt(6 ^ r$1 ? 3 ^ r$1 ? "0" : t$3[0] + t$3[0] + t$3[1] + t$3[1] + t$3[2] + t$3[2] : t$3, 16);
|
|
1039
|
-
return [
|
|
1040
|
-
l$1 >> 16 & 255,
|
|
1041
|
-
l$1 >> 8 & 255,
|
|
1042
|
-
255 & l$1
|
|
1043
|
-
];
|
|
1044
|
-
}, u = (e$2, t$3, r$1) => e$2 ^ t$3 || t$3 ^ r$1 ? 16 + 36 * c(e$2 / 51) + 6 * c(t$3 / 51) + c(r$1 / 51) : 8 > e$2 ? 16 : e$2 > 248 ? 231 : c(24 * (e$2 - 8) / 247) + 232, d = (e$2) => {
|
|
1045
|
-
let t$3, r$1, l$1, n$2, o$1;
|
|
1046
|
-
return 8 > e$2 ? 30 + e$2 : 16 > e$2 ? e$2 - 8 + 90 : (232 > e$2 ? (o$1 = (e$2 -= 16) % 36, t$3 = (e$2 / 36 | 0) / 5, r$1 = (o$1 / 6 | 0) / 5, l$1 = o$1 % 6 / 5) : t$3 = r$1 = l$1 = (10 * (e$2 - 232) + 8) / 255, n$2 = 2 * a$1(t$3, r$1, l$1), n$2 ? 30 + (c(l$1) << 2 | c(r$1) << 1 | c(t$3)) + (2 ^ n$2 ? 0 : 60) : 30);
|
|
1047
|
-
}, f = (() => {
|
|
1048
|
-
let r$1 = (e$2) => o$1.some(((t$3) => e$2.test(t$3))), l$1 = globalThis, n$2 = l$1.process ?? {}, o$1 = n$2.argv ?? [], i$1 = n$2.env ?? {}, c$1 = -1;
|
|
1049
|
-
try {
|
|
1050
|
-
e$1 = "," + s(i$1).join(",");
|
|
1051
|
-
} catch (e$2) {
|
|
1052
|
-
i$1 = {}, c$1 = 0;
|
|
1053
|
-
}
|
|
1054
|
-
let a$2 = "FORCE_COLOR", p$1 = {
|
|
1055
|
-
false: 0,
|
|
1056
|
-
0: 0,
|
|
1057
|
-
1: 1,
|
|
1058
|
-
2: 2,
|
|
1059
|
-
3: 3
|
|
1060
|
-
}[i$1[a$2]] ?? -1, u$1 = a$2 in i$1 && p$1 || r$1(/^--color=?(true|always)?$/);
|
|
1061
|
-
return u$1 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, l$2, n$3) => (t$2 = r$2.TERM, {
|
|
1062
|
-
"24bit": 3,
|
|
1063
|
-
truecolor: 3,
|
|
1064
|
-
ansi256: 2,
|
|
1065
|
-
ansi: 1
|
|
1066
|
-
}[r$2.COLORTERM] || (r$2.CI ? /,GITHUB/.test(e$1) ? 3 : 1 : l$2 && "dumb" !== t$2 ? n$3 ? 3 : /-256/.test(t$2) ? 2 : 1 : 0)))(i$1, !!i$1.PM2_HOME || i$1.NEXT_RUNTIME?.includes("edge") || !!n$2.stdout?.isTTY, "win32" === n$2.platform)), !p$1 || i$1.NO_COLOR || r$1(/^--(no-color|color=(false|never))$/) ? 0 : l$1.window?.chrome || u$1 && !c$1 ? 3 : c$1;
|
|
1067
|
-
})(), g = {
|
|
1068
|
-
open: i,
|
|
1069
|
-
close: i
|
|
1070
|
-
}, h = 39, b = 49, O = {}, m = ({ p: e$2 }, { open: t$3, close: l$1 }) => {
|
|
1071
|
-
let o$1 = (e$3, ...r$1) => {
|
|
1072
|
-
if (!e$3) {
|
|
1073
|
-
if (t$3 && t$3 === l$1) return t$3;
|
|
1074
|
-
if ((e$3 ?? i) === i) return i;
|
|
1075
|
-
}
|
|
1076
|
-
let n$2, s$2 = e$3.raw ? String.raw({ raw: e$3 }, ...r$1) : i + e$3, c$2 = o$1.p, a$2 = c$2.o, p$1 = c$2.c;
|
|
1077
|
-
if (s$2.includes("\x1B")) for (; c$2; c$2 = c$2.p) {
|
|
1078
|
-
let { open: e$4, close: t$4 } = c$2, r$2 = t$4.length, l$2 = i, o$2 = 0;
|
|
1079
|
-
if (r$2) for (; ~(n$2 = s$2.indexOf(t$4, o$2)); o$2 = n$2 + r$2) l$2 += s$2.slice(o$2, n$2) + e$4;
|
|
1080
|
-
s$2 = l$2 + s$2.slice(o$2);
|
|
1081
|
-
}
|
|
1082
|
-
return a$2 + (s$2.includes("\n") ? s$2.replace(/(\r?\n)/g, p$1 + "$1" + a$2) : s$2) + p$1;
|
|
1083
|
-
}, s$1 = t$3, c$1 = l$1;
|
|
1084
|
-
return e$2 && (s$1 = e$2.o + t$3, c$1 = l$1 + e$2.c), n$1(o$1, r), o$1.p = {
|
|
1085
|
-
open: t$3,
|
|
1086
|
-
close: l$1,
|
|
1087
|
-
o: s$1,
|
|
1088
|
-
c: c$1,
|
|
1089
|
-
p: e$2
|
|
1090
|
-
}, o$1.open = s$1, o$1.close = c$1, o$1;
|
|
1091
|
-
};
|
|
1092
|
-
const w = new function e$2(t$3 = f) {
|
|
1093
|
-
let s$1 = {
|
|
1094
|
-
Ansis: e$2,
|
|
1095
|
-
level: t$3,
|
|
1096
|
-
isSupported: () => a$2,
|
|
1097
|
-
strip: (e$3) => e$3.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
|
|
1098
|
-
extend(e$3) {
|
|
1099
|
-
for (let t$4 in e$3) {
|
|
1100
|
-
let r$1 = e$3[t$4], l$1 = (typeof r$1)[0];
|
|
1101
|
-
"s" === l$1 ? (c$1(t$4, T(...p(r$1))), c$1(_(t$4), v(...p(r$1)))) : c$1(t$4, r$1, "f" === l$1);
|
|
1102
|
-
}
|
|
1103
|
-
return r = o({}, O), n$1(s$1, r), s$1;
|
|
1104
|
-
}
|
|
1105
|
-
}, c$1 = (e$3, t$4, r$1) => {
|
|
1106
|
-
O[e$3] = { get() {
|
|
1107
|
-
let n$2 = r$1 ? (...e$4) => m(this, t$4(...e$4)) : m(this, t$4);
|
|
1108
|
-
return l(this, e$3, { value: n$2 }), n$2;
|
|
1109
|
-
} };
|
|
1110
|
-
}, a$2 = t$3 > 0, w$1 = (e$3, t$4) => a$2 ? {
|
|
1111
|
-
open: `[${e$3}m`,
|
|
1112
|
-
close: `[${t$4}m`
|
|
1113
|
-
} : g, y = (e$3) => (t$4) => e$3(...p(t$4)), R = (e$3, t$4) => (r$1, l$1, n$2) => w$1(`${e$3}8;2;${r$1};${l$1};${n$2}`, t$4), $ = (e$3, t$4) => (r$1, l$1, n$2) => w$1(((e$4, t$5, r$2) => d(u(e$4, t$5, r$2)))(r$1, l$1, n$2) + e$3, t$4), x = (e$3) => (t$4, r$1, l$1) => e$3(u(t$4, r$1, l$1)), T = R(3, h), v = R(4, b), C = (e$3) => w$1("38;5;" + e$3, h), E = (e$3) => w$1("48;5;" + e$3, b);
|
|
1114
|
-
2 === t$3 ? (T = x(C), v = x(E)) : 1 === t$3 && (T = $(0, h), v = $(10, b), C = (e$3) => w$1(d(e$3), h), E = (e$3) => w$1(d(e$3) + 10, b));
|
|
1115
|
-
let M, I = {
|
|
1116
|
-
fg: C,
|
|
1117
|
-
bg: E,
|
|
1118
|
-
rgb: T,
|
|
1119
|
-
bgRgb: v,
|
|
1120
|
-
hex: y(T),
|
|
1121
|
-
bgHex: y(v),
|
|
1122
|
-
visible: g,
|
|
1123
|
-
reset: w$1(0, 0),
|
|
1124
|
-
bold: w$1(1, 22),
|
|
1125
|
-
dim: w$1(2, 22),
|
|
1126
|
-
italic: w$1(3, 23),
|
|
1127
|
-
underline: w$1(4, 24),
|
|
1128
|
-
inverse: w$1(7, 27),
|
|
1129
|
-
hidden: w$1(8, 28),
|
|
1130
|
-
strikethrough: w$1(9, 29)
|
|
1131
|
-
}, _ = (e$3) => "bg" + e$3[0].toUpperCase() + e$3.slice(1), k = "Bright";
|
|
1132
|
-
return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$3, t$4) => {
|
|
1133
|
-
M = _(e$3), 8 > t$4 ? (I[e$3 + k] = w$1(90 + t$4, h), I[M + k] = w$1(100 + t$4, b)) : t$4 = 60, I[e$3] = w$1(30 + t$4, h), I[M] = w$1(40 + t$4, b);
|
|
1134
|
-
})), s$1.extend(I);
|
|
1135
|
-
}();
|
|
1136
|
-
module.exports = w, w.default = w;
|
|
1137
|
-
}) });
|
|
1138
|
-
|
|
1139
|
-
//#endregion
|
|
1140
|
-
//#region ../../node_modules/.pnpm/ansis@4.2.0/node_modules/ansis/index.mjs
|
|
1141
|
-
var import_ansis = /* @__PURE__ */ __toESM(require_ansis(), 1);
|
|
1142
|
-
var ansis_default = import_ansis.default;
|
|
1143
|
-
const { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bold, dim, italic, underline, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = import_ansis.default;
|
|
1144
|
-
|
|
1145
1038
|
//#endregion
|
|
1146
1039
|
//#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.9.3/node_modules/valibot/dist/index.js
|
|
1147
1040
|
var store;
|
|
@@ -2168,17 +2061,6 @@ const JsxOptionsSchema = strictObject({
|
|
|
2168
2061
|
pragmaFrag: pipe(optional(string()), description("Jsx fragment transformation")),
|
|
2169
2062
|
refresh: pipe(optional(boolean()), description("Enable react fast refresh"))
|
|
2170
2063
|
});
|
|
2171
|
-
const RollupJsxOptionsSchema = strictObject({
|
|
2172
|
-
mode: optional(union([
|
|
2173
|
-
literal("classic"),
|
|
2174
|
-
literal("automatic"),
|
|
2175
|
-
literal("preserve")
|
|
2176
|
-
])),
|
|
2177
|
-
factory: optional(string()),
|
|
2178
|
-
fragment: optional(string()),
|
|
2179
|
-
importSource: optional(string()),
|
|
2180
|
-
jsxImportSource: optional(string())
|
|
2181
|
-
});
|
|
2182
2064
|
const HelperModeSchema = union([literal("Runtime"), literal("External")]);
|
|
2183
2065
|
const DecoratorOptionSchema = object({
|
|
2184
2066
|
legacy: optional(boolean()),
|
|
@@ -2215,7 +2097,10 @@ const TransformOptionsSchema = object({
|
|
|
2215
2097
|
helpers: optional(HelpersSchema),
|
|
2216
2098
|
decorators: optional(DecoratorOptionSchema),
|
|
2217
2099
|
jsx: optional(union([literal("preserve"), JsxOptionsSchema])),
|
|
2218
|
-
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment"))
|
|
2100
|
+
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
|
|
2101
|
+
define: optional(record(string(), string())),
|
|
2102
|
+
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
2103
|
+
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names"))
|
|
2219
2104
|
});
|
|
2220
2105
|
const WatchOptionsSchema = strictObject({
|
|
2221
2106
|
chokidar: optional(never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
|
|
@@ -2342,11 +2227,11 @@ const InputOptionsSchema = strictObject({
|
|
|
2342
2227
|
literal("browser"),
|
|
2343
2228
|
literal("neutral"),
|
|
2344
2229
|
literal("node")
|
|
2345
|
-
])), description(`Platform for which the code should be generated (node, ${
|
|
2230
|
+
])), description(`Platform for which the code should be generated (node, ${styleText("underline", "browser")}, neutral)`)),
|
|
2346
2231
|
shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
|
|
2347
2232
|
treeshake: optional(TreeshakingOptionsSchema),
|
|
2348
2233
|
optimization: optional(OptimizationOptionsSchema),
|
|
2349
|
-
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${
|
|
2234
|
+
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${styleText("dim", "silent")}, ${styleText(["underline", "gray"], "info")}, debug, ${styleText("yellow", "warn")})`)),
|
|
2350
2235
|
onLog: optional(OnLogSchema),
|
|
2351
2236
|
onwarn: optional(OnwarnSchema),
|
|
2352
2237
|
moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
|
|
@@ -2368,18 +2253,12 @@ const InputOptionsSchema = strictObject({
|
|
|
2368
2253
|
chunkImportMap: optional(union([boolean(), object({
|
|
2369
2254
|
baseUrl: optional(string()),
|
|
2370
2255
|
fileName: optional(string())
|
|
2371
|
-
})]))
|
|
2256
|
+
})])),
|
|
2257
|
+
nativeMagicString: optional(boolean())
|
|
2372
2258
|
})),
|
|
2373
2259
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
2374
2260
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
2375
2261
|
profilerNames: optional(boolean()),
|
|
2376
|
-
jsx: optional(union([
|
|
2377
|
-
literal(false),
|
|
2378
|
-
literal("react"),
|
|
2379
|
-
literal("react-jsx"),
|
|
2380
|
-
literal("preserve"),
|
|
2381
|
-
RollupJsxOptionsSchema
|
|
2382
|
-
])),
|
|
2383
2262
|
transform: optional(TransformOptionsSchema),
|
|
2384
2263
|
watch: optional(union([WatchOptionsSchema, literal(false)])),
|
|
2385
2264
|
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
|
|
@@ -2400,12 +2279,6 @@ const InputCliOverrideSchema = strictObject({
|
|
|
2400
2279
|
inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
|
|
2401
2280
|
treeshake: pipe(optional(boolean()), description("enable treeshaking")),
|
|
2402
2281
|
makeAbsoluteExternalsRelative: pipe(optional(boolean()), description("Prevent normalization of external imports")),
|
|
2403
|
-
jsx: pipe(optional(union([
|
|
2404
|
-
literal(false),
|
|
2405
|
-
literal("react"),
|
|
2406
|
-
literal("react-jsx"),
|
|
2407
|
-
literal("preserve")
|
|
2408
|
-
])), description("Jsx options preset")),
|
|
2409
2282
|
preserveEntrySignatures: pipe(optional(literal(false)), description("Avoid facade chunks for entry points")),
|
|
2410
2283
|
context: pipe(optional(string()), description("The entity top-level `this` represents."))
|
|
2411
2284
|
});
|
|
@@ -2435,6 +2308,7 @@ const ChunkFileNamesSchema = union([string(), pipe(function_(), args(tuple([cust
|
|
|
2435
2308
|
const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([custom(() => true)])), returns(string()))]);
|
|
2436
2309
|
const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
|
|
2437
2310
|
const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
|
|
2311
|
+
const PathsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
|
|
2438
2312
|
const AdvancedChunksSchema = strictObject({
|
|
2439
2313
|
includeDependenciesRecursively: optional(boolean()),
|
|
2440
2314
|
minSize: optional(number()),
|
|
@@ -2460,7 +2334,8 @@ const AdvancedChunksSchema = strictObject({
|
|
|
2460
2334
|
const GeneratedCodePresetSchema = union([literal("es5"), literal("es2015")]);
|
|
2461
2335
|
const GeneratedCodeOptionsSchema = strictObject({
|
|
2462
2336
|
symbols: pipe(optional(boolean()), description("Whether to use Symbol.toStringTag for namespace objects")),
|
|
2463
|
-
preset: GeneratedCodePresetSchema
|
|
2337
|
+
preset: GeneratedCodePresetSchema,
|
|
2338
|
+
profilerNames: pipe(optional(boolean()), description("Whether to add readable names to internal variables for profiling purposes"))
|
|
2464
2339
|
});
|
|
2465
2340
|
const OutputOptionsSchema = strictObject({
|
|
2466
2341
|
dir: pipe(optional(string()), description("Output directory, defaults to `dist` if `file` is not set")),
|
|
@@ -2470,18 +2345,18 @@ const OutputOptionsSchema = strictObject({
|
|
|
2470
2345
|
literal("named"),
|
|
2471
2346
|
literal("default"),
|
|
2472
2347
|
literal("none")
|
|
2473
|
-
])), description(`Specify a export mode (${
|
|
2348
|
+
])), description(`Specify a export mode (${styleText("underline", "auto")}, named, default, none)`)),
|
|
2474
2349
|
hashCharacters: pipe(optional(union([
|
|
2475
2350
|
literal("base64"),
|
|
2476
2351
|
literal("base36"),
|
|
2477
2352
|
literal("hex")
|
|
2478
2353
|
])), description("Use the specified character set for file hashes")),
|
|
2479
|
-
format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${
|
|
2354
|
+
format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${styleText("underline", "esm")}, cjs, and iife)`)),
|
|
2480
2355
|
sourcemap: pipe(optional(union([
|
|
2481
2356
|
boolean(),
|
|
2482
2357
|
literal("inline"),
|
|
2483
2358
|
literal("hidden")
|
|
2484
|
-
])), description(`Generate sourcemap (\`-s inline\` for inline, or ${
|
|
2359
|
+
])), description(`Generate sourcemap (\`-s inline\` for inline, or ${styleText("bold", "pass the `-s` on the last argument if you want to generate `.map` file")})`)),
|
|
2485
2360
|
sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
|
|
2486
2361
|
sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
|
|
2487
2362
|
sourcemapIgnoreList: optional(union([
|
|
@@ -2509,6 +2384,7 @@ const OutputOptionsSchema = strictObject({
|
|
|
2509
2384
|
])), description("Minify the bundled file")),
|
|
2510
2385
|
name: pipe(optional(string()), description("Name for UMD / IIFE format outputs")),
|
|
2511
2386
|
globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
|
|
2387
|
+
paths: pipe(optional(union([record(string(), string()), PathsFunctionSchema])), description("Maps external module IDs to paths")),
|
|
2512
2388
|
generatedCode: pipe(optional(partial(GeneratedCodeOptionsSchema)), description("Generated code options")),
|
|
2513
2389
|
externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
|
|
2514
2390
|
inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
|
|
@@ -2525,10 +2401,12 @@ const OutputOptionsSchema = strictObject({
|
|
|
2525
2401
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2526
2402
|
virtualDirname: optional(string()),
|
|
2527
2403
|
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
|
|
2528
|
-
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`."))
|
|
2404
|
+
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`.")),
|
|
2405
|
+
cleanDir: pipe(optional(boolean()), description("Clean output directory before emitting output")),
|
|
2406
|
+
keepNames: pipe(optional(boolean()), description("Keep function and class names after bundling"))
|
|
2529
2407
|
});
|
|
2530
2408
|
const getAddonDescription = (placement, wrapper) => {
|
|
2531
|
-
return `Code to insert the ${
|
|
2409
|
+
return `Code to insert the ${styleText("bold", placement)} of the bundled file (${styleText("bold", wrapper)} the wrapper function)`;
|
|
2532
2410
|
};
|
|
2533
2411
|
const OutputCliOverrideSchema = strictObject({
|
|
2534
2412
|
assetFileNames: pipe(optional(string()), description("Name pattern for asset files")),
|
|
@@ -2581,7 +2459,7 @@ function validateOption(key, options) {
|
|
|
2581
2459
|
let issueMsg = issue.message;
|
|
2582
2460
|
const issuePaths = issue.path.map((path) => path.key);
|
|
2583
2461
|
if (issue.type === "union") {
|
|
2584
|
-
const subIssue = issue.issues?.find((i
|
|
2462
|
+
const subIssue = issue.issues?.find((i) => !(i.type !== issue.received && i.input === issue.input));
|
|
2585
2463
|
if (subIssue) {
|
|
2586
2464
|
if (subIssue.path) issuePaths.push(subIssue.path.map((path) => path.key));
|
|
2587
2465
|
issueMsg = subIssue.message;
|
|
@@ -2596,6 +2474,77 @@ function validateOption(key, options) {
|
|
|
2596
2474
|
}
|
|
2597
2475
|
}
|
|
2598
2476
|
|
|
2477
|
+
//#endregion
|
|
2478
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.95.0/node_modules/oxc-parser/src-js/wrap.js
|
|
2479
|
+
function wrap$1(result) {
|
|
2480
|
+
let program, module, comments, errors;
|
|
2481
|
+
return {
|
|
2482
|
+
get program() {
|
|
2483
|
+
if (!program) program = jsonParseAst(result.program);
|
|
2484
|
+
return program;
|
|
2485
|
+
},
|
|
2486
|
+
get module() {
|
|
2487
|
+
if (!module) module = result.module;
|
|
2488
|
+
return module;
|
|
2489
|
+
},
|
|
2490
|
+
get comments() {
|
|
2491
|
+
if (!comments) comments = result.comments;
|
|
2492
|
+
return comments;
|
|
2493
|
+
},
|
|
2494
|
+
get errors() {
|
|
2495
|
+
if (!errors) errors = result.errors;
|
|
2496
|
+
return errors;
|
|
2497
|
+
}
|
|
2498
|
+
};
|
|
2499
|
+
}
|
|
2500
|
+
function jsonParseAst(programJson) {
|
|
2501
|
+
const { node: program, fixes } = JSON.parse(programJson);
|
|
2502
|
+
for (const fixPath of fixes) applyFix(program, fixPath);
|
|
2503
|
+
return program;
|
|
2504
|
+
}
|
|
2505
|
+
function applyFix(program, fixPath) {
|
|
2506
|
+
let node = program;
|
|
2507
|
+
for (const key of fixPath) node = node[key];
|
|
2508
|
+
if (node.bigint) node.value = BigInt(node.bigint);
|
|
2509
|
+
else try {
|
|
2510
|
+
node.value = RegExp(node.regex.pattern, node.regex.flags);
|
|
2511
|
+
} catch (_err) {}
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
//#endregion
|
|
2515
|
+
//#region src/parse-ast-index.ts
|
|
2516
|
+
function wrap(result, sourceText) {
|
|
2517
|
+
result = wrap$1(result);
|
|
2518
|
+
if (result.errors.length > 0) return normalizeParseError(sourceText, result.errors);
|
|
2519
|
+
return result.program;
|
|
2520
|
+
}
|
|
2521
|
+
function normalizeParseError(sourceText, errors) {
|
|
2522
|
+
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
2523
|
+
for (let i = 0; i < errors.length; i++) {
|
|
2524
|
+
if (i >= 5) {
|
|
2525
|
+
message += "\n...";
|
|
2526
|
+
break;
|
|
2527
|
+
}
|
|
2528
|
+
const e$1 = errors[i];
|
|
2529
|
+
message += e$1.message + "\n" + e$1.labels.map((label) => {
|
|
2530
|
+
const location = locate(sourceText, label.start, { offsetLine: 1 });
|
|
2531
|
+
if (!location) return;
|
|
2532
|
+
return getCodeFrame(sourceText, location.line, location.column);
|
|
2533
|
+
}).filter(Boolean).join("\n");
|
|
2534
|
+
}
|
|
2535
|
+
return error(logParseError(message));
|
|
2536
|
+
}
|
|
2537
|
+
const defaultParserOptions = {
|
|
2538
|
+
lang: "js",
|
|
2539
|
+
preserveParens: false
|
|
2540
|
+
};
|
|
2541
|
+
function parseAst(sourceText, options, filename) {
|
|
2542
|
+
return wrap(parseSync(filename ?? "file.js", sourceText, {
|
|
2543
|
+
...defaultParserOptions,
|
|
2544
|
+
...options
|
|
2545
|
+
}), sourceText);
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2599
2548
|
//#endregion
|
|
2600
2549
|
//#region src/types/sourcemap.ts
|
|
2601
2550
|
function bindingifySourcemap$1(map) {
|
|
@@ -2604,8 +2553,8 @@ function bindingifySourcemap$1(map) {
|
|
|
2604
2553
|
file: map.file ?? void 0,
|
|
2605
2554
|
mappings: map.mappings,
|
|
2606
2555
|
sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
|
|
2607
|
-
sources: map.sources?.map((s
|
|
2608
|
-
sourcesContent: map.sourcesContent?.map((s
|
|
2556
|
+
sources: map.sources?.map((s) => s ?? void 0),
|
|
2557
|
+
sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
|
|
2609
2558
|
names: map.names,
|
|
2610
2559
|
x_google_ignoreList: map.x_google_ignoreList,
|
|
2611
2560
|
debugId: "debugId" in map ? map.debugId : void 0
|
|
@@ -2618,23 +2567,27 @@ function unwrapBindingResult(container) {
|
|
|
2618
2567
|
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) throw aggregateBindingErrorsIntoJsError(container.errors);
|
|
2619
2568
|
return container;
|
|
2620
2569
|
}
|
|
2621
|
-
function
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2570
|
+
function normalizeBindingResult(container) {
|
|
2571
|
+
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) return aggregateBindingErrorsIntoJsError(container.errors);
|
|
2572
|
+
return container;
|
|
2573
|
+
}
|
|
2574
|
+
function normalizeBindingError(e$1) {
|
|
2575
|
+
return e$1.type === "JsError" ? e$1.field0 : Object.assign(/* @__PURE__ */ new Error(), {
|
|
2576
|
+
kind: e$1.field0.kind,
|
|
2577
|
+
message: e$1.field0.message,
|
|
2625
2578
|
stack: void 0
|
|
2626
2579
|
});
|
|
2627
2580
|
}
|
|
2628
2581
|
function aggregateBindingErrorsIntoJsError(rawErrors) {
|
|
2629
2582
|
const errors = rawErrors.map(normalizeBindingError);
|
|
2630
2583
|
let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
2631
|
-
for (let i
|
|
2584
|
+
for (let i = 0; i < errors.length; i++) {
|
|
2632
2585
|
summary += "\n";
|
|
2633
|
-
if (i
|
|
2586
|
+
if (i >= 5) {
|
|
2634
2587
|
summary += "...";
|
|
2635
2588
|
break;
|
|
2636
2589
|
}
|
|
2637
|
-
summary += getErrorMessage(errors[i
|
|
2590
|
+
summary += getErrorMessage(errors[i]);
|
|
2638
2591
|
}
|
|
2639
2592
|
const wrapper = new Error(summary);
|
|
2640
2593
|
Object.defineProperty(wrapper, "errors", {
|
|
@@ -2649,25 +2602,25 @@ function aggregateBindingErrorsIntoJsError(rawErrors) {
|
|
|
2649
2602
|
});
|
|
2650
2603
|
return wrapper;
|
|
2651
2604
|
}
|
|
2652
|
-
function getErrorMessage(e$
|
|
2653
|
-
if (Object.hasOwn(e$
|
|
2654
|
-
let s
|
|
2655
|
-
if (e$
|
|
2656
|
-
const id$1 = e$
|
|
2605
|
+
function getErrorMessage(e$1) {
|
|
2606
|
+
if (Object.hasOwn(e$1, "kind")) return e$1.message;
|
|
2607
|
+
let s = "";
|
|
2608
|
+
if (e$1.plugin) s += `[plugin ${e$1.plugin}]`;
|
|
2609
|
+
const id$1 = e$1.id ?? e$1.loc?.file;
|
|
2657
2610
|
if (id$1) {
|
|
2658
|
-
s
|
|
2659
|
-
if (e$
|
|
2611
|
+
s += " " + id$1;
|
|
2612
|
+
if (e$1.loc) s += `:${e$1.loc.line}:${e$1.loc.column}`;
|
|
2660
2613
|
}
|
|
2661
|
-
if (s
|
|
2662
|
-
const message = `${e$
|
|
2663
|
-
s
|
|
2664
|
-
if (e$
|
|
2665
|
-
if (e$
|
|
2666
|
-
if (e$
|
|
2667
|
-
s
|
|
2668
|
-
s
|
|
2614
|
+
if (s) s += "\n";
|
|
2615
|
+
const message = `${e$1.name ?? "Error"}: ${e$1.message}`;
|
|
2616
|
+
s += message;
|
|
2617
|
+
if (e$1.frame) s = joinNewLine(s, e$1.frame);
|
|
2618
|
+
if (e$1.stack) s = joinNewLine(s, e$1.stack.replace(message, ""));
|
|
2619
|
+
if (e$1.cause) {
|
|
2620
|
+
s = joinNewLine(s, "Caused by:");
|
|
2621
|
+
s = joinNewLine(s, getErrorMessage(e$1.cause).split("\n").map((line) => " " + line).join("\n"));
|
|
2669
2622
|
}
|
|
2670
|
-
return s
|
|
2623
|
+
return s;
|
|
2671
2624
|
}
|
|
2672
2625
|
function joinNewLine(s1, s2) {
|
|
2673
2626
|
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
@@ -2795,42 +2748,42 @@ function exclude(expr) {
|
|
|
2795
2748
|
|
|
2796
2749
|
//#endregion
|
|
2797
2750
|
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
|
|
2798
|
-
function e(e$
|
|
2799
|
-
let r
|
|
2800
|
-
return n$
|
|
2801
|
-
lazy: n$
|
|
2802
|
-
lazyArgs: t$
|
|
2751
|
+
function e(e$1, t$2, n$1) {
|
|
2752
|
+
let r = (n$2) => e$1(n$2, ...t$2);
|
|
2753
|
+
return n$1 === void 0 ? r : Object.assign(r, {
|
|
2754
|
+
lazy: n$1,
|
|
2755
|
+
lazyArgs: t$2
|
|
2803
2756
|
});
|
|
2804
2757
|
}
|
|
2805
2758
|
|
|
2806
2759
|
//#endregion
|
|
2807
2760
|
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
|
|
2808
|
-
function t(t$
|
|
2809
|
-
let i
|
|
2810
|
-
if (i
|
|
2811
|
-
if (i
|
|
2761
|
+
function t(t$2, n$1, r) {
|
|
2762
|
+
let i = t$2.length - n$1.length;
|
|
2763
|
+
if (i === 0) return t$2(...n$1);
|
|
2764
|
+
if (i === 1) return e(t$2, n$1, r);
|
|
2812
2765
|
throw Error(`Wrong number of arguments`);
|
|
2813
2766
|
}
|
|
2814
2767
|
|
|
2815
2768
|
//#endregion
|
|
2816
2769
|
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/partition-DAu403JQ.js
|
|
2817
|
-
function t$1(...t$
|
|
2818
|
-
return t(n, t$
|
|
2770
|
+
function t$1(...t$2) {
|
|
2771
|
+
return t(n, t$2);
|
|
2819
2772
|
}
|
|
2820
|
-
const n = (e$
|
|
2821
|
-
let n$
|
|
2822
|
-
for (let [r
|
|
2823
|
-
return n$
|
|
2773
|
+
const n = (e$1, t$2) => {
|
|
2774
|
+
let n$1 = [[], []];
|
|
2775
|
+
for (let [r, i] of e$1.entries()) t$2(i, r, e$1) ? n$1[0].push(i) : n$1[1].push(i);
|
|
2776
|
+
return n$1;
|
|
2824
2777
|
};
|
|
2825
2778
|
|
|
2826
2779
|
//#endregion
|
|
2827
2780
|
//#region src/plugin/bindingify-hook-filter.ts
|
|
2828
2781
|
function generalHookFilterMatcherToFilterExprs(matcher, stringKind) {
|
|
2829
2782
|
if (typeof matcher === "string" || matcher instanceof RegExp) return [include(generateAtomMatcher(stringKind, matcher))];
|
|
2830
|
-
if (Array.isArray(matcher)) return matcher.map((m
|
|
2783
|
+
if (Array.isArray(matcher)) return matcher.map((m) => include(generateAtomMatcher(stringKind, m)));
|
|
2831
2784
|
let ret = [];
|
|
2832
|
-
if (matcher.exclude) ret.push(...arraify(matcher.exclude).map((m
|
|
2833
|
-
if (matcher.include) ret.push(...arraify(matcher.include).map((m
|
|
2785
|
+
if (matcher.exclude) ret.push(...arraify(matcher.exclude).map((m) => exclude(generateAtomMatcher(stringKind, m))));
|
|
2786
|
+
if (matcher.include) ret.push(...arraify(matcher.include).map((m) => include(generateAtomMatcher(stringKind, m))));
|
|
2834
2787
|
return ret;
|
|
2835
2788
|
}
|
|
2836
2789
|
function generateAtomMatcher(kind, matcher) {
|
|
@@ -2845,14 +2798,14 @@ function transformFilterMatcherToFilterExprs(filterOption) {
|
|
|
2845
2798
|
let idExcludes = [];
|
|
2846
2799
|
let codeIncludes = [];
|
|
2847
2800
|
let codeExcludes = [];
|
|
2848
|
-
if (id$1) [idIncludes, idExcludes] = t$1(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m
|
|
2849
|
-
if (code$1) [codeIncludes, codeExcludes] = t$1(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m
|
|
2801
|
+
if (id$1) [idIncludes, idExcludes] = t$1(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m) => m.kind === "include");
|
|
2802
|
+
if (code$1) [codeIncludes, codeExcludes] = t$1(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m) => m.kind === "include");
|
|
2850
2803
|
ret.push(...idExcludes);
|
|
2851
2804
|
ret.push(...codeExcludes);
|
|
2852
2805
|
let andExprList = [];
|
|
2853
2806
|
if (moduleType$1) {
|
|
2854
2807
|
let moduleTypes = Array.isArray(moduleType$1) ? moduleType$1 : moduleType$1.include ?? [];
|
|
2855
|
-
andExprList.push(or(...moduleTypes.map((m
|
|
2808
|
+
andExprList.push(or(...moduleTypes.map((m) => moduleType(m))));
|
|
2856
2809
|
}
|
|
2857
2810
|
if (idIncludes.length) andExprList.push(or(...idIncludes.map((item) => item.expr)));
|
|
2858
2811
|
if (codeIncludes.length) andExprList.push(or(...codeIncludes.map((item) => item.expr)));
|
|
@@ -2874,7 +2827,7 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
2874
2827
|
switch (expr.kind) {
|
|
2875
2828
|
case "and": {
|
|
2876
2829
|
let args$1 = expr.args;
|
|
2877
|
-
for (let i
|
|
2830
|
+
for (let i = args$1.length - 1; i >= 0; i--) bindingifyFilterExprImpl(args$1[i], list);
|
|
2878
2831
|
list.push({
|
|
2879
2832
|
kind: "And",
|
|
2880
2833
|
payload: args$1.length
|
|
@@ -2883,7 +2836,7 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
2883
2836
|
}
|
|
2884
2837
|
case "or": {
|
|
2885
2838
|
let args$1 = expr.args;
|
|
2886
|
-
for (let i
|
|
2839
|
+
for (let i = args$1.length - 1; i >= 0; i--) bindingifyFilterExprImpl(args$1[i], list);
|
|
2887
2840
|
list.push({
|
|
2888
2841
|
kind: "Or",
|
|
2889
2842
|
payload: args$1.length
|
|
@@ -2972,77 +2925,6 @@ function bindingPluginOrder(order) {
|
|
|
2972
2925
|
}
|
|
2973
2926
|
}
|
|
2974
2927
|
|
|
2975
|
-
//#endregion
|
|
2976
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.94.0/node_modules/oxc-parser/src-js/wrap.js
|
|
2977
|
-
function wrap$1(result) {
|
|
2978
|
-
let program, module$1, comments, errors;
|
|
2979
|
-
return {
|
|
2980
|
-
get program() {
|
|
2981
|
-
if (!program) program = jsonParseAst(result.program);
|
|
2982
|
-
return program;
|
|
2983
|
-
},
|
|
2984
|
-
get module() {
|
|
2985
|
-
if (!module$1) module$1 = result.module;
|
|
2986
|
-
return module$1;
|
|
2987
|
-
},
|
|
2988
|
-
get comments() {
|
|
2989
|
-
if (!comments) comments = result.comments;
|
|
2990
|
-
return comments;
|
|
2991
|
-
},
|
|
2992
|
-
get errors() {
|
|
2993
|
-
if (!errors) errors = result.errors;
|
|
2994
|
-
return errors;
|
|
2995
|
-
}
|
|
2996
|
-
};
|
|
2997
|
-
}
|
|
2998
|
-
function jsonParseAst(programJson) {
|
|
2999
|
-
const { node: program, fixes } = JSON.parse(programJson);
|
|
3000
|
-
for (const fixPath of fixes) applyFix(program, fixPath);
|
|
3001
|
-
return program;
|
|
3002
|
-
}
|
|
3003
|
-
function applyFix(program, fixPath) {
|
|
3004
|
-
let node = program;
|
|
3005
|
-
for (const key of fixPath) node = node[key];
|
|
3006
|
-
if (node.bigint) node.value = BigInt(node.bigint);
|
|
3007
|
-
else try {
|
|
3008
|
-
node.value = RegExp(node.regex.pattern, node.regex.flags);
|
|
3009
|
-
} catch (_err) {}
|
|
3010
|
-
}
|
|
3011
|
-
|
|
3012
|
-
//#endregion
|
|
3013
|
-
//#region src/parse-ast-index.ts
|
|
3014
|
-
function wrap(result, sourceText) {
|
|
3015
|
-
result = wrap$1(result);
|
|
3016
|
-
if (result.errors.length > 0) return normalizeParseError(sourceText, result.errors);
|
|
3017
|
-
return result.program;
|
|
3018
|
-
}
|
|
3019
|
-
function normalizeParseError(sourceText, errors) {
|
|
3020
|
-
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
3021
|
-
for (let i$1 = 0; i$1 < errors.length; i$1++) {
|
|
3022
|
-
if (i$1 >= 5) {
|
|
3023
|
-
message += "\n...";
|
|
3024
|
-
break;
|
|
3025
|
-
}
|
|
3026
|
-
const e$2 = errors[i$1];
|
|
3027
|
-
message += e$2.message + "\n" + e$2.labels.map((label) => {
|
|
3028
|
-
const location = locate(sourceText, label.start, { offsetLine: 1 });
|
|
3029
|
-
if (!location) return;
|
|
3030
|
-
return getCodeFrame(sourceText, location.line, location.column);
|
|
3031
|
-
}).filter(Boolean).join("\n");
|
|
3032
|
-
}
|
|
3033
|
-
return error(logParseError(message));
|
|
3034
|
-
}
|
|
3035
|
-
const defaultParserOptions = {
|
|
3036
|
-
lang: "js",
|
|
3037
|
-
preserveParens: false
|
|
3038
|
-
};
|
|
3039
|
-
function parseAst(sourceText, options, filename) {
|
|
3040
|
-
return wrap(parseSync(filename ?? "file.js", sourceText, {
|
|
3041
|
-
...defaultParserOptions,
|
|
3042
|
-
...options
|
|
3043
|
-
}), sourceText);
|
|
3044
|
-
}
|
|
3045
|
-
|
|
3046
2928
|
//#endregion
|
|
3047
2929
|
//#region src/utils/asset-source.ts
|
|
3048
2930
|
function transformAssetSource(bindingAssetSource$1) {
|
|
@@ -3102,7 +2984,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3102
2984
|
this.data.updateModuleOption(id$1, rawOptions);
|
|
3103
2985
|
let loadPromise = this.data.loadModulePromiseMap.get(id$1);
|
|
3104
2986
|
if (!loadPromise) {
|
|
3105
|
-
loadPromise = this.context.load(id$1, options.moduleSideEffects ?? void 0).catch(() => {
|
|
2987
|
+
loadPromise = this.context.load(id$1, options.moduleSideEffects ?? void 0, options.packageJsonPath ?? void 0).catch(() => {
|
|
3106
2988
|
this.data.loadModulePromiseMap.delete(id$1);
|
|
3107
2989
|
});
|
|
3108
2990
|
this.data.loadModulePromiseMap.set(id$1, loadPromise);
|
|
@@ -3191,12 +3073,12 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
3191
3073
|
this.warn = getLogHandler$1(this.warn);
|
|
3192
3074
|
this.info = getLogHandler$1(this.info);
|
|
3193
3075
|
}
|
|
3194
|
-
error(e$
|
|
3195
|
-
if (typeof e$
|
|
3196
|
-
if (pos) augmentCodeLocation(e$
|
|
3197
|
-
e$
|
|
3198
|
-
e$
|
|
3199
|
-
return error(logPluginError(normalizeLog(e$
|
|
3076
|
+
error(e$1, pos) {
|
|
3077
|
+
if (typeof e$1 === "string") e$1 = { message: e$1 };
|
|
3078
|
+
if (pos) augmentCodeLocation(e$1, pos, this.moduleSource, this.moduleId);
|
|
3079
|
+
e$1.id = this.moduleId;
|
|
3080
|
+
e$1.hook = "transform";
|
|
3081
|
+
return error(logPluginError(normalizeLog(e$1), this.pluginName));
|
|
3200
3082
|
}
|
|
3201
3083
|
getCombinedSourcemap() {
|
|
3202
3084
|
return JSON.parse(this.inner.getCombinedSourcemap());
|
|
@@ -3204,6 +3086,9 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
3204
3086
|
addWatchFile(id$1) {
|
|
3205
3087
|
this.inner.addWatchFile(id$1);
|
|
3206
3088
|
}
|
|
3089
|
+
sendMagicString(s) {
|
|
3090
|
+
this.inner.sendMagicString(s);
|
|
3091
|
+
}
|
|
3207
3092
|
};
|
|
3208
3093
|
|
|
3209
3094
|
//#endregion
|
|
@@ -3303,7 +3188,29 @@ function bindingifyTransform(args$1) {
|
|
|
3303
3188
|
const { handler, meta, options } = normalizeHook(hook);
|
|
3304
3189
|
return {
|
|
3305
3190
|
plugin: async (ctx, code$1, id$1, meta$1) => {
|
|
3306
|
-
|
|
3191
|
+
Object.defineProperties(meta$1, {
|
|
3192
|
+
magicString: { get() {
|
|
3193
|
+
return new BindingMagicString(code$1);
|
|
3194
|
+
} },
|
|
3195
|
+
ast: { get() {
|
|
3196
|
+
let lang = "js";
|
|
3197
|
+
switch (meta$1.moduleType) {
|
|
3198
|
+
case "js":
|
|
3199
|
+
case "jsx":
|
|
3200
|
+
case "ts":
|
|
3201
|
+
case "tsx":
|
|
3202
|
+
lang = meta$1.moduleType;
|
|
3203
|
+
break;
|
|
3204
|
+
default: break;
|
|
3205
|
+
}
|
|
3206
|
+
return parseAst(code$1, {
|
|
3207
|
+
astType: meta$1.moduleType.includes("ts") ? "ts" : "js",
|
|
3208
|
+
lang
|
|
3209
|
+
});
|
|
3210
|
+
} }
|
|
3211
|
+
});
|
|
3212
|
+
const transformCtx = new TransformPluginContextImpl(args$1.outputOptions, ctx.inner(), args$1.plugin, args$1.pluginContextData, ctx, id$1, code$1, args$1.onLog, args$1.logLevel, args$1.watchMode);
|
|
3213
|
+
const ret = await handler.call(transformCtx, code$1, id$1, meta$1);
|
|
3307
3214
|
if (ret == null) return;
|
|
3308
3215
|
if (typeof ret === "string") return { code: ret };
|
|
3309
3216
|
let moduleOption = args$1.pluginContextData.updateModuleOption(id$1, {
|
|
@@ -3311,9 +3218,18 @@ function bindingifyTransform(args$1) {
|
|
|
3311
3218
|
moduleSideEffects: ret.moduleSideEffects ?? null,
|
|
3312
3219
|
invalidate: false
|
|
3313
3220
|
});
|
|
3221
|
+
let normalizedCode = void 0;
|
|
3222
|
+
let map = ret.map;
|
|
3223
|
+
if (typeof ret.code === "string") normalizedCode = ret.code;
|
|
3224
|
+
else if (ret.code instanceof BindingMagicString) {
|
|
3225
|
+
let magicString = ret.code;
|
|
3226
|
+
normalizedCode = magicString.toString();
|
|
3227
|
+
let fallbackSourcemap = ctx.sendMagicString(magicString);
|
|
3228
|
+
if (fallbackSourcemap != void 0) map = fallbackSourcemap;
|
|
3229
|
+
}
|
|
3314
3230
|
return {
|
|
3315
|
-
code:
|
|
3316
|
-
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id$1, code$1,
|
|
3231
|
+
code: normalizedCode,
|
|
3232
|
+
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id$1, code$1, map)),
|
|
3317
3233
|
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
|
|
3318
3234
|
moduleType: ret.moduleType
|
|
3319
3235
|
};
|
|
@@ -3427,9 +3343,9 @@ function transformRenderedChunk(chunk) {
|
|
|
3427
3343
|
}
|
|
3428
3344
|
function transformChunkModules(modules) {
|
|
3429
3345
|
const result = {};
|
|
3430
|
-
for (let i
|
|
3431
|
-
let key = modules.keys[i
|
|
3432
|
-
const mod = modules.values[i
|
|
3346
|
+
for (let i = 0; i < modules.values.length; i++) {
|
|
3347
|
+
let key = modules.keys[i];
|
|
3348
|
+
const mod = modules.values[i];
|
|
3433
3349
|
result[key] = transformToRenderedModule(mod);
|
|
3434
3350
|
}
|
|
3435
3351
|
return result;
|
|
@@ -3481,20 +3397,20 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
|
|
|
3481
3397
|
};
|
|
3482
3398
|
const cache = {};
|
|
3483
3399
|
return new Proxy(chunk, {
|
|
3484
|
-
get(target, p
|
|
3485
|
-
if (p
|
|
3486
|
-
const value = target[p
|
|
3487
|
-
cache[p
|
|
3400
|
+
get(target, p) {
|
|
3401
|
+
if (p in cache) return cache[p];
|
|
3402
|
+
const value = target[p];
|
|
3403
|
+
cache[p] = value;
|
|
3488
3404
|
return value;
|
|
3489
3405
|
},
|
|
3490
|
-
set(_target, p
|
|
3491
|
-
cache[p
|
|
3406
|
+
set(_target, p, newValue) {
|
|
3407
|
+
cache[p] = newValue;
|
|
3492
3408
|
changed?.updated.add(bindingChunk.fileName);
|
|
3493
3409
|
return true;
|
|
3494
3410
|
},
|
|
3495
|
-
has(target, p
|
|
3496
|
-
if (p
|
|
3497
|
-
return p
|
|
3411
|
+
has(target, p) {
|
|
3412
|
+
if (p in cache) return true;
|
|
3413
|
+
return p in target;
|
|
3498
3414
|
}
|
|
3499
3415
|
});
|
|
3500
3416
|
}
|
|
@@ -3512,14 +3428,14 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
|
|
|
3512
3428
|
};
|
|
3513
3429
|
const cache = {};
|
|
3514
3430
|
return new Proxy(asset, {
|
|
3515
|
-
get(target, p
|
|
3516
|
-
if (p
|
|
3517
|
-
const value = target[p
|
|
3518
|
-
cache[p
|
|
3431
|
+
get(target, p) {
|
|
3432
|
+
if (p in cache) return cache[p];
|
|
3433
|
+
const value = target[p];
|
|
3434
|
+
cache[p] = value;
|
|
3519
3435
|
return value;
|
|
3520
3436
|
},
|
|
3521
|
-
set(_target, p
|
|
3522
|
-
cache[p
|
|
3437
|
+
set(_target, p, newValue) {
|
|
3438
|
+
cache[p] = newValue;
|
|
3523
3439
|
changed?.updated.add(bindingAsset.fileName);
|
|
3524
3440
|
return true;
|
|
3525
3441
|
}
|
|
@@ -3931,8 +3847,8 @@ function wrapHandlers(plugin) {
|
|
|
3931
3847
|
if (handler) plugin[hookName] = async (...args$1) => {
|
|
3932
3848
|
try {
|
|
3933
3849
|
return await handler(...args$1);
|
|
3934
|
-
} catch (e$
|
|
3935
|
-
return error(logPluginError(e$
|
|
3850
|
+
} catch (e$1) {
|
|
3851
|
+
return error(logPluginError(e$1, plugin.name, {
|
|
3936
3852
|
hook: hookName,
|
|
3937
3853
|
id: hookName === "transform" ? args$1[2] : void 0
|
|
3938
3854
|
}));
|
|
@@ -4041,6 +3957,9 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
4041
3957
|
get globals() {
|
|
4042
3958
|
return this.inner.globals || this.outputOptions.globals;
|
|
4043
3959
|
}
|
|
3960
|
+
get paths() {
|
|
3961
|
+
return this.outputOptions.paths;
|
|
3962
|
+
}
|
|
4044
3963
|
get hashCharacters() {
|
|
4045
3964
|
return this.inner.hashCharacters;
|
|
4046
3965
|
}
|
|
@@ -4200,6 +4119,49 @@ function isReadonlyArray(input) {
|
|
|
4200
4119
|
return Array.isArray(input);
|
|
4201
4120
|
}
|
|
4202
4121
|
|
|
4122
|
+
//#endregion
|
|
4123
|
+
//#region src/utils/normalize-transform-options.ts
|
|
4124
|
+
/**
|
|
4125
|
+
* Normalizes transform options by extracting `define`, `inject`, and `dropLabels` separately from OXC transform options.
|
|
4126
|
+
*
|
|
4127
|
+
* Prioritizes values from `transform.define`, `transform.inject`, and `transform.dropLabels` over deprecated top-level options.
|
|
4128
|
+
*/
|
|
4129
|
+
function normalizeTransformOptions(inputOptions, onLog) {
|
|
4130
|
+
const transform = inputOptions.transform;
|
|
4131
|
+
let define;
|
|
4132
|
+
if (transform?.define) define = Object.entries(transform.define);
|
|
4133
|
+
else if (inputOptions.define) {
|
|
4134
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedDefine());
|
|
4135
|
+
define = Object.entries(inputOptions.define);
|
|
4136
|
+
}
|
|
4137
|
+
let inject;
|
|
4138
|
+
if (transform?.inject) inject = transform.inject;
|
|
4139
|
+
else if (inputOptions.inject) {
|
|
4140
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedInject());
|
|
4141
|
+
inject = inputOptions.inject;
|
|
4142
|
+
}
|
|
4143
|
+
let dropLabels;
|
|
4144
|
+
if (transform?.dropLabels) dropLabels = transform.dropLabels;
|
|
4145
|
+
else if (inputOptions.dropLabels) {
|
|
4146
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedDropLabels());
|
|
4147
|
+
dropLabels = inputOptions.dropLabels;
|
|
4148
|
+
}
|
|
4149
|
+
let oxcTransformOptions;
|
|
4150
|
+
if (transform) {
|
|
4151
|
+
const { define: _define, inject: _inject, dropLabels: _dropLabels,...rest } = transform;
|
|
4152
|
+
if (Object.keys(rest).length > 0) {
|
|
4153
|
+
if (rest.jsx === false) rest.jsx = "disable";
|
|
4154
|
+
oxcTransformOptions = rest;
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
return {
|
|
4158
|
+
define,
|
|
4159
|
+
inject,
|
|
4160
|
+
dropLabels,
|
|
4161
|
+
oxcTransformOptions
|
|
4162
|
+
};
|
|
4163
|
+
}
|
|
4164
|
+
|
|
4203
4165
|
//#endregion
|
|
4204
4166
|
//#region src/utils/bindingify-input-options.ts
|
|
4205
4167
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -4209,7 +4171,19 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4209
4171
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
4210
4172
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
4211
4173
|
});
|
|
4212
|
-
const
|
|
4174
|
+
const normalizedTransform = normalizeTransformOptions(inputOptions, onLog);
|
|
4175
|
+
let profilerNames;
|
|
4176
|
+
if (outputOptions.generatedCode?.profilerNames !== void 0) profilerNames = outputOptions.generatedCode.profilerNames;
|
|
4177
|
+
else if (inputOptions.profilerNames !== void 0) {
|
|
4178
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedProfilerNames());
|
|
4179
|
+
profilerNames = inputOptions.profilerNames;
|
|
4180
|
+
}
|
|
4181
|
+
let keepNames;
|
|
4182
|
+
if (outputOptions.keepNames !== void 0) keepNames = outputOptions.keepNames;
|
|
4183
|
+
else if (inputOptions.keepNames !== void 0) {
|
|
4184
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedKeepNames());
|
|
4185
|
+
keepNames = inputOptions.keepNames;
|
|
4186
|
+
}
|
|
4213
4187
|
return {
|
|
4214
4188
|
input: bindingifyInput(inputOptions.input),
|
|
4215
4189
|
plugins,
|
|
@@ -4222,15 +4196,14 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4222
4196
|
onLog: async (level, log) => onLog(level, log),
|
|
4223
4197
|
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
|
|
4224
4198
|
moduleTypes: inputOptions.moduleTypes,
|
|
4225
|
-
define:
|
|
4226
|
-
inject: bindingifyInject(
|
|
4199
|
+
define: normalizedTransform.define,
|
|
4200
|
+
inject: bindingifyInject(normalizedTransform.inject),
|
|
4227
4201
|
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
4228
|
-
profilerNames
|
|
4229
|
-
|
|
4230
|
-
transform,
|
|
4202
|
+
profilerNames,
|
|
4203
|
+
transform: normalizedTransform.oxcTransformOptions,
|
|
4231
4204
|
watch: bindingifyWatch(inputOptions.watch),
|
|
4232
|
-
dropLabels:
|
|
4233
|
-
keepNames
|
|
4205
|
+
dropLabels: normalizedTransform.dropLabels,
|
|
4206
|
+
keepNames,
|
|
4234
4207
|
checks: inputOptions.checks,
|
|
4235
4208
|
deferSyncScanData: () => {
|
|
4236
4209
|
let ret = [];
|
|
@@ -4295,7 +4268,8 @@ function bindingifyExperimental(experimental) {
|
|
|
4295
4268
|
chunkModulesOrder,
|
|
4296
4269
|
chunkImportMap: experimental?.chunkImportMap,
|
|
4297
4270
|
onDemandWrapping: experimental?.onDemandWrapping,
|
|
4298
|
-
incrementalBuild: experimental?.incrementalBuild
|
|
4271
|
+
incrementalBuild: experimental?.incrementalBuild,
|
|
4272
|
+
nativeMagicString: experimental?.nativeMagicString
|
|
4299
4273
|
};
|
|
4300
4274
|
}
|
|
4301
4275
|
function bindingifyResolve(resolve$1) {
|
|
@@ -4358,46 +4332,6 @@ function bindingifyInput(input) {
|
|
|
4358
4332
|
};
|
|
4359
4333
|
});
|
|
4360
4334
|
}
|
|
4361
|
-
function bindingifyJsx(onLog, input, transform) {
|
|
4362
|
-
if (transform?.jsx) {
|
|
4363
|
-
if (input !== void 0) onLog(LOG_LEVEL_WARN, logDuplicateJsxConfig());
|
|
4364
|
-
return { transform };
|
|
4365
|
-
}
|
|
4366
|
-
if (typeof input === "object") {
|
|
4367
|
-
if (input.mode === "preserve") return {
|
|
4368
|
-
jsx: BindingJsx.Preserve,
|
|
4369
|
-
transform
|
|
4370
|
-
};
|
|
4371
|
-
const mode = input.mode ?? "automatic";
|
|
4372
|
-
transform ??= {};
|
|
4373
|
-
transform.jsx = {
|
|
4374
|
-
runtime: mode,
|
|
4375
|
-
pragma: input.factory,
|
|
4376
|
-
pragmaFrag: input.fragment,
|
|
4377
|
-
importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0
|
|
4378
|
-
};
|
|
4379
|
-
return { transform };
|
|
4380
|
-
}
|
|
4381
|
-
let jsx;
|
|
4382
|
-
switch (input) {
|
|
4383
|
-
case false:
|
|
4384
|
-
jsx = BindingJsx.Disable;
|
|
4385
|
-
break;
|
|
4386
|
-
case "react":
|
|
4387
|
-
jsx = BindingJsx.React;
|
|
4388
|
-
break;
|
|
4389
|
-
case "react-jsx":
|
|
4390
|
-
jsx = BindingJsx.ReactJsx;
|
|
4391
|
-
break;
|
|
4392
|
-
case "preserve":
|
|
4393
|
-
jsx = BindingJsx.Preserve;
|
|
4394
|
-
break;
|
|
4395
|
-
}
|
|
4396
|
-
return {
|
|
4397
|
-
jsx,
|
|
4398
|
-
transform
|
|
4399
|
-
};
|
|
4400
|
-
}
|
|
4401
4335
|
function bindingifyWatch(watch$1) {
|
|
4402
4336
|
if (watch$1) return {
|
|
4403
4337
|
buildDelay: watch$1.buildDelay,
|
|
@@ -4484,7 +4418,7 @@ var ChunkingContextImpl = class {
|
|
|
4484
4418
|
//#endregion
|
|
4485
4419
|
//#region src/utils/bindingify-output-options.ts
|
|
4486
4420
|
function bindingifyOutputOptions(outputOptions) {
|
|
4487
|
-
const { dir, format: format$1, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
4421
|
+
const { dir, format: format$1, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir } = outputOptions;
|
|
4488
4422
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
4489
4423
|
return {
|
|
4490
4424
|
dir,
|
|
@@ -4503,6 +4437,7 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
4503
4437
|
outro: bindingifyAddon(outro),
|
|
4504
4438
|
extend: outputOptions.extend,
|
|
4505
4439
|
globals,
|
|
4440
|
+
paths,
|
|
4506
4441
|
generatedCode,
|
|
4507
4442
|
esModule,
|
|
4508
4443
|
name,
|
|
@@ -4523,7 +4458,8 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
4523
4458
|
legalComments,
|
|
4524
4459
|
preserveModulesRoot,
|
|
4525
4460
|
topLevelVar,
|
|
4526
|
-
minifyInternalExports: outputOptions.minifyInternalExports
|
|
4461
|
+
minifyInternalExports: outputOptions.minifyInternalExports,
|
|
4462
|
+
cleanDir
|
|
4527
4463
|
};
|
|
4528
4464
|
}
|
|
4529
4465
|
function bindingifyAddon(configAddon) {
|
|
@@ -4609,9 +4545,9 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
4609
4545
|
onLog,
|
|
4610
4546
|
stopWorkers: parallelPluginInitResult?.stopWorkers
|
|
4611
4547
|
};
|
|
4612
|
-
} catch (e$
|
|
4548
|
+
} catch (e$1) {
|
|
4613
4549
|
await parallelPluginInitResult?.stopWorkers();
|
|
4614
|
-
throw e$
|
|
4550
|
+
throw e$1;
|
|
4615
4551
|
}
|
|
4616
4552
|
}
|
|
4617
4553
|
|
|
@@ -4643,9 +4579,9 @@ var RolldownBuild = class RolldownBuild {
|
|
|
4643
4579
|
RolldownBuild.asyncRuntimeShutdown = true;
|
|
4644
4580
|
}
|
|
4645
4581
|
};
|
|
4646
|
-
} catch (e$
|
|
4582
|
+
} catch (e$1) {
|
|
4647
4583
|
await option.stopWorkers?.();
|
|
4648
|
-
throw e$
|
|
4584
|
+
throw e$1;
|
|
4649
4585
|
}
|
|
4650
4586
|
}
|
|
4651
4587
|
async scan() {
|
|
@@ -4841,4 +4777,4 @@ function defineConfig(config) {
|
|
|
4841
4777
|
const VERSION = version;
|
|
4842
4778
|
|
|
4843
4779
|
//#endregion
|
|
4844
|
-
export {
|
|
4780
|
+
export { build as a, createBundlerOptions as c, normalizeBindingResult as d, bindingifySourcemap$1 as f, makeBuiltinPluginCallable as h, watch as i, normalizedStringOrRegex as l, BuiltinPlugin as m, VERSION as n, rolldown as o, PluginDriver as p, defineConfig as r, RolldownBuild as s, BindingMagicString$1 as t, transformToRollupOutput as u };
|