@rolldown/browser 1.0.0-beta.31 → 1.0.0-beta.32
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.cjs +6 -6
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.mts +1 -1
- package/dist/cli.mjs +8 -7
- package/dist/config.cjs +4 -4
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.browser.mjs +1 -1
- package/dist/experimental-index.cjs +3 -3
- package/dist/experimental-index.d.cts +2 -2
- package/dist/experimental-index.d.mts +2 -2
- package/dist/experimental-index.mjs +3 -3
- package/dist/experimental-runtime-types.d.ts +7 -4
- package/dist/filter-index.cjs +1 -1
- package/dist/filter-index.d.cts +2 -2
- 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.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/parallel-plugin-worker.cjs +3 -3
- package/dist/parallel-plugin-worker.d.cts +1 -1
- package/dist/parallel-plugin-worker.d.mts +1 -1
- package/dist/parallel-plugin-worker.mjs +5 -4
- package/dist/parallel-plugin.d.cts +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.cts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-B2f_h9DF.d.mts → binding-BEeJNtY4.d.mts} +2 -0
- package/dist/shared/{binding-CCkTRaSB.d.cts → binding-CRMJJtol.d.cts} +2 -0
- package/dist/shared/{define-config-BzVT47Bj.d.cts → define-config-Dw9PP95x.d.cts} +18 -4
- package/dist/shared/{define-config-xzVj_WrD.d.mts → define-config-rQzrgjTj.d.mts} +18 -4
- package/dist/shared/{load-config-9KWiC1Y_.cjs → load-config-Df5heSrD.cjs} +1 -1
- package/dist/shared/{load-config-DCz6MK3j.mjs → load-config-Dv1HB87g.mjs} +1 -1
- package/dist/shared/{parse-ast-index-r9XO-GhB.mjs → parse-ast-index-CqHkFxPM.mjs} +1 -1
- package/dist/shared/{parse-ast-index-DZ5uPSgP.cjs → parse-ast-index-DAsDnaa1.cjs} +1 -1
- package/dist/shared/{src-gD0LmYxq.cjs → src-BDMOiU9t.cjs} +130 -119
- package/dist/shared/{src-BSeUgDdv.mjs → src-ZwxjvPpL.mjs} +132 -121
- package/dist/{src-C8_hb_FH.js → src-ZTshMqyf.js} +427 -416
- package/package.json +2 -2
- /package/dist/shared/{dist-DvBwroyk.mjs → dist-ByKQkexh.mjs} +0 -0
- /package/dist/shared/{dist-BVAp8sOm.cjs → dist-CK0hotcm.cjs} +0 -0
|
@@ -11,8 +11,8 @@ var __commonJS = (cb, mod) => function() {
|
|
|
11
11
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
12
|
};
|
|
13
13
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i$
|
|
15
|
-
key = keys[i$
|
|
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
16
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
17
|
get: ((k) => from[k]).bind(null, key),
|
|
18
18
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region package.json
|
|
30
|
-
var version = "1.0.0-beta.
|
|
30
|
+
var version = "1.0.0-beta.32";
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/utils/normalize-string-or-regex.ts
|
|
@@ -40,13 +40,213 @@ function isReadonlyArray(input) {
|
|
|
40
40
|
return Array.isArray(input);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/utils/code-frame.ts
|
|
45
|
+
function spaces(index) {
|
|
46
|
+
let result = "";
|
|
47
|
+
while (index--) result += " ";
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
function tabsToSpaces(value) {
|
|
51
|
+
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
52
|
+
}
|
|
53
|
+
const LINE_TRUNCATE_LENGTH = 120;
|
|
54
|
+
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
55
|
+
const ELLIPSIS = "...";
|
|
56
|
+
function getCodeFrame(source, line, column) {
|
|
57
|
+
let lines = source.split("\n");
|
|
58
|
+
if (line > lines.length) return "";
|
|
59
|
+
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
|
|
60
|
+
const frameStart = Math.max(0, line - 3);
|
|
61
|
+
let frameEnd = Math.min(line + 2, lines.length);
|
|
62
|
+
lines = lines.slice(frameStart, frameEnd);
|
|
63
|
+
while (!/\S/.test(lines[lines.length - 1])) {
|
|
64
|
+
lines.pop();
|
|
65
|
+
frameEnd -= 1;
|
|
66
|
+
}
|
|
67
|
+
const digits = String(frameEnd).length;
|
|
68
|
+
return lines.map((sourceLine, index) => {
|
|
69
|
+
const isErrorLine = frameStart + index + 1 === line;
|
|
70
|
+
let lineNumber = String(index + frameStart + 1);
|
|
71
|
+
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
|
|
72
|
+
let displayedLine = tabsToSpaces(sourceLine);
|
|
73
|
+
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
|
|
74
|
+
if (isErrorLine) {
|
|
75
|
+
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
|
|
76
|
+
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
|
77
|
+
}
|
|
78
|
+
return `${lineNumber}: ${displayedLine}`;
|
|
79
|
+
}).join("\n");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/log/locate-character/index.js
|
|
84
|
+
/** @typedef {import('./types').Location} Location */
|
|
85
|
+
/**
|
|
86
|
+
* @param {import('./types').Range} range
|
|
87
|
+
* @param {number} index
|
|
88
|
+
*/
|
|
89
|
+
function rangeContains(range, index) {
|
|
90
|
+
return range.start <= index && index < range.end;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @param {string} source
|
|
94
|
+
* @param {import('./types').Options} [options]
|
|
95
|
+
*/
|
|
96
|
+
function getLocator(source, options = {}) {
|
|
97
|
+
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
98
|
+
let start = 0;
|
|
99
|
+
const ranges = source.split("\n").map((line, i$2) => {
|
|
100
|
+
const end = start + line.length + 1;
|
|
101
|
+
/** @type {import('./types').Range} */
|
|
102
|
+
const range = {
|
|
103
|
+
start,
|
|
104
|
+
end,
|
|
105
|
+
line: i$2
|
|
106
|
+
};
|
|
107
|
+
start = end;
|
|
108
|
+
return range;
|
|
109
|
+
});
|
|
110
|
+
let i$1 = 0;
|
|
111
|
+
/**
|
|
112
|
+
* @param {string | number} search
|
|
113
|
+
* @param {number} [index]
|
|
114
|
+
* @returns {Location | undefined}
|
|
115
|
+
*/
|
|
116
|
+
function locator(search, index) {
|
|
117
|
+
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
118
|
+
if (search === -1) return void 0;
|
|
119
|
+
let range = ranges[i$1];
|
|
120
|
+
const d$1 = search >= range.end ? 1 : -1;
|
|
121
|
+
while (range) {
|
|
122
|
+
if (rangeContains(range, search)) return {
|
|
123
|
+
line: offsetLine + range.line,
|
|
124
|
+
column: offsetColumn + search - range.start,
|
|
125
|
+
character: search
|
|
126
|
+
};
|
|
127
|
+
i$1 += d$1;
|
|
128
|
+
range = ranges[i$1];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return locator;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @param {string} source
|
|
135
|
+
* @param {string | number} search
|
|
136
|
+
* @param {import('./types').Options} [options]
|
|
137
|
+
* @returns {Location | undefined}
|
|
138
|
+
*/
|
|
139
|
+
function locate(source, search, options) {
|
|
140
|
+
return getLocator(source, options)(search, options && options.startIndex);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/log/logs.ts
|
|
145
|
+
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", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
|
|
146
|
+
function logParseError(message) {
|
|
147
|
+
return {
|
|
148
|
+
code: PARSE_ERROR,
|
|
149
|
+
message
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function logInvalidLogPosition(pluginName) {
|
|
153
|
+
return {
|
|
154
|
+
code: INVALID_LOG_POSITION,
|
|
155
|
+
message: `Plugin "${pluginName}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function logInputHookInOutputPlugin(pluginName, hookName) {
|
|
159
|
+
return {
|
|
160
|
+
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
|
161
|
+
message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function logCycleLoading(pluginName, moduleId) {
|
|
165
|
+
return {
|
|
166
|
+
code: CYCLE_LOADING,
|
|
167
|
+
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function logMultiplyNotifyOption() {
|
|
171
|
+
return {
|
|
172
|
+
code: MULTIPLY_NOTIFY_OPTION,
|
|
173
|
+
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function logDuplicateJsxConfig() {
|
|
177
|
+
return {
|
|
178
|
+
code: DUPLICATE_JSX_CONFIG,
|
|
179
|
+
message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function logNoFileSystemInBrowser(method) {
|
|
183
|
+
return {
|
|
184
|
+
code: NO_FS_IN_BROWSER,
|
|
185
|
+
message: `Cannot access the file system (via "${method}") when using the browser build of Rolldown.`
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function logPluginError(error$1, plugin, { hook, id: id$1 } = {}) {
|
|
189
|
+
try {
|
|
190
|
+
const code$1 = error$1.code;
|
|
191
|
+
if (!error$1.pluginCode && code$1 != null && (typeof code$1 !== "string" || !code$1.startsWith("PLUGIN_"))) error$1.pluginCode = code$1;
|
|
192
|
+
error$1.code = PLUGIN_ERROR;
|
|
193
|
+
error$1.plugin = plugin;
|
|
194
|
+
if (hook) error$1.hook = hook;
|
|
195
|
+
if (id$1) error$1.id = id$1;
|
|
196
|
+
} catch (_) {} finally {
|
|
197
|
+
return error$1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function error(base) {
|
|
201
|
+
if (!(base instanceof Error)) {
|
|
202
|
+
base = Object.assign(new Error(base.message), base);
|
|
203
|
+
Object.defineProperty(base, "name", {
|
|
204
|
+
value: "RollupError",
|
|
205
|
+
writable: true
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
throw base;
|
|
209
|
+
}
|
|
210
|
+
function augmentCodeLocation(properties, pos, source, id$1) {
|
|
211
|
+
if (typeof pos === "object") {
|
|
212
|
+
const { line, column } = pos;
|
|
213
|
+
properties.loc = {
|
|
214
|
+
column,
|
|
215
|
+
file: id$1,
|
|
216
|
+
line
|
|
217
|
+
};
|
|
218
|
+
} else {
|
|
219
|
+
properties.pos = pos;
|
|
220
|
+
const location = locate(source, pos, { offsetLine: 1 });
|
|
221
|
+
if (!location) return;
|
|
222
|
+
const { line, column } = location;
|
|
223
|
+
properties.loc = {
|
|
224
|
+
column,
|
|
225
|
+
file: id$1,
|
|
226
|
+
line
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (properties.frame === void 0) {
|
|
230
|
+
const { line, column } = properties.loc;
|
|
231
|
+
properties.frame = getCodeFrame(source, line, column);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
43
235
|
//#endregion
|
|
44
236
|
//#region src/builtin-plugin/utils.ts
|
|
45
237
|
function makeBuiltinPluginCallable(plugin) {
|
|
46
238
|
let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
47
239
|
const wrappedPlugin = plugin;
|
|
48
|
-
for (const key in callablePlugin) wrappedPlugin[key] = function(...args$1) {
|
|
49
|
-
|
|
240
|
+
for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
|
|
241
|
+
try {
|
|
242
|
+
return await callablePlugin[key](...args$1);
|
|
243
|
+
} catch (e$2) {
|
|
244
|
+
if (e$2 instanceof Error && !e$2.stack?.includes("at ")) Error.captureStackTrace(e$2, wrappedPlugin[key]);
|
|
245
|
+
return error(logPluginError(e$2, plugin.name, {
|
|
246
|
+
hook: key,
|
|
247
|
+
id: key === "transform" ? args$1[2] : void 0
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
50
250
|
};
|
|
51
251
|
return wrappedPlugin;
|
|
52
252
|
}
|
|
@@ -119,171 +319,171 @@ function webWorkerPostPlugin() {
|
|
|
119
319
|
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
120
320
|
let _lazyMatch = () => {
|
|
121
321
|
var __lib__ = (() => {
|
|
122
|
-
var m$1 = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r$1, e$
|
|
123
|
-
for (var n$
|
|
124
|
-
get: e$
|
|
322
|
+
var m$1 = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r$1, e$2) => {
|
|
323
|
+
for (var n$2 in e$2) m$1(r$1, n$2, {
|
|
324
|
+
get: e$2[n$2],
|
|
125
325
|
enumerable: true
|
|
126
326
|
});
|
|
127
|
-
}, H = (r$1, e$
|
|
128
|
-
if (e$
|
|
129
|
-
get: () => e$
|
|
130
|
-
enumerable: !(a$2 = V(e$
|
|
327
|
+
}, H = (r$1, e$2, n$2, a$2) => {
|
|
328
|
+
if (e$2 && typeof e$2 == "object" || typeof e$2 == "function") for (let t$3 of G(e$2)) !T.call(r$1, t$3) && t$3 !== n$2 && m$1(r$1, t$3, {
|
|
329
|
+
get: () => e$2[t$3],
|
|
330
|
+
enumerable: !(a$2 = V(e$2, t$3)) || a$2.enumerable
|
|
131
331
|
});
|
|
132
332
|
return r$1;
|
|
133
333
|
}, J = (r$1) => H(m$1({}, "__esModule", { value: true }), r$1), w$1 = {};
|
|
134
334
|
q(w$1, { default: () => re });
|
|
135
|
-
var A = (r$1) => Array.isArray(r$1), d$
|
|
136
|
-
const e$
|
|
137
|
-
return (n$
|
|
138
|
-
const a$2 = e$
|
|
335
|
+
var A = (r$1) => Array.isArray(r$1), d$1 = (r$1) => typeof r$1 == "function", Q = (r$1) => r$1.length === 0, W = (r$1) => typeof r$1 == "number", K = (r$1) => typeof r$1 == "object" && r$1 !== null, X = (r$1) => r$1 instanceof RegExp, b$1 = (r$1) => typeof r$1 == "string", h$1 = (r$1) => r$1 === void 0, Y = (r$1) => {
|
|
336
|
+
const e$2 = /* @__PURE__ */ new Map();
|
|
337
|
+
return (n$2) => {
|
|
338
|
+
const a$2 = e$2.get(n$2);
|
|
139
339
|
if (a$2) return a$2;
|
|
140
|
-
const t$
|
|
141
|
-
return e$
|
|
340
|
+
const t$3 = r$1(n$2);
|
|
341
|
+
return e$2.set(n$2, t$3), t$3;
|
|
142
342
|
};
|
|
143
|
-
}, rr = (r$1, e$
|
|
343
|
+
}, rr = (r$1, e$2, n$2 = {}) => {
|
|
144
344
|
const a$2 = {
|
|
145
345
|
cache: {},
|
|
146
346
|
input: r$1,
|
|
147
347
|
index: 0,
|
|
148
348
|
indexMax: 0,
|
|
149
|
-
options: n$
|
|
349
|
+
options: n$2,
|
|
150
350
|
output: []
|
|
151
351
|
};
|
|
152
|
-
if (v(e$
|
|
352
|
+
if (v(e$2)(a$2) && a$2.index === r$1.length) return a$2.output;
|
|
153
353
|
throw new Error(`Failed to parse at index ${a$2.indexMax}`);
|
|
154
|
-
}, i$
|
|
155
|
-
const n$
|
|
354
|
+
}, i$1 = (r$1, e$2) => A(r$1) ? er(r$1, e$2) : b$1(r$1) ? ar(r$1, e$2) : nr(r$1, e$2), er = (r$1, e$2) => {
|
|
355
|
+
const n$2 = {};
|
|
156
356
|
for (const a$2 of r$1) {
|
|
157
357
|
if (a$2.length !== 1) throw new Error(`Invalid character: "${a$2}"`);
|
|
158
|
-
const t$
|
|
159
|
-
n$
|
|
358
|
+
const t$3 = a$2.charCodeAt(0);
|
|
359
|
+
n$2[t$3] = true;
|
|
160
360
|
}
|
|
161
361
|
return (a$2) => {
|
|
162
|
-
const t$
|
|
163
|
-
for (; a$2.index < o$1.length && o$1.charCodeAt(a$2.index) in n$
|
|
164
|
-
const u$
|
|
165
|
-
if (u$
|
|
166
|
-
if (!h$1(e$
|
|
167
|
-
const s$1 = a$2.input.slice(t$
|
|
362
|
+
const t$3 = a$2.index, o$1 = a$2.input;
|
|
363
|
+
for (; a$2.index < o$1.length && o$1.charCodeAt(a$2.index) in n$2;) a$2.index += 1;
|
|
364
|
+
const u$1 = a$2.index;
|
|
365
|
+
if (u$1 > t$3) {
|
|
366
|
+
if (!h$1(e$2) && !a$2.options.silent) {
|
|
367
|
+
const s$1 = a$2.input.slice(t$3, u$1), c$1 = d$1(e$2) ? e$2(s$1, o$1, String(t$3)) : e$2;
|
|
168
368
|
h$1(c$1) || a$2.output.push(c$1);
|
|
169
369
|
}
|
|
170
370
|
a$2.indexMax = Math.max(a$2.indexMax, a$2.index);
|
|
171
371
|
}
|
|
172
372
|
return true;
|
|
173
373
|
};
|
|
174
|
-
}, nr = (r$1, e$
|
|
175
|
-
const n$
|
|
374
|
+
}, nr = (r$1, e$2) => {
|
|
375
|
+
const n$2 = r$1.source, a$2 = r$1.flags.replace(/y|$/, "y"), t$3 = new RegExp(n$2, a$2);
|
|
176
376
|
return g$1((o$1) => {
|
|
177
|
-
t$
|
|
178
|
-
const u$
|
|
179
|
-
if (u$
|
|
180
|
-
if (!h$1(e$
|
|
181
|
-
const s$1 = d$
|
|
377
|
+
t$3.lastIndex = o$1.index;
|
|
378
|
+
const u$1 = t$3.exec(o$1.input);
|
|
379
|
+
if (u$1) {
|
|
380
|
+
if (!h$1(e$2) && !o$1.options.silent) {
|
|
381
|
+
const s$1 = d$1(e$2) ? e$2(...u$1, o$1.input, String(o$1.index)) : e$2;
|
|
182
382
|
h$1(s$1) || o$1.output.push(s$1);
|
|
183
383
|
}
|
|
184
|
-
return o$1.index += u$
|
|
384
|
+
return o$1.index += u$1[0].length, o$1.indexMax = Math.max(o$1.indexMax, o$1.index), true;
|
|
185
385
|
} else return false;
|
|
186
386
|
});
|
|
187
|
-
}, ar = (r$1, e$
|
|
188
|
-
if (n$
|
|
189
|
-
if (!h$1(e$
|
|
190
|
-
const t$
|
|
191
|
-
h$1(t$
|
|
387
|
+
}, ar = (r$1, e$2) => (n$2) => {
|
|
388
|
+
if (n$2.input.startsWith(r$1, n$2.index)) {
|
|
389
|
+
if (!h$1(e$2) && !n$2.options.silent) {
|
|
390
|
+
const t$3 = d$1(e$2) ? e$2(r$1, n$2.input, String(n$2.index)) : e$2;
|
|
391
|
+
h$1(t$3) || n$2.output.push(t$3);
|
|
192
392
|
}
|
|
193
|
-
return n$
|
|
393
|
+
return n$2.index += r$1.length, n$2.indexMax = Math.max(n$2.indexMax, n$2.index), true;
|
|
194
394
|
} else return false;
|
|
195
|
-
}, C = (r$1, e$
|
|
196
|
-
const t$
|
|
395
|
+
}, C = (r$1, e$2, n$2, a$2) => {
|
|
396
|
+
const t$3 = v(r$1);
|
|
197
397
|
return g$1(_(M((o$1) => {
|
|
198
|
-
let u$
|
|
199
|
-
for (; u$
|
|
398
|
+
let u$1 = 0;
|
|
399
|
+
for (; u$1 < n$2;) {
|
|
200
400
|
const s$1 = o$1.index;
|
|
201
|
-
if (!t$
|
|
401
|
+
if (!t$3(o$1) || (u$1 += 1, o$1.index === s$1)) break;
|
|
202
402
|
}
|
|
203
|
-
return u$
|
|
403
|
+
return u$1 >= e$2;
|
|
204
404
|
})));
|
|
205
|
-
}, tr = (r$1, e$
|
|
206
|
-
const n$
|
|
405
|
+
}, tr = (r$1, e$2) => C(r$1, 0, 1), f$1 = (r$1, e$2) => C(r$1, 0, Infinity), x = (r$1, e$2) => {
|
|
406
|
+
const n$2 = r$1.map(v);
|
|
207
407
|
return g$1(_(M((a$2) => {
|
|
208
|
-
for (let t$
|
|
408
|
+
for (let t$3 = 0, o$1 = n$2.length; t$3 < o$1; t$3++) if (!n$2[t$3](a$2)) return false;
|
|
209
409
|
return true;
|
|
210
410
|
})));
|
|
211
|
-
}, l$1 = (r$1, e$
|
|
212
|
-
const n$
|
|
411
|
+
}, l$1 = (r$1, e$2) => {
|
|
412
|
+
const n$2 = r$1.map(v);
|
|
213
413
|
return g$1(_((a$2) => {
|
|
214
|
-
for (let t$
|
|
414
|
+
for (let t$3 = 0, o$1 = n$2.length; t$3 < o$1; t$3++) if (n$2[t$3](a$2)) return true;
|
|
215
415
|
return false;
|
|
216
416
|
}));
|
|
217
|
-
}, M = (r$1, e$
|
|
218
|
-
const n$
|
|
417
|
+
}, M = (r$1, e$2 = false) => {
|
|
418
|
+
const n$2 = v(r$1);
|
|
219
419
|
return (a$2) => {
|
|
220
|
-
const t$
|
|
221
|
-
return (!u$
|
|
420
|
+
const t$3 = a$2.index, o$1 = a$2.output.length, u$1 = n$2(a$2);
|
|
421
|
+
return (!u$1 || e$2) && (a$2.index = t$3, a$2.output.length !== o$1 && (a$2.output.length = o$1)), u$1;
|
|
222
422
|
};
|
|
223
|
-
}, _ = (r$1, e$
|
|
224
|
-
const n$
|
|
225
|
-
return n$
|
|
423
|
+
}, _ = (r$1, e$2) => {
|
|
424
|
+
const n$2 = v(r$1);
|
|
425
|
+
return n$2;
|
|
226
426
|
}, g$1 = (() => {
|
|
227
427
|
let r$1 = 0;
|
|
228
|
-
return (e$
|
|
229
|
-
const n$
|
|
230
|
-
return (t$
|
|
428
|
+
return (e$2) => {
|
|
429
|
+
const n$2 = v(e$2), a$2 = r$1 += 1;
|
|
430
|
+
return (t$3) => {
|
|
231
431
|
var o$1;
|
|
232
|
-
if (t$
|
|
233
|
-
const u$
|
|
432
|
+
if (t$3.options.memoization === false) return n$2(t$3);
|
|
433
|
+
const u$1 = t$3.index, s$1 = (o$1 = t$3.cache)[a$2] || (o$1[a$2] = /* @__PURE__ */ new Map()), c$1 = s$1.get(u$1);
|
|
234
434
|
if (c$1 === false) return false;
|
|
235
|
-
if (W(c$1)) return t$
|
|
236
|
-
if (c$1) return t$
|
|
435
|
+
if (W(c$1)) return t$3.index = c$1, true;
|
|
436
|
+
if (c$1) return t$3.index = c$1.index, c$1.output?.length && t$3.output.push(...c$1.output), true;
|
|
237
437
|
{
|
|
238
|
-
const Z = t$
|
|
239
|
-
if (n$
|
|
240
|
-
const D = t$
|
|
438
|
+
const Z = t$3.output.length;
|
|
439
|
+
if (n$2(t$3)) {
|
|
440
|
+
const D = t$3.index, U = t$3.output.length;
|
|
241
441
|
if (U > Z) {
|
|
242
|
-
const ee = t$
|
|
243
|
-
s$1.set(u$
|
|
442
|
+
const ee = t$3.output.slice(Z, U);
|
|
443
|
+
s$1.set(u$1, {
|
|
244
444
|
index: D,
|
|
245
445
|
output: ee
|
|
246
446
|
});
|
|
247
|
-
} else s$1.set(u$
|
|
447
|
+
} else s$1.set(u$1, D);
|
|
248
448
|
return true;
|
|
249
|
-
} else return s$1.set(u$
|
|
449
|
+
} else return s$1.set(u$1, false), false;
|
|
250
450
|
}
|
|
251
451
|
};
|
|
252
452
|
};
|
|
253
453
|
})(), E = (r$1) => {
|
|
254
|
-
let e$
|
|
255
|
-
return (n$
|
|
454
|
+
let e$2;
|
|
455
|
+
return (n$2) => (e$2 || (e$2 = v(r$1())), e$2(n$2));
|
|
256
456
|
}, v = Y((r$1) => {
|
|
257
|
-
if (d$
|
|
258
|
-
if (b$1(r$1) || X(r$1)) return i$
|
|
457
|
+
if (d$1(r$1)) return Q(r$1) ? E(r$1) : r$1;
|
|
458
|
+
if (b$1(r$1) || X(r$1)) return i$1(r$1);
|
|
259
459
|
if (A(r$1)) return x(r$1);
|
|
260
460
|
if (K(r$1)) return l$1(Object.values(r$1));
|
|
261
461
|
throw new Error("Invalid rule");
|
|
262
462
|
}), P = "abcdefghijklmnopqrstuvwxyz", ir = (r$1) => {
|
|
263
|
-
let e$
|
|
463
|
+
let e$2 = "";
|
|
264
464
|
for (; r$1 > 0;) {
|
|
265
|
-
const n$
|
|
266
|
-
e$
|
|
465
|
+
const n$2 = (r$1 - 1) % 26;
|
|
466
|
+
e$2 = P[n$2] + e$2, r$1 = Math.floor((r$1 - 1) / 26);
|
|
267
467
|
}
|
|
268
|
-
return e$
|
|
468
|
+
return e$2;
|
|
269
469
|
}, O$1 = (r$1) => {
|
|
270
|
-
let e$
|
|
271
|
-
for (let n$
|
|
272
|
-
return e$
|
|
273
|
-
}, S = (r$1, e$
|
|
274
|
-
if (e$
|
|
275
|
-
const n$
|
|
276
|
-
for (; r$1 <= e$
|
|
277
|
-
return n$
|
|
278
|
-
}, or$1 = (r$1, e$
|
|
279
|
-
const e$
|
|
280
|
-
return (n$
|
|
281
|
-
}, sr = i$
|
|
470
|
+
let e$2 = 0;
|
|
471
|
+
for (let n$2 = 0, a$2 = r$1.length; n$2 < a$2; n$2++) e$2 = e$2 * 26 + P.indexOf(r$1[n$2]) + 1;
|
|
472
|
+
return e$2;
|
|
473
|
+
}, S = (r$1, e$2) => {
|
|
474
|
+
if (e$2 < r$1) return S(e$2, r$1);
|
|
475
|
+
const n$2 = [];
|
|
476
|
+
for (; r$1 <= e$2;) n$2.push(r$1++);
|
|
477
|
+
return n$2;
|
|
478
|
+
}, or$1 = (r$1, e$2, n$2) => S(r$1, e$2).map((a$2) => String(a$2).padStart(n$2, "0")), R = (r$1, e$2) => S(O$1(r$1), O$1(e$2)).map(ir), p$1 = (r$1) => r$1, z = (r$1) => ur((e$2) => rr(e$2, r$1, { memoization: false }).join("")), ur = (r$1) => {
|
|
479
|
+
const e$2 = {};
|
|
480
|
+
return (n$2) => e$2[n$2] ?? (e$2[n$2] = r$1(n$2));
|
|
481
|
+
}, sr = i$1(/^\*\*\/\*$/, ".*"), cr = i$1(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r$1, e$2, n$2) => `.*${e$2 ? "" : "(?:^|/)"}${n$2.replaceAll(".", "\\.")}`), lr = i$1(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r$1, e$2, n$2, a$2) => `.*${e$2 ? "" : "(?:^|/)"}${n$2.replaceAll(".", "\\.")}(?:${a$2.replaceAll(",", "|").replaceAll(".", "\\.")})`), y$1 = i$1(/\\./, p$1), pr = i$1(/[$.*+?^(){}[\]\|]/, (r$1) => `\\${r$1}`), vr = i$1(/./, p$1), hr = i$1(/^(?:!!)*!(.*)$/, (r$1, e$2) => `(?!^${L(e$2)}$).*?`), dr = i$1(/^(!!)+/, ""), fr = l$1([hr, dr]), xr = i$1(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i$1(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i$1(/\/(\*\*)$/, "(?:/.*|$)"), _r = i$1(/\*\*/, ".*"), j = l$1([
|
|
282
482
|
xr,
|
|
283
483
|
gr,
|
|
284
484
|
mr,
|
|
285
485
|
_r
|
|
286
|
-
]), Sr = i$
|
|
486
|
+
]), Sr = i$1(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i$1(/\*/, "[^/]*"), N = l$1([Sr, yr]), k = i$1("?", "[^/]"), $r = i$1("[", p$1), wr = i$1("]", p$1), Ar = i$1(/[!^]/, "^/"), br = i$1(/[a-z]-[a-z]|[0-9]-[0-9]/i, p$1), Cr = i$1(/[$.*+?^(){}[\|]/, (r$1) => `\\${r$1}`), Mr = i$1(/[^\]]/, p$1), Er = l$1([
|
|
287
487
|
y$1,
|
|
288
488
|
Cr,
|
|
289
489
|
br,
|
|
@@ -293,7 +493,7 @@ let _lazyMatch = () => {
|
|
|
293
493
|
tr(Ar),
|
|
294
494
|
f$1(Er),
|
|
295
495
|
wr
|
|
296
|
-
]), Pr = i$
|
|
496
|
+
]), Pr = i$1("{", "(?:"), Or$1 = i$1("}", ")"), Rr = i$1(/(\d+)\.\.(\d+)/, (r$1, e$2, n$2) => or$1(+e$2, +n$2, Math.min(e$2.length, n$2.length)).join("|")), zr = i$1(/([a-z]+)\.\.([a-z]+)/, (r$1, e$2, n$2) => R(e$2, n$2).join("|")), jr = i$1(/([A-Z]+)\.\.([A-Z]+)/, (r$1, e$2, n$2) => R(e$2.toLowerCase(), n$2.toLowerCase()).join("|").toUpperCase()), Nr = l$1([
|
|
297
497
|
Rr,
|
|
298
498
|
zr,
|
|
299
499
|
jr
|
|
@@ -301,7 +501,7 @@ let _lazyMatch = () => {
|
|
|
301
501
|
Pr,
|
|
302
502
|
Nr,
|
|
303
503
|
Or$1
|
|
304
|
-
]), kr = i$
|
|
504
|
+
]), kr = i$1("{", "(?:"), Br = i$1("}", ")"), Ir = i$1(",", "|"), Fr = i$1(/[$.*+?^(){[\]\|]/, (r$1) => `\\${r$1}`), Lr = i$1(/[^}]/, p$1), Zr = E(() => F), Dr = l$1([
|
|
305
505
|
j,
|
|
306
506
|
N,
|
|
307
507
|
k,
|
|
@@ -330,16 +530,16 @@ let _lazyMatch = () => {
|
|
|
330
530
|
y$1,
|
|
331
531
|
pr,
|
|
332
532
|
vr
|
|
333
|
-
])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i$
|
|
533
|
+
])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i$1(/\\./, p$1), qr = i$1(/./, p$1), Hr = i$1(/\*\*\*+/, "*"), Jr = i$1(/([^/{[(!])\*\*/, (r$1, e$2) => `${e$2}*`), Qr = i$1(/(^|.)\*\*(?=[^*/)\]}])/, (r$1, e$2) => `${e$2}*`), Wr = f$1(l$1([
|
|
334
534
|
Tr,
|
|
335
535
|
Hr,
|
|
336
536
|
Jr,
|
|
337
537
|
Qr,
|
|
338
538
|
qr
|
|
339
|
-
])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r$1, e$
|
|
340
|
-
const n$
|
|
341
|
-
if (!n$
|
|
342
|
-
const a$2 = n$
|
|
539
|
+
])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r$1, e$2) => {
|
|
540
|
+
const n$2 = Array.isArray(r$1) ? r$1 : [r$1];
|
|
541
|
+
if (!n$2.length) return false;
|
|
542
|
+
const a$2 = n$2.map($.compile), t$3 = n$2.every((s$1) => /(\/(?:\*\*)?|\[\/\])$/.test(s$1)), o$1 = e$2.replace(/[\\\/]+/g, "/").replace(/\/$/, t$3 ? "/" : "");
|
|
343
543
|
return a$2.some((s$1) => s$1.test(o$1));
|
|
344
544
|
};
|
|
345
545
|
$.compile = (r$1) => new RegExp(`^${L(Yr(r$1))}$`, "s");
|
|
@@ -509,8 +709,8 @@ const format = function(p$1) {
|
|
|
509
709
|
const basename = function(p$1, extension) {
|
|
510
710
|
const segments = normalizeWindowsPath(p$1).split("/");
|
|
511
711
|
let lastSegment = "";
|
|
512
|
-
for (let i$
|
|
513
|
-
const val = segments[i$
|
|
712
|
+
for (let i$1 = segments.length - 1; i$1 >= 0; i$1--) {
|
|
713
|
+
const val = segments[i$1];
|
|
514
714
|
if (val) {
|
|
515
715
|
lastSegment = val;
|
|
516
716
|
break;
|
|
@@ -601,198 +801,6 @@ const logLevelPriority = {
|
|
|
601
801
|
[LOG_LEVEL_SILENT]: 3
|
|
602
802
|
};
|
|
603
803
|
|
|
604
|
-
//#endregion
|
|
605
|
-
//#region src/utils/code-frame.ts
|
|
606
|
-
function spaces(index) {
|
|
607
|
-
let result = "";
|
|
608
|
-
while (index--) result += " ";
|
|
609
|
-
return result;
|
|
610
|
-
}
|
|
611
|
-
function tabsToSpaces(value) {
|
|
612
|
-
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
613
|
-
}
|
|
614
|
-
const LINE_TRUNCATE_LENGTH = 120;
|
|
615
|
-
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
616
|
-
const ELLIPSIS = "...";
|
|
617
|
-
function getCodeFrame(source, line, column) {
|
|
618
|
-
let lines = source.split("\n");
|
|
619
|
-
if (line > lines.length) return "";
|
|
620
|
-
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
|
|
621
|
-
const frameStart = Math.max(0, line - 3);
|
|
622
|
-
let frameEnd = Math.min(line + 2, lines.length);
|
|
623
|
-
lines = lines.slice(frameStart, frameEnd);
|
|
624
|
-
while (!/\S/.test(lines[lines.length - 1])) {
|
|
625
|
-
lines.pop();
|
|
626
|
-
frameEnd -= 1;
|
|
627
|
-
}
|
|
628
|
-
const digits = String(frameEnd).length;
|
|
629
|
-
return lines.map((sourceLine, index) => {
|
|
630
|
-
const isErrorLine = frameStart + index + 1 === line;
|
|
631
|
-
let lineNumber = String(index + frameStart + 1);
|
|
632
|
-
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
|
|
633
|
-
let displayedLine = tabsToSpaces(sourceLine);
|
|
634
|
-
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
|
|
635
|
-
if (isErrorLine) {
|
|
636
|
-
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
|
|
637
|
-
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
|
638
|
-
}
|
|
639
|
-
return `${lineNumber}: ${displayedLine}`;
|
|
640
|
-
}).join("\n");
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
//#endregion
|
|
644
|
-
//#region src/log/locate-character/index.js
|
|
645
|
-
/** @typedef {import('./types').Location} Location */
|
|
646
|
-
/**
|
|
647
|
-
* @param {import('./types').Range} range
|
|
648
|
-
* @param {number} index
|
|
649
|
-
*/
|
|
650
|
-
function rangeContains(range, index) {
|
|
651
|
-
return range.start <= index && index < range.end;
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
* @param {string} source
|
|
655
|
-
* @param {import('./types').Options} [options]
|
|
656
|
-
*/
|
|
657
|
-
function getLocator(source, options = {}) {
|
|
658
|
-
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
659
|
-
let start = 0;
|
|
660
|
-
const ranges = source.split("\n").map((line, i$3) => {
|
|
661
|
-
const end = start + line.length + 1;
|
|
662
|
-
/** @type {import('./types').Range} */
|
|
663
|
-
const range = {
|
|
664
|
-
start,
|
|
665
|
-
end,
|
|
666
|
-
line: i$3
|
|
667
|
-
};
|
|
668
|
-
start = end;
|
|
669
|
-
return range;
|
|
670
|
-
});
|
|
671
|
-
let i$2 = 0;
|
|
672
|
-
/**
|
|
673
|
-
* @param {string | number} search
|
|
674
|
-
* @param {number} [index]
|
|
675
|
-
* @returns {Location | undefined}
|
|
676
|
-
*/
|
|
677
|
-
function locator(search, index) {
|
|
678
|
-
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
679
|
-
if (search === -1) return void 0;
|
|
680
|
-
let range = ranges[i$2];
|
|
681
|
-
const d$2 = search >= range.end ? 1 : -1;
|
|
682
|
-
while (range) {
|
|
683
|
-
if (rangeContains(range, search)) return {
|
|
684
|
-
line: offsetLine + range.line,
|
|
685
|
-
column: offsetColumn + search - range.start,
|
|
686
|
-
character: search
|
|
687
|
-
};
|
|
688
|
-
i$2 += d$2;
|
|
689
|
-
range = ranges[i$2];
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
return locator;
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* @param {string} source
|
|
696
|
-
* @param {string | number} search
|
|
697
|
-
* @param {import('./types').Options} [options]
|
|
698
|
-
* @returns {Location | undefined}
|
|
699
|
-
*/
|
|
700
|
-
function locate(source, search, options) {
|
|
701
|
-
return getLocator(source, options)(search, options && options.startIndex);
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
//#endregion
|
|
705
|
-
//#region src/log/logs.ts
|
|
706
|
-
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", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
|
|
707
|
-
function logParseError(message) {
|
|
708
|
-
return {
|
|
709
|
-
code: PARSE_ERROR,
|
|
710
|
-
message
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
function logInvalidLogPosition(pluginName) {
|
|
714
|
-
return {
|
|
715
|
-
code: INVALID_LOG_POSITION,
|
|
716
|
-
message: `Plugin "${pluginName}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
|
|
717
|
-
};
|
|
718
|
-
}
|
|
719
|
-
function logInputHookInOutputPlugin(pluginName, hookName) {
|
|
720
|
-
return {
|
|
721
|
-
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
|
722
|
-
message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
function logCycleLoading(pluginName, moduleId) {
|
|
726
|
-
return {
|
|
727
|
-
code: CYCLE_LOADING,
|
|
728
|
-
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
function logMultiplyNotifyOption() {
|
|
732
|
-
return {
|
|
733
|
-
code: MULTIPLY_NOTIFY_OPTION,
|
|
734
|
-
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
function logDuplicateJsxConfig() {
|
|
738
|
-
return {
|
|
739
|
-
code: DUPLICATE_JSX_CONFIG,
|
|
740
|
-
message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
function logNoFileSystemInBrowser(method) {
|
|
744
|
-
return {
|
|
745
|
-
code: NO_FS_IN_BROWSER,
|
|
746
|
-
message: `Cannot access the file system (via "${method}") when using the browser build of Rolldown.`
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
function logPluginError(error$1, plugin, { hook, id: id$1 } = {}) {
|
|
750
|
-
try {
|
|
751
|
-
const code$1 = error$1.code;
|
|
752
|
-
if (!error$1.pluginCode && code$1 != null && (typeof code$1 !== "string" || !code$1.startsWith("PLUGIN_"))) error$1.pluginCode = code$1;
|
|
753
|
-
error$1.code = PLUGIN_ERROR;
|
|
754
|
-
error$1.plugin = plugin;
|
|
755
|
-
if (hook) error$1.hook = hook;
|
|
756
|
-
if (id$1) error$1.id = id$1;
|
|
757
|
-
} catch (_) {} finally {
|
|
758
|
-
return error$1;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
function error(base) {
|
|
762
|
-
if (!(base instanceof Error)) {
|
|
763
|
-
base = Object.assign(new Error(base.message), base);
|
|
764
|
-
Object.defineProperty(base, "name", {
|
|
765
|
-
value: "RollupError",
|
|
766
|
-
writable: true
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
throw base;
|
|
770
|
-
}
|
|
771
|
-
function augmentCodeLocation(properties, pos, source, id$1) {
|
|
772
|
-
if (typeof pos === "object") {
|
|
773
|
-
const { line, column } = pos;
|
|
774
|
-
properties.loc = {
|
|
775
|
-
column,
|
|
776
|
-
file: id$1,
|
|
777
|
-
line
|
|
778
|
-
};
|
|
779
|
-
} else {
|
|
780
|
-
properties.pos = pos;
|
|
781
|
-
const location = locate(source, pos, { offsetLine: 1 });
|
|
782
|
-
if (!location) return;
|
|
783
|
-
const { line, column } = location;
|
|
784
|
-
properties.loc = {
|
|
785
|
-
column,
|
|
786
|
-
file: id$1,
|
|
787
|
-
line
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
if (properties.frame === void 0) {
|
|
791
|
-
const { line, column } = properties.loc;
|
|
792
|
-
properties.frame = getCodeFrame(source, line, column);
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
|
|
796
804
|
//#endregion
|
|
797
805
|
//#region src/log/log-handler.ts
|
|
798
806
|
const normalizeLog = (log) => typeof log === "string" ? { message: log } : typeof log === "function" ? normalizeLog(log()) : log;
|
|
@@ -1022,8 +1030,8 @@ var MinimalPluginContextImpl = class {
|
|
|
1022
1030
|
watchMode
|
|
1023
1031
|
};
|
|
1024
1032
|
}
|
|
1025
|
-
error(e$
|
|
1026
|
-
return error(logPluginError(normalizeLog(e$
|
|
1033
|
+
error(e$2) {
|
|
1034
|
+
return error(logPluginError(normalizeLog(e$2), this.pluginName, { hook: this.hookName }));
|
|
1027
1035
|
}
|
|
1028
1036
|
};
|
|
1029
1037
|
|
|
@@ -2062,22 +2070,22 @@ function safeParse(schema, input, config2) {
|
|
|
2062
2070
|
//#endregion
|
|
2063
2071
|
//#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
|
|
2064
2072
|
var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs": ((exports, module) => {
|
|
2065
|
-
let e, t, r, { defineProperty: n, setPrototypeOf: l, create: o, keys: s } = Object, i
|
|
2066
|
-
let t$
|
|
2073
|
+
let e$1, t$2, r, { defineProperty: n$1, setPrototypeOf: l, create: o, keys: s } = Object, i = "", { round: c, max: a$1 } = Math, p = (e$2) => {
|
|
2074
|
+
let t$3 = /([a-f\d]{3,6})/i.exec(e$2)?.[1], r$1 = t$3?.length, n$2 = 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);
|
|
2067
2075
|
return [
|
|
2068
|
-
n$
|
|
2069
|
-
n$
|
|
2070
|
-
255 & n$
|
|
2076
|
+
n$2 >> 16 & 255,
|
|
2077
|
+
n$2 >> 8 & 255,
|
|
2078
|
+
255 & n$2
|
|
2071
2079
|
];
|
|
2072
|
-
}, u
|
|
2073
|
-
let t$
|
|
2074
|
-
return 8 > e$
|
|
2080
|
+
}, 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) => {
|
|
2081
|
+
let t$3, r$1, n$2, l$1, o$1;
|
|
2082
|
+
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, n$2 = o$1 % 6 / 5) : t$3 = r$1 = n$2 = (10 * (e$2 - 232) + 8) / 255, l$1 = 2 * a$1(t$3, r$1, n$2), l$1 ? 30 + (c(n$2) << 2 | c(r$1) << 1 | c(t$3)) + (2 ^ l$1 ? 0 : 60) : 30);
|
|
2075
2083
|
}, g = (() => {
|
|
2076
|
-
let r$1 = (e$
|
|
2084
|
+
let r$1 = (e$2) => o$1.some(((t$3) => e$2.test(t$3))), n$2 = globalThis, l$1 = n$2.process ?? {}, o$1 = l$1.argv ?? [], i$1 = l$1.env ?? {}, c$1 = -1;
|
|
2077
2085
|
try {
|
|
2078
|
-
e = "," + s(i$
|
|
2079
|
-
} catch (e$
|
|
2080
|
-
i$
|
|
2086
|
+
e$1 = "," + s(i$1).join(",");
|
|
2087
|
+
} catch (e$2) {
|
|
2088
|
+
i$1 = {}, c$1 = 0;
|
|
2081
2089
|
}
|
|
2082
2090
|
let a$2 = "FORCE_COLOR", p$1 = {
|
|
2083
2091
|
false: 0,
|
|
@@ -2085,61 +2093,61 @@ var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis
|
|
|
2085
2093
|
1: 1,
|
|
2086
2094
|
2: 2,
|
|
2087
2095
|
3: 3
|
|
2088
|
-
}[i$
|
|
2089
|
-
return u$
|
|
2096
|
+
}[i$1[a$2]] ?? -1, u$1 = a$2 in i$1 && p$1 || r$1(/^--color=?(true|always)?$/);
|
|
2097
|
+
return u$1 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, n$3, l$2) => (t$2 = r$2.TERM, {
|
|
2090
2098
|
"24bit": 3,
|
|
2091
2099
|
truecolor: 3,
|
|
2092
2100
|
ansi256: 2,
|
|
2093
2101
|
ansi: 1
|
|
2094
|
-
}[r$2.COLORTERM] || (r$2.CI ? /,GITHUB/.test(e) ? 3 : 1 : n$
|
|
2102
|
+
}[r$2.COLORTERM] || (r$2.CI ? /,GITHUB/.test(e$1) ? 3 : 1 : n$3 && "dumb" !== t$2 ? l$2 ? 3 : /-256/.test(t$2) ? 2 : 1 : 0)))(i$1, !!i$1.PM2_HOME || i$1.NEXT_RUNTIME?.includes("edge") || !!l$1.stdout?.isTTY, "win32" === l$1.platform)), !p$1 || i$1.NO_COLOR || r$1(/^--(no-color|color=(false|never))$/) ? 0 : n$2.window?.chrome || u$1 && !c$1 ? 3 : c$1;
|
|
2095
2103
|
})(), f = {
|
|
2096
|
-
open: i
|
|
2097
|
-
close: i
|
|
2098
|
-
}, h = 39, b = 49, O = {}, m = ({ p: e$
|
|
2099
|
-
let o$1 = (e$
|
|
2100
|
-
if (!e$
|
|
2101
|
-
if (t$
|
|
2102
|
-
if ((e$
|
|
2104
|
+
open: i,
|
|
2105
|
+
close: i
|
|
2106
|
+
}, h = 39, b = 49, O = {}, m = ({ p: e$2 }, { open: t$3, close: n$2 }) => {
|
|
2107
|
+
let o$1 = (e$3, ...r$1) => {
|
|
2108
|
+
if (!e$3) {
|
|
2109
|
+
if (t$3 && t$3 === n$2) return t$3;
|
|
2110
|
+
if ((e$3 ?? i) === i) return i;
|
|
2103
2111
|
}
|
|
2104
|
-
let l$1, s$2 = e$
|
|
2112
|
+
let l$1, 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;
|
|
2105
2113
|
if (s$2.includes("\x1B")) for (; c$2; c$2 = c$2.p) {
|
|
2106
|
-
let { open: e$
|
|
2107
|
-
if (r$2) for (; ~(l$1 = s$2.indexOf(t$
|
|
2108
|
-
s$2 = n$
|
|
2114
|
+
let { open: e$4, close: t$4 } = c$2, r$2 = t$4.length, n$3 = i, o$2 = 0;
|
|
2115
|
+
if (r$2) for (; ~(l$1 = s$2.indexOf(t$4, o$2)); o$2 = l$1 + r$2) n$3 += s$2.slice(o$2, l$1) + e$4;
|
|
2116
|
+
s$2 = n$3 + s$2.slice(o$2);
|
|
2109
2117
|
}
|
|
2110
2118
|
return a$2 + (s$2.includes("\n") ? s$2.replace(/(\r?\n)/g, p$1 + "$1" + a$2) : s$2) + p$1;
|
|
2111
|
-
}, s$1 = t$
|
|
2112
|
-
return e$
|
|
2113
|
-
open: t$
|
|
2114
|
-
close: n$
|
|
2119
|
+
}, s$1 = t$3, c$1 = n$2;
|
|
2120
|
+
return e$2 && (s$1 = e$2.o + t$3, c$1 = n$2 + e$2.c), l(o$1, r), o$1.p = {
|
|
2121
|
+
open: t$3,
|
|
2122
|
+
close: n$2,
|
|
2115
2123
|
o: s$1,
|
|
2116
2124
|
c: c$1,
|
|
2117
|
-
p: e$
|
|
2125
|
+
p: e$2
|
|
2118
2126
|
}, o$1.open = s$1, o$1.close = c$1, o$1;
|
|
2119
2127
|
};
|
|
2120
|
-
const w = function(e$
|
|
2121
|
-
let t$
|
|
2128
|
+
const w = function(e$2 = g) {
|
|
2129
|
+
let t$3 = {
|
|
2122
2130
|
Ansis: w,
|
|
2123
|
-
level: e$
|
|
2131
|
+
level: e$2,
|
|
2124
2132
|
isSupported: () => s$1,
|
|
2125
|
-
strip: (e$
|
|
2126
|
-
extend(e$
|
|
2127
|
-
for (let t$
|
|
2128
|
-
let r$1 = e$
|
|
2129
|
-
O[t$
|
|
2130
|
-
return (...e$
|
|
2133
|
+
strip: (e$3) => e$3.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
|
|
2134
|
+
extend(e$3) {
|
|
2135
|
+
for (let t$4 in e$3) {
|
|
2136
|
+
let r$1 = e$3[t$4], l$1 = (typeof r$1)[0], o$1 = "s" === l$1 ? x(...p(r$1)) : r$1;
|
|
2137
|
+
O[t$4] = "f" === l$1 ? { get() {
|
|
2138
|
+
return (...e$4) => m(this, r$1(...e$4));
|
|
2131
2139
|
} } : { get() {
|
|
2132
|
-
let e$
|
|
2133
|
-
return n(this, t$
|
|
2140
|
+
let e$4 = m(this, o$1);
|
|
2141
|
+
return n$1(this, t$4, { value: e$4 }), e$4;
|
|
2134
2142
|
} };
|
|
2135
2143
|
}
|
|
2136
|
-
return r = o({}, O), l(t$
|
|
2144
|
+
return r = o({}, O), l(t$3, r), t$3;
|
|
2137
2145
|
}
|
|
2138
|
-
}, s$1 = e$
|
|
2139
|
-
open: `[${e$
|
|
2140
|
-
close: `[${t$
|
|
2141
|
-
} : f, a$2 = (e$
|
|
2142
|
-
2 === e$
|
|
2146
|
+
}, s$1 = e$2 > 0, c$1 = (e$3, t$4) => s$1 ? {
|
|
2147
|
+
open: `[${e$3}m`,
|
|
2148
|
+
close: `[${t$4}m`
|
|
2149
|
+
} : f, a$2 = (e$3) => (t$4) => e$3(...p(t$4)), y$1 = (e$3, t$4) => (r$1, n$2, l$1) => c$1(`${e$3}8;2;${r$1};${n$2};${l$1}`, t$4), R = (e$3, t$4) => (r$1, n$2, l$1) => c$1(((e$4, t$5, r$2) => d(u(e$4, t$5, r$2)))(r$1, n$2, l$1) + e$3, t$4), $ = (e$3) => (t$4, r$1, n$2) => e$3(u(t$4, r$1, n$2)), x = y$1(3, h), T = y$1(4, b), v = (e$3) => c$1("38;5;" + e$3, h), C = (e$3) => c$1("48;5;" + e$3, b);
|
|
2150
|
+
2 === e$2 ? (x = $(v), T = $(C)) : 1 === e$2 && (x = R(0, h), T = R(10, b), v = (e$3) => c$1(d(e$3), h), C = (e$3) => c$1(d(e$3) + 10, b));
|
|
2143
2151
|
let E, M = {
|
|
2144
2152
|
fg: v,
|
|
2145
2153
|
bg: C,
|
|
@@ -2157,9 +2165,9 @@ var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis
|
|
|
2157
2165
|
hidden: c$1(8, 28),
|
|
2158
2166
|
strikethrough: c$1(9, 29)
|
|
2159
2167
|
}, I = "Bright";
|
|
2160
|
-
return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$
|
|
2161
|
-
E = "bg" + e$
|
|
2162
|
-
})), t$
|
|
2168
|
+
return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$3, t$4) => {
|
|
2169
|
+
E = "bg" + e$3[0].toUpperCase() + e$3.slice(1), 8 > t$4 ? (M[e$3 + I] = c$1(90 + t$4, h), M[E + I] = c$1(100 + t$4, b)) : t$4 = 60, M[e$3] = c$1(30 + t$4, h), M[E] = c$1(40 + t$4, b);
|
|
2170
|
+
})), t$3.extend(M);
|
|
2163
2171
|
}, y = new w();
|
|
2164
2172
|
module.exports = y, y.default = y;
|
|
2165
2173
|
}) });
|
|
@@ -2409,7 +2417,8 @@ const InputCliOverrideSchema = strictObject({
|
|
|
2409
2417
|
literal("react-jsx"),
|
|
2410
2418
|
literal("preserve")
|
|
2411
2419
|
])), description("Jsx options preset")),
|
|
2412
|
-
preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points"))
|
|
2420
|
+
preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points")),
|
|
2421
|
+
context: pipe(optional(string()), description("The entity top-level `this` represents."))
|
|
2413
2422
|
});
|
|
2414
2423
|
const InputCliOptionsSchema = omit(strictObject({
|
|
2415
2424
|
...InputOptionsSchema.entries,
|
|
@@ -2438,6 +2447,7 @@ const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([cust
|
|
|
2438
2447
|
const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
|
|
2439
2448
|
const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
|
|
2440
2449
|
const AdvancedChunksSchema = strictObject({
|
|
2450
|
+
includeDependenciesRecursively: optional(boolean()),
|
|
2441
2451
|
minSize: optional(number()),
|
|
2442
2452
|
maxSize: optional(number()),
|
|
2443
2453
|
minModuleSize: optional(number()),
|
|
@@ -2566,7 +2576,7 @@ function validateOption(key, options) {
|
|
|
2566
2576
|
const issuePaths = issue.path.map((path) => path.key);
|
|
2567
2577
|
let issueMsg = issue.message;
|
|
2568
2578
|
if (issue.type === "union") {
|
|
2569
|
-
const subIssue = issue.issues?.find((i$
|
|
2579
|
+
const subIssue = issue.issues?.find((i$1) => !(i$1.type !== issue.received && i$1.input === issue.input));
|
|
2570
2580
|
if (subIssue) {
|
|
2571
2581
|
if (subIssue.path) issuePaths.push(subIssue.path.map((path) => path.key));
|
|
2572
2582
|
issueMsg = subIssue.message;
|
|
@@ -2600,19 +2610,19 @@ function bindingifySourcemap$1(map) {
|
|
|
2600
2610
|
//#endregion
|
|
2601
2611
|
//#region src/utils/error.ts
|
|
2602
2612
|
function normalizeErrors(rawErrors) {
|
|
2603
|
-
const errors = rawErrors.map((e$
|
|
2604
|
-
kind: e$
|
|
2605
|
-
message: e$
|
|
2613
|
+
const errors = rawErrors.map((e$2) => e$2 instanceof Error ? e$2 : Object.assign(/* @__PURE__ */ new Error(), {
|
|
2614
|
+
kind: e$2.kind,
|
|
2615
|
+
message: e$2.message,
|
|
2606
2616
|
stack: void 0
|
|
2607
2617
|
}));
|
|
2608
2618
|
let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
2609
|
-
for (let i$
|
|
2619
|
+
for (let i$1 = 0; i$1 < errors.length; i$1++) {
|
|
2610
2620
|
summary += "\n";
|
|
2611
|
-
if (i$
|
|
2621
|
+
if (i$1 >= 5) {
|
|
2612
2622
|
summary += "...";
|
|
2613
2623
|
break;
|
|
2614
2624
|
}
|
|
2615
|
-
summary += getErrorMessage(errors[i$
|
|
2625
|
+
summary += getErrorMessage(errors[i$1]);
|
|
2616
2626
|
}
|
|
2617
2627
|
const wrapper = new Error(summary);
|
|
2618
2628
|
Object.defineProperty(wrapper, "errors", {
|
|
@@ -2627,20 +2637,20 @@ function normalizeErrors(rawErrors) {
|
|
|
2627
2637
|
});
|
|
2628
2638
|
return wrapper;
|
|
2629
2639
|
}
|
|
2630
|
-
function getErrorMessage(e$
|
|
2631
|
-
if (Object.hasOwn(e$
|
|
2640
|
+
function getErrorMessage(e$2) {
|
|
2641
|
+
if (Object.hasOwn(e$2, "kind")) return e$2.message;
|
|
2632
2642
|
let s$1 = "";
|
|
2633
|
-
if (e$
|
|
2634
|
-
const id$1 = e$
|
|
2643
|
+
if (e$2.plugin) s$1 += `[plugin ${e$2.plugin}]`;
|
|
2644
|
+
const id$1 = e$2.id ?? e$2.loc?.file;
|
|
2635
2645
|
if (id$1) {
|
|
2636
2646
|
s$1 += " " + id$1;
|
|
2637
|
-
if (e$
|
|
2647
|
+
if (e$2.loc) s$1 += `:${e$2.loc.line}:${e$2.loc.column}`;
|
|
2638
2648
|
}
|
|
2639
2649
|
if (s$1) s$1 += "\n";
|
|
2640
|
-
const message = `${e$
|
|
2650
|
+
const message = `${e$2.name ?? "Error"}: ${e$2.message}`;
|
|
2641
2651
|
s$1 += message;
|
|
2642
|
-
if (e$
|
|
2643
|
-
if (e$
|
|
2652
|
+
if (e$2.frame) s$1 = joinNewLine(s$1, e$2.frame);
|
|
2653
|
+
if (e$2.stack) s$1 = joinNewLine(s$1, e$2.stack.replace(message, ""));
|
|
2644
2654
|
return s$1;
|
|
2645
2655
|
}
|
|
2646
2656
|
function joinNewLine(s1, s2) {
|
|
@@ -2768,33 +2778,33 @@ function exclude(expr) {
|
|
|
2768
2778
|
}
|
|
2769
2779
|
|
|
2770
2780
|
//#endregion
|
|
2771
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2772
|
-
function
|
|
2773
|
-
let
|
|
2774
|
-
return
|
|
2775
|
-
lazy:
|
|
2776
|
-
lazyArgs:
|
|
2781
|
+
//#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
|
|
2782
|
+
function e(e$2, t$3, n$2) {
|
|
2783
|
+
let r$1 = (n$3) => e$2(n$3, ...t$3);
|
|
2784
|
+
return n$2 === void 0 ? r$1 : Object.assign(r$1, {
|
|
2785
|
+
lazy: n$2,
|
|
2786
|
+
lazyArgs: t$3
|
|
2777
2787
|
});
|
|
2778
2788
|
}
|
|
2779
2789
|
|
|
2780
2790
|
//#endregion
|
|
2781
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2782
|
-
function
|
|
2783
|
-
let
|
|
2784
|
-
if (
|
|
2785
|
-
if (
|
|
2786
|
-
throw
|
|
2791
|
+
//#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/purry-DH9cw9sy.js
|
|
2792
|
+
function t(t$3, n$2, r$1) {
|
|
2793
|
+
let i$1 = t$3.length - n$2.length;
|
|
2794
|
+
if (i$1 === 0) return t$3(...n$2);
|
|
2795
|
+
if (i$1 === 1) return e(t$3, n$2, r$1);
|
|
2796
|
+
throw Error(`Wrong number of arguments`);
|
|
2787
2797
|
}
|
|
2788
2798
|
|
|
2789
2799
|
//#endregion
|
|
2790
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2791
|
-
function
|
|
2792
|
-
return
|
|
2793
|
-
}
|
|
2794
|
-
|
|
2795
|
-
let
|
|
2796
|
-
for (let [
|
|
2797
|
-
return
|
|
2800
|
+
//#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/partition-BJYkp-a7.js
|
|
2801
|
+
function t$1(...t$3) {
|
|
2802
|
+
return t(n, t$3);
|
|
2803
|
+
}
|
|
2804
|
+
const n = (e$2, t$3) => {
|
|
2805
|
+
let n$2 = [[], []];
|
|
2806
|
+
for (let [r$1, i$1] of e$2.entries()) t$3(i$1, r$1, e$2) ? n$2[0].push(i$1) : n$2[1].push(i$1);
|
|
2807
|
+
return n$2;
|
|
2798
2808
|
};
|
|
2799
2809
|
|
|
2800
2810
|
//#endregion
|
|
@@ -2819,8 +2829,8 @@ function transformFilterMatcherToFilterExprs(filterOption) {
|
|
|
2819
2829
|
let idExcludes = [];
|
|
2820
2830
|
let codeIncludes = [];
|
|
2821
2831
|
let codeExcludes = [];
|
|
2822
|
-
if (id$1) [idIncludes, idExcludes] =
|
|
2823
|
-
if (code$1) [codeIncludes, codeExcludes] =
|
|
2832
|
+
if (id$1) [idIncludes, idExcludes] = t$1(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m$1) => m$1.kind === "include");
|
|
2833
|
+
if (code$1) [codeIncludes, codeExcludes] = t$1(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m$1) => m$1.kind === "include");
|
|
2824
2834
|
ret.push(...idExcludes);
|
|
2825
2835
|
ret.push(...codeExcludes);
|
|
2826
2836
|
let andExprList = [];
|
|
@@ -2848,7 +2858,7 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
2848
2858
|
switch (expr.kind) {
|
|
2849
2859
|
case "and": {
|
|
2850
2860
|
let args$1 = expr.args;
|
|
2851
|
-
for (let i$
|
|
2861
|
+
for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
|
|
2852
2862
|
list.push({
|
|
2853
2863
|
kind: "And",
|
|
2854
2864
|
payload: args$1.length
|
|
@@ -2857,7 +2867,7 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
2857
2867
|
}
|
|
2858
2868
|
case "or": {
|
|
2859
2869
|
let args$1 = expr.args;
|
|
2860
|
-
for (let i$
|
|
2870
|
+
for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
|
|
2861
2871
|
list.push({
|
|
2862
2872
|
kind: "Or",
|
|
2863
2873
|
payload: args$1.length
|
|
@@ -2947,7 +2957,7 @@ function bindingPluginOrder(order) {
|
|
|
2947
2957
|
}
|
|
2948
2958
|
|
|
2949
2959
|
//#endregion
|
|
2950
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2960
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.81.0/node_modules/oxc-parser/wrap.mjs
|
|
2951
2961
|
function wrap$1(result) {
|
|
2952
2962
|
let program, module$1, comments, errors;
|
|
2953
2963
|
return {
|
|
@@ -2992,13 +3002,13 @@ function wrap(result, sourceText) {
|
|
|
2992
3002
|
}
|
|
2993
3003
|
function normalizeParseError(sourceText, errors) {
|
|
2994
3004
|
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
2995
|
-
for (let i$
|
|
2996
|
-
if (i$
|
|
3005
|
+
for (let i$1 = 0; i$1 < errors.length; i$1++) {
|
|
3006
|
+
if (i$1 >= 5) {
|
|
2997
3007
|
message += "\n...";
|
|
2998
3008
|
break;
|
|
2999
3009
|
}
|
|
3000
|
-
const e$
|
|
3001
|
-
message += e$
|
|
3010
|
+
const e$2 = errors[i$1];
|
|
3011
|
+
message += e$2.message + "\n" + e$2.labels.map((label) => {
|
|
3002
3012
|
const location = locate(sourceText, label.start, { offsetLine: 1 });
|
|
3003
3013
|
if (!location) return;
|
|
3004
3014
|
return getCodeFrame(sourceText, location.line, location.column);
|
|
@@ -3083,10 +3093,10 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3083
3093
|
data.loadModulePromiseMap.set(id$1, promise$1);
|
|
3084
3094
|
try {
|
|
3085
3095
|
await context.load(id$1, options.moduleSideEffects ?? void 0);
|
|
3086
|
-
} catch (e$
|
|
3096
|
+
} catch (e$2) {
|
|
3087
3097
|
data.loadModulePromiseMap.delete(id$1);
|
|
3088
3098
|
data.loadModulePromiseResolveFnMap.delete(id$1);
|
|
3089
|
-
throw e$
|
|
3099
|
+
throw e$2;
|
|
3090
3100
|
}
|
|
3091
3101
|
return promise$1;
|
|
3092
3102
|
}
|
|
@@ -3173,12 +3183,12 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
3173
3183
|
this.warn = getLogHandler$1(this.warn);
|
|
3174
3184
|
this.info = getLogHandler$1(this.info);
|
|
3175
3185
|
}
|
|
3176
|
-
error(e$
|
|
3177
|
-
if (typeof e$
|
|
3178
|
-
if (pos) augmentCodeLocation(e$
|
|
3179
|
-
e$
|
|
3180
|
-
e$
|
|
3181
|
-
return error(logPluginError(normalizeLog(e$
|
|
3186
|
+
error(e$2, pos) {
|
|
3187
|
+
if (typeof e$2 === "string") e$2 = { message: e$2 };
|
|
3188
|
+
if (pos) augmentCodeLocation(e$2, pos, this.moduleSource, this.moduleId);
|
|
3189
|
+
e$2.id = this.moduleId;
|
|
3190
|
+
e$2.hook = "transform";
|
|
3191
|
+
return error(logPluginError(normalizeLog(e$2), this.pluginName));
|
|
3182
3192
|
}
|
|
3183
3193
|
getCombinedSourcemap() {
|
|
3184
3194
|
return JSON.parse(this.inner.getCombinedSourcemap());
|
|
@@ -3404,9 +3414,9 @@ function transformRenderedChunk(chunk) {
|
|
|
3404
3414
|
}
|
|
3405
3415
|
function transformChunkModules(modules) {
|
|
3406
3416
|
const result = {};
|
|
3407
|
-
for (let i$
|
|
3408
|
-
let key = modules.keys[i$
|
|
3409
|
-
const mod = modules.values[i$
|
|
3417
|
+
for (let i$1 = 0; i$1 < modules.values.length; i$1++) {
|
|
3418
|
+
let key = modules.keys[i$1];
|
|
3419
|
+
const mod = modules.values[i$1];
|
|
3410
3420
|
result[key] = transformToRenderedModule(mod);
|
|
3411
3421
|
}
|
|
3412
3422
|
return result;
|
|
@@ -3915,8 +3925,8 @@ function wrapHandlers(plugin) {
|
|
|
3915
3925
|
if (handler) plugin[hookName] = async (...args$1) => {
|
|
3916
3926
|
try {
|
|
3917
3927
|
return await handler(...args$1);
|
|
3918
|
-
} catch (e$
|
|
3919
|
-
return error(logPluginError(e$
|
|
3928
|
+
} catch (e$2) {
|
|
3929
|
+
return error(logPluginError(e$2, plugin.name, {
|
|
3920
3930
|
hook: hookName,
|
|
3921
3931
|
id: hookName === "transform" ? args$1[2] : void 0
|
|
3922
3932
|
}));
|
|
@@ -4345,7 +4355,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4345
4355
|
invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
|
|
4346
4356
|
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
4347
4357
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
4348
|
-
optimization: inputOptions.optimization
|
|
4358
|
+
optimization: inputOptions.optimization,
|
|
4359
|
+
context: inputOptions.context
|
|
4349
4360
|
};
|
|
4350
4361
|
}
|
|
4351
4362
|
function bindingifyHmr(hmr) {
|
|
@@ -4578,9 +4589,9 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isCl
|
|
|
4578
4589
|
onLog,
|
|
4579
4590
|
stopWorkers: parallelPluginInitResult?.stopWorkers
|
|
4580
4591
|
};
|
|
4581
|
-
} catch (e$
|
|
4592
|
+
} catch (e$2) {
|
|
4582
4593
|
await parallelPluginInitResult?.stopWorkers();
|
|
4583
|
-
throw e$
|
|
4594
|
+
throw e$2;
|
|
4584
4595
|
}
|
|
4585
4596
|
}
|
|
4586
4597
|
|
|
@@ -4599,9 +4610,9 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
|
|
|
4599
4610
|
asyncRuntimeShutdown = true;
|
|
4600
4611
|
}
|
|
4601
4612
|
};
|
|
4602
|
-
} catch (e$
|
|
4613
|
+
} catch (e$2) {
|
|
4603
4614
|
await option.stopWorkers?.();
|
|
4604
|
-
throw e$
|
|
4615
|
+
throw e$2;
|
|
4605
4616
|
}
|
|
4606
4617
|
}
|
|
4607
4618
|
|