mdream 0.2.6 → 0.2.7

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/index.d.mts CHANGED
@@ -1,6 +1,9 @@
1
- import { H as HTMLToMarkdownOptions } from './shared/mdream.-SGj02be.mjs';
2
- export { B as BufferRegion, E as ELEMENT_NODE, b as ElementNode, f as HandlerContext, M as MdreamProcessingState, d as MdreamRuntimeState, N as Node, e as NodeEvent, P as Plugin, a as PluginCreationOptions, T as TEXT_NODE, g as TagHandler, c as TextNode } from './shared/mdream.-SGj02be.mjs';
1
+ import { H as HTMLToMarkdownOptions } from './shared/mdream.C0Qx0F7t.mjs';
2
+ export { B as BufferRegion, b as ELEMENT_NODE, E as ElementNode, f as HandlerContext, d as MdreamProcessingState, M as MdreamRuntimeState, N as Node, e as NodeEvent, P as Plugin, a as PluginCreationOptions, T as TEXT_NODE, g as TagHandler, c as TextNode } from './shared/mdream.C0Qx0F7t.mjs';
3
3
  import { ReadableStream } from 'node:stream/web';
4
+ export { E as ExtractedElement } from './shared/mdream.DMe7T-0M.mjs';
5
+
6
+ declare const TagIdMap: Record<string, number>;
4
7
 
5
8
  /**
6
9
  * Creates a markdown stream from an HTML stream
@@ -10,8 +13,6 @@ import { ReadableStream } from 'node:stream/web';
10
13
  */
11
14
  declare function streamHtmlToMarkdown(htmlStream: ReadableStream | null, options?: HTMLToMarkdownOptions): AsyncIterable<string>;
12
15
 
13
- declare const TagIdMap: Record<string, number>;
14
-
15
16
  declare function htmlToMarkdown(html: string, options?: HTMLToMarkdownOptions): string;
16
17
 
17
18
  export { HTMLToMarkdownOptions, TagIdMap, htmlToMarkdown, streamHtmlToMarkdown };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
- import { H as HTMLToMarkdownOptions } from './shared/mdream.-SGj02be.js';
2
- export { B as BufferRegion, E as ELEMENT_NODE, b as ElementNode, f as HandlerContext, M as MdreamProcessingState, d as MdreamRuntimeState, N as Node, e as NodeEvent, P as Plugin, a as PluginCreationOptions, T as TEXT_NODE, g as TagHandler, c as TextNode } from './shared/mdream.-SGj02be.js';
1
+ import { H as HTMLToMarkdownOptions } from './shared/mdream.C0Qx0F7t.js';
2
+ export { B as BufferRegion, b as ELEMENT_NODE, E as ElementNode, f as HandlerContext, d as MdreamProcessingState, M as MdreamRuntimeState, N as Node, e as NodeEvent, P as Plugin, a as PluginCreationOptions, T as TEXT_NODE, g as TagHandler, c as TextNode } from './shared/mdream.C0Qx0F7t.js';
3
3
  import { ReadableStream } from 'node:stream/web';
4
+ export { E as ExtractedElement } from './shared/mdream.BFdDSM96.js';
5
+
6
+ declare const TagIdMap: Record<string, number>;
4
7
 
5
8
  /**
6
9
  * Creates a markdown stream from an HTML stream
@@ -10,8 +13,6 @@ import { ReadableStream } from 'node:stream/web';
10
13
  */
11
14
  declare function streamHtmlToMarkdown(htmlStream: ReadableStream | null, options?: HTMLToMarkdownOptions): AsyncIterable<string>;
12
15
 
13
- declare const TagIdMap: Record<string, number>;
14
-
15
16
  declare function htmlToMarkdown(html: string, options?: HTMLToMarkdownOptions): string;
16
17
 
17
18
  export { HTMLToMarkdownOptions, TagIdMap, htmlToMarkdown, streamHtmlToMarkdown };
@@ -1,4 +1,5 @@
1
- import { P as Plugin, b as ElementNode, d as MdreamRuntimeState } from './shared/mdream.-SGj02be.mjs';
1
+ import { P as Plugin } from './shared/mdream.C0Qx0F7t.mjs';
2
+ export { e as extractionPlugin } from './shared/mdream.DMe7T-0M.mjs';
2
3
 
3
4
  /**
4
5
  * Create a plugin that implements the Plugin interface with improved type inference
@@ -7,11 +8,6 @@ import { P as Plugin, b as ElementNode, d as MdreamRuntimeState } from './shared
7
8
  */
8
9
  declare function createPlugin<T extends Partial<Plugin>>(plugin: T): Plugin;
9
10
 
10
- interface ExtractedElement extends ElementNode {
11
- textContent: string;
12
- }
13
- declare function extractionPlugin(selectors: Record<string, (element: ExtractedElement, state: MdreamRuntimeState) => void>): Plugin;
14
-
15
11
  /**
16
12
  * Plugin that filters nodes based on CSS selectors.
17
13
  * Allows including or excluding nodes based on selectors.
@@ -90,4 +86,4 @@ declare function readabilityPlugin(): Plugin;
90
86
  */
91
87
  declare function tailwindPlugin(): Plugin;
92
88
 
93
- export { createPlugin, extractionPlugin, filterPlugin, frontmatterPlugin, isolateMainPlugin, readabilityPlugin, tailwindPlugin };
89
+ export { createPlugin, filterPlugin, frontmatterPlugin, isolateMainPlugin, readabilityPlugin, tailwindPlugin };
package/dist/plugins.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { P as Plugin, b as ElementNode, d as MdreamRuntimeState } from './shared/mdream.-SGj02be.js';
1
+ import { P as Plugin } from './shared/mdream.C0Qx0F7t.js';
2
+ export { e as extractionPlugin } from './shared/mdream.BFdDSM96.js';
2
3
 
3
4
  /**
4
5
  * Create a plugin that implements the Plugin interface with improved type inference
@@ -7,11 +8,6 @@ import { P as Plugin, b as ElementNode, d as MdreamRuntimeState } from './shared
7
8
  */
8
9
  declare function createPlugin<T extends Partial<Plugin>>(plugin: T): Plugin;
9
10
 
10
- interface ExtractedElement extends ElementNode {
11
- textContent: string;
12
- }
13
- declare function extractionPlugin(selectors: Record<string, (element: ExtractedElement, state: MdreamRuntimeState) => void>): Plugin;
14
-
15
11
  /**
16
12
  * Plugin that filters nodes based on CSS selectors.
17
13
  * Allows including or excluding nodes based on selectors.
@@ -90,4 +86,4 @@ declare function readabilityPlugin(): Plugin;
90
86
  */
91
87
  declare function tailwindPlugin(): Plugin;
92
88
 
93
- export { createPlugin, extractionPlugin, filterPlugin, frontmatterPlugin, isolateMainPlugin, readabilityPlugin, tailwindPlugin };
89
+ export { createPlugin, filterPlugin, frontmatterPlugin, isolateMainPlugin, readabilityPlugin, tailwindPlugin };
@@ -1,4 +1,4 @@
1
- import { H as HTMLToMarkdownOptions } from '../shared/mdream.-SGj02be.mjs';
1
+ import { H as HTMLToMarkdownOptions } from '../shared/mdream.C0Qx0F7t.mjs';
2
2
 
3
3
  /**
4
4
  * Creates a configurable minimal preset with advanced options
@@ -1,4 +1,4 @@
1
- import { H as HTMLToMarkdownOptions } from '../shared/mdream.-SGj02be.js';
1
+ import { H as HTMLToMarkdownOptions } from '../shared/mdream.C0Qx0F7t.js';
2
2
 
3
3
  /**
4
4
  * Creates a configurable minimal preset with advanced options
@@ -0,0 +1,9 @@
1
+ import { E as ElementNode, M as MdreamRuntimeState, P as Plugin } from './mdream.C0Qx0F7t.js';
2
+
3
+ interface ExtractedElement extends ElementNode {
4
+ textContent: string;
5
+ }
6
+ declare function extractionPlugin(selectors: Record<string, (element: ExtractedElement, state: MdreamRuntimeState) => void>): Plugin;
7
+
8
+ export { extractionPlugin as e };
9
+ export type { ExtractedElement as E };
@@ -222,5 +222,5 @@ interface TagHandler {
222
222
  excludesTextNodes?: boolean;
223
223
  }
224
224
 
225
- export { ELEMENT_NODE as E, TEXT_NODE as T };
226
- export type { BufferRegion as B, HTMLToMarkdownOptions as H, MdreamProcessingState as M, Node as N, Plugin as P, PluginCreationOptions as a, ElementNode as b, TextNode as c, MdreamRuntimeState as d, NodeEvent as e, HandlerContext as f, TagHandler as g };
225
+ export { TEXT_NODE as T, ELEMENT_NODE as b };
226
+ export type { BufferRegion as B, ElementNode as E, HTMLToMarkdownOptions as H, MdreamRuntimeState as M, Node as N, Plugin as P, PluginCreationOptions as a, TextNode as c, MdreamProcessingState as d, NodeEvent as e, HandlerContext as f, TagHandler as g };
@@ -222,5 +222,5 @@ interface TagHandler {
222
222
  excludesTextNodes?: boolean;
223
223
  }
224
224
 
225
- export { ELEMENT_NODE as E, TEXT_NODE as T };
226
- export type { BufferRegion as B, HTMLToMarkdownOptions as H, MdreamProcessingState as M, Node as N, Plugin as P, PluginCreationOptions as a, ElementNode as b, TextNode as c, MdreamRuntimeState as d, NodeEvent as e, HandlerContext as f, TagHandler as g };
225
+ export { TEXT_NODE as T, ELEMENT_NODE as b };
226
+ export type { BufferRegion as B, ElementNode as E, HTMLToMarkdownOptions as H, MdreamRuntimeState as M, Node as N, Plugin as P, PluginCreationOptions as a, TextNode as c, MdreamProcessingState as d, NodeEvent as e, HandlerContext as f, TagHandler as g };
@@ -0,0 +1,9 @@
1
+ import { E as ElementNode, M as MdreamRuntimeState, P as Plugin } from './mdream.C0Qx0F7t.mjs';
2
+
3
+ interface ExtractedElement extends ElementNode {
4
+ textContent: string;
5
+ }
6
+ declare function extractionPlugin(selectors: Record<string, (element: ExtractedElement, state: MdreamRuntimeState) => void>): Plugin;
7
+
8
+ export { extractionPlugin as e };
9
+ export type { ExtractedElement as E };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mdream",
3
3
  "type": "module",
4
- "version": "0.2.6",
4
+ "version": "0.2.7",
5
5
  "description": "Ultra-performant JavaScript HTML to Markdown converter optimized for LLMs.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -29,16 +29,16 @@
29
29
  "cac": "^6.7.14"
30
30
  },
31
31
  "devDependencies": {
32
- "@antfu/eslint-config": "^4.13.2",
33
- "@types/node": "^22.15.29",
34
- "bumpp": "^10.1.1",
35
- "crawlee": "^3.13.5",
36
- "eslint": "^9.28.0",
32
+ "@antfu/eslint-config": "^4.16.1",
33
+ "@types/node": "^22.15.33",
34
+ "bumpp": "^10.2.0",
35
+ "crawlee": "^3.13.8",
36
+ "eslint": "^9.29.0",
37
37
  "llm-cost": "^1.0.5",
38
- "playwright": "^1.52.0",
38
+ "playwright": "^1.53.1",
39
39
  "typescript": "5.8.3",
40
40
  "unbuild": "^3.5.0",
41
- "vitest": "^3.1.4"
41
+ "vitest": "^3.2.4"
42
42
  },
43
43
  "scripts": {
44
44
  "flame": "pnpm build && unbuild bench/bundle && clinic flame -- node bench/bundle/dist/string.mjs 10",