mdream 1.2.2 → 1.3.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/dist/iife.js +1 -1
- package/napi/index.mjs +14 -4
- package/package.json +15 -15
- package/wasm/mdream_edge_bg.wasm +0 -0
- package/wasm/package.json +1 -1
- package/wasm-bundler/mdream_edge_bg.wasm +0 -0
- package/wasm-bundler/package.json +1 -1
package/napi/index.mjs
CHANGED
|
@@ -529,23 +529,33 @@ function requireNative() {
|
|
|
529
529
|
|
|
530
530
|
nativeBinding = requireNative()
|
|
531
531
|
|
|
532
|
-
|
|
532
|
+
// NAPI_RS_FORCE_WASI is a tri-state flag:
|
|
533
|
+
// unset / any other value → native binding preferred, WASI is only a fallback
|
|
534
|
+
// 'true' → force WASI fallback even if native loaded
|
|
535
|
+
// 'error' → force WASI and throw if no WASI binding is found
|
|
536
|
+
// Treating any non-empty string as truthy (the historical behavior) meant
|
|
537
|
+
// NAPI_RS_FORCE_WASI=false, NAPI_RS_FORCE_WASI=0, etc. inadvertently triggered
|
|
538
|
+
// the WASI path, causing ENOENT for packages shipped without a .wasi.cjs file.
|
|
539
|
+
const forceWasi =
|
|
540
|
+
process.env.NAPI_RS_FORCE_WASI === 'true' || process.env.NAPI_RS_FORCE_WASI === 'error'
|
|
541
|
+
|
|
542
|
+
if (!nativeBinding || forceWasi) {
|
|
533
543
|
let wasiBinding = null
|
|
534
544
|
let wasiBindingError = null
|
|
535
545
|
try {
|
|
536
546
|
wasiBinding = require('./rust.wasi.cjs')
|
|
537
547
|
nativeBinding = wasiBinding
|
|
538
548
|
} catch (err) {
|
|
539
|
-
if (
|
|
549
|
+
if (forceWasi) {
|
|
540
550
|
wasiBindingError = err
|
|
541
551
|
}
|
|
542
552
|
}
|
|
543
|
-
if (!nativeBinding ||
|
|
553
|
+
if (!nativeBinding || forceWasi) {
|
|
544
554
|
try {
|
|
545
555
|
wasiBinding = require('@mdream/rust-wasm32-wasi')
|
|
546
556
|
nativeBinding = wasiBinding
|
|
547
557
|
} catch (err) {
|
|
548
|
-
if (
|
|
558
|
+
if (forceWasi) {
|
|
549
559
|
if (!wasiBindingError) {
|
|
550
560
|
wasiBindingError = err
|
|
551
561
|
} else {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdream",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"description": "Ultra-performant HTML to Markdown Convertor Optimized for LLMs and llm.txt artifacts.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -52,22 +52,22 @@
|
|
|
52
52
|
"browser": "./dist/browser.mjs",
|
|
53
53
|
"dependencies": {},
|
|
54
54
|
"optionalDependencies": {
|
|
55
|
-
"@mdream/rust-android-
|
|
56
|
-
"@mdream/rust-
|
|
57
|
-
"@mdream/rust-
|
|
58
|
-
"@mdream/rust-darwin-x64": "1.
|
|
59
|
-
"@mdream/rust-linux-
|
|
60
|
-
"@mdream/rust-
|
|
61
|
-
"@mdream/rust-linux-arm64-
|
|
62
|
-
"@mdream/rust-linux-
|
|
63
|
-
"@mdream/rust-
|
|
64
|
-
"@mdream/rust-
|
|
65
|
-
"@mdream/rust-win32-
|
|
66
|
-
"@mdream/rust-
|
|
67
|
-
"@mdream/rust-
|
|
55
|
+
"@mdream/rust-android-arm64": "1.3.0",
|
|
56
|
+
"@mdream/rust-darwin-arm64": "1.3.0",
|
|
57
|
+
"@mdream/rust-android-arm-eabi": "1.3.0",
|
|
58
|
+
"@mdream/rust-darwin-x64": "1.3.0",
|
|
59
|
+
"@mdream/rust-linux-arm-gnueabihf": "1.3.0",
|
|
60
|
+
"@mdream/rust-linux-x64-gnu": "1.3.0",
|
|
61
|
+
"@mdream/rust-linux-arm64-gnu": "1.3.0",
|
|
62
|
+
"@mdream/rust-linux-arm64-musl": "1.3.0",
|
|
63
|
+
"@mdream/rust-freebsd-x64": "1.3.0",
|
|
64
|
+
"@mdream/rust-wasm32-wasi": "1.3.0",
|
|
65
|
+
"@mdream/rust-win32-arm64-msvc": "1.3.0",
|
|
66
|
+
"@mdream/rust-win32-x64-msvc": "1.3.0",
|
|
67
|
+
"@mdream/rust-linux-x64-musl": "1.3.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@mdream/js": "1.
|
|
70
|
+
"@mdream/js": "1.3.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"flame": "pnpm build && unbuild bench/bundle && clinic flame -- node bench/bundle/dist/string.mjs 10",
|
package/wasm/mdream_edge_bg.wasm
CHANGED
|
Binary file
|
package/wasm/package.json
CHANGED
|
Binary file
|