@medicomind/rolldown-compression 2.5.1 → 2.5.3
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/CHANGELOG.md +16 -0
- package/README.md +3 -3
- package/dist/index.cjs +21 -14
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +21 -14
- package/index.d.ts +34 -31
- package/index.js +81 -82
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @medicomind/rolldown-compression
|
|
2
2
|
|
|
3
|
+
## 2.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5117b7d`](https://github.com/Medico-Mind/rolldown-compression/commit/5117b7dc2ddb2f86cfba7dcc4b53139bc302459f) Thanks [@Mnwa](https://github.com/Mnwa)! - Fix intermittent `illegal hardware instruction` crashes while compressing: a stack overflow on the rayon workers. Single-section brotli inputs run inline again instead of joining a parallel iterator, and the worker pool is always built with 16 MiB stacks.
|
|
8
|
+
|
|
9
|
+
## 2.5.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`cb1cfe8`](https://github.com/Medico-Mind/rolldown-compression/commit/cb1cfe835554389b92b3b79f9e57480911ed7498) Thanks [@Mnwa](https://github.com/Mnwa)! - Pass each source file to Rust once per batch and share its buffer across compression algorithms, with algorithm settings sent separately.
|
|
14
|
+
|
|
15
|
+
- [`b1fbdfe`](https://github.com/Medico-Mind/rolldown-compression/commit/b1fbdfef82174a8cc8aa8ff3e326d9735c5267b6) Thanks [@Mnwa](https://github.com/Mnwa)! - Use the same Brotli encoder for single-section and parallel compression.
|
|
16
|
+
|
|
17
|
+
- [`f8b39cb`](https://github.com/Medico-Mind/rolldown-compression/commit/f8b39cbbd62cfc3f5ca3805182efd3d58804168c) Thanks [@Mnwa](https://github.com/Mnwa)! - Update the WebAssembly runtime dependency to @napi-rs/wasm-runtime 1.2.4.
|
|
18
|
+
|
|
3
19
|
## 2.5.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -113,7 +113,7 @@ defineAlgorithm('brotli', { quality: 7, windowBits: 22 })
|
|
|
113
113
|
defineAlgorithm('zstd', { level: 12 })
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
`sectionSize` is the target number of bytes in each section when a large input is split across the native worker pool; inputs
|
|
116
|
+
`sectionSize` is the target number of bytes in each section when a large input is split across the native worker pool; inputs larger than one section are split. It defaults to two windows (`2^(windowBits + 1)` bytes) — 8 MiB at the default window — because sections much smaller than the window lose too many cross-section matches. The encoder segments between 64 KiB and 16 MiB, and values outside that range are clamped to it.
|
|
117
117
|
|
|
118
118
|
Smaller sections finish large files faster and cost ratio. Measured on 31.8 MiB of real JS at quality 9, `windowBits: 22`, against the 4 MiB point:
|
|
119
119
|
|
|
@@ -128,7 +128,7 @@ Smaller sections finish large files faster and cost ratio. Measured on 31.8 MiB
|
|
|
128
128
|
|
|
129
129
|
**Brotli output is reproducible across machines.** How many sections an input is cut into follows `sectionSize` alone, and how many threads work through them is a scheduling decision that leaves the bytes alone, so a given input and set of options compress to identical bytes regardless of core count or [`concurrency`](#options) — as gzip and zstd already did.
|
|
130
130
|
|
|
131
|
-
**`windowBits` is the other speed/ratio dial.** It sets the brotli sliding window (`2^windowBits` bytes) — how far back a match can be found — and, through the `sectionSize` default above, how large a file has to be before it is split across threads. **Lowering it makes compression faster in two ways at once and costs compression ratio**: a smaller window is cheaper to search, *and* it
|
|
131
|
+
**`windowBits` is the other speed/ratio dial.** It sets the brotli sliding window (`2^windowBits` bytes) — how far back a match can be found — and, through the `sectionSize` default above, how large a file has to be before it is split across threads. **Lowering it makes compression faster in two ways at once and costs compression ratio**: a smaller window is cheaper to search, *and* it reduces the default section size to `2^(windowBits + 1)` bytes, so big bundles are cut into sections sooner and finish on more cores (`windowBits: 20` splits inputs larger than 2 MiB instead of 8 MiB). Raising it does the reverse: better ratio, less parallelism, slower builds.
|
|
132
132
|
|
|
133
133
|
The size penalty depends entirely on how far apart your content's repetitions are: it is real on production bundles (repeated vendor copies, inlined assets, source maps), but on those synthetic fixtures — whose matches are nearly all short-range — it stays within 0.1%, and there `windowBits: 20` even came out marginally *smaller*. **Measure your own output before shipping a lower window** — decoders also allocate the window the stream declares, and above 24 bits brotli needs the large-window extension that browsers do not implement, hence the 10–24 range. The default `22` matches `BROTLI_DEFAULT_WINDOW`, i.e. what `node:zlib` and the `brotli` CLI emit.
|
|
134
134
|
|
|
@@ -136,7 +136,7 @@ The size penalty depends entirely on how far apart your content's repetitions ar
|
|
|
136
136
|
|
|
137
137
|
- The plugin hooks **`generateBundle`**, while all chunks and assets are still in memory — no filesystem round-trip. Eligible files (filter + threshold) are sent to the native module as **one batched FFI call per build**; results are emitted with `emitFile`.
|
|
138
138
|
- Compression runs on a rayon thread pool inside the native module (`AsyncTask`), parallel across files *and* algorithms, scheduled most-expensive-first so one large brotli file can't stretch the batch tail. The JS event loop keeps ticking throughout (covered by a test).
|
|
139
|
-
-
|
|
139
|
+
- Each file crosses the FFI boundary once as a buffer, with algorithm settings sent separately. Rust shares that source allocation across algorithms without copying the bytes. Buffers require no base64/string round-trips, and the compression working set lives in native memory — a 500 MB asset does not pressure the JS heap.
|
|
140
140
|
- A failing task never aborts the batch: per-task errors are aggregated and fail the build with one message.
|
|
141
141
|
- Already-compressed artifacts (`.gz`, `.br`, `.zst` — ours or pre-existing) are never re-compressed, so chaining plugin instances can't produce `app.js.gz.br`.
|
|
142
142
|
- Artifact names are checked before anything is written: a name that escapes the output directory, collides with another artifact of the same build, or overwrites a file the build already owns fails the build instead of silently clobbering it.
|
package/dist/index.cjs
CHANGED
|
@@ -221,7 +221,8 @@ function resolveOutputFileName(filename, fileName, algorithm, source) {
|
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
223
223
|
* Compress a batch of buffers in the native rayon thread pool, off the JS
|
|
224
|
-
* main thread.
|
|
224
|
+
* main thread. Each file is passed once and compressed with every algorithm.
|
|
225
|
+
* Results follow file order, then algorithm order within each file.
|
|
225
226
|
*/
|
|
226
227
|
const compressBuffers = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("../index.js").compressBuffers;
|
|
227
228
|
//#endregion
|
|
@@ -296,7 +297,7 @@ function createLogger(context, logLevel) {
|
|
|
296
297
|
};
|
|
297
298
|
}
|
|
298
299
|
/**
|
|
299
|
-
* Shared batching core: queues
|
|
300
|
+
* Shared batching core: queues each file once, flushes the files to the
|
|
300
301
|
* native module and hands successful results to `emit`. Only one batch of
|
|
301
302
|
* source buffers is referenced at a time once a flush trigger is set.
|
|
302
303
|
*/
|
|
@@ -308,17 +309,27 @@ function createBatchRunner({ options, log, emittedNames, isReserved, emit, fail
|
|
|
308
309
|
/** Artifact name -> the `source (algorithm)` that claimed it, for collision reporting. */
|
|
309
310
|
const claimed = /* @__PURE__ */ new Map();
|
|
310
311
|
const chunkSize = options.chunkSize > 0 ? options.chunkSize : options.stream ? STREAM_DEFAULT_CHUNK_SIZE : 0;
|
|
312
|
+
const algorithms = options.algorithms.map(({ algorithm, level, windowBits, sectionSize }) => ({
|
|
313
|
+
algorithm,
|
|
314
|
+
level,
|
|
315
|
+
windowBits,
|
|
316
|
+
sectionSize
|
|
317
|
+
}));
|
|
318
|
+
const batchOptions = {
|
|
319
|
+
concurrency: options.concurrency,
|
|
320
|
+
skipIfLargerOrEqual: options.skipIfLargerOrEqual
|
|
321
|
+
};
|
|
322
|
+
let pendingFiles = [];
|
|
311
323
|
let pending = [];
|
|
312
324
|
let pendingSourceBytes = 0;
|
|
313
325
|
const flush = async () => {
|
|
314
326
|
if (pending.length === 0) return;
|
|
315
327
|
const batch = pending;
|
|
328
|
+
const files = pendingFiles;
|
|
316
329
|
pending = [];
|
|
330
|
+
pendingFiles = [];
|
|
317
331
|
pendingSourceBytes = 0;
|
|
318
|
-
const results = await compressBuffers(
|
|
319
|
-
concurrency: options.concurrency,
|
|
320
|
-
skipIfLargerOrEqual: options.skipIfLargerOrEqual
|
|
321
|
-
});
|
|
332
|
+
const results = await compressBuffers(files, algorithms, batchOptions);
|
|
322
333
|
for (const [index, result] of results.entries()) {
|
|
323
334
|
const artifact = batch[index];
|
|
324
335
|
if (artifact === void 0) continue;
|
|
@@ -354,18 +365,14 @@ function createBatchRunner({ options, log, emittedNames, isReserved, emit, fail
|
|
|
354
365
|
if (isReserved(outputFileName)) fail(`the artifact "${outputFileName}" for ${fileName} (${algorithm.algorithm}) would overwrite a file this build already owns`);
|
|
355
366
|
claimed.set(outputFileName, `${fileName} (${algorithm.algorithm})`);
|
|
356
367
|
pending.push({
|
|
357
|
-
task: {
|
|
358
|
-
fileName,
|
|
359
|
-
algorithm: algorithm.algorithm,
|
|
360
|
-
level: algorithm.level,
|
|
361
|
-
windowBits: algorithm.windowBits,
|
|
362
|
-
sectionSize: algorithm.sectionSize
|
|
363
|
-
},
|
|
364
|
-
buffer,
|
|
365
368
|
sourceFileName: fileName,
|
|
366
369
|
outputFileName
|
|
367
370
|
});
|
|
368
371
|
}
|
|
372
|
+
pendingFiles.push({
|
|
373
|
+
fileName,
|
|
374
|
+
data: buffer
|
|
375
|
+
});
|
|
369
376
|
processedSources.add(fileName);
|
|
370
377
|
pendingSourceBytes += buffer.byteLength;
|
|
371
378
|
if (chunkSize > 0 && pendingSourceBytes >= chunkSize) await flush();
|
package/dist/index.d.cts
CHANGED
|
@@ -11,9 +11,9 @@ interface GzipOptions {
|
|
|
11
11
|
/**
|
|
12
12
|
* Brotli options. `quality`: 0-11, default 11. `windowBits`: 10-24, default 22.
|
|
13
13
|
* `sectionSize`: target bytes per section when large inputs are split across
|
|
14
|
-
* the native brotli worker pool; inputs
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* the native brotli worker pool; inputs larger than one section are split.
|
|
15
|
+
* Defaults to two windows (`2^(windowBits + 1)` bytes), i.e. 8 MiB
|
|
16
|
+
* at the default window. Smaller
|
|
17
17
|
* sections finish large files faster at a cost in compression ratio, and are
|
|
18
18
|
* clamped to the 64 KiB - 16 MiB range the encoder segments in.
|
|
19
19
|
*/
|
package/dist/index.d.mts
CHANGED
|
@@ -11,9 +11,9 @@ interface GzipOptions {
|
|
|
11
11
|
/**
|
|
12
12
|
* Brotli options. `quality`: 0-11, default 11. `windowBits`: 10-24, default 22.
|
|
13
13
|
* `sectionSize`: target bytes per section when large inputs are split across
|
|
14
|
-
* the native brotli worker pool; inputs
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* the native brotli worker pool; inputs larger than one section are split.
|
|
15
|
+
* Defaults to two windows (`2^(windowBits + 1)` bytes), i.e. 8 MiB
|
|
16
|
+
* at the default window. Smaller
|
|
17
17
|
* sections finish large files faster at a cost in compression ratio, and are
|
|
18
18
|
* clamped to the 64 KiB - 16 MiB range the encoder segments in.
|
|
19
19
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -197,7 +197,8 @@ function resolveOutputFileName(filename, fileName, algorithm, source) {
|
|
|
197
197
|
}
|
|
198
198
|
/**
|
|
199
199
|
* Compress a batch of buffers in the native rayon thread pool, off the JS
|
|
200
|
-
* main thread.
|
|
200
|
+
* main thread. Each file is passed once and compressed with every algorithm.
|
|
201
|
+
* Results follow file order, then algorithm order within each file.
|
|
201
202
|
*/
|
|
202
203
|
const compressBuffers = createRequire(import.meta.url)("../index.js").compressBuffers;
|
|
203
204
|
//#endregion
|
|
@@ -272,7 +273,7 @@ function createLogger(context, logLevel) {
|
|
|
272
273
|
};
|
|
273
274
|
}
|
|
274
275
|
/**
|
|
275
|
-
* Shared batching core: queues
|
|
276
|
+
* Shared batching core: queues each file once, flushes the files to the
|
|
276
277
|
* native module and hands successful results to `emit`. Only one batch of
|
|
277
278
|
* source buffers is referenced at a time once a flush trigger is set.
|
|
278
279
|
*/
|
|
@@ -284,17 +285,27 @@ function createBatchRunner({ options, log, emittedNames, isReserved, emit, fail
|
|
|
284
285
|
/** Artifact name -> the `source (algorithm)` that claimed it, for collision reporting. */
|
|
285
286
|
const claimed = /* @__PURE__ */ new Map();
|
|
286
287
|
const chunkSize = options.chunkSize > 0 ? options.chunkSize : options.stream ? STREAM_DEFAULT_CHUNK_SIZE : 0;
|
|
288
|
+
const algorithms = options.algorithms.map(({ algorithm, level, windowBits, sectionSize }) => ({
|
|
289
|
+
algorithm,
|
|
290
|
+
level,
|
|
291
|
+
windowBits,
|
|
292
|
+
sectionSize
|
|
293
|
+
}));
|
|
294
|
+
const batchOptions = {
|
|
295
|
+
concurrency: options.concurrency,
|
|
296
|
+
skipIfLargerOrEqual: options.skipIfLargerOrEqual
|
|
297
|
+
};
|
|
298
|
+
let pendingFiles = [];
|
|
287
299
|
let pending = [];
|
|
288
300
|
let pendingSourceBytes = 0;
|
|
289
301
|
const flush = async () => {
|
|
290
302
|
if (pending.length === 0) return;
|
|
291
303
|
const batch = pending;
|
|
304
|
+
const files = pendingFiles;
|
|
292
305
|
pending = [];
|
|
306
|
+
pendingFiles = [];
|
|
293
307
|
pendingSourceBytes = 0;
|
|
294
|
-
const results = await compressBuffers(
|
|
295
|
-
concurrency: options.concurrency,
|
|
296
|
-
skipIfLargerOrEqual: options.skipIfLargerOrEqual
|
|
297
|
-
});
|
|
308
|
+
const results = await compressBuffers(files, algorithms, batchOptions);
|
|
298
309
|
for (const [index, result] of results.entries()) {
|
|
299
310
|
const artifact = batch[index];
|
|
300
311
|
if (artifact === void 0) continue;
|
|
@@ -330,18 +341,14 @@ function createBatchRunner({ options, log, emittedNames, isReserved, emit, fail
|
|
|
330
341
|
if (isReserved(outputFileName)) fail(`the artifact "${outputFileName}" for ${fileName} (${algorithm.algorithm}) would overwrite a file this build already owns`);
|
|
331
342
|
claimed.set(outputFileName, `${fileName} (${algorithm.algorithm})`);
|
|
332
343
|
pending.push({
|
|
333
|
-
task: {
|
|
334
|
-
fileName,
|
|
335
|
-
algorithm: algorithm.algorithm,
|
|
336
|
-
level: algorithm.level,
|
|
337
|
-
windowBits: algorithm.windowBits,
|
|
338
|
-
sectionSize: algorithm.sectionSize
|
|
339
|
-
},
|
|
340
|
-
buffer,
|
|
341
344
|
sourceFileName: fileName,
|
|
342
345
|
outputFileName
|
|
343
346
|
});
|
|
344
347
|
}
|
|
348
|
+
pendingFiles.push({
|
|
349
|
+
fileName,
|
|
350
|
+
data: buffer
|
|
351
|
+
});
|
|
345
352
|
processedSources.add(fileName);
|
|
346
353
|
pendingSourceBytes += buffer.byteLength;
|
|
347
354
|
if (chunkSize > 0 && pendingSourceBytes >= chunkSize) await flush();
|
package/index.d.ts
CHANGED
|
@@ -11,15 +11,47 @@ export interface BatchOptions {
|
|
|
11
11
|
skipIfLargerOrEqual?: boolean
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/** Algorithm settings applied to every file in a batch. */
|
|
15
|
+
export interface CompressAlgorithm {
|
|
16
|
+
/** Canonical algorithm name: "gzip" | "brotli" | "zstd". */
|
|
17
|
+
algorithm: string
|
|
18
|
+
/**
|
|
19
|
+
* Compression level; algorithm default when omitted
|
|
20
|
+
* (gzip 6, brotli 11, zstd 19).
|
|
21
|
+
*/
|
|
22
|
+
level?: number
|
|
23
|
+
/** Brotli only: log2 window size (10-24, default 22). */
|
|
24
|
+
windowBits?: number
|
|
25
|
+
/**
|
|
26
|
+
* Brotli only: target section size in bytes when a large input is
|
|
27
|
+
* split across the brotli worker pool; inputs larger than one section
|
|
28
|
+
* are split. Defaults to two windows (`2^(windowBits + 1)` bytes),
|
|
29
|
+
* i.e. 8 MiB at the default window.
|
|
30
|
+
*
|
|
31
|
+
* Smaller sections finish large files faster and cost compression
|
|
32
|
+
* ratio. The encoder segments between 64 KiB and 16 MiB, and values
|
|
33
|
+
* outside that range are clamped to it.
|
|
34
|
+
*/
|
|
35
|
+
sectionSize?: number
|
|
36
|
+
}
|
|
37
|
+
|
|
14
38
|
/**
|
|
15
39
|
* Compress a batch of buffers off the JS main thread.
|
|
16
40
|
*
|
|
17
|
-
*
|
|
41
|
+
* Each file carries one buffer; algorithm settings are shared by all files.
|
|
42
|
+
* Results follow file order, then algorithm order within each file. Empty
|
|
43
|
+
* files or algorithms arrays produce no results. Algorithm names and
|
|
18
44
|
* levels are validated synchronously so misconfiguration fails fast;
|
|
19
45
|
* I/O-shaped failures during compression are reported per task via
|
|
20
46
|
* [`CompressResult::error`].
|
|
21
47
|
*/
|
|
22
|
-
export declare function compressBuffers(
|
|
48
|
+
export declare function compressBuffers(files: Array<CompressFile>, algorithms: Array<CompressAlgorithm>, options?: BatchOptions | undefined | null): Promise<Array<CompressResult>>
|
|
49
|
+
|
|
50
|
+
/** One source file, passed once regardless of the number of algorithms. */
|
|
51
|
+
export interface CompressFile {
|
|
52
|
+
fileName: string
|
|
53
|
+
data: Buffer
|
|
54
|
+
}
|
|
23
55
|
|
|
24
56
|
/** Outcome of a single task within a batch. */
|
|
25
57
|
export interface CompressResult {
|
|
@@ -37,32 +69,3 @@ export interface CompressResult {
|
|
|
37
69
|
/** Per-task failure. A failed task never aborts the rest of the batch. */
|
|
38
70
|
error?: string
|
|
39
71
|
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* One compression task: pairs with the buffer at the same index in the
|
|
43
|
-
* `buffers` argument of [`compress_buffers`].
|
|
44
|
-
*/
|
|
45
|
-
export interface CompressTask {
|
|
46
|
-
fileName: string
|
|
47
|
-
/** Canonical algorithm name: "gzip" | "brotli" | "zstd". */
|
|
48
|
-
algorithm: string
|
|
49
|
-
/**
|
|
50
|
-
* Compression level; algorithm default when omitted
|
|
51
|
-
* (gzip 6, brotli 11, zstd 19).
|
|
52
|
-
*/
|
|
53
|
-
level?: number
|
|
54
|
-
/** Brotli only: log2 window size (10-24, default 22). */
|
|
55
|
-
windowBits?: number
|
|
56
|
-
/**
|
|
57
|
-
* Brotli only: target section size in bytes when a large input is
|
|
58
|
-
* split across the brotli worker pool; inputs at least twice this
|
|
59
|
-
* size take the multithreaded path. Defaults to two windows
|
|
60
|
-
* (`2^(windowBits + 1)` bytes), i.e. 8 MiB and multithreading from
|
|
61
|
-
* 16 MiB at the default window.
|
|
62
|
-
*
|
|
63
|
-
* Smaller sections finish large files faster and cost compression
|
|
64
|
-
* ratio. The encoder segments between 64 KiB and 16 MiB, and values
|
|
65
|
-
* outside that range are clamped to it.
|
|
66
|
-
*/
|
|
67
|
-
sectionSize?: number
|
|
68
|
-
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// prettier-ignore
|
|
2
1
|
/* eslint-disable */
|
|
3
2
|
// @ts-nocheck
|
|
4
3
|
/* auto-generated by NAPI-RS */
|
|
@@ -63,7 +62,7 @@ const isMuslFromChildProcess = () => {
|
|
|
63
62
|
function requireNative() {
|
|
64
63
|
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
65
64
|
try {
|
|
66
|
-
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
|
|
65
|
+
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
|
|
67
66
|
} catch (err) {
|
|
68
67
|
loadErrors.push(err)
|
|
69
68
|
}
|
|
@@ -77,8 +76,8 @@ function requireNative() {
|
|
|
77
76
|
try {
|
|
78
77
|
const binding = require('@medicomind/rolldown-compression-android-arm64')
|
|
79
78
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '2.5.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
79
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
80
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
81
|
}
|
|
83
82
|
return binding
|
|
84
83
|
} catch (e) {
|
|
@@ -93,8 +92,8 @@ function requireNative() {
|
|
|
93
92
|
try {
|
|
94
93
|
const binding = require('@medicomind/rolldown-compression-android-arm-eabi')
|
|
95
94
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '2.5.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
95
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
96
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
97
|
}
|
|
99
98
|
return binding
|
|
100
99
|
} catch (e) {
|
|
@@ -107,36 +106,36 @@ function requireNative() {
|
|
|
107
106
|
if (process.arch === 'x64') {
|
|
108
107
|
if ((process.config && process.config.variables && process.config.variables.shlib_suffix === 'dll.a') || (process.config && process.config.variables && process.config.variables.node_target_type === 'shared_library')) {
|
|
109
108
|
try {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
return require('./rolldown-compression.win32-x64-gnu.node')
|
|
110
|
+
} catch (e) {
|
|
111
|
+
loadErrors.push(e)
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const binding = require('@medicomind/rolldown-compression-win32-x64-gnu')
|
|
115
|
+
const bindingPackageVersion = require('@medicomind/rolldown-compression-win32-x64-gnu/package.json').version
|
|
116
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
117
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
118
|
+
}
|
|
119
|
+
return binding
|
|
120
|
+
} catch (e) {
|
|
121
|
+
loadErrors.push(e)
|
|
119
122
|
}
|
|
120
|
-
return binding
|
|
121
|
-
} catch (e) {
|
|
122
|
-
loadErrors.push(e)
|
|
123
|
-
}
|
|
124
123
|
} else {
|
|
125
124
|
try {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
return require('./rolldown-compression.win32-x64-msvc.node')
|
|
126
|
+
} catch (e) {
|
|
127
|
+
loadErrors.push(e)
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
const binding = require('@medicomind/rolldown-compression-win32-x64-msvc')
|
|
131
|
+
const bindingPackageVersion = require('@medicomind/rolldown-compression-win32-x64-msvc/package.json').version
|
|
132
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
133
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
134
|
+
}
|
|
135
|
+
return binding
|
|
136
|
+
} catch (e) {
|
|
137
|
+
loadErrors.push(e)
|
|
135
138
|
}
|
|
136
|
-
return binding
|
|
137
|
-
} catch (e) {
|
|
138
|
-
loadErrors.push(e)
|
|
139
|
-
}
|
|
140
139
|
}
|
|
141
140
|
} else if (process.arch === 'ia32') {
|
|
142
141
|
try {
|
|
@@ -147,8 +146,8 @@ function requireNative() {
|
|
|
147
146
|
try {
|
|
148
147
|
const binding = require('@medicomind/rolldown-compression-win32-ia32-msvc')
|
|
149
148
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '2.5.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
149
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
150
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
151
|
}
|
|
153
152
|
return binding
|
|
154
153
|
} catch (e) {
|
|
@@ -163,8 +162,8 @@ function requireNative() {
|
|
|
163
162
|
try {
|
|
164
163
|
const binding = require('@medicomind/rolldown-compression-win32-arm64-msvc')
|
|
165
164
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '2.5.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
165
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
166
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
167
|
}
|
|
169
168
|
return binding
|
|
170
169
|
} catch (e) {
|
|
@@ -182,8 +181,8 @@ function requireNative() {
|
|
|
182
181
|
try {
|
|
183
182
|
const binding = require('@medicomind/rolldown-compression-darwin-universal')
|
|
184
183
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '2.5.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
184
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
185
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
186
|
}
|
|
188
187
|
return binding
|
|
189
188
|
} catch (e) {
|
|
@@ -198,8 +197,8 @@ function requireNative() {
|
|
|
198
197
|
try {
|
|
199
198
|
const binding = require('@medicomind/rolldown-compression-darwin-x64')
|
|
200
199
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '2.5.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
200
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
201
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
202
|
}
|
|
204
203
|
return binding
|
|
205
204
|
} catch (e) {
|
|
@@ -214,8 +213,8 @@ function requireNative() {
|
|
|
214
213
|
try {
|
|
215
214
|
const binding = require('@medicomind/rolldown-compression-darwin-arm64')
|
|
216
215
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '2.5.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
216
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
217
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
218
|
}
|
|
220
219
|
return binding
|
|
221
220
|
} catch (e) {
|
|
@@ -234,8 +233,8 @@ function requireNative() {
|
|
|
234
233
|
try {
|
|
235
234
|
const binding = require('@medicomind/rolldown-compression-freebsd-x64')
|
|
236
235
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '2.5.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
236
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
237
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
238
|
}
|
|
240
239
|
return binding
|
|
241
240
|
} catch (e) {
|
|
@@ -250,8 +249,8 @@ function requireNative() {
|
|
|
250
249
|
try {
|
|
251
250
|
const binding = require('@medicomind/rolldown-compression-freebsd-arm64')
|
|
252
251
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '2.5.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
252
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
253
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
254
|
}
|
|
256
255
|
return binding
|
|
257
256
|
} catch (e) {
|
|
@@ -271,8 +270,8 @@ function requireNative() {
|
|
|
271
270
|
try {
|
|
272
271
|
const binding = require('@medicomind/rolldown-compression-linux-x64-musl')
|
|
273
272
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '2.5.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
273
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
274
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
275
|
}
|
|
277
276
|
return binding
|
|
278
277
|
} catch (e) {
|
|
@@ -287,8 +286,8 @@ function requireNative() {
|
|
|
287
286
|
try {
|
|
288
287
|
const binding = require('@medicomind/rolldown-compression-linux-x64-gnu')
|
|
289
288
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '2.5.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
289
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
290
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
291
|
}
|
|
293
292
|
return binding
|
|
294
293
|
} catch (e) {
|
|
@@ -305,8 +304,8 @@ function requireNative() {
|
|
|
305
304
|
try {
|
|
306
305
|
const binding = require('@medicomind/rolldown-compression-linux-arm64-musl')
|
|
307
306
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '2.5.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
307
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
308
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
309
|
}
|
|
311
310
|
return binding
|
|
312
311
|
} catch (e) {
|
|
@@ -321,8 +320,8 @@ function requireNative() {
|
|
|
321
320
|
try {
|
|
322
321
|
const binding = require('@medicomind/rolldown-compression-linux-arm64-gnu')
|
|
323
322
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '2.5.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
323
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
324
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
325
|
}
|
|
327
326
|
return binding
|
|
328
327
|
} catch (e) {
|
|
@@ -339,8 +338,8 @@ function requireNative() {
|
|
|
339
338
|
try {
|
|
340
339
|
const binding = require('@medicomind/rolldown-compression-linux-arm-musleabihf')
|
|
341
340
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '2.5.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
341
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
342
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
343
|
}
|
|
345
344
|
return binding
|
|
346
345
|
} catch (e) {
|
|
@@ -355,8 +354,8 @@ function requireNative() {
|
|
|
355
354
|
try {
|
|
356
355
|
const binding = require('@medicomind/rolldown-compression-linux-arm-gnueabihf')
|
|
357
356
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '2.5.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
357
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
358
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
359
|
}
|
|
361
360
|
return binding
|
|
362
361
|
} catch (e) {
|
|
@@ -373,8 +372,8 @@ function requireNative() {
|
|
|
373
372
|
try {
|
|
374
373
|
const binding = require('@medicomind/rolldown-compression-linux-loong64-musl')
|
|
375
374
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '2.5.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
375
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
376
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
377
|
}
|
|
379
378
|
return binding
|
|
380
379
|
} catch (e) {
|
|
@@ -389,8 +388,8 @@ function requireNative() {
|
|
|
389
388
|
try {
|
|
390
389
|
const binding = require('@medicomind/rolldown-compression-linux-loong64-gnu')
|
|
391
390
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '2.5.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
391
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
392
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
393
|
}
|
|
395
394
|
return binding
|
|
396
395
|
} catch (e) {
|
|
@@ -407,8 +406,8 @@ function requireNative() {
|
|
|
407
406
|
try {
|
|
408
407
|
const binding = require('@medicomind/rolldown-compression-linux-riscv64-musl')
|
|
409
408
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '2.5.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
409
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
410
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
411
|
}
|
|
413
412
|
return binding
|
|
414
413
|
} catch (e) {
|
|
@@ -423,8 +422,8 @@ function requireNative() {
|
|
|
423
422
|
try {
|
|
424
423
|
const binding = require('@medicomind/rolldown-compression-linux-riscv64-gnu')
|
|
425
424
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '2.5.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
425
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
426
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
427
|
}
|
|
429
428
|
return binding
|
|
430
429
|
} catch (e) {
|
|
@@ -440,8 +439,8 @@ function requireNative() {
|
|
|
440
439
|
try {
|
|
441
440
|
const binding = require('@medicomind/rolldown-compression-linux-ppc64-gnu')
|
|
442
441
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '2.5.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
442
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
443
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
444
|
}
|
|
446
445
|
return binding
|
|
447
446
|
} catch (e) {
|
|
@@ -456,8 +455,8 @@ function requireNative() {
|
|
|
456
455
|
try {
|
|
457
456
|
const binding = require('@medicomind/rolldown-compression-linux-s390x-gnu')
|
|
458
457
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '2.5.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
458
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
459
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
460
|
}
|
|
462
461
|
return binding
|
|
463
462
|
} catch (e) {
|
|
@@ -476,8 +475,8 @@ function requireNative() {
|
|
|
476
475
|
try {
|
|
477
476
|
const binding = require('@medicomind/rolldown-compression-openharmony-arm64')
|
|
478
477
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '2.5.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
478
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
479
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
480
|
}
|
|
482
481
|
return binding
|
|
483
482
|
} catch (e) {
|
|
@@ -492,8 +491,8 @@ function requireNative() {
|
|
|
492
491
|
try {
|
|
493
492
|
const binding = require('@medicomind/rolldown-compression-openharmony-x64')
|
|
494
493
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '2.5.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
494
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
495
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
496
|
}
|
|
498
497
|
return binding
|
|
499
498
|
} catch (e) {
|
|
@@ -508,8 +507,8 @@ function requireNative() {
|
|
|
508
507
|
try {
|
|
509
508
|
const binding = require('@medicomind/rolldown-compression-openharmony-arm')
|
|
510
509
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '2.5.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 2.5.
|
|
510
|
+
if (bindingPackageVersion !== '2.5.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
511
|
+
throw new Error(`Native binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
512
|
}
|
|
514
513
|
return binding
|
|
515
514
|
} catch (e) {
|
|
@@ -550,7 +549,7 @@ function createLoadErrorChain(errors) {
|
|
|
550
549
|
//
|
|
551
550
|
// NAPI_RS_WASI_FLAVOR selects one exact generated flavor and implies strict
|
|
552
551
|
// WASI loading. It never crosses into another flavor or falls back to native.
|
|
553
|
-
const __napiWasiFlavors = [
|
|
552
|
+
const __napiWasiFlavors = ['wasm32-wasi']
|
|
554
553
|
const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR
|
|
555
554
|
const __napiWasiFlavorRequested =
|
|
556
555
|
typeof __napiWasiFlavor === 'string' && __napiWasiFlavor.length > 0
|
|
@@ -619,11 +618,11 @@ if (!nativeBinding || forceWasi) {
|
|
|
619
618
|
}
|
|
620
619
|
return null
|
|
621
620
|
}
|
|
622
|
-
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor ===
|
|
621
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
|
|
623
622
|
let candidateError = null
|
|
624
623
|
let candidateFailed = false
|
|
625
624
|
try {
|
|
626
|
-
candidateError = __napiWasiResolveCandidate('./rolldown-compression.wasi.cjs', false, [
|
|
625
|
+
candidateError = __napiWasiResolveCandidate('./rolldown-compression.wasi.cjs', false, ['./rolldown-compression.wasm32-wasi.debug.wasm', './rolldown-compression.wasm32-wasi.wasm'])
|
|
627
626
|
candidateFailed = candidateError !== null
|
|
628
627
|
if (!candidateFailed) {
|
|
629
628
|
wasiBinding = require('./rolldown-compression.wasi.cjs')
|
|
@@ -639,7 +638,7 @@ if (!nativeBinding || forceWasi) {
|
|
|
639
638
|
loadErrors.push(candidateError)
|
|
640
639
|
}
|
|
641
640
|
}
|
|
642
|
-
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor ===
|
|
641
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
|
|
643
642
|
let candidateError = null
|
|
644
643
|
let candidateFailed = false
|
|
645
644
|
try {
|
|
@@ -648,8 +647,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
648
647
|
if (!candidateFailed) {
|
|
649
648
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
650
649
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-wasm32-wasi/package.json').version
|
|
651
|
-
if (bindingPackageVersion !== '2.5.
|
|
652
|
-
throw new Error(`WASI binding package version mismatch, expected 2.5.
|
|
650
|
+
if (bindingPackageVersion !== '2.5.3') {
|
|
651
|
+
throw new Error(`WASI binding package version mismatch, expected 2.5.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
653
652
|
}
|
|
654
653
|
}
|
|
655
654
|
wasiBinding = require('@medicomind/rolldown-compression-wasm32-wasi')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicomind/rolldown-compression",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "Fast native (Rust) gzip / brotli / zstd compression plugin for Rolldown, powered by napi-rs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rolldown",
|
|
@@ -88,26 +88,26 @@
|
|
|
88
88
|
"rolldown": "^1.0.0"
|
|
89
89
|
},
|
|
90
90
|
"optionalDependencies": {
|
|
91
|
-
"@medicomind/rolldown-compression-darwin-arm64": "2.5.
|
|
92
|
-
"@medicomind/rolldown-compression-darwin-x64": "2.5.
|
|
93
|
-
"@medicomind/rolldown-compression-linux-arm64-gnu": "2.5.
|
|
94
|
-
"@medicomind/rolldown-compression-linux-x64-gnu": "2.5.
|
|
95
|
-
"@medicomind/rolldown-compression-linux-x64-musl": "2.5.
|
|
96
|
-
"@medicomind/rolldown-compression-wasm32-wasi": "2.5.
|
|
97
|
-
"@medicomind/rolldown-compression-win32-x64-msvc": "2.5.
|
|
91
|
+
"@medicomind/rolldown-compression-darwin-arm64": "2.5.3",
|
|
92
|
+
"@medicomind/rolldown-compression-darwin-x64": "2.5.3",
|
|
93
|
+
"@medicomind/rolldown-compression-linux-arm64-gnu": "2.5.3",
|
|
94
|
+
"@medicomind/rolldown-compression-linux-x64-gnu": "2.5.3",
|
|
95
|
+
"@medicomind/rolldown-compression-linux-x64-musl": "2.5.3",
|
|
96
|
+
"@medicomind/rolldown-compression-wasm32-wasi": "2.5.3",
|
|
97
|
+
"@medicomind/rolldown-compression-win32-x64-msvc": "2.5.3"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@biomejs/biome": "^2.5.
|
|
100
|
+
"@biomejs/biome": "^2.5.13",
|
|
101
101
|
"@changesets/changelog-github": "^1.0.1",
|
|
102
102
|
"@changesets/cli": "^3.0.2",
|
|
103
103
|
"@emnapi/core": "2.0.0-alpha.5",
|
|
104
104
|
"@emnapi/runtime": "2.0.0-alpha.5",
|
|
105
|
-
"@napi-rs/cli": "^3.9.
|
|
106
|
-
"@napi-rs/wasm-runtime": "^1.2.
|
|
107
|
-
"@types/node": "^26.5.
|
|
105
|
+
"@napi-rs/cli": "^3.9.1",
|
|
106
|
+
"@napi-rs/wasm-runtime": "^1.2.4",
|
|
107
|
+
"@types/node": "^26.5.1",
|
|
108
108
|
"@vitest/coverage-v8": "^5.0.0",
|
|
109
109
|
"emnapi": "^2.0.0-alpha.5",
|
|
110
|
-
"rolldown": "^1.2.
|
|
110
|
+
"rolldown": "^1.2.8",
|
|
111
111
|
"tsdown": "^0.23.0",
|
|
112
112
|
"typescript": "^7.0.2",
|
|
113
113
|
"vitest": "^5.0.0"
|