mdream 1.4.0 → 1.4.1

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/napi/index.mjs CHANGED
@@ -3,11 +3,11 @@
3
3
  // @ts-nocheck
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- import { createRequire } from 'node:module'
6
+ import { createRequire } from 'module'
7
7
  const require = createRequire(import.meta.url)
8
8
  const __dirname = new URL('.', import.meta.url).pathname
9
9
 
10
- const { readFileSync } = require('node:fs')
10
+ const { readFileSync } = require('fs')
11
11
  let nativeBinding = null
12
12
  const loadErrors = []
13
13
 
@@ -37,7 +37,7 @@ const isMuslFromFilesystem = () => {
37
37
 
38
38
  const isMuslFromReport = () => {
39
39
  let report = null
40
- if (typeof process.report?.getReport === 'function') {
40
+ if (process.report && typeof process.report.getReport === 'function') {
41
41
  process.report.excludeNetwork = true
42
42
  report = process.report.getReport()
43
43
  }
@@ -109,7 +109,7 @@ function requireNative() {
109
109
  }
110
110
  } else if (process.platform === 'win32') {
111
111
  if (process.arch === 'x64') {
112
- if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
112
+ 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')) {
113
113
  try {
114
114
  return require('./rust.win32-x64-gnu.node')
115
115
  } catch (e) {
@@ -574,17 +574,18 @@ if (!nativeBinding || forceWasi) {
574
574
 
575
575
  if (!nativeBinding) {
576
576
  if (loadErrors.length > 0) {
577
- throw new Error(
577
+ const error = new Error(
578
578
  `Cannot find native binding. ` +
579
579
  `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
580
580
  'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
581
- {
582
- cause: loadErrors.reduce((err, cur) => {
583
- cur.cause = err
584
- return cur
585
- }),
586
- },
587
581
  )
582
+ // assign instead of the `new Error(message, { cause })` options form,
583
+ // which Node < 16.9 silently ignores
584
+ error.cause = loadErrors.reduce((err, cur) => {
585
+ cur.cause = err
586
+ return cur
587
+ })
588
+ throw error
588
589
  }
589
590
  throw new Error(`Failed to load native binding`)
590
591
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mdream",
3
3
  "type": "module",
4
- "version": "1.4.0",
4
+ "version": "1.4.1",
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-arm-eabi": "1.4.0",
56
- "@mdream/rust-android-arm64": "1.4.0",
57
- "@mdream/rust-darwin-arm64": "1.4.0",
58
- "@mdream/rust-darwin-x64": "1.4.0",
59
- "@mdream/rust-freebsd-x64": "1.4.0",
60
- "@mdream/rust-linux-arm-gnueabihf": "1.4.0",
61
- "@mdream/rust-linux-arm64-gnu": "1.4.0",
62
- "@mdream/rust-linux-arm64-musl": "1.4.0",
63
- "@mdream/rust-linux-x64-musl": "1.4.0",
64
- "@mdream/rust-wasm32-wasi": "1.4.0",
65
- "@mdream/rust-win32-arm64-msvc": "1.4.0",
66
- "@mdream/rust-win32-x64-msvc": "1.4.0",
67
- "@mdream/rust-linux-x64-gnu": "1.4.0"
55
+ "@mdream/rust-android-arm64": "1.4.1",
56
+ "@mdream/rust-darwin-arm64": "1.4.1",
57
+ "@mdream/rust-darwin-x64": "1.4.1",
58
+ "@mdream/rust-android-arm-eabi": "1.4.1",
59
+ "@mdream/rust-linux-arm-gnueabihf": "1.4.1",
60
+ "@mdream/rust-linux-arm64-gnu": "1.4.1",
61
+ "@mdream/rust-freebsd-x64": "1.4.1",
62
+ "@mdream/rust-linux-arm64-musl": "1.4.1",
63
+ "@mdream/rust-linux-x64-gnu": "1.4.1",
64
+ "@mdream/rust-wasm32-wasi": "1.4.1",
65
+ "@mdream/rust-linux-x64-musl": "1.4.1",
66
+ "@mdream/rust-win32-arm64-msvc": "1.4.1",
67
+ "@mdream/rust-win32-x64-msvc": "1.4.1"
68
68
  },
69
69
  "devDependencies": {
70
- "@mdream/js": "1.4.0"
70
+ "@mdream/js": "1.4.1"
71
71
  },
72
72
  "scripts": {
73
73
  "flame": "pnpm build && unbuild bench/bundle && clinic flame -- node bench/bundle/dist/string.mjs 10",
Binary file
package/wasm/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mdream-edge",
3
3
  "type": "module",
4
4
  "description": "WebAssembly edge runtime bindings for mdream HTML-to-Markdown converter",
5
- "version": "1.4.0",
5
+ "version": "1.4.1",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "mdream_edge_bg.wasm",
Binary file
@@ -2,7 +2,7 @@
2
2
  "name": "mdream-edge",
3
3
  "type": "module",
4
4
  "description": "WebAssembly edge runtime bindings for mdream HTML-to-Markdown converter",
5
- "version": "1.4.0",
5
+ "version": "1.4.1",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "mdream_edge_bg.wasm",