@rolldown/browser 1.0.0-beta.46 → 1.0.0-beta.48
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.mjs +3 -4
- package/dist/cli.mjs +22 -10
- package/dist/config.d.mts +3 -2
- package/dist/config.mjs +6 -5
- package/dist/constructors-EhfoQfqh.js +68 -0
- package/dist/experimental-index.browser.mjs +38 -117
- package/dist/experimental-index.d.mts +18 -58
- package/dist/experimental-index.mjs +41 -120
- package/dist/filter-index.d.mts +3 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +5 -5
- package/dist/{shared/parse-ast-index-DMI5m8Lk.mjs → normalize-string-or-regex-d47jXr3r.js} +38 -110
- package/dist/parallel-plugin-worker.mjs +7 -6
- package/dist/parallel-plugin.d.mts +3 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/plugins-index.browser.mjs +39 -0
- package/dist/plugins-index.d.mts +31 -0
- package/dist/plugins-index.mjs +40 -0
- 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-CCMrV5an.d.mts → binding-B4uTNiw2.d.mts} +49 -58
- package/dist/shared/constructors-CaN9lKj2.d.mts +32 -0
- package/dist/shared/constructors-DcEzB0nc.mjs +68 -0
- package/dist/shared/{define-config-Bj-neIhz.d.mts → define-config-Dv3i4cxM.d.mts} +4 -62
- package/dist/shared/{load-config-DnUAKl9P.mjs → load-config-B-QIvCpC.mjs} +2 -2
- package/dist/shared/logs-CPsamAuj.mjs +181 -0
- package/dist/shared/normalize-string-or-regex-CbDij6KB.mjs +46 -0
- package/dist/shared/parse-ast-index-D9jH_38U.mjs +81 -0
- package/dist/shared/{prompt-YGfbLmz5.mjs → prompt-Ckjl2FdJ.mjs} +1 -1
- package/dist/shared/{src-B8saaB3b.mjs → src-CvsuRKGv.mjs} +247 -224
- package/dist/shared/utils-CduIqa7h.d.mts +18 -0
- package/dist/{src-B-7Hrt6w.js → src-DLQqj5Wo.js} +234 -994
- package/package.json +1 -1
- package/dist/shared/binding-BeWSOIj5.mjs +0 -578
- /package/dist/shared/{composable-filters-CgRsnfr3.mjs → composable-filters-CBpK2Fbc.mjs} +0 -0
|
@@ -1,812 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n$1 = keys.length, key; i < n$1; i++) {
|
|
13
|
-
key = keys[i];
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
-
get: ((k) => from[k]).bind(null, key),
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
value: mod,
|
|
23
|
-
enumerable: true
|
|
24
|
-
}) : target, mod));
|
|
25
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
26
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
27
|
-
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
|
|
28
|
-
});
|
|
1
|
+
import { a as augmentCodeLocation, c as logInputHookInOutputPlugin, d as logNoFileSystemInBrowser, f as logParseError, h as getCodeFrame, l as logInvalidLogPosition, m as locate, n as BuiltinPlugin, o as error, p as logPluginError, r as bindingifyBuiltInPlugin, s as logCycleLoading, t as normalizedStringOrRegex, u as logMultiplyNotifyOption } from "./normalize-string-or-regex-d47jXr3r.js";
|
|
2
|
+
import { BindingAttachDebugInfo, BindingBundler, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingMagicString as BindingMagicString$1, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
29
3
|
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/binding.cjs
|
|
32
|
-
var require_binding = /* @__PURE__ */ __commonJS({ "src/binding.cjs": ((exports, module) => {
|
|
33
|
-
const { readFileSync } = __require("node:fs");
|
|
34
|
-
let nativeBinding = null;
|
|
35
|
-
const loadErrors = [];
|
|
36
|
-
const isMusl = () => {
|
|
37
|
-
let musl = false;
|
|
38
|
-
if (process.platform === "linux") {
|
|
39
|
-
musl = isMuslFromFilesystem();
|
|
40
|
-
if (musl === null) musl = isMuslFromReport();
|
|
41
|
-
if (musl === null) musl = isMuslFromChildProcess();
|
|
42
|
-
}
|
|
43
|
-
return musl;
|
|
44
|
-
};
|
|
45
|
-
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
46
|
-
const isMuslFromFilesystem = () => {
|
|
47
|
-
try {
|
|
48
|
-
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
|
|
49
|
-
} catch {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const isMuslFromReport = () => {
|
|
54
|
-
let report = null;
|
|
55
|
-
if (typeof process.report?.getReport === "function") {
|
|
56
|
-
process.report.excludeNetwork = true;
|
|
57
|
-
report = process.report.getReport();
|
|
58
|
-
}
|
|
59
|
-
if (!report) return null;
|
|
60
|
-
if (report.header && report.header.glibcVersionRuntime) return false;
|
|
61
|
-
if (Array.isArray(report.sharedObjects)) {
|
|
62
|
-
if (report.sharedObjects.some(isFileMusl)) return true;
|
|
63
|
-
}
|
|
64
|
-
return false;
|
|
65
|
-
};
|
|
66
|
-
const isMuslFromChildProcess = () => {
|
|
67
|
-
try {
|
|
68
|
-
return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
|
|
69
|
-
} catch (e$1) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
function requireNative() {
|
|
74
|
-
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) try {
|
|
75
|
-
return __require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
76
|
-
} catch (err) {
|
|
77
|
-
loadErrors.push(err);
|
|
78
|
-
}
|
|
79
|
-
else if (process.platform === "android") if (process.arch === "arm64") {
|
|
80
|
-
try {
|
|
81
|
-
return __require("./rolldown-binding.android-arm64.node");
|
|
82
|
-
} catch (e$1) {
|
|
83
|
-
loadErrors.push(e$1);
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
const binding = __require("@rolldown/binding-android-arm64");
|
|
87
|
-
const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
|
|
88
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
89
|
-
return binding;
|
|
90
|
-
} catch (e$1) {
|
|
91
|
-
loadErrors.push(e$1);
|
|
92
|
-
}
|
|
93
|
-
} else if (process.arch === "arm") {
|
|
94
|
-
try {
|
|
95
|
-
return __require("./rolldown-binding.android-arm-eabi.node");
|
|
96
|
-
} catch (e$1) {
|
|
97
|
-
loadErrors.push(e$1);
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
const binding = __require("@rolldown/binding-android-arm-eabi");
|
|
101
|
-
const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
|
|
102
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
103
|
-
return binding;
|
|
104
|
-
} catch (e$1) {
|
|
105
|
-
loadErrors.push(e$1);
|
|
106
|
-
}
|
|
107
|
-
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
108
|
-
else if (process.platform === "win32") if (process.arch === "x64") if (process.config?.variables?.shlib_suffix === "dll.a" || process.config?.variables?.node_target_type === "shared_library") {
|
|
109
|
-
try {
|
|
110
|
-
return __require("./rolldown-binding.win32-x64-gnu.node");
|
|
111
|
-
} catch (e$1) {
|
|
112
|
-
loadErrors.push(e$1);
|
|
113
|
-
}
|
|
114
|
-
try {
|
|
115
|
-
const binding = __require("@rolldown/binding-win32-x64-gnu");
|
|
116
|
-
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
|
|
117
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
118
|
-
return binding;
|
|
119
|
-
} catch (e$1) {
|
|
120
|
-
loadErrors.push(e$1);
|
|
121
|
-
}
|
|
122
|
-
} else {
|
|
123
|
-
try {
|
|
124
|
-
return __require("./rolldown-binding.win32-x64-msvc.node");
|
|
125
|
-
} catch (e$1) {
|
|
126
|
-
loadErrors.push(e$1);
|
|
127
|
-
}
|
|
128
|
-
try {
|
|
129
|
-
const binding = __require("@rolldown/binding-win32-x64-msvc");
|
|
130
|
-
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
|
|
131
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
132
|
-
return binding;
|
|
133
|
-
} catch (e$1) {
|
|
134
|
-
loadErrors.push(e$1);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
else if (process.arch === "ia32") {
|
|
138
|
-
try {
|
|
139
|
-
return __require("./rolldown-binding.win32-ia32-msvc.node");
|
|
140
|
-
} catch (e$1) {
|
|
141
|
-
loadErrors.push(e$1);
|
|
142
|
-
}
|
|
143
|
-
try {
|
|
144
|
-
const binding = __require("@rolldown/binding-win32-ia32-msvc");
|
|
145
|
-
const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
|
|
146
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
147
|
-
return binding;
|
|
148
|
-
} catch (e$1) {
|
|
149
|
-
loadErrors.push(e$1);
|
|
150
|
-
}
|
|
151
|
-
} else if (process.arch === "arm64") {
|
|
152
|
-
try {
|
|
153
|
-
return __require("./rolldown-binding.win32-arm64-msvc.node");
|
|
154
|
-
} catch (e$1) {
|
|
155
|
-
loadErrors.push(e$1);
|
|
156
|
-
}
|
|
157
|
-
try {
|
|
158
|
-
const binding = __require("@rolldown/binding-win32-arm64-msvc");
|
|
159
|
-
const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
|
|
160
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
161
|
-
return binding;
|
|
162
|
-
} catch (e$1) {
|
|
163
|
-
loadErrors.push(e$1);
|
|
164
|
-
}
|
|
165
|
-
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
166
|
-
else if (process.platform === "darwin") {
|
|
167
|
-
try {
|
|
168
|
-
return __require("./rolldown-binding.darwin-universal.node");
|
|
169
|
-
} catch (e$1) {
|
|
170
|
-
loadErrors.push(e$1);
|
|
171
|
-
}
|
|
172
|
-
try {
|
|
173
|
-
const binding = __require("@rolldown/binding-darwin-universal");
|
|
174
|
-
const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
|
|
175
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
176
|
-
return binding;
|
|
177
|
-
} catch (e$1) {
|
|
178
|
-
loadErrors.push(e$1);
|
|
179
|
-
}
|
|
180
|
-
if (process.arch === "x64") {
|
|
181
|
-
try {
|
|
182
|
-
return __require("./rolldown-binding.darwin-x64.node");
|
|
183
|
-
} catch (e$1) {
|
|
184
|
-
loadErrors.push(e$1);
|
|
185
|
-
}
|
|
186
|
-
try {
|
|
187
|
-
const binding = __require("@rolldown/binding-darwin-x64");
|
|
188
|
-
const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
|
|
189
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
190
|
-
return binding;
|
|
191
|
-
} catch (e$1) {
|
|
192
|
-
loadErrors.push(e$1);
|
|
193
|
-
}
|
|
194
|
-
} else if (process.arch === "arm64") {
|
|
195
|
-
try {
|
|
196
|
-
return __require("./rolldown-binding.darwin-arm64.node");
|
|
197
|
-
} catch (e$1) {
|
|
198
|
-
loadErrors.push(e$1);
|
|
199
|
-
}
|
|
200
|
-
try {
|
|
201
|
-
const binding = __require("@rolldown/binding-darwin-arm64");
|
|
202
|
-
const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
|
|
203
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
204
|
-
return binding;
|
|
205
|
-
} catch (e$1) {
|
|
206
|
-
loadErrors.push(e$1);
|
|
207
|
-
}
|
|
208
|
-
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
209
|
-
} else if (process.platform === "freebsd") if (process.arch === "x64") {
|
|
210
|
-
try {
|
|
211
|
-
return __require("./rolldown-binding.freebsd-x64.node");
|
|
212
|
-
} catch (e$1) {
|
|
213
|
-
loadErrors.push(e$1);
|
|
214
|
-
}
|
|
215
|
-
try {
|
|
216
|
-
const binding = __require("@rolldown/binding-freebsd-x64");
|
|
217
|
-
const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
|
|
218
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
219
|
-
return binding;
|
|
220
|
-
} catch (e$1) {
|
|
221
|
-
loadErrors.push(e$1);
|
|
222
|
-
}
|
|
223
|
-
} else if (process.arch === "arm64") {
|
|
224
|
-
try {
|
|
225
|
-
return __require("./rolldown-binding.freebsd-arm64.node");
|
|
226
|
-
} catch (e$1) {
|
|
227
|
-
loadErrors.push(e$1);
|
|
228
|
-
}
|
|
229
|
-
try {
|
|
230
|
-
const binding = __require("@rolldown/binding-freebsd-arm64");
|
|
231
|
-
const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
|
|
232
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
233
|
-
return binding;
|
|
234
|
-
} catch (e$1) {
|
|
235
|
-
loadErrors.push(e$1);
|
|
236
|
-
}
|
|
237
|
-
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
238
|
-
else if (process.platform === "linux") if (process.arch === "x64") if (isMusl()) {
|
|
239
|
-
try {
|
|
240
|
-
return __require("./rolldown-binding.linux-x64-musl.node");
|
|
241
|
-
} catch (e$1) {
|
|
242
|
-
loadErrors.push(e$1);
|
|
243
|
-
}
|
|
244
|
-
try {
|
|
245
|
-
const binding = __require("@rolldown/binding-linux-x64-musl");
|
|
246
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
|
|
247
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
248
|
-
return binding;
|
|
249
|
-
} catch (e$1) {
|
|
250
|
-
loadErrors.push(e$1);
|
|
251
|
-
}
|
|
252
|
-
} else {
|
|
253
|
-
try {
|
|
254
|
-
return __require("./rolldown-binding.linux-x64-gnu.node");
|
|
255
|
-
} catch (e$1) {
|
|
256
|
-
loadErrors.push(e$1);
|
|
257
|
-
}
|
|
258
|
-
try {
|
|
259
|
-
const binding = __require("@rolldown/binding-linux-x64-gnu");
|
|
260
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
|
|
261
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
262
|
-
return binding;
|
|
263
|
-
} catch (e$1) {
|
|
264
|
-
loadErrors.push(e$1);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
else if (process.arch === "arm64") if (isMusl()) {
|
|
268
|
-
try {
|
|
269
|
-
return __require("./rolldown-binding.linux-arm64-musl.node");
|
|
270
|
-
} catch (e$1) {
|
|
271
|
-
loadErrors.push(e$1);
|
|
272
|
-
}
|
|
273
|
-
try {
|
|
274
|
-
const binding = __require("@rolldown/binding-linux-arm64-musl");
|
|
275
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
|
|
276
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
277
|
-
return binding;
|
|
278
|
-
} catch (e$1) {
|
|
279
|
-
loadErrors.push(e$1);
|
|
280
|
-
}
|
|
281
|
-
} else {
|
|
282
|
-
try {
|
|
283
|
-
return __require("./rolldown-binding.linux-arm64-gnu.node");
|
|
284
|
-
} catch (e$1) {
|
|
285
|
-
loadErrors.push(e$1);
|
|
286
|
-
}
|
|
287
|
-
try {
|
|
288
|
-
const binding = __require("@rolldown/binding-linux-arm64-gnu");
|
|
289
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
|
|
290
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
291
|
-
return binding;
|
|
292
|
-
} catch (e$1) {
|
|
293
|
-
loadErrors.push(e$1);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
else if (process.arch === "arm") if (isMusl()) {
|
|
297
|
-
try {
|
|
298
|
-
return __require("./rolldown-binding.linux-arm-musleabihf.node");
|
|
299
|
-
} catch (e$1) {
|
|
300
|
-
loadErrors.push(e$1);
|
|
301
|
-
}
|
|
302
|
-
try {
|
|
303
|
-
const binding = __require("@rolldown/binding-linux-arm-musleabihf");
|
|
304
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
|
|
305
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
306
|
-
return binding;
|
|
307
|
-
} catch (e$1) {
|
|
308
|
-
loadErrors.push(e$1);
|
|
309
|
-
}
|
|
310
|
-
} else {
|
|
311
|
-
try {
|
|
312
|
-
return __require("./rolldown-binding.linux-arm-gnueabihf.node");
|
|
313
|
-
} catch (e$1) {
|
|
314
|
-
loadErrors.push(e$1);
|
|
315
|
-
}
|
|
316
|
-
try {
|
|
317
|
-
const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
|
|
318
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
|
|
319
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
320
|
-
return binding;
|
|
321
|
-
} catch (e$1) {
|
|
322
|
-
loadErrors.push(e$1);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
else if (process.arch === "loong64") if (isMusl()) {
|
|
326
|
-
try {
|
|
327
|
-
return __require("./rolldown-binding.linux-loong64-musl.node");
|
|
328
|
-
} catch (e$1) {
|
|
329
|
-
loadErrors.push(e$1);
|
|
330
|
-
}
|
|
331
|
-
try {
|
|
332
|
-
const binding = __require("@rolldown/binding-linux-loong64-musl");
|
|
333
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
|
|
334
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
335
|
-
return binding;
|
|
336
|
-
} catch (e$1) {
|
|
337
|
-
loadErrors.push(e$1);
|
|
338
|
-
}
|
|
339
|
-
} else {
|
|
340
|
-
try {
|
|
341
|
-
return __require("./rolldown-binding.linux-loong64-gnu.node");
|
|
342
|
-
} catch (e$1) {
|
|
343
|
-
loadErrors.push(e$1);
|
|
344
|
-
}
|
|
345
|
-
try {
|
|
346
|
-
const binding = __require("@rolldown/binding-linux-loong64-gnu");
|
|
347
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
|
|
348
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
349
|
-
return binding;
|
|
350
|
-
} catch (e$1) {
|
|
351
|
-
loadErrors.push(e$1);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
else if (process.arch === "riscv64") if (isMusl()) {
|
|
355
|
-
try {
|
|
356
|
-
return __require("./rolldown-binding.linux-riscv64-musl.node");
|
|
357
|
-
} catch (e$1) {
|
|
358
|
-
loadErrors.push(e$1);
|
|
359
|
-
}
|
|
360
|
-
try {
|
|
361
|
-
const binding = __require("@rolldown/binding-linux-riscv64-musl");
|
|
362
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
|
|
363
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
364
|
-
return binding;
|
|
365
|
-
} catch (e$1) {
|
|
366
|
-
loadErrors.push(e$1);
|
|
367
|
-
}
|
|
368
|
-
} else {
|
|
369
|
-
try {
|
|
370
|
-
return __require("./rolldown-binding.linux-riscv64-gnu.node");
|
|
371
|
-
} catch (e$1) {
|
|
372
|
-
loadErrors.push(e$1);
|
|
373
|
-
}
|
|
374
|
-
try {
|
|
375
|
-
const binding = __require("@rolldown/binding-linux-riscv64-gnu");
|
|
376
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
|
|
377
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
378
|
-
return binding;
|
|
379
|
-
} catch (e$1) {
|
|
380
|
-
loadErrors.push(e$1);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
else if (process.arch === "ppc64") {
|
|
384
|
-
try {
|
|
385
|
-
return __require("./rolldown-binding.linux-ppc64-gnu.node");
|
|
386
|
-
} catch (e$1) {
|
|
387
|
-
loadErrors.push(e$1);
|
|
388
|
-
}
|
|
389
|
-
try {
|
|
390
|
-
const binding = __require("@rolldown/binding-linux-ppc64-gnu");
|
|
391
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
|
|
392
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
393
|
-
return binding;
|
|
394
|
-
} catch (e$1) {
|
|
395
|
-
loadErrors.push(e$1);
|
|
396
|
-
}
|
|
397
|
-
} else if (process.arch === "s390x") {
|
|
398
|
-
try {
|
|
399
|
-
return __require("./rolldown-binding.linux-s390x-gnu.node");
|
|
400
|
-
} catch (e$1) {
|
|
401
|
-
loadErrors.push(e$1);
|
|
402
|
-
}
|
|
403
|
-
try {
|
|
404
|
-
const binding = __require("@rolldown/binding-linux-s390x-gnu");
|
|
405
|
-
const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
|
|
406
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
407
|
-
return binding;
|
|
408
|
-
} catch (e$1) {
|
|
409
|
-
loadErrors.push(e$1);
|
|
410
|
-
}
|
|
411
|
-
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
412
|
-
else if (process.platform === "openharmony") if (process.arch === "arm64") {
|
|
413
|
-
try {
|
|
414
|
-
return __require("./rolldown-binding.openharmony-arm64.node");
|
|
415
|
-
} catch (e$1) {
|
|
416
|
-
loadErrors.push(e$1);
|
|
417
|
-
}
|
|
418
|
-
try {
|
|
419
|
-
const binding = __require("@rolldown/binding-openharmony-arm64");
|
|
420
|
-
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
|
|
421
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
422
|
-
return binding;
|
|
423
|
-
} catch (e$1) {
|
|
424
|
-
loadErrors.push(e$1);
|
|
425
|
-
}
|
|
426
|
-
} else if (process.arch === "x64") {
|
|
427
|
-
try {
|
|
428
|
-
return __require("./rolldown-binding.openharmony-x64.node");
|
|
429
|
-
} catch (e$1) {
|
|
430
|
-
loadErrors.push(e$1);
|
|
431
|
-
}
|
|
432
|
-
try {
|
|
433
|
-
const binding = __require("@rolldown/binding-openharmony-x64");
|
|
434
|
-
const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
|
|
435
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
436
|
-
return binding;
|
|
437
|
-
} catch (e$1) {
|
|
438
|
-
loadErrors.push(e$1);
|
|
439
|
-
}
|
|
440
|
-
} else if (process.arch === "arm") {
|
|
441
|
-
try {
|
|
442
|
-
return __require("./rolldown-binding.openharmony-arm.node");
|
|
443
|
-
} catch (e$1) {
|
|
444
|
-
loadErrors.push(e$1);
|
|
445
|
-
}
|
|
446
|
-
try {
|
|
447
|
-
const binding = __require("@rolldown/binding-openharmony-arm");
|
|
448
|
-
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
|
|
449
|
-
if (bindingPackageVersion !== "1.0.0-beta.46" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
450
|
-
return binding;
|
|
451
|
-
} catch (e$1) {
|
|
452
|
-
loadErrors.push(e$1);
|
|
453
|
-
}
|
|
454
|
-
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
455
|
-
else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
456
|
-
}
|
|
457
|
-
nativeBinding = requireNative();
|
|
458
|
-
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
459
|
-
let wasiBinding = null;
|
|
460
|
-
let wasiBindingError = null;
|
|
461
|
-
try {
|
|
462
|
-
wasiBinding = __require("./rolldown-binding.wasi.cjs");
|
|
463
|
-
nativeBinding = wasiBinding;
|
|
464
|
-
} catch (err) {
|
|
465
|
-
if (process.env.NAPI_RS_FORCE_WASI) wasiBindingError = err;
|
|
466
|
-
}
|
|
467
|
-
if (!nativeBinding) try {
|
|
468
|
-
wasiBinding = __require("@rolldown/binding-wasm32-wasi");
|
|
469
|
-
nativeBinding = wasiBinding;
|
|
470
|
-
} catch (err) {
|
|
471
|
-
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
472
|
-
wasiBindingError.cause = err;
|
|
473
|
-
loadErrors.push(err);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
|
|
477
|
-
const error$1 = /* @__PURE__ */ new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
|
478
|
-
error$1.cause = wasiBindingError;
|
|
479
|
-
throw error$1;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
if (!nativeBinding) {
|
|
483
|
-
if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors.reduce((err, cur) => {
|
|
484
|
-
cur.cause = err;
|
|
485
|
-
return cur;
|
|
486
|
-
}) });
|
|
487
|
-
throw new Error(`Failed to load native binding`);
|
|
488
|
-
}
|
|
489
|
-
module.exports = nativeBinding;
|
|
490
|
-
module.exports.minify = nativeBinding.minify;
|
|
491
|
-
module.exports.Severity = nativeBinding.Severity;
|
|
492
|
-
module.exports.ParseResult = nativeBinding.ParseResult;
|
|
493
|
-
module.exports.ExportExportNameKind = nativeBinding.ExportExportNameKind;
|
|
494
|
-
module.exports.ExportImportNameKind = nativeBinding.ExportImportNameKind;
|
|
495
|
-
module.exports.ExportLocalNameKind = nativeBinding.ExportLocalNameKind;
|
|
496
|
-
module.exports.ImportNameKind = nativeBinding.ImportNameKind;
|
|
497
|
-
module.exports.parseAsync = nativeBinding.parseAsync;
|
|
498
|
-
module.exports.parseSync = nativeBinding.parseSync;
|
|
499
|
-
module.exports.rawTransferSupported = nativeBinding.rawTransferSupported;
|
|
500
|
-
module.exports.ResolverFactory = nativeBinding.ResolverFactory;
|
|
501
|
-
module.exports.EnforceExtension = nativeBinding.EnforceExtension;
|
|
502
|
-
module.exports.ModuleType = nativeBinding.ModuleType;
|
|
503
|
-
module.exports.sync = nativeBinding.sync;
|
|
504
|
-
module.exports.HelperMode = nativeBinding.HelperMode;
|
|
505
|
-
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
|
|
506
|
-
module.exports.moduleRunnerTransform = nativeBinding.moduleRunnerTransform;
|
|
507
|
-
module.exports.transform = nativeBinding.transform;
|
|
508
|
-
module.exports.transformAsync = nativeBinding.transformAsync;
|
|
509
|
-
module.exports.BindingBundleEndEventData = nativeBinding.BindingBundleEndEventData;
|
|
510
|
-
module.exports.BindingBundleErrorEventData = nativeBinding.BindingBundleErrorEventData;
|
|
511
|
-
module.exports.BindingBundler = nativeBinding.BindingBundler;
|
|
512
|
-
module.exports.BindingBundlerImpl = nativeBinding.BindingBundlerImpl;
|
|
513
|
-
module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
|
|
514
|
-
module.exports.BindingChunkingContext = nativeBinding.BindingChunkingContext;
|
|
515
|
-
module.exports.BindingDevEngine = nativeBinding.BindingDevEngine;
|
|
516
|
-
module.exports.BindingMagicString = nativeBinding.BindingMagicString;
|
|
517
|
-
module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
|
|
518
|
-
module.exports.BindingNormalizedOptions = nativeBinding.BindingNormalizedOptions;
|
|
519
|
-
module.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset;
|
|
520
|
-
module.exports.BindingOutputChunk = nativeBinding.BindingOutputChunk;
|
|
521
|
-
module.exports.BindingPluginContext = nativeBinding.BindingPluginContext;
|
|
522
|
-
module.exports.BindingRenderedChunk = nativeBinding.BindingRenderedChunk;
|
|
523
|
-
module.exports.BindingRenderedChunkMeta = nativeBinding.BindingRenderedChunkMeta;
|
|
524
|
-
module.exports.BindingRenderedModule = nativeBinding.BindingRenderedModule;
|
|
525
|
-
module.exports.BindingTransformPluginContext = nativeBinding.BindingTransformPluginContext;
|
|
526
|
-
module.exports.BindingUrlResolver = nativeBinding.BindingUrlResolver;
|
|
527
|
-
module.exports.BindingWatcher = nativeBinding.BindingWatcher;
|
|
528
|
-
module.exports.BindingWatcherChangeData = nativeBinding.BindingWatcherChangeData;
|
|
529
|
-
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
|
|
530
|
-
module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
|
|
531
|
-
module.exports.ScheduledBuild = nativeBinding.ScheduledBuild;
|
|
532
|
-
module.exports.TraceSubscriberGuard = nativeBinding.TraceSubscriberGuard;
|
|
533
|
-
module.exports.BindingAttachDebugInfo = nativeBinding.BindingAttachDebugInfo;
|
|
534
|
-
module.exports.BindingBuiltinPluginName = nativeBinding.BindingBuiltinPluginName;
|
|
535
|
-
module.exports.BindingChunkModuleOrderBy = nativeBinding.BindingChunkModuleOrderBy;
|
|
536
|
-
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
|
|
537
|
-
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
|
|
538
|
-
module.exports.BindingPropertyReadSideEffects = nativeBinding.BindingPropertyReadSideEffects;
|
|
539
|
-
module.exports.BindingPropertyWriteSideEffects = nativeBinding.BindingPropertyWriteSideEffects;
|
|
540
|
-
module.exports.BindingRebuildStrategy = nativeBinding.BindingRebuildStrategy;
|
|
541
|
-
module.exports.createTokioRuntime = nativeBinding.createTokioRuntime;
|
|
542
|
-
module.exports.FilterTokenKind = nativeBinding.FilterTokenKind;
|
|
543
|
-
module.exports.initTraceSubscriber = nativeBinding.initTraceSubscriber;
|
|
544
|
-
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
545
|
-
module.exports.shutdownAsyncRuntime = nativeBinding.shutdownAsyncRuntime;
|
|
546
|
-
module.exports.startAsyncRuntime = nativeBinding.startAsyncRuntime;
|
|
547
|
-
}) });
|
|
548
|
-
|
|
549
|
-
//#endregion
|
|
550
|
-
//#region src/setup.ts
|
|
551
|
-
var import_binding$9 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
552
|
-
|
|
553
|
-
//#endregion
|
|
554
4
|
//#region package.json
|
|
555
|
-
var version = "1.0.0-beta.
|
|
556
|
-
|
|
557
|
-
//#endregion
|
|
558
|
-
//#region src/utils/code-frame.ts
|
|
559
|
-
function spaces(index) {
|
|
560
|
-
let result = "";
|
|
561
|
-
while (index--) result += " ";
|
|
562
|
-
return result;
|
|
563
|
-
}
|
|
564
|
-
function tabsToSpaces(value) {
|
|
565
|
-
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
566
|
-
}
|
|
567
|
-
const LINE_TRUNCATE_LENGTH = 120;
|
|
568
|
-
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
569
|
-
const ELLIPSIS = "...";
|
|
570
|
-
function getCodeFrame(source, line, column) {
|
|
571
|
-
let lines = source.split("\n");
|
|
572
|
-
if (line > lines.length) return "";
|
|
573
|
-
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
|
|
574
|
-
const frameStart = Math.max(0, line - 3);
|
|
575
|
-
let frameEnd = Math.min(line + 2, lines.length);
|
|
576
|
-
lines = lines.slice(frameStart, frameEnd);
|
|
577
|
-
while (!/\S/.test(lines[lines.length - 1])) {
|
|
578
|
-
lines.pop();
|
|
579
|
-
frameEnd -= 1;
|
|
580
|
-
}
|
|
581
|
-
const digits = String(frameEnd).length;
|
|
582
|
-
return lines.map((sourceLine, index) => {
|
|
583
|
-
const isErrorLine = frameStart + index + 1 === line;
|
|
584
|
-
let lineNumber = String(index + frameStart + 1);
|
|
585
|
-
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
|
|
586
|
-
let displayedLine = tabsToSpaces(sourceLine);
|
|
587
|
-
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
|
|
588
|
-
if (isErrorLine) {
|
|
589
|
-
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
|
|
590
|
-
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
|
591
|
-
}
|
|
592
|
-
return `${lineNumber}: ${displayedLine}`;
|
|
593
|
-
}).join("\n");
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
//#endregion
|
|
597
|
-
//#region src/utils/style-text.ts
|
|
598
|
-
function styleText(...args$1) {
|
|
599
|
-
return args$1[1];
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
//#endregion
|
|
603
|
-
//#region src/log/locate-character/index.js
|
|
604
|
-
/** @typedef {import('./types').Location} Location */
|
|
605
|
-
/**
|
|
606
|
-
* @param {import('./types').Range} range
|
|
607
|
-
* @param {number} index
|
|
608
|
-
*/
|
|
609
|
-
function rangeContains(range, index) {
|
|
610
|
-
return range.start <= index && index < range.end;
|
|
611
|
-
}
|
|
612
|
-
/**
|
|
613
|
-
* @param {string} source
|
|
614
|
-
* @param {import('./types').Options} [options]
|
|
615
|
-
*/
|
|
616
|
-
function getLocator(source, options = {}) {
|
|
617
|
-
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
618
|
-
let start = 0;
|
|
619
|
-
const ranges = source.split("\n").map((line, i$1) => {
|
|
620
|
-
const end = start + line.length + 1;
|
|
621
|
-
/** @type {import('./types').Range} */
|
|
622
|
-
const range = {
|
|
623
|
-
start,
|
|
624
|
-
end,
|
|
625
|
-
line: i$1
|
|
626
|
-
};
|
|
627
|
-
start = end;
|
|
628
|
-
return range;
|
|
629
|
-
});
|
|
630
|
-
let i = 0;
|
|
631
|
-
/**
|
|
632
|
-
* @param {string | number} search
|
|
633
|
-
* @param {number} [index]
|
|
634
|
-
* @returns {Location | undefined}
|
|
635
|
-
*/
|
|
636
|
-
function locator(search, index) {
|
|
637
|
-
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
638
|
-
if (search === -1) return void 0;
|
|
639
|
-
let range = ranges[i];
|
|
640
|
-
const d = search >= range.end ? 1 : -1;
|
|
641
|
-
while (range) {
|
|
642
|
-
if (rangeContains(range, search)) return {
|
|
643
|
-
line: offsetLine + range.line,
|
|
644
|
-
column: offsetColumn + search - range.start,
|
|
645
|
-
character: search
|
|
646
|
-
};
|
|
647
|
-
i += d;
|
|
648
|
-
range = ranges[i];
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
return locator;
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
* @param {string} source
|
|
655
|
-
* @param {string | number} search
|
|
656
|
-
* @param {import('./types').Options} [options]
|
|
657
|
-
* @returns {Location | undefined}
|
|
658
|
-
*/
|
|
659
|
-
function locate(source, search, options) {
|
|
660
|
-
return getLocator(source, options)(search, options && options.startIndex);
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
//#endregion
|
|
664
|
-
//#region src/log/logs.ts
|
|
665
|
-
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";
|
|
666
|
-
function logParseError(message) {
|
|
667
|
-
return {
|
|
668
|
-
code: PARSE_ERROR,
|
|
669
|
-
message
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
function logInvalidLogPosition(pluginName) {
|
|
673
|
-
return {
|
|
674
|
-
code: INVALID_LOG_POSITION,
|
|
675
|
-
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.`
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
function logInputHookInOutputPlugin(pluginName, hookName) {
|
|
679
|
-
return {
|
|
680
|
-
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
|
681
|
-
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.`
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
function logCycleLoading(pluginName, moduleId) {
|
|
685
|
-
return {
|
|
686
|
-
code: CYCLE_LOADING,
|
|
687
|
-
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
function logMultiplyNotifyOption() {
|
|
691
|
-
return {
|
|
692
|
-
code: MULTIPLY_NOTIFY_OPTION,
|
|
693
|
-
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
694
|
-
};
|
|
695
|
-
}
|
|
696
|
-
function logNoFileSystemInBrowser(method) {
|
|
697
|
-
return {
|
|
698
|
-
code: NO_FS_IN_BROWSER,
|
|
699
|
-
message: `Cannot access the file system (via "${method}") when using the browser build of Rolldown.`
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
function logDeprecatedDefine() {
|
|
703
|
-
return {
|
|
704
|
-
code: DEPRECATED_DEFINE,
|
|
705
|
-
message: `${styleText(["yellow", "bold"], "⚠ Deprecation Warning:")} The top-level "define" option is deprecated. Use "transform.define" instead.`
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
|
-
function logDeprecatedInject() {
|
|
709
|
-
return {
|
|
710
|
-
code: DEPRECATED_INJECT,
|
|
711
|
-
message: `${styleText(["yellow", "bold"], "⚠ Deprecation Warning:")} The top-level "inject" option is deprecated. Use "transform.inject" instead.`
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
function logDeprecatedProfilerNames() {
|
|
715
|
-
return {
|
|
716
|
-
code: DEPRECATED_PROFILER_NAMES,
|
|
717
|
-
message: "The top-level \"profilerNames\" option is deprecated. Use \"output.generatedCode.profilerNames\" instead."
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
function logDeprecatedKeepNames() {
|
|
721
|
-
return {
|
|
722
|
-
code: DEPRECATED_KEEP_NAMES,
|
|
723
|
-
message: "The top-level \"keepNames\" option is deprecated. Use \"output.keepNames\" instead."
|
|
724
|
-
};
|
|
725
|
-
}
|
|
726
|
-
function logDeprecatedDropLabels() {
|
|
727
|
-
return {
|
|
728
|
-
code: DEPRECATED_DROP_LABELS,
|
|
729
|
-
message: `${styleText(["yellow", "bold"], "⚠ Deprecation Warning:")} The top-level "dropLabels" option is deprecated. Use "transform.dropLabels" instead.`
|
|
730
|
-
};
|
|
731
|
-
}
|
|
732
|
-
function logPluginError(error$1, plugin, { hook, id: id$1 } = {}) {
|
|
733
|
-
try {
|
|
734
|
-
const code$1 = error$1.code;
|
|
735
|
-
if (!error$1.pluginCode && code$1 != null && (typeof code$1 !== "string" || !code$1.startsWith("PLUGIN_"))) error$1.pluginCode = code$1;
|
|
736
|
-
error$1.code = PLUGIN_ERROR;
|
|
737
|
-
error$1.plugin = plugin;
|
|
738
|
-
if (hook) error$1.hook = hook;
|
|
739
|
-
if (id$1) error$1.id = id$1;
|
|
740
|
-
} catch (_) {} finally {
|
|
741
|
-
return error$1;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
function error(base) {
|
|
745
|
-
if (!(base instanceof Error)) {
|
|
746
|
-
base = Object.assign(new Error(base.message), base);
|
|
747
|
-
Object.defineProperty(base, "name", {
|
|
748
|
-
value: "RollupError",
|
|
749
|
-
writable: true
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
throw base;
|
|
753
|
-
}
|
|
754
|
-
function augmentCodeLocation(properties, pos, source, id$1) {
|
|
755
|
-
if (typeof pos === "object") {
|
|
756
|
-
const { line, column } = pos;
|
|
757
|
-
properties.loc = {
|
|
758
|
-
column,
|
|
759
|
-
file: id$1,
|
|
760
|
-
line
|
|
761
|
-
};
|
|
762
|
-
} else {
|
|
763
|
-
properties.pos = pos;
|
|
764
|
-
const location = locate(source, pos, { offsetLine: 1 });
|
|
765
|
-
if (!location) return;
|
|
766
|
-
const { line, column } = location;
|
|
767
|
-
properties.loc = {
|
|
768
|
-
column,
|
|
769
|
-
file: id$1,
|
|
770
|
-
line
|
|
771
|
-
};
|
|
772
|
-
}
|
|
773
|
-
if (properties.frame === void 0) {
|
|
774
|
-
const { line, column } = properties.loc;
|
|
775
|
-
properties.frame = getCodeFrame(source, line, column);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
//#endregion
|
|
780
|
-
//#region src/builtin-plugin/utils.ts
|
|
781
|
-
var import_binding$8 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
782
|
-
var BuiltinPlugin = class {
|
|
783
|
-
constructor(name, _options) {
|
|
784
|
-
this.name = name;
|
|
785
|
-
this._options = _options;
|
|
786
|
-
}
|
|
787
|
-
};
|
|
788
|
-
function makeBuiltinPluginCallable(plugin) {
|
|
789
|
-
let callablePlugin = new import_binding$8.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
790
|
-
const wrappedPlugin = plugin;
|
|
791
|
-
for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
|
|
792
|
-
try {
|
|
793
|
-
return await callablePlugin[key](...args$1);
|
|
794
|
-
} catch (e$1) {
|
|
795
|
-
if (e$1 instanceof Error && !e$1.stack?.includes("at ")) Error.captureStackTrace(e$1, wrappedPlugin[key]);
|
|
796
|
-
return error(logPluginError(e$1, plugin.name, {
|
|
797
|
-
hook: key,
|
|
798
|
-
id: key === "transform" ? args$1[2] : void 0
|
|
799
|
-
}));
|
|
800
|
-
}
|
|
801
|
-
};
|
|
802
|
-
return wrappedPlugin;
|
|
803
|
-
}
|
|
804
|
-
function bindingifyBuiltInPlugin(plugin) {
|
|
805
|
-
return {
|
|
806
|
-
__name: plugin.name,
|
|
807
|
-
options: plugin._options
|
|
808
|
-
};
|
|
809
|
-
}
|
|
5
|
+
var version = "1.0.0-beta.48";
|
|
810
6
|
|
|
811
7
|
//#endregion
|
|
812
8
|
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
@@ -2583,6 +1779,12 @@ function safeParse(schema, input, config2) {
|
|
|
2583
1779
|
};
|
|
2584
1780
|
}
|
|
2585
1781
|
|
|
1782
|
+
//#endregion
|
|
1783
|
+
//#region src/utils/style-text.ts
|
|
1784
|
+
function styleText(...args$1) {
|
|
1785
|
+
return args$1[1];
|
|
1786
|
+
}
|
|
1787
|
+
|
|
2586
1788
|
//#endregion
|
|
2587
1789
|
//#region src/utils/validator.ts
|
|
2588
1790
|
const StringOrRegExpSchema = union([string(), instance(RegExp)]);
|
|
@@ -2679,8 +1881,8 @@ const TransformOptionsSchema = object({
|
|
|
2679
1881
|
JsxOptionsSchema
|
|
2680
1882
|
])),
|
|
2681
1883
|
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
|
|
2682
|
-
define: optional(record(string(), string())),
|
|
2683
|
-
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
1884
|
+
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
1885
|
+
inject: pipe(optional(record(string(), union([string(), tuple([string(), string()])]))), description("Inject import statements on demand")),
|
|
2684
1886
|
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names"))
|
|
2685
1887
|
});
|
|
2686
1888
|
const WatchOptionsSchema = strictObject({
|
|
@@ -2834,14 +2036,9 @@ const InputOptionsSchema = strictObject({
|
|
|
2834
2036
|
})])),
|
|
2835
2037
|
nativeMagicString: optional(boolean())
|
|
2836
2038
|
})),
|
|
2837
|
-
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
2838
|
-
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
2839
|
-
profilerNames: optional(boolean()),
|
|
2840
2039
|
transform: optional(TransformOptionsSchema),
|
|
2841
2040
|
watch: optional(union([WatchOptionsSchema, literal(false)])),
|
|
2842
|
-
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
|
|
2843
2041
|
checks: optional(ChecksOptionsSchema),
|
|
2844
|
-
keepNames: pipe(optional(boolean()), description("Keep function/class name")),
|
|
2845
2042
|
debug: pipe(optional(object({ sessionId: pipe(optional(string()), description("Used to name the build.")) })), description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly.")),
|
|
2846
2043
|
preserveEntrySignatures: pipe(optional(union([
|
|
2847
2044
|
literal("strict"),
|
|
@@ -2854,7 +2051,6 @@ const InputOptionsSchema = strictObject({
|
|
|
2854
2051
|
const InputCliOverrideSchema = strictObject({
|
|
2855
2052
|
input: pipe(optional(array(string())), description("Entry file")),
|
|
2856
2053
|
external: pipe(optional(array(string())), description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
|
|
2857
|
-
inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
|
|
2858
2054
|
treeshake: pipe(optional(boolean()), description("enable treeshaking")),
|
|
2859
2055
|
makeAbsoluteExternalsRelative: pipe(optional(boolean()), description("Prevent normalization of external imports")),
|
|
2860
2056
|
preserveEntrySignatures: pipe(optional(literal(false)), description("Avoid facade chunks for entry points")),
|
|
@@ -2869,7 +2065,6 @@ const InputCliOptionsSchema = omit(strictObject({
|
|
|
2869
2065
|
"onLog",
|
|
2870
2066
|
"resolve",
|
|
2871
2067
|
"experimental",
|
|
2872
|
-
"profilerNames",
|
|
2873
2068
|
"watch"
|
|
2874
2069
|
]);
|
|
2875
2070
|
const ModuleFormatSchema = union([
|
|
@@ -3056,33 +2251,72 @@ function validateOption(key, options) {
|
|
|
3056
2251
|
}
|
|
3057
2252
|
|
|
3058
2253
|
//#endregion
|
|
3059
|
-
//#region src/
|
|
2254
|
+
//#region src/types/plain-object-like.ts
|
|
3060
2255
|
const LAZY_FIELDS_KEY = Symbol("__lazy_fields__");
|
|
3061
|
-
const LAZY_CACHE_PREFIX = "__cached_";
|
|
3062
2256
|
/**
|
|
3063
|
-
*
|
|
3064
|
-
*
|
|
2257
|
+
* Base class for classes that use `@lazyProp` decorated properties.
|
|
2258
|
+
*
|
|
2259
|
+
* **Design Pattern in Rolldown:**
|
|
2260
|
+
* This is a common pattern in Rolldown due to its three-layer architecture:
|
|
2261
|
+
* TypeScript API → NAPI Bindings → Rust Core
|
|
2262
|
+
*
|
|
2263
|
+
* **Why we use getters:**
|
|
2264
|
+
* For performance - to lazily fetch data from Rust bindings only when needed,
|
|
2265
|
+
* rather than eagerly fetching all data during object construction.
|
|
2266
|
+
*
|
|
2267
|
+
* **The problem:**
|
|
2268
|
+
* Getters defined on class prototypes are non-enumerable by default, which breaks:
|
|
2269
|
+
* - Object spread operators ({...obj})
|
|
2270
|
+
* - Object.keys() and similar methods
|
|
2271
|
+
* - Standard JavaScript object semantics
|
|
2272
|
+
*
|
|
2273
|
+
* **The solution:**
|
|
2274
|
+
* This base class automatically converts `@lazyProp` decorated getters into
|
|
2275
|
+
* own enumerable getters on each instance during construction.
|
|
2276
|
+
*
|
|
2277
|
+
* **Result:**
|
|
2278
|
+
* Objects get both lazy-loading performance benefits AND plain JavaScript object behavior.
|
|
3065
2279
|
*
|
|
3066
2280
|
* @example
|
|
3067
2281
|
* ```typescript
|
|
3068
|
-
* class MyClass {
|
|
3069
|
-
* @
|
|
3070
|
-
* get
|
|
3071
|
-
* return
|
|
2282
|
+
* class MyClass extends PlainObjectLike {
|
|
2283
|
+
* @lazyProp
|
|
2284
|
+
* get myProp() {
|
|
2285
|
+
* return fetchFromRustBinding();
|
|
3072
2286
|
* }
|
|
3073
2287
|
* }
|
|
3074
2288
|
* ```
|
|
3075
2289
|
*/
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
2290
|
+
var PlainObjectLike = class {
|
|
2291
|
+
constructor() {
|
|
2292
|
+
setupLazyProperties(this);
|
|
2293
|
+
}
|
|
2294
|
+
};
|
|
2295
|
+
/**
|
|
2296
|
+
* Set up lazy properties as own getters on an instance.
|
|
2297
|
+
* This is called automatically by the `PlainObjectLike` base class constructor.
|
|
2298
|
+
*
|
|
2299
|
+
* @param instance - The instance to set up lazy properties on
|
|
2300
|
+
* @internal
|
|
2301
|
+
*/
|
|
2302
|
+
function setupLazyProperties(instance$1) {
|
|
2303
|
+
const lazyFields = instance$1.constructor[LAZY_FIELDS_KEY];
|
|
2304
|
+
if (!lazyFields) return;
|
|
2305
|
+
for (const [propertyKey, originalGetter] of lazyFields.entries()) {
|
|
2306
|
+
let cachedValue;
|
|
2307
|
+
let hasValue = false;
|
|
2308
|
+
Object.defineProperty(instance$1, propertyKey, {
|
|
2309
|
+
get() {
|
|
2310
|
+
if (!hasValue) {
|
|
2311
|
+
cachedValue = originalGetter.call(this);
|
|
2312
|
+
hasValue = true;
|
|
2313
|
+
}
|
|
2314
|
+
return cachedValue;
|
|
2315
|
+
},
|
|
2316
|
+
enumerable: true,
|
|
2317
|
+
configurable: true
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
3086
2320
|
}
|
|
3087
2321
|
/**
|
|
3088
2322
|
* Get all lazy field names from a class instance.
|
|
@@ -3091,28 +2325,46 @@ function lazy(target, propertyKey, descriptor) {
|
|
|
3091
2325
|
* @returns Set of lazy property names
|
|
3092
2326
|
*/
|
|
3093
2327
|
function getLazyFields(instance$1) {
|
|
3094
|
-
|
|
2328
|
+
const lazyFields = instance$1.constructor[LAZY_FIELDS_KEY];
|
|
2329
|
+
return lazyFields ? new Set(lazyFields.keys()) : /* @__PURE__ */ new Set();
|
|
3095
2330
|
}
|
|
3096
2331
|
|
|
3097
2332
|
//#endregion
|
|
3098
|
-
//#region src/decorators/
|
|
2333
|
+
//#region src/decorators/lazy.ts
|
|
3099
2334
|
/**
|
|
3100
|
-
* Decorator that
|
|
3101
|
-
*
|
|
2335
|
+
* Decorator that marks a getter as lazy-evaluated and cached.
|
|
2336
|
+
*
|
|
2337
|
+
* **What "lazy" means here:**
|
|
2338
|
+
* 1. Data is lazily fetched from Rust bindings only when the property is accessed (not eagerly on construction)
|
|
2339
|
+
* 2. Once fetched, the data is cached for subsequent accesses (performance optimization)
|
|
2340
|
+
* 3. Despite being a getter, it behaves like a plain object property (enumerable, appears in Object.keys())
|
|
2341
|
+
*
|
|
2342
|
+
* **Important**: Properties decorated with `@lazyProp` are defined as own enumerable
|
|
2343
|
+
* properties on each instance (not on the prototype). This ensures they:
|
|
2344
|
+
* - Appear in Object.keys() and Object.getOwnPropertyNames()
|
|
2345
|
+
* - Are included in object spreads ({...obj})
|
|
2346
|
+
* - Are enumerable in for...in loops
|
|
2347
|
+
*
|
|
2348
|
+
* Classes using this decorator must extend `PlainObjectLike` base class.
|
|
3102
2349
|
*
|
|
3103
2350
|
* @example
|
|
3104
2351
|
* ```typescript
|
|
3105
|
-
* class MyClass {
|
|
3106
|
-
* @
|
|
3107
|
-
*
|
|
3108
|
-
* return
|
|
2352
|
+
* class MyClass extends PlainObjectLike {
|
|
2353
|
+
* @lazyProp
|
|
2354
|
+
* get expensiveValue() {
|
|
2355
|
+
* return someExpensiveComputation();
|
|
3109
2356
|
* }
|
|
3110
2357
|
* }
|
|
3111
2358
|
* ```
|
|
3112
2359
|
*/
|
|
3113
|
-
function
|
|
3114
|
-
|
|
3115
|
-
|
|
2360
|
+
function lazyProp(target, propertyKey, descriptor) {
|
|
2361
|
+
if (!target.constructor[LAZY_FIELDS_KEY]) target.constructor[LAZY_FIELDS_KEY] = /* @__PURE__ */ new Map();
|
|
2362
|
+
const originalGetter = descriptor.get;
|
|
2363
|
+
target.constructor[LAZY_FIELDS_KEY].set(propertyKey, originalGetter);
|
|
2364
|
+
return {
|
|
2365
|
+
enumerable: false,
|
|
2366
|
+
configurable: true
|
|
2367
|
+
};
|
|
3116
2368
|
}
|
|
3117
2369
|
|
|
3118
2370
|
//#endregion
|
|
@@ -3135,9 +2387,10 @@ function __decorate(decorators, target, key, desc) {
|
|
|
3135
2387
|
|
|
3136
2388
|
//#endregion
|
|
3137
2389
|
//#region src/types/output-asset-impl.ts
|
|
3138
|
-
var OutputAssetImpl = class {
|
|
2390
|
+
var OutputAssetImpl = class extends PlainObjectLike {
|
|
3139
2391
|
type = "asset";
|
|
3140
2392
|
constructor(bindingAsset) {
|
|
2393
|
+
super();
|
|
3141
2394
|
this.bindingAsset = bindingAsset;
|
|
3142
2395
|
}
|
|
3143
2396
|
get fileName() {
|
|
@@ -3166,13 +2419,12 @@ var OutputAssetImpl = class {
|
|
|
3166
2419
|
for (const field of getLazyFields(this)) this[field];
|
|
3167
2420
|
}
|
|
3168
2421
|
};
|
|
3169
|
-
__decorate([
|
|
3170
|
-
__decorate([
|
|
3171
|
-
__decorate([
|
|
3172
|
-
__decorate([
|
|
3173
|
-
__decorate([
|
|
3174
|
-
__decorate([
|
|
3175
|
-
__decorate([nonEnumerable], OutputAssetImpl.prototype, "__rolldown_external_memory_handle__", null);
|
|
2422
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "fileName", null);
|
|
2423
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "originalFileName", null);
|
|
2424
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "originalFileNames", null);
|
|
2425
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "name", null);
|
|
2426
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "names", null);
|
|
2427
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "source", null);
|
|
3176
2428
|
|
|
3177
2429
|
//#endregion
|
|
3178
2430
|
//#region src/utils/transform-rendered-module.ts
|
|
@@ -3241,9 +2493,10 @@ function transformChunkModules(modules) {
|
|
|
3241
2493
|
|
|
3242
2494
|
//#endregion
|
|
3243
2495
|
//#region src/types/output-chunk-impl.ts
|
|
3244
|
-
var OutputChunkImpl = class {
|
|
2496
|
+
var OutputChunkImpl = class extends PlainObjectLike {
|
|
3245
2497
|
type = "chunk";
|
|
3246
2498
|
constructor(bindingChunk) {
|
|
2499
|
+
super();
|
|
3247
2500
|
this.bindingChunk = bindingChunk;
|
|
3248
2501
|
}
|
|
3249
2502
|
get fileName() {
|
|
@@ -3297,21 +2550,20 @@ var OutputChunkImpl = class {
|
|
|
3297
2550
|
for (const field of getLazyFields(this)) this[field];
|
|
3298
2551
|
}
|
|
3299
2552
|
};
|
|
3300
|
-
__decorate([
|
|
3301
|
-
__decorate([
|
|
3302
|
-
__decorate([
|
|
3303
|
-
__decorate([
|
|
3304
|
-
__decorate([
|
|
3305
|
-
__decorate([
|
|
3306
|
-
__decorate([
|
|
3307
|
-
__decorate([
|
|
3308
|
-
__decorate([
|
|
3309
|
-
__decorate([
|
|
3310
|
-
__decorate([
|
|
3311
|
-
__decorate([
|
|
3312
|
-
__decorate([
|
|
3313
|
-
__decorate([
|
|
3314
|
-
__decorate([nonEnumerable], OutputChunkImpl.prototype, "__rolldown_external_memory_handle__", null);
|
|
2553
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "fileName", null);
|
|
2554
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "name", null);
|
|
2555
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "exports", null);
|
|
2556
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "isEntry", null);
|
|
2557
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "facadeModuleId", null);
|
|
2558
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "isDynamicEntry", null);
|
|
2559
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "sourcemapFileName", null);
|
|
2560
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "preliminaryFileName", null);
|
|
2561
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "code", null);
|
|
2562
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "modules", null);
|
|
2563
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "imports", null);
|
|
2564
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "dynamicImports", null);
|
|
2565
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "moduleIds", null);
|
|
2566
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "map", null);
|
|
3315
2567
|
|
|
3316
2568
|
//#endregion
|
|
3317
2569
|
//#region src/types/sourcemap.ts
|
|
@@ -3491,8 +2743,9 @@ function collectChangedBundle(changed, bundle) {
|
|
|
3491
2743
|
|
|
3492
2744
|
//#endregion
|
|
3493
2745
|
//#region src/types/rolldown-output-impl.ts
|
|
3494
|
-
var RolldownOutputImpl = class {
|
|
2746
|
+
var RolldownOutputImpl = class extends PlainObjectLike {
|
|
3495
2747
|
constructor(bindingOutputs) {
|
|
2748
|
+
super();
|
|
3496
2749
|
this.bindingOutputs = bindingOutputs;
|
|
3497
2750
|
}
|
|
3498
2751
|
get output() {
|
|
@@ -3510,21 +2763,20 @@ var RolldownOutputImpl = class {
|
|
|
3510
2763
|
return { freed: true };
|
|
3511
2764
|
}
|
|
3512
2765
|
};
|
|
3513
|
-
__decorate([
|
|
3514
|
-
__decorate([nonEnumerable], RolldownOutputImpl.prototype, "__rolldown_external_memory_handle__", null);
|
|
2766
|
+
__decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
|
|
3515
2767
|
|
|
3516
2768
|
//#endregion
|
|
3517
2769
|
//#region ../../node_modules/.pnpm/oxc-parser@0.96.0/node_modules/oxc-parser/src-js/wrap.js
|
|
3518
2770
|
function wrap$1(result) {
|
|
3519
|
-
let program, module
|
|
2771
|
+
let program, module, comments, errors;
|
|
3520
2772
|
return {
|
|
3521
2773
|
get program() {
|
|
3522
2774
|
if (!program) program = jsonParseAst(result.program);
|
|
3523
2775
|
return program;
|
|
3524
2776
|
},
|
|
3525
2777
|
get module() {
|
|
3526
|
-
if (!module
|
|
3527
|
-
return module
|
|
2778
|
+
if (!module) module = result.module;
|
|
2779
|
+
return module;
|
|
3528
2780
|
},
|
|
3529
2781
|
get comments() {
|
|
3530
2782
|
if (!comments) comments = result.comments;
|
|
@@ -3552,7 +2804,6 @@ function applyFix(program, fixPath) {
|
|
|
3552
2804
|
|
|
3553
2805
|
//#endregion
|
|
3554
2806
|
//#region src/parse-ast-index.ts
|
|
3555
|
-
var import_binding$7 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
3556
2807
|
function wrap(result, sourceText) {
|
|
3557
2808
|
result = wrap$1(result);
|
|
3558
2809
|
if (result.errors.length > 0) return normalizeParseError(sourceText, result.errors);
|
|
@@ -3579,7 +2830,7 @@ const defaultParserOptions = {
|
|
|
3579
2830
|
preserveParens: false
|
|
3580
2831
|
};
|
|
3581
2832
|
function parseAst(sourceText, options, filename) {
|
|
3582
|
-
return wrap(
|
|
2833
|
+
return wrap(parseSync(filename ?? "file.js", sourceText, {
|
|
3583
2834
|
...defaultParserOptions,
|
|
3584
2835
|
...options
|
|
3585
2836
|
}), sourceText);
|
|
@@ -3936,14 +3187,13 @@ function bindingifyRenderChunkFilter(filterOption) {
|
|
|
3936
3187
|
|
|
3937
3188
|
//#endregion
|
|
3938
3189
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
3939
|
-
var import_binding$6 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
3940
3190
|
function bindingifyPluginHookMeta(options) {
|
|
3941
3191
|
return { order: bindingPluginOrder(options.order) };
|
|
3942
3192
|
}
|
|
3943
3193
|
function bindingPluginOrder(order) {
|
|
3944
3194
|
switch (order) {
|
|
3945
|
-
case "post": return
|
|
3946
|
-
case "pre": return
|
|
3195
|
+
case "post": return BindingPluginOrder.Post;
|
|
3196
|
+
case "pre": return BindingPluginOrder.Pre;
|
|
3947
3197
|
case null:
|
|
3948
3198
|
case void 0: return;
|
|
3949
3199
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
@@ -4109,7 +3359,6 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
4109
3359
|
|
|
4110
3360
|
//#endregion
|
|
4111
3361
|
//#region src/plugin/bindingify-build-hooks.ts
|
|
4112
|
-
var import_binding$5 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4113
3362
|
function bindingifyBuildStart(args$1) {
|
|
4114
3363
|
const hook = args$1.plugin.buildStart;
|
|
4115
3364
|
if (!hook) return {};
|
|
@@ -4205,11 +3454,15 @@ function bindingifyTransform(args$1) {
|
|
|
4205
3454
|
const { handler, meta, options } = normalizeHook(hook);
|
|
4206
3455
|
return {
|
|
4207
3456
|
plugin: async (ctx, code$1, id$1, meta$1) => {
|
|
3457
|
+
let magicStringInstance, astInstance;
|
|
4208
3458
|
Object.defineProperties(meta$1, {
|
|
4209
3459
|
magicString: { get() {
|
|
4210
|
-
|
|
3460
|
+
if (magicStringInstance) return magicStringInstance;
|
|
3461
|
+
magicStringInstance = new BindingMagicString(code$1);
|
|
3462
|
+
return magicStringInstance;
|
|
4211
3463
|
} },
|
|
4212
3464
|
ast: { get() {
|
|
3465
|
+
if (astInstance) return astInstance;
|
|
4213
3466
|
let lang = "js";
|
|
4214
3467
|
switch (meta$1.moduleType) {
|
|
4215
3468
|
case "js":
|
|
@@ -4220,10 +3473,11 @@ function bindingifyTransform(args$1) {
|
|
|
4220
3473
|
break;
|
|
4221
3474
|
default: break;
|
|
4222
3475
|
}
|
|
4223
|
-
|
|
3476
|
+
astInstance = parseAst(code$1, {
|
|
4224
3477
|
astType: meta$1.moduleType.includes("ts") ? "ts" : "js",
|
|
4225
3478
|
lang
|
|
4226
3479
|
});
|
|
3480
|
+
return astInstance;
|
|
4227
3481
|
} }
|
|
4228
3482
|
});
|
|
4229
3483
|
const transformCtx = new TransformPluginContextImpl(args$1.outputOptions, ctx.inner(), args$1.plugin, args$1.pluginContextData, ctx, id$1, code$1, args$1.onLog, args$1.logLevel, args$1.watchMode);
|
|
@@ -4238,7 +3492,7 @@ function bindingifyTransform(args$1) {
|
|
|
4238
3492
|
let normalizedCode = void 0;
|
|
4239
3493
|
let map = ret.map;
|
|
4240
3494
|
if (typeof ret.code === "string") normalizedCode = ret.code;
|
|
4241
|
-
else if (ret.code instanceof
|
|
3495
|
+
else if (ret.code instanceof BindingMagicString) {
|
|
4242
3496
|
let magicString = ret.code;
|
|
4243
3497
|
normalizedCode = magicString.toString();
|
|
4244
3498
|
let fallbackSourcemap = ctx.sendMagicString(magicString);
|
|
@@ -4663,9 +3917,10 @@ function wrapHandlers(plugin) {
|
|
|
4663
3917
|
|
|
4664
3918
|
//#endregion
|
|
4665
3919
|
//#region src/options/normalized-input-options.ts
|
|
4666
|
-
var NormalizedInputOptionsImpl = class {
|
|
3920
|
+
var NormalizedInputOptionsImpl = class extends PlainObjectLike {
|
|
4667
3921
|
inner;
|
|
4668
3922
|
constructor(inner, onLog) {
|
|
3923
|
+
super();
|
|
4669
3924
|
this.onLog = onLog;
|
|
4670
3925
|
this.inner = inner;
|
|
4671
3926
|
}
|
|
@@ -4685,11 +3940,17 @@ var NormalizedInputOptionsImpl = class {
|
|
|
4685
3940
|
return this.inner.context;
|
|
4686
3941
|
}
|
|
4687
3942
|
};
|
|
3943
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "shimMissingExports", null);
|
|
3944
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "input", null);
|
|
3945
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "cwd", null);
|
|
3946
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "platform", null);
|
|
3947
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "context", null);
|
|
4688
3948
|
|
|
4689
3949
|
//#endregion
|
|
4690
3950
|
//#region src/options/normalized-output-options.ts
|
|
4691
|
-
var NormalizedOutputOptionsImpl = class {
|
|
3951
|
+
var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
|
|
4692
3952
|
constructor(inner, outputOptions, normalizedOutputPlugins) {
|
|
3953
|
+
super();
|
|
4693
3954
|
this.inner = inner;
|
|
4694
3955
|
this.outputOptions = outputOptions;
|
|
4695
3956
|
this.normalizedOutputPlugins = normalizedOutputPlugins;
|
|
@@ -4809,6 +4070,42 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
4809
4070
|
return this.inner.minifyInternalExports ?? false;
|
|
4810
4071
|
}
|
|
4811
4072
|
};
|
|
4073
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "dir", null);
|
|
4074
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "entryFileNames", null);
|
|
4075
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "chunkFileNames", null);
|
|
4076
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "assetFileNames", null);
|
|
4077
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "format", null);
|
|
4078
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "exports", null);
|
|
4079
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemap", null);
|
|
4080
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapBaseUrl", null);
|
|
4081
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "cssEntryFileNames", null);
|
|
4082
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "cssChunkFileNames", null);
|
|
4083
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "shimMissingExports", null);
|
|
4084
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "name", null);
|
|
4085
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "file", null);
|
|
4086
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "inlineDynamicImports", null);
|
|
4087
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "externalLiveBindings", null);
|
|
4088
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "banner", null);
|
|
4089
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "footer", null);
|
|
4090
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "intro", null);
|
|
4091
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "outro", null);
|
|
4092
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "esModule", null);
|
|
4093
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "extend", null);
|
|
4094
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "globals", null);
|
|
4095
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "paths", null);
|
|
4096
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "hashCharacters", null);
|
|
4097
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapDebugIds", null);
|
|
4098
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapIgnoreList", null);
|
|
4099
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapPathTransform", null);
|
|
4100
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "minify", null);
|
|
4101
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "legalComments", null);
|
|
4102
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "polyfillRequire", null);
|
|
4103
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "plugins", null);
|
|
4104
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "preserveModules", null);
|
|
4105
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "preserveModulesRoot", null);
|
|
4106
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "virtualDirname", null);
|
|
4107
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "topLevelVar", null);
|
|
4108
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "minifyInternalExports", null);
|
|
4812
4109
|
function normalizeAddon(value) {
|
|
4813
4110
|
if (typeof value === "function") return value;
|
|
4814
4111
|
return () => value || "";
|
|
@@ -4911,17 +4208,6 @@ var PluginContextData = class {
|
|
|
4911
4208
|
}
|
|
4912
4209
|
};
|
|
4913
4210
|
|
|
4914
|
-
//#endregion
|
|
4915
|
-
//#region src/utils/normalize-string-or-regex.ts
|
|
4916
|
-
function normalizedStringOrRegex(pattern) {
|
|
4917
|
-
if (!pattern) return;
|
|
4918
|
-
if (!isReadonlyArray(pattern)) return [pattern];
|
|
4919
|
-
return pattern;
|
|
4920
|
-
}
|
|
4921
|
-
function isReadonlyArray(input) {
|
|
4922
|
-
return Array.isArray(input);
|
|
4923
|
-
}
|
|
4924
|
-
|
|
4925
4211
|
//#endregion
|
|
4926
4212
|
//#region src/utils/normalize-transform-options.ts
|
|
4927
4213
|
/**
|
|
@@ -4929,26 +4215,11 @@ function isReadonlyArray(input) {
|
|
|
4929
4215
|
*
|
|
4930
4216
|
* Prioritizes values from `transform.define`, `transform.inject`, and `transform.dropLabels` over deprecated top-level options.
|
|
4931
4217
|
*/
|
|
4932
|
-
function normalizeTransformOptions(inputOptions
|
|
4218
|
+
function normalizeTransformOptions(inputOptions) {
|
|
4933
4219
|
const transform = inputOptions.transform;
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedDefine());
|
|
4938
|
-
define = Object.entries(inputOptions.define);
|
|
4939
|
-
}
|
|
4940
|
-
let inject;
|
|
4941
|
-
if (transform?.inject) inject = transform.inject;
|
|
4942
|
-
else if (inputOptions.inject) {
|
|
4943
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedInject());
|
|
4944
|
-
inject = inputOptions.inject;
|
|
4945
|
-
}
|
|
4946
|
-
let dropLabels;
|
|
4947
|
-
if (transform?.dropLabels) dropLabels = transform.dropLabels;
|
|
4948
|
-
else if (inputOptions.dropLabels) {
|
|
4949
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedDropLabels());
|
|
4950
|
-
dropLabels = inputOptions.dropLabels;
|
|
4951
|
-
}
|
|
4220
|
+
const define = transform?.define ? Object.entries(transform.define) : void 0;
|
|
4221
|
+
const inject = transform?.inject;
|
|
4222
|
+
const dropLabels = transform?.dropLabels;
|
|
4952
4223
|
let oxcTransformOptions;
|
|
4953
4224
|
if (transform) {
|
|
4954
4225
|
const { define: _define, inject: _inject, dropLabels: _dropLabels,...rest } = transform;
|
|
@@ -4967,7 +4238,6 @@ function normalizeTransformOptions(inputOptions, onLog) {
|
|
|
4967
4238
|
|
|
4968
4239
|
//#endregion
|
|
4969
4240
|
//#region src/utils/bindingify-input-options.ts
|
|
4970
|
-
var import_binding$4 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4971
4241
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
4972
4242
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
|
|
4973
4243
|
const plugins = rawPlugins.map((plugin) => {
|
|
@@ -4975,19 +4245,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4975
4245
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
4976
4246
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
4977
4247
|
});
|
|
4978
|
-
const normalizedTransform = normalizeTransformOptions(inputOptions
|
|
4979
|
-
let profilerNames;
|
|
4980
|
-
if (outputOptions.generatedCode?.profilerNames !== void 0) profilerNames = outputOptions.generatedCode.profilerNames;
|
|
4981
|
-
else if (inputOptions.profilerNames !== void 0) {
|
|
4982
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedProfilerNames());
|
|
4983
|
-
profilerNames = inputOptions.profilerNames;
|
|
4984
|
-
}
|
|
4985
|
-
let keepNames;
|
|
4986
|
-
if (outputOptions.keepNames !== void 0) keepNames = outputOptions.keepNames;
|
|
4987
|
-
else if (inputOptions.keepNames !== void 0) {
|
|
4988
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedKeepNames());
|
|
4989
|
-
keepNames = inputOptions.keepNames;
|
|
4990
|
-
}
|
|
4248
|
+
const normalizedTransform = normalizeTransformOptions(inputOptions);
|
|
4991
4249
|
return {
|
|
4992
4250
|
input: bindingifyInput(inputOptions.input),
|
|
4993
4251
|
plugins,
|
|
@@ -5003,11 +4261,11 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
5003
4261
|
define: normalizedTransform.define,
|
|
5004
4262
|
inject: bindingifyInject(normalizedTransform.inject),
|
|
5005
4263
|
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
5006
|
-
profilerNames,
|
|
4264
|
+
profilerNames: outputOptions.generatedCode?.profilerNames,
|
|
5007
4265
|
transform: normalizedTransform.oxcTransformOptions,
|
|
5008
4266
|
watch: bindingifyWatch(inputOptions.watch),
|
|
5009
4267
|
dropLabels: normalizedTransform.dropLabels,
|
|
5010
|
-
keepNames,
|
|
4268
|
+
keepNames: outputOptions.keepNames,
|
|
5011
4269
|
checks: inputOptions.checks,
|
|
5012
4270
|
deferSyncScanData: () => {
|
|
5013
4271
|
let ret = [];
|
|
@@ -5037,9 +4295,9 @@ function bindingifyHmr(hmr) {
|
|
|
5037
4295
|
function bindingifyAttachDebugInfo(attachDebugInfo) {
|
|
5038
4296
|
switch (attachDebugInfo) {
|
|
5039
4297
|
case void 0: return;
|
|
5040
|
-
case "full": return
|
|
5041
|
-
case "simple": return
|
|
5042
|
-
case "none": return
|
|
4298
|
+
case "full": return BindingAttachDebugInfo.Full;
|
|
4299
|
+
case "simple": return BindingAttachDebugInfo.Simple;
|
|
4300
|
+
case "none": return BindingAttachDebugInfo.None;
|
|
5043
4301
|
}
|
|
5044
4302
|
}
|
|
5045
4303
|
function bindingifyExternal(external) {
|
|
@@ -5052,13 +4310,13 @@ function bindingifyExternal(external) {
|
|
|
5052
4310
|
}
|
|
5053
4311
|
}
|
|
5054
4312
|
function bindingifyExperimental(experimental) {
|
|
5055
|
-
let chunkModulesOrder =
|
|
4313
|
+
let chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
|
|
5056
4314
|
if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
|
|
5057
4315
|
case "exec-order":
|
|
5058
|
-
chunkModulesOrder =
|
|
4316
|
+
chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
|
|
5059
4317
|
break;
|
|
5060
4318
|
case "module-id":
|
|
5061
|
-
chunkModulesOrder =
|
|
4319
|
+
chunkModulesOrder = BindingChunkModuleOrderBy.ModuleId;
|
|
5062
4320
|
break;
|
|
5063
4321
|
default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
|
|
5064
4322
|
}
|
|
@@ -5118,10 +4376,10 @@ function bindingifyInject(inject) {
|
|
|
5118
4376
|
}
|
|
5119
4377
|
function bindingifyLogLevel(logLevel) {
|
|
5120
4378
|
switch (logLevel) {
|
|
5121
|
-
case "silent": return
|
|
5122
|
-
case "debug": return
|
|
5123
|
-
case "warn": return
|
|
5124
|
-
case "info": return
|
|
4379
|
+
case "silent": return BindingLogLevel.Silent;
|
|
4380
|
+
case "debug": return BindingLogLevel.Debug;
|
|
4381
|
+
case "warn": return BindingLogLevel.Warn;
|
|
4382
|
+
case "info": return BindingLogLevel.Info;
|
|
5125
4383
|
default: throw new Error(`Unexpected log level: ${logLevel}`);
|
|
5126
4384
|
}
|
|
5127
4385
|
}
|
|
@@ -5157,19 +4415,19 @@ function bindingifyTreeshakeOptions(config) {
|
|
|
5157
4415
|
};
|
|
5158
4416
|
switch (config.propertyReadSideEffects) {
|
|
5159
4417
|
case "always":
|
|
5160
|
-
normalizedConfig.propertyReadSideEffects =
|
|
4418
|
+
normalizedConfig.propertyReadSideEffects = BindingPropertyReadSideEffects.Always;
|
|
5161
4419
|
break;
|
|
5162
4420
|
case false:
|
|
5163
|
-
normalizedConfig.propertyReadSideEffects =
|
|
4421
|
+
normalizedConfig.propertyReadSideEffects = BindingPropertyReadSideEffects.False;
|
|
5164
4422
|
break;
|
|
5165
4423
|
default:
|
|
5166
4424
|
}
|
|
5167
4425
|
switch (config.propertyWriteSideEffects) {
|
|
5168
4426
|
case "always":
|
|
5169
|
-
normalizedConfig.propertyWriteSideEffects =
|
|
4427
|
+
normalizedConfig.propertyWriteSideEffects = BindingPropertyWriteSideEffects.Always;
|
|
5170
4428
|
break;
|
|
5171
4429
|
case false:
|
|
5172
|
-
normalizedConfig.propertyWriteSideEffects =
|
|
4430
|
+
normalizedConfig.propertyWriteSideEffects = BindingPropertyWriteSideEffects.False;
|
|
5173
4431
|
break;
|
|
5174
4432
|
default:
|
|
5175
4433
|
}
|
|
@@ -5327,10 +4585,6 @@ function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
|
|
|
5327
4585
|
};
|
|
5328
4586
|
}
|
|
5329
4587
|
|
|
5330
|
-
//#endregion
|
|
5331
|
-
//#region src/utils/initialize-parallel-plugins.ts
|
|
5332
|
-
var import_binding$3 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5333
|
-
|
|
5334
4588
|
//#endregion
|
|
5335
4589
|
//#region src/utils/create-bundler-option.ts
|
|
5336
4590
|
async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
@@ -5361,68 +4615,56 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
5361
4615
|
|
|
5362
4616
|
//#endregion
|
|
5363
4617
|
//#region src/api/rolldown/rolldown-build.ts
|
|
5364
|
-
var import_binding$2 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5365
4618
|
Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
|
5366
4619
|
var RolldownBuild = class RolldownBuild {
|
|
5367
4620
|
#inputOptions;
|
|
5368
4621
|
#bundler;
|
|
5369
|
-
#
|
|
4622
|
+
#stopWorkers;
|
|
5370
4623
|
static asyncRuntimeShutdown = false;
|
|
5371
4624
|
constructor(inputOptions) {
|
|
5372
4625
|
this.#inputOptions = inputOptions;
|
|
5373
|
-
this.#bundler = new
|
|
4626
|
+
this.#bundler = new BindingBundler();
|
|
5374
4627
|
}
|
|
5375
4628
|
get closed() {
|
|
5376
|
-
return this.#
|
|
5377
|
-
}
|
|
5378
|
-
async #getBundlerWithStopWorker(outputOptions) {
|
|
5379
|
-
if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
|
|
5380
|
-
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
5381
|
-
if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding$2.startAsyncRuntime)();
|
|
5382
|
-
try {
|
|
5383
|
-
return this.#bundlerImpl = {
|
|
5384
|
-
impl: this.#bundler.createImpl(option.bundlerOptions),
|
|
5385
|
-
stopWorkers: option.stopWorkers,
|
|
5386
|
-
shutdown: () => {
|
|
5387
|
-
(0, import_binding$2.shutdownAsyncRuntime)();
|
|
5388
|
-
RolldownBuild.asyncRuntimeShutdown = true;
|
|
5389
|
-
}
|
|
5390
|
-
};
|
|
5391
|
-
} catch (e$1) {
|
|
5392
|
-
await option.stopWorkers?.();
|
|
5393
|
-
throw e$1;
|
|
5394
|
-
}
|
|
5395
|
-
}
|
|
5396
|
-
async scan() {
|
|
5397
|
-
const { impl } = await this.#getBundlerWithStopWorker({});
|
|
5398
|
-
unwrapBindingResult(await impl.scan());
|
|
4629
|
+
return this.#bundler.closed;
|
|
5399
4630
|
}
|
|
5400
4631
|
async generate(outputOptions = {}) {
|
|
5401
|
-
|
|
5402
|
-
const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
|
|
5403
|
-
return new RolldownOutputImpl(unwrapBindingResult(await impl.generate()));
|
|
4632
|
+
return this.#build(false, outputOptions);
|
|
5404
4633
|
}
|
|
5405
4634
|
async write(outputOptions = {}) {
|
|
5406
|
-
|
|
5407
|
-
const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
|
|
5408
|
-
return new RolldownOutputImpl(unwrapBindingResult(await impl.write()));
|
|
4635
|
+
return this.#build(true, outputOptions);
|
|
5409
4636
|
}
|
|
5410
4637
|
/**
|
|
5411
4638
|
* Close the build and free resources.
|
|
5412
4639
|
*/
|
|
5413
4640
|
async close() {
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
}
|
|
4641
|
+
await this.#stopWorkers?.();
|
|
4642
|
+
await this.#bundler.close();
|
|
4643
|
+
shutdownAsyncRuntime();
|
|
4644
|
+
RolldownBuild.asyncRuntimeShutdown = true;
|
|
4645
|
+
this.#stopWorkers = void 0;
|
|
5420
4646
|
}
|
|
5421
4647
|
async [Symbol.asyncDispose]() {
|
|
5422
4648
|
await this.close();
|
|
5423
4649
|
}
|
|
5424
4650
|
get watchFiles() {
|
|
5425
|
-
return this.#
|
|
4651
|
+
return Promise.resolve(this.#bundler.getWatchFiles());
|
|
4652
|
+
}
|
|
4653
|
+
async #build(isWrite, outputOptions) {
|
|
4654
|
+
validateOption("output", outputOptions);
|
|
4655
|
+
await this.#stopWorkers?.();
|
|
4656
|
+
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
4657
|
+
if (RolldownBuild.asyncRuntimeShutdown) startAsyncRuntime();
|
|
4658
|
+
try {
|
|
4659
|
+
this.#stopWorkers = option.stopWorkers;
|
|
4660
|
+
let output;
|
|
4661
|
+
if (isWrite) output = await this.#bundler.write(option.bundlerOptions);
|
|
4662
|
+
else output = await this.#bundler.generate(option.bundlerOptions);
|
|
4663
|
+
return new RolldownOutputImpl(unwrapBindingResult(output));
|
|
4664
|
+
} catch (e$1) {
|
|
4665
|
+
await option.stopWorkers?.();
|
|
4666
|
+
throw e$1;
|
|
4667
|
+
}
|
|
5426
4668
|
}
|
|
5427
4669
|
};
|
|
5428
4670
|
|
|
@@ -5524,7 +4766,6 @@ var WatcherEmitter = class {
|
|
|
5524
4766
|
|
|
5525
4767
|
//#endregion
|
|
5526
4768
|
//#region src/api/watch/watcher.ts
|
|
5527
|
-
var import_binding$1 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5528
4769
|
var Watcher = class {
|
|
5529
4770
|
closed;
|
|
5530
4771
|
inner;
|
|
@@ -5546,7 +4787,7 @@ var Watcher = class {
|
|
|
5546
4787
|
this.closed = true;
|
|
5547
4788
|
for (const stop of this.stopWorkers) await stop?.();
|
|
5548
4789
|
await this.inner.close();
|
|
5549
|
-
|
|
4790
|
+
shutdownAsyncRuntime();
|
|
5550
4791
|
}
|
|
5551
4792
|
start() {
|
|
5552
4793
|
process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
|
|
@@ -5558,7 +4799,7 @@ async function createWatcher(emitter, input) {
|
|
|
5558
4799
|
return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
|
|
5559
4800
|
})).flat());
|
|
5560
4801
|
const notifyOptions = getValidNotifyOption(bundlerOptions);
|
|
5561
|
-
new Watcher(emitter, new
|
|
4802
|
+
new Watcher(emitter, new BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions), bundlerOptions.map((option) => option.stopWorkers)).start();
|
|
5562
4803
|
}
|
|
5563
4804
|
function getValidNotifyOption(bundlerOptions) {
|
|
5564
4805
|
let result;
|
|
@@ -5587,8 +4828,7 @@ function defineConfig(config) {
|
|
|
5587
4828
|
|
|
5588
4829
|
//#endregion
|
|
5589
4830
|
//#region src/index.ts
|
|
5590
|
-
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5591
4831
|
const VERSION = version;
|
|
5592
4832
|
|
|
5593
4833
|
//#endregion
|
|
5594
|
-
export {
|
|
4834
|
+
export { build as a, createBundlerOptions as c, transformToRollupOutput as d, bindingifySourcemap$1 as f, watch as i, normalizeBindingResult as l, PluginDriver as m, VERSION as n, rolldown as o, validateOption as p, defineConfig as r, RolldownBuild as s, BindingMagicString$1 as t, unwrapBindingResult as u };
|