@rolldown/browser 1.0.0-beta.43 → 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 +1048 -75
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.browser.mjs +33 -452
- package/dist/experimental-index.d.mts +20 -5
- package/dist/experimental-index.mjs +38 -15
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- 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 +1 -1
- package/dist/rolldown-binding.wasi.cjs +1 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-BkaKdpud.d.mts → binding-0m41EAn-.d.mts} +89 -14
- package/dist/shared/{define-config-D5LB7YAC.d.mts → define-config-BbwLmCDX.d.mts} +193 -87
- package/dist/shared/{dist-CU0dSkK2.mjs → dist-DNFKY37q.mjs} +1 -1
- package/dist/shared/{load-config-DBsf9ada.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-Dqrw8WuH.mjs → src-BnIhK3nA.mjs} +184 -324
- package/dist/{src-DXN0YLUN.js → src-CIeG_TGR.js} +393 -503
- 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")),
|
|
@@ -2374,13 +2259,6 @@ const InputOptionsSchema = strictObject({
|
|
|
2374
2259
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
2375
2260
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
2376
2261
|
profilerNames: optional(boolean()),
|
|
2377
|
-
jsx: optional(union([
|
|
2378
|
-
literal(false),
|
|
2379
|
-
literal("react"),
|
|
2380
|
-
literal("react-jsx"),
|
|
2381
|
-
literal("preserve"),
|
|
2382
|
-
RollupJsxOptionsSchema
|
|
2383
|
-
])),
|
|
2384
2262
|
transform: optional(TransformOptionsSchema),
|
|
2385
2263
|
watch: optional(union([WatchOptionsSchema, literal(false)])),
|
|
2386
2264
|
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
|
|
@@ -2401,12 +2279,6 @@ const InputCliOverrideSchema = strictObject({
|
|
|
2401
2279
|
inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
|
|
2402
2280
|
treeshake: pipe(optional(boolean()), description("enable treeshaking")),
|
|
2403
2281
|
makeAbsoluteExternalsRelative: pipe(optional(boolean()), description("Prevent normalization of external imports")),
|
|
2404
|
-
jsx: pipe(optional(union([
|
|
2405
|
-
literal(false),
|
|
2406
|
-
literal("react"),
|
|
2407
|
-
literal("react-jsx"),
|
|
2408
|
-
literal("preserve")
|
|
2409
|
-
])), description("Jsx options preset")),
|
|
2410
2282
|
preserveEntrySignatures: pipe(optional(literal(false)), description("Avoid facade chunks for entry points")),
|
|
2411
2283
|
context: pipe(optional(string()), description("The entity top-level `this` represents."))
|
|
2412
2284
|
});
|
|
@@ -2462,7 +2334,8 @@ const AdvancedChunksSchema = strictObject({
|
|
|
2462
2334
|
const GeneratedCodePresetSchema = union([literal("es5"), literal("es2015")]);
|
|
2463
2335
|
const GeneratedCodeOptionsSchema = strictObject({
|
|
2464
2336
|
symbols: pipe(optional(boolean()), description("Whether to use Symbol.toStringTag for namespace objects")),
|
|
2465
|
-
preset: GeneratedCodePresetSchema
|
|
2337
|
+
preset: GeneratedCodePresetSchema,
|
|
2338
|
+
profilerNames: pipe(optional(boolean()), description("Whether to add readable names to internal variables for profiling purposes"))
|
|
2466
2339
|
});
|
|
2467
2340
|
const OutputOptionsSchema = strictObject({
|
|
2468
2341
|
dir: pipe(optional(string()), description("Output directory, defaults to `dist` if `file` is not set")),
|
|
@@ -2472,18 +2345,18 @@ const OutputOptionsSchema = strictObject({
|
|
|
2472
2345
|
literal("named"),
|
|
2473
2346
|
literal("default"),
|
|
2474
2347
|
literal("none")
|
|
2475
|
-
])), description(`Specify a export mode (${
|
|
2348
|
+
])), description(`Specify a export mode (${styleText("underline", "auto")}, named, default, none)`)),
|
|
2476
2349
|
hashCharacters: pipe(optional(union([
|
|
2477
2350
|
literal("base64"),
|
|
2478
2351
|
literal("base36"),
|
|
2479
2352
|
literal("hex")
|
|
2480
2353
|
])), description("Use the specified character set for file hashes")),
|
|
2481
|
-
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)`)),
|
|
2482
2355
|
sourcemap: pipe(optional(union([
|
|
2483
2356
|
boolean(),
|
|
2484
2357
|
literal("inline"),
|
|
2485
2358
|
literal("hidden")
|
|
2486
|
-
])), 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")})`)),
|
|
2487
2360
|
sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
|
|
2488
2361
|
sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
|
|
2489
2362
|
sourcemapIgnoreList: optional(union([
|
|
@@ -2528,10 +2401,12 @@ const OutputOptionsSchema = strictObject({
|
|
|
2528
2401
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2529
2402
|
virtualDirname: optional(string()),
|
|
2530
2403
|
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
|
|
2531
|
-
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"))
|
|
2532
2407
|
});
|
|
2533
2408
|
const getAddonDescription = (placement, wrapper) => {
|
|
2534
|
-
return `Code to insert the ${
|
|
2409
|
+
return `Code to insert the ${styleText("bold", placement)} of the bundled file (${styleText("bold", wrapper)} the wrapper function)`;
|
|
2535
2410
|
};
|
|
2536
2411
|
const OutputCliOverrideSchema = strictObject({
|
|
2537
2412
|
assetFileNames: pipe(optional(string()), description("Name pattern for asset files")),
|
|
@@ -2584,7 +2459,7 @@ function validateOption(key, options) {
|
|
|
2584
2459
|
let issueMsg = issue.message;
|
|
2585
2460
|
const issuePaths = issue.path.map((path) => path.key);
|
|
2586
2461
|
if (issue.type === "union") {
|
|
2587
|
-
const subIssue = issue.issues?.find((i
|
|
2462
|
+
const subIssue = issue.issues?.find((i) => !(i.type !== issue.received && i.input === issue.input));
|
|
2588
2463
|
if (subIssue) {
|
|
2589
2464
|
if (subIssue.path) issuePaths.push(subIssue.path.map((path) => path.key));
|
|
2590
2465
|
issueMsg = subIssue.message;
|
|
@@ -2600,17 +2475,17 @@ function validateOption(key, options) {
|
|
|
2600
2475
|
}
|
|
2601
2476
|
|
|
2602
2477
|
//#endregion
|
|
2603
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2478
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.95.0/node_modules/oxc-parser/src-js/wrap.js
|
|
2604
2479
|
function wrap$1(result) {
|
|
2605
|
-
let program, module
|
|
2480
|
+
let program, module, comments, errors;
|
|
2606
2481
|
return {
|
|
2607
2482
|
get program() {
|
|
2608
2483
|
if (!program) program = jsonParseAst(result.program);
|
|
2609
2484
|
return program;
|
|
2610
2485
|
},
|
|
2611
2486
|
get module() {
|
|
2612
|
-
if (!module
|
|
2613
|
-
return module
|
|
2487
|
+
if (!module) module = result.module;
|
|
2488
|
+
return module;
|
|
2614
2489
|
},
|
|
2615
2490
|
get comments() {
|
|
2616
2491
|
if (!comments) comments = result.comments;
|
|
@@ -2645,13 +2520,13 @@ function wrap(result, sourceText) {
|
|
|
2645
2520
|
}
|
|
2646
2521
|
function normalizeParseError(sourceText, errors) {
|
|
2647
2522
|
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
2648
|
-
for (let i
|
|
2649
|
-
if (i
|
|
2523
|
+
for (let i = 0; i < errors.length; i++) {
|
|
2524
|
+
if (i >= 5) {
|
|
2650
2525
|
message += "\n...";
|
|
2651
2526
|
break;
|
|
2652
2527
|
}
|
|
2653
|
-
const e$
|
|
2654
|
-
message += e$
|
|
2528
|
+
const e$1 = errors[i];
|
|
2529
|
+
message += e$1.message + "\n" + e$1.labels.map((label) => {
|
|
2655
2530
|
const location = locate(sourceText, label.start, { offsetLine: 1 });
|
|
2656
2531
|
if (!location) return;
|
|
2657
2532
|
return getCodeFrame(sourceText, location.line, location.column);
|
|
@@ -2678,8 +2553,8 @@ function bindingifySourcemap$1(map) {
|
|
|
2678
2553
|
file: map.file ?? void 0,
|
|
2679
2554
|
mappings: map.mappings,
|
|
2680
2555
|
sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
|
|
2681
|
-
sources: map.sources?.map((s
|
|
2682
|
-
sourcesContent: map.sourcesContent?.map((s
|
|
2556
|
+
sources: map.sources?.map((s) => s ?? void 0),
|
|
2557
|
+
sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
|
|
2683
2558
|
names: map.names,
|
|
2684
2559
|
x_google_ignoreList: map.x_google_ignoreList,
|
|
2685
2560
|
debugId: "debugId" in map ? map.debugId : void 0
|
|
@@ -2696,23 +2571,23 @@ function normalizeBindingResult(container) {
|
|
|
2696
2571
|
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) return aggregateBindingErrorsIntoJsError(container.errors);
|
|
2697
2572
|
return container;
|
|
2698
2573
|
}
|
|
2699
|
-
function normalizeBindingError(e$
|
|
2700
|
-
return e$
|
|
2701
|
-
kind: e$
|
|
2702
|
-
message: e$
|
|
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,
|
|
2703
2578
|
stack: void 0
|
|
2704
2579
|
});
|
|
2705
2580
|
}
|
|
2706
2581
|
function aggregateBindingErrorsIntoJsError(rawErrors) {
|
|
2707
2582
|
const errors = rawErrors.map(normalizeBindingError);
|
|
2708
2583
|
let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
2709
|
-
for (let i
|
|
2584
|
+
for (let i = 0; i < errors.length; i++) {
|
|
2710
2585
|
summary += "\n";
|
|
2711
|
-
if (i
|
|
2586
|
+
if (i >= 5) {
|
|
2712
2587
|
summary += "...";
|
|
2713
2588
|
break;
|
|
2714
2589
|
}
|
|
2715
|
-
summary += getErrorMessage(errors[i
|
|
2590
|
+
summary += getErrorMessage(errors[i]);
|
|
2716
2591
|
}
|
|
2717
2592
|
const wrapper = new Error(summary);
|
|
2718
2593
|
Object.defineProperty(wrapper, "errors", {
|
|
@@ -2727,25 +2602,25 @@ function aggregateBindingErrorsIntoJsError(rawErrors) {
|
|
|
2727
2602
|
});
|
|
2728
2603
|
return wrapper;
|
|
2729
2604
|
}
|
|
2730
|
-
function getErrorMessage(e$
|
|
2731
|
-
if (Object.hasOwn(e$
|
|
2732
|
-
let s
|
|
2733
|
-
if (e$
|
|
2734
|
-
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;
|
|
2735
2610
|
if (id$1) {
|
|
2736
|
-
s
|
|
2737
|
-
if (e$
|
|
2611
|
+
s += " " + id$1;
|
|
2612
|
+
if (e$1.loc) s += `:${e$1.loc.line}:${e$1.loc.column}`;
|
|
2738
2613
|
}
|
|
2739
|
-
if (s
|
|
2740
|
-
const message = `${e$
|
|
2741
|
-
s
|
|
2742
|
-
if (e$
|
|
2743
|
-
if (e$
|
|
2744
|
-
if (e$
|
|
2745
|
-
s
|
|
2746
|
-
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"));
|
|
2747
2622
|
}
|
|
2748
|
-
return s
|
|
2623
|
+
return s;
|
|
2749
2624
|
}
|
|
2750
2625
|
function joinNewLine(s1, s2) {
|
|
2751
2626
|
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
@@ -2873,42 +2748,42 @@ function exclude(expr) {
|
|
|
2873
2748
|
|
|
2874
2749
|
//#endregion
|
|
2875
2750
|
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
|
|
2876
|
-
function e(e$
|
|
2877
|
-
let r
|
|
2878
|
-
return n$
|
|
2879
|
-
lazy: n$
|
|
2880
|
-
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
|
|
2881
2756
|
});
|
|
2882
2757
|
}
|
|
2883
2758
|
|
|
2884
2759
|
//#endregion
|
|
2885
2760
|
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
|
|
2886
|
-
function t(t$
|
|
2887
|
-
let i
|
|
2888
|
-
if (i
|
|
2889
|
-
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);
|
|
2890
2765
|
throw Error(`Wrong number of arguments`);
|
|
2891
2766
|
}
|
|
2892
2767
|
|
|
2893
2768
|
//#endregion
|
|
2894
2769
|
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/partition-DAu403JQ.js
|
|
2895
|
-
function t$1(...t$
|
|
2896
|
-
return t(n, t$
|
|
2770
|
+
function t$1(...t$2) {
|
|
2771
|
+
return t(n, t$2);
|
|
2897
2772
|
}
|
|
2898
|
-
const n = (e$
|
|
2899
|
-
let n$
|
|
2900
|
-
for (let [r
|
|
2901
|
-
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;
|
|
2902
2777
|
};
|
|
2903
2778
|
|
|
2904
2779
|
//#endregion
|
|
2905
2780
|
//#region src/plugin/bindingify-hook-filter.ts
|
|
2906
2781
|
function generalHookFilterMatcherToFilterExprs(matcher, stringKind) {
|
|
2907
2782
|
if (typeof matcher === "string" || matcher instanceof RegExp) return [include(generateAtomMatcher(stringKind, matcher))];
|
|
2908
|
-
if (Array.isArray(matcher)) return matcher.map((m
|
|
2783
|
+
if (Array.isArray(matcher)) return matcher.map((m) => include(generateAtomMatcher(stringKind, m)));
|
|
2909
2784
|
let ret = [];
|
|
2910
|
-
if (matcher.exclude) ret.push(...arraify(matcher.exclude).map((m
|
|
2911
|
-
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))));
|
|
2912
2787
|
return ret;
|
|
2913
2788
|
}
|
|
2914
2789
|
function generateAtomMatcher(kind, matcher) {
|
|
@@ -2923,14 +2798,14 @@ function transformFilterMatcherToFilterExprs(filterOption) {
|
|
|
2923
2798
|
let idExcludes = [];
|
|
2924
2799
|
let codeIncludes = [];
|
|
2925
2800
|
let codeExcludes = [];
|
|
2926
|
-
if (id$1) [idIncludes, idExcludes] = t$1(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m
|
|
2927
|
-
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");
|
|
2928
2803
|
ret.push(...idExcludes);
|
|
2929
2804
|
ret.push(...codeExcludes);
|
|
2930
2805
|
let andExprList = [];
|
|
2931
2806
|
if (moduleType$1) {
|
|
2932
2807
|
let moduleTypes = Array.isArray(moduleType$1) ? moduleType$1 : moduleType$1.include ?? [];
|
|
2933
|
-
andExprList.push(or(...moduleTypes.map((m
|
|
2808
|
+
andExprList.push(or(...moduleTypes.map((m) => moduleType(m))));
|
|
2934
2809
|
}
|
|
2935
2810
|
if (idIncludes.length) andExprList.push(or(...idIncludes.map((item) => item.expr)));
|
|
2936
2811
|
if (codeIncludes.length) andExprList.push(or(...codeIncludes.map((item) => item.expr)));
|
|
@@ -2952,7 +2827,7 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
2952
2827
|
switch (expr.kind) {
|
|
2953
2828
|
case "and": {
|
|
2954
2829
|
let args$1 = expr.args;
|
|
2955
|
-
for (let i
|
|
2830
|
+
for (let i = args$1.length - 1; i >= 0; i--) bindingifyFilterExprImpl(args$1[i], list);
|
|
2956
2831
|
list.push({
|
|
2957
2832
|
kind: "And",
|
|
2958
2833
|
payload: args$1.length
|
|
@@ -2961,7 +2836,7 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
2961
2836
|
}
|
|
2962
2837
|
case "or": {
|
|
2963
2838
|
let args$1 = expr.args;
|
|
2964
|
-
for (let i
|
|
2839
|
+
for (let i = args$1.length - 1; i >= 0; i--) bindingifyFilterExprImpl(args$1[i], list);
|
|
2965
2840
|
list.push({
|
|
2966
2841
|
kind: "Or",
|
|
2967
2842
|
payload: args$1.length
|
|
@@ -3198,12 +3073,12 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
3198
3073
|
this.warn = getLogHandler$1(this.warn);
|
|
3199
3074
|
this.info = getLogHandler$1(this.info);
|
|
3200
3075
|
}
|
|
3201
|
-
error(e$
|
|
3202
|
-
if (typeof e$
|
|
3203
|
-
if (pos) augmentCodeLocation(e$
|
|
3204
|
-
e$
|
|
3205
|
-
e$
|
|
3206
|
-
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));
|
|
3207
3082
|
}
|
|
3208
3083
|
getCombinedSourcemap() {
|
|
3209
3084
|
return JSON.parse(this.inner.getCombinedSourcemap());
|
|
@@ -3211,8 +3086,8 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
3211
3086
|
addWatchFile(id$1) {
|
|
3212
3087
|
this.inner.addWatchFile(id$1);
|
|
3213
3088
|
}
|
|
3214
|
-
sendMagicString(s
|
|
3215
|
-
this.inner.sendMagicString(s
|
|
3089
|
+
sendMagicString(s) {
|
|
3090
|
+
this.inner.sendMagicString(s);
|
|
3216
3091
|
}
|
|
3217
3092
|
};
|
|
3218
3093
|
|
|
@@ -3468,9 +3343,9 @@ function transformRenderedChunk(chunk) {
|
|
|
3468
3343
|
}
|
|
3469
3344
|
function transformChunkModules(modules) {
|
|
3470
3345
|
const result = {};
|
|
3471
|
-
for (let i
|
|
3472
|
-
let key = modules.keys[i
|
|
3473
|
-
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];
|
|
3474
3349
|
result[key] = transformToRenderedModule(mod);
|
|
3475
3350
|
}
|
|
3476
3351
|
return result;
|
|
@@ -3522,20 +3397,20 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
|
|
|
3522
3397
|
};
|
|
3523
3398
|
const cache = {};
|
|
3524
3399
|
return new Proxy(chunk, {
|
|
3525
|
-
get(target, p
|
|
3526
|
-
if (p
|
|
3527
|
-
const value = target[p
|
|
3528
|
-
cache[p
|
|
3400
|
+
get(target, p) {
|
|
3401
|
+
if (p in cache) return cache[p];
|
|
3402
|
+
const value = target[p];
|
|
3403
|
+
cache[p] = value;
|
|
3529
3404
|
return value;
|
|
3530
3405
|
},
|
|
3531
|
-
set(_target, p
|
|
3532
|
-
cache[p
|
|
3406
|
+
set(_target, p, newValue) {
|
|
3407
|
+
cache[p] = newValue;
|
|
3533
3408
|
changed?.updated.add(bindingChunk.fileName);
|
|
3534
3409
|
return true;
|
|
3535
3410
|
},
|
|
3536
|
-
has(target, p
|
|
3537
|
-
if (p
|
|
3538
|
-
return p
|
|
3411
|
+
has(target, p) {
|
|
3412
|
+
if (p in cache) return true;
|
|
3413
|
+
return p in target;
|
|
3539
3414
|
}
|
|
3540
3415
|
});
|
|
3541
3416
|
}
|
|
@@ -3553,14 +3428,14 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
|
|
|
3553
3428
|
};
|
|
3554
3429
|
const cache = {};
|
|
3555
3430
|
return new Proxy(asset, {
|
|
3556
|
-
get(target, p
|
|
3557
|
-
if (p
|
|
3558
|
-
const value = target[p
|
|
3559
|
-
cache[p
|
|
3431
|
+
get(target, p) {
|
|
3432
|
+
if (p in cache) return cache[p];
|
|
3433
|
+
const value = target[p];
|
|
3434
|
+
cache[p] = value;
|
|
3560
3435
|
return value;
|
|
3561
3436
|
},
|
|
3562
|
-
set(_target, p
|
|
3563
|
-
cache[p
|
|
3437
|
+
set(_target, p, newValue) {
|
|
3438
|
+
cache[p] = newValue;
|
|
3564
3439
|
changed?.updated.add(bindingAsset.fileName);
|
|
3565
3440
|
return true;
|
|
3566
3441
|
}
|
|
@@ -3972,8 +3847,8 @@ function wrapHandlers(plugin) {
|
|
|
3972
3847
|
if (handler) plugin[hookName] = async (...args$1) => {
|
|
3973
3848
|
try {
|
|
3974
3849
|
return await handler(...args$1);
|
|
3975
|
-
} catch (e$
|
|
3976
|
-
return error(logPluginError(e$
|
|
3850
|
+
} catch (e$1) {
|
|
3851
|
+
return error(logPluginError(e$1, plugin.name, {
|
|
3977
3852
|
hook: hookName,
|
|
3978
3853
|
id: hookName === "transform" ? args$1[2] : void 0
|
|
3979
3854
|
}));
|
|
@@ -4244,6 +4119,49 @@ function isReadonlyArray(input) {
|
|
|
4244
4119
|
return Array.isArray(input);
|
|
4245
4120
|
}
|
|
4246
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
|
+
|
|
4247
4165
|
//#endregion
|
|
4248
4166
|
//#region src/utils/bindingify-input-options.ts
|
|
4249
4167
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -4253,7 +4171,19 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4253
4171
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
4254
4172
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
4255
4173
|
});
|
|
4256
|
-
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
|
+
}
|
|
4257
4187
|
return {
|
|
4258
4188
|
input: bindingifyInput(inputOptions.input),
|
|
4259
4189
|
plugins,
|
|
@@ -4266,15 +4196,14 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4266
4196
|
onLog: async (level, log) => onLog(level, log),
|
|
4267
4197
|
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
|
|
4268
4198
|
moduleTypes: inputOptions.moduleTypes,
|
|
4269
|
-
define:
|
|
4270
|
-
inject: bindingifyInject(
|
|
4199
|
+
define: normalizedTransform.define,
|
|
4200
|
+
inject: bindingifyInject(normalizedTransform.inject),
|
|
4271
4201
|
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
4272
|
-
profilerNames
|
|
4273
|
-
|
|
4274
|
-
transform,
|
|
4202
|
+
profilerNames,
|
|
4203
|
+
transform: normalizedTransform.oxcTransformOptions,
|
|
4275
4204
|
watch: bindingifyWatch(inputOptions.watch),
|
|
4276
|
-
dropLabels:
|
|
4277
|
-
keepNames
|
|
4205
|
+
dropLabels: normalizedTransform.dropLabels,
|
|
4206
|
+
keepNames,
|
|
4278
4207
|
checks: inputOptions.checks,
|
|
4279
4208
|
deferSyncScanData: () => {
|
|
4280
4209
|
let ret = [];
|
|
@@ -4403,46 +4332,6 @@ function bindingifyInput(input) {
|
|
|
4403
4332
|
};
|
|
4404
4333
|
});
|
|
4405
4334
|
}
|
|
4406
|
-
function bindingifyJsx(onLog, input, transform) {
|
|
4407
|
-
if (transform?.jsx) {
|
|
4408
|
-
if (input !== void 0) onLog(LOG_LEVEL_WARN, logDuplicateJsxConfig());
|
|
4409
|
-
return { transform };
|
|
4410
|
-
}
|
|
4411
|
-
if (typeof input === "object") {
|
|
4412
|
-
if (input.mode === "preserve") return {
|
|
4413
|
-
jsx: BindingJsx.Preserve,
|
|
4414
|
-
transform
|
|
4415
|
-
};
|
|
4416
|
-
const mode = input.mode ?? "automatic";
|
|
4417
|
-
transform ??= {};
|
|
4418
|
-
transform.jsx = {
|
|
4419
|
-
runtime: mode,
|
|
4420
|
-
pragma: input.factory,
|
|
4421
|
-
pragmaFrag: input.fragment,
|
|
4422
|
-
importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0
|
|
4423
|
-
};
|
|
4424
|
-
return { transform };
|
|
4425
|
-
}
|
|
4426
|
-
let jsx;
|
|
4427
|
-
switch (input) {
|
|
4428
|
-
case false:
|
|
4429
|
-
jsx = BindingJsx.Disable;
|
|
4430
|
-
break;
|
|
4431
|
-
case "react":
|
|
4432
|
-
jsx = BindingJsx.React;
|
|
4433
|
-
break;
|
|
4434
|
-
case "react-jsx":
|
|
4435
|
-
jsx = BindingJsx.ReactJsx;
|
|
4436
|
-
break;
|
|
4437
|
-
case "preserve":
|
|
4438
|
-
jsx = BindingJsx.Preserve;
|
|
4439
|
-
break;
|
|
4440
|
-
}
|
|
4441
|
-
return {
|
|
4442
|
-
jsx,
|
|
4443
|
-
transform
|
|
4444
|
-
};
|
|
4445
|
-
}
|
|
4446
4335
|
function bindingifyWatch(watch$1) {
|
|
4447
4336
|
if (watch$1) return {
|
|
4448
4337
|
buildDelay: watch$1.buildDelay,
|
|
@@ -4529,7 +4418,7 @@ var ChunkingContextImpl = class {
|
|
|
4529
4418
|
//#endregion
|
|
4530
4419
|
//#region src/utils/bindingify-output-options.ts
|
|
4531
4420
|
function bindingifyOutputOptions(outputOptions) {
|
|
4532
|
-
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 } = 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;
|
|
4533
4422
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
4534
4423
|
return {
|
|
4535
4424
|
dir,
|
|
@@ -4569,7 +4458,8 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
4569
4458
|
legalComments,
|
|
4570
4459
|
preserveModulesRoot,
|
|
4571
4460
|
topLevelVar,
|
|
4572
|
-
minifyInternalExports: outputOptions.minifyInternalExports
|
|
4461
|
+
minifyInternalExports: outputOptions.minifyInternalExports,
|
|
4462
|
+
cleanDir
|
|
4573
4463
|
};
|
|
4574
4464
|
}
|
|
4575
4465
|
function bindingifyAddon(configAddon) {
|
|
@@ -4655,9 +4545,9 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
4655
4545
|
onLog,
|
|
4656
4546
|
stopWorkers: parallelPluginInitResult?.stopWorkers
|
|
4657
4547
|
};
|
|
4658
|
-
} catch (e$
|
|
4548
|
+
} catch (e$1) {
|
|
4659
4549
|
await parallelPluginInitResult?.stopWorkers();
|
|
4660
|
-
throw e$
|
|
4550
|
+
throw e$1;
|
|
4661
4551
|
}
|
|
4662
4552
|
}
|
|
4663
4553
|
|
|
@@ -4689,9 +4579,9 @@ var RolldownBuild = class RolldownBuild {
|
|
|
4689
4579
|
RolldownBuild.asyncRuntimeShutdown = true;
|
|
4690
4580
|
}
|
|
4691
4581
|
};
|
|
4692
|
-
} catch (e$
|
|
4582
|
+
} catch (e$1) {
|
|
4693
4583
|
await option.stopWorkers?.();
|
|
4694
|
-
throw e$
|
|
4584
|
+
throw e$1;
|
|
4695
4585
|
}
|
|
4696
4586
|
}
|
|
4697
4587
|
async scan() {
|
|
@@ -4887,4 +4777,4 @@ function defineConfig(config) {
|
|
|
4887
4777
|
const VERSION = version;
|
|
4888
4778
|
|
|
4889
4779
|
//#endregion
|
|
4890
|
-
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 };
|