@rollipop/rolldown 0.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +25 -0
- package/README.md +11 -0
- package/bin/cli.mjs +3 -0
- package/dist/cli-setup.d.mts +1 -0
- package/dist/cli-setup.mjs +17 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +1581 -0
- package/dist/config.d.mts +10 -0
- package/dist/config.mjs +14 -0
- package/dist/experimental-index.d.mts +239 -0
- package/dist/experimental-index.mjs +299 -0
- package/dist/experimental-runtime-types.d.ts +92 -0
- package/dist/filter-index.d.mts +4 -0
- package/dist/filter-index.mjs +369 -0
- package/dist/get-log-filter.d.mts +7 -0
- package/dist/get-log-filter.mjs +48 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +38 -0
- package/dist/parallel-plugin-worker.d.mts +1 -0
- package/dist/parallel-plugin-worker.mjs +32 -0
- package/dist/parallel-plugin.d.mts +14 -0
- package/dist/parallel-plugin.mjs +7 -0
- package/dist/parse-ast-index.d.mts +8 -0
- package/dist/parse-ast-index.mjs +4 -0
- package/dist/plugins-index.d.mts +31 -0
- package/dist/plugins-index.mjs +40 -0
- package/dist/shared/binding-DmMMxMk0.mjs +584 -0
- package/dist/shared/binding-kAegJ1Bj.d.mts +1775 -0
- package/dist/shared/bindingify-input-options-D0BAGfk2.mjs +1622 -0
- package/dist/shared/constructors-F44lhsH3.d.mts +30 -0
- package/dist/shared/constructors-Rl_oLd2F.mjs +67 -0
- package/dist/shared/define-config-BF4P-Pum.mjs +7 -0
- package/dist/shared/define-config-DJ1-iIdx.d.mts +2562 -0
- package/dist/shared/load-config-BEpugZky.mjs +114 -0
- package/dist/shared/logging-DsnCZi19.d.mts +42 -0
- package/dist/shared/logs-cyjC0SDv.mjs +183 -0
- package/dist/shared/misc-DpjTMcQQ.mjs +22 -0
- package/dist/shared/normalize-string-or-regex-DbTZ9prS.mjs +670 -0
- package/dist/shared/parse-ast-index-BuuhACPk.mjs +99 -0
- package/dist/shared/prompt-5sWCM0jm.mjs +847 -0
- package/dist/shared/rolldown-build-viDZfkdI.mjs +2292 -0
- package/dist/shared/rolldown-il0-nWH9.mjs +11 -0
- package/dist/shared/watch-BSdMzY6q.mjs +352 -0
- package/package.json +128 -0
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
//#region rolldown:runtime
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
+
key = keys[i];
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
16
|
+
__defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
28
|
+
}) : target, mod));
|
|
29
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/webcontainer-fallback.cjs
|
|
33
|
+
var require_webcontainer_fallback = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
34
|
+
const fs = __require("node:fs");
|
|
35
|
+
const childProcess = __require("node:child_process");
|
|
36
|
+
const version = JSON.parse(fs.readFileSync(__require.resolve("@rollipop/rolldown/package.json"), "utf-8")).version;
|
|
37
|
+
const baseDir = `/tmp/rolldown-${version}`;
|
|
38
|
+
const bindingEntry = `${baseDir}/node_modules/@rollipop/rolldown-binding/binding-wasm32-wasi/rolldown-binding.wasi.cjs`;
|
|
39
|
+
if (!fs.existsSync(bindingEntry)) {
|
|
40
|
+
const bindingPkg = `@rolldown/binding-wasm32-wasi@${version}`;
|
|
41
|
+
fs.rmSync(baseDir, {
|
|
42
|
+
recursive: true,
|
|
43
|
+
force: true
|
|
44
|
+
});
|
|
45
|
+
fs.mkdirSync(baseDir, { recursive: true });
|
|
46
|
+
console.log(`[rolldown] Downloading ${bindingPkg} on WebContainer...`);
|
|
47
|
+
childProcess.execFileSync("pnpm", ["i", bindingPkg], {
|
|
48
|
+
cwd: baseDir,
|
|
49
|
+
stdio: "inherit"
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
module.exports = __require(bindingEntry);
|
|
53
|
+
}));
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/binding.cjs
|
|
57
|
+
var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
58
|
+
const { readFileSync } = __require("node:fs");
|
|
59
|
+
let nativeBinding = null;
|
|
60
|
+
const loadErrors = [];
|
|
61
|
+
const isMusl = () => {
|
|
62
|
+
let musl = false;
|
|
63
|
+
if (process.platform === "linux") {
|
|
64
|
+
musl = isMuslFromFilesystem();
|
|
65
|
+
if (musl === null) musl = isMuslFromReport();
|
|
66
|
+
if (musl === null) musl = isMuslFromChildProcess();
|
|
67
|
+
}
|
|
68
|
+
return musl;
|
|
69
|
+
};
|
|
70
|
+
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
71
|
+
const isMuslFromFilesystem = () => {
|
|
72
|
+
try {
|
|
73
|
+
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
|
|
74
|
+
} catch {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const isMuslFromReport = () => {
|
|
79
|
+
let report = null;
|
|
80
|
+
if (typeof process.report?.getReport === "function") {
|
|
81
|
+
process.report.excludeNetwork = true;
|
|
82
|
+
report = process.report.getReport();
|
|
83
|
+
}
|
|
84
|
+
if (!report) return null;
|
|
85
|
+
if (report.header && report.header.glibcVersionRuntime) return false;
|
|
86
|
+
if (Array.isArray(report.sharedObjects)) {
|
|
87
|
+
if (report.sharedObjects.some(isFileMusl)) return true;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
};
|
|
91
|
+
const isMuslFromChildProcess = () => {
|
|
92
|
+
try {
|
|
93
|
+
return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
|
|
94
|
+
} catch (e) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
function requireNative() {
|
|
99
|
+
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) try {
|
|
100
|
+
return __require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
101
|
+
} catch (err) {
|
|
102
|
+
loadErrors.push(err);
|
|
103
|
+
}
|
|
104
|
+
else if (process.platform === "android") if (process.arch === "arm64") {
|
|
105
|
+
try {
|
|
106
|
+
return __require("./rolldown-binding.android-arm64.node");
|
|
107
|
+
} catch (e) {
|
|
108
|
+
loadErrors.push(e);
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
const binding = __require("@rollipop/rolldown-binding-android-arm64");
|
|
112
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-android-arm64/package.json").version;
|
|
113
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
114
|
+
return binding;
|
|
115
|
+
} catch (e) {
|
|
116
|
+
loadErrors.push(e);
|
|
117
|
+
}
|
|
118
|
+
} else if (process.arch === "arm") {
|
|
119
|
+
try {
|
|
120
|
+
return __require("./rolldown-binding.android-arm-eabi.node");
|
|
121
|
+
} catch (e) {
|
|
122
|
+
loadErrors.push(e);
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
const binding = __require("@rollipop/rolldown-binding-android-arm-eabi");
|
|
126
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-android-arm-eabi/package.json").version;
|
|
127
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
128
|
+
return binding;
|
|
129
|
+
} catch (e) {
|
|
130
|
+
loadErrors.push(e);
|
|
131
|
+
}
|
|
132
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
133
|
+
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") {
|
|
134
|
+
try {
|
|
135
|
+
return __require("./rolldown-binding.win32-x64-gnu.node");
|
|
136
|
+
} catch (e) {
|
|
137
|
+
loadErrors.push(e);
|
|
138
|
+
}
|
|
139
|
+
try {
|
|
140
|
+
const binding = __require("@rollipop/rolldown-binding-win32-x64-gnu");
|
|
141
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-win32-x64-gnu/package.json").version;
|
|
142
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
143
|
+
return binding;
|
|
144
|
+
} catch (e) {
|
|
145
|
+
loadErrors.push(e);
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
try {
|
|
149
|
+
return __require("./rolldown-binding.win32-x64-msvc.node");
|
|
150
|
+
} catch (e) {
|
|
151
|
+
loadErrors.push(e);
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
const binding = __require("@rollipop/rolldown-binding-win32-x64-msvc");
|
|
155
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-win32-x64-msvc/package.json").version;
|
|
156
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
157
|
+
return binding;
|
|
158
|
+
} catch (e) {
|
|
159
|
+
loadErrors.push(e);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else if (process.arch === "ia32") {
|
|
163
|
+
try {
|
|
164
|
+
return __require("./rolldown-binding.win32-ia32-msvc.node");
|
|
165
|
+
} catch (e) {
|
|
166
|
+
loadErrors.push(e);
|
|
167
|
+
}
|
|
168
|
+
try {
|
|
169
|
+
const binding = __require("@rollipop/rolldown-binding-win32-ia32-msvc");
|
|
170
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-win32-ia32-msvc/package.json").version;
|
|
171
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
172
|
+
return binding;
|
|
173
|
+
} catch (e) {
|
|
174
|
+
loadErrors.push(e);
|
|
175
|
+
}
|
|
176
|
+
} else if (process.arch === "arm64") {
|
|
177
|
+
try {
|
|
178
|
+
return __require("./rolldown-binding.win32-arm64-msvc.node");
|
|
179
|
+
} catch (e) {
|
|
180
|
+
loadErrors.push(e);
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
const binding = __require("@rollipop/rolldown-binding-win32-arm64-msvc");
|
|
184
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-win32-arm64-msvc/package.json").version;
|
|
185
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
186
|
+
return binding;
|
|
187
|
+
} catch (e) {
|
|
188
|
+
loadErrors.push(e);
|
|
189
|
+
}
|
|
190
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
191
|
+
else if (process.platform === "darwin") {
|
|
192
|
+
try {
|
|
193
|
+
return __require("./rolldown-binding.darwin-universal.node");
|
|
194
|
+
} catch (e) {
|
|
195
|
+
loadErrors.push(e);
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
const binding = __require("@rollipop/rolldown-binding-darwin-universal");
|
|
199
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-darwin-universal/package.json").version;
|
|
200
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
201
|
+
return binding;
|
|
202
|
+
} catch (e) {
|
|
203
|
+
loadErrors.push(e);
|
|
204
|
+
}
|
|
205
|
+
if (process.arch === "x64") {
|
|
206
|
+
try {
|
|
207
|
+
return __require("./rolldown-binding.darwin-x64.node");
|
|
208
|
+
} catch (e) {
|
|
209
|
+
loadErrors.push(e);
|
|
210
|
+
}
|
|
211
|
+
try {
|
|
212
|
+
const binding = __require("@rollipop/rolldown-binding-darwin-x64");
|
|
213
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-darwin-x64/package.json").version;
|
|
214
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
215
|
+
return binding;
|
|
216
|
+
} catch (e) {
|
|
217
|
+
loadErrors.push(e);
|
|
218
|
+
}
|
|
219
|
+
} else if (process.arch === "arm64") {
|
|
220
|
+
try {
|
|
221
|
+
return __require("./rolldown-binding.darwin-arm64.node");
|
|
222
|
+
} catch (e) {
|
|
223
|
+
loadErrors.push(e);
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
const binding = __require("@rollipop/rolldown-binding-darwin-arm64");
|
|
227
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-darwin-arm64/package.json").version;
|
|
228
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
229
|
+
return binding;
|
|
230
|
+
} catch (e) {
|
|
231
|
+
loadErrors.push(e);
|
|
232
|
+
}
|
|
233
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
234
|
+
} else if (process.platform === "freebsd") if (process.arch === "x64") {
|
|
235
|
+
try {
|
|
236
|
+
return __require("./rolldown-binding.freebsd-x64.node");
|
|
237
|
+
} catch (e) {
|
|
238
|
+
loadErrors.push(e);
|
|
239
|
+
}
|
|
240
|
+
try {
|
|
241
|
+
const binding = __require("@rollipop/rolldown-binding-freebsd-x64");
|
|
242
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-freebsd-x64/package.json").version;
|
|
243
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
244
|
+
return binding;
|
|
245
|
+
} catch (e) {
|
|
246
|
+
loadErrors.push(e);
|
|
247
|
+
}
|
|
248
|
+
} else if (process.arch === "arm64") {
|
|
249
|
+
try {
|
|
250
|
+
return __require("./rolldown-binding.freebsd-arm64.node");
|
|
251
|
+
} catch (e) {
|
|
252
|
+
loadErrors.push(e);
|
|
253
|
+
}
|
|
254
|
+
try {
|
|
255
|
+
const binding = __require("@rollipop/rolldown-binding-freebsd-arm64");
|
|
256
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-freebsd-arm64/package.json").version;
|
|
257
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
258
|
+
return binding;
|
|
259
|
+
} catch (e) {
|
|
260
|
+
loadErrors.push(e);
|
|
261
|
+
}
|
|
262
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
263
|
+
else if (process.platform === "linux") if (process.arch === "x64") if (isMusl()) {
|
|
264
|
+
try {
|
|
265
|
+
return __require("./rolldown-binding.linux-x64-musl.node");
|
|
266
|
+
} catch (e) {
|
|
267
|
+
loadErrors.push(e);
|
|
268
|
+
}
|
|
269
|
+
try {
|
|
270
|
+
const binding = __require("@rollipop/rolldown-binding-linux-x64-musl");
|
|
271
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-x64-musl/package.json").version;
|
|
272
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
273
|
+
return binding;
|
|
274
|
+
} catch (e) {
|
|
275
|
+
loadErrors.push(e);
|
|
276
|
+
}
|
|
277
|
+
} else {
|
|
278
|
+
try {
|
|
279
|
+
return __require("../rolldown-binding.linux-x64-gnu.node");
|
|
280
|
+
} catch (e) {
|
|
281
|
+
loadErrors.push(e);
|
|
282
|
+
}
|
|
283
|
+
try {
|
|
284
|
+
const binding = __require("@rollipop/rolldown-binding-linux-x64-gnu");
|
|
285
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-x64-gnu/package.json").version;
|
|
286
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
287
|
+
return binding;
|
|
288
|
+
} catch (e) {
|
|
289
|
+
loadErrors.push(e);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
else if (process.arch === "arm64") if (isMusl()) {
|
|
293
|
+
try {
|
|
294
|
+
return __require("./rolldown-binding.linux-arm64-musl.node");
|
|
295
|
+
} catch (e) {
|
|
296
|
+
loadErrors.push(e);
|
|
297
|
+
}
|
|
298
|
+
try {
|
|
299
|
+
const binding = __require("@rollipop/rolldown-binding-linux-arm64-musl");
|
|
300
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-arm64-musl/package.json").version;
|
|
301
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
302
|
+
return binding;
|
|
303
|
+
} catch (e) {
|
|
304
|
+
loadErrors.push(e);
|
|
305
|
+
}
|
|
306
|
+
} else {
|
|
307
|
+
try {
|
|
308
|
+
return __require("./rolldown-binding.linux-arm64-gnu.node");
|
|
309
|
+
} catch (e) {
|
|
310
|
+
loadErrors.push(e);
|
|
311
|
+
}
|
|
312
|
+
try {
|
|
313
|
+
const binding = __require("@rollipop/rolldown-binding-linux-arm64-gnu");
|
|
314
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-arm64-gnu/package.json").version;
|
|
315
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
316
|
+
return binding;
|
|
317
|
+
} catch (e) {
|
|
318
|
+
loadErrors.push(e);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
else if (process.arch === "arm") if (isMusl()) {
|
|
322
|
+
try {
|
|
323
|
+
return __require("./rolldown-binding.linux-arm-musleabihf.node");
|
|
324
|
+
} catch (e) {
|
|
325
|
+
loadErrors.push(e);
|
|
326
|
+
}
|
|
327
|
+
try {
|
|
328
|
+
const binding = __require("@rollipop/rolldown-binding-linux-arm-musleabihf");
|
|
329
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-arm-musleabihf/package.json").version;
|
|
330
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
331
|
+
return binding;
|
|
332
|
+
} catch (e) {
|
|
333
|
+
loadErrors.push(e);
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
try {
|
|
337
|
+
return __require("./rolldown-binding.linux-arm-gnueabihf.node");
|
|
338
|
+
} catch (e) {
|
|
339
|
+
loadErrors.push(e);
|
|
340
|
+
}
|
|
341
|
+
try {
|
|
342
|
+
const binding = __require("@rollipop/rolldown-binding-linux-arm-gnueabihf");
|
|
343
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-arm-gnueabihf/package.json").version;
|
|
344
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
345
|
+
return binding;
|
|
346
|
+
} catch (e) {
|
|
347
|
+
loadErrors.push(e);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
else if (process.arch === "loong64") if (isMusl()) {
|
|
351
|
+
try {
|
|
352
|
+
return __require("./rolldown-binding.linux-loong64-musl.node");
|
|
353
|
+
} catch (e) {
|
|
354
|
+
loadErrors.push(e);
|
|
355
|
+
}
|
|
356
|
+
try {
|
|
357
|
+
const binding = __require("@rollipop/rolldown-binding-linux-loong64-musl");
|
|
358
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-loong64-musl/package.json").version;
|
|
359
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
360
|
+
return binding;
|
|
361
|
+
} catch (e) {
|
|
362
|
+
loadErrors.push(e);
|
|
363
|
+
}
|
|
364
|
+
} else {
|
|
365
|
+
try {
|
|
366
|
+
return __require("./rolldown-binding.linux-loong64-gnu.node");
|
|
367
|
+
} catch (e) {
|
|
368
|
+
loadErrors.push(e);
|
|
369
|
+
}
|
|
370
|
+
try {
|
|
371
|
+
const binding = __require("@rollipop/rolldown-binding-linux-loong64-gnu");
|
|
372
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-loong64-gnu/package.json").version;
|
|
373
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
374
|
+
return binding;
|
|
375
|
+
} catch (e) {
|
|
376
|
+
loadErrors.push(e);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
else if (process.arch === "riscv64") if (isMusl()) {
|
|
380
|
+
try {
|
|
381
|
+
return __require("./rolldown-binding.linux-riscv64-musl.node");
|
|
382
|
+
} catch (e) {
|
|
383
|
+
loadErrors.push(e);
|
|
384
|
+
}
|
|
385
|
+
try {
|
|
386
|
+
const binding = __require("@rollipop/rolldown-binding-linux-riscv64-musl");
|
|
387
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-riscv64-musl/package.json").version;
|
|
388
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
389
|
+
return binding;
|
|
390
|
+
} catch (e) {
|
|
391
|
+
loadErrors.push(e);
|
|
392
|
+
}
|
|
393
|
+
} else {
|
|
394
|
+
try {
|
|
395
|
+
return __require("./rolldown-binding.linux-riscv64-gnu.node");
|
|
396
|
+
} catch (e) {
|
|
397
|
+
loadErrors.push(e);
|
|
398
|
+
}
|
|
399
|
+
try {
|
|
400
|
+
const binding = __require("@rollipop/rolldown-binding-linux-riscv64-gnu");
|
|
401
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-riscv64-gnu/package.json").version;
|
|
402
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
403
|
+
return binding;
|
|
404
|
+
} catch (e) {
|
|
405
|
+
loadErrors.push(e);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
else if (process.arch === "ppc64") {
|
|
409
|
+
try {
|
|
410
|
+
return __require("./rolldown-binding.linux-ppc64-gnu.node");
|
|
411
|
+
} catch (e) {
|
|
412
|
+
loadErrors.push(e);
|
|
413
|
+
}
|
|
414
|
+
try {
|
|
415
|
+
const binding = __require("@rollipop/rolldown-binding-linux-ppc64-gnu");
|
|
416
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-ppc64-gnu/package.json").version;
|
|
417
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
418
|
+
return binding;
|
|
419
|
+
} catch (e) {
|
|
420
|
+
loadErrors.push(e);
|
|
421
|
+
}
|
|
422
|
+
} else if (process.arch === "s390x") {
|
|
423
|
+
try {
|
|
424
|
+
return __require("./rolldown-binding.linux-s390x-gnu.node");
|
|
425
|
+
} catch (e) {
|
|
426
|
+
loadErrors.push(e);
|
|
427
|
+
}
|
|
428
|
+
try {
|
|
429
|
+
const binding = __require("@rollipop/rolldown-binding-linux-s390x-gnu");
|
|
430
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-linux-s390x-gnu/package.json").version;
|
|
431
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
432
|
+
return binding;
|
|
433
|
+
} catch (e) {
|
|
434
|
+
loadErrors.push(e);
|
|
435
|
+
}
|
|
436
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
437
|
+
else if (process.platform === "openharmony") if (process.arch === "arm64") {
|
|
438
|
+
try {
|
|
439
|
+
return __require("./rolldown-binding.openharmony-arm64.node");
|
|
440
|
+
} catch (e) {
|
|
441
|
+
loadErrors.push(e);
|
|
442
|
+
}
|
|
443
|
+
try {
|
|
444
|
+
const binding = __require("@rollipop/rolldown-binding-openharmony-arm64");
|
|
445
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-openharmony-arm64/package.json").version;
|
|
446
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
447
|
+
return binding;
|
|
448
|
+
} catch (e) {
|
|
449
|
+
loadErrors.push(e);
|
|
450
|
+
}
|
|
451
|
+
} else if (process.arch === "x64") {
|
|
452
|
+
try {
|
|
453
|
+
return __require("./rolldown-binding.openharmony-x64.node");
|
|
454
|
+
} catch (e) {
|
|
455
|
+
loadErrors.push(e);
|
|
456
|
+
}
|
|
457
|
+
try {
|
|
458
|
+
const binding = __require("@rollipop/rolldown-binding-openharmony-x64");
|
|
459
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-openharmony-x64/package.json").version;
|
|
460
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
461
|
+
return binding;
|
|
462
|
+
} catch (e) {
|
|
463
|
+
loadErrors.push(e);
|
|
464
|
+
}
|
|
465
|
+
} else if (process.arch === "arm") {
|
|
466
|
+
try {
|
|
467
|
+
return __require("./rolldown-binding.openharmony-arm.node");
|
|
468
|
+
} catch (e) {
|
|
469
|
+
loadErrors.push(e);
|
|
470
|
+
}
|
|
471
|
+
try {
|
|
472
|
+
const binding = __require("@rollipop/rolldown-binding-openharmony-arm");
|
|
473
|
+
const bindingPackageVersion = __require("@rollipop/rolldown-binding-openharmony-arm/package.json").version;
|
|
474
|
+
if (bindingPackageVersion !== "0.0.0-beta.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.0.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
475
|
+
return binding;
|
|
476
|
+
} catch (e) {
|
|
477
|
+
loadErrors.push(e);
|
|
478
|
+
}
|
|
479
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
480
|
+
else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
481
|
+
}
|
|
482
|
+
nativeBinding = requireNative();
|
|
483
|
+
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
484
|
+
let wasiBinding = null;
|
|
485
|
+
let wasiBindingError = null;
|
|
486
|
+
try {
|
|
487
|
+
wasiBinding = __require("../rolldown-binding.wasi.cjs");
|
|
488
|
+
nativeBinding = wasiBinding;
|
|
489
|
+
} catch (err) {
|
|
490
|
+
if (process.env.NAPI_RS_FORCE_WASI) wasiBindingError = err;
|
|
491
|
+
}
|
|
492
|
+
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) try {
|
|
493
|
+
wasiBinding = __require("@rollipop/rolldown-binding-wasm32-wasi");
|
|
494
|
+
nativeBinding = wasiBinding;
|
|
495
|
+
} catch (err) {
|
|
496
|
+
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
497
|
+
if (!wasiBindingError) wasiBindingError = err;
|
|
498
|
+
else wasiBindingError.cause = err;
|
|
499
|
+
loadErrors.push(err);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
|
|
503
|
+
const error = /* @__PURE__ */ new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
|
504
|
+
error.cause = wasiBindingError;
|
|
505
|
+
throw error;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
|
|
509
|
+
nativeBinding = require_webcontainer_fallback();
|
|
510
|
+
} catch (err) {
|
|
511
|
+
loadErrors.push(err);
|
|
512
|
+
}
|
|
513
|
+
if (!nativeBinding) {
|
|
514
|
+
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) => {
|
|
515
|
+
cur.cause = err;
|
|
516
|
+
return cur;
|
|
517
|
+
}) });
|
|
518
|
+
throw new Error(`Failed to load native binding`);
|
|
519
|
+
}
|
|
520
|
+
module.exports = nativeBinding;
|
|
521
|
+
module.exports.minify = nativeBinding.minify;
|
|
522
|
+
module.exports.minifySync = nativeBinding.minifySync;
|
|
523
|
+
module.exports.Severity = nativeBinding.Severity;
|
|
524
|
+
module.exports.ParseResult = nativeBinding.ParseResult;
|
|
525
|
+
module.exports.ExportExportNameKind = nativeBinding.ExportExportNameKind;
|
|
526
|
+
module.exports.ExportImportNameKind = nativeBinding.ExportImportNameKind;
|
|
527
|
+
module.exports.ExportLocalNameKind = nativeBinding.ExportLocalNameKind;
|
|
528
|
+
module.exports.ImportNameKind = nativeBinding.ImportNameKind;
|
|
529
|
+
module.exports.parse = nativeBinding.parse;
|
|
530
|
+
module.exports.parseSync = nativeBinding.parseSync;
|
|
531
|
+
module.exports.rawTransferSupported = nativeBinding.rawTransferSupported;
|
|
532
|
+
module.exports.ResolverFactory = nativeBinding.ResolverFactory;
|
|
533
|
+
module.exports.EnforceExtension = nativeBinding.EnforceExtension;
|
|
534
|
+
module.exports.ModuleType = nativeBinding.ModuleType;
|
|
535
|
+
module.exports.sync = nativeBinding.sync;
|
|
536
|
+
module.exports.HelperMode = nativeBinding.HelperMode;
|
|
537
|
+
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
|
|
538
|
+
module.exports.isolatedDeclarationSync = nativeBinding.isolatedDeclarationSync;
|
|
539
|
+
module.exports.moduleRunnerTransform = nativeBinding.moduleRunnerTransform;
|
|
540
|
+
module.exports.moduleRunnerTransformSync = nativeBinding.moduleRunnerTransformSync;
|
|
541
|
+
module.exports.transform = nativeBinding.transform;
|
|
542
|
+
module.exports.transformSync = nativeBinding.transformSync;
|
|
543
|
+
module.exports.BindingBundleEndEventData = nativeBinding.BindingBundleEndEventData;
|
|
544
|
+
module.exports.BindingBundleErrorEventData = nativeBinding.BindingBundleErrorEventData;
|
|
545
|
+
module.exports.BindingBundler = nativeBinding.BindingBundler;
|
|
546
|
+
module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
|
|
547
|
+
module.exports.BindingChunkingContext = nativeBinding.BindingChunkingContext;
|
|
548
|
+
module.exports.BindingDevEngine = nativeBinding.BindingDevEngine;
|
|
549
|
+
module.exports.BindingMagicString = nativeBinding.BindingMagicString;
|
|
550
|
+
module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
|
|
551
|
+
module.exports.BindingNormalizedOptions = nativeBinding.BindingNormalizedOptions;
|
|
552
|
+
module.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset;
|
|
553
|
+
module.exports.BindingOutputChunk = nativeBinding.BindingOutputChunk;
|
|
554
|
+
module.exports.BindingPluginContext = nativeBinding.BindingPluginContext;
|
|
555
|
+
module.exports.BindingRenderedChunk = nativeBinding.BindingRenderedChunk;
|
|
556
|
+
module.exports.BindingRenderedChunkMeta = nativeBinding.BindingRenderedChunkMeta;
|
|
557
|
+
module.exports.BindingRenderedModule = nativeBinding.BindingRenderedModule;
|
|
558
|
+
module.exports.BindingTransformPluginContext = nativeBinding.BindingTransformPluginContext;
|
|
559
|
+
module.exports.BindingUrlResolver = nativeBinding.BindingUrlResolver;
|
|
560
|
+
module.exports.BindingWatcher = nativeBinding.BindingWatcher;
|
|
561
|
+
module.exports.BindingWatcherBundler = nativeBinding.BindingWatcherBundler;
|
|
562
|
+
module.exports.BindingWatcherChangeData = nativeBinding.BindingWatcherChangeData;
|
|
563
|
+
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
|
|
564
|
+
module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
|
|
565
|
+
module.exports.ScheduledBuild = nativeBinding.ScheduledBuild;
|
|
566
|
+
module.exports.TraceSubscriberGuard = nativeBinding.TraceSubscriberGuard;
|
|
567
|
+
module.exports.BindingAttachDebugInfo = nativeBinding.BindingAttachDebugInfo;
|
|
568
|
+
module.exports.BindingBuiltinPluginName = nativeBinding.BindingBuiltinPluginName;
|
|
569
|
+
module.exports.BindingChunkModuleOrderBy = nativeBinding.BindingChunkModuleOrderBy;
|
|
570
|
+
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
|
|
571
|
+
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
|
|
572
|
+
module.exports.BindingPropertyReadSideEffects = nativeBinding.BindingPropertyReadSideEffects;
|
|
573
|
+
module.exports.BindingPropertyWriteSideEffects = nativeBinding.BindingPropertyWriteSideEffects;
|
|
574
|
+
module.exports.BindingRebuildStrategy = nativeBinding.BindingRebuildStrategy;
|
|
575
|
+
module.exports.createTokioRuntime = nativeBinding.createTokioRuntime;
|
|
576
|
+
module.exports.FilterTokenKind = nativeBinding.FilterTokenKind;
|
|
577
|
+
module.exports.initTraceSubscriber = nativeBinding.initTraceSubscriber;
|
|
578
|
+
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
579
|
+
module.exports.shutdownAsyncRuntime = nativeBinding.shutdownAsyncRuntime;
|
|
580
|
+
module.exports.startAsyncRuntime = nativeBinding.startAsyncRuntime;
|
|
581
|
+
}));
|
|
582
|
+
|
|
583
|
+
//#endregion
|
|
584
|
+
export { __toESM as n, require_binding as t };
|