@vizejs/native 0.290.0 → 0.302.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/index.d.ts +3 -0
- package/index.js +4 -758
- package/package.json +10 -10
- package/types/sfc.d.ts +3 -0
package/index.d.ts
CHANGED
|
@@ -74,6 +74,9 @@ export interface BatchCompileOptionsNapi {
|
|
|
74
74
|
vueVersion?: string;
|
|
75
75
|
/** Preserve TypeScript in output when true */
|
|
76
76
|
isTs?: boolean;
|
|
77
|
+
/** Worker threads for this call (1-256). Omit to use Rayon's global pool.
|
|
78
|
+
* Concurrent explicit calls share a process-wide 256-worker budget.
|
|
79
|
+
* Capacity exhaustion fails immediately with a `WouldDeadlock` error. */
|
|
77
80
|
threads?: number;
|
|
78
81
|
/**
|
|
79
82
|
* Include per-block style metadata (incl. `styles[].content`). Default OFF.
|
package/index.js
CHANGED
|
@@ -1,762 +1,8 @@
|
|
|
1
|
-
// prettier-ignore
|
|
2
1
|
/* eslint-disable */
|
|
3
2
|
// @ts-nocheck
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
let nativeBinding = null;
|
|
8
|
-
const loadErrors = [];
|
|
9
|
-
|
|
10
|
-
const isMusl = () => {
|
|
11
|
-
let musl = false;
|
|
12
|
-
if (process.platform === "linux") {
|
|
13
|
-
musl = isMuslFromFilesystem();
|
|
14
|
-
if (musl === null) {
|
|
15
|
-
musl = isMuslFromReport();
|
|
16
|
-
}
|
|
17
|
-
if (musl === null) {
|
|
18
|
-
musl = isMuslFromChildProcess();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return musl;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
25
|
-
|
|
26
|
-
const isMuslFromFilesystem = () => {
|
|
27
|
-
try {
|
|
28
|
-
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
|
|
29
|
-
} catch {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const isMuslFromReport = () => {
|
|
35
|
-
let report = null;
|
|
36
|
-
if (typeof process.report?.getReport === "function") {
|
|
37
|
-
process.report.excludeNetwork = true;
|
|
38
|
-
report = process.report.getReport();
|
|
39
|
-
}
|
|
40
|
-
if (!report) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
if (report.header && report.header.glibcVersionRuntime) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
if (Array.isArray(report.sharedObjects)) {
|
|
47
|
-
if (report.sharedObjects.some(isFileMusl)) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const isMuslFromChildProcess = () => {
|
|
55
|
-
try {
|
|
56
|
-
return require("child_process")
|
|
57
|
-
.execSync("ldd --version", { encoding: "utf8" })
|
|
58
|
-
.includes("musl");
|
|
59
|
-
} catch (e) {
|
|
60
|
-
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
function requireNative() {
|
|
66
|
-
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
67
|
-
try {
|
|
68
|
-
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
69
|
-
} catch (err) {
|
|
70
|
-
loadErrors.push(err);
|
|
71
|
-
}
|
|
72
|
-
} else if (process.platform === "android") {
|
|
73
|
-
if (process.arch === "arm64") {
|
|
74
|
-
try {
|
|
75
|
-
return require("./vize-vitrine.android-arm64.node");
|
|
76
|
-
} catch (e) {
|
|
77
|
-
loadErrors.push(e);
|
|
78
|
-
}
|
|
79
|
-
try {
|
|
80
|
-
const binding = require("@vizejs/native-android-arm64");
|
|
81
|
-
const bindingPackageVersion = require("@vizejs/native-android-arm64/package.json").version;
|
|
82
|
-
if (
|
|
83
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
84
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
85
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
86
|
-
) {
|
|
87
|
-
throw new Error(
|
|
88
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
return binding;
|
|
92
|
-
} catch (e) {
|
|
93
|
-
loadErrors.push(e);
|
|
94
|
-
}
|
|
95
|
-
} else if (process.arch === "arm") {
|
|
96
|
-
try {
|
|
97
|
-
return require("./vize-vitrine.android-arm-eabi.node");
|
|
98
|
-
} catch (e) {
|
|
99
|
-
loadErrors.push(e);
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
const binding = require("@vizejs/native-android-arm-eabi");
|
|
103
|
-
const bindingPackageVersion =
|
|
104
|
-
require("@vizejs/native-android-arm-eabi/package.json").version;
|
|
105
|
-
if (
|
|
106
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
107
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
108
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
109
|
-
) {
|
|
110
|
-
throw new Error(
|
|
111
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
return binding;
|
|
115
|
-
} catch (e) {
|
|
116
|
-
loadErrors.push(e);
|
|
117
|
-
}
|
|
118
|
-
} else {
|
|
119
|
-
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
120
|
-
}
|
|
121
|
-
} else if (process.platform === "win32") {
|
|
122
|
-
if (process.arch === "x64") {
|
|
123
|
-
if (
|
|
124
|
-
process.config?.variables?.shlib_suffix === "dll.a" ||
|
|
125
|
-
process.config?.variables?.node_target_type === "shared_library"
|
|
126
|
-
) {
|
|
127
|
-
try {
|
|
128
|
-
return require("./vize-vitrine.win32-x64-gnu.node");
|
|
129
|
-
} catch (e) {
|
|
130
|
-
loadErrors.push(e);
|
|
131
|
-
}
|
|
132
|
-
try {
|
|
133
|
-
const binding = require("@vizejs/native-win32-x64-gnu");
|
|
134
|
-
const bindingPackageVersion =
|
|
135
|
-
require("@vizejs/native-win32-x64-gnu/package.json").version;
|
|
136
|
-
if (
|
|
137
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
138
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
139
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
140
|
-
) {
|
|
141
|
-
throw new Error(
|
|
142
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
return binding;
|
|
146
|
-
} catch (e) {
|
|
147
|
-
loadErrors.push(e);
|
|
148
|
-
}
|
|
149
|
-
} else {
|
|
150
|
-
try {
|
|
151
|
-
return require("./vize-vitrine.win32-x64-msvc.node");
|
|
152
|
-
} catch (e) {
|
|
153
|
-
loadErrors.push(e);
|
|
154
|
-
}
|
|
155
|
-
try {
|
|
156
|
-
const binding = require("@vizejs/native-win32-x64-msvc");
|
|
157
|
-
const bindingPackageVersion =
|
|
158
|
-
require("@vizejs/native-win32-x64-msvc/package.json").version;
|
|
159
|
-
if (
|
|
160
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
161
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
162
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
163
|
-
) {
|
|
164
|
-
throw new Error(
|
|
165
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
return binding;
|
|
169
|
-
} catch (e) {
|
|
170
|
-
loadErrors.push(e);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
} else if (process.arch === "ia32") {
|
|
174
|
-
try {
|
|
175
|
-
return require("./vize-vitrine.win32-ia32-msvc.node");
|
|
176
|
-
} catch (e) {
|
|
177
|
-
loadErrors.push(e);
|
|
178
|
-
}
|
|
179
|
-
try {
|
|
180
|
-
const binding = require("@vizejs/native-win32-ia32-msvc");
|
|
181
|
-
const bindingPackageVersion =
|
|
182
|
-
require("@vizejs/native-win32-ia32-msvc/package.json").version;
|
|
183
|
-
if (
|
|
184
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
185
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
186
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
187
|
-
) {
|
|
188
|
-
throw new Error(
|
|
189
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
return binding;
|
|
193
|
-
} catch (e) {
|
|
194
|
-
loadErrors.push(e);
|
|
195
|
-
}
|
|
196
|
-
} else if (process.arch === "arm64") {
|
|
197
|
-
try {
|
|
198
|
-
return require("./vize-vitrine.win32-arm64-msvc.node");
|
|
199
|
-
} catch (e) {
|
|
200
|
-
loadErrors.push(e);
|
|
201
|
-
}
|
|
202
|
-
try {
|
|
203
|
-
const binding = require("@vizejs/native-win32-arm64-msvc");
|
|
204
|
-
const bindingPackageVersion =
|
|
205
|
-
require("@vizejs/native-win32-arm64-msvc/package.json").version;
|
|
206
|
-
if (
|
|
207
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
208
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
209
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
210
|
-
) {
|
|
211
|
-
throw new Error(
|
|
212
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
return binding;
|
|
216
|
-
} catch (e) {
|
|
217
|
-
loadErrors.push(e);
|
|
218
|
-
}
|
|
219
|
-
} else {
|
|
220
|
-
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
221
|
-
}
|
|
222
|
-
} else if (process.platform === "darwin") {
|
|
223
|
-
try {
|
|
224
|
-
return require("./vize-vitrine.darwin-universal.node");
|
|
225
|
-
} catch (e) {
|
|
226
|
-
loadErrors.push(e);
|
|
227
|
-
}
|
|
228
|
-
try {
|
|
229
|
-
const binding = require("@vizejs/native-darwin-universal");
|
|
230
|
-
const bindingPackageVersion = require("@vizejs/native-darwin-universal/package.json").version;
|
|
231
|
-
if (
|
|
232
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
233
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
234
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
235
|
-
) {
|
|
236
|
-
throw new Error(
|
|
237
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
return binding;
|
|
241
|
-
} catch (e) {
|
|
242
|
-
loadErrors.push(e);
|
|
243
|
-
}
|
|
244
|
-
if (process.arch === "x64") {
|
|
245
|
-
try {
|
|
246
|
-
return require("./vize-vitrine.darwin-x64.node");
|
|
247
|
-
} catch (e) {
|
|
248
|
-
loadErrors.push(e);
|
|
249
|
-
}
|
|
250
|
-
try {
|
|
251
|
-
const binding = require("@vizejs/native-darwin-x64");
|
|
252
|
-
const bindingPackageVersion = require("@vizejs/native-darwin-x64/package.json").version;
|
|
253
|
-
if (
|
|
254
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
255
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
256
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
257
|
-
) {
|
|
258
|
-
throw new Error(
|
|
259
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
return binding;
|
|
263
|
-
} catch (e) {
|
|
264
|
-
loadErrors.push(e);
|
|
265
|
-
}
|
|
266
|
-
} else if (process.arch === "arm64") {
|
|
267
|
-
try {
|
|
268
|
-
return require("./vize-vitrine.darwin-arm64.node");
|
|
269
|
-
} catch (e) {
|
|
270
|
-
loadErrors.push(e);
|
|
271
|
-
}
|
|
272
|
-
try {
|
|
273
|
-
const binding = require("@vizejs/native-darwin-arm64");
|
|
274
|
-
const bindingPackageVersion = require("@vizejs/native-darwin-arm64/package.json").version;
|
|
275
|
-
if (
|
|
276
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
277
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
278
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
279
|
-
) {
|
|
280
|
-
throw new Error(
|
|
281
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
return binding;
|
|
285
|
-
} catch (e) {
|
|
286
|
-
loadErrors.push(e);
|
|
287
|
-
}
|
|
288
|
-
} else {
|
|
289
|
-
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
290
|
-
}
|
|
291
|
-
} else if (process.platform === "freebsd") {
|
|
292
|
-
if (process.arch === "x64") {
|
|
293
|
-
try {
|
|
294
|
-
return require("./vize-vitrine.freebsd-x64.node");
|
|
295
|
-
} catch (e) {
|
|
296
|
-
loadErrors.push(e);
|
|
297
|
-
}
|
|
298
|
-
try {
|
|
299
|
-
const binding = require("@vizejs/native-freebsd-x64");
|
|
300
|
-
const bindingPackageVersion = require("@vizejs/native-freebsd-x64/package.json").version;
|
|
301
|
-
if (
|
|
302
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
303
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
304
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
305
|
-
) {
|
|
306
|
-
throw new Error(
|
|
307
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
return binding;
|
|
311
|
-
} catch (e) {
|
|
312
|
-
loadErrors.push(e);
|
|
313
|
-
}
|
|
314
|
-
} else if (process.arch === "arm64") {
|
|
315
|
-
try {
|
|
316
|
-
return require("./vize-vitrine.freebsd-arm64.node");
|
|
317
|
-
} catch (e) {
|
|
318
|
-
loadErrors.push(e);
|
|
319
|
-
}
|
|
320
|
-
try {
|
|
321
|
-
const binding = require("@vizejs/native-freebsd-arm64");
|
|
322
|
-
const bindingPackageVersion = require("@vizejs/native-freebsd-arm64/package.json").version;
|
|
323
|
-
if (
|
|
324
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
325
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
326
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
327
|
-
) {
|
|
328
|
-
throw new Error(
|
|
329
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
330
|
-
);
|
|
331
|
-
}
|
|
332
|
-
return binding;
|
|
333
|
-
} catch (e) {
|
|
334
|
-
loadErrors.push(e);
|
|
335
|
-
}
|
|
336
|
-
} else {
|
|
337
|
-
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
338
|
-
}
|
|
339
|
-
} else if (process.platform === "linux") {
|
|
340
|
-
if (process.arch === "x64") {
|
|
341
|
-
if (isMusl()) {
|
|
342
|
-
try {
|
|
343
|
-
return require("./vize-vitrine.linux-x64-musl.node");
|
|
344
|
-
} catch (e) {
|
|
345
|
-
loadErrors.push(e);
|
|
346
|
-
}
|
|
347
|
-
try {
|
|
348
|
-
const binding = require("@vizejs/native-linux-x64-musl");
|
|
349
|
-
const bindingPackageVersion =
|
|
350
|
-
require("@vizejs/native-linux-x64-musl/package.json").version;
|
|
351
|
-
if (
|
|
352
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
353
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
354
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
355
|
-
) {
|
|
356
|
-
throw new Error(
|
|
357
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
358
|
-
);
|
|
359
|
-
}
|
|
360
|
-
return binding;
|
|
361
|
-
} catch (e) {
|
|
362
|
-
loadErrors.push(e);
|
|
363
|
-
}
|
|
364
|
-
} else {
|
|
365
|
-
try {
|
|
366
|
-
return require("./vize-vitrine.linux-x64-gnu.node");
|
|
367
|
-
} catch (e) {
|
|
368
|
-
loadErrors.push(e);
|
|
369
|
-
}
|
|
370
|
-
try {
|
|
371
|
-
const binding = require("@vizejs/native-linux-x64-gnu");
|
|
372
|
-
const bindingPackageVersion =
|
|
373
|
-
require("@vizejs/native-linux-x64-gnu/package.json").version;
|
|
374
|
-
if (
|
|
375
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
376
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
377
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
378
|
-
) {
|
|
379
|
-
throw new Error(
|
|
380
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
return binding;
|
|
384
|
-
} catch (e) {
|
|
385
|
-
loadErrors.push(e);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
} else if (process.arch === "arm64") {
|
|
389
|
-
if (isMusl()) {
|
|
390
|
-
try {
|
|
391
|
-
return require("./vize-vitrine.linux-arm64-musl.node");
|
|
392
|
-
} catch (e) {
|
|
393
|
-
loadErrors.push(e);
|
|
394
|
-
}
|
|
395
|
-
try {
|
|
396
|
-
const binding = require("@vizejs/native-linux-arm64-musl");
|
|
397
|
-
const bindingPackageVersion =
|
|
398
|
-
require("@vizejs/native-linux-arm64-musl/package.json").version;
|
|
399
|
-
if (
|
|
400
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
401
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
402
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
403
|
-
) {
|
|
404
|
-
throw new Error(
|
|
405
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
406
|
-
);
|
|
407
|
-
}
|
|
408
|
-
return binding;
|
|
409
|
-
} catch (e) {
|
|
410
|
-
loadErrors.push(e);
|
|
411
|
-
}
|
|
412
|
-
} else {
|
|
413
|
-
try {
|
|
414
|
-
return require("./vize-vitrine.linux-arm64-gnu.node");
|
|
415
|
-
} catch (e) {
|
|
416
|
-
loadErrors.push(e);
|
|
417
|
-
}
|
|
418
|
-
try {
|
|
419
|
-
const binding = require("@vizejs/native-linux-arm64-gnu");
|
|
420
|
-
const bindingPackageVersion =
|
|
421
|
-
require("@vizejs/native-linux-arm64-gnu/package.json").version;
|
|
422
|
-
if (
|
|
423
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
424
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
425
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
426
|
-
) {
|
|
427
|
-
throw new Error(
|
|
428
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
429
|
-
);
|
|
430
|
-
}
|
|
431
|
-
return binding;
|
|
432
|
-
} catch (e) {
|
|
433
|
-
loadErrors.push(e);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
} else if (process.arch === "arm") {
|
|
437
|
-
if (isMusl()) {
|
|
438
|
-
try {
|
|
439
|
-
return require("./vize-vitrine.linux-arm-musleabihf.node");
|
|
440
|
-
} catch (e) {
|
|
441
|
-
loadErrors.push(e);
|
|
442
|
-
}
|
|
443
|
-
try {
|
|
444
|
-
const binding = require("@vizejs/native-linux-arm-musleabihf");
|
|
445
|
-
const bindingPackageVersion =
|
|
446
|
-
require("@vizejs/native-linux-arm-musleabihf/package.json").version;
|
|
447
|
-
if (
|
|
448
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
449
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
450
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
451
|
-
) {
|
|
452
|
-
throw new Error(
|
|
453
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
return binding;
|
|
457
|
-
} catch (e) {
|
|
458
|
-
loadErrors.push(e);
|
|
459
|
-
}
|
|
460
|
-
} else {
|
|
461
|
-
try {
|
|
462
|
-
return require("./vize-vitrine.linux-arm-gnueabihf.node");
|
|
463
|
-
} catch (e) {
|
|
464
|
-
loadErrors.push(e);
|
|
465
|
-
}
|
|
466
|
-
try {
|
|
467
|
-
const binding = require("@vizejs/native-linux-arm-gnueabihf");
|
|
468
|
-
const bindingPackageVersion =
|
|
469
|
-
require("@vizejs/native-linux-arm-gnueabihf/package.json").version;
|
|
470
|
-
if (
|
|
471
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
472
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
473
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
474
|
-
) {
|
|
475
|
-
throw new Error(
|
|
476
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
477
|
-
);
|
|
478
|
-
}
|
|
479
|
-
return binding;
|
|
480
|
-
} catch (e) {
|
|
481
|
-
loadErrors.push(e);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
} else if (process.arch === "loong64") {
|
|
485
|
-
if (isMusl()) {
|
|
486
|
-
try {
|
|
487
|
-
return require("./vize-vitrine.linux-loong64-musl.node");
|
|
488
|
-
} catch (e) {
|
|
489
|
-
loadErrors.push(e);
|
|
490
|
-
}
|
|
491
|
-
try {
|
|
492
|
-
const binding = require("@vizejs/native-linux-loong64-musl");
|
|
493
|
-
const bindingPackageVersion =
|
|
494
|
-
require("@vizejs/native-linux-loong64-musl/package.json").version;
|
|
495
|
-
if (
|
|
496
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
497
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
498
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
499
|
-
) {
|
|
500
|
-
throw new Error(
|
|
501
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
502
|
-
);
|
|
503
|
-
}
|
|
504
|
-
return binding;
|
|
505
|
-
} catch (e) {
|
|
506
|
-
loadErrors.push(e);
|
|
507
|
-
}
|
|
508
|
-
} else {
|
|
509
|
-
try {
|
|
510
|
-
return require("./vize-vitrine.linux-loong64-gnu.node");
|
|
511
|
-
} catch (e) {
|
|
512
|
-
loadErrors.push(e);
|
|
513
|
-
}
|
|
514
|
-
try {
|
|
515
|
-
const binding = require("@vizejs/native-linux-loong64-gnu");
|
|
516
|
-
const bindingPackageVersion =
|
|
517
|
-
require("@vizejs/native-linux-loong64-gnu/package.json").version;
|
|
518
|
-
if (
|
|
519
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
520
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
521
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
522
|
-
) {
|
|
523
|
-
throw new Error(
|
|
524
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
525
|
-
);
|
|
526
|
-
}
|
|
527
|
-
return binding;
|
|
528
|
-
} catch (e) {
|
|
529
|
-
loadErrors.push(e);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
} else if (process.arch === "riscv64") {
|
|
533
|
-
if (isMusl()) {
|
|
534
|
-
try {
|
|
535
|
-
return require("./vize-vitrine.linux-riscv64-musl.node");
|
|
536
|
-
} catch (e) {
|
|
537
|
-
loadErrors.push(e);
|
|
538
|
-
}
|
|
539
|
-
try {
|
|
540
|
-
const binding = require("@vizejs/native-linux-riscv64-musl");
|
|
541
|
-
const bindingPackageVersion =
|
|
542
|
-
require("@vizejs/native-linux-riscv64-musl/package.json").version;
|
|
543
|
-
if (
|
|
544
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
545
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
546
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
547
|
-
) {
|
|
548
|
-
throw new Error(
|
|
549
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
550
|
-
);
|
|
551
|
-
}
|
|
552
|
-
return binding;
|
|
553
|
-
} catch (e) {
|
|
554
|
-
loadErrors.push(e);
|
|
555
|
-
}
|
|
556
|
-
} else {
|
|
557
|
-
try {
|
|
558
|
-
return require("./vize-vitrine.linux-riscv64-gnu.node");
|
|
559
|
-
} catch (e) {
|
|
560
|
-
loadErrors.push(e);
|
|
561
|
-
}
|
|
562
|
-
try {
|
|
563
|
-
const binding = require("@vizejs/native-linux-riscv64-gnu");
|
|
564
|
-
const bindingPackageVersion =
|
|
565
|
-
require("@vizejs/native-linux-riscv64-gnu/package.json").version;
|
|
566
|
-
if (
|
|
567
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
568
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
569
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
570
|
-
) {
|
|
571
|
-
throw new Error(
|
|
572
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
573
|
-
);
|
|
574
|
-
}
|
|
575
|
-
return binding;
|
|
576
|
-
} catch (e) {
|
|
577
|
-
loadErrors.push(e);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
} else if (process.arch === "ppc64") {
|
|
581
|
-
try {
|
|
582
|
-
return require("./vize-vitrine.linux-ppc64-gnu.node");
|
|
583
|
-
} catch (e) {
|
|
584
|
-
loadErrors.push(e);
|
|
585
|
-
}
|
|
586
|
-
try {
|
|
587
|
-
const binding = require("@vizejs/native-linux-ppc64-gnu");
|
|
588
|
-
const bindingPackageVersion =
|
|
589
|
-
require("@vizejs/native-linux-ppc64-gnu/package.json").version;
|
|
590
|
-
if (
|
|
591
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
592
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
593
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
594
|
-
) {
|
|
595
|
-
throw new Error(
|
|
596
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
597
|
-
);
|
|
598
|
-
}
|
|
599
|
-
return binding;
|
|
600
|
-
} catch (e) {
|
|
601
|
-
loadErrors.push(e);
|
|
602
|
-
}
|
|
603
|
-
} else if (process.arch === "s390x") {
|
|
604
|
-
try {
|
|
605
|
-
return require("./vize-vitrine.linux-s390x-gnu.node");
|
|
606
|
-
} catch (e) {
|
|
607
|
-
loadErrors.push(e);
|
|
608
|
-
}
|
|
609
|
-
try {
|
|
610
|
-
const binding = require("@vizejs/native-linux-s390x-gnu");
|
|
611
|
-
const bindingPackageVersion =
|
|
612
|
-
require("@vizejs/native-linux-s390x-gnu/package.json").version;
|
|
613
|
-
if (
|
|
614
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
615
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
616
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
617
|
-
) {
|
|
618
|
-
throw new Error(
|
|
619
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
620
|
-
);
|
|
621
|
-
}
|
|
622
|
-
return binding;
|
|
623
|
-
} catch (e) {
|
|
624
|
-
loadErrors.push(e);
|
|
625
|
-
}
|
|
626
|
-
} else {
|
|
627
|
-
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
628
|
-
}
|
|
629
|
-
} else if (process.platform === "openharmony") {
|
|
630
|
-
if (process.arch === "arm64") {
|
|
631
|
-
try {
|
|
632
|
-
return require("./vize-vitrine.openharmony-arm64.node");
|
|
633
|
-
} catch (e) {
|
|
634
|
-
loadErrors.push(e);
|
|
635
|
-
}
|
|
636
|
-
try {
|
|
637
|
-
const binding = require("@vizejs/native-openharmony-arm64");
|
|
638
|
-
const bindingPackageVersion =
|
|
639
|
-
require("@vizejs/native-openharmony-arm64/package.json").version;
|
|
640
|
-
if (
|
|
641
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
642
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
643
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
644
|
-
) {
|
|
645
|
-
throw new Error(
|
|
646
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
647
|
-
);
|
|
648
|
-
}
|
|
649
|
-
return binding;
|
|
650
|
-
} catch (e) {
|
|
651
|
-
loadErrors.push(e);
|
|
652
|
-
}
|
|
653
|
-
} else if (process.arch === "x64") {
|
|
654
|
-
try {
|
|
655
|
-
return require("./vize-vitrine.openharmony-x64.node");
|
|
656
|
-
} catch (e) {
|
|
657
|
-
loadErrors.push(e);
|
|
658
|
-
}
|
|
659
|
-
try {
|
|
660
|
-
const binding = require("@vizejs/native-openharmony-x64");
|
|
661
|
-
const bindingPackageVersion =
|
|
662
|
-
require("@vizejs/native-openharmony-x64/package.json").version;
|
|
663
|
-
if (
|
|
664
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
665
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
666
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
667
|
-
) {
|
|
668
|
-
throw new Error(
|
|
669
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
670
|
-
);
|
|
671
|
-
}
|
|
672
|
-
return binding;
|
|
673
|
-
} catch (e) {
|
|
674
|
-
loadErrors.push(e);
|
|
675
|
-
}
|
|
676
|
-
} else if (process.arch === "arm") {
|
|
677
|
-
try {
|
|
678
|
-
return require("./vize-vitrine.openharmony-arm.node");
|
|
679
|
-
} catch (e) {
|
|
680
|
-
loadErrors.push(e);
|
|
681
|
-
}
|
|
682
|
-
try {
|
|
683
|
-
const binding = require("@vizejs/native-openharmony-arm");
|
|
684
|
-
const bindingPackageVersion =
|
|
685
|
-
require("@vizejs/native-openharmony-arm/package.json").version;
|
|
686
|
-
if (
|
|
687
|
-
bindingPackageVersion !== "0.272.0" &&
|
|
688
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
689
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
690
|
-
) {
|
|
691
|
-
throw new Error(
|
|
692
|
-
`Native binding package version mismatch, expected 0.272.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
693
|
-
);
|
|
694
|
-
}
|
|
695
|
-
return binding;
|
|
696
|
-
} catch (e) {
|
|
697
|
-
loadErrors.push(e);
|
|
698
|
-
}
|
|
699
|
-
} else {
|
|
700
|
-
loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
701
|
-
}
|
|
702
|
-
} else {
|
|
703
|
-
loadErrors.push(
|
|
704
|
-
new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`),
|
|
705
|
-
);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
nativeBinding = requireNative();
|
|
710
|
-
|
|
711
|
-
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
712
|
-
let wasiBinding = null;
|
|
713
|
-
let wasiBindingError = null;
|
|
714
|
-
try {
|
|
715
|
-
wasiBinding = require("./vize-vitrine.wasi.cjs");
|
|
716
|
-
nativeBinding = wasiBinding;
|
|
717
|
-
} catch (err) {
|
|
718
|
-
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
719
|
-
wasiBindingError = err;
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
723
|
-
try {
|
|
724
|
-
wasiBinding = require("@vizejs/native-wasm32-wasi");
|
|
725
|
-
nativeBinding = wasiBinding;
|
|
726
|
-
} catch (err) {
|
|
727
|
-
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
728
|
-
if (!wasiBindingError) {
|
|
729
|
-
wasiBindingError = err;
|
|
730
|
-
} else {
|
|
731
|
-
wasiBindingError.cause = err;
|
|
732
|
-
}
|
|
733
|
-
loadErrors.push(err);
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
|
|
738
|
-
const error = new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
|
739
|
-
error.cause = wasiBindingError;
|
|
740
|
-
throw error;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
if (!nativeBinding) {
|
|
745
|
-
if (loadErrors.length > 0) {
|
|
746
|
-
throw new Error(
|
|
747
|
-
`Cannot find native binding. ` +
|
|
748
|
-
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
749
|
-
"Please try `npm i` again after removing both package-lock.json and node_modules directory.",
|
|
750
|
-
{
|
|
751
|
-
cause: loadErrors.reduce((err, cur) => {
|
|
752
|
-
cur.cause = err;
|
|
753
|
-
return cur;
|
|
754
|
-
}),
|
|
755
|
-
},
|
|
756
|
-
);
|
|
757
|
-
}
|
|
758
|
-
throw new Error(`Failed to load native binding`);
|
|
759
|
-
}
|
|
3
|
+
// Generated from the NAPI-RS export list by scripts/sync-entrypoint.mjs.
|
|
4
|
+
// Native target selection and package version checks live in native-binding.js.
|
|
5
|
+
const nativeBinding = require("./native-binding");
|
|
760
6
|
|
|
761
7
|
module.exports = nativeBinding;
|
|
762
8
|
module.exports.applyViteDefineReplacements = nativeBinding.applyViteDefineReplacements;
|
|
@@ -766,7 +12,6 @@ module.exports.buildInspectorGraph = nativeBinding.buildInspectorGraph;
|
|
|
766
12
|
module.exports.chunkVitePrecompileFiles = nativeBinding.chunkVitePrecompileFiles;
|
|
767
13
|
module.exports.classifyVitePluginRequest = nativeBinding.classifyVitePluginRequest;
|
|
768
14
|
module.exports.collectSfcTemplateAssetUrls = nativeBinding.collectSfcTemplateAssetUrls;
|
|
769
|
-
module.exports.rewriteSfcTemplateAssetReferences = nativeBinding.rewriteSfcTemplateAssetReferences;
|
|
770
15
|
module.exports.compile = nativeBinding.compile;
|
|
771
16
|
module.exports.compileCss = nativeBinding.compileCss;
|
|
772
17
|
module.exports.compileJsx = nativeBinding.compileJsx;
|
|
@@ -826,6 +71,7 @@ module.exports.resolveViteAliasRequest = nativeBinding.resolveViteAliasRequest;
|
|
|
826
71
|
module.exports.resolveViteCssImports = nativeBinding.resolveViteCssImports;
|
|
827
72
|
module.exports.resolveViteRelativeImport = nativeBinding.resolveViteRelativeImport;
|
|
828
73
|
module.exports.resolveViteVuePath = nativeBinding.resolveViteVuePath;
|
|
74
|
+
module.exports.rewriteSfcTemplateAssetReferences = nativeBinding.rewriteSfcTemplateAssetReferences;
|
|
829
75
|
module.exports.rewriteViteDynamicTemplateImports = nativeBinding.rewriteViteDynamicTemplateImports;
|
|
830
76
|
module.exports.rewriteViteImportMetaGlobBase = nativeBinding.rewriteViteImportMetaGlobBase;
|
|
831
77
|
module.exports.rewriteViteStaticAssetUrls = nativeBinding.rewriteViteStaticAssetUrls;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.302.0",
|
|
4
4
|
"description": "High-performance Vue.js compiler - Native bindings",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiler",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"@napi-rs/cli": "3.6.2"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@vizejs/native-darwin-arm64": "0.
|
|
40
|
-
"@vizejs/native-darwin-x64": "0.
|
|
41
|
-
"@vizejs/native-linux-arm64-gnu": "0.
|
|
42
|
-
"@vizejs/native-linux-arm64-musl": "0.
|
|
43
|
-
"@vizejs/native-linux-x64-gnu": "0.
|
|
44
|
-
"@vizejs/native-linux-x64-musl": "0.
|
|
45
|
-
"@vizejs/native-win32-arm64-msvc": "0.
|
|
46
|
-
"@vizejs/native-win32-x64-msvc": "0.
|
|
39
|
+
"@vizejs/native-darwin-arm64": "0.302.0",
|
|
40
|
+
"@vizejs/native-darwin-x64": "0.302.0",
|
|
41
|
+
"@vizejs/native-linux-arm64-gnu": "0.302.0",
|
|
42
|
+
"@vizejs/native-linux-arm64-musl": "0.302.0",
|
|
43
|
+
"@vizejs/native-linux-x64-gnu": "0.302.0",
|
|
44
|
+
"@vizejs/native-linux-x64-musl": "0.302.0",
|
|
45
|
+
"@vizejs/native-win32-arm64-msvc": "0.302.0",
|
|
46
|
+
"@vizejs/native-win32-x64-msvc": "0.302.0"
|
|
47
47
|
},
|
|
48
48
|
"napi": {
|
|
49
49
|
"binaryName": "vize-vitrine",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "node ./scripts/build-local.mjs --release",
|
|
66
|
-
"build:ci": "napi build --platform --profile ci --manifest-path ../../crates/vize_vitrine/Cargo.toml -p vize_vitrine --features napi,legacy --output-dir .",
|
|
66
|
+
"build:ci": "napi build --platform --profile ci --manifest-path ../../crates/vize_vitrine/Cargo.toml -p vize_vitrine --features napi,legacy --output-dir . && node ./scripts/sync-entrypoint.mjs",
|
|
67
67
|
"build:debug": "node ./scripts/build-local.mjs"
|
|
68
68
|
}
|
|
69
69
|
}
|
package/types/sfc.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export interface BatchCompileOptionsNapi {
|
|
|
11
11
|
experimentalServerScript?: boolean;
|
|
12
12
|
/** Preserve TypeScript in output when true */
|
|
13
13
|
isTs?: boolean;
|
|
14
|
+
/** Worker threads for this call (1-256). Omit to use Rayon's global pool.
|
|
15
|
+
* Concurrent explicit calls share a process-wide 256-worker budget.
|
|
16
|
+
* Capacity exhaustion fails immediately with a `WouldDeadlock` error. */
|
|
14
17
|
threads?: number;
|
|
15
18
|
}
|
|
16
19
|
|